/* 校园收费 · 共享主题层
   12 套主题：海盐青 / 雾海蓝 / 自定义配色 / 青瓷 / 燕麦杏 / 雾霭蓝 / 薄雾紫 /
   暖沙 / 云白 / 松雾 / 墨夜 / 深海
   由 vendor/theme.js 设置 html[data-theme] 与 html.dark
*/

html[data-theme="jade"] {
  --bg: #f4f7f6;
  --bg-deep: #dfe9e5;
  --surface: #ffffff;
  --surface-2: #f7fbf9;
  --surface-3: #eaf5f1;
  --ink: #17322c;
  --ink-soft: #3f5b53;
  --muted: #5d716c;
  --line: #e6ecea;
  --brand: #0f5b4e;
  --brand-2: #137a68;
  --brand-3: #e8f3ef;
  --brand-line: #bcd8d0;
  --accent: #c98a2e;
  --accent-soft: #fff8ea;
  --hero-start: #0f5b4e;
  --hero-end: #16806b;
  --hero-sub: #b6d9ce;
  --sidebar: #0a2621;
  --sidebar-2: #0d3029;
  --menu-active-start: #1a6a5a;
  --menu-active-end: #155748;
  --side-text: #dcf0ea;
  --side-muted: #8fb0a6;
  --side-divider: rgba(255, 255, 255, .08);
  --side-hover: rgba(255, 255, 255, .065);
  --side-icon: rgba(220, 240, 234, .7);
  --side-icon-active: #ffe4ae;
  --side-accent: #e8b567;
  --side-glow: rgba(43, 154, 128, .2);
  --login-start: #0b2b26;
  --login-mid: #17695a;
  --login-end: #0e4b40;
  --shadow: 0 6px 18px rgba(16, 54, 46, .05);
  --shadow-strong: 0 18px 50px rgba(15, 91, 78, .14);
  --overlay: rgba(7, 24, 20, .56);
  --warn-bg: #fff8ea;
  --warn-line: #f0dcb4;
  --warn-ink: #7d5a1c;
  --table-head: #f7fbf9;
  --row-hover: #f1f8f5;
  --input-bg: #ffffff;
  --success: #1a7a5e;
  --warning: #b07a1f;
  --danger: #c0392b;
  --info: #7b8a86;
}

html[data-theme="sand"] {
  --bg: #f6f2ea;
  --bg-deep: #e7dfd1;
  --surface: #fffdf9;
  --surface-2: #faf5ec;
  --surface-3: #f3e9d8;
  --ink: #2f2a22;
  --ink-soft: #5b5145;
  --muted: #746754;
  --line: #e6dccb;
  --brand: #8a5a2b;
  --brand-2: #a9743f;
  --brand-3: #f3e7d5;
  --brand-line: #dcc5a3;
  --accent: #0f5b4e;
  --accent-soft: #eef7f3;
  --hero-start: #6f4620;
  --hero-end: #9a6a36;
  --hero-sub: #e6d6bf;
  --sidebar: #241e16;
  --sidebar-2: #352b1f;
  --menu-active-start: #604221;
  --menu-active-end: #7a5328;
  --side-text: #f1e7d8;
  --side-muted: #b39c80;
  --side-divider: rgba(255, 255, 255, .09);
  --side-hover: rgba(255, 255, 255, .065);
  --side-icon: rgba(241, 231, 216, .72);
  --side-icon-active: #ffe4ae;
  --side-accent: #e0b15f;
  --side-glow: rgba(186, 130, 71, .19);
  --login-start: #2a2117;
  --login-mid: #6f4620;
  --login-end: #8a5a2b;
  --shadow: 0 6px 18px rgba(74, 52, 25, .07);
  --shadow-strong: 0 18px 50px rgba(74, 52, 25, .18);
  --overlay: rgba(31, 23, 14, .54);
  --warn-bg: #fff6e4;
  --warn-line: #eddcb9;
  --warn-ink: #7a5622;
  --table-head: #faf5ec;
  --row-hover: #f6eee2;
  --input-bg: #fffdf9;
  --success: #3c725c;
  --warning: #9a6723;
  --danger: #b23b2e;
  --info: #837462;
}

html[data-theme="cloud"] {
  --bg: #eff4f9;
  --bg-deep: #dbe6ef;
  --surface: #ffffff;
  --surface-2: #f6f9fc;
  --surface-3: #e8f0f7;
  --ink: #1e2d3b;
  --ink-soft: #45596b;
  --muted: #5c7183;
  --line: #dfe8f0;
  --brand: #2b5a78;
  --brand-2: #3a7294;
  --brand-3: #e9f2f8;
  --brand-line: #bdd6e7;
  --accent: #b9853f;
  --accent-soft: #fff8ec;
  --hero-start: #234c66;
  --hero-end: #2f6d8d;
  --hero-sub: #b8d4e5;
  --sidebar: #0f2230;
  --sidebar-2: #142c3c;
  --menu-active-start: #1f516d;
  --menu-active-end: #193f55;
  --side-text: #e2eff8;
  --side-muted: #93b0c4;
  --side-divider: rgba(255, 255, 255, .09);
  --side-hover: rgba(255, 255, 255, .065);
  --side-icon: rgba(226, 239, 248, .72);
  --side-icon-active: #ffe4ae;
  --side-accent: #d9a75e;
  --side-glow: rgba(73, 135, 171, .22);
  --login-start: #0e2331;
  --login-mid: #23506b;
  --login-end: #2d6686;
  --shadow: 0 6px 18px rgba(35, 60, 80, .06);
  --shadow-strong: 0 18px 50px rgba(31, 70, 96, .16);
  --overlay: rgba(8, 20, 30, .56);
  --warn-bg: #fff8ec;
  --warn-line: #efdcb8;
  --warn-ink: #7b5a25;
  --table-head: #f6f9fc;
  --row-hover: #eff6fb;
  --input-bg: #ffffff;
  --success: #2d7d62;
  --warning: #a87428;
  --danger: #bd4a40;
  --info: #758a9b;
}

html[data-theme="sage"] {
  --bg: #f2f5f1;
  --bg-deep: #dfe7de;
  --surface: #fdfefb;
  --surface-2: #f6f9f4;
  --surface-3: #e9f0e5;
  --ink: #24312a;
  --ink-soft: #4b5f53;
  --muted: #617267;
  --line: #e1e9de;
  --brand: #466453;
  --brand-2: #587a65;
  --brand-3: #ecf3eb;
  --brand-line: #c8dac9;
  --accent: #b38745;
  --accent-soft: #fff9ee;
  --hero-start: #3c5747;
  --hero-end: #5b7f68;
  --hero-sub: #c6dcc9;
  --sidebar: #18271f;
  --sidebar-2: #22372a;
  --menu-active-start: #3f5f4c;
  --menu-active-end: #324d3c;
  --side-text: #e6efdf;
  --side-muted: #a2b4a4;
  --side-divider: rgba(255, 255, 255, .08);
  --side-hover: rgba(255, 255, 255, .06);
  --side-icon: rgba(230, 239, 223, .7);
  --side-icon-active: #ffe4ae;
  --side-accent: #d8b06b;
  --side-glow: rgba(111, 150, 120, .2);
  --login-start: #16251d;
  --login-mid: #3c5747;
  --login-end: #56775f;
  --shadow: 0 6px 18px rgba(45, 65, 50, .05);
  --shadow-strong: 0 18px 50px rgba(45, 65, 50, .14);
  --overlay: rgba(10, 22, 15, .54);
  --warn-bg: #fff9ee;
  --warn-line: #ead9bb;
  --warn-ink: #74552a;
  --table-head: #f6f9f4;
  --row-hover: #eff5ec;
  --input-bg: #fdfefb;
  --success: #3f7259;
  --warning: #96702d;
  --danger: #b54d42;
  --info: #7a8b7f;
}

html[data-theme="ink"] {
  --bg: #0c1412;
  --bg-deep: #07100d;
  --surface: #131f1b;
  --surface-2: #182722;
  --surface-3: #1f302a;
  --ink: #e7f2ed;
  --ink-soft: #bfd4cc;
  --muted: #8ba69c;
  --line: #2a3d36;
  --brand: #1f7f69;
  --brand-2: #2b9a80;
  --brand-3: rgba(79, 209, 176, .14);
  --brand-line: rgba(79, 209, 176, .34);
  --accent: #e0b15f;
  --accent-soft: rgba(224, 177, 95, .13);
  --hero-start: #10241f;
  --hero-end: #1b4d42;
  --hero-sub: #9cc4b7;
  --sidebar: #08110e;
  --sidebar-2: #0e211b;
  --menu-active-start: #134b3f;
  --menu-active-end: #103a31;
  --side-text: #dcf0ea;
  --side-muted: #8ba69c;
  --side-divider: rgba(255, 255, 255, .075);
  --side-hover: rgba(255, 255, 255, .055);
  --side-icon: rgba(220, 240, 234, .68);
  --side-icon-active: #9ff0d9;
  --side-accent: #5ad1b6;
  --side-glow: rgba(45, 154, 128, .2);
  --login-start: #07100d;
  --login-mid: #10241f;
  --login-end: #1a453b;
  --shadow: 0 10px 28px rgba(0, 0, 0, .3);
  --shadow-strong: 0 18px 50px rgba(0, 0, 0, .5);
  --overlay: rgba(1, 7, 5, .72);
  --warn-bg: rgba(224, 177, 95, .11);
  --warn-line: rgba(224, 177, 95, .28);
  --warn-ink: #e8c27d;
  --table-head: #182722;
  --row-hover: #1c2c26;
  --input-bg: #0f1a16;
  --success: #5ad1b6;
  --warning: #e0b15f;
  --danger: #e57a6d;
  --info: #8ba69c;
}

html[data-theme="ocean"] {
  --bg: #0b141c;
  --bg-deep: #070e14;
  --surface: #111e28;
  --surface-2: #162531;
  --surface-3: #1c2e3d;
  --ink: #e6eff7;
  --ink-soft: #b9c9d8;
  --muted: #8da3b6;
  --line: #26394a;
  --brand: #2c6f98;
  --brand-2: #3d8fbf;
  --brand-3: rgba(93, 179, 224, .14);
  --brand-line: rgba(93, 179, 224, .32);
  --accent: #e8b567;
  --accent-soft: rgba(232, 181, 103, .12);
  --hero-start: #0e2433;
  --hero-end: #1a4b63;
  --hero-sub: #a9c8db;
  --sidebar: #07121b;
  --sidebar-2: #0d2230;
  --menu-active-start: #16435a;
  --menu-active-end: #123447;
  --side-text: #e1edf6;
  --side-muted: #8da3b6;
  --side-divider: rgba(255, 255, 255, .08);
  --side-hover: rgba(255, 255, 255, .06);
  --side-icon: rgba(225, 237, 246, .7);
  --side-icon-active: #a8e3fa;
  --side-accent: #6fc2e8;
  --side-glow: rgba(61, 143, 191, .22);
  --login-start: #07121b;
  --login-mid: #102d3f;
  --login-end: #1a4b63;
  --shadow: 0 10px 28px rgba(0, 0, 0, .3);
  --shadow-strong: 0 18px 50px rgba(0, 0, 0, .5);
  --overlay: rgba(2, 8, 13, .72);
  --warn-bg: rgba(232, 181, 103, .12);
  --warn-line: rgba(232, 181, 103, .3);
  --warn-ink: #f0cb85;
  --table-head: #162531;
  --row-hover: #1a2c39;
  --input-bg: #0e1922;
  --success: #6fc2e8;
  --warning: #e8b567;
  --danger: #e88a7d;
  --info: #8da3b6;
}

/* Element Plus 主题变量 */
html[data-theme] {
  background: var(--bg-deep);
  --card-highlight: rgba(255, 255, 255, .72);
  --topbar-shadow: 0 1px 0 var(--line), 0 10px 24px rgba(16, 54, 46, .045);
  --hero-shadow: 0 18px 42px rgba(15, 91, 78, .18);
  --el-color-primary: var(--brand);
  --el-color-primary-light-3: var(--brand-2);
  --el-color-primary-light-5: var(--brand-2);
  --el-color-primary-light-7: var(--brand-3);
  --el-color-primary-light-8: var(--brand-3);
  --el-color-primary-light-9: var(--brand-3);
  --el-color-primary-dark-2: var(--brand-2);
  --el-color-success: var(--success);
  --el-color-success-light-9: var(--surface-2);
  --el-color-success-light-8: var(--brand-3);
  --el-color-warning: var(--warning);
  --el-color-warning-light-9: var(--accent-soft);
  --el-color-warning-light-8: var(--accent-soft);
  --el-color-danger: var(--danger);
  --el-color-danger-light-9: var(--surface-2);
  --el-color-info: var(--info);
  --el-color-info-light-9: var(--surface-2);
  --el-bg-color: var(--surface);
  --el-bg-color-page: var(--bg);
  --el-bg-color-overlay: var(--surface);
  --el-text-color-primary: var(--ink);
  --el-text-color-regular: var(--ink-soft);
  --el-text-color-secondary: var(--muted);
  --el-text-color-placeholder: var(--muted);
  --el-text-color-disabled: var(--muted);
  --el-border-color: var(--line);
  --el-border-color-light: var(--line);
  --el-border-color-lighter: var(--line);
  --el-border-color-extra-light: var(--surface-3);
  --el-border-color-dark: var(--line);
  --el-fill-color: var(--surface-2);
  --el-fill-color-light: var(--surface-2);
  --el-fill-color-lighter: var(--surface-2);
  --el-fill-color-extra-light: var(--surface-3);
  --el-fill-color-blank: var(--surface);
  --el-mask-color: var(--overlay);
  --el-overlay-color: var(--overlay);
  --el-overlay-color-light: var(--overlay);
  --el-overlay-color-lighter: var(--overlay);
  --el-box-shadow-light: var(--shadow);
  --el-box-shadow: var(--shadow-strong);
  --el-table-bg-color: var(--surface);
  --el-table-tr-bg-color: var(--surface);
  --el-table-header-bg-color: var(--table-head);
  --el-table-row-hover-bg-color: var(--row-hover);
  --el-table-border-color: var(--line);
  --el-table-text-color: var(--ink-soft);
  --el-table-header-text-color: var(--ink);
  --el-input-bg-color: var(--input-bg);
  --el-input-border-color: var(--line);
  --el-input-text-color: var(--ink);
  --el-input-placeholder-color: var(--muted);
  --el-dialog-bg-color: var(--surface);
  --el-popover-bg-color: var(--surface);
  --el-pagination-bg-color: var(--surface);
  --el-pagination-button-bg-color: var(--surface-2);
  --el-pagination-text-color: var(--ink-soft);
  --el-tag-bg-color: var(--surface-2);
  --el-tag-border-color: var(--line);
  --el-tag-text-color: var(--ink-soft);
  --el-disabled-bg-color: var(--surface-2);
  --el-disabled-text-color: var(--muted);
  --el-disabled-border-color: var(--line);
}

html.dark {
  --card-highlight: rgba(255, 255, 255, .045);
  --topbar-shadow: 0 1px 0 var(--line), 0 16px 32px rgba(0, 0, 0, .26);
  --hero-shadow: 0 18px 44px rgba(0, 0, 0, .42);
}

html[data-theme] body {
  background: var(--bg);
  color: var(--ink);
}

html[data-theme] .card,
html[data-theme] .topbar,
html[data-theme] .login-right,
html[data-theme] .login-card,
html[data-theme] .mine-list,
html[data-theme] .nav,
html[data-theme] .pay-btn,
html[data-theme] .icon-item {
  background: var(--surface);
  border-color: var(--line);
  color: var(--ink);
}

html[data-theme] .card,
html[data-theme] .login-card {
  background: linear-gradient(180deg, var(--surface) 0%, color-mix(in srgb, var(--surface) 94%, var(--bg)) 100%);
  box-shadow: inset 0 1px 0 var(--card-highlight), var(--shadow);
}

html[data-theme] .topbar {
  box-shadow: var(--topbar-shadow);
}

html[data-theme] .sidebar {
  background:
    radial-gradient(120% 55% at 0% 0%, var(--side-glow), transparent 62%),
    linear-gradient(180deg, var(--sidebar), var(--sidebar-2));
}

html[data-theme] .menu-item.active {
  background: linear-gradient(90deg, var(--menu-active-start), var(--menu-active-end));
}

html[data-theme] .menu-item.active .dot {
  background: var(--accent);
}

html[data-theme] .banner {
  background: linear-gradient(120deg, var(--hero-start), var(--hero-end));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .14), var(--hero-shadow);
}

html[data-theme] .banner .t,
html[data-theme] .banner .r,
html[data-theme] .brand-badge,
html[data-theme] .login-sub,
html[data-theme] .login-points div,
html[data-theme] .login-foot {
  color: var(--hero-sub);
}

html[data-theme] .login-left {
  background:
    radial-gradient(1200px 600px at 15% 10%, var(--login-mid) 0%, transparent 60%),
    radial-gradient(900px 500px at 90% 90%, var(--login-end) 0%, transparent 55%),
    var(--login-start);
}

html[data-theme] .login-title,
html[data-theme] .login-points b {
  color: #f2faf7;
}

html[data-theme] .login .school,
html[data-theme] .login .slogan,
html[data-theme] .hero .sub,
html[data-theme] .mine-head div[style*="color:#b6d9ce"] {
  color: var(--hero-sub);
}

html[data-theme] .login,
html[data-theme] .hero,
html[data-theme] .mine-head {
  background: linear-gradient(150deg, var(--hero-start), var(--hero-end));
}

html[data-theme] #app {
  background: var(--bg);
  box-shadow: 0 0 40px rgba(0, 0, 0, .16);
}

html[data-theme] .field {
  background: var(--surface-2);
  border-color: var(--line);
}

html[data-theme] .field input {
  color: var(--ink);
}

html[data-theme] .btn {
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
}

html[data-theme] .btn.ghost {
  background: var(--surface);
  color: var(--brand);
  border-color: var(--brand-line);
}

html[data-theme] .chip {
  background: var(--brand-3);
  color: var(--brand);
  border-color: var(--brand-line);
}

html[data-theme] .tabbar {
  background: color-mix(in srgb, var(--surface) 94%, transparent);
  border-color: var(--line);
}

html[data-theme] .tab {
  color: var(--muted);
}

html[data-theme] .tab.active {
  color: var(--brand);
}

html[data-theme] .icon-item {
  color: var(--ink-soft);
  box-shadow: var(--shadow);
}

html[data-theme] .icon-item .ic {
  background: var(--brand-3);
  color: var(--brand);
}

html[data-theme] .nav .back {
  color: var(--ink-soft);
}

html[data-theme] .safe-tip {
  color: var(--muted);
}

html[data-theme] .calc-cell {
  background: var(--surface-2);
  border-color: var(--line);
}

html[data-theme] .calc-cell.hl {
  background: var(--accent-soft);
  border-color: var(--warn-line);
}

html[data-theme] .notice {
  background: var(--warn-bg);
  border-color: var(--warn-line);
  color: var(--warn-ink);
}

html[data-theme] .demo-chip:hover {
  border-color: var(--brand-line);
  background: var(--surface-2);
}

html[data-theme] .role-pill {
  background: var(--brand-3);
  color: var(--brand);
}

html[data-theme] .formula {
  background: var(--sidebar);
  color: var(--hero-sub);
}

html[data-theme] .mine-row {
  border-color: var(--line);
}

html[data-theme] .mine-head .avatar {
  background: rgba(255, 255, 255, .16);
}

html[data-theme] .result .ok {
  background: var(--brand-3);
  color: var(--brand);
}

html[data-theme] .errbar {
  background: var(--surface-2);
  border-color: var(--danger);
  color: var(--danger);
}

html[data-theme] .el-button--primary {
  --el-button-text-color: #fff;
  --el-button-bg-color: var(--brand);
  --el-button-border-color: var(--brand);
  --el-button-hover-bg-color: var(--brand-2);
  --el-button-hover-border-color: var(--brand-2);
  --el-button-active-bg-color: var(--brand-2);
  --el-button-active-border-color: var(--brand-2);
}

html[data-theme] .el-button--primary.is-plain {
  --el-button-text-color: var(--brand);
  --el-button-border-color: var(--brand-line);
  --el-button-bg-color: var(--brand-3);
}

html[data-theme] .el-button--primary.is-link,
html[data-theme] .el-button--primary.is-text {
  --el-button-text-color: var(--brand-2);
  --el-button-hover-text-color: var(--brand-2);
  --el-button-active-text-color: var(--brand-2);
}

html[data-theme] .el-button:not(.el-button--primary):not(.is-link):not(.is-text) {
  --el-button-bg-color: var(--surface);
  --el-button-border-color: var(--line);
  --el-button-text-color: var(--ink-soft);
  --el-button-hover-bg-color: var(--surface-2);
  --el-button-hover-border-color: var(--brand-line);
  --el-button-hover-text-color: var(--brand);
}

html[data-theme] .el-dialog,
html[data-theme] .el-message-box,
html[data-theme] .el-drawer {
  background: var(--surface);
  color: var(--ink);
  border-color: var(--line);
}

html[data-theme] .el-dialog__title,
html[data-theme] .el-message-box__title {
  color: var(--ink);
}

html[data-theme] .el-table {
  --el-table-bg-color: var(--surface);
  --el-table-tr-bg-color: var(--surface);
  --el-table-header-bg-color: var(--table-head);
  --el-table-row-hover-bg-color: var(--row-hover);
  --el-table-border-color: var(--line);
  --el-table-text-color: var(--ink-soft);
  --el-table-header-text-color: var(--ink);
  background: var(--surface);
}

html[data-theme] .el-table th.el-table__cell {
  background: var(--table-head);
}

html[data-theme] .el-table tr {
  background: var(--surface);
}

html[data-theme] .el-table--striped .el-table__body tr.el-table__row--striped td.el-table__cell {
  background: var(--surface-2);
}

html[data-theme] .el-tabs__item {
  color: var(--muted);
}

html[data-theme] .el-tabs__item.is-active {
  color: var(--brand);
}

html[data-theme] .el-tabs__active-bar {
  background: var(--brand);
}

html[data-theme] .el-pagination.is-background .el-pager li {
  background: var(--surface-2);
  color: var(--ink-soft);
}

html[data-theme] .el-pagination.is-background .el-pager li.is-active {
  background: var(--brand);
  color: #fff;
}

html[data-theme] .el-tag {
  --el-tag-bg-color: var(--surface-2);
  --el-tag-border-color: var(--line);
  --el-tag-text-color: var(--ink-soft);
}

/* 深色主题的状态标签 */
html.dark .status-ISSUED,
html.dark .status-SUBMITTED {
  color: #e8c07a;
  background: rgba(201, 138, 46, .15);
  border-color: rgba(201, 138, 46, .34);
}

html.dark .status-PARTIAL,
html.dark .status-APPROVED {
  color: #8dc8ef;
  background: rgba(80, 160, 220, .14);
  border-color: rgba(80, 160, 220, .3);
}

html.dark .status-PAID,
html.dark .status-SETTLED,
html.dark .status-COMPLETED {
  color: #7fdbc0;
  background: rgba(63, 191, 159, .14);
  border-color: rgba(63, 191, 159, .3);
}

html.dark .status-DEFERRED,
html.dark .status-EXECUTING {
  color: #c7a9e8;
  background: rgba(154, 111, 204, .14);
  border-color: rgba(154, 111, 204, .3);
}

html.dark .status-REDUCED {
  color: #ddb98c;
  background: rgba(170, 120, 65, .14);
  border-color: rgba(170, 120, 65, .3);
}

html.dark .status-PARTIALLY_REFUNDED {
  color: #f0b28c;
  background: rgba(200, 100, 55, .14);
  border-color: rgba(200, 100, 55, .3);
}

html.dark .status-VOID,
html.dark .status-TRANSFERRED,
html.dark .status-DRAFT,
html.dark .status-REVERSED {
  color: var(--muted);
  background: var(--surface-2);
  border-color: var(--line);
}

html.dark .status-EXCEPTION {
  color: #f0a096;
  background: rgba(210, 85, 70, .14);
  border-color: rgba(210, 85, 70, .3);
}

html.dark .tag.ISSUED { background: rgba(201, 138, 46, .15); color: #e8c07a; }
html.dark .tag.PARTIAL { background: rgba(80, 160, 220, .14); color: #8dc8ef; }
html.dark .tag.PARTIALLY_REFUNDED { background: rgba(200, 100, 55, .14); color: #f0b28c; }
html.dark .tag.PAID { background: rgba(63, 191, 159, .14); color: #7fdbc0; }
html.dark .tag.DEFERRED { background: rgba(154, 111, 204, .14); color: #c7a9e8; }
html.dark .tag.TRANSFERRED { background: var(--surface-2); color: var(--muted); }

html[data-theme] .el-loading-mask {
  background: color-mix(in srgb, var(--surface) 82%, transparent);
}

/* 主题选择器 */
.theme-trigger {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 34px;
  padding: 0 11px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface-2);
  color: var(--ink-soft);
  box-shadow: inset 0 1px 0 var(--card-highlight), 0 2px 7px rgba(16, 54, 46, .045);
  font: inherit;
  font-size: 12px;
  white-space: nowrap;
  flex: 0 0 auto;
  cursor: pointer;
  transition: border-color .15s ease, color .15s ease, background .15s ease;
}

.theme-trigger:hover {
  border-color: var(--brand-line);
  color: var(--brand);
}

/* 浅色主题下，右上角主题入口用中性浅灰，和大面积带色画布分开 */
html:not(.dark) {
  --theme-control: #EEF1F4;
  --theme-control-line: #DCE1E6;
}

html:not(.dark) .theme-trigger {
  background: var(--theme-control, #EEF1F4);
  border-color: var(--theme-control-line, #D9DFE4);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .82), 0 1px 3px rgba(20, 30, 40, .06);
}

html:not(.dark) .theme-trigger:hover {
  background: #ffffff;
  border-color: var(--brand-line);
}

.theme-trigger:focus-visible,
.theme-option:focus-visible,
.theme-fab:focus-visible,
.theme-sheet-close:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
}

.theme-trigger .dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--brand);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .18);
}

.theme-pop {
  padding: 4px;
  min-width: 210px;
  max-height: min(72vh, 560px);
  overflow-y: auto;
  overscroll-behavior: contain;
}

/* 主题选择面板：非常浅的中性灰，和右侧画布分层 */
html:not(.dark) .theme-popper.el-popover.el-popper {
  background: var(--theme-control, #EEF1F4);
  border-color: var(--theme-control-line, #DCE1E6);
  box-shadow: 0 14px 32px rgba(22, 30, 38, .13);
}

html:not(.dark) .theme-popper .theme-option:hover {
  background: #ffffff;
}

html:not(.dark) .theme-popper .theme-option.active {
  background: var(--brand-3);
}

.theme-pop-head {
  padding: 2px 8px 8px;
}

.theme-pop-head b {
  display: block;
  color: var(--ink);
  font-size: 13px;
}

.theme-pop-head small {
  display: block;
  color: var(--muted);
  font-size: 11px;
  margin-top: 2px;
}

.theme-option {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 9px 10px;
  border: 1px solid transparent;
  border-radius: 10px;
  background: transparent;
  color: var(--ink);
  text-align: left;
  cursor: pointer;
  font: inherit;
  transition: background .15s ease, border-color .15s ease;
}

.theme-option:hover {
  background: var(--surface-2);
}

.theme-option.active {
  border-color: var(--brand-line);
  background: var(--brand-3);
}

.theme-option .swatch {
  width: 25px;
  height: 25px;
  border-radius: 8px;
  flex: 0 0 25px;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .1);
}

.theme-option b {
  display: block;
  font-size: 12px;
  line-height: 1.35;
}

.theme-option small {
  display: block;
  color: var(--muted);
  font-size: 10px;
  margin-top: 2px;
}

.theme-option .check {
  margin-left: auto;
  color: var(--brand);
  font-size: 14px;
}

.theme-pop-foot {
  position: sticky;
  bottom: 0;
  padding: 8px 6px 4px;
  background: linear-gradient(180deg, transparent, var(--theme-control, transparent) 30%);
}

html.dark .theme-pop-foot {
  background: linear-gradient(180deg, transparent, var(--surface) 30%);
}

.theme-custom-btn {
  width: 100%;
  min-height: 34px;
  padding: 7px 10px;
  border: 1px solid var(--theme-control-line, var(--line));
  border-radius: 9px;
  background: var(--surface);
  color: var(--ink-soft);
  font: inherit;
  font-size: 12px;
  text-align: left;
  cursor: pointer;
}

.theme-custom-btn:hover {
  color: var(--brand);
  border-color: var(--brand-line);
}

.theme-custom-btn:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
}

/* H5 主题入口与选择面板 */
.theme-fab {
  position: fixed;
  right: calc(max(0px, (100vw - 430px) / 2) + 14px);
  bottom: calc(92px + env(safe-area-inset-bottom));
  width: 42px;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--surface);
  color: var(--ink-soft);
  box-shadow: var(--shadow);
  display: grid;
  place-items: center;
  font-size: 18px;
  z-index: 32;
  cursor: pointer;
}

.theme-fab.login-fab {
  bottom: calc(22px + env(safe-area-inset-bottom));
}

.theme-fab:active {
  transform: scale(.94);
}

.theme-sheet {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  background: var(--overlay);
}

.theme-sheet-panel {
  width: 100%;
  max-width: 430px;
  background: var(--surface);
  color: var(--ink);
  border-radius: 22px 22px 0 0;
  padding: 18px 18px calc(18px + env(safe-area-inset-bottom));
  box-shadow: 0 -18px 50px rgba(0, 0, 0, .22);
  max-height: calc(100vh - 36px);
  display: flex;
  flex-direction: column;
}

.theme-sheet-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  padding: 0 4px 12px;
}

.theme-sheet-head b {
  font-size: 16px;
}

.theme-sheet-head small {
  color: var(--muted);
  font-size: 11px;
}

.theme-sheet-close {
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 18px;
  cursor: pointer;
}

.theme-sheet-list {
  display: grid;
  gap: 4px;
  overflow: auto;
  min-height: 0;
  padding-right: 2px;
}

.theme-sheet-foot {
  padding-top: 10px;
  flex: 0 0 auto;
}

.theme-sheet-foot .theme-custom-btn {
  min-height: 40px;
}

@media (prefers-reduced-motion: reduce) {
  .theme-trigger,
  .theme-option,
  .theme-fab {
    transition: none;
  }
}

/* ============================================================
   明亮主题：海盐青 / 雾海蓝 / 自定义配色，以及保留的候选 A-D
   共同点：画布和卡片都带轻色底，不做大面积纯白；
   侧栏浅色、主操作有明确品牌色，整体保持清爽明亮。
   ============================================================ */

/* A. 海盐青：暖白画布 + 薄荷卡片 + 深青主操作（按用户选定色值） */
html[data-theme="sea"] {
  --bg: #F7F6F2;
  --bg-deep: #E7E8E3;
  --bg-glow: #E7F4EE;
  --surface: #EAF8F2;
  --surface-2: #E1F3EB;
  --surface-3: #D5EDE3;
  --topbar: #F1FAF6;
  --ink: #12332D;
  --ink-soft: #355C53;
  --muted: #5F7B73;
  --line: #CEE6DC;
  --brand: #0F766E;
  --brand-2: #0B5F59;
  --brand-3: #DDF3EC;
  --brand-line: #B7DCCF;
  --accent: #E0A13C;
  --accent-soft: #FDF4E4;
  --hero-start: #0A4F4A;
  --hero-end: #12857B;
  --hero-sub: #C9ECE4;
  --sidebar: #E3F2ED;
  --sidebar-2: #D6EAE3;
  --menu-active-start: #0F766E;
  --menu-active-end: #0B5F59;
  --side-text: #20443D;
  --side-muted: #64857C;
  --side-divider: #C9E1D9;
  --side-hover: #EDF8F4;
  --side-icon: #4D7C72;
  --side-icon-active: #FFFFFF;
  --side-accent: #D9FBF3;
  --side-glow: rgba(15, 118, 110, .12);
  --login-start: #083F3B;
  --login-mid: #0E7169;
  --login-end: #0B5F59;
  --shadow: 0 8px 22px rgba(18, 79, 70, .08);
  --shadow-strong: 0 22px 48px rgba(18, 79, 70, .16);
  --topbar-shadow: 0 1px 0 var(--line), 0 10px 24px rgba(15, 118, 110, .06);
  --hero-shadow: 0 18px 40px rgba(10, 79, 74, .18);
  --warn-bg: #FFF8E8;
  --warn-line: #F1DDB4;
  --warn-ink: #7B5418;
  --table-head: #EAF7F2;
  --row-hover: #EFFAF6;
  --input-bg: #FBFFFD;
  --success: #2F8A5B;
  --warning: #B7791F;
  --danger: #CF4B45;
  --info: #5F7B73;
  --el-color-primary: #0F766E;
  --el-color-primary-light-3: #4F9E95;
  --el-color-primary-light-5: #8AC2BA;
  --el-color-primary-light-7: #C4E2DC;
  --el-color-primary-light-8: #D9EFE9;
  --el-color-primary-light-9: #EDF8F4;
  --el-color-primary-dark-2: #0B5F59;
  --el-color-success: #2F8A5B;
  --el-color-success-light-9: #EEF8F1;
  --el-color-warning: #B7791F;
  --el-color-warning-light-9: #FFF8E8;
  --el-color-danger: #CF4B45;
  --el-color-danger-light-9: #FFF1F0;
}

/* A2. 雾海蓝：暖白画布 + 中性卡片 + 薄荷/深青强调（按用户选定色值） */
html[data-theme="mistblue"] {
  --bg: #F7F6F2;
  --bg-deep: #E7E8E6;
  --bg-glow: #E8F3EE;
  --surface: #FAFAFA;
  --surface-2: #E1F3EB;
  --surface-3: #E9E9E9;
  --topbar: #F2F2F2;
  --ink: #12332D;
  --ink-soft: #355C53;
  --muted: #5F7B73;
  --line: #CEE6DC;
  --brand: #0F766E;
  --brand-2: #0B5F59;
  --brand-3: #DDF3EC;
  --brand-line: #B7DCCF;
  --accent: #E89C21;
  --accent-soft: #FDF4E4;
  --hero-start: #0A4F4A;
  --hero-end: #12857B;
  --hero-sub: #C9ECE4;
  --sidebar: #F2F2F2;
  --sidebar-2: #E8E8E8;
  --menu-active-start: #0F766E;
  --menu-active-end: #0B5F59;
  --side-text: #12332D;
  --side-muted: #5F7B73;
  --side-divider: #DCE4E0;
  --side-hover: #F7F8F7;
  --side-icon: #5F7B73;
  --side-icon-active: #FFFFFF;
  --side-accent: #DDF3EC;
  --side-glow: rgba(15, 118, 110, .10);
  --login-start: #083F3B;
  --login-mid: #0E7169;
  --login-end: #0B5F59;
  --shadow: 0 8px 22px rgba(30, 44, 39, .07);
  --shadow-strong: 0 22px 48px rgba(30, 44, 39, .14);
  --topbar-shadow: 0 1px 0 var(--line), 0 10px 24px rgba(15, 118, 110, .05);
  --hero-shadow: 0 18px 40px rgba(10, 79, 74, .16);
  --warn-bg: #FFF7E6;
  --warn-line: #F0D9A8;
  --warn-ink: #7A4F10;
  --table-head: #EAF3EE;
  --row-hover: #F3F8F5;
  --input-bg: #FCFCFC;
  --success: #2F8A5B;
  --warning: #B7791F;
  --danger: #CF4B45;
  --info: #5F7B73;
  --el-color-primary: #0F766E;
  --el-color-primary-light-3: #4F9E95;
  --el-color-primary-light-5: #8AC2BA;
  --el-color-primary-light-7: #C4E2DC;
  --el-color-primary-light-8: #D9EFE9;
  --el-color-primary-light-9: #EDF8F4;
  --el-color-primary-dark-2: #0B5F59;
  --el-color-success: #2F8A5B;
  --el-color-success-light-9: #EEF8F1;
  --el-color-warning: #B7791F;
  --el-color-warning-light-9: #FFF8E8;
  --el-color-danger: #CF4B45;
  --el-color-danger-light-9: #FFF1F0;
}

/* B. 燕麦杏：奶油暖底 + 陶土色主操作 */
html[data-theme="oat"] {
  --bg: #f8f0e3;
  --bg-deep: #eedfc9;
  --bg-glow: #fbe6c9;
  --surface: #fcf1de;
  --surface-2: #f7e9d4;
  --surface-3: #f0dfc5;
  --ink: #38281a;
  --ink-soft: #5b4633;
  --muted: #8a7361;
  --line: #e6d6c0;
  --brand: #b45309;
  --brand-2: #92400e;
  --brand-3: #fbead6;
  --brand-line: #e8c8a2;
  --accent: #2f7d6a;
  --accent-soft: #e7f4ef;
  --hero-start: #8a3c0b;
  --hero-end: #c2651e;
  --hero-sub: #f7d9b8;
  --sidebar: #f1e6d6;
  --sidebar-2: #e8d9c4;
  --menu-active-start: #b45309;
  --menu-active-end: #92400e;
  --side-text: #4a3525;
  --side-muted: #8a7460;
  --side-divider: #e3d2bd;
  --side-hover: #fbf4ea;
  --side-icon: #98775a;
  --side-icon-active: #ffffff;
  --side-accent: #ffe6c7;
  --side-glow: rgba(180, 83, 9, .10);
  --login-start: #5c2a09;
  --login-mid: #9a4a0b;
  --login-end: #b85c14;
  --shadow: 0 8px 22px rgba(120, 73, 25, .08);
  --shadow-strong: 0 22px 48px rgba(120, 73, 25, .16);
  --topbar-shadow: 0 1px 0 var(--line), 0 10px 24px rgba(180, 83, 9, .06);
  --hero-shadow: 0 18px 40px rgba(138, 60, 11, .18);
  --warn-bg: #fdf0d6;
  --warn-line: #eccb96;
  --warn-ink: #74460d;
  --table-head: #fbf0df;
  --row-hover: #fff8ed;
  --input-bg: #fffdf8;
  --success: #4f7d54;
  --warning: #b7791f;
  --danger: #cf4b45;
  --info: #8a7361;
  --el-color-primary: #b45309;
  --el-color-primary-light-3: #cb7d42;
  --el-color-primary-light-5: #dda570;
  --el-color-primary-light-7: #edc9a3;
  --el-color-primary-light-8: #f3d9bb;
  --el-color-primary-light-9: #fbf0e2;
  --el-color-primary-dark-2: #92400e;
  --el-color-success: #4f7d54;
  --el-color-success-light-9: #eef5ee;
  --el-color-warning: #b7791f;
  --el-color-warning-light-9: #fdf0d6;
  --el-color-danger: #cf4b45;
  --el-color-danger-light-9: #fff1f0;
}

/* C. 雾霭蓝：灰蓝画布 + 低饱和钢蓝主操作 */
html[data-theme="mist"] {
  --bg: #eaf1f7;
  --bg-deep: #dce8f2;
  --bg-glow: #d8eaf7;
  --surface: #edf7fd;
  --surface-2: #e4f1fa;
  --surface-3: #d5e7f4;
  --ink: #1c2d3e;
  --ink-soft: #3e566b;
  --muted: #687f93;
  --line: #d0e0ed;
  --brand: #3d6f9e;
  --brand-2: #2e5a80;
  --brand-3: #e1effa;
  --brand-line: #bad5e9;
  --accent: #c98a35;
  --accent-soft: #fdf4e4;
  --hero-start: #274f70;
  --hero-end: #3d6f9e;
  --hero-sub: #cfe4f5;
  --sidebar: #e2eef8;
  --sidebar-2: #d4e5f1;
  --menu-active-start: #3d6f9e;
  --menu-active-end: #2e5a80;
  --side-text: #223a4e;
  --side-muted: #6b8397;
  --side-divider: #cddfeb;
  --side-hover: #eff7fd;
  --side-icon: #5c7b93;
  --side-icon-active: #ffffff;
  --side-accent: #dcefff;
  --side-glow: rgba(61, 111, 158, .12);
  --login-start: #1c3a52;
  --login-mid: #2e5a80;
  --login-end: #3d6f9e;
  --shadow: 0 8px 22px rgba(34, 74, 110, .08);
  --shadow-strong: 0 22px 48px rgba(34, 74, 110, .16);
  --topbar-shadow: 0 1px 0 var(--line), 0 10px 24px rgba(61, 111, 158, .07);
  --hero-shadow: 0 18px 40px rgba(39, 79, 112, .18);
  --warn-bg: #fdf4e4;
  --warn-line: #ecd3a8;
  --warn-ink: #744b16;
  --table-head: #eaf3fa;
  --row-hover: #f1f8fd;
  --input-bg: #fbfdff;
  --success: #3f8a63;
  --warning: #b7791f;
  --danger: #cf4b45;
  --info: #687f93;
  --el-color-primary: #3d6f9e;
  --el-color-primary-light-3: #6b93b5;
  --el-color-primary-light-5: #96b2ca;
  --el-color-primary-light-7: #c1d3e2;
  --el-color-primary-light-8: #d3e2ed;
  --el-color-primary-light-9: #e9f2f8;
  --el-color-primary-dark-2: #2e5a80;
  --el-color-success: #3f8a63;
  --el-color-success-light-9: #eef7f2;
  --el-color-warning: #b7791f;
  --el-color-warning-light-9: #fdf4e4;
  --el-color-danger: #cf4b45;
  --el-color-danger-light-9: #fff1f0;
}

/* D. 薄雾紫：淡紫画布 + 雾紫主操作 */
html[data-theme="lilac"] {
  --bg: #f1ecf9;
  --bg-deep: #e2d9f2;
  --bg-glow: #e6dbf7;
  --surface: #f5eeff;
  --surface-2: #eee5fc;
  --surface-3: #e3d7f5;
  --ink: #2a2340;
  --ink-soft: #4d4067;
  --muted: #786a91;
  --line: #ded3ee;
  --brand: #6d5bd0;
  --brand-2: #5643b6;
  --brand-3: #eee8fd;
  --brand-line: #cabcf0;
  --accent: #c98a35;
  --accent-soft: #fdf4e4;
  --hero-start: #41318f;
  --hero-end: #6d5bd0;
  --hero-sub: #ded4ff;
  --sidebar: #ece6f8;
  --sidebar-2: #e2d9f2;
  --menu-active-start: #6d5bd0;
  --menu-active-end: #5643b6;
  --side-text: #302647;
  --side-muted: #77698f;
  --side-divider: #ddd2ec;
  --side-hover: #f4effc;
  --side-icon: #6f5f8c;
  --side-icon-active: #ffffff;
  --side-accent: #e7dcff;
  --side-glow: rgba(109, 91, 208, .12);
  --login-start: #2f246e;
  --login-mid: #4f3da8;
  --login-end: #6d5bd0;
  --shadow: 0 8px 22px rgba(69, 54, 126, .08);
  --shadow-strong: 0 22px 48px rgba(69, 54, 126, .16);
  --topbar-shadow: 0 1px 0 var(--line), 0 10px 24px rgba(109, 91, 208, .07);
  --hero-shadow: 0 18px 40px rgba(65, 49, 143, .18);
  --warn-bg: #fdf4e4;
  --warn-line: #ecd3a8;
  --warn-ink: #744b16;
  --table-head: #f1eafb;
  --row-hover: #f6f2fd;
  --input-bg: #fcfaff;
  --success: #3f8a63;
  --warning: #b7791f;
  --danger: #cf4b45;
  --info: #786a91;
  --el-color-primary: #6d5bd0;
  --el-color-primary-light-3: #8979da;
  --el-color-primary-light-5: #a99ce4;
  --el-color-primary-light-7: #cdc3f1;
  --el-color-primary-light-8: #ded6f6;
  --el-color-primary-light-9: #f0ecfb;
  --el-color-primary-dark-2: #5643b6;
  --el-color-success: #3f8a63;
  --el-color-success-light-9: #eef7f2;
  --el-color-warning: #b7791f;
  --el-color-warning-light-9: #fdf4e4;
  --el-color-danger: #cf4b45;
  --el-color-danger-light-9: #fff1f0;
}

/* E. 自定义配色：所有模块颜色由主题面板写入，派生色按主色/画布自动计算 */
html[data-theme="custom"] {
  --bg: #F7F4FA;
  --bg-deep: color-mix(in srgb, var(--bg) 88%, var(--brand) 12%);
  --bg-glow: color-mix(in srgb, var(--bg) 80%, var(--brand-3) 20%);
  --surface: #F5EEFF;
  --surface-2: #EEE5FC;
  --surface-3: color-mix(in srgb, var(--surface-2) 78%, var(--brand-3) 22%);
  --topbar: #F8F3FE;
  --ink: #241F33;
  --ink-soft: color-mix(in srgb, var(--ink) 72%, var(--bg) 28%);
  --muted: #6F6883;
  --line: #DED5EE;
  --brand: #6D5BD0;
  --brand-2: #5643B6;
  --brand-3: #EEE8FD;
  --brand-line: color-mix(in srgb, var(--brand) 34%, var(--surface) 66%);
  --accent: #C98A35;
  --accent-soft: color-mix(in srgb, var(--accent) 12%, white);
  --hero-start: var(--brand-2);
  --hero-end: var(--brand);
  --hero-sub: color-mix(in srgb, var(--brand-3) 62%, white);
  --sidebar: #ECE6F8;
  --sidebar-2: color-mix(in srgb, var(--sidebar) 90%, var(--brand) 10%);
  --menu-active-start: var(--brand);
  --menu-active-end: var(--brand-2);
  --side-text: var(--ink);
  --side-muted: var(--muted);
  --side-divider: color-mix(in srgb, var(--line) 84%, var(--surface) 16%);
  --side-hover: color-mix(in srgb, var(--surface) 76%, white);
  --side-icon: var(--muted);
  --side-icon-active: #FFFFFF;
  --side-accent: var(--brand-3);
  --side-glow: color-mix(in srgb, var(--brand) 14%, transparent);
  --login-start: var(--brand-2);
  --login-mid: var(--brand);
  --login-end: var(--brand);
  --shadow: 0 8px 22px color-mix(in srgb, var(--brand) 12%, transparent);
  --shadow-strong: 0 22px 48px color-mix(in srgb, var(--brand) 18%, transparent);
  --topbar-shadow: 0 1px 0 var(--line), 0 10px 24px color-mix(in srgb, var(--brand) 8%, transparent);
  --hero-shadow: 0 18px 40px color-mix(in srgb, var(--brand) 18%, transparent);
  --warn-bg: color-mix(in srgb, var(--accent) 12%, white);
  --warn-line: color-mix(in srgb, var(--accent) 34%, white);
  --warn-ink: color-mix(in srgb, var(--accent) 74%, #2C2114);
  --table-head: color-mix(in srgb, var(--surface-2) 88%, var(--brand-3) 12%);
  --row-hover: color-mix(in srgb, var(--surface) 78%, var(--brand-3) 22%);
  --input-bg: var(--surface);
  --success: #3F8A63;
  --warning: #B7791F;
  --danger: #CF4B45;
  --info: var(--muted);
  --theme-control: #EEF1F4;
  --theme-control-line: #DCE1E6;
  --el-color-primary: var(--brand);
  --el-color-primary-light-3: color-mix(in srgb, var(--brand) 70%, white);
  --el-color-primary-light-5: color-mix(in srgb, var(--brand) 52%, white);
  --el-color-primary-light-7: color-mix(in srgb, var(--brand) 34%, white);
  --el-color-primary-light-8: color-mix(in srgb, var(--brand) 24%, white);
  --el-color-primary-light-9: color-mix(in srgb, var(--brand) 12%, white);
  --el-color-primary-dark-2: var(--brand-2);
  --el-color-success: #3F8A63;
  --el-color-success-light-9: #EEF7F2;
  --el-color-warning: #B7791F;
  --el-color-warning-light-9: #FDF4E4;
  --el-color-danger: #CF4B45;
  --el-color-danger-light-9: #FFF1F0;
}

/* 明亮主题共用组件层：浅色侧栏、带色顶栏、品牌色按钮和标题竖条 */
html:is([data-theme="sea"], [data-theme="mistblue"], [data-theme="custom"], [data-theme="oat"], [data-theme="mist"], [data-theme="lilac"]) body {
  background:
    radial-gradient(900px 460px at 100% 0%, var(--bg-glow) 0%, transparent 60%),
    linear-gradient(180deg, var(--bg) 0%, var(--bg) 100%);
  color: var(--ink);
}

html:is([data-theme="sea"], [data-theme="mistblue"], [data-theme="custom"], [data-theme="oat"], [data-theme="mist"], [data-theme="lilac"]) #app {
  background: transparent;
  box-shadow: none;
}

html:is([data-theme="sea"], [data-theme="mistblue"], [data-theme="custom"], [data-theme="oat"], [data-theme="mist"], [data-theme="lilac"]) .topbar {
  background: color-mix(in srgb, var(--topbar, var(--surface)) 93%, transparent);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  box-shadow: var(--topbar-shadow);
}

html:is([data-theme="sea"], [data-theme="mistblue"], [data-theme="custom"], [data-theme="oat"], [data-theme="mist"], [data-theme="lilac"]) .sidebar {
  color-scheme: light;
  box-shadow: inset -1px 0 0 var(--side-divider), 10px 0 26px color-mix(in srgb, var(--brand) 10%, transparent);
}

html:is([data-theme="sea"], [data-theme="mistblue"], [data-theme="custom"], [data-theme="oat"], [data-theme="mist"], [data-theme="lilac"]) .side-brand {
  background: linear-gradient(180deg, color-mix(in srgb, var(--surface) 88%, transparent), rgba(255, 255, 255, .12));
}

html:is([data-theme="sea"], [data-theme="mistblue"], [data-theme="custom"], [data-theme="oat"], [data-theme="mist"], [data-theme="lilac"]) .side-brand .logo {
  background: linear-gradient(145deg, var(--brand), var(--brand-2));
  box-shadow: 0 9px 20px color-mix(in srgb, var(--brand) 24%, transparent), inset 0 1px 0 rgba(255, 255, 255, .35);
}

html:is([data-theme="sea"], [data-theme="mistblue"], [data-theme="custom"], [data-theme="oat"], [data-theme="mist"], [data-theme="lilac"]) .side-foot {
  background: linear-gradient(0deg, color-mix(in srgb, var(--brand-3) 55%, transparent), transparent);
}

html:is([data-theme="sea"], [data-theme="mistblue"], [data-theme="custom"], [data-theme="oat"], [data-theme="mist"], [data-theme="lilac"]) .menu-item .mi {
  background: color-mix(in srgb, var(--brand) 9%, transparent);
}

html:is([data-theme="sea"], [data-theme="mistblue"], [data-theme="custom"], [data-theme="oat"], [data-theme="mist"], [data-theme="lilac"]) .menu-item.active {
  color: #fff;
  box-shadow: 0 8px 18px color-mix(in srgb, var(--brand) 22%, transparent), inset 0 1px 0 rgba(255, 255, 255, .16);
}

html:is([data-theme="sea"], [data-theme="mistblue"], [data-theme="custom"], [data-theme="oat"], [data-theme="mist"], [data-theme="lilac"]) .menu-item.active .mi {
  background: rgba(255, 255, 255, .16);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .14);
}

html:is([data-theme="sea"], [data-theme="mistblue"], [data-theme="custom"], [data-theme="oat"], [data-theme="mist"], [data-theme="lilac"]) .menu-item.active::before {
  background: rgba(255, 255, 255, .86);
  box-shadow: none;
}

html:is([data-theme="sea"], [data-theme="mistblue"], [data-theme="custom"], [data-theme="oat"], [data-theme="mist"], [data-theme="lilac"]) .card {
  border-color: color-mix(in srgb, var(--line) 82%, var(--surface));
  box-shadow: var(--shadow), inset 0 1px 0 rgba(255, 255, 255, .55);
}

html:is([data-theme="sea"], [data-theme="mistblue"], [data-theme="custom"], [data-theme="oat"], [data-theme="mist"], [data-theme="lilac"]) .page-head h1 {
  position: relative;
  padding-left: 12px;
}

html:is([data-theme="sea"], [data-theme="mistblue"], [data-theme="custom"], [data-theme="oat"], [data-theme="mist"], [data-theme="lilac"]) .page-head h1::before {
  content: "";
  position: absolute;
  left: 0;
  top: 2px;
  bottom: 2px;
  width: 3px;
  border-radius: 3px;
  background: linear-gradient(180deg, color-mix(in srgb, var(--brand) 60%, white), var(--brand));
}

html:is([data-theme="sea"], [data-theme="mistblue"], [data-theme="custom"], [data-theme="oat"], [data-theme="mist"], [data-theme="lilac"]) .el-button--primary {
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  border-color: var(--brand);
  box-shadow: 0 6px 14px color-mix(in srgb, var(--brand) 20%, transparent);
}

html:is([data-theme="sea"], [data-theme="mistblue"], [data-theme="custom"], [data-theme="oat"], [data-theme="mist"], [data-theme="lilac"]) .el-button--primary:hover,
html:is([data-theme="sea"], [data-theme="mistblue"], [data-theme="custom"], [data-theme="oat"], [data-theme="mist"], [data-theme="lilac"]) .el-button--primary:focus {
  background: linear-gradient(135deg, color-mix(in srgb, var(--brand) 82%, white), var(--brand));
  border-color: var(--brand);
}

html:is([data-theme="sea"], [data-theme="mistblue"], [data-theme="custom"], [data-theme="oat"], [data-theme="mist"], [data-theme="lilac"]) .el-button--primary.is-plain {
  background: var(--brand-3);
  border-color: var(--brand-line);
  color: var(--brand-2);
}

/* link/text 按钮不能继承实心主按钮的渐变底，否则深色文字会压在深色底上 */
html:is([data-theme="sea"], [data-theme="mistblue"], [data-theme="custom"], [data-theme="oat"], [data-theme="mist"], [data-theme="lilac"]) .el-button--primary.is-link,
html:is([data-theme="sea"], [data-theme="mistblue"], [data-theme="custom"], [data-theme="oat"], [data-theme="mist"], [data-theme="lilac"]) .el-button--primary.is-text {
  background: transparent;
  border-color: transparent;
  box-shadow: none;
  color: var(--brand-2);
}

html:is([data-theme="sea"], [data-theme="mistblue"], [data-theme="custom"], [data-theme="oat"], [data-theme="mist"], [data-theme="lilac"]) .el-button--primary.is-link:hover,
html:is([data-theme="sea"], [data-theme="mistblue"], [data-theme="custom"], [data-theme="oat"], [data-theme="mist"], [data-theme="lilac"]) .el-button--primary.is-link:focus,
html:is([data-theme="sea"], [data-theme="mistblue"], [data-theme="custom"], [data-theme="oat"], [data-theme="mist"], [data-theme="lilac"]) .el-button--primary.is-text:hover,
html:is([data-theme="sea"], [data-theme="mistblue"], [data-theme="custom"], [data-theme="oat"], [data-theme="mist"], [data-theme="lilac"]) .el-button--primary.is-text:focus {
  background: color-mix(in srgb, var(--brand) 8%, transparent);
  border-color: transparent;
  box-shadow: none;
  color: var(--brand);
}

/* 浅色主题下的删除/停用/通过等语义链接，统一加深到卡片上 4.5:1 以上 */
html:not(.dark) .el-button--danger.is-link,
html:not(.dark) .el-button--danger.is-text {
  color: #B53A33;
}

html:not(.dark) .el-button--warning.is-link,
html:not(.dark) .el-button--warning.is-text {
  color: #8A5A10;
}

html:not(.dark) .el-button--success.is-link,
html:not(.dark) .el-button--success.is-text {
  color: #2F6E30;
}

html:not(.dark) .el-button--danger.is-link:hover,
html:not(.dark) .el-button--danger.is-link:focus,
html:not(.dark) .el-button--danger.is-text:hover,
html:not(.dark) .el-button--danger.is-text:focus {
  color: #9A2F29;
}

html:not(.dark) .el-button--warning.is-link:hover,
html:not(.dark) .el-button--warning.is-link:focus,
html:not(.dark) .el-button--warning.is-text:hover,
html:not(.dark) .el-button--warning.is-text:focus {
  color: #74490C;
}

html:not(.dark) .el-button--success.is-link:hover,
html:not(.dark) .el-button--success.is-link:focus,
html:not(.dark) .el-button--success.is-text:hover,
html:not(.dark) .el-button--success.is-text:focus {
  color: #245A27;
}

html:is([data-theme="sea"], [data-theme="mistblue"], [data-theme="custom"], [data-theme="oat"], [data-theme="mist"], [data-theme="lilac"]) .el-table th.el-table__cell {
  background: var(--table-head);
  color: var(--ink);
  font-weight: 600;
}

html:is([data-theme="sea"], [data-theme="mistblue"], [data-theme="custom"], [data-theme="oat"], [data-theme="mist"], [data-theme="lilac"]) .el-table td.el-table__cell {
  border-bottom-color: color-mix(in srgb, var(--line) 86%, var(--surface));
}

/* 自定义配色编辑器：工具自身用中性色，避免干扰对预览颜色的判断 */
.theme-editor-mask {
  position: fixed;
  inset: 0;
  z-index: 3000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(18, 24, 30, .42);
}

.theme-editor {
  width: min(860px, calc(100vw - 32px));
  max-height: calc(100vh - 48px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid #D8D5CE;
  border-radius: 16px;
  background: #FBFAF7;
  color: #2B2A26;
  box-shadow: 0 28px 70px rgba(18, 24, 30, .26);
  font-family: inherit;
}

.theme-editor-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  padding: 20px 22px 14px;
  border-bottom: 1px solid #E8E4DB;
}

.theme-editor-head h3 {
  margin: 0;
  color: #24231F;
  font-size: 18px;
  line-height: 1.3;
}

.theme-editor-head p {
  margin: 5px 0 0;
  color: #716C61;
  font-size: 12px;
  line-height: 1.6;
}

.theme-editor-close {
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  display: grid;
  place-items: center;
  border: 1px solid #DDD8CE;
  border-radius: 9px;
  background: #FFFFFF;
  color: #6E685C;
  font: inherit;
  font-size: 15px;
  cursor: pointer;
}

.theme-editor-close:hover {
  border-color: #B9B2A4;
  color: #2B2A26;
}

.theme-editor-body {
  overflow: auto;
  padding: 16px 22px 18px;
  overscroll-behavior: contain;
}

.theme-editor-group {
  margin-bottom: 14px;
}

.theme-editor-group:last-child {
  margin-bottom: 0;
}

.theme-editor-group h4 {
  margin: 0 0 8px;
  color: #8A8376;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .08em;
}

.theme-editor-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px 16px;
}

.theme-color-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 34px 82px;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 5px 8px;
  border: 1px solid #E6E1D8;
  border-radius: 9px;
  background: #FFFFFF;
}

.theme-role {
  min-width: 0;
  line-height: 1.25;
}

.theme-role b {
  display: block;
  color: #33312C;
  font-size: 12px;
  font-weight: 600;
}

.theme-role small {
  display: block;
  margin-top: 2px;
  overflow: hidden;
  color: #8A8376;
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.theme-color-row input[type="color"] {
  width: 34px;
  height: 32px;
  padding: 2px;
  border: 1px solid #D7D1C5;
  border-radius: 7px;
  background: #FFFFFF;
  cursor: pointer;
}

.theme-hex {
  width: 82px;
  height: 30px;
  padding: 0 7px;
  border: 1px solid #DDD7CB;
  border-radius: 7px;
  background: #F8F6F1;
  color: #3A3832;
  font: 11px/1 ui-monospace, SFMono-Regular, Consolas, monospace;
  text-transform: uppercase;
}

.theme-hex:focus {
  outline: 2px solid #6D5BD0;
  outline-offset: 1px;
  border-color: #6D5BD0;
}

.theme-editor-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 13px 22px 16px;
  border-top: 1px solid #E8E4DB;
  background: #F7F5F0;
}

.theme-editor-checks {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.theme-check {
  padding: 4px 8px;
  border-radius: 999px;
  background: #E8F3EC;
  color: #28694C;
  font-size: 11px;
  line-height: 1.4;
}

.theme-check.low {
  background: #FBEAE7;
  color: #9A3A2E;
}

.theme-editor-actions {
  display: flex;
  gap: 8px;
  flex: 0 0 auto;
}

.theme-editor-btn {
  min-height: 36px;
  padding: 0 16px;
  border-radius: 9px;
  font: inherit;
  font-size: 12px;
  cursor: pointer;
}

.theme-editor-btn.ghost {
  border: 1px solid #D9D3C7;
  background: #FFFFFF;
  color: #5D594F;
}

.theme-editor-btn.ghost:hover {
  border-color: #BEB6A8;
  color: #2B2A26;
}

.theme-editor-btn.primary {
  border: 1px solid #6D5BD0;
  background: #6D5BD0;
  color: #FFFFFF;
}

.theme-editor-btn.primary:hover {
  background: #5B49C0;
  border-color: #5B49C0;
}

.theme-editor-btn:focus-visible,
.theme-editor-close:focus-visible {
  outline: 2px solid #6D5BD0;
  outline-offset: 2px;
}

@media (max-width: 700px) {
  .theme-editor-mask {
    padding: 10px;
  }

  .theme-editor {
    max-height: calc(100vh - 20px);
    border-radius: 13px;
  }

  .theme-editor-head {
    padding: 16px 16px 12px;
  }

  .theme-editor-body {
    padding: 12px 16px;
  }

  .theme-editor-grid {
    grid-template-columns: 1fr;
  }

  .theme-color-row {
    min-height: 48px;
    grid-template-columns: minmax(0, 1fr) 36px 88px;
  }

  .theme-hex {
    width: 88px;
    height: 34px;
    font-size: 16px;
  }

  .theme-editor-foot {
    align-items: stretch;
    flex-direction: column;
    padding: 12px 16px 14px;
  }

  .theme-editor-actions {
    justify-content: flex-end;
  }
}

