/* 主题切换按钮 + 夜间模式配色。白天样式不受影响，夜间只在 html.dark 下覆盖。 */
.theme-switch { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 4px; border-radius: 999px; background: #fff0b8; }
.theme-switch button { display: flex; align-items: center; justify-content: center; gap: .4rem; padding: .4rem 0; border-radius: 999px; font-size: .875rem; color: #8f4200; }
.theme-switch button[aria-pressed="true"] { background: #fff; font-weight: 600; box-shadow: 0 1px 4px rgba(230,115,0,.25); }
.theme-switch button:focus-visible { outline: 2px solid #e67300; outline-offset: 1px; }

html.dark { color-scheme: dark; }
html.dark body[data-page] { background-color: #1c1812; background-image: linear-gradient(180deg, #3a2c12, rgba(58,44,18,0) 520px); color: #e9e1d3; }

/* 底色 */
html.dark .bg-white { background-color: #2a241b; }
html.dark .bg-white\/95 { background-color: rgba(35,30,22,.95); }
html.dark .bg-amber-50 { background-color: #33291a; }
html.dark .bg-amber-100 { background-color: #43341a; }
html.dark .bg-amber-100\/50, html.dark .bg-amber-100\/60 { background-color: rgba(120,90,30,.22); }
html.dark .bg-gray-100 { background-color: #3a352d; }
html.dark .bg-rose-50 { background-color: #3a2326; }
html.dark .bg-emerald-100 { background-color: #1f3a2c; }
html.dark .from-rose-50 { --tw-gradient-from: #3a2326 var(--tw-gradient-from-position); }
html.dark .from-sky-50 { --tw-gradient-from: #1d2f3b var(--tw-gradient-from-position); }
html.dark .from-emerald-50 { --tw-gradient-from: #1c3327 var(--tw-gradient-from-position); }
html.dark .to-white { --tw-gradient-to: #2a241b var(--tw-gradient-to-position); }
html.dark .hover\:bg-amber-50:hover { background-color: #3a2f1d; }
html.dark .hover\:bg-white:hover { background-color: #3a3328; }

/* 文字 */
html.dark .text-amber-900 { color: #ffe3a6; }
html.dark .text-amber-800 { color: #ffd98a; }
html.dark .text-amber-700 { color: #ffc766; }
html.dark .text-amber-700\/70 { color: rgba(255,199,102,.7); }
html.dark .text-amber-600 { color: #ffb23e; }
html.dark .text-gray-800 { color: #e9e1d3; }
html.dark .text-gray-700 { color: #d9d0c0; }
html.dark .text-gray-600 { color: #c8bfae; }
html.dark .text-gray-500 { color: #a89f8f; }
html.dark .text-gray-400 { color: #8b8376; }
html.dark .text-rose-700 { color: #ff9fb0; }
html.dark .text-sky-600 { color: #6cc4f5; }
html.dark .text-emerald-600 { color: #5fd3a0; }

/* 边框 */
html.dark .border-amber-100 { border-color: #453a27; }
html.dark .border-amber-200 { border-color: #5a4a2c; }
html.dark .border-amber-300 { border-color: #7a6232; }
html.dark .border-rose-100 { border-color: #55333a; }
html.dark .border-sky-100 { border-color: #2c4555; }
html.dark .border-emerald-100 { border-color: #2b4a3a; }

/* style.css 里的自定义组件 */
html.dark .side-link[aria-current="page"] { background: #3a2f1d; color: #ffd98a; box-shadow: none; }
html.dark .nav-link[aria-current="page"], html.dark .nav-group.has-current > .nav-link { color: #ffb23e; }
html.dark .tree-child::before, html.dark .tree-child::after { border-color: #6b562a; }
html.dark .choice:has(input:checked) { background: #3a2c14; }
html.dark .field { background: #221d15; border-color: #5a4a2c; color: #e9e1d3; }
html.dark .field.invalid { border-color: #f87171; }
html.dark footer.bg-amber-900 { background-image: linear-gradient(90deg, #4a2a0c, #4d3a0e); color: #ffe3a6; }
html.dark .theme-switch { background: #1c1812; }
html.dark .theme-switch button { color: #c8bfae; }
html.dark .theme-switch button[aria-pressed="true"] { background: #43341a; color: #ffe3a6; box-shadow: none; }

/* 首页轮播与成长熊猫（home.css） */
html.dark .ivy { --card: #2a241b; --fg: #e9e1d3; --muted: #b3a998; --brand: #ffd08a; --ink: #ffb866; --soft: #43341a; --line: #4d4029; --sky: #34401f; --band: linear-gradient(135deg, #3d2e14, #342a19); }
html.dark .ivy .slide { --wave-a: #3d2e14; --wave-b: #342a19; --wave-line: #8a6a24; --wave-dots: #5a4a2c; }
html.dark .ivy .tag { color: #ffd08a; }
html.dark .ivy .strip .brand { color: #8fd694; }
html.dark .ivy .track-card { background: #30281a; }
html.dark .ivy .track-card.eq { background: #35251f; border-color: #5c3b30; }
html.dark .ivy .track-card.eq .chips span { background: #54342a; }
html.dark .ivy .track-card.motor { background: #1f2d34; border-color: #2f4d5c; }
html.dark .ivy .track-card.social { background: #2b2536; border-color: #4a3d66; }
html.dark .ivy .track-card.motor .chips span { background: #2b4754; }
html.dark .ivy .track-card.social .chips span { background: #433560; }
html.dark .ivy .vocab { --pale: #3a3226; }
html.dark .ivy .watermark { color: #8fd694; opacity: .35; }
html.dark .ivy .word-panel { background: rgba(42,36,27,.96); }
html.dark .ivy .hill-wrap button { background: rgba(42,36,27,.9); }
html.dark .ivy .hill-wrap button:hover { background: #3a3328; }
/* 插画保留原色，只压暗一点；插画里的文字仍用深色 */
html.dark .ivy .art { --fg: #33302a; filter: brightness(.85); }

/* 熊猫放映厅（show.css） */
html.dark .show .frame { background: #2a241b; border-color: #5a4a2c; box-shadow: 0 18px 40px -20px rgba(0,0,0,.7); }
html.dark .show .screen { filter: brightness(.85); }
html.dark .show .bar { background: #33291a; color: #ffd98a; }
html.dark .show .bar button { background: #43341a; color: #ffc766; }
html.dark .show .bar button:hover { background: #e67300; color: #fff; }
html.dark .show .bar .segs button, html.dark .show .bar .segs button:hover { background: none; }
html.dark .show .segs i { background: rgba(255,217,138,.2); }
html.dark .show .frame:fullscreen { background: #14110d; }
