/* ==========================================================================
   小说AI写作台 · 主题令牌与全局样式
   一处改，全局变。所有颜色禁止硬编码。
   ========================================================================== */

:root {
  /* 紫色主色阶 */
  --p-950: #101010;
  --p-900: #171717;
  --p-800: #202020;
  --p-700: #2d2d2d;
  --p-600: #454545;
  --p-500: #656565;
  --p-400: #848484;
  --p-300: #a6a6a6;

  /* 强调色 */
  --pink-500: #909090;
  --cyan-400: #4fd6e8;
  --gold-400: #f2c46b;
  --green-400: #6fffa6;   /* 1.8.67：加亮绿色，提高暗底可读性 */
  --red-400: #ff6b7a;
  --orange-400: #ffa24d;

  /* 语义层 */
  --bg: #0d0d0d;
  --surface: rgba(255, 255, 255, 0.055);
  --surface-2: rgba(255, 255, 255, 0.085);
  --soft: rgba(255, 255, 255, 0.028);
  --border: rgba(255, 255, 255, 0.10);
  --border-strong: rgba(255, 255, 255, 0.18);
  --text: #ececec;
  --text-2: #d5d5d5;     /* 1.8.67：secondary 文字加亮 */
  --muted: #a8a8a8;      /* 1.8.67：muted 加亮 */
  --faint: #8b8b8b;      /* 1.8.67：faint 加亮 */

  --radius-s: 8px;
  --radius: 12px;
  --radius-l: 18px;
  --shadow: 0 8px 28px rgba(0, 0, 0, 0.38);
  --shadow-lift: 0 16px 44px rgba(0, 0, 0, 0.5);
  --inset-hi: inset 0 1px 0 rgba(255, 255, 255, 0.14);

  --titlebar-h: 38px;
  --sidebar-w: 232px;
  --sidebar-w-mini: 60px;

  --ease: cubic-bezier(.2, .8, .2, 1);
  --t: .24s var(--ease);
}

/* 浅色主题：1.8.6 全面提高对比度，避免「muted/faint 字看不见」 */
html[data-theme="light"] {
  --bg: #f6f6f6;
  --surface: rgba(0, 0, 0, 0.045);
  --surface-2: rgba(0, 0, 0, 0.085);
  --soft: rgba(0, 0, 0, 0.028);
  --border: rgba(0, 0, 0, 0.12);
  --border-strong: rgba(0, 0, 0, 0.20);
  --text: #141414;
  --text-2: #323232;
  --muted: #585858;        /* 1.8.6: 由 #797979 加深，确保小字可读 */
  --faint: #6b6b6b;        /* 1.8.6: 由 #a8a8a8 加深 */
  --shadow: 0 8px 28px rgba(0, 0, 0, 0.12);
  --shadow-lift: 0 16px 44px rgba(0, 0, 0, 0.16);
}
/* 浅色主题：补强 .text-2 与 on-state 文字色，修复选中态看不见 */
html[data-theme="light"] .sidebar .item.on,
html[data-theme="light"] .sidebar .item.on b { color: #282828; font-weight: 600; }
html[data-theme="light"] .sidebar .item b { color: #191919; }
html[data-theme="light"] .sidebar .item .pill { color: #282828; background: rgba(101, 101, 101,.16); }
html[data-theme="light"] .card-h .right { color: #585858; }
html[data-theme="light"] .card-h b { color: #141414; }
html[data-theme="light"] .ph-ico { background: rgba(101, 101, 101,.18); }
html[data-theme="light"] .page-head h1 { color: #141414; }
html[data-theme="light"] .page-head p { color: #484848; }
html[data-theme="light"] .page-head .sub-t { color: #585858; }
html[data-theme="light"] .stat-card { background: linear-gradient(160deg, #ffffff, #f0f0f0); border-color: rgba(101, 101, 101,.18); }
html[data-theme="light"] .stat-card .num { color: #141414; }
html[data-theme="light"] .stat-card .lab { color: #484848; }
html[data-theme="light"] .work-card { background: linear-gradient(160deg, #ffffff, #f0f0f0); border-color: rgba(101, 101, 101,.2); }
html[data-theme="light"] .work-card .cover { background: linear-gradient(160deg,#d2d2d2,#dcdcdc); }
html[data-theme="light"] .work-card .title { color: #141414; }
html[data-theme="light"] .work-card .meta { color: #585858; }
html[data-theme="light"] .quick-card { background: linear-gradient(160deg, #ffffff, #f2f2f2); border-color: rgba(101, 101, 101,.18); color: #141414; }
html[data-theme="light"] .quick-card .ico { color: #454545; }
html[data-theme="light"] .card { background: #ffffff; color: #141414; border-color: rgba(101, 101, 101,.18); }
html[data-theme="light"] .card .card-b { color: #191919; }
html[data-theme="light"] .list-item .li-main b { color: #141414; }
html[data-theme="light"] .list-item .li-main small { color: #585858; }
html[data-theme="light"] .empty { color: #585858; }
html[data-theme="light"] .empty p { color: #585858; }
html[data-theme="light"] input.inp,
html[data-theme="light"] select.inp,
html[data-theme="light"] textarea.inp { background: #ffffff; color: #141414; border-color: rgba(101, 101, 101,.22); }
html[data-theme="light"] input.inp::placeholder,
html[data-theme="light"] textarea.inp::placeholder { color: #8a8a8a; }
html[data-theme="light"] .editor-area { background: #ffffff; color: #141414; border-color: rgba(101, 101, 101,.2); }
html[data-theme="light"] .editor-foot { color: #484848; background: #f0f0f0; }
html[data-theme="light"] .editor-bar { background: #f0f0f0; border-color: rgba(101, 101, 101,.18); }
html[data-theme="light"] .editor-bar .eb { color: #282828; }
html[data-theme="light"] .editor-bar .eb:hover { background: rgba(101, 101, 101,.14); color: #141414; }
html[data-theme="light"] .stepbar .step { color: #484848; }
html[data-theme="light"] .stepbar .step.active { color: #141414; }
html[data-theme="light"] .stepbar .step.active i { background: linear-gradient(135deg,#454545,#909090); color: #fff; }
html[data-theme="light"] .stepbar .step.done i { background: rgba(79,216,138,.22); color: #1a7a3e; }
html[data-theme="light"] .kcol > h5 { color: #141414; }
html[data-theme="light"] .kcol > h5 .vbar { color: #585858; }
html[data-theme="light"] .kcard-h { background: #f6f6f6; border-color: rgba(101, 101, 101,.18); }
html[data-theme="light"] .kcard-h b { color: #141414; }
html[data-theme="light"] .kcard-h .kctag { color: #585858; }
html[data-theme="light"] .tag { background: rgba(101, 101, 101,.14); color: #282828; }
html[data-theme="light"] .tag.p { background: linear-gradient(135deg,#656565,#909090); color: #fff; }
html[data-theme="light"] .tag.g { background: rgba(79,216,138,.22); color: #1a7a3e; }
html[data-theme="light"] .tag.k { background: rgba(122, 122, 122,.18); color: #484848; }
html[data-theme="light"] .tag.y { background: rgba(255,162,77,.22); color: #8a4a10; }
html[data-theme="light"] .tag.r { background: rgba(255,107,122,.22); color: #8a1a2a; }
html[data-theme="light"] .kv .k { color: #585858; }
html[data-theme="light"] .kv .v { color: #141414; }
html[data-theme="light"] .drawer-wrap .right { color: #141414; }
html[data-theme="light"] .titlebar { color: #141414; }
html[data-theme="light"] .titlebar .title { color: #141414; }
html[data-theme="light"] .titlebar .accent { color: #454545; }
html[data-theme="light"] .status-bar { color: #585858; background: rgba(255,255,255,.65); }
html[data-theme="light"] .btn { color: #141414; background: rgba(101, 101, 101,.1); border-color: rgba(101, 101, 101,.2); }
html[data-theme="light"] .btn.ghost { background: transparent; }
html[data-theme="light"] .btn.primary { background: linear-gradient(135deg,#656565,#909090); color: #fff; border-color: transparent; }
html[data-theme="light"] .btn:hover { background: rgba(101, 101, 101,.18); }
html[data-theme="light"] .panda-fab { background: #ffffff; border-color: rgba(101, 101, 101,.25); color: #141414; }
html[data-theme="light"] .work-switch { color: #141414; }
html[data-theme="light"] .work-switch .on { color: #454545; }
html[data-theme="light"] .dcard .front .val { color: #141414; }
html[data-theme="light"] .dcard .front .cat { color: #585858; }
html[data-theme="light"] .dcard .back .rune { color: #656565; }
html[data-theme="light"] .collide-item { background: #ffffff; border-color: rgba(101, 101, 101,.18); }
html[data-theme="light"] .collide-item b { color: #141414; }
html[data-theme="light"] .heat i { background: rgba(101, 101, 101,.12); }
html[data-theme="light"] .heat i.l1 { background: rgba(79,216,138,.4); }
html[data-theme="light"] .heat i.l2 { background: rgba(79,216,138,.6); }
html[data-theme="light"] .heat i.l3 { background: rgba(79,216,138,.8); }
html[data-theme="light"] .heat i.l4 { background: rgba(79,216,138,1); }
html[data-theme="light"] .issue .i-main b { color: #141414; }
html[data-theme="light"] .issue .i-main p { color: #484848; }
html[data-theme="light"] .work2r .col-c,
html[data-theme="light"] .work2r .col-r { color: #141414; }
html[data-theme="light"] .work3 .col-l,
html[data-theme="light"] .work3 .col-c,
html[data-theme="light"] .work3 .col-r { color: #141414; }

/* 浅色主题：抽卡卡面改浅底高对比，避免字体看不清 */
html[data-theme="light"] .dcard .back {
  background: radial-gradient(circle at 50% 40%, #d2d2d2, #ebebeb);
  color: #282828; border-color: rgba(101, 101, 101,.55);
}
html[data-theme="light"] .dcard .front {
  background: linear-gradient(160deg, #ffffff, #f0f0f0);
  color: #191919; border-color: rgba(101, 101, 101,.5);
}
html[data-theme="light"] .dcard .front .cat { color: #696969; }
html[data-theme="light"] body::before {
  background:
    radial-gradient(900px 620px at 12% -8%, rgba(101, 101, 101, .18), transparent 62%),
    radial-gradient(760px 540px at 92% 4%, rgba(144, 144, 144, .10), transparent 60%),
    radial-gradient(1100px 800px at 60% 110%, rgba(79, 214, 232, .08), transparent 62%),
    linear-gradient(155deg, #f8f8f8 0%, #f6f6f6 46%, #f0f0f0 100%);
}
html[data-theme="light"] body::after { opacity: .10; }
html[data-theme="light"] .titlebar { background: rgba(255,255,255,.72); }
html[data-theme="light"] .sidebar { background: rgba(255,255,255,.62); }
html[data-theme="light"] .win-ctrl button:hover { background: rgba(0,0,0,.06); }
html[data-theme="light"] .win-ctrl button.close:hover { background: #e0384f; color: #fff; }
html[data-theme="light"] .modal-overlay { background: rgba(0,0,0,.35); }
html[data-theme="light"] .modal { background: #fff; color: var(--text); }
html[data-theme="light"] .empty { color: var(--muted); }
/* 浅色主题：抽卡卡面改浅底高对比，避免字体看不清 */
html[data-theme="light"] .dcard .back {
  background: radial-gradient(circle at 50% 40%, #d2d2d2, #ebebeb);
  color: #282828; border-color: rgba(101, 101, 101,.55);
}
html[data-theme="light"] .dcard .front {
  background: linear-gradient(160deg, #ffffff, #f0f0f0);
  color: #191919; border-color: rgba(101, 101, 101,.5);
}

/* 1.8.6 绿色护眼版：主色沙绿/抹茶绿，背景米黄/淡绿，文字深绿/暖灰，长时间阅读不刺眼 */
html[data-theme="green"] {
  --p-950: #0e2018;
  --p-900: #16302a;
  --p-800: #1e3f37;
  --p-700: #2a5a4d;
  --p-600: #3b7a64;
  --p-500: #4d9a7e;   /* 主色：薄荷绿 */
  --p-400: #6cb496;
  --p-300: #8fccb1;
  --pink-500: #c08a52;   /* 暖橙替代粉色 */
  --cyan-400: #4d9a9a;
  --gold-400: #c8a64d;
  --green-400: #4d9a7e;
  --red-400: #b86060;
  --orange-400: #c08850;
  --bg: #f4f7eb;          /* 暖米黄/抹茶淡绿 */
  --surface: rgba(60, 110, 90, 0.06);
  --surface-2: rgba(60, 110, 90, 0.12);
  --soft: rgba(60, 110, 90, 0.035);
  --border: rgba(60, 110, 90, 0.18);
  --border-strong: rgba(60, 110, 90, 0.30);
  --text: #1a2a22;        /* 深绿黑 */
  --text-2: #324a3c;
  --muted: #4d6b58;       /* 偏暗绿灰，确保小字可读 */
  --faint: #688275;       /* 比 light 主题深，避免模糊 */
  --shadow: 0 8px 28px rgba(40, 80, 60, 0.12);
  --shadow-lift: 0 16px 44px rgba(40, 80, 60, 0.18);
  --radius: 12px;
}
html[data-theme="green"] body::before {
  background:
    radial-gradient(900px 620px at 12% -8%, rgba(77, 154, 126, .14), transparent 62%),
    radial-gradient(760px 540px at 92% 4%, rgba(192, 138, 82, .08), transparent 60%),
    radial-gradient(1100px 800px at 60% 110%, rgba(200, 166, 77, .06), transparent 62%),
    linear-gradient(155deg, #f8faf0 0%, #f4f7eb 46%, #ecf0e0 100%);
}
html[data-theme="green"] body::after { opacity: .10; }
html[data-theme="green"] .titlebar { background: rgba(244, 247, 235, .85); color: #1a2a22; }
html[data-theme="green"] .titlebar .title { color: #1a2a22; }
html[data-theme="green"] .titlebar .accent { color: #3b7a64; }
html[data-theme="green"] .sidebar { background: rgba(244, 247, 235, .72); }
html[data-theme="green"] .sidebar .item b { color: #1a2a22; }
html[data-theme="green"] .sidebar .item .pill { background: rgba(77, 154, 126, .18); color: #16302a; }
html[data-theme="green"] .sidebar .item.on,
html[data-theme="green"] .sidebar .item.on b { color: #16302a; font-weight: 600; }
html[data-theme="green"] .sidebar .item.on { background: rgba(77, 154, 126, .14); }
html[data-theme="green"] .card { background: #fafdf3; color: #1a2a22; border-color: rgba(77, 154, 126, .22); }
html[data-theme="green"] .card .card-b { color: #1a2a22; }
html[data-theme="green"] .card-h b { color: #1a2a22; }
html[data-theme="green"] .card-h .right { color: #4d6b58; }
html[data-theme="green"] .ph-ico { background: rgba(77, 154, 126, .2); }
html[data-theme="green"] .page-head h1 { color: #1a2a22; }
html[data-theme="green"] .page-head p { color: #324a3c; }
html[data-theme="green"] .page-head .sub-t { color: #4d6b58; }
html[data-theme="green"] .stat-card { background: linear-gradient(160deg, #fafdf3, #ecf5e0); border-color: rgba(77, 154, 126, .22); }
html[data-theme="green"] .stat-card .num { color: #1a2a22; }
html[data-theme="green"] .stat-card .lab { color: #324a3c; }
html[data-theme="green"] .work-card { background: linear-gradient(160deg, #fafdf3, #ecf5e0); border-color: rgba(77, 154, 126, .22); }
html[data-theme="green"] .work-card .cover { background: linear-gradient(160deg,#c8dccc,#d8d8b8); }
html[data-theme="green"] .work-card .title { color: #1a2a22; }
html[data-theme="green"] .work-card .meta { color: #4d6b58; }
html[data-theme="green"] .quick-card { background: linear-gradient(160deg, #fafdf3, #ecf5e0); border-color: rgba(77, 154, 126, .22); color: #1a2a22; }
html[data-theme="green"] .quick-card .ico { color: #3b7a64; }
html[data-theme="green"] .list-item .li-main b { color: #1a2a22; }
html[data-theme="green"] .list-item .li-main small { color: #4d6b58; }
html[data-theme="green"] .empty { color: #4d6b58; }
html[data-theme="green"] input.inp,
html[data-theme="green"] select.inp,
html[data-theme="green"] textarea.inp { background: #fafdf3; color: #1a2a22; border-color: rgba(77, 154, 126, .25); }
html[data-theme="green"] input.inp::placeholder,
html[data-theme="green"] textarea.inp::placeholder { color: #688275; }
html[data-theme="green"] .editor-area { background: #fafdf3; color: #1a2a22; border-color: rgba(77, 154, 126, .25); }
html[data-theme="green"] .editor-foot { color: #324a3c; background: #ecf0e0; }
html[data-theme="green"] .editor-bar { background: #ecf0e0; border-color: rgba(77, 154, 126, .22); }
html[data-theme="green"] .editor-bar .eb { color: #16302a; }
html[data-theme="green"] .editor-bar .eb:hover { background: rgba(77, 154, 126, .18); color: #1a2a22; }
html[data-theme="green"] .stepbar .step { color: #324a3c; }
html[data-theme="green"] .stepbar .step.active { color: #1a2a22; }
html[data-theme="green"] .stepbar .step.active i { background: linear-gradient(135deg,#3b7a64,#c08a52); color: #fff; }
html[data-theme="green"] .stepbar .step.done i { background: rgba(77, 154, 126, .3); color: #16302a; }
html[data-theme="green"] .kcol { background: #ecf5e0; border-color: rgba(77, 154, 126, .25); }
html[data-theme="green"] .kcol > h5 { color: #1a2a22; }
html[data-theme="green"] .kcol > h5 .vbar { color: #4d6b58; }
html[data-theme="green"] .kcard-h { background: #fafdf3; border-color: rgba(77, 154, 126, .22); }
html[data-theme="green"] .kcard-h b { color: #1a2a22; }
html[data-theme="green"] .kcard-h .kctag { color: #4d6b58; }
html[data-theme="green"] .tag { background: rgba(77, 154, 126, .18); color: #16302a; }
html[data-theme="green"] .tag.p { background: linear-gradient(135deg,#3b7a64,#c08a52); color: #fff; }
html[data-theme="green"] .tag.g { background: rgba(77, 154, 126, .28); color: #16302a; }
html[data-theme="green"] .tag.k { background: rgba(120, 120, 120, .2); color: #324a3c; }
html[data-theme="green"] .tag.y { background: rgba(200, 166, 77, .25); color: #6a4a10; }
html[data-theme="green"] .tag.r { background: rgba(184, 96, 96, .22); color: #6a1a1a; }
html[data-theme="green"] .kv .k { color: #4d6b58; }
html[data-theme="green"] .kv .v { color: #1a2a22; }
html[data-theme="green"] .drawer-wrap .right { color: #1a2a22; }
html[data-theme="green"] .status-bar { color: #4d6b58; background: rgba(244, 247, 235, .78); }
html[data-theme="green"] .btn { color: #1a2a22; background: rgba(77, 154, 126, .12); border-color: rgba(77, 154, 126, .25); }
html[data-theme="green"] .btn.ghost { background: transparent; }
html[data-theme="green"] .btn.primary { background: linear-gradient(135deg,#3b7a64,#c08a52); color: #fff; border-color: transparent; }
html[data-theme="green"] .btn:hover { background: rgba(77, 154, 126, .22); }
html[data-theme="green"] .panda-fab { background: #fafdf3; border-color: rgba(77, 154, 126, .3); color: #1a2a22; }
html[data-theme="green"] .work-switch { color: #1a2a22; }
html[data-theme="green"] .work-switch .on { color: #3b7a64; }
html[data-theme="green"] .dcard .back { background: radial-gradient(circle at 50% 40%, #c8dccc, #d8d8b8); color: #16302a; border-color: rgba(77, 154, 126, .55); }
html[data-theme="green"] .dcard .front { background: linear-gradient(160deg, #fafdf3, #ecf5e0); color: #1a2a22; border-color: rgba(77, 154, 126, .5); }
html[data-theme="green"] .dcard .front .val { color: #1a2a22; }
html[data-theme="green"] .dcard .front .cat { color: #4d6b58; }
html[data-theme="green"] .dcard .back .rune { color: #3b7a64; }
html[data-theme="green"] .collide-item { background: #fafdf3; border-color: rgba(77, 154, 126, .22); }
html[data-theme="green"] .collide-item b { color: #1a2a22; }
html[data-theme="green"] .issue .i-main b { color: #1a2a22; }
html[data-theme="green"] .issue .i-main p { color: #324a3c; }
html[data-theme="green"] .work2r .col-c,
html[data-theme="green"] .work2r .col-r { color: #1a2a22; }
html[data-theme="green"] .work3 .col-l,
html[data-theme="green"] .work3 .col-c,
html[data-theme="green"] .work3 .col-r { color: #1a2a22; }
html[data-theme="green"] .modal { background: #fafdf3; color: #1a2a22; }
html[data-theme="green"] .modal-overlay { background: rgba(20, 40, 30, .35); }

/* 1.8.6 深色主题微调：封面卡白字在浅渐变 cover 上看不清，加 text-shadow + 半透明遮罩 */
.work-card .cover .title,
.work-card .cover .meta { text-shadow: 0 1px 6px rgba(0, 0, 0, .55), 0 0 2px rgba(0, 0, 0, .8); }
.work-card .cover::after { content: ''; position: absolute; inset: 0; background: linear-gradient(180deg, transparent 50%, rgba(0,0,0,.45) 100%); pointer-events: none; border-radius: inherit; }
.work-card .cover { position: relative; overflow: hidden; }
html[data-theme="light"] .dcard .front .cat { color: #696969; }
html[data-theme="light"] .dcard .front .val { color: #191919; }
html[data-theme="light"] .dcard .front .rare { color: #696969; }
html[data-theme="light"] .dcard .face { box-shadow: 0 8px 22px rgba(72, 72, 72,.16); }

/* 1.8.6 前置素材卡标签色：浅/绿主题下用同色系深版本，避免被浅背景吞掉 */
html[data-theme="light"] .flow-preface [style*="color:var(--p-300)"] { color: #282828 !important; }
html[data-theme="light"] .flow-preface [style*="color:var(--blue-400"] { color: #1e40af !important; }
html[data-theme="light"] .flow-preface [style*="color:#4ade80"] { color: #15803d !important; }
html[data-theme="light"] .flow-preface [style*="color:#fbbf24"] { color: #92400e !important; }
html[data-theme="light"] .flow-preface > div:first-child { color: #282828 !important; }
html[data-theme="green"] .flow-preface [style*="color:var(--p-300)"] { color: #1a2a22 !important; }
html[data-theme="green"] .flow-preface [style*="color:var(--blue-400"] { color: #16302a !important; }
html[data-theme="green"] .flow-preface [style*="color:#4ade80"] { color: #1a7a3e !important; }
html[data-theme="green"] .flow-preface [style*="color:#fbbf24"] { color: #6a4a10 !important; }
html[data-theme="green"] .flow-preface > div:first-child { color: #1a2a22 !important; }

/* 1.8.6 书名/书测标题：浅/绿主题下用深色，避开 gold-400 被浅背景吞 */
html[data-theme="light"] [style*="color:var(--gold-400)"] { color: #92400e !important; }
html[data-theme="green"] [style*="color:var(--gold-400)"] { color: #6a4a10 !important; }

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body { height: 100%; overflow: hidden; }

body {
  font-family: "PingFang SC", "Microsoft YaHei UI", "Microsoft YaHei", "Source Han Sans SC", system-ui, sans-serif;
  font-size: 13px;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

/* 三层质感底：底色 + 光晕 + 噪点 */
body::before {
  content: ""; position: fixed; inset: 0; z-index: -2;
  background:
    radial-gradient(900px 620px at 12% -8%, rgba(101, 101, 101, .40), transparent 62%),
    radial-gradient(760px 540px at 92% 4%, rgba(144, 144, 144, .20), transparent 60%),
    radial-gradient(1100px 800px at 60% 110%, rgba(79, 214, 232, .10), transparent 62%),
    linear-gradient(155deg, #131313 0%, #0d0d0d 46%, #090909 100%);
}
body::after {
  content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none; opacity: .32;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3'/%3E%3C/filter%3E%3Crect width='180' height='180' filter='url(%23n)' opacity='.35'/%3E%3C/svg%3E");
}

::-webkit-scrollbar { width: 9px; height: 9px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,.10); border-radius: 6px; border: 2px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,.20); background-clip: padding-box; }
/* 1.8.69：浅色/绿色主题下滑条改为深色半透明，修复「看不见滑条」 */
html[data-theme="light"] ::-webkit-scrollbar-thumb { background: rgba(20, 20, 20,.28); background-clip: padding-box; }
html[data-theme="light"] ::-webkit-scrollbar-thumb:hover { background: rgba(20, 20, 20,.45); background-clip: padding-box; }
html[data-theme="green"] ::-webkit-scrollbar-thumb { background: rgba(40,80,60,.32); background-clip: padding-box; }
html[data-theme="green"] ::-webkit-scrollbar-thumb:hover { background: rgba(40,80,60,.50); background-clip: padding-box; }

svg.icon { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; flex: none; pointer-events: none; }
svg.icon use { pointer-events: none; }

/* ========================= 标题栏 ========================= */
.titlebar {
  height: var(--titlebar-h);
  display: flex; align-items: center; gap: 12px;
  padding-left: 14px;
  background: rgba(10, 10, 10, .62);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
  -webkit-app-region: drag;
  position: relative; z-index: 40;
}
.tb-brand { display: flex; align-items: center; gap: 8px; font-weight: 600; letter-spacing: .04em; }
.tb-brand .logo {
  width: 20px; height: 20px; border-radius: 6px;
  background: linear-gradient(135deg, var(--p-400), var(--pink-500));
  display: grid; place-items: center; font-size: 11px;
  box-shadow: 0 0 14px rgba(132, 132, 132,.55);
}
.tb-brand small { color: var(--faint); font-weight: 400; font-size: 11px; }

.work-switch {
  -webkit-app-region: no-drag;
  margin-left: 10px; display: flex; align-items: center; gap: 8px;
  height: 25px; padding: 0 10px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 999px; cursor: pointer; transition: var(--t);
  max-width: 300px;
}
.work-switch:hover { background: var(--surface-2); border-color: var(--border-strong); }
.work-switch .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--green-400); box-shadow: 0 0 8px var(--green-400); flex: none; }
.work-switch b { font-weight: 500; font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.work-switch span { color: var(--faint); font-size: 11px; white-space: nowrap; }
/* 1.9.126 顶栏「关闭当前作品」×（点一下清空作品上下文回作品集） */
.ws-exit {
  -webkit-app-region: no-drag;
  margin-left: 4px; width: 22px; height: 22px; flex: none;
  display: grid; place-items: center;
  border-radius: 50%; border: 1px solid transparent;
  background: transparent; color: var(--muted);
  font-size: 16px; line-height: 1; cursor: pointer;
  transition: var(--t);
}
.ws-exit:hover { background: var(--surface-2); border-color: var(--border-strong); color: var(--red-400); }

.tb-spacer { flex: 1; }

.tb-tools { display: flex; align-items: center; gap: 6px; -webkit-app-region: no-drag; }
.tb-btn {
  height: 26px; display: flex; align-items: center; gap: 6px; padding: 0 9px;
  border-radius: 7px; border: 1px solid transparent; color: var(--text-2);
  background: transparent; cursor: pointer; font-size: 12px; transition: var(--t);
}
.tb-btn:hover { background: var(--surface); border-color: var(--border); color: var(--text); }
.tb-btn .badge {
  min-width: 15px; height: 15px; padding: 0 4px; border-radius: 999px;
  background: linear-gradient(135deg, var(--p-500), var(--pink-500));
  font-size: 10px; display: grid; place-items: center; color: #fff;
}
.tb-btn.spin svg { animation: spin 3.4s linear infinite; }
/* 顶栏图标统一尺寸，整齐对齐 */
.tb-btn .icon { width: 16px; height: 16px; flex: none; }
@keyframes spin { to { transform: rotate(360deg); } }

/* 操作历史记录弹窗 */
.hist-row { display: flex; gap: 10px; padding: 7px 2px; border-bottom: 1px solid var(--border); font-size: 12px; line-height: 1.5; }
.hist-row:last-child { border-bottom: 0; }
.hist-time { color: var(--muted); flex: none; font-variant-numeric: tabular-nums; }
.hist-text { color: var(--text-2); }

.win-ctrl { display: flex; -webkit-app-region: no-drag; margin-left: 6px; }
.win-ctrl button {
  width: 44px; height: var(--titlebar-h); border: 0; background: transparent;
  color: var(--text-2); cursor: pointer; display: grid; place-items: center; transition: background .16s;
}
.win-ctrl button:hover { background: rgba(255,255,255,.08); }
.win-ctrl button.close:hover { background: #e0384f; color: #fff; }

/* ========================= 布局 ========================= */
.shell { display: flex; height: calc(100vh - var(--titlebar-h)); }

/* ---- 侧边栏 ---- */
.sidebar {
  width: var(--sidebar-w); flex: none;
  background: rgba(9, 9, 9, .52);
  backdrop-filter: blur(18px);
  border-right: 1px solid var(--border);
  display: flex; flex-direction: column;
  transition: width .26s var(--ease);
  overflow: hidden;
}
body.mini .sidebar { width: var(--sidebar-w-mini); }
.sb-scroll { flex: 1; overflow-y: auto; overflow-x: hidden; padding: 10px 10px 14px; }

.sb-sect { margin-top: 12px; }
.sb-sect:first-child { margin-top: 2px; }
/* 1.9.117 分组标题放大：老大反馈「创作/生产」字太小 → 10px → 12px，提对比度、降字距，配左侧色条更醒目 */
.sb-sect > h4 {
  display: flex; align-items: center; gap: 7px;
  font-size: 12px; font-weight: 700; letter-spacing: .06em; color: var(--text-2);
  padding: 8px 10px 8px; text-transform: none;
}
.sb-sect > h4::before {
  content: ''; width: 3px; height: 12px; border-radius: 2px;
  background: linear-gradient(180deg, var(--p-400), var(--p-300));
  flex: none;
}
body.mini .sb-sect > h4 { opacity: 0; height: 12px; padding: 0; }

.nav-item {
  display: flex; align-items: center; gap: 10px;
  height: 34px; padding: 0 10px; border-radius: 9px;
  color: var(--text-2); cursor: pointer; position: relative;
  transition: background .18s, color .18s, transform .18s;
  white-space: nowrap; user-select: none;
}
.nav-item:hover { background: var(--surface); color: var(--text); }
.nav-item.active {
  background: linear-gradient(95deg, rgba(101, 101, 101,.42), rgba(144, 144, 144,.16));
  color: #fff; box-shadow: var(--inset-hi);
}
.nav-item.active::before {
  content: ""; position: absolute; left: -10px; top: 8px; bottom: 8px; width: 3px;
  border-radius: 0 3px 3px 0; background: linear-gradient(var(--p-300), var(--pink-500));
  box-shadow: 0 0 10px var(--p-400);
}
.nav-item .label { flex: 1; font-size: 13px; overflow: hidden; text-overflow: ellipsis; }
body.mini .nav-item .label, body.mini .nav-item .caret, body.mini .nav-item .pill { opacity: 0; width: 0; }
.nav-item .caret { transition: transform .2s var(--ease); color: var(--faint); }
.nav-item.open .caret { transform: rotate(90deg); }
.nav-item .pill {
  font-size: 10px; padding: 1px 6px; border-radius: 999px;
  background: rgba(255,255,255,.09); color: var(--muted);
}

.sub { overflow: hidden; max-height: 0; transition: max-height .3s var(--ease); }
.sub.open { max-height: 560px; }
body.mini .sub { display: none; }
.sub .nav-item { height: 29px; padding-left: 12px; margin-left: 14px; font-size: 12px; }
.sub .nav-item .idx {
  width: 18px; font-size: 10px; color: var(--faint);
  font-variant-numeric: tabular-nums; flex: none;
}
.sub .nav-item.done .idx { color: var(--green-400); }
.sub .nav-item.done .idx::after { content: "✓"; }
.sub .nav-item.done .idx span { display: none; }
.sub .nav-item.active::before { left: -12px; }

.sb-foot { padding: 10px; border-top: 1px solid var(--border); }
.lic-card {
  display: flex; align-items: center; gap: 9px; padding: 8px 9px;
  background: linear-gradient(120deg, rgba(242,196,107,.12), rgba(144, 144, 144,.08));
  border: 1px solid rgba(242,196,107,.25); border-radius: 10px; cursor: pointer;
  transition: var(--t);
}
.lic-card:hover { transform: translateY(-1px); box-shadow: var(--shadow); }
.lic-card .ico { color: var(--gold-400); }
.lic-card b { display: block; font-size: 12px; }
.lic-card small { color: var(--muted); font-size: 10px; }
body.mini .lic-card > div { display: none; }

/* ---- 内容区 ---- */
.content { flex: 1; overflow-y: auto; overflow-x: hidden; position: relative; }
.page { display: none; padding: 20px 24px 40px; animation: fadeUp .32s var(--ease); }
.page.active { display: block; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

.page-head { display: flex; align-items: flex-end; gap: 14px; margin-bottom: 16px; }
.page-head .ph-ico {
  width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; flex: none;
  background: linear-gradient(135deg, rgba(101, 101, 101,.55), rgba(144, 144, 144,.28));
  border: 1px solid var(--border-strong); box-shadow: var(--inset-hi);
}
.page-head h1 { font-size: 19px; font-weight: 600; letter-spacing: .02em; }
.page-head h1 .sub-t { font-size: 12px; color: var(--muted); font-weight: 400; margin-left: 8px; letter-spacing: 0; }
.page-head p { color: var(--muted); font-size: 12px; margin-top: 3px; max-width: 720px; line-height: 1.6; }
.page-head .ph-act { margin-left: auto; display: flex; gap: 8px; align-items: center; }

/* ========================= 通用元件 ========================= */
.btn {
  display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 13px;
  border-radius: 9px; border: 1px solid var(--border); background: var(--surface);
  color: var(--text); cursor: pointer; font-size: 12px; transition: var(--t); white-space: nowrap;
  font-family: inherit;
}
.btn:hover { background: var(--surface-2); border-color: var(--border-strong); transform: translateY(-1px); }
.btn.primary {
  background: linear-gradient(120deg, var(--p-500), var(--pink-500));
  border-color: transparent; color: #fff; box-shadow: 0 6px 18px rgba(101, 101, 101,.42), var(--inset-hi);
}
.btn.primary:hover { box-shadow: 0 10px 26px rgba(101, 101, 101,.55), var(--inset-hi); }
.btn.ghost { background: transparent; }
/* 按压态：点击瞬间明显的下沉/缩放反馈，避免用户误以为"没按到" */
.btn:active { transform: translateY(1px) scale(.96); filter: brightness(.94); }
.btn:focus-visible { outline: 2px solid var(--p-400); outline-offset: 1px; }
/* 删除按钮的醒目悬停/按压（红） */
.btn.danger { color: var(--red-400); border-color: var(--red-400); }
.btn.danger:hover, .btn[style*="red-400"]:hover { background: rgba(229,72,77,.16) !important; }
.btn.danger:active, .btn[style*="red-400"]:active { background: rgba(229,72,77,.28) !important; transform: translateY(1px) scale(.94); }
.btn.sm { height: 25px; padding: 0 9px; font-size: 11px; border-radius: 7px; }
.btn.gold { background: linear-gradient(120deg, #d9a441, #f2c46b); border-color: transparent; color: #2a1a05; font-weight: 600; }

.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  backdrop-filter: blur(12px); box-shadow: var(--inset-hi);
  transition: transform var(--t), box-shadow var(--t), border-color var(--t);
}
.card.hover:hover { transform: translateY(-3px); box-shadow: var(--shadow-lift), var(--inset-hi); border-color: var(--border-strong); }
.card-h {
  display: flex; align-items: center; gap: 8px; padding: 11px 14px;
  border-bottom: 1px solid var(--border); font-size: 13px; font-weight: 600;
}
.card-h .ico { color: var(--p-300); }
.card-h .right { margin-left: auto; display: flex; gap: 6px; align-items: center; color: var(--muted); font-weight: 400; font-size: 11px; }
.card-b { padding: 13px 14px; }

.grid { display: grid; gap: 14px; }
.g2 { grid-template-columns: repeat(2, minmax(0,1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0,1fr)); }
.g4 { grid-template-columns: repeat(4, minmax(0,1fr)); }
.row { display: flex; gap: 14px; align-items: flex-start; }
.row > .flex1 { flex: 1; min-width: 0; }

.tag {
  display: inline-flex; align-items: center; gap: 4px; height: 21px; padding: 0 8px;
  border-radius: 999px; font-size: 11px; background: rgba(255,255,255,.07);
  border: 1px solid var(--border); color: var(--text-2); white-space: nowrap;
}
.tag.p { background: rgba(101, 101, 101,.22); border-color: rgba(132, 132, 132,.4); color: #c8c8c8; }
.tag.k { background: rgba(79,214,232,.16); border-color: rgba(79,214,232,.34); color: #a5eff8; }
.tag.g { background: rgba(79,216,138,.15); border-color: rgba(79,216,138,.34); color: #a8f0c6; }
.tag.o { background: rgba(255,162,77,.16); border-color: rgba(255,162,77,.34); color: #ffd2a5; }
.tag.r { background: rgba(255,107,122,.16); border-color: rgba(255,107,122,.34); color: #ffb7bf; }
.tag.y { background: rgba(242,196,107,.16); border-color: rgba(242,196,107,.34); color: #f7dda6; }
.tag.local { background: rgba(79,216,138,.12); border-color: rgba(79,216,138,.3); color: #a8f0c6; }
.tag.api { background: rgba(101, 101, 101,.18); border-color: rgba(132, 132, 132,.38); color: #c8c8c8; }

.chips { display: flex; flex-wrap: wrap; gap: 6px; }

.stat-card { padding: 14px 15px; position: relative; overflow: hidden; }
.stat-card .lab { font-size: 11px; color: var(--muted); display: flex; align-items: center; gap: 6px; }
.stat-card .num {
  font-size: 26px; font-weight: 600; margin-top: 7px; letter-spacing: -.01em;
  font-variant-numeric: tabular-nums;
  background: linear-gradient(120deg, #fff, var(--p-300));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.stat-card .delta { font-size: 11px; margin-top: 4px; color: var(--green-400); }
.stat-card .glow {
  position: absolute; right: -22px; top: -22px; width: 90px; height: 90px; border-radius: 50%;
  background: radial-gradient(circle, rgba(132, 132, 132,.34), transparent 70%);
}

.bar { height: 5px; border-radius: 99px; background: rgba(255,255,255,.08); overflow: hidden; }
.bar > i { display: block; height: 100%; border-radius: 99px; background: linear-gradient(90deg, var(--p-500), var(--pink-500)); }
.bar.k > i { background: linear-gradient(90deg, var(--cyan-400), var(--p-400)); }
.bar.g > i { background: linear-gradient(90deg, var(--green-400), var(--cyan-400)); }
.bar.y > i { background: linear-gradient(90deg, var(--orange-400), var(--gold-400)); }

.kv { display: flex; justify-content: space-between; gap: 10px; padding: 6px 0; font-size: 12px; border-bottom: 1px dashed rgba(255,255,255,.07); }
.kv:last-child { border-bottom: 0; }
.kv .k { color: var(--muted); }
.kv .v { color: var(--text); text-align: right; }

.list-item {
  display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 9px;
  cursor: pointer; transition: var(--t); border: 1px solid transparent;
}
.list-item:hover { background: var(--surface); border-color: var(--border); }
.list-item.on { background: linear-gradient(95deg, rgba(101, 101, 101,.34), transparent); border-color: rgba(132, 132, 132,.35); }
.list-item .li-ico {
  width: 26px; height: 26px; border-radius: 8px; display: grid; place-items: center; flex: none;
  background: rgba(255,255,255,.06); border: 1px solid var(--border); font-size: 12px;
}
.list-item .li-main { flex: 1; min-width: 0; }
.list-item .li-main b { display: block; font-size: 12px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.list-item .li-main small { color: var(--faint); font-size: 11px; }
.list-item:hover .world-item-del { opacity: 1 !important; }
.world-item-del { transition: opacity .15s ease; }
.list-item.main-idea { background: linear-gradient(95deg, rgba(101, 101, 101,.18), transparent); border-color: rgba(132, 132, 132,.4); }
.idea-main-text { flex: none; margin-left: 8px; padding: 4px 9px; font-size: 11px; font-weight: 600; border-radius: 999px; cursor: pointer; transition: var(--t); white-space: nowrap; }
.idea-main-text.idea-main-set { color: #fbbf24; background: rgba(251,191,36,.15); border: 1px solid rgba(251,191,36,.35); box-shadow: 0 0 8px rgba(251,191,36,.25); }
.idea-main-text.idea-main-set:hover { background: rgba(251,191,36,.28); color: #f59e0b; box-shadow: 0 0 12px rgba(251,191,36,.45); }
.idea-main-text.idea-main-on { color: #fff; background: linear-gradient(135deg, rgba(101, 101, 101,.9), rgba(132, 132, 132,.85)); border: 1px solid rgba(132, 132, 132,.55); box-shadow: 0 0 10px rgba(101, 101, 101,.35); }
.idea-main-text.idea-main-on:hover { background: linear-gradient(135deg, rgba(132, 132, 132,.95), rgba(101, 101, 101,.95)); box-shadow: 0 0 14px rgba(101, 101, 101,.5); }

/* 灵感池条目：以内容展示为主，操作右置，防止窄容器竖排 */
.list-item.idea-pool-item { align-items: flex-start; padding: 10px 11px; flex-direction: row; }
.list-item.idea-pool-item .li-ico { flex: none; margin-top: 1px; }
.list-item.idea-pool-item .li-main { flex: 1; min-width: 0; }
.list-item.idea-pool-item .li-main b { display: block; font-size: 13px; font-weight: 600; color: var(--text); line-height: 1.4; white-space: normal; overflow: visible; text-overflow: clip; margin-bottom: 3px; word-break: break-word; }
.list-item.idea-pool-item .li-main small { display: block; color: var(--faint); font-size: 11px; line-height: 1.6; white-space: normal; word-break: break-word; }
.list-item.idea-pool-item .li-ops { flex: none; display: flex; align-items: center; gap: 6px; margin-left: 8px; flex-wrap: wrap; justify-content: flex-end; max-width: 40%; }
.list-item.idea-pool-item .idea-main-text { margin-left: 0; }

.dot-s { width: 7px; height: 7px; border-radius: 50%; flex: none; }
.dot-s.g { background: var(--green-400); box-shadow: 0 0 7px var(--green-400); }
.dot-s.y { background: var(--gold-400); box-shadow: 0 0 7px var(--gold-400); }
.dot-s.r { background: var(--red-400); box-shadow: 0 0 7px var(--red-400); }
.dot-s.m { background: var(--faint); }

table.tbl { width: 100%; border-collapse: collapse; font-size: 12px; }
table.tbl th {
  text-align: left; padding: 8px 10px; color: var(--muted); font-weight: 500; font-size: 11px;
  letter-spacing: .06em; border-bottom: 1px solid var(--border); white-space: nowrap;
}
table.tbl td { padding: 8px 10px; border-bottom: 1px solid rgba(255,255,255,.05); vertical-align: top; }
table.tbl tr:hover td { background: rgba(255,255,255,.03); }
table.tbl tr:last-child td { border-bottom: 0; }

.empty { text-align: center; padding: 34px 10px; color: var(--faint); font-size: 12px; }

/* 三栏工作区 */
.work3 { display: grid; grid-template-columns: 246px minmax(0,1fr) 306px; gap: 14px; align-items: start; }
.work2 { display: grid; grid-template-columns: 246px minmax(0,1fr); gap: 14px; align-items: start; }
.work2r { display: grid; grid-template-columns: minmax(0,1fr) 306px; gap: 14px; align-items: start; }
@media (max-width: 1320px) {
  .work3 { grid-template-columns: 216px minmax(0,1fr); }
  .work3 > .col-r { grid-column: 1 / -1; }
}
@media (max-width: 760px) {
  .work3 { grid-template-columns: 1fr; gap: 12px; }
  .work3 > .col-l,
  .work3 > .col-c,
  .work3 > .col-r { grid-column: 1 / -1; }
  .pool-scroll { max-height: 260px; }
}

/* 流程步骤条 */
.stepbar {
  display: flex; gap: 4px; overflow-x: auto; padding: 8px; margin-bottom: 14px;
  background: var(--soft); border: 1px solid var(--border); border-radius: 12px;
  scrollbar-width: thin;
}
.stepbar .step {
  display: flex; align-items: center; gap: 7px; padding: 6px 11px; border-radius: 8px;
  font-size: 12px; color: var(--muted); cursor: pointer; white-space: nowrap;
  border: 1px solid transparent; transition: var(--t);
}
.stepbar .step:hover { background: var(--surface); color: var(--text); }
.stepbar .step i {
  width: 17px; height: 17px; border-radius: 50%; display: grid; place-items: center;
  font-size: 10px; font-style: normal; background: rgba(255,255,255,.08); color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.stepbar .step.done i { background: rgba(79,216,138,.2); color: var(--green-400); }
.stepbar .step.active {
  background: linear-gradient(100deg, rgba(101, 101, 101,.4), rgba(144, 144, 144,.16));
  color: #fff; border-color: rgba(132, 132, 132,.4);
}
.stepbar .step.active i { background: linear-gradient(135deg, var(--p-400), var(--pink-500)); color: #fff; }

/* 底部操作条 */
.actionbar {
  display: flex; align-items: center; gap: 9px; margin-top: 14px; padding: 10px 13px;
  background: rgba(13, 13, 13,.72); backdrop-filter: blur(14px);
  border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--inset-hi);
  position: sticky; bottom: 0; z-index: 5; flex-wrap: wrap;
}
.actionbar .sel {
  display: flex; align-items: center; gap: 6px; height: 27px; padding: 0 10px;
  border-radius: 8px; background: var(--surface); border: 1px solid var(--border);
  font-size: 12px; color: var(--text-2); cursor: pointer; transition: var(--t);
  position: relative;
}
.actionbar .sel:hover { border-color: var(--border-strong); color: var(--text); }
/* 1.8.67：底部操作条下拉标签/值改用 text-2，避免 --faint 在暗底上几乎看不见 */
.actionbar .sel span { color: var(--text-2); }
.actionbar .sel:hover span { color: var(--text); }
.actionbar .sel select.inp {
  position: absolute; inset: 0; width: 100%; height: 100%;
  opacity: 0; cursor: pointer; z-index: 1;
}
#draftStyleDisplay { color: var(--text-2) !important; }
.actionbar .sp { flex: 1; }
/* 1.8.69：修复浅色/绿色主题下文风/人称文字看不见——根因是 .actionbar 背景硬编码深紫 rgba(13, 13, 13,.72)，
   浅色/绿色主题无覆盖规则，深字压深底。这里给两套主题补浅底覆盖，文字 var(--text-2) 即可读 */
html[data-theme="light"] .actionbar { background: rgba(255,255,255,.82); backdrop-filter: blur(14px); }
html[data-theme="green"] .actionbar { background: rgba(244,247,235,.88); backdrop-filter: blur(14px); }

/* 编辑器 */
.editor-wrap { background: rgba(9, 9, 9,.42); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.editor-bar {
  display: flex; align-items: center; gap: 5px; padding: 7px 10px;
  border-bottom: 1px solid var(--border); background: var(--soft); flex-wrap: wrap;
}
.editor-bar .eb {
  height: 24px; min-width: 24px; padding: 0 8px; border-radius: 6px; border: 1px solid transparent;
  background: transparent; color: var(--text-2); cursor: pointer; font-size: 11px;
  display: inline-flex; align-items: center; gap: 5px; transition: var(--t); font-family: inherit;
}
.editor-bar .eb:hover { background: var(--surface); border-color: var(--border); color: var(--text); }
.editor-bar .div { width: 1px; height: 15px; background: var(--border); margin: 0 3px; }
.editor-body {
  padding: 22px 30px; min-height: 300px; max-height: 460px; overflow-y: auto;
  font-family: "Source Han Serif SC", "Noto Serif SC", "SimSun", serif;
  /* P1 稿纸：17px / 1.9 —— 与 .editor-area 同一口径（见 polish.css 的「稿纸」一节） */
  font-size: 17px; line-height: 1.9; color: #dedede; letter-spacing: .015em;
}
.editor-body h3 {
  font-size: 16px; font-family: inherit; margin-bottom: 14px; color: #fff;
  letter-spacing: .06em; text-align: center; font-weight: 600;
}
.editor-body p { margin-bottom: 13px; text-indent: 2em; }
.editor-body p.typing::after {
  content: ""; display: inline-block; width: 2px; height: 15px; vertical-align: -2px;
  background: var(--p-300); margin-left: 2px; animation: caret .9s steps(1) infinite;
}
@keyframes caret { 50% { opacity: 0; } }
.editor-foot {
  display: flex; align-items: center; gap: 14px; padding: 8px 13px;
  border-top: 1px solid var(--border); background: var(--soft); font-size: 11px; color: var(--muted);
}
.editor-foot .sp { flex: 1; }

/* diff 对照 */
.diff { display: grid; grid-template-columns: 1fr 1fr; gap: 0; border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.diff > div { padding: 13px 15px; font-size: 13px; line-height: 1.95; }
.diff > div:first-child { border-right: 1px solid var(--border); background: rgba(255,107,122,.04); }
.diff > div:last-child { background: rgba(79,216,138,.05); }
.diff h5 { font-size: 11px; color: var(--muted); letter-spacing: .1em; margin-bottom: 9px; font-weight: 500; }
.diff del { background: rgba(255,107,122,.20); color: #ffc3ca; text-decoration: line-through; border-radius: 3px; padding: 0 2px; }
.diff ins { background: rgba(79,216,138,.20); color: #b6f2ce; text-decoration: none; border-radius: 3px; padding: 0 2px; }

/* 问题卡 */
.issue { display: flex; gap: 11px; padding: 11px 13px; border-radius: 10px; background: var(--surface); border: 1px solid var(--border); border-left: 3px solid var(--orange-400); transition: var(--t); }
.issue:hover { background: var(--surface-2); transform: translateX(2px); }
.issue.sev-h { border-left-color: var(--red-400); }
.issue.sev-l { border-left-color: var(--cyan-400); }
.issue .i-main { flex: 1; min-width: 0; }
.issue .i-main b { font-size: 12px; display: flex; align-items: center; gap: 7px; }
.issue .i-main p { font-size: 12px; color: var(--text-2); margin-top: 5px; line-height: 1.7; }
.issue .i-main .quote { border-left: 2px solid var(--border-strong); padding-left: 8px; color: var(--muted); margin-top: 5px; font-size: 11px; }
.issue .i-act { display: flex; gap: 5px; margin-top: 8px; flex-wrap: wrap; }

/* 仪表盘 */
.gauge { display: flex; align-items: center; gap: 18px; }
.gauge .ring { position: relative; width: 108px; height: 108px; flex: none; }
.gauge .ring svg { transform: rotate(-90deg); }
.gauge .ring .val {
  position: absolute; inset: 0; display: grid; place-items: center; flex-direction: column;
  font-size: 26px; font-weight: 600; font-variant-numeric: tabular-nums;
}
.gauge .ring .val small { display: block; font-size: 10px; color: var(--muted); font-weight: 400; margin-top: 2px; }
.gauge .metrics { flex: 1; display: grid; gap: 8px; }
.gauge .metrics .m { display: grid; grid-template-columns: 96px 1fr 38px; gap: 9px; align-items: center; font-size: 12px; }
.gauge .metrics .m span:first-child { color: var(--muted); }
.gauge .metrics .m span:last-child { text-align: right; color: var(--text-2); font-variant-numeric: tabular-nums; }

/* 热力图 */
.heat { display: flex; gap: 3px; }
.heat .col { display: grid; grid-template-rows: repeat(7, 1fr); gap: 3px; }
.heat i { width: 11px; height: 11px; border-radius: 3px; background: rgba(255,255,255,.055); display: block; transition: transform .16s; }
.heat i:hover { transform: scale(1.35); }
.heat i.l1 { background: rgba(101, 101, 101,.32); }
.heat i.l2 { background: rgba(101, 101, 101,.55); }
.heat i.l3 { background: rgba(132, 132, 132,.78); }
.heat i.l4 { background: linear-gradient(135deg, var(--p-400), var(--pink-500)); box-shadow: 0 0 8px rgba(132, 132, 132,.6); }

/* 书架卡片 */
.shelf { display: grid; grid-template-columns: repeat(auto-fill, minmax(196px, 1fr)); gap: 16px; }
.book { cursor: pointer; transition: transform .3s var(--ease), box-shadow .3s var(--ease); }
.book:hover { transform: translateY(-6px); }
.book .cover {
  aspect-ratio: 3/4.2; border-radius: 11px; position: relative; overflow: hidden;
  border: 1px solid var(--border-strong); box-shadow: var(--shadow), var(--inset-hi);
  display: flex; flex-direction: column; justify-content: flex-end; padding: 13px;
}
.book .cover::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(115deg, transparent 38%, rgba(255,255,255,.18) 50%, transparent 62%);
  transform: translateX(-110%); transition: transform .7s var(--ease);
}
.book:hover .cover::after { transform: translateX(110%); }
.book .cover .spine { position: absolute; left: 0; top: 0; bottom: 0; width: 7px; background: rgba(0,0,0,.34); box-shadow: inset -2px 0 5px rgba(0,0,0,.44); }
.book .cover .bt { font-size: 16px; font-weight: 600; letter-spacing: .08em; text-shadow: 0 2px 12px rgba(0,0,0,.55); line-height: 1.4; }
.book .cover .bs { font-size: 11px; color: rgba(255,255,255,.72); margin-top: 5px; }
.book .cover .badge-st {
  position: absolute; top: 10px; right: 10px; font-size: 10px; padding: 2px 7px; border-radius: 999px;
  background: rgba(0,0,0,.42); backdrop-filter: blur(6px); border: 1px solid rgba(255,255,255,.2);
}
.book .meta { margin-top: 9px; }
.book .meta b { font-size: 13px; display: block; }
.book .meta .mrow { display: flex; align-items: center; gap: 6px; margin-top: 6px; font-size: 11px; color: var(--muted); }
.book .meta .bar { flex: 1; }

/* 抽卡：默认 5 个一排，宽度不足时明确 2+3 两行 */
/* 抽卡卡布局：.draw-area / .dcard 基础尺寸在上方「碰撞控件」区统一定义（自适应网格） */
.dcard .inner { position: relative; width: 100%; height: 100%; transform-style: preserve-3d; transition: transform .72s var(--ease); }
.dcard.flip .inner { transform: rotateY(180deg); }
.dcard .face {
  position: absolute; inset: 0; backface-visibility: hidden; border-radius: 12px;
  border: 1px solid var(--border-strong); display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 8px; padding: 12px; text-align: center;
  box-shadow: var(--shadow), var(--inset-hi);
}
.dcard .back {
  background: radial-gradient(circle at 50% 40%, rgba(101, 101, 101,.5), rgba(16, 16, 16,.95));
}
.dcard .back .rune { font-size: 26px; opacity: .82; animation: breathe 3.4s ease-in-out infinite; }
@keyframes breathe { 50% { opacity: .45; transform: scale(.94); } }
.dcard .front {
  transform: rotateY(180deg);
  background: linear-gradient(160deg, rgba(45, 45, 45,.92), rgba(16, 16, 16,.95));
}
.dcard .front .cat { font-size: 10px; color: var(--muted); letter-spacing: .16em; }
.dcard .front .val { font-size: 14px; font-weight: 600; line-height: 1.5; }
.dcard .front .rare { font-size: 10px; }
.dcard .lock { position: absolute; top: 7px; right: 8px; font-size: 11px; opacity: .5; z-index: 3; }
.dcard.locked .front { border-color: var(--gold-400); box-shadow: 0 0 18px rgba(242,196,107,.34), var(--inset-hi); }
.dcard.locked .lock { opacity: 1; }

.magic-ring { position: relative; display: grid; place-items: center; padding: 6px 0 14px; }
.magic-ring svg { position: absolute; opacity: .30; pointer-events: none; }
.magic-ring .r1 { animation: spin 26s linear infinite; }
.magic-ring .r2 { animation: spin 17s linear infinite reverse; }
.magic-ring .r3 { animation: spin 11s linear infinite; }

/* 节点画布 */
.canvas {
  position: relative; height: 428px; border-radius: var(--radius); overflow: hidden;
  border: 1px solid var(--border);
  background-color: rgba(9, 9, 9,.42);
  background-image: radial-gradient(rgba(255,255,255,.075) 1px, transparent 1px);
  background-size: 19px 19px;
}
.node {
  position: absolute; width: 148px; border-radius: 10px; cursor: grab;
  background: linear-gradient(150deg, rgba(36, 36, 36,.96), rgba(17, 17, 17,.96));
  border: 1px solid var(--border-strong); box-shadow: var(--shadow), var(--inset-hi);
  transition: box-shadow var(--t), border-color var(--t), transform var(--t);
  user-select: none;
}
.node:hover { transform: translateY(-2px); border-color: var(--p-400); box-shadow: 0 10px 28px rgba(101, 101, 101,.4), var(--inset-hi); }
.node.run { border-color: var(--cyan-400); animation: nodePulse 1.4s ease-in-out infinite; }
@keyframes nodePulse { 50% { box-shadow: 0 0 0 5px rgba(79,214,232,.14), 0 10px 28px rgba(79,214,232,.34); } }
.node .nh { display: flex; align-items: center; gap: 6px; padding: 7px 9px; border-bottom: 1px solid var(--border); font-size: 12px; font-weight: 500; }
.node .nh .nd { width: 6px; height: 6px; border-radius: 50%; flex: none; }
.node .nb { padding: 7px 9px; font-size: 11px; color: var(--muted); line-height: 1.55; }
.node .port { position: absolute; width: 9px; height: 9px; border-radius: 50%; background: var(--p-400); border: 2px solid var(--bg); top: 50%; margin-top: -4.5px; }
.node .port.in { left: -5px; }
.node .port.out { right: -5px; }
.wire { position: absolute; inset: 0; pointer-events: none; }
.wire path { fill: none; stroke: rgba(132, 132, 132,.5); stroke-width: 1.8; }
.wire path.flow { stroke: var(--cyan-400); stroke-dasharray: 5 7; animation: dash 1s linear infinite; }
@keyframes dash { to { stroke-dashoffset: -12; } }

/* 素材墙 */
.mwall { display: grid; grid-template-columns: repeat(auto-fill, minmax(126px, 1fr)); gap: 11px; }
.shot { border-radius: 10px; overflow: hidden; border: 1px solid var(--border); background: var(--soft); }
.shot .thumb { aspect-ratio: 9/16; position: relative; display: grid; place-items: center; font-size: 22px; }
.shot .thumb .no { position: absolute; left: 6px; top: 6px; font-size: 10px; padding: 1px 5px; border-radius: 5px; background: rgba(0,0,0,.5); }
.shot .cap { padding: 6px 7px; font-size: 10px; color: var(--muted); border-top: 1px solid var(--border); }
.skeleton {
  background: linear-gradient(100deg, rgba(255,255,255,.045) 30%, rgba(255,255,255,.13) 50%, rgba(255,255,255,.045) 70%);
  background-size: 220% 100%; animation: shimmer 1.5s linear infinite;
}
@keyframes shimmer { to { background-position: -220% 0; } }

/* 时间轴 */
.tline { position: relative; padding-left: 20px; }
.tline::before { content: ""; position: absolute; left: 5px; top: 5px; bottom: 5px; width: 1.5px; background: linear-gradient(var(--p-500), transparent); }
.tline .ti { position: relative; padding: 0 0 15px; }
.tline .ti::before {
  content: ""; position: absolute; left: -18.5px; top: 5px; width: 8px; height: 8px; border-radius: 50%;
  background: var(--p-400); box-shadow: 0 0 0 3px rgba(101, 101, 101,.22);
}
.tline .ti b { font-size: 12px; }
.tline .ti small { color: var(--faint); font-size: 11px; margin-left: 7px; }
.tline .ti p { color: var(--muted); font-size: 12px; margin-top: 4px; line-height: 1.65; }

/* 专注模式（1.8.5）：F11 / 按钮 / Esc 切换；隐藏侧栏/顶部/底部/助手，稿纸居中全屏 */
/* 1.9.108 重做：稿纸真正居中放大（原来 col 隐藏后 grid 列宽残留，稿纸挤在左侧），加可点击退出按钮 */
body.focus-mode .sidebar,
body.focus-mode .topbar,
body.focus-mode .drawer-wrap,
body.focus-mode .work-switch,
body.focus-mode .stepbar,
body.focus-mode .page-head,
body.focus-mode .editor-foot,
body.focus-mode .col-l,
body.focus-mode .col-r,
body.focus-mode .model-bar,
body.focus-mode .work3 > .card { display: none !important; }
body.focus-mode .work3 { display: block !important; padding: 12px 16px !important; max-width: none; }
body.focus-mode .col-c { display: block !important; max-width: min(900px, 92vw) !important; margin: 0 auto !important; }
body.focus-mode .editor-wrap { height: calc(100vh - 24px) !important; display: flex !important; flex-direction: column; }
body.focus-mode .editor-bar { opacity: .35; transition: opacity .15s; }
body.focus-mode .editor-bar:hover { opacity: 1; }
body.focus-mode .editor-area { flex: 1 !important; height: auto !important; font-size: 17px !important; line-height: 1.9 !important; padding: 26px 34px !important; }
body.focus-mode::after {
  content: '专注模式 · F11 / Esc 退出'; position: fixed; left: 50%; transform: translateX(-50%); bottom: 12px;
  font-size: 11px; color: var(--faint); background: var(--soft); border: 1px solid var(--border);
  padding: 4px 12px; border-radius: 12px; pointer-events: none; z-index: 9999;
}
body.focus-mode .focus-exit {
  position: fixed; right: 16px; top: 14px; z-index: 10000; display: inline-flex; align-items: center; gap: 6px;
  font-size: 12px; color: var(--text-1); background: var(--soft); border: 1px solid var(--border);
  padding: 6px 14px; border-radius: 16px; cursor: pointer;
}
body.focus-mode .focus-exit:hover { border-color: var(--p-400, #848484); color: #fff; }

/* 看板：横版排版（1.8.7）—— 每卷独占一行，卷内 arc 横向铺开 + 完整 desc 直接显示 */
.kan {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  padding-bottom: 6px;
  min-width: 0;
}
.kan .kcol { background: var(--soft); border: 1px solid var(--border); border-radius: 11px; padding: 9px 11px; }
.kan .kcol > h5 { font-size: 13px; margin-bottom: 8px; display: flex; align-items: center; gap: 6px; }
.kan .kcol > h5 .vbar { margin-left: auto; display: flex; align-items: center; gap: 6px; color: var(--faint); font-size: 10px; font-weight: 400; }
.kan .kcol > h5 .vbar .krange { width: 56px; height: 4px; background: rgba(132, 132, 132,.18); border-radius: 2px; overflow: hidden; }
.kan .kcol > h5 .vbar .krange i { display: block; height: 100%; background: linear-gradient(90deg, #848484, #909090); }
.kan .krow {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 8px;
  margin-bottom: 6px;
}
.kan .kcard-h {
  background: var(--surface); border: 1px solid var(--border); border-radius: 8px;
  padding: 7px 10px; display: block; min-height: 28px;
}
.kan .kcard-h b { font-size: 12px; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text); }
.kan .kcard-h .kctag { font-size: 10px; color: var(--faint); flex: 0 0 auto; }
.kan::-webkit-scrollbar { height: 8px; }
.kan::-webkit-scrollbar-track { background: rgba(255,255,255,.06); border-radius: 4px; }
.kan::-webkit-scrollbar-thumb { background: rgba(132, 132, 132,.55); border-radius: 4px; }
.kan::-webkit-scrollbar-thumb:hover { background: rgba(132, 132, 132,.8); }
.kan .kcol { background: var(--soft); border: 1px solid var(--border); border-radius: 11px; padding: 10px 12px; }
.kan .kcol > h5 { font-size: 13px; margin-bottom: 8px; display: flex; align-items: center; gap: 6px; color: var(--text); font-weight: 700; }
.kan .kcol > h5 span { margin-left: auto; color: var(--faint); font-size: 11px; font-weight: 500; }
.kan .kcol > h5 .vbar .kctag[style*="cursor:pointer"] { width: 20px; height: 20px; display: inline-flex; align-items: center; justify-content: center; border-radius: 5px; background: rgba(255,107,122,.18); color: var(--red-400); margin-left: 4px; font-size: 13px; }
.kan .kcol > h5 .vbar .kctag[style*="cursor:pointer"]:hover { background: rgba(255,107,122,.32); }
.kcard {
  background: var(--surface); border: 1px solid var(--border); border-radius: 9px; padding: 9px;
  margin-bottom: 7px; cursor: grab; transition: var(--t);
}
.kcard:hover { transform: translateY(-2px); border-color: var(--border-strong); box-shadow: var(--shadow); }
.kcard b { font-size: 12px; display: block; }
.kcard p { font-size: 11px; color: var(--muted); margin-top: 4px; line-height: 1.6; }
.kcard .kf { display: flex; align-items: center; gap: 6px; margin-top: 7px; }

/* 关系图 */
.graph-box { height: 258px; border-radius: var(--radius); border: 1px solid var(--border); background: rgba(9, 9, 9,.34); position: relative; overflow: hidden; }
.graph-box svg { width: 100%; height: 100%; }
.graph-box .gn { cursor: pointer; }
.graph-box .gn:hover circle { stroke: #fff; stroke-width: 2; }

/* 表单 */
.field { margin-bottom: 11px; }
.field > label { display: block; font-size: 11px; color: var(--muted); margin-bottom: 5px; }
.inp, .field select, .field textarea, .field input {
  width: 100%; background: rgba(0,0,0,.24); border: 1px solid var(--border); border-radius: 8px;
  padding: 7px 10px; color: var(--text); font-size: 12px; font-family: inherit; outline: none; transition: var(--t);
}
.inp:focus, .field select:focus, .field textarea:focus, .field input:focus { border-color: var(--p-400); box-shadow: 0 0 0 3px rgba(101, 101, 101,.16); }
.field textarea { resize: vertical; min-height: 62px; line-height: 1.7; }
.field select option { background: #171717; }
/* 底部操作条（正文页模型/文风选择器）下拉菜单可读性 */
.actionbar .sel select.inp,
.actionbar .sel select.inp option,
.actionbar .sel select.inp optgroup { color: var(--text) !important; background: var(--surface-2) !important; }
html[data-theme="light"] .actionbar .sel select.inp,
html[data-theme="light"] .actionbar .sel select.inp option,
html[data-theme="light"] .actionbar .sel select.inp optgroup { color: #141414 !important; background: #ffffff !important; }
/* 1.8.29 修复深色主题下模型/文风下拉选项文字看不清 */
html[data-theme="dark"] .actionbar .sel select.inp option { background: #272727 !important; color: #f2f2f2 !important; }
html[data-theme="dark"] .actionbar .sel select.inp { background: rgba(28, 28, 28,.85) !important; color: var(--text) !important; }
.range { -webkit-appearance: none; width: 100%; height: 4px; border-radius: 99px; background: rgba(255,255,255,.1); outline: none; }
.range::-webkit-slider-thumb {
  -webkit-appearance: none; width: 14px; height: 14px; border-radius: 50%;
  background: linear-gradient(135deg, var(--p-400), var(--pink-500)); cursor: pointer;
  box-shadow: 0 0 9px rgba(132, 132, 132,.65);
}
.switch-row { display: flex; align-items: center; justify-content: space-between; padding: 8px 0; border-bottom: 1px dashed rgba(255,255,255,.07); font-size: 12px; }
.switch-row:last-child { border-bottom: 0; }
.sw { width: 38px; height: 22px; border-radius: 99px; background: rgba(255,255,255,.16); position: relative; cursor: pointer; transition: var(--t); flex: none; border: 1px solid rgba(0,0,0,0.12); }
.sw::after { content: ""; position: absolute; left: 3px; top: 2px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.35); transition: var(--t); }
.sw.on { background: linear-gradient(120deg, var(--p-500), var(--pink-500)); border-color: transparent; }
.sw.on::after { left: 19px; }
/* 浅色/绿色主题：OFF 开关加深背景 + 加深滑块边框，确保开关状态可见 */
html[data-theme="light"] .sw { background: #c0c0c0; border-color: rgba(0,0,0,.18); }
html[data-theme="light"] .sw::after { background: #ffffff; box-shadow: 0 1px 3px rgba(0,0,0,.28); }
html[data-theme="light"] .sw.on { background: linear-gradient(120deg, #656565, #909090); border-color: transparent; }
html[data-theme="green"] .sw { background: #b5c8b5; border-color: rgba(20, 60, 40, .22); }
html[data-theme="green"] .sw::after { background: #ffffff; box-shadow: 0 1px 3px rgba(0, 60, 30, .25); }
html[data-theme="green"] .sw.on { background: linear-gradient(120deg, #3b7a64, #c08a52); border-color: transparent; }

/* 能力灯板 */
.cap-row { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-bottom: 1px dashed rgba(255,255,255,.07); font-size: 12px; }
.cap-row:last-child { border-bottom: 0; }
.cap-row .cn { width: 88px; color: var(--text-2); }
.cap-row .cs { flex: 1; color: var(--muted); font-size: 12px; }

/* 宠物 */
.pet {
  position: fixed; right: 22px; bottom: 26px; z-index: 60; width: 60px; height: 60px;
  display: grid; place-items: center; cursor: grab; user-select: none;
  transition: left .35s var(--ease), right .35s var(--ease), top .35s var(--ease), transform .2s var(--ease);
}
.pet.dragging { transition: none; cursor: grabbing; transform: scale(1.08); }
.pet .body { width: 48px; height: 48px; object-fit: contain; animation: petFloat 3.2s ease-in-out infinite; filter: drop-shadow(0 6px 12px rgba(0,0,0,.5)); pointer-events: auto; }
@keyframes petFloat { 50% { transform: translateY(-9px); } }
.pet .shadow { position: absolute; bottom: -4px; width: 26px; height: 6px; border-radius: 50%; background: rgba(0,0,0,.34); filter: blur(3px); animation: petShadow 3.2s ease-in-out infinite; }
@keyframes petShadow { 50% { transform: scaleX(.66); opacity: .5; } }
.pet .st {
  position: absolute; top: -6px; left: 50%; transform: translateX(-50%);
  font-size: 10px; padding: 1px 7px; border-radius: 999px; white-space: nowrap;
  background: rgba(16, 16, 16,.9); border: 1px solid var(--border-strong); color: var(--text-2);
}

/* 任务抽屉 */
.drawer {
  position: fixed; right: 14px; top: calc(var(--titlebar-h) + 10px); width: 320px; z-index: 55;
  background: rgba(14, 14, 14,.94); backdrop-filter: blur(20px);
  border: 1px solid var(--border-strong); border-radius: 14px; box-shadow: var(--shadow-lift);
  opacity: 0; transform: translateY(-8px) scale(.98); pointer-events: none; transition: var(--t);
}
.drawer.open { opacity: 1; transform: none; pointer-events: auto; }

/* toast */
.toast-wrap { position: fixed; left: 50%; bottom: 26px; transform: translateX(-50%); z-index: 90; display: grid; gap: 8px; }
.toast {
  padding: 9px 16px; border-radius: 999px; font-size: 12px;
  background: rgba(17, 17, 17,.95); border: 1px solid var(--border-strong);
  box-shadow: var(--shadow-lift); animation: toastIn .3s var(--ease);
}
@keyframes toastIn { from { opacity: 0; transform: translateY(12px); } }

/* stagger 入场 */
.stag > * { animation: fadeUp .42s var(--ease) both; animation-delay: calc(var(--i, 0) * 55ms); }

/* 无障碍降级 */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ============ P1 新增样式 ============ */

/* 通用编辑器（正文 textarea） */
.editor-area {
  width: 100%; min-height: 420px; max-height: 60vh; resize: vertical;
  border: 0; outline: none; background: transparent; color: #dedede;
  font-family: "Source Han Serif SC", "Noto Serif SC", "SimSun", serif;
  font-size: 17px; line-height: 1.9; letter-spacing: .015em; padding: 22px 30px;
}
.editor-area::placeholder { color: var(--faint); }

/* 1.8.60 正文手机阅读模式：模拟 375px 手机屏宽度 */
.editor-wrap.mobile-preview {
  max-width: 375px;
  margin: 0 auto;
  box-shadow: 0 0 0 10px rgba(255,255,255,.05), 0 24px 60px rgba(0,0,0,.35);
  border-radius: 18px;
  background: var(--panel);
}
.editor-wrap.mobile-preview .editor-area {
  font-size: 17px;
  line-height: 1.85;
  padding: 22px 18px;
  min-height: 520px;
  max-height: 70vh;
}

/* 章节树（正文页左侧） */
.chap-list { display: grid; gap: 6px; max-height: calc(100vh - 240px); overflow-y: auto; overflow-x: hidden; padding-right: 4px; scrollbar-width: thin; scrollbar-color: rgba(132, 132, 132,.35) transparent; }
.chap-list::-webkit-scrollbar { width: 6px; }
.chap-list::-webkit-scrollbar-track { background: transparent; }
.chap-list::-webkit-scrollbar-thumb { background: rgba(132, 132, 132,.32); border-radius: 3px; }
.chap-list::-webkit-scrollbar-thumb:hover { background: rgba(132, 132, 132,.55); }
.chap {
  display: flex; gap: 9px; align-items: center; padding: 8px 9px; border-radius: 9px;
  cursor: pointer; border: 1px solid transparent; transition: var(--t);
}
.chap:hover { background: var(--surface); }
.chap.on { background: rgba(132, 132, 132,.14); border-color: rgba(132, 132, 132,.4); }
.chap .cno {
  width: 26px; height: 26px; flex: none; display: grid; place-items: center; border-radius: 7px;
  background: var(--soft); color: var(--p-300); font-size: 11px; font-weight: 600;
}
.chap .ct { display: flex; flex-direction: column; min-width: 0; }
.chap .ct b { font-size: 12px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chap .ct small { font-size: 10px; color: var(--muted); }

/* 作品集封面删除按钮 */
.book .book-del {
  position: absolute; top: 6px; right: 6px; width: 22px; height: 22px; border-radius: 50%;
  border: 0; background: rgba(0,0,0,.4); color: #fff; cursor: pointer; font-size: 16px; line-height: 1;
  opacity: 0; transition: var(--t);
}
.book:hover .book-del { opacity: 1; }
.book .book-del:hover { background: var(--red-500); }

/* 空状态 */
.empty.sm { padding: 18px 10px; }
.empty h3 { font-size: 16px; color: var(--text); margin: 12px 0 6px; font-weight: 600; }
.empty p { color: var(--muted); max-width: 320px; margin: 0 auto 14px; line-height: 1.7; }
.empty .e-ico {
  width: 64px; height: 64px; margin: 0 auto; border-radius: 18px; display: grid; place-items: center;
  background: linear-gradient(135deg, rgba(132, 132, 132,.25), rgba(144, 144, 144,.12)); color: var(--p-300);
}

/* 更新日志 */
.changelog { display: flex; flex-direction: column; gap: 16px; max-width: 860px; }
.cl-item {
  border: 1px solid var(--border); border-radius: 14px; padding: 16px 18px;
  background: linear-gradient(135deg, rgba(132, 132, 132,.06), rgba(144, 144, 144,.03));
}
.cl-head { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; flex-wrap: wrap; }
.cl-ver { font-size: 16px; font-weight: 700; color: var(--text); }
.cl-date { font-size: 12px; color: var(--faint); }
.cl-list { margin: 0; padding-left: 18px; }
.cl-list li { font-size: 13px; color: var(--muted); line-height: 1.9; }

.trope-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.trope-card { background: var(--surface); border: 1px solid var(--border); border-radius: 11px; padding: 10px 12px; cursor: pointer; transition: .15s; }
.trope-card:hover { border-color: var(--p-400); transform: translateY(-2px); }
.trope-card.lk { border-color: var(--p-400); background: rgba(111, 111, 111,.08); }
.tc-top { display: flex; align-items: center; gap: 6px; margin-bottom: 6px; }
.tc-body { font-size: 13px; line-height: 1.7; color: var(--text-2); min-height: 34px; }
.tc-foot { font-size: 11px; color: var(--faint); margin-top: 6px; text-align: right; }

/* 弹窗 */
.modal-overlay {
  position: fixed; inset: 0; z-index: 200; display: grid; place-items: center;
  background: rgba(7, 7, 7,.6); backdrop-filter: blur(6px); opacity: 0; transition: opacity .22s var(--ease);
}
.modal-overlay.show { opacity: 1; }
.modal {
  position: relative; width: 440px; max-width: calc(100vw - 32px); max-height: calc(100vh - 60px); overflow: auto;
  background: rgba(17, 17, 17,.98); border: 1px solid var(--border-strong); border-radius: 16px;
  box-shadow: var(--shadow-lift); padding: 20px 22px; transform: translateY(10px) scale(.98); transition: transform .22s var(--ease);
}
.modal-overlay.show .modal { transform: none; }
.modal.wide { width: 680px; }
/* 1.8.69：全屏弹窗——关系图谱放大查看用；flex 纵向布局让内容区自动撑满剩余高度 */
.modal.full {
  display: flex; flex-direction: column;
  width: min(96vw, 1560px); height: calc(100vh - 44px); max-height: calc(100vh - 44px);
  padding: 16px 20px; overflow: hidden;
}
.modal.full > .mh { margin-bottom: 10px; flex: none; }
/* 图谱缩放控件条 */
.rel-zoom-bar { display: inline-flex; align-items: center; gap: 5px; margin-left: auto; }
.rel-zoom-bar button {
  width: 26px; height: 26px; border: 1px solid var(--border); border-radius: 7px; cursor: pointer;
  background: var(--surface); color: var(--text-2); font-size: 14px; line-height: 1; transition: var(--t);
}
.rel-zoom-bar button:hover { border-color: var(--border-strong); color: var(--text); background: var(--surface-2); }
.rel-zoom-bar .zlab { font-size: 12px; color: var(--text-2); min-width: 40px; text-align: center; font-variant-numeric: tabular-nums; }
.rel-zoom-wrap { overflow: auto; cursor: grab; border-radius: 10px; min-height: 0; }
.rel-zoom-wrap.dragging { cursor: grabbing; }
.rel-zoom-wrap.dragging svg { pointer-events: none; }
.modal-x {
  position: absolute; top: 10px; right: 12px; width: 28px; height: 28px; border: 0; border-radius: 8px;
  background: transparent; color: var(--muted); font-size: 19px; cursor: pointer; line-height: 1;
}
.modal-x:hover { background: var(--surface); color: var(--text); }
.modal .mh { font-size: 16px; font-weight: 600; margin-bottom: 14px; letter-spacing: .02em; }
.modal .mb { margin-bottom: 14px; }
.modal .mb:last-child { margin-bottom: 0; }

/* 封面色板 */
.swatch { width: 34px; height: 34px; border-radius: 9px; cursor: pointer; border: 2px solid transparent; transition: var(--t); }
.swatch.on { border-color: #fff; box-shadow: 0 0 0 2px var(--p-400); }

/* 仓库切换列表 */
.pick-row {
  display: flex; align-items: center; gap: 11px; padding: 10px 12px; border-radius: 10px; cursor: pointer;
  border: 1px solid transparent; transition: var(--t);
}
.pick-row:hover { background: var(--surface); border-color: var(--border); }
.pick-row .dot { width: 12px; height: 12px; border-radius: 50%; flex: none; }
.pick-row b { font-size: 13px; font-weight: 500; }
.pick-row small { color: var(--muted); font-size: 11px; }

/* 加载遮罩 */
.loading-mask {
  position: fixed; inset: 0; z-index: 120; display: none; place-items: center; flex-direction: column; gap: 14px;
  background: rgba(7, 7, 7,.5); backdrop-filter: blur(3px);
}
.loading-mask.show { display: grid; }
.loading-mask .spinner {
  width: 38px; height: 38px; border-radius: 50%; border: 3px solid rgba(255,255,255,.15);
  border-top-color: var(--p-400); animation: spin .8s linear infinite;
}
.loading-mask .ltxt { color: var(--text-2); font-size: 13px; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ===== 非阻塞生成提示（不锁全局 UI，仅顶部提示「AI 正在生成中…」） ===== */
.gen-hint {
  position: fixed; top: 14px; left: 50%; transform: translateX(-50%) translateY(-12px);
  z-index: 150; display: none; align-items: center; gap: 9px;
  padding: 8px 16px; border-radius: 999px;
  background: var(--surface-2); border: 1px solid var(--border-strong);
  color: var(--text); font-size: 13px; box-shadow: var(--shadow);
  pointer-events: none; opacity: 0; transition: opacity .2s, transform .2s;
}
.gen-hint.show { display: flex; opacity: 1; transform: translateX(-50%) translateY(0); }
.gen-hint::before {
  content: ''; width: 14px; height: 14px; border-radius: 50%;
  border: 2px solid rgba(255,255,255,.18); border-top-color: var(--p-400);
  animation: spin .8s linear infinite;
}

/* ===== 任务抽屉：真实任务行 ===== */
.task-row { display: flex; align-items: center; gap: 9px; padding: 9px 11px; background: rgba(255,255,255,.03); border: 1px solid rgba(255,255,255,.06); border-radius: 9px; }
.task-row b { font-size: 12px; font-weight: 600; color: var(--text); }
.task-row small { margin-left: auto; font-size: 11px; color: var(--muted); }
/* 1.8.7 任务取消按钮：× 直接收在 task-row 右侧 */
.task-row .task-x {
  width: 22px; height: 22px; display: inline-flex; align-items: center; justify-content: center;
  border-radius: 6px; border: 1px solid rgba(255,107,122,.35); background: rgba(255,107,122,.15);
  color: #ff8a98; font-size: 14px; font-weight: 700; cursor: pointer; margin-left: 8px; padding: 0; line-height: 1;
  transition: var(--t);
}
.task-row .task-x:hover { background: rgba(255,107,122,.32); color: #fff; border-color: #ff6b7a; }
.dot-s.run { background: var(--p-500); box-shadow: 0 0 7px var(--p-500); animation: pulse 1.4s ease-in-out infinite; }
.dot-s.ok { background: var(--green-400); box-shadow: 0 0 7px var(--green-400); }
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: .4; } }

/* ===== 灵感池删除按钮 ===== */
.li-x { margin-left: 6px; width: 18px; height: 18px; line-height: 16px; text-align: center; border-radius: 50%; color: var(--muted); cursor: pointer; flex: none; transition: var(--t); }
.li-x:hover { background: rgba(255,107,122,.2); color: var(--red-400); }

/* ===== 反套路勾选列表 ===== */
.suit-list { display: grid; grid-template-columns: 1fr 1fr; gap: 5px 12px; margin-top: 2px; }
.suit-item { display: flex; align-items: center; gap: 6px; font-size: 11px; color: var(--text-2); cursor: pointer; }
.suit-item input { accent-color: var(--p-500); }

/* ===== 碰撞控件 ===== */
.collide-ctl { display: grid; grid-template-columns: 1fr 1fr; gap: 2px 14px; }
.collide-ctl .field { margin-bottom: 9px; min-width: 0; }
.collide-ctl .field.full { grid-column: 1 / -1; }
.collide-ctl .field label { display: flex; justify-content: space-between; align-items: center; }
.collide-ctl .range { width: 100%; }
/* 灵感池长列表内部滚动，避免撑爆左栏 */
.pool-scroll { max-height: calc(100vh - 248px); overflow-y: auto; padding-right: 4px; margin-right: -4px; }
/* 抽卡卡自适应：宽屏多列、窄屏居中 */
.draw-area { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 12px; justify-items: center; padding: 8px 0; }
.dcard { width: 100%; max-width: 124px; height: 168px; perspective: 1000px; cursor: pointer; }

/* ===== 全局搜索 ===== */
.search-modal { width: 560px; }
.search-box { display: flex; align-items: center; gap: 10px; padding: 10px 14px; background: var(--surface); border: 1px solid var(--border-strong); border-radius: 12px; }
.search-box input { flex: 1; background: transparent; border: 0; color: var(--text); font-size: 14px; outline: none; }
.search-box input::placeholder { color: var(--faint); }
.search-hits { max-height: 360px; overflow-y: auto; margin-top: 12px; }
.search-group { margin-bottom: 10px; }
.search-group h5 { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .1em; margin-bottom: 6px; }
.search-row { display: flex; align-items: center; gap: 10px; padding: 9px 11px; border-radius: 9px; cursor: pointer; border: 1px solid transparent; transition: var(--t); }
.search-row:hover { background: var(--surface); border-color: var(--border); }
.search-row b { font-size: 13px; font-weight: 500; }
.search-row small { color: var(--muted); font-size: 11px; margin-left: auto; }
.search-row .ctx { color: var(--text-2); font-size: 11px; margin-top: 3px; line-height: 1.5; }

/* ===== 主题下拉 ===== */
.theme-pop { position: absolute; top: 34px; right: 0; min-width: 120px; background: var(--surface-2); border: 1px solid var(--border-strong); border-radius: 10px; padding: 6px; box-shadow: var(--shadow-lift); z-index: 60; display: none; }
.theme-pop.open { display: block; }
.theme-pop button { width: 100%; text-align: left; padding: 7px 10px; border-radius: 7px; border: 0; background: transparent; color: var(--text-2); font-size: 12px; cursor: pointer; }
.theme-pop button:hover { background: var(--surface); color: var(--text); }
.theme-pop button.on { color: var(--text); background: var(--surface); }
.theme-wrap { position: relative; }

/* ===== 胖哒对话 ===== */
.panda-chat { position: fixed; right: 22px; bottom: 92px; width: 360px; max-height: 520px; background: rgba(17, 17, 17,.98); border: 1px solid var(--border-strong); border-radius: 18px; box-shadow: var(--shadow-lift); z-index: 90; display: flex; flex-direction: column; overflow: hidden; transform-origin: bottom right; transform: scale(0.96); opacity: 0; pointer-events: none; transition: transform .22s var(--ease), opacity .18s; }
.panda-chat.open { transform: scale(1); opacity: 1; pointer-events: auto; }
html[data-theme="light"] .panda-chat { background: #fff; }
.panda-chat-h { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-bottom: 1px solid var(--border); }
.panda-chat-h img { width: 28px; height: 28px; }
.panda-chat-h b { font-size: 13px; }
.panda-chat-h .close { margin-left: auto; width: 24px; height: 24px; border: 0; background: transparent; color: var(--muted); cursor: pointer; border-radius: 6px; }
.panda-chat-h .close:hover { background: var(--surface); color: var(--text); }
.panda-chat-b { flex: 1; overflow-y: auto; padding: 12px 14px; display: flex; flex-direction: column; gap: 10px; min-height: 260px; }
.panda-chat-b .msg { max-width: 92%; padding: 9px 12px; border-radius: 12px; font-size: 12px; line-height: 1.7; word-break: break-word; }
.panda-chat-b .msg.u { align-self: flex-end; background: linear-gradient(135deg, var(--p-500), var(--pink-500)); color: #fff; border-bottom-right-radius: 4px; }
.panda-chat-b .msg.a { align-self: flex-start; background: var(--surface); border: 1px solid var(--border); border-bottom-left-radius: 4px; }
.panda-chat-b .msg.a code { background: var(--soft); padding: 1px 4px; border-radius: 4px; }
.panda-chat-b .msg.a p { margin: 0 0 6px; }
.panda-chat-b .msg.a p:last-child { margin: 0; }
.panda-chat-f { padding: 10px 12px; border-top: 1px solid var(--border); display: flex; gap: 8px; }
.panda-chat-f input { flex: 1; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 8px 11px; color: var(--text); font-size: 12px; outline: none; }
.panda-chat-f input:focus { border-color: var(--p-400); }
.panda-chat-f button { padding: 0 12px; border-radius: 10px; border: 0; background: var(--p-500); color: #fff; cursor: pointer; font-size: 12px; }
.panda-chat-f button:disabled { opacity: .5; }
.panda-chat-tips { display: flex; flex-wrap: wrap; gap: 6px; padding: 0 14px 8px; }
.panda-chat-tips span { font-size: 11px; padding: 4px 8px; background: var(--surface); border: 1px solid var(--border); border-radius: 999px; color: var(--text-2); cursor: pointer; }
.panda-chat-tips span:hover { border-color: var(--border-strong); color: var(--text); }
.panda-chat-h .panda-stop { width: 24px; height: 24px; border: 0; background: rgba(144, 144, 144,.18); color: var(--pink-400); cursor: pointer; border-radius: 6px; font-size: 10px; line-height: 1; }
.panda-chat-h .panda-stop:hover { background: rgba(144, 144, 144,.32); }
.panda-chat-b .msg.a b { color: var(--p-400); }
.panda-think { display: flex; align-items: center; gap: 2px; }
.panda-think .dots { display: inline-flex; }
.panda-think .dots i { font-style: normal; animation: pandaBlink 1.2s infinite; opacity: .3; }
.panda-think .dots i:nth-child(2) { animation-delay: .2s; }
.panda-think .dots i:nth-child(3) { animation-delay: .4s; }
@keyframes pandaBlink { 0%,100% { opacity: .25; } 50% { opacity: 1; } }
.panda-suggest { align-self: stretch; display: flex; flex-wrap: wrap; gap: 6px; margin-top: -2px; }
.panda-suggest span { font-size: 11px; padding: 4px 9px; background: rgba(132, 132, 132,.12); border: 1px solid rgba(132, 132, 132,.3); border-radius: 999px; color: var(--p-300); cursor: pointer; }
.panda-suggest span:hover { background: rgba(132, 132, 132,.22); color: var(--text); }

/* ============ 封面生成（生产·拆书下方） ============ */
.cover-wrap { display: grid; grid-template-columns: 360px 1fr; gap: 18px; align-items: start; }
.cover-form { background: var(--card); border: 1px solid var(--border); border-radius: 14px; padding: 16px; }
.cover-out { display: grid; gap: 14px; }
.cover-preview { width: 300px; max-width: 100%; border-radius: 10px; overflow: hidden; box-shadow: 0 6px 20px rgba(0,0,0,.25); }
.cover-preview svg { display: block; width: 100%; height: auto; }
.cover-result { display: grid; gap: 10px; }
.cover-image { margin-top: 12px; }
.ci-img { width: 300px; max-width: 100%; border-radius: 10px; box-shadow: 0 6px 20px rgba(0,0,0,.25); display: block; }
.ci-loading { font-size: 12px; color: var(--muted); padding: 14px; background: rgba(0,0,0,.2); border: 1px solid var(--border); border-radius: 10px; }
.wf-tabs { display:flex; gap:8px; flex-wrap:wrap; margin-bottom:14px; }
.wf-tab { padding:8px 14px; border-radius:10px; border:1px solid var(--border); background:var(--card); color:var(--muted); cursor:pointer; font-size:13px; transition:.15s; }
.wf-tab.on { background:linear-gradient(135deg,#656565,#909090); color:#fff; border-color:transparent; }
.wf-stage { background:var(--card); border:1px solid var(--border); border-radius:14px; padding:18px; }
.wf-canvas { max-width:640px; margin:0 auto; position:relative; }
.wf-node { position:relative; display:flex; gap:12px; align-items:flex-start; background:rgba(0,0,0,.22); border:1px solid var(--border); border-radius:12px; padding:13px 14px; margin:0 0 26px; transition:.15s; }
/* 工作流页节点为「纯说明」：不可点（.static 去掉手型与悬停位移动画） */
.wf-node.static { cursor:default; }
.wf-node.static:hover { border-color:var(--border); }
.wf-no { flex:0 0 26px; height:26px; border-radius:50%; background:#656565; color:#fff; display:flex; align-items:center; justify-content:center; font-size:13px; font-weight:700; }
.wf-nb { flex:1; min-width:0; }
/* 1.9.125 节点标题行 + 「去这一步」直达按钮（点一下进入对应创作页） */
.wf-head { display:flex; align-items:center; gap:8px; }
.wf-head .btn { margin-left:auto; flex:none; }
/* 1.9.126 步骤完成度标签 */
.wf-st { font-size:11px; color:var(--faint); flex:none; }
.wf-st.on { color:var(--green-400); }
.wf-nb b { font-size:14px; } .wf-nb > p { margin:4px 0 0; font-size:12px; color:var(--muted); line-height:1.65; }
/* 四段式说明：做什么 / 输入 / 产出 / 注意 */
.wf-desc { margin-top:6px; display:grid; gap:3px; }
.wf-desc p { margin:0; font-size:12px; color:var(--muted); line-height:1.7; padding-left:46px; position:relative; }
.wf-desc p i { position:absolute; left:0; top:0; font-style:normal; font-size:11px; color:var(--p-300); font-weight:700; }
.wf-desc p.wf-tip, .wf-desc p.wf-tip i { color:#fbbf24; }
.wf-link { position:absolute; left:26px; bottom:-22px; width:2px; height:18px; background:var(--border); }
.adapt-shots { display:grid; gap:10px; }
.adapt-shot { background:rgba(0,0,0,.22); border:1px solid var(--border); border-radius:12px; padding:12px 13px; }
.as-h { font-size:13px; display:flex; gap:8px; align-items:center; flex-wrap:wrap; margin-bottom:6px; }
.as-no { flex:0 0 24px; height:24px; border-radius:50%; background:#909090; color:#fff; display:flex; align-items:center; justify-content:center; font-size:12px; font-weight:700; }
.as-dlg { font-size:12px; color:var(--text-2); line-height:1.7; margin:4px 0; }
.as-vis { font-size:12px; color:var(--muted); line-height:1.7; }
.cp-block { background: var(--card); border: 1px solid var(--border); border-radius: 12px; padding: 12px 14px; }
.cp-h { font-size: 12px; font-weight: 600; color: var(--p-300); margin-bottom: 6px; }
.cp-block pre { margin: 0; white-space: pre-wrap; word-break: break-word; font-family: inherit; font-size: 13px; line-height: 1.8; color: var(--text-2); }
.cactions { display: flex; gap: 8px; flex-wrap: wrap; }
@media (max-width: 860px) { .cover-wrap { grid-template-columns: 1fr; } }

/* ── 本地配音 ── */
.tts-wrap { display: grid; grid-template-columns: 246px minmax(0,1fr) 306px; gap: 14px; align-items: start; }
.tts-text { width: 100%; resize: vertical; line-height: 1.9; font-size: 14px; }
.tts-voice { cursor: pointer; }
.tts-voice:hover { background: rgba(255,255,255,.04); }
.tts-voice.on { background: rgba(132, 132, 132,.14); border-color: rgba(132, 132, 132,.5); }
@media (max-width: 980px) { .tts-wrap { grid-template-columns: minmax(0,1fr); } .tts-wrap > .col-r { grid-column: 1 / -1; } }

/* ═══ 中性主题精修层（neutral polish）═══ */
/* 这一段整体可删 —— 删掉就回到未精修的中性灰（仍是灰的，只是层次弱一些） */

:root {
  /* 唯一强调色：冷白。中性方案里不引入第二种彩色。 */
  --accent: #e7e9eb;
  --accent-fg: #0c0c0c;
  --accent-hover: #ffffff;

  /* 重新拉开三档灰：底 / 面 / 边 */
  --surface: rgba(255, 255, 255, 0.065);
  --surface-2: rgba(255, 255, 255, 0.10);
  --soft: rgba(255, 255, 255, 0.035);
  --border: rgba(255, 255, 255, 0.085);
  --border-strong: rgba(255, 255, 255, 0.16);

  /* 文字三档（比原来更分离，避免"整屏糊成一片灰字"） */
  --text: #ededee;
  --text-2: #cfd1d3;
  --muted: #96999c;
  --faint: #71757a;

  /* 主色阶改成"纯中性"，且把中段压深一点 —— 它主要用作 hover / 选中底 */
  --p-700: #262626;
  --p-600: #333333;
  --p-500: #4a4a4a;
  --p-400: #7a7d80;
  --p-300: #b6b9bc;
}

/* ── 1. 去掉装饰：光晕、模糊、卡片渐变 ───────────────────── */
.glow { display: none !important; }
.card, .stat-card, .work-card, .quick-card, .task-row, .dcard .front, .dcard .back {
  background-image: none !important;
  backdrop-filter: none !important;
}
/* 卡片改纯色（半透明白叠底 = 更干净的"纸面"），边框更细更淡 */
.card, .stat-card, .work-card, .quick-card {
  background-color: rgba(255, 255, 255, 0.048);
  border-color: rgba(255, 255, 255, 0.075);
  box-shadow: none;
}
.card.hover:hover, .work-card.hover:hover, .quick-card.hover:hover {
  background-color: rgba(255, 255, 255, 0.072);
  border-color: rgba(255, 255, 255, 0.13);
}

/* ── 2. 主按钮：白底黑字（整屏唯一的"亮点"）─────────────── */
/* 深色主题 */
.btn.primary {
  background: var(--accent) !important;
  background-image: none !important;
  color: var(--accent-fg) !important;
  border-color: transparent !important;
  font-weight: 600;
  box-shadow: none !important;
}
.btn.primary:hover { background: var(--accent-hover) !important; }
.btn.primary:active { background: #d4d7da !important; }
.btn.primary.disabled, .btn.primary[disabled] { opacity: .45; }

/* 浅色主题：反过来，深底白字（浅底上的白按钮会消失） */
html[data-theme="light"] .btn.primary {
  background: #1b1c1e !important;
  color: #f7f7f8 !important;
}
html[data-theme="light"] .btn.primary:hover { background: #2c2e31 !important; }

/* 普通按钮：只靠边框与轻微提亮，不抢主按钮 */
.btn:not(.primary):not(.ghost) {
  background: rgba(255, 255, 255, 0.055);
  border-color: rgba(255, 255, 255, 0.10);
  color: var(--text);
}
.btn:not(.primary):not(.ghost):hover { background: rgba(255, 255, 255, 0.10); }

/* ── 3. 统计卡：数字要够亮，label 要够淡 ─────────────────── */
.stat-card .num { color: var(--text); font-weight: 600; letter-spacing: -.02em; }
.stat-card .lab { color: var(--muted); }
.stat-card .delta { color: var(--faint); }

/* ── 4. 侧栏 / 标题栏：用"略深于内容区"来划分，而不是靠颜色 ── */
.sidebar { background: #0a0a0b; border-right-color: rgba(255, 255, 255, 0.06); }
.titlebar { background: #0a0a0b; border-bottom-color: rgba(255, 255, 255, 0.06); }
.sidebar .nav-item.active, .sidebar .item.on {
  background: rgba(255, 255, 255, 0.085);
  color: var(--text);
}
.sidebar .nav-item:hover { background: rgba(255, 255, 255, 0.05); }

/* ── 5. 正文可读性（这是写作工具，正文最重要）──────────── */
.content { color: var(--text-2); }
.page-head h1 { color: var(--text); font-weight: 600; }
.card-h b { color: var(--text); }

/* 正文编辑区 = 整屏唯一的「纸」：比页面底**略亮**（原来是更暗的 rgba(9,9,9,.42)，
   视觉上像凹陷的黑洞）。写作时视线应该自然落在纸上，两侧面板退到背景里。 */
.editor-wrap {
  background: rgba(255, 255, 255, 0.042);
  border-color: rgba(255, 255, 255, 0.085);
}
.editor-body {
  font-size: 17px;          /* P1：与正文稿纸同口径 17 / 1.9（原 15.5 / 2.05） */
  line-height: 1.9;
  color: #e3e5e7;
  letter-spacing: .02em;
  padding: 26px 34px;         /* 留白多一点，靠近纸质稿 */
}
.editor-bar, .editor-foot { background: rgba(255, 255, 255, 0.02); }

/* ── 6. 去掉位移动效（安静克制：只保留颜色/透明度过渡）─── */
.issue:hover, .card.hover:hover, .work-card.hover:hover,
.quick-card.hover:hover, .task-row:hover { transform: none !important; }
.nav-item { transition: background-color .18s ease, color .18s ease; }
.btn { transition: background-color .18s ease, border-color .18s ease, color .18s ease; }
/* ── 8. 作品封面：把饱和度压掉 ─────────────────────────────
   ⚠️ 为什么不能只改 JS 里的默认色：w.cover 是**创建作品时写进数据的字符串**
   （（形如 linear-gradient(160deg,#4c2fa0,#e05bd0)））。改代码只影响**新作品**，
   老作品的封面色还留在 IndexedDB / 快照里，页面上仍旧一片紫。
   用滤镜兜底：不管是新是老、是渐变还是纯色，统一压到近乎无彩。
   （保留一点点色相差别 —— 全是同一个灰的话，封面就没法区分作品了。） */
[data-act="open-work"] > div:first-child,
.work-card .cover,
.book-card .cover {
  filter: saturate(0.10) brightness(1.05);
}

/* ── 9. 左下角状态卡（原先是「授权卡」，带金色渐变装饰）──
   网页版把它当"存储/备份状态"用，配金色就变成一块突兀的米黄补丁。 */
.lic-card {
  background: rgba(255, 255, 255, 0.045);
  border-color: rgba(255, 255, 255, 0.085);
}
.lic-card:hover { transform: none; box-shadow: none; background: rgba(255, 255, 255, 0.075); }
.lic-card .ico { color: var(--muted); }
html[data-theme="light"] .lic-card { background: rgba(0, 0, 0, 0.028); border-color: rgba(0, 0, 0, 0.08); }
html[data-theme="light"] .lic-card:hover { background: rgba(0, 0, 0, 0.05); }

/* ── 9. 浅色主题同步中性（原先是淡紫底）───────────────── */
html[data-theme="light"] {
  --accent: #1b1c1e;
  --accent-fg: #ffffff;
  --bg: #f7f7f8;
  --text: #17181a;
  --text-2: #3a3c40;
  --muted: #6b6f74;
  --faint: #8b8f95;
  --border: rgba(0, 0, 0, 0.09);
  --border-strong: rgba(0, 0, 0, 0.16);
}
html[data-theme="light"] .card,
html[data-theme="light"] .stat-card,
html[data-theme="light"] .work-card,
html[data-theme="light"] .quick-card {
  background-color: #ffffff;
  border-color: rgba(0, 0, 0, 0.08);
}
html[data-theme="light"] .sidebar,
html[data-theme="light"] .titlebar { background: #fbfbfc; }
/* ═══ 精修层结束（neutral polish）═══ */

/* ═══ 平台 API 只读选择（网页版专用，2026-11-25）═══
   网页端 API 由平台统一配置，用户只能选、不能配。
   做成"卡片单选"而不是"表格+编辑"——**界面形态本身就在说明权限**。 */
.api-pick{
  border:1px solid var(--border);
  border-radius:10px;
  padding:12px 14px;
  background:transparent;
  transition:border-color .15s, background .15s;
}
.api-pick:hover{ border-color:var(--border-strong); }
.api-pick.on{
  border-color:var(--border-strong);
  background:rgba(127,127,127,.06);
}
.api-pick .api-pick-name{ font-weight:600; }
