/* 夜间模式样式 - 三大网站通用 */

/* 默认浅色主题 */
:root {
  --bg-primary: #F8F6F1;
  --bg-card: #FFFFFF;
  --text-primary: #3D3D3D;
  --text-secondary: #6B6B6B;
  --accent: #7BA05B;
  --accent-light: #A8C69F;
  --border: #E8E6E1;
  --shadow: rgba(0,0,0,0.05);
  --nav-bg: rgba(248,246,241,0.95);
}

/* 深色主题 */
[data-theme="dark"] {
  --bg-primary: #1a1a1a;
  --bg-card: #2d2d2d;
  --text-primary: #e8e8e8;
  --text-secondary: #b0b0b0;
  --accent: #8BC34A;
  --accent-light: #7BA05B;
  --border: #404040;
  --shadow: rgba(0,0,0,0.3);
  --nav-bg: rgba(26,26,26,0.95);
}

/* 平滑过渡 */
body,
.navbar,
.hero,
.card,
.section-block {
  transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease;
}

/* 导航栏夜间模式 */
[data-theme="dark"] .navbar {
  background: var(--nav-bg);
  border-bottom-color: var(--border);
}

[data-theme="dark"] .nav-links a {
  color: var(--text-secondary);
}

[data-theme="dark"] .nav-links a:hover,
[data-theme="dark"] .nav-links a.active {
  color: var(--accent);
}

/* Hero区域夜间模式 */
[data-theme="dark"] .hero {
  background: linear-gradient(135deg, #1a1a1a 0%, #2d2d2d 100%);
}

[data-theme="dark"] .hero h1 {
  color: var(--text-primary);
}

[data-theme="dark"] .hero p {
  color: var(--text-secondary);
}

/* 卡片夜间模式 */
[data-theme="dark"] .card,
[data-theme="dark"] .article-card,
[data-theme="dark"] .category-link,
[data-theme="dark"] .zen-entrance-card {
  background: var(--bg-card);
  border-color: var(--border);
  color: var(--text-primary);
}

[data-theme="dark"] .card:hover,
[data-theme="dark"] .article-card:hover,
[data-theme="dark"] .category-link:hover,
[data-theme="dark"] .zen-entrance-card:hover {
  box-shadow: 0 12px 40px var(--shadow);
}

[data-theme="dark"] .card h3,
[data-theme="dark"] .article-card h3,
[data-theme="dark"] .category-link h3 {
  color: var(--text-primary);
}

[data-theme="dark"] .card p,
[data-theme="dark"] .article-card p,
[data-theme="dark"] .category-link p {
  color: var(--text-secondary);
}

/* 内容区块夜间模式 */
[data-theme="dark"] .section-block.alt {
  background: rgba(45,45,45,0.5);
}

[data-theme="dark"] .section-header h2 {
  color: var(--text-primary);
}

[data-theme="dark"] .section-header p {
  color: var(--text-secondary);
}

/* 表格夜间模式 */
[data-theme="dark"] table {
  background: var(--bg-card);
  border-color: var(--border);
}

[data-theme="dark"] th {
  background: var(--accent);
  color: white;
}

[data-theme="dark"] td {
  border-color: var(--border);
  color: var(--text-primary);
}

[data-theme="dark"] tr:hover {
  background: rgba(123,160,91,0.1);
}

/* 表单夜间模式 */
[data-theme="dark"] input,
[data-theme="dark"] select,
[data-theme="dark"] textarea {
  background: var(--bg-card);
  border-color: var(--border);
  color: var(--text-primary);
}

[data-theme="dark"] input:focus,
[data-theme="dark"] select:focus,
[data-theme="dark"] textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(123,160,91,0.1);
}

/* 按钮夜间模式 */
[data-theme="dark"] .btn-primary,
[data-theme="dark"] .btn-secondary {
  background: var(--accent);
  color: white;
}

[data-theme="dark"] .btn-secondary {
  background: transparent;
  border-color: var(--accent);
  color: var(--accent);
}

/* 主题切换按钮 */
.theme-toggle {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  width: 3.5rem;
  height: 3.5rem;
  border-radius: 50%;
  background: var(--accent);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 20px rgba(0,0,0,0.2);
  z-index: 1000;
  transition: all 0.3s ease;
}

.theme-toggle:hover {
  transform: scale(1.1);
  box-shadow: 0 6px 30px rgba(0,0,0,0.3);
}

.theme-toggle svg {
  width: 1.5rem;
  height: 1.5rem;
  fill: white;
}

.theme-toggle .sun-icon,
.theme-toggle .moon-icon {
  transition: opacity 0.3s ease;
}

[data-theme="dark"] .theme-toggle .sun-icon {
  opacity: 1;
}

[data-theme="dark"] .theme-toggle .moon-icon {
  opacity: 0;
}

.theme-toggle .sun-icon {
  opacity: 0;
}

.theme-toggle .moon-icon {
  opacity: 1;
}

/* 回到顶部按钮 */
.back-to-top {
  position: fixed;
  bottom: 6rem;
  right: 2rem;
  width: 3rem;
  height: 3rem;
  border-radius: 50%;
  background: var(--accent);
  color: white;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 20px rgba(0,0,0,0.2);
  z-index: 999;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
}

.back-to-top.visible {
  opacity: 1;
  visibility: visible;
}

.back-to-top:hover {
  transform: translateY(-4px);
  box-shadow: 0 6px 30px rgba(0,0,0,0.3);
}

.back-to-top svg {
  width: 1.25rem;
  height: 1.25rem;
}

/* 空状态样式 */
.empty-state {
  text-align: center;
  padding: 4rem 2rem;
  background: var(--bg-card);
  border-radius: 8px;
  border: 2px dashed var(--border);
  margin: 2rem 0;
}

.empty-state-icon {
  font-size: 4rem;
  margin-bottom: 1.5rem;
  opacity: 0.5;
}

.empty-state h3 {
  font-size: 1.25rem;
  margin-bottom: 1rem;
  color: var(--text-primary);
}

.empty-state p {
  color: var(--text-secondary);
  margin-bottom: 1.5rem;
  line-height: 1.8;
}

.empty-state-actions {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
}

.empty-state-actions .btn {
  padding: 0.75rem 1.5rem;
  border-radius: 6px;
  font-size: 0.95rem;
  cursor: pointer;
  border: none;
  transition: all 0.3s ease;
}

.empty-state-actions .btn-primary {
  background: var(--accent);
  color: white;
}

.empty-state-actions .btn-secondary {
  background: transparent;
  border: 2px solid var(--accent);
  color: var(--accent);
}

.empty-state-actions .btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 20px rgba(0,0,0,0.1);
}
