/* ===== 全局样式 ===== */
:root {
  --primary: #8B2500;
  --primary-foreground: #FFF8F0;
  --background: #FAF6F1;
  --foreground: #2C1810;
  --secondary: #D4A574;
  --card: #FFFFFF;
  --border: #E8DDD0;
  --accent: #C4463A;
  --muted: #8B7355;
}

body {
  background-color: var(--background);
  color: var(--foreground);
  line-height: 1.75;
}

/* 导航链接 */
.nav-link {
  color: var(--muted);
  text-decoration: none;
  font-size: 0.95rem;
  transition: color 0.3s ease;
  position: relative;
}
.nav-link:hover, .nav-link.active {
  color: var(--primary);
}
.nav-link.active::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--primary);
  border-radius: 1px;
}

/* 卡片悬停 */
.article-card {
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.article-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 25px rgba(139, 37, 0, 0.1);
}

/* 徽章 */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 10px;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 600;
}
.badge-read { background: #E8F5E9; color: #2E7D32; }
.badge-unread { background: #FFF3E0; color: #E65100; }

/* 按钮基础 */
.btn-primary {
  background: var(--primary);
  color: var(--primary-foreground);
  padding: 8px 20px;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  font-weight: 600;
  transition: all 0.3s ease;
}
.btn-primary:hover { opacity: 0.9; }
.btn-primary:disabled { opacity: 0.5; cursor: not-allowed; }

.btn-outline {
  background: transparent;
  color: var(--primary);
  padding: 8px 20px;
  border-radius: 8px;
  border: 1.5px solid var(--primary);
  cursor: pointer;
  font-weight: 600;
  transition: all 0.3s ease;
}
.btn-outline:hover { background: var(--primary); color: var(--primary-foreground); }

.btn-ghost {
  background: transparent;
  color: var(--muted);
  padding: 6px 12px;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  transition: all 0.3s ease;
}
.btn-ghost:hover { color: var(--primary); background: rgba(139, 37, 0, 0.06); }
.btn-ghost.active { color: var(--accent); }

/* 输入框 */
.input-field {
  width: 100%;
  padding: 10px 14px;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  background: var(--background);
  color: var(--foreground);
  font-size: 0.95rem;
  outline: none;
  transition: border-color 0.3s ease;
}
.input-field:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(139, 37, 0, 0.1);
}

textarea.input-field {
  resize: vertical;
  min-height: 100px;
  line-height: 1.75;
}

/* 金句样式 */
.quote-card {
  border-left: 4px solid var(--accent);
  padding-left: 16px;
}
.quote-text {
  font-family: "ZCOOL XiaoWei", serif;
  font-size: 1.15rem;
  line-height: 1.9;
  color: var(--foreground);
}

/* 正文字体 */
.article-content p {
  text-indent: 2em;
  margin-bottom: 1em;
  line-height: 1.9;
}

/* 封面渐变色 */
.cover-1 { background: linear-gradient(135deg, #8B2500 0%, #C4463A 50%, #D4A574 100%); }
.cover-2 { background: linear-gradient(135deg, #5D3A1A 0%, #8B7355 50%, #D4A574 100%); }
.cover-3 { background: linear-gradient(135deg, #2C1810 0%, #8B2500 50%, #C4463A 100%); }
.cover-4 { background: linear-gradient(135deg, #8B4513 0%, #D4A574 50%, #FAF6F1 100%); }
.cover-5 { background: linear-gradient(135deg, #6B3A2A 0%, #8B7355 50%, #C4463A 100%); }
.cover-6 { background: linear-gradient(135deg, #8B2500 0%, #A0522D 50%, #D4A574 100%); }

/* 公告栏 */
.announcement-bar {
  background: linear-gradient(90deg, rgba(139, 37, 0, 0.06) 0%, rgba(196, 70, 58, 0.06) 100%);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 16px;
}

/* Tab 切换 */
.tab-btn {
  padding: 8px 20px;
  border: none;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-weight: 600;
  border-bottom: 2px solid transparent;
  transition: all 0.3s ease;
}
.tab-btn.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
}
.tab-btn:hover { color: var(--primary); }

/* Toast 通知 */
.toast {
  position: fixed;
  top: 80px;
  right: 20px;
  z-index: 200;
  padding: 12px 24px;
  border-radius: 10px;
  background: var(--card);
  border: 1px solid var(--border);
  box-shadow: 0 4px 20px rgba(0,0,0,0.1);
  font-size: 0.9rem;
  animation: slideIn 0.3s ease, fadeOut 0.3s ease 2.7s;
  pointer-events: none;
}
.toast.success { border-left: 4px solid #2E7D32; }
.toast.error { border-left: 4px solid #C4463A; }

@keyframes slideIn {
  from { transform: translateX(100px); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}
@keyframes fadeOut {
  from { opacity: 1; }
  to { opacity: 0; }
}

/* 加载动画 */
.loading {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 40px;
  color: var(--muted);
}
.loading::after {
  content: '';
  width: 24px;
  height: 24px;
  border: 3px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin-left: 10px;
}
@keyframes spin {
  to { transform: rotate(360deg); }
}
