/* ============================================
   西麦的旅行日记 — Travel Journal Blog
   Design: Vintage Travelogue / 手帐风
   ============================================ */

/* --- CSS Variables --- */
:root {
  --bg-primary: #faf6f0;
  --bg-secondary: #f3ece0;
  --bg-card: #fffdf9;
  --bg-card-hover: #fff8ee;
  --text-primary: #2c2417;
  --text-secondary: #6b5d4d;
  --text-muted: #9e8e78;
  --accent-warm: #c4613a;
  --accent-warm-light: #e8926e;
  --accent-teal: #3a8c7e;
  --accent-teal-light: #6bb5a6;
  --accent-gold: #c9a84c;
  --accent-gold-light: #e8d48b;
  --border-light: rgba(107, 93, 77, 0.12);
  --border-medium: rgba(107, 93, 77, 0.25);
  --shadow-sm: 0 2px 8px rgba(44, 36, 23, 0.06);
  --shadow-md: 0 4px 20px rgba(44, 36, 23, 0.1);
  --shadow-lg: 0 8px 40px rgba(44, 36, 23, 0.14);
  --radius-sm: 6px;
  --radius-md: 12px;
  --radius-lg: 20px;
  --font-display: 'ZCOOL XiaoWei', 'Noto Serif SC', serif;
  --font-body: 'Noto Serif SC', 'Georgia', serif;
  --font-mono: 'Fira Code', 'Consolas', monospace;
  --max-width: 960px;
  --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* --- Reset & Base --- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  font-family: var(--font-body);
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.8;
  min-height: 100vh;
  overflow-x: hidden;
  position: relative;
}

a {
  color: var(--accent-warm);
  text-decoration: none;
  transition: color var(--transition);
}

a:hover {
  color: var(--accent-warm-light);
}

img {
  max-width: 100%;
  display: block;
}

/* --- Film Grain Texture --- */
.grain-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  pointer-events: none;
  z-index: 9999;
  opacity: 0.025;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
  background-repeat: repeat;
  background-size: 256px;
}

/* --- Navigation --- */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  background: rgba(250, 246, 240, 0.85);
  backdrop-filter: blur(20px) saturate(1.5);
  -webkit-backdrop-filter: blur(20px) saturate(1.5);
  border-bottom: 1px solid var(--border-light);
  transition: box-shadow var(--transition);
}

.nav.scrolled {
  box-shadow: var(--shadow-sm);
}

.nav-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 24px;
  height: 68px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text-primary);
  font-family: var(--font-display);
  font-size: 1.25rem;
  transition: transform var(--transition);
}

.nav-logo:hover {
  transform: scale(1.02);
  color: var(--text-primary);
}

.logo-icon {
  font-size: 1.4rem;
  display: inline-block;
  animation: float 3s ease-in-out infinite;
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-4px); }
}

.nav-links {
  display: flex;
  gap: 8px;
}

.nav-link {
  color: var(--text-secondary);
  font-size: 0.9rem;
  padding: 6px 16px;
  border-radius: 100px;
  transition: all var(--transition);
  position: relative;
}

.nav-link:hover,
.nav-link.active {
  color: var(--accent-warm);
  background: rgba(196, 97, 58, 0.08);
}

.nav-link.active {
  font-weight: 600;
}

.nav-menu-btn {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
}

.nav-menu-btn span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--text-primary);
  border-radius: 2px;
  transition: all var(--transition);
}

.mobile-menu {
  display: none;
  flex-direction: column;
  padding: 0 24px 16px;
  gap: 4px;
}

.mobile-link {
  color: var(--text-secondary);
  font-size: 1rem;
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  transition: all var(--transition);
}

.mobile-link:hover,
.mobile-link.active {
  color: var(--accent-warm);
  background: rgba(196, 97, 58, 0.08);
}

@media (max-width: 640px) {
  .nav-links { display: none; }
  .nav-menu-btn { display: flex; }
  .mobile-menu.open { display: flex; }
}

/* --- Main Container --- */
.main {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 100px 24px 60px;
  min-height: calc(100vh - 180px);
}

/* --- Hero Section --- */
.hero {
  text-align: center;
  padding: 60px 0 48px;
  animation: fadeUp 0.8s ease-out;
}

.hero-greeting {
  font-size: 0.95rem;
  color: var(--text-muted);
  letter-spacing: 4px;
  text-transform: uppercase;
  margin-bottom: 16px;
}

.hero-title {
  font-family: var(--font-display);
  font-size: clamp(2rem, 5vw, 3.2rem);
  color: var(--text-primary);
  line-height: 1.3;
  margin-bottom: 20px;
}

.hero-title .highlight {
  color: var(--accent-warm);
  position: relative;
}

.hero-title .highlight::after {
  content: '';
  position: absolute;
  bottom: 2px;
  left: 0;
  right: 0;
  height: 8px;
  background: var(--accent-gold-light);
  opacity: 0.4;
  z-index: -1;
  border-radius: 4px;
}

.hero-subtitle {
  font-size: 1.05rem;
  color: var(--text-secondary);
  max-width: 500px;
  margin: 0 auto;
  line-height: 1.9;
}

.hero-divider {
  width: 60px;
  height: 2px;
  background: linear-gradient(90deg, var(--accent-warm), var(--accent-gold));
  margin: 32px auto 0;
  border-radius: 2px;
}

/* --- Section Headers --- */
.section-header {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 32px;
}

.section-header h2 {
  font-family: var(--font-display);
  font-size: 1.5rem;
  color: var(--text-primary);
  white-space: nowrap;
}

.section-header::after {
  content: '';
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, var(--border-medium), transparent);
}

/* --- Post Card Grid --- */
.posts-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
}

.posts-grid.featured {
  gap: 28px;
}

/* Featured Post Card */
.post-card.featured {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-md);
  transition: all var(--transition);
  border: 1px solid var(--border-light);
  animation: fadeUp 0.6s ease-out both;
}

.post-card.featured:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: rgba(196, 97, 58, 0.2);
}

.post-card.featured .post-cover {
  height: 100%;
  min-height: 300px;
  position: relative;
  overflow: hidden;
}

.post-card.featured .post-cover::after {
  content: '';
  position: absolute;
  top: 16px;
  left: 16px;
  background: var(--accent-warm);
  color: #fff;
  font-size: 0.75rem;
  padding: 3px 12px;
  border-radius: 100px;
  letter-spacing: 1px;
}

.post-card.featured .post-content {
  padding: 32px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

/* Regular Post Card */
.post-card {
  background: var(--bg-card);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: all var(--transition);
  border: 1px solid var(--border-light);
  animation: fadeUp 0.6s ease-out both;
}

.post-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
  border-color: rgba(196, 97, 58, 0.15);
}

.post-card .post-cover {
  height: 200px;
  position: relative;
  overflow: hidden;
  background: var(--bg-secondary);
}

.post-card .post-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.post-card:hover .post-cover img {
  transform: scale(1.05);
}

.post-card .post-content {
  padding: 24px;
}

.post-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
  font-size: 0.82rem;
  color: var(--text-muted);
}

.post-meta .dot {
  width: 3px;
  height: 3px;
  background: var(--text-muted);
  border-radius: 50%;
}

.post-content h3 {
  font-family: var(--font-display);
  font-size: 1.2rem;
  line-height: 1.5;
  margin-bottom: 10px;
  color: var(--text-primary);
  transition: color var(--transition);
}

.post-card:hover .post-content h3 {
  color: var(--accent-warm);
}

.post-excerpt {
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.8;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.post-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 16px;
}

.tag {
  display: inline-flex;
  align-items: center;
  font-size: 0.75rem;
  padding: 3px 10px;
  border-radius: 100px;
  background: var(--bg-secondary);
  color: var(--text-secondary);
  transition: all var(--transition);
  border: 1px solid transparent;
}

.tag:hover {
  background: rgba(196, 97, 58, 0.08);
  color: var(--accent-warm);
  border-color: rgba(196, 97, 58, 0.15);
}

/* Read more link */
.read-more {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 16px;
  font-size: 0.85rem;
  color: var(--accent-warm);
  font-weight: 600;
  transition: gap var(--transition);
}

.read-more:hover {
  gap: 10px;
}

.read-more .arrow {
  display: inline-block;
  transition: transform var(--transition);
}

.read-more:hover .arrow {
  transform: translateX(3px);
}

/* --- Post Detail --- */
.post-detail {
  animation: fadeUp 0.5s ease-out;
}

.post-detail-header {
  margin-bottom: 40px;
}

.post-detail-header .back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-bottom: 24px;
  transition: color var(--transition);
}

.post-detail-header .back-link:hover {
  color: var(--accent-warm);
}

.post-detail-title {
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 4vw, 2.6rem);
  line-height: 1.35;
  color: var(--text-primary);
  margin-bottom: 20px;
}

.post-detail-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--border-light);
  font-size: 0.88rem;
  color: var(--text-muted);
}

.post-detail-cover {
  width: 100%;
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin-bottom: 40px;
  box-shadow: var(--shadow-md);
  aspect-ratio: 16/9;
  background: var(--bg-secondary);
}

.post-detail-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Markdown Content Styles */
.markdown-body {
  font-size: 1.02rem;
  line-height: 2;
  color: var(--text-primary);
}

.markdown-body h1,
.markdown-body h2,
.markdown-body h3,
.markdown-body h4,
.markdown-body h5,
.markdown-body h6 {
  font-family: var(--font-display);
  color: var(--text-primary);
  margin-top: 2em;
  margin-bottom: 0.8em;
  line-height: 1.4;
}

.markdown-body h1 { font-size: 1.8rem; }
.markdown-body h2 {
  font-size: 1.5rem;
  padding-bottom: 0.4em;
  border-bottom: 1px solid var(--border-light);
}
.markdown-body h3 { font-size: 1.25rem; }
.markdown-body h4 { font-size: 1.1rem; }

.markdown-body p {
  margin-bottom: 1.2em;
}

.markdown-body blockquote {
  margin: 1.5em 0;
  padding: 16px 24px;
  border-left: 3px solid var(--accent-warm);
  background: rgba(196, 97, 58, 0.04);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  color: var(--text-secondary);
  font-style: italic;
}

.markdown-body blockquote p {
  margin-bottom: 0;
}

.markdown-body ul,
.markdown-body ol {
  margin: 1em 0;
  padding-left: 1.8em;
}

.markdown-body li {
  margin-bottom: 0.4em;
}

.markdown-body li::marker {
  color: var(--accent-warm);
}

.markdown-body img {
  border-radius: var(--radius-md);
  margin: 2em 0;
  box-shadow: var(--shadow-sm);
}

.markdown-body a {
  color: var(--accent-warm);
  border-bottom: 1px solid rgba(196, 97, 58, 0.3);
  transition: border-color var(--transition);
}

.markdown-body a:hover {
  border-color: var(--accent-warm);
}

.markdown-body code {
  font-family: var(--font-mono);
  font-size: 0.88em;
  padding: 2px 8px;
  background: rgba(58, 140, 126, 0.08);
  color: var(--accent-teal);
  border-radius: 4px;
}

.markdown-body pre {
  margin: 1.5em 0;
  padding: 20px 24px;
  background: #1e1e2e;
  border-radius: var(--radius-md);
  overflow-x: auto;
  box-shadow: var(--shadow-md);
}

.markdown-body pre code {
  background: none;
  color: #cdd6f4;
  padding: 0;
  font-size: 0.85rem;
  line-height: 1.7;
}

.markdown-body hr {
  border: none;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--border-medium), transparent);
  margin: 2em 0;
}

.markdown-body table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5em 0;
  font-size: 0.92rem;
}

.markdown-body th,
.markdown-body td {
  padding: 10px 14px;
  border: 1px solid var(--border-light);
  text-align: left;
}

.markdown-body th {
  background: var(--bg-secondary);
  font-weight: 600;
  color: var(--text-primary);
}

/* --- Tags Page --- */
.tags-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  padding: 20px 0;
}

.tag-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 18px;
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: 100px;
  font-size: 0.9rem;
  color: var(--text-secondary);
  transition: all var(--transition);
  box-shadow: var(--shadow-sm);
}

.tag-item:hover {
  background: rgba(196, 97, 58, 0.06);
  border-color: rgba(196, 97, 58, 0.25);
  color: var(--accent-warm);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.tag-count {
  font-size: 0.75rem;
  background: var(--bg-secondary);
  color: var(--text-muted);
  padding: 1px 8px;
  border-radius: 100px;
  transition: all var(--transition);
}

.tag-item:hover .tag-count {
  background: rgba(196, 97, 58, 0.12);
  color: var(--accent-warm);
}

.tag-posts {
  margin-top: 48px;
}

/* --- About Page --- */
.about-page {
  animation: fadeUp 0.5s ease-out;
}

.about-hero {
  text-align: center;
  padding: 40px 0;
}

.about-avatar {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent-warm), var(--accent-gold));
  margin: 0 auto 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3rem;
  box-shadow: 0 8px 30px rgba(196, 97, 58, 0.25);
  position: relative;
}

.about-avatar::after {
  content: '';
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  border: 2px dashed var(--accent-gold-light);
  animation: spin 20s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.about-name {
  font-family: var(--font-display);
  font-size: 1.8rem;
  margin-bottom: 8px;
}

.about-bio {
  color: var(--text-secondary);
  font-size: 1rem;
  margin-bottom: 4px;
}

.about-location {
  color: var(--text-muted);
  font-size: 0.9rem;
}

.about-content {
  display: grid;
  gap: 40px;
  margin-top: 40px;
}

.about-section {
  background: var(--bg-card);
  border-radius: var(--radius-md);
  padding: 32px;
  border: 1px solid var(--border-light);
  box-shadow: var(--shadow-sm);
}

.about-section h3 {
  font-family: var(--font-display);
  font-size: 1.2rem;
  margin-bottom: 16px;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 8px;
}

.about-section p {
  color: var(--text-secondary);
  line-height: 1.9;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 16px;
}

.stat-card {
  text-align: center;
  padding: 20px;
  background: var(--bg-secondary);
  border-radius: var(--radius-md);
  transition: transform var(--transition);
}

.stat-card:hover {
  transform: translateY(-2px);
}

.stat-number {
  font-family: var(--font-display);
  font-size: 1.8rem;
  color: var(--accent-warm);
  display: block;
}

.stat-label {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-top: 4px;
}

.timeline {
  position: relative;
  padding-left: 24px;
}

.timeline::before {
  content: '';
  position: absolute;
  left: 6px;
  top: 8px;
  bottom: 8px;
  width: 2px;
  background: linear-gradient(180deg, var(--accent-warm), var(--accent-teal), var(--accent-gold));
  border-radius: 2px;
}

.timeline-item {
  position: relative;
  padding-bottom: 20px;
}

.timeline-item:last-child {
  padding-bottom: 0;
}

.timeline-item::before {
  content: '';
  position: absolute;
  left: -21px;
  top: 8px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--accent-warm);
  border: 2px solid var(--bg-card);
  box-shadow: 0 0 0 3px rgba(196, 97, 58, 0.2);
}

.timeline-item:nth-child(2)::before { background: var(--accent-teal); box-shadow: 0 0 0 3px rgba(58, 140, 126, 0.2); }
.timeline-item:nth-child(3)::before { background: var(--accent-gold); box-shadow: 0 0 0 3px rgba(201, 168, 76, 0.2); }

.timeline-date {
  font-size: 0.82rem;
  color: var(--accent-warm);
  font-weight: 600;
  margin-bottom: 4px;
}

.timeline-item:nth-child(2) .timeline-date { color: var(--accent-teal); }
.timeline-item:nth-child(3) .timeline-date { color: var(--accent-gold); }

.timeline-text {
  color: var(--text-secondary);
  font-size: 0.92rem;
}

/* --- Pagination --- */
.pagination {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 48px;
}

.pagination-btn {
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  color: var(--text-secondary);
  font-size: 0.88rem;
  cursor: pointer;
  transition: all var(--transition);
  font-family: var(--font-body);
}

.pagination-btn:hover {
  background: rgba(196, 97, 58, 0.06);
  border-color: rgba(196, 97, 58, 0.2);
  color: var(--accent-warm);
}

.pagination-btn.active {
  background: var(--accent-warm);
  border-color: var(--accent-warm);
  color: #fff;
}

.pagination-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* --- Footer --- */
.footer {
  background: var(--bg-secondary);
  border-top: 1px solid var(--border-light);
  padding: 40px 24px;
  text-align: center;
}

.footer-quote {
  font-family: var(--font-display);
  font-size: 0.95rem;
  color: var(--text-secondary);
  margin-bottom: 12px;
}

.footer-copy {
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* --- Empty State --- */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-muted);
}

.empty-state .empty-icon {
  font-size: 3rem;
  margin-bottom: 16px;
  opacity: 0.6;
}

.empty-state p {
  font-size: 1rem;
}

/* --- Animations --- */
@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(24px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

:root {
  --bg-muted: #e8e0d4;
}

.post-card:nth-child(2) { animation-delay: 0.1s; }
.post-card:nth-child(3) { animation-delay: 0.2s; }
.post-card:nth-child(4) { animation-delay: 0.15s; }
.post-card:nth-child(5) { animation-delay: 0.25s; }
.post-card:nth-child(6) { animation-delay: 0.2s; }

/* --- Responsive --- */
@media (max-width: 768px) {
  .post-card.featured {
    grid-template-columns: 1fr;
  }
  .post-card.featured .post-cover {
    min-height: 200px;
  }
  .about-section {
    padding: 24px;
  }
  .hero {
    padding: 40px 0 32px;
  }
}

@media (max-width: 480px) {
  .main {
    padding: 88px 16px 40px;
  }
  .hero-title {
    font-size: 1.7rem;
  }
  .post-detail-title {
    font-size: 1.5rem;
  }
  .post-card .post-content {
    padding: 20px;
  }
}

/* --- Scrollbar --- */
::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: var(--bg-primary);
}

::-webkit-scrollbar-thumb {
  background: var(--border-medium);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--text-muted);
}

/* --- Page transition --- */
.page-enter {
  animation: fadeUp 0.4s ease-out;
}

/* --- Loading Skeleton --- */
.skeleton {
  background: linear-gradient(90deg, var(--bg-secondary) 25%, rgba(243, 236, 224, 0.4) 50%, var(--bg-secondary) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: var(--radius-sm);
}

@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ============================================
   Admin Panel Styles
   ============================================ */

/* --- Login Page --- */
.admin-login {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 60vh;
}

.login-card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 48px 40px;
  text-align: center;
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border-light);
  max-width: 400px;
  width: 100%;
}

.login-avatar {
  font-size: 3rem;
  margin-bottom: 16px;
}

.login-card h2 {
  font-family: var(--font-display);
  font-size: 1.5rem;
  margin-bottom: 4px;
}

.login-subtitle {
  color: var(--text-muted);
  font-size: 0.88rem;
  margin-bottom: 32px;
}

.login-form .form-group {
  text-align: left;
  margin-bottom: 16px;
}

.login-form label {
  display: block;
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-bottom: 6px;
  font-weight: 600;
}

.login-form input {
  width: 100%;
  padding: 12px 16px;
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-sm);
  font-size: 0.95rem;
  font-family: var(--font-body);
  background: var(--bg-primary);
  color: var(--text-primary);
  transition: border-color var(--transition);
  outline: none;
}

.login-form input:focus {
  border-color: var(--accent-warm);
  box-shadow: 0 0 0 3px rgba(196, 97, 58, 0.1);
}

.login-error {
  color: var(--accent-warm);
  font-size: 0.85rem;
  margin-bottom: 12px;
}

.back-to-blog {
  display: inline-block;
  margin-top: 20px;
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* --- Buttons --- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 20px;
  border-radius: var(--radius-sm);
  font-size: 0.88rem;
  font-family: var(--font-body);
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
  border: none;
  text-decoration: none;
}

.btn-primary {
  background: var(--accent-warm);
  color: #fff;
}

.btn-primary:hover {
  background: var(--accent-warm-light);
  color: #fff;
}

.btn-outline {
  background: transparent;
  border: 1px solid var(--border-medium);
  color: var(--text-secondary);
}

.btn-outline:hover {
  border-color: var(--accent-warm);
  color: var(--accent-warm);
}

.btn-danger {
  background: transparent;
  border: 1px solid var(--accent-warm);
  color: var(--accent-warm);
}

.btn-danger:hover {
  background: var(--accent-warm);
  color: #fff;
}

.btn-block {
  width: 100%;
}

/* --- Admin Layout --- */
.admin-layout {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 0;
  min-height: calc(100vh - 180px);
}

.admin-sidebar {
  background: var(--bg-card);
  border-right: 1px solid var(--border-light);
  padding: 24px 0;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 68px;
  height: calc(100vh - 68px);
}

.sidebar-header {
  padding: 0 20px 24px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.sidebar-logo {
  font-size: 1.5rem;
}

.sidebar-title {
  font-family: var(--font-display);
  font-size: 1.1rem;
  color: var(--text-primary);
}

.sidebar-nav {
  flex: 1;
  padding: 0 12px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: 0.9rem;
  text-decoration: none;
  transition: all var(--transition);
}

.sidebar-link:hover {
  background: var(--bg-secondary);
  color: var(--text-primary);
}

.sidebar-link.active {
  background: rgba(196, 97, 58, 0.08);
  color: var(--accent-warm);
  font-weight: 600;
}

.sidebar-icon {
  font-size: 1rem;
  width: 20px;
  text-align: center;
}

.sidebar-footer {
  padding: 16px 12px;
  border-top: 1px solid var(--border-light);
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.sidebar-logout {
  color: var(--accent-warm) !important;
}

.sidebar-logout:hover {
  background: rgba(196, 97, 58, 0.08) !important;
}

/* --- Admin Content --- */
.admin-content {
  padding: 32px;
  max-width: 100%;
  overflow-x: auto;
}

.admin-view {
  max-width: 960px;
}

.admin-view-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 28px;
  flex-wrap: wrap;
  gap: 12px;
}

.admin-view-header h2 {
  font-family: var(--font-display);
  font-size: 1.4rem;
  color: var(--text-primary);
}

.admin-count {
  font-size: 0.85rem;
  color: var(--text-muted);
  font-weight: 400;
  margin-left: 8px;
  font-family: var(--font-body);
}

.header-actions {
  display: flex;
  gap: 8px;
}

/* --- Dashboard Stats --- */
.dashboard-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 32px;
}

.dash-stat {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  box-shadow: var(--shadow-sm);
}

.dash-stat-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  flex-shrink: 0;
}

.dash-stat-num {
  font-family: var(--font-display);
  font-size: 1.5rem;
  color: var(--text-primary);
  display: block;
}

.dash-stat-label {
  font-size: 0.82rem;
  color: var(--text-muted);
}

/* --- Dashboard Sections --- */
.dashboard-section {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 24px;
  margin-bottom: 24px;
  box-shadow: var(--shadow-sm);
}

.dashboard-section h3 {
  font-family: var(--font-display);
  font-size: 1.1rem;
  margin-bottom: 16px;
  color: var(--text-primary);
}

.dashboard-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.dashboard-tag-item {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

/* --- Admin Table --- */
.admin-table-wrap {
  overflow-x: auto;
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}

.admin-table th {
  text-align: left;
  padding: 12px 16px;
  font-size: 0.78rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-bottom: 1px solid var(--border-light);
  font-weight: 600;
  white-space: nowrap;
}

.admin-table td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border-light);
  vertical-align: middle;
}

.admin-table tr:hover {
  background: var(--bg-secondary);
}

.table-post-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
  color: var(--text-primary);
  max-width: 280px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.table-thumb {
  width: 40px;
  height: 28px;
  object-fit: cover;
  border-radius: 4px;
  flex-shrink: 0;
}

.table-date {
  color: var(--text-muted);
  white-space: nowrap;
}

.table-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.table-actions {
  display: flex;
  gap: 12px;
  white-space: nowrap;
}

.table-action {
  font-size: 0.82rem;
  color: var(--text-secondary);
  text-decoration: none;
  transition: color var(--transition);
}

.table-action:hover {
  color: var(--accent-warm);
}

/* --- Post Editor --- */
.post-editor {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 24px;
}

.editor-main .form-group {
  margin-bottom: 20px;
}

.editor-main label {
  display: block;
  font-size: 0.88rem;
  color: var(--text-primary);
  font-weight: 600;
  margin-bottom: 8px;
}

.form-hint {
  font-weight: 400;
  color: var(--text-muted);
  font-size: 0.82rem;
}

.editor-main input,
.editor-main textarea {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-sm);
  font-size: 0.92rem;
  font-family: var(--font-body);
  background: var(--bg-card);
  color: var(--text-primary);
  transition: border-color var(--transition);
  outline: none;
  resize: vertical;
}

.editor-main input:focus,
.editor-main textarea:focus {
  border-color: var(--accent-warm);
  box-shadow: 0 0 0 3px rgba(196, 97, 58, 0.08);
}

.editor-main textarea {
  line-height: 1.7;
}

.editor-main textarea#editorContent {
  font-family: var(--font-mono);
  font-size: 0.88rem;
  line-height: 1.8;
}

.editor-sidebar .editor-card {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 20px;
  margin-bottom: 16px;
  box-shadow: var(--shadow-sm);
}

.editor-sidebar .editor-card h4 {
  font-size: 0.9rem;
  color: var(--text-primary);
  margin-bottom: 14px;
  font-weight: 600;
}

.editor-sidebar .form-group {
  margin-bottom: 12px;
}

.editor-sidebar label {
  display: block;
  font-size: 0.82rem;
  color: var(--text-secondary);
  margin-bottom: 6px;
  font-weight: 600;
}

.editor-sidebar input[type="text"],
.editor-sidebar input[type="url"],
.editor-sidebar input[type="date"],
.editor-sidebar input[type="password"] {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-sm);
  font-size: 0.88rem;
  font-family: var(--font-body);
  background: var(--bg-primary);
  color: var(--text-primary);
  outline: none;
  transition: border-color var(--transition);
}

.editor-sidebar input:focus {
  border-color: var(--accent-warm);
}

.checkbox-label {
  display: flex !important;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-size: 0.88rem !important;
  color: var(--text-secondary) !important;
  font-weight: 400 !important;
}

.checkbox-label input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--accent-warm);
}

.cover-preview {
  margin-top: 10px;
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.cover-preview img {
  width: 100%;
  height: 120px;
  object-fit: cover;
}

/* --- Editor Toolbar & Media Upload --- */
.editor-toolbar {
  display: flex;
  gap: 8px;
  margin-bottom: 8px;
}

.toolbar-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  font-size: 0.85rem;
  font-family: var(--font-body);
  color: var(--text-secondary);
  background: var(--bg-secondary);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.2s;
}

.toolbar-btn:hover {
  background: var(--accent-teal);
  color: #fff;
  border-color: var(--accent-teal);
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}

/* 上传进度遮罩 */
.media-upload-overlay {
  display: flex;
  align-items: center;
  justify-content: center;
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(44, 36, 23, 0.5);
  z-index: 10001;
  backdrop-filter: blur(4px);
}

.media-upload-dialog {
  background: var(--bg-card);
  border-radius: var(--radius-md);
  padding: 32px 40px;
  box-shadow: var(--shadow-lg);
  text-align: center;
  min-width: 320px;
}

.upload-title {
  font-size: 1rem;
  color: var(--text-primary);
  margin-bottom: 16px;
  font-weight: 500;
}

.upload-progress-bar {
  width: 100%;
  height: 8px;
  background: var(--bg-secondary);
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 8px;
}

.upload-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent-teal), var(--accent-teal-light));
  border-radius: 4px;
  transition: width 0.3s ease;
  width: 0%;
}

.upload-percent {
  font-size: 0.85rem;
  color: var(--text-secondary);
}

/* 博客文章内视频样式 */
.post-content video {
  width: 100%;
  border-radius: var(--radius-md);
  margin: 16px 0;
  background: #000;
}

/* --- Tags Manager --- */
.tags-manager {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.tag-manage-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  transition: all var(--transition);
}

.tag-manage-item:hover {
  border-color: rgba(196, 97, 58, 0.2);
  box-shadow: var(--shadow-sm);
}

.tag-manage-info {
  display: flex;
  align-items: center;
  gap: 12px;
}

.tag-manage-actions {
  display: flex;
  gap: 12px;
}

/* --- Settings --- */
.settings-section {
  margin-bottom: 32px;
}

.settings-section h3 {
  font-family: var(--font-display);
  font-size: 1.1rem;
  color: var(--text-primary);
  margin-bottom: 16px;
}

.settings-desc {
  color: var(--text-secondary);
  font-size: 0.9rem;
  margin-bottom: 16px;
  line-height: 1.6;
}

.settings-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.settings-info {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.info-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px solid var(--border-light);
  font-size: 0.9rem;
}

.info-row span:first-child {
  color: var(--text-muted);
}

.info-row strong,
.info-row a {
  color: var(--text-primary);
}

/* --- Admin Responsive --- */
@media (max-width: 900px) {
  .admin-layout {
    grid-template-columns: 1fr;
  }
  .admin-sidebar {
    position: relative;
    top: 0;
    height: auto;
    flex-direction: row;
    align-items: center;
    padding: 12px 16px;
    overflow-x: auto;
    gap: 4px;
    border-right: none;
    border-bottom: 1px solid var(--border-light);
  }
  .sidebar-header {
    padding: 0 12px 0 0;
    white-space: nowrap;
  }
  .sidebar-nav {
    flex-direction: row;
    padding: 0 4px;
    gap: 2px;
  }
  .sidebar-footer {
    display: none;
  }
  .sidebar-link {
    white-space: nowrap;
    padding: 8px 12px;
    font-size: 0.82rem;
  }
  .post-editor {
    grid-template-columns: 1fr;
  }
  .dashboard-stats {
    grid-template-columns: repeat(2, 1fr);
  }
  .admin-content {
    padding: 20px 16px;
  }
}

@media (max-width: 480px) {
  .dashboard-stats {
    grid-template-columns: 1fr;
  }
  .login-card {
    margin: 0 16px;
    padding: 32px 24px;
  }
}
