/* =========================================================
   Design tokens · 统一的设计变量
   - 基础层：间距、圆角、阴影、动效、层级、状态色（所有主题共用，状态色不随主题变）
   - 主题层：html[data-theme] 决定强调色、表面色、字体气质
     yellow-heart / pink-spider / lemoned / psyence / rocket-dive
   - 旧页面（首页、今日安排、周计划、专注、统计）仍用 style.css / spider.css 里原来的变量，外观不变
     新组件（ui.css）和新页面只用这里的变量
   ========================================================= */
:root{
  /* 间距 4px 基准 */
  --sp-1:4px; --sp-2:8px; --sp-3:12px; --sp-4:16px; --sp-5:20px; --sp-6:24px; --sp-8:32px; --sp-10:40px;
  /* 圆角 */
  --r-xs:6px; --r-sm:10px; --r-md:14px; --r-lg:18px; --r-pill:999px;
  /* 阴影 */
  --sh-1:0 4px 14px rgba(0,0,0,.35); --sh-2:0 14px 40px rgba(0,0,0,.5); --sh-3:0 30px 80px rgba(0,0,0,.6);
  /* 动效 */
  --dur-1:.15s; --dur-2:.25s; --dur-3:.45s; --ease-out:cubic-bezier(.16,1,.3,1);
  /* 层级 */
  --z-bar:10; --z-drawer:60; --z-modal:70; --z-toast:80;
  /* 字号 */
  --fs-xs:11px; --fs-sm:12px; --fs-md:14px; --fs-lg:16px; --fs-xl:20px; --fs-2xl:28px;
  /* 状态色：成功 / 警告 / 危险 / 信息，任何主题都不改 */
  --ok:#3DDC84; --ok-bg:rgba(61,220,132,.12);
  --warn:#FFB020; --warn-bg:rgba(255,176,32,.12);
  --danger:#FF4D4F; --danger-bg:rgba(255,77,79,.12);
  --info:#5AB4FF; --info-bg:rgba(90,180,255,.12);
  /* 优先级 */
  --prio-3:#FF4D4F; --prio-2:#FFB020; --prio-1:#5AB4FF; --prio-0:#6B7280;

  /* 主题层默认值 = Yellow Heart */
  --t-bg:#000; --t-surface:#101010; --t-surface-2:#191919; --t-surface-3:#232323;
  --t-ink:#E1E0CC; --t-muted:#9CA3AF; --t-faint:#6B7280;
  --t-border:rgba(225,224,204,.12); --t-border-2:rgba(225,224,204,.22);
  --t-accent:#FCEB3F; --t-accent-ink:#000; --t-accent-2:#E0000F; --t-glow:rgba(252,235,63,.35);
  --t-font-display:'Instrument Serif',"Songti SC",serif;
}
html[data-theme="pink-spider"]{
  --t-bg:#050205; --t-surface:#160814; --t-surface-2:#21101e; --t-surface-3:#2c1428;
  --t-ink:#EBDDFF; --t-muted:rgba(235,221,255,.62); --t-faint:rgba(235,221,255,.38);
  --t-border:rgba(255,46,136,.2); --t-border-2:rgba(255,46,136,.38);
  --t-accent:#FF2E88; --t-accent-ink:#fff; --t-accent-2:#B36BFF; --t-glow:rgba(255,46,136,.45);
}
html[data-theme="lemoned"]{
  --t-bg:#0A0A08; --t-surface:#121210; --t-surface-2:#1B1B17; --t-surface-3:#26261F;
  --t-ink:#F4F1E0; --t-muted:#B5B29E; --t-faint:#7A7867;
  --t-border:rgba(255,230,0,.14); --t-border-2:rgba(255,230,0,.32);
  --t-accent:#FFE600; --t-accent-ink:#0A0A08; --t-accent-2:#F4F1E0; --t-glow:rgba(255,230,0,.3);
  --t-font-display:'Almarai',"PingFang SC",sans-serif;
}
html[data-theme="psyence"]{
  --t-bg:#07060F; --t-surface:#0F0C1C; --t-surface-2:#171329; --t-surface-3:#211B38;
  --t-ink:#E8E4FF; --t-muted:#A8A1CF; --t-faint:#6E6896;
  --t-border:rgba(124,245,216,.14); --t-border-2:rgba(124,245,216,.32);
  --t-accent:#7CF5D8; --t-accent-ink:#07060F; --t-accent-2:#B58CFF; --t-glow:rgba(124,245,216,.32);
}
html[data-theme="rocket-dive"]{
  --t-bg:#05070B; --t-surface:#0B0F16; --t-surface-2:#121824; --t-surface-3:#1A2232;
  --t-ink:#E6EEF8; --t-muted:#9AA8BC; --t-faint:#5F6C80;
  --t-border:rgba(63,208,255,.14); --t-border-2:rgba(63,208,255,.32);
  --t-accent:#FF6A00; --t-accent-ink:#05070B; --t-accent-2:#3FD0FF; --t-glow:rgba(255,106,0,.35);
}

html[data-theme="electric-cucumber"]{
  --t-bg:#040805; --t-surface:#0A120C; --t-surface-2:#111C13; --t-surface-3:#18271B;
  --t-ink:#DDF7DF; --t-muted:#93B597; --t-faint:#5C7A60;
  --t-border:rgba(57,255,122,.15); --t-border-2:rgba(57,255,122,.34);
  --t-accent:#39FF7A; --t-accent-ink:#031006; --t-accent-2:#D7FF3A; --t-glow:rgba(57,255,122,.3);
  --t-font-display:ui-monospace,"SF Mono",Menlo,monospace;
}
/* 浅色纸张：知识库 */
html[data-theme="hide-your-face"]{
  color-scheme:light;
  --t-bg:#EFE9DC; --t-surface:#FBF8F1; --t-surface-2:#F3EDE1; --t-surface-3:#E6DDCB;
  --t-ink:#1C1813; --t-muted:#5E564A; --t-faint:#8E8576;
  --t-border:rgba(28,24,19,.14); --t-border-2:rgba(28,24,19,.3);
  --t-accent:#C8102E; --t-accent-ink:#fff; --t-accent-2:#1C1813; --t-glow:rgba(200,16,46,.16);
  --ok:#15803D; --ok-bg:rgba(21,128,61,.1); --warn:#B45309; --warn-bg:rgba(180,83,9,.1);
  --danger:#C8102E; --danger-bg:rgba(200,16,46,.08); --info:#1D5FBF; --info-bg:rgba(29,95,191,.1);
  --sh-1:0 2px 10px rgba(28,24,19,.08); --sh-2:0 12px 32px rgba(28,24,19,.14); --sh-3:0 24px 60px rgba(28,24,19,.2);
}
/* 浅色天空：目标 */
html[data-theme="ever-free"]{
  color-scheme:light;
  --t-bg:#E4EEFA; --t-surface:#FFFFFF; --t-surface-2:#F1F6FD; --t-surface-3:#DCE8F8;
  --t-ink:#0E2340; --t-muted:#4A5F7D; --t-faint:#8293AB;
  --t-border:rgba(14,35,64,.1); --t-border-2:rgba(14,35,64,.22);
  --t-accent:#2F6FEB; --t-accent-ink:#fff; --t-accent-2:#FF8A3D; --t-glow:rgba(47,111,235,.22);
  --ok:#15803D; --ok-bg:rgba(21,128,61,.1); --warn:#B45309; --warn-bg:rgba(180,83,9,.1);
  --danger:#D92D20; --danger-bg:rgba(217,45,32,.08); --info:#2F6FEB; --info-bg:rgba(47,111,235,.1);
  --sh-1:0 4px 16px rgba(14,35,64,.08); --sh-2:0 14px 36px rgba(14,35,64,.14); --sh-3:0 28px 70px rgba(14,35,64,.2);
}
html[data-theme="hurry-go-round"]{
  --t-bg:#100B07; --t-surface:#1A130D; --t-surface-2:#241A11; --t-surface-3:#302317;
  --t-ink:#F3E6D0; --t-muted:#BFA98A; --t-faint:#85725A;
  --t-border:rgba(232,176,95,.16); --t-border-2:rgba(232,176,95,.34);
  --t-accent:#E8B05F; --t-accent-ink:#100B07; --t-accent-2:#C2544A; --t-glow:rgba(232,176,95,.28);
}

/* =========================================================
   主题同步：选了「跟随页面」以外的主题时，原来的页面也跟着换配色
   - 只换颜色变量（强调色、背景、卡片、文字、线条），照片、爱心胶带、蜘蛛这些页面专属装饰保留
   - 红色继续表示警告和错误，不跟着主题变
   ========================================================= */
:root{--t-accent-rgb:252,235,63}
html[data-theme="pink-spider"]{--t-accent-rgb:255,46,136}
html[data-theme="lemoned"]{--t-accent-rgb:255,230,0}
html[data-theme="psyence"]{--t-accent-rgb:124,245,216}
html[data-theme="rocket-dive"]{--t-accent-rgb:255,106,0}
html[data-theme="electric-cucumber"]{--t-accent-rgb:57,255,122}
html[data-theme="hide-your-face"]{--t-accent-rgb:200,16,46}
html[data-theme="ever-free"]{--t-accent-rgb:47,111,235}
html[data-theme="hurry-go-round"]{--t-accent-rgb:232,176,95}
html[data-theme-pref]:not([data-theme-pref="auto"]){
  --yellow:var(--t-accent); --yellow-rgb:var(--t-accent-rgb);
  --bg:var(--t-bg); --card:var(--t-surface); --card-2:var(--t-surface-3);
  --ink:var(--t-ink); --primary:var(--t-ink); --line:var(--t-border); --line-2:var(--t-border-2);
}
html[data-theme-pref]:not([data-theme-pref="auto"]) body{background:var(--t-bg)}
html[data-theme-pref]:not([data-theme-pref="auto"]) .spider{
  --pk:var(--t-accent); --pk-rgb:var(--t-accent-rgb); --pk2:var(--t-accent-2); --pk3:var(--t-accent-2); --vi:var(--t-ink);
  --dim:var(--t-muted); --faint:var(--t-faint); --ln:var(--t-border-2); --card:color-mix(in srgb,var(--t-surface) 72%,transparent);
  background:radial-gradient(110% 70% at 50% -8%,var(--t-surface-3) 0%,var(--t-surface) 42%,var(--t-bg) 100%);
}
html[data-theme-pref]:not([data-theme-pref="auto"]) body[data-view="focus"],html[data-theme-pref]:not([data-theme-pref="auto"]) body[data-view="stats"]{background:var(--t-bg)}
/* 黄色强调上的文字：亮色强调用深色字，深色强调用浅色字 */
html[data-theme-pref="pink-spider"] .btn.solid,html[data-theme-pref="pink-spider"] .cta,html[data-theme-pref="rocket-dive"] .btn.solid{color:var(--t-accent-ink)}
/* 两套浅色主题只给自己的页面用，不能设成全站主题（旧页面的照片和深色装饰在浅色底上会看不清） */
