/* 亮色主题 + 主题切换按钮
   默认深色（html 无 data-theme 时按深色处理），亮色只在 [data-theme="light"] 下生效 */

html[data-theme="light"] {
  --bg: #eef2f8;
  --surface: rgba(255, 255, 255, .72);
  --surface-hover: #ffffff;
  --surface-solid: #ffffff;
  --fg: #0d1b2e;
  --fg-2: #44556e;
  --fg-3: #74849b;
  --line: rgba(24, 54, 96, .13);
  --line-strong: rgba(37, 99, 235, .42);
  --accent: #1d4ed8;
  --accent-2: #2563eb;
  --shadow-lg: 0 18px 48px rgba(24, 54, 96, .12);
}

html[data-theme="light"] body {
  background:
    radial-gradient(1000px 560px at 12% -8%, rgba(37, 99, 235, .10), transparent 62%),
    radial-gradient(760px 460px at 88% 2%, rgba(14, 165, 233, .09), transparent 58%),
    radial-gradient(900px 620px at 50% 112%, rgba(37, 99, 235, .06), transparent 60%),
    #eef2f8;
  color: var(--fg);
}

html[data-theme="light"] body::before {
  background-image:
    linear-gradient(rgba(24, 54, 96, .045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(24, 54, 96, .045) 1px, transparent 1px);
}

html[data-theme="light"] ::selection {
  background: rgba(37, 99, 235, .16);
  color: #0d1b2e;
}

html[data-theme="light"] .cursor-glow {
  background: radial-gradient(circle, rgba(37, 99, 235, .07) 0%, rgba(37, 99, 235, .04) 42%, transparent 70%);
}

/* 标题原本是白色渐变字，白底上必须换掉 */
html[data-theme="light"] h1 {
  background: linear-gradient(180deg, #0d1b2e 30%, #27476e);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: #0d1b2e;
}

html[data-theme="light"] .accent-bar {
  background: linear-gradient(90deg, #1d4ed8, #2563eb);
  box-shadow: 0 0 14px rgba(37, 99, 235, .26);
}

/* 导航 */
html[data-theme="light"] .site-nav {
  background: rgba(255, 255, 255, .78);
  border-color: rgba(24, 54, 96, .10);
  border-bottom-color: rgba(24, 54, 96, .18);
  box-shadow: 0 10px 30px rgba(24, 54, 96, .08);
}

html[data-theme="light"] .nav-brand { color: #0d1b2e; }
html[data-theme="light"] .nav-brand svg { color: #3d4f68; }
html[data-theme="light"] .nav-brand:hover svg { color: #0d1b2e; }
html[data-theme="light"] .nav-links a { color: #5f7089; }
html[data-theme="light"] .nav-links a:hover { color: #0d1b2e; }

/* 卡片 */
html[data-theme="light"] .card {
  background: rgba(255, 255, 255, .72);
  border-color: rgba(24, 54, 96, .10);
}

html[data-theme="light"] .card::after {
  background: radial-gradient(260px circle at var(--mx, 50%) var(--my, 50%), rgba(37, 99, 235, .07), transparent 62%);
}

html[data-theme="light"] .card:hover {
  background: #ffffff;
  border-color: rgba(37, 99, 235, .32);
  box-shadow: 0 14px 36px rgba(24, 54, 96, .11);
}

html[data-theme="light"] .card p { color: #61728c; }

/* 照片：边框与卡片底 */
html[data-theme="light"] .photo,
html[data-theme="light"] .strip a,
html[data-theme="light"] .feature-photo {
  border-color: rgba(24, 54, 96, .12);
  background: rgba(255, 255, 255, .6);
}

html[data-theme="light"] .photo:hover,
html[data-theme="light"] .feature-photo:hover {
  border-color: rgba(37, 99, 235, .38);
  box-shadow: 0 16px 40px rgba(24, 54, 96, .14);
}

/* 图注压在照片上，仍需深色渐变保证可读 */
html[data-theme="light"] .photo .cap {
  background: linear-gradient(transparent, rgba(6, 16, 32, .78));
  color: #f2f6fb;
}

html[data-theme="light"] .photo .cap span { color: rgba(242, 246, 251, .72); }

/* 区块标题链接 */
html[data-theme="light"] .section-head a,
html[data-theme="light"] .card .more { color: #5f7089; }

html[data-theme="light"] .section-head a:hover,
html[data-theme="light"] .card:hover .more { color: #0d1b2e; }

/* 引言 */
html[data-theme="light"] .quote blockquote { color: #44556e; }
html[data-theme="light"] .quote figcaption { color: #74849b; }

/* 月历 */
html[data-theme="light"] .calendar {
  background: rgba(255, 255, 255, .72);
  border-color: rgba(24, 54, 96, .10);
}

html[data-theme="light"] .cal-title { color: #0d1b2e; }
html[data-theme="light"] .cal-dow { color: #74849b; }
html[data-theme="light"] .cal-day { color: #44556e; }
html[data-theme="light"] .cal-day.is-weekend { color: #74849b; }
html[data-theme="light"] .cal-day.is-other { color: rgba(116, 132, 155, .42); }

html[data-theme="light"] .cal-day.is-today {
  color: #ffffff;
  box-shadow: 0 4px 14px rgba(37, 99, 235, .26);
}

html[data-theme="light"] .cal-nav button {
  border-color: rgba(24, 54, 96, .14);
  color: #5f7089;
}

html[data-theme="light"] .cal-nav button:hover {
  border-color: rgba(37, 99, 235, .4);
  color: #1d4ed8;
  background: rgba(37, 99, 235, .07);
}

/* 栏目页 */
html[data-theme="light"] .page-desc { color: #44556e; }
html[data-theme="light"] .entry-list { border-top-color: rgba(24, 54, 96, .12); }
html[data-theme="light"] .entry + .entry { border-top-color: rgba(24, 54, 96, .12); }
html[data-theme="light"] .entry .meta { color: #74849b; }
html[data-theme="light"] .entry h2 { color: #0d1b2e; }
html[data-theme="light"] .entry p { color: #44556e; }

/* 分隔线与页脚 */
html[data-theme="light"] .divider {
  background: linear-gradient(90deg, transparent, rgba(24, 54, 96, .14), transparent);
}

html[data-theme="light"] .site-footer .ft-line {
  background: linear-gradient(90deg, transparent, rgba(24, 54, 96, .18), transparent);
}

html[data-theme="light"] .site-footer p,
html[data-theme="light"] .site-footer a { color: #74849b; }

html[data-theme="light"] .site-footer a:hover { color: #44556e; }

/* ---- 切换按钮（两套主题共用） ---- */

.nav-right {
  display: flex;
  align-items: center;
  gap: 16px;
}

.theme-toggle {
  width: 34px;
  height: 34px;
  padding: 0;
  flex: none;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 9px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--fg-3);
  cursor: pointer;
  transition: border-color .2s ease, color .2s ease, background .2s ease;
}

.theme-toggle:hover {
  border-color: var(--line-strong);
  color: var(--fg);
  background: rgba(56, 189, 248, .08);
}

html[data-theme="light"] .theme-toggle:hover { background: rgba(37, 99, 235, .07); }

.theme-toggle:focus-visible {
  outline: 2px solid rgba(255, 255, 255, .8);
  outline-offset: 3px;
}

html[data-theme="light"] .theme-toggle:focus-visible { outline-color: rgba(29, 78, 216, .55); }

.theme-toggle svg {
  width: 17px;
  height: 17px;
  display: block;
  stroke: currentColor;
  stroke-width: 1.8;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* 深色时显示太阳（点击切亮），亮色时显示月亮 */
html[data-theme="light"] .ico-sun { display: none; }
html:not([data-theme="light"]) .ico-moon { display: none; }

@media (max-width: 640px) {
  .nav-right { gap: 10px; }
  .theme-toggle { width: 32px; height: 32px; }
}
