/* 梁 Sir 工具站: explicit choice wins over OS colours; only platform pages load this file. */
html[data-theme="light"]{color-scheme:light}html[data-theme="dark"]{color-scheme:dark}
html[data-theme="light"],html[data-theme="light"] body{--bg:#f5f7f8;--surface:#fff;--surface-soft:#eaf4ef;--text:#183342;--muted:#596e79;--line:#dce5e8;--primary:#246b58;--primary-strong:#185340;--accent:#367c69;--danger:#b42318;--focus:#b87900;--shadow:0 8px 24px rgba(24,51,66,.045);color-scheme:light}
html[data-theme="dark"],html[data-theme="dark"] body{--bg:#111e26;--surface:#192a34;--surface-soft:#243b3a;--text:#ecf2f4;--muted:#b1c2ca;--line:#405761;--primary:#88d0b6;--primary-strong:#a1e2c9;--accent:#88d0b6;--danger:#fda29b;--focus:#fbbf24;--shadow:0 8px 24px rgba(0,0,0,.12);color-scheme:dark}
html[data-theme] body{background:var(--bg);color:var(--text)}
html[data-theme="light"] body .home-intro{background:#e9f2ee;border-color:#d6e5dc}
html[data-theme="dark"] body .home-intro{background:#213831;border-color:#375346}
html[data-theme="light"] body .home-hero-actions a,html[data-theme="light"] body .card-link:not(.card-link--secondary),html[data-theme="light"] body .button:not(.button--secondary):not(.button--quiet){color:#fff}
html[data-theme="dark"] body .home-hero-actions a,html[data-theme="dark"] body .card-link:not(.card-link--secondary),html[data-theme="dark"] body .button:not(.button--secondary):not(.button--quiet){color:#122e24}
html[data-theme] body .button--quiet{color:var(--primary)}
html[data-theme="light"] body .home-hero-actions a+a{color:#246b58;border-color:#aac7b8}
html[data-theme="dark"] body .home-hero-actions a+a{color:var(--primary);border-color:#527a65}
html[data-theme="light"] body .home-hero-actions a+a:hover{background:#dcebe1}
html[data-theme="dark"] body .home-hero-actions a+a:hover{background:#29493c}
html[data-theme="light"] body .portal-card--tools{--card-color:#366f92}html[data-theme="light"] body .portal-card--explainers{--card-color:#926628}html[data-theme="light"] body .portal-card--games{--card-color:#367c55}
html[data-theme="dark"] body .portal-card--tools{--card-color:#96c4e0}html[data-theme="dark"] body .portal-card--explainers{--card-color:#e3bc88}html[data-theme="dark"] body .portal-card--games{--card-color:#91d0a9}
html[data-theme="light"] body .resource-icon img{filter:none}html[data-theme="dark"] body .resource-icon img{filter:invert(1)}
/* Login and guide use a few fixed brand colours; map their surfaces and text as well. */
html[data-theme="dark"] .login-layout{background:var(--surface);border-color:var(--line);box-shadow:var(--shadow)}
html[data-theme="dark"] .login-story{background:#203b33}
html[data-theme="dark"] .login-lede,html[data-theme="dark"] .login-collections,html[data-theme="dark"] .login-account-note,html[data-theme="dark"] .access-footer{color:#b6ccc3}
html[data-theme="dark"] .wordmark>span,html[data-theme="dark"] .wordmark b{color:var(--text)}
html[data-theme="dark"] .login-collections>span{background:#29453b;border-color:#45665a;color:#d2e6dc}
html[data-theme="dark"] .google-sign-in{background:#88d0b6;border-color:#88d0b6;color:#122e24;box-shadow:none}
html[data-theme="dark"] .google-sign-in:hover{background:#a1e2c9;border-color:#a1e2c9}
html[data-theme="dark"] .sign-in-arrow{color:#122e24}
html[data-theme="dark"] .login-help{border-color:var(--line)}
html[data-theme="dark"] .guide-steps li:before{color:var(--primary);background:#28463c}
html[data-theme="dark"] .prompt-section{background:var(--surface);border-color:var(--line)}
html[data-theme="dark"] .small-tag{background:#25473a;color:#b8e4d1;border-color:#45665a}
html[data-theme="dark"] .prompt-fields input,html[data-theme="dark"] .prompt-fields select,html[data-theme="dark"] .prompt-fields textarea{background:#13242c;border-color:#526c78;color:var(--text)}
html[data-theme="dark"] .prompt-output{background:#13242c;border-color:var(--line);color:#c7ded3}
html[data-theme="dark"] .guide-note{background:#213b32;border-color:#88b99b}
html[data-theme="dark"] .guide-note p{color:#c4dbd0}
html[data-theme="dark"] .access-page .language-switcher{background:var(--surface);color:var(--text);border-color:var(--line)}
.theme-picker{position:relative;flex:none;color:var(--text)}
.theme-picker>summary{list-style:none;cursor:pointer;display:grid;place-items:center;width:44px;height:44px;border:1px solid var(--line);border-radius:9px;background:var(--surface);color:var(--text)}
.theme-picker>summary::-webkit-details-marker{display:none}
.theme-picker>summary:hover{background:var(--surface-soft)}
.theme-picker>fieldset{position:absolute;z-index:100;right:0;top:calc(100% + 8px);width:174px;min-width:174px;margin:0;padding:10px;border:1px solid var(--line);border-radius:12px;background:var(--surface);box-shadow:var(--shadow);color:var(--text)}
.theme-picker legend{float:left;width:100%;padding:4px 8px 8px;font-size:.75rem;font-weight:650;color:var(--muted)}
.theme-picker label{clear:both;display:flex;align-items:center;gap:10px;min-height:42px;padding:8px;border-radius:7px;font-size:.85rem;cursor:pointer;white-space:nowrap}
.theme-picker label:hover{background:var(--surface-soft)}
.theme-picker input[type="radio"]{appearance:auto;accent-color:var(--primary);width:16px;min-width:16px;height:16px;min-height:16px;flex:none;margin:0;padding:0}
@media(max-width:600px){.access-top{flex-wrap:wrap}.access-top-actions{gap:8px}.theme-picker>summary{width:44px;height:44px}}
@media(max-width:480px){.portal-login-page .access-top{flex-wrap:nowrap;gap:8px;padding-inline:16px}.portal-login-page .wordmark{font-size:.9rem;gap:6px}.portal-login-page .wordmark>img{width:32px;height:32px}.portal-login-page .access-top-actions{gap:8px}.portal-login-page .access-top .language-switcher{width:88px;min-width:88px;padding-inline:8px;font-size:.75rem}.portal-login-page .theme-picker>summary{width:44px;height:44px}}
html[data-theme="light"] .status-badge--pending{background:#fff2cc;color:#7a5200}html[data-theme="dark"] .status-badge--pending{background:#493814;color:#ffd978}
html[data-theme="light"] .status-badge--published,html[data-theme="light"] .link-status--ok{background:#d9f4e9;color:#176448}html[data-theme="dark"] .status-badge--published,html[data-theme="dark"] .link-status--ok{background:#173e31;color:#8ce0bd}
html[data-theme="light"] .status-badge--rejected,html[data-theme="light"] .link-status--failed{background:#fee4e2;color:#912018}html[data-theme="dark"] .status-badge--rejected,html[data-theme="dark"] .link-status--failed{background:#4b2525;color:#ffb4ad}
html[data-theme="light"] .icon-picker-preview img,html[data-theme="light"] .icon-choice img{filter:none}html[data-theme="dark"] .icon-picker-preview img,html[data-theme="dark"] .icon-choice img{filter:invert(1)}
html[data-theme] .access-page .prompt-preview-heading .button{background:var(--primary);border:1px solid var(--primary);border-radius:8px;font-weight:700;cursor:pointer}
html[data-theme="light"] .access-page .prompt-preview-heading .button{color:#fff}html[data-theme="dark"] .access-page .prompt-preview-heading .button{color:#122e24}
html[data-theme] .access-page .prompt-preview-heading .button:hover{background:var(--primary-strong)}
