
/* assets/base.css */

:root {
  color-scheme: dark;
  --bg: #07090e;
  --accent-rgb: 225, 184, 74;
  --body-bg: linear-gradient(135deg, rgba(var(--accent-rgb), 0.075) 0 1px, transparent 1px 112px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.035), transparent 28%),
    linear-gradient(180deg, #11151b 0%, var(--bg) 42rem, #050608 100%);
  --grid-line-y: rgba(255, 255, 255, 0.009);
  --grid-line-x: rgba(255, 255, 255, 0.007);
  --ambient-bg: linear-gradient(90deg, rgba(var(--accent-rgb), 0.08), transparent 18rem),
    linear-gradient(180deg, rgba(255, 255, 255, 0.03), transparent 16rem);
  --surface: rgba(17, 22, 34, 0.6);
  --surface-hover: rgba(23, 30, 47, 0.8);
  --surface-soft: rgba(10, 13, 20, 0.7);
  --surface-solid: #10141d;
  --surface-panel: rgba(12, 16, 24, 0.78);
  --surface-card: rgba(12, 16, 24, 0.64);
  --surface-card-hover: rgba(15, 20, 30, 0.82);
  --surface-table: rgba(8, 11, 17, 0.56);
  --surface-subtle-hover: rgba(255, 255, 255, 0.025);
  --notice-bg-rgb: 18, 18, 13;
  --notice-bg-alpha: 0.78;
  --popover: #0b0f18;
  --line: rgba(255, 255, 255, 0.08);
  --line-soft: rgba(255, 255, 255, 0.035);
  --line-strong: rgba(255, 255, 255, 0.14);
  --text: #f3efe4;
  --muted: #8e96a4;
  --muted-dim: #68717f;
  --soft: #d5d9df;
  --heading-gradient: linear-gradient(180deg, #ffffff 0%, #dcdcdc 100%);
  --value-gradient: linear-gradient(180deg, #ffffff 0%, #e0e0e0 100%);
  --accent: #e1b84a;
  --accent-gradient: linear-gradient(135deg, #f5c453 0%, #dca00b 100%);
  --accent-soft: rgba(var(--accent-rgb), 0.1);
  --accent-fg: #0d0f12;
  --bad: #ff6b6b;
  --bad-rgb: 255, 107, 107;
  --bad-soft: rgba(255, 107, 107, 0.1);
  --ok: #4cd964;
  --ok-soft: rgba(76, 217, 100, 0.1);
  --warn: #f0c15d;
  --warn-soft: rgba(240, 193, 93, 0.1);
  --shadow-soft: 0 10px 28px rgba(0, 0, 0, 0.32);
  --font-sans: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", "Noto Sans CJK SC", "Helvetica Neue", Arial, sans-serif;
  --font-display: var(--font-sans);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --duration-slow: 620ms;
  --radius-sm: 10px;
  --radius-md: 14px;
  --radius-lg: 18px;
  --radius-xl: 22px;
  --radius-pill: 999px;
  --shadow-card: 0 1px 0 rgba(255, 255, 255, 0.045) inset, 0 12px 32px rgba(0, 0, 0, 0.24);
  --shadow-elevated: 0 1px 0 rgba(255, 255, 255, 0.06) inset, 0 20px 48px rgba(0, 0, 0, 0.34);
  --shadow-float: 0 28px 72px rgba(0, 0, 0, 0.46);
  --glass-blur: saturate(160%) blur(22px);
}

html[data-theme="white"] {
  color-scheme: light;
  --bg: #eef1f5;
  --accent-rgb: 181, 123, 9;
  --body-bg: linear-gradient(135deg, rgba(var(--accent-rgb), 0.1) 0 1px, transparent 1px 112px),
    linear-gradient(90deg, rgba(25, 33, 46, 0.045), transparent 30%),
    linear-gradient(180deg, #f8fafc 0%, var(--bg) 42rem, #e7ebf0 100%);
  --grid-line-y: rgba(25, 33, 46, 0.04);
  --grid-line-x: rgba(25, 33, 46, 0.032);
  --ambient-bg: linear-gradient(90deg, rgba(var(--accent-rgb), 0.08), transparent 18rem),
    linear-gradient(180deg, rgba(255, 255, 255, 0.65), transparent 18rem);
  --surface: rgba(255, 255, 255, 0.72);
  --surface-hover: rgba(255, 255, 255, 0.92);
  --surface-soft: rgba(255, 255, 255, 0.78);
  --surface-solid: #ffffff;
  --surface-panel: rgba(255, 255, 255, 0.82);
  --surface-card: rgba(255, 255, 255, 0.86);
  --surface-card-hover: rgba(255, 255, 255, 0.96);
  --surface-table: rgba(255, 255, 255, 0.54);
  --surface-subtle-hover: rgba(25, 33, 46, 0.035);
  --notice-bg-rgb: 255, 255, 255;
  --popover: #ffffff;
  --line: rgba(25, 33, 46, 0.12);
  --line-soft: rgba(25, 33, 46, 0.075);
  --line-strong: rgba(25, 33, 46, 0.2);
  --text: #161b22;
  --muted: #66707f;
  --muted-dim: #8590a0;
  --soft: #29313c;
  --heading-gradient: linear-gradient(180deg, #121821 0%, #35404d 100%);
  --value-gradient: linear-gradient(180deg, #121821 0%, #384452 100%);
  --accent: #b57b09;
  --accent-gradient: linear-gradient(135deg, #f0bd48 0%, #c98c08 100%);
  --accent-soft: rgba(var(--accent-rgb), 0.11);
  --accent-fg: #15100a;
  --bad: #c93434;
  --bad-rgb: 201, 52, 52;
  --bad-soft: rgba(201, 52, 52, 0.1);
  --ok: #1d8f42;
  --ok-soft: rgba(29, 143, 66, 0.1);
  --warn: #a66f05;
  --warn-soft: rgba(166, 111, 5, 0.1);
  --shadow-soft: 0 10px 24px rgba(25, 33, 46, 0.13);
  --shadow-card: 0 1px 0 rgba(255, 255, 255, 0.86) inset, 0 10px 28px rgba(25, 33, 46, 0.08);
  --shadow-elevated: 0 1px 0 rgba(255, 255, 255, 0.92) inset, 0 16px 40px rgba(25, 33, 46, 0.12);
  --shadow-float: 0 24px 56px rgba(25, 33, 46, 0.16);
}

html[data-theme="ocean"] {
  color-scheme: dark;
  --bg: #081018;
  --accent-rgb: 126, 165, 199;
  --accent: #7ea5c7;
  --accent-gradient: linear-gradient(135deg, #b5d0e4 0%, #6f96ba 100%);
  --accent-fg: #071019;
  --surface-solid: #101923;
  --popover: #0b121d;
  --notice-bg-rgb: 12, 22, 32;
  --text: #f0f6fb;
  --muted: #93a3b2;
  --muted-dim: #6b7a89;
  --soft: #d6e2eb;
  --theme-heading-lo: #d7e5f0;
  --theme-value-lo: #d9e6ee;
  --ink-rgb: 214, 231, 243;
  --theme-body-deep: #05090d;
  --shadow-soft: 0 10px 28px rgba(2, 6, 10, 0.34);
  --theme-ambient-accent-a: 0.12;
}

html[data-theme="teal"] {
  color-scheme: dark;
  --bg: #07110f;
  --accent-rgb: 114, 190, 172;
  --accent: #72beac;
  --accent-gradient: linear-gradient(135deg, #a8d9cd 0%, #55a391 100%);
  --accent-fg: #05100d;
  --surface-solid: #101a17;
  --popover: #0a1412;
  --notice-bg-rgb: 12, 24, 21;
  --text: #eef8f5;
  --muted: #8fa69f;
  --muted-dim: #687c76;
  --soft: #d4e8e2;
  --theme-heading-lo: #d4ebe4;
  --theme-value-lo: #d7ebe5;
  --ink-rgb: 214, 238, 232;
  --theme-body-deep: #040807;
  --shadow-soft: 0 10px 28px rgba(2, 8, 6, 0.34);
}

html[data-theme="wine"] {
  color-scheme: dark;
  --bg: #130910;
  --accent-rgb: 206, 132, 153;
  --accent: #ce8499;
  --accent-gradient: linear-gradient(135deg, #e7b7c5 0%, #b8667e 100%);
  --accent-fg: #17060d;
  --surface-solid: #1b1018;
  --popover: #170b14;
  --notice-bg-rgb: 26, 13, 22;
  --text: #fbf0f4;
  --muted: #aa929b;
  --muted-dim: #806b73;
  --soft: #ead5dd;
  --theme-heading-lo: #efd6df;
  --theme-value-lo: #efd8e0;
  --ink-rgb: 244, 220, 228;
  --theme-body-deep: #070306;
  --shadow-soft: 0 10px 28px rgba(8, 2, 5, 0.34);
}

html[data-theme="purple"] {
  color-scheme: dark;
  --bg: #100c17;
  --accent-rgb: 168, 139, 211;
  --accent: #a88bd3;
  --accent-gradient: linear-gradient(135deg, #d0bdf0 0%, #9171c5 100%);
  --accent-fg: #110818;
  --surface-solid: #171221;
  --popover: #130e1c;
  --notice-bg-rgb: 22, 16, 32;
  --text: #f5f0fb;
  --muted: #a196b3;
  --muted-dim: #766d87;
  --soft: #e1d8ee;
  --theme-heading-lo: #e4d9f2;
  --theme-value-lo: #e5dcf1;
  --ink-rgb: 231, 221, 247;
  --theme-body-deep: #07050a;
  --shadow-soft: 0 10px 28px rgba(5, 3, 9, 0.34);
}

html[data-theme="amber"] {
  color-scheme: dark;
  --bg: #120d07;
  --accent-rgb: 213, 154, 69;
  --accent: #d59a45;
  --accent-gradient: linear-gradient(135deg, #edc174 0%, #b97928 100%);
  --accent-fg: #140b03;
  --surface-solid: #1b150d;
  --popover: #160f08;
  --notice-bg-rgb: 26, 18, 9;
  --text: #fbf4e8;
  --muted: #aa9b87;
  --muted-dim: #7f725f;
  --soft: #eadcca;
  --theme-heading-lo: #f0dfc5;
  --theme-value-lo: #efdfc9;
  --ink-rgb: 245, 228, 198;
  --theme-body-deep: #070502;
  --shadow-soft: 0 10px 28px rgba(7, 4, 1, 0.34);
}

html[data-theme="forest"] {
  color-scheme: dark;
  --bg: #07100a;
  --accent-rgb: 123, 166, 92;
  --accent: #7ba65c;
  --accent-gradient: linear-gradient(135deg, #b2d291 0%, #668f45 100%);
  --accent-fg: #071003;
  --surface-solid: #10180f;
  --popover: #0b140b;
  --notice-bg-rgb: 13, 24, 13;
  --text: #f1f8ed;
  --muted: #95a68c;
  --muted-dim: #6f7d67;
  --soft: #dcebd3;
  --theme-heading-lo: #dcebd2;
  --theme-value-lo: #deecd6;
  --ink-rgb: 224, 239, 213;
  --theme-body-deep: #030704;
  --shadow-soft: 0 10px 28px rgba(2, 7, 2, 0.34);
}

html[data-theme="graphite"] {
  color-scheme: dark;
  --bg: #0a0c0f;
  --accent-rgb: 225, 184, 74;
  --accent: #e1b84a;
  --accent-gradient: linear-gradient(135deg, #f0c75a 0%, #c99520 100%);
  --accent-fg: #07090c;
  --surface-solid: #141820;
  --popover: #0e1117;
  --notice-bg-rgb: 15, 18, 24;
  --text: #f2f5f8;
  --muted: #9aa4b2;
  --muted-dim: #707987;
  --soft: #dbe2ea;
  --theme-heading-lo: #dde4eb;
  --theme-value-lo: #dfe5eb;
  --ink-rgb: 226, 232, 240;
  --theme-body-deep: #050608;
  --shadow-soft: 0 10px 28px rgba(2, 3, 5, 0.34);
  --theme-body-accent-a: 0.06;
  --theme-ambient-accent-a: 0.09;
  --theme-accent-soft-a: 0.11;
  --theme-grid-y: 0.01;
}

html[data-theme="black"] {
  color-scheme: dark;
  --bg: #050608;
  --accent-rgb: 225, 184, 74;
  --accent: #e1b84a;
  --accent-gradient: linear-gradient(135deg, #f0c75a 0%, #c99520 100%);
  --accent-fg: #07090c;
  --surface-solid: #0c0e12;
  --popover: #090b0f;
  --notice-bg-rgb: 10, 12, 16;
  --text: #f2f5f8;
  --muted: #9aa4b2;
  --muted-dim: #707987;
  --soft: #dbe2ea;
  --theme-heading-lo: #dde4eb;
  --theme-value-lo: #dfe5eb;
  --ink-rgb: 226, 232, 240;
  --theme-body-deep: #020304;
  --shadow-soft: 0 10px 28px rgba(0, 0, 0, 0.5);
  --theme-body-accent-a: 0.05;
  --theme-ambient-accent-a: 0.08;
  --theme-accent-soft-a: 0.1;
  --theme-grid-y: 0.008;
}

html[data-theme="cyan"] {
  color-scheme: dark;
  --bg: #061014;
  --accent-rgb: 93, 184, 203;
  --accent: #5db8cb;
  --accent-gradient: linear-gradient(135deg, #9ed9e5 0%, #3f9bae 100%);
  --accent-fg: #041013;
  --surface-solid: #0d1b21;
  --popover: #08161b;
  --notice-bg-rgb: 9, 26, 31;
  --text: #effaff;
  --muted: #8faab2;
  --muted-dim: #687f87;
  --soft: #d4ebf1;
  --theme-heading-lo: #d4edf3;
  --theme-value-lo: #d7edf3;
  --ink-rgb: 211, 241, 247;
  --theme-body-deep: #020709;
  --shadow-soft: 0 10px 28px rgba(1, 6, 8, 0.34);
}

html[data-theme="mecha-red"] {
  color-scheme: dark;
  --bg: #0a0204;
  --accent-rgb: 255, 30, 30;
  --accent: #ff1e1e;
  --accent-gradient: linear-gradient(135deg, #ff5555 0%, #cc0000 100%);
  --accent-fg: #ffffff;
  --surface-solid: #120508;
  --popover: #0e0305;
  --notice-bg-rgb: 20, 4, 6;
  --text: #f8eeef;
  --muted: #a87880;
  --muted-dim: #7a5458;
  --soft: #e8c8cc;
  --theme-heading-lo: #f0c8cc;
  --theme-value-lo: #f0ccd0;
  --ink-rgb: 255, 80, 80;
  --theme-body-deep: #040102;
  --shadow-soft: 0 10px 28px rgba(0, 0, 0, 0.45);
}

html[data-theme="mecha-blue"] {
  color-scheme: dark;
  --bg: #02060c;
  --accent-rgb: 0, 140, 255;
  --accent: #008cff;
  --accent-gradient: linear-gradient(135deg, #44aaff 0%, #0060cc 100%);
  --accent-fg: #ffffff;
  --surface-solid: #081020;
  --popover: #040a16;
  --notice-bg-rgb: 4, 8, 20;
  --text: #eef4ff;
  --muted: #7898c0;
  --muted-dim: #587098;
  --soft: #c8dcf8;
  --theme-heading-lo: #c8dcff;
  --theme-value-lo: #cce0ff;
  --ink-rgb: 80, 160, 255;
  --theme-body-deep: #010308;
  --shadow-soft: 0 10px 28px rgba(0, 0, 0, 0.45);
}

html[data-theme="mecha-green"] {
  color-scheme: dark;
  --bg: #030a04;
  --accent-rgb: 0, 255, 80;
  --accent: #00ff50;
  --accent-gradient: linear-gradient(135deg, #44ff80 0%, #00c830 100%);
  --accent-fg: #041208;
  --surface-solid: #0a140c;
  --popover: #050e07;
  --notice-bg-rgb: 4, 16, 6;
  --text: #eefcf2;
  --muted: #6cb888;
  --muted-dim: #4a8a64;
  --soft: #c8f0d8;
  --theme-heading-lo: #c8f0d8;
  --theme-value-lo: #ccf0dc;
  --ink-rgb: 60, 255, 120;
  --theme-body-deep: #020603;
  --shadow-soft: 0 10px 28px rgba(0, 0, 0, 0.45);
}

html[data-theme="mecha-orange"] {
  color-scheme: dark;
  --bg: #0c0602;
  --accent-rgb: 255, 120, 0;
  --accent: #ff7800;
  --accent-gradient: linear-gradient(135deg, #ffaa44 0%, #cc5500 100%);
  --accent-fg: #1a0e00;
  --surface-solid: #180c04;
  --popover: #140802;
  --notice-bg-rgb: 24, 10, 3;
  --text: #fff6ee;
  --muted: #b89068;
  --muted-dim: #8a6a48;
  --soft: #f0d8c0;
  --theme-heading-lo: #f0d8c0;
  --theme-value-lo: #f0dcc4;
  --ink-rgb: 255, 160, 60;
  --theme-body-deep: #060301;
  --shadow-soft: 0 10px 28px rgba(0, 0, 0, 0.45);
}

html[data-theme="mecha-pink"] {
  color-scheme: dark;
  --bg: #0a030a;
  --accent-rgb: 255, 30, 180;
  --accent: #ff1eb4;
  --accent-gradient: linear-gradient(135deg, #ff55d4 0%, #cc0088 100%);
  --accent-fg: #ffffff;
  --surface-solid: #140610;
  --popover: #0c030a;
  --notice-bg-rgb: 18, 4, 16;
  --text: #fef0f8;
  --muted: #a878a0;
  --muted-dim: #7a5478;
  --soft: #e8c8e4;
  --theme-heading-lo: #f0c8e8;
  --theme-value-lo: #f0cce6;
  --ink-rgb: 255, 80, 200;
  --theme-body-deep: #050205;
  --shadow-soft: 0 10px 28px rgba(0, 0, 0, 0.45);
}

/* 暗色主题共享派生 token */
html[data-theme="ocean"],
html[data-theme="teal"],
html[data-theme="wine"],
html[data-theme="purple"],
html[data-theme="amber"],
html[data-theme="forest"],
html[data-theme="graphite"],
html[data-theme="black"],
html[data-theme="cyan"],
html[data-theme="mecha-red"],
html[data-theme="mecha-blue"],
html[data-theme="mecha-green"],
html[data-theme="mecha-orange"],
html[data-theme="mecha-pink"] {
  --body-bg: linear-gradient(135deg, rgba(var(--accent-rgb), var(--theme-body-accent-a, 0.075)) 0 1px, transparent 1px 112px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.03), transparent 28%),
    linear-gradient(180deg, var(--surface-solid) 0%, var(--bg) 42rem, var(--theme-body-deep) 100%);
  --grid-line-y: rgba(var(--ink-rgb), var(--theme-grid-y, 0.011));
  --grid-line-x: rgba(var(--ink-rgb), var(--theme-grid-x, 0.008));
  --ambient-bg: linear-gradient(90deg, rgba(var(--accent-rgb), var(--theme-ambient-accent-a, 0.11)), transparent 18rem),
    linear-gradient(180deg, rgba(255, 255, 255, var(--theme-ambient-top-a, 0.024)), transparent 16rem);
  --surface: color-mix(in srgb, var(--surface-solid) 64%, transparent);
  --surface-hover: color-mix(in srgb, var(--surface-solid) 84%, transparent);
  --surface-soft: color-mix(in srgb, var(--surface-solid) 72%, transparent);
  --surface-panel: color-mix(in srgb, var(--surface-solid) 80%, transparent);
  --surface-card: color-mix(in srgb, var(--surface-solid) 66%, transparent);
  --surface-card-hover: color-mix(in srgb, var(--surface-solid) 84%, transparent);
  --surface-table: color-mix(in srgb, var(--surface-solid) 58%, transparent);
  --surface-subtle-hover: rgba(var(--ink-rgb), 0.026);
  --line: rgba(var(--ink-rgb), var(--theme-line-a, 0.09));
  --line-soft: rgba(var(--ink-rgb), var(--theme-line-soft-a, 0.04));
  --line-strong: rgba(var(--ink-rgb), var(--theme-line-strong-a, 0.15));
  --heading-gradient: linear-gradient(180deg, #ffffff 0%, var(--theme-heading-lo) 100%);
  --value-gradient: linear-gradient(180deg, #ffffff 0%, var(--theme-value-lo) 100%);
  --accent-soft: rgba(var(--accent-rgb), var(--theme-accent-soft-a, 0.13));
  --bad: #ff7b7b;
  --bad-rgb: 255, 123, 123;
  --bad-soft: rgba(255, 123, 123, 0.1);
  --ok: #79d89a;
  --ok-soft: rgba(121, 216, 154, 0.1);
  --warn: #dfc174;
  --warn-soft: rgba(223, 193, 116, 0.1);
}

html[data-theme^="mecha-"] {
  --theme-body-accent-a: 0.06;
  --theme-ambient-top-a: 0.018;
  --theme-ambient-accent-a: 0.1;
  --theme-accent-soft-a: 0.14;
  --theme-line-a: 0.14;
  --theme-line-soft-a: 0.06;
  --theme-line-strong-a: 0.24;
  --theme-grid-y: 0.018;
  --theme-grid-x: 0.012;
  --surface: color-mix(in srgb, var(--surface-solid) 72%, transparent);
  --surface-hover: color-mix(in srgb, var(--surface-solid) 90%, transparent);
  --surface-soft: color-mix(in srgb, var(--surface-solid) 78%, transparent);
  --surface-panel: color-mix(in srgb, var(--surface-solid) 86%, transparent);
  --surface-card: color-mix(in srgb, var(--surface-solid) 72%, transparent);
  --surface-card-hover: color-mix(in srgb, var(--surface-solid) 90%, transparent);
  --surface-table: color-mix(in srgb, var(--surface-solid) 64%, transparent);
  --surface-subtle-hover: rgba(var(--ink-rgb), 0.03);
  --bad: #ff4444;
  --bad-rgb: 255, 68, 68;
  --bad-soft: rgba(255, 68, 68, 0.15);
  --ok: #44ff88;
  --ok-soft: rgba(68, 255, 136, 0.12);
  --warn: #ffaa22;
  --warn-soft: rgba(255, 170, 34, 0.12);
  --shadow-soft: 0 10px 28px rgba(0, 0, 0, 0.45);
}

/* ── 机甲风轻量装饰（弱化，贴近常规主题） ── */

html[data-theme^="mecha-"] body::before {
  background-image:
    linear-gradient(var(--grid-line-y) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-line-x) 1px, transparent 1px);
  background-size: 32px 32px;
  mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.95), transparent 72%);
}

html[data-theme^="mecha-"] .topbar::after {
  height: 1px;
  opacity: 0.85;
  background: linear-gradient(90deg, var(--accent), transparent);
  box-shadow: none;
}

html[data-theme^="mecha-"] .metric {
  border-color: rgba(var(--accent-rgb), 0.16);
}

html[data-theme^="mecha-"] .account {
  border-color: rgba(var(--accent-rgb), 0.14);
}

html[data-theme^="mecha-"] .account:hover {
  border-color: rgba(var(--accent-rgb), 0.28);
  box-shadow: var(--shadow-soft);
}

html[data-theme^="mecha-"] .button.primary,
html[data-theme^="mecha-"] .refresh {
  box-shadow: 0 6px 14px rgba(var(--accent-rgb), 0.16);
}

html[data-theme^="mecha-"] .notice {
  border-color: rgba(var(--accent-rgb), 0.22);
}

* {
  box-sizing: border-box;
  scrollbar-color: rgba(142, 150, 164, 0.38) rgba(255, 255, 255, 0.035);
  scrollbar-width: thin;
}

[hidden] {
  display: none !important;
}

.spa-view {
  animation: appEnter var(--duration-slow) var(--ease-out) both;
}

.forbidden-view {
  margin-top: 24px;
}

*::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

*::-webkit-scrollbar-track {
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.035);
}

*::-webkit-scrollbar-thumb {
  border: 2px solid #10141f;
  border-radius: 999px;
  background: rgba(142, 150, 164, 0.38);
}

*::-webkit-scrollbar-thumb:hover {
  background: rgba(var(--accent-rgb), 0.58);
}

html[data-theme="white"] * {
  scrollbar-color: rgba(102, 112, 127, 0.42) rgba(25, 33, 46, 0.08);
}

html[data-theme="white"] *::-webkit-scrollbar-track {
  background: rgba(25, 33, 46, 0.08);
}

html[data-theme="white"] *::-webkit-scrollbar-thumb {
  border-color: #eef1f5;
  background: rgba(102, 112, 127, 0.42);
}

body {
  margin: 0;
  background: var(--body-bg);
  color: var(--text);
  font-family: var(--font-sans);
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-text-size-adjust: 100%;
  position: relative;
}

body::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(var(--grid-line-y) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-line-x) 1px, transparent 1px);
  background-size: 32px 32px;
  background-position: 0 0, 0 0;
  mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.95), transparent 72%);
  pointer-events: none;
  z-index: 0;
}

body::after {
  content: '';
  position: fixed;
  inset: 0;
  background: var(--ambient-bg);
  opacity: 0.82;
  transform: translate3d(0, 0, 0);
  pointer-events: none;
  z-index: 0;
}

html::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 118;
  background:
    linear-gradient(180deg, rgba(var(--accent-rgb), 0.16), transparent 180px),
    radial-gradient(520px 220px at calc(100% - 58px) 44px, rgba(var(--accent-rgb), 0.22), transparent 70%);
  opacity: 0;
  pointer-events: none;
}

html.is-theme-settling::before {
  animation: themeTintSettle 640ms var(--ease-out) both;
}

button,
select {
  font: inherit;
}

.app {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  max-width: 1440px;
  margin: 0 auto;
  padding:
    calc(28px + env(safe-area-inset-top, 0px))
    calc(clamp(16px, 4vw, 48px) + env(safe-area-inset-right, 0px))
    calc(56px + env(safe-area-inset-bottom, 0px))
    calc(clamp(16px, 4vw, 48px) + env(safe-area-inset-left, 0px));
  animation: appEnter var(--duration-slow) var(--ease-out) both;
}

.topbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px 24px;
  min-height: 72px;
  padding: 0 0 18px;
  border-bottom: 1px solid var(--line-soft);
  position: relative;
  z-index: 120;
  animation: topbarEnter 520ms var(--ease-out) both;
}

.topbar::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: -1px;
  width: min(320px, 42vw);
  height: 1px;
  background: linear-gradient(90deg, var(--accent), transparent);
  opacity: 0.72;
}

html.is-theme-settling .topbar::after {
  animation: themeLineSettle 640ms var(--ease-out) both;
}

.title-block {
  min-width: 0;
  flex: 1 1 auto;
}

.topbar-side {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 12px;
  flex: 0 0 auto;
  min-width: 0;
}

.topbar-tools {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex: 0 0 auto;
}

.topbar-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  flex: 0 0 auto;
  flex-wrap: wrap;
  max-width: min(100%, 720px);
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--accent);
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  opacity: 0.9;
}

h1 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 34px;
  line-height: 1.15;
  font-weight: 800;
  letter-spacing: 0;
  background: var(--heading-gradient);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.subtitle {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 14px;
}

.main-nav {
  display: flex;
  align-items: center;
  gap: 3px;
  flex: 0 0 auto;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface-soft);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.035);
}

.admin-section-nav {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  margin-top: 18px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface-soft);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.035);
}

.admin-section-nav .nav-link {
  min-width: 112px;
}

.theme-menu {
  position: relative;
  z-index: 130;
}

.theme-trigger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 38px;
  min-width: 38px;
  min-height: 38px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface-soft);
  color: var(--soft);
  cursor: pointer;
  font: inherit;
  font-weight: 800;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.035);
  transition: background 180ms ease, border-color 180ms ease, box-shadow 180ms ease;
}

.theme-trigger-icon {
  display: inline-grid;
  place-items: center;
  width: 18px;
  height: 18px;
  color: var(--text);
  font-size: 17px;
  font-weight: 900;
  line-height: 1;
}

.theme-trigger-icon.is-swatch {
  font-size: 0;
}

.theme-trigger-icon.is-swatch::before,
.theme-menu-swatch::before {
  content: '';
  display: block;
  width: 14px;
  height: 14px;
  border: 1px solid var(--theme-choice-border, rgba(255, 255, 255, 0.22));
  border-radius: 50%;
  background: var(--theme-choice-color);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.24), 0 0 0 1px rgba(0, 0, 0, 0.12);
}

.theme-menu-swatch::before {
  width: 18px;
  height: 18px;
}

.theme-new-badge {
  position: absolute;
  top: -7px;
  right: -8px;
  z-index: 2;
  min-width: 26px;
  padding: 2px 5px;
  border: 1px solid rgba(var(--accent-rgb), 0.5);
  border-radius: 999px;
  background: var(--accent);
  color: var(--accent-fg);
  font-size: 9px;
  font-weight: 900;
  line-height: 1;
  letter-spacing: 0;
  text-align: center;
  box-shadow: 0 0 0 2px var(--surface-soft), 0 6px 14px rgba(var(--accent-rgb), 0.2);
  pointer-events: none;
  animation: themeNewBadgePulse 1600ms var(--ease-out) infinite;
}

.theme-trigger::after {
  content: none;
}

.theme-menu::after {
  content: '';
  position: absolute;
  right: 7px;
  bottom: 5px;
  width: 7px;
  height: 7px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238e96a4' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: center;
  background-size: 7px;
  pointer-events: none;
  transition: transform 180ms ease;
}

.theme-menu.is-open::after {
  transform: rotate(180deg);
}

.theme-trigger:hover,
.theme-trigger:focus-visible,
.theme-menu.is-open .theme-trigger {
  border-color: rgba(var(--accent-rgb), 0.42);
  background: var(--surface-hover);
}

.theme-trigger:focus-visible {
  outline: 2px solid rgba(var(--accent-rgb), 0.6);
  outline-offset: 2px;
}

.theme-trigger.is-theme-trigger-pulsing {
  animation: themeTriggerPulse 520ms var(--ease-spring) both;
}

.theme-menu-list {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 140;
  width: max-content;
  max-width: min(calc(100vw - 32px), 280px);
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--popover);
  box-shadow: var(--shadow-soft);
  display: grid;
  grid-template-columns: repeat(5, 40px);
  gap: 6px;
  animation: selectMenuIn 150ms var(--ease-out) both;
}

.theme-menu-item {
  position: relative;
  display: inline-grid;
  place-items: center;
  width: 40px;
  min-width: 40px;
  height: 40px;
  min-height: 40px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--soft);
  cursor: pointer;
  font: inherit;
  transition: background 160ms ease, box-shadow 160ms ease;
}

.theme-menu-item-label {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.theme-menu-hint {
  grid-column: 1 / -1;
  margin-top: 2px;
  padding: 4px 2px 0;
  border-top: 1px solid var(--line-soft);
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.35;
  text-align: center;
  letter-spacing: 0.02em;
}

.theme-menu-icon {
  display: inline-grid;
  place-items: center;
  width: 22px;
  height: 22px;
  color: currentColor;
  font-size: 16px;
  font-weight: 900;
  line-height: 1;
}

.theme-menu-item:hover,
.theme-menu-item:focus-visible {
  background: var(--surface-hover);
  box-shadow: 0 0 0 1px rgba(var(--accent-rgb), 0.2);
  outline: none;
}

.theme-menu-item[aria-checked="true"] {
  background: var(--accent-soft);
  box-shadow: 0 0 0 1px rgba(var(--accent-rgb), 0.48);
}

.user-menu {
  position: relative;
  z-index: 132;
}

.user-trigger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  min-width: 38px;
  min-height: 38px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface-soft);
  color: var(--soft);
  cursor: pointer;
  font: inherit;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.035);
  transition: background 180ms ease, border-color 180ms ease, box-shadow 180ms ease, transform 180ms ease;
}

.user-trigger-icon {
  width: 19px;
  height: 19px;
}

.user-trigger:hover,
.user-trigger:focus-visible,
.user-menu.is-open .user-trigger {
  border-color: rgba(var(--accent-rgb), 0.42);
  background: var(--surface-hover);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05), 0 0 0 3px rgba(var(--accent-rgb), 0.08);
}

.user-trigger:focus-visible {
  outline: 2px solid rgba(var(--accent-rgb), 0.6);
  outline-offset: 2px;
}

.user-menu-list {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 145;
  display: grid;
  gap: 5px;
  width: min(220px, calc(100vw - 32px));
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--popover);
  box-shadow: var(--shadow-soft);
  animation: selectMenuIn 150ms var(--ease-out) both;
}

.user-menu-list[hidden] {
  display: none;
}

.user-menu-label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.user-menu-account {
  min-width: 0;
  color: var(--text);
  font-size: 15px;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.user-menu-role {
  justify-self: start;
  margin-top: 4px;
  padding: 3px 8px;
  border-radius: 999px;
  background: var(--surface-soft);
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.user-menu-role.is-admin {
  background: var(--accent-soft);
  color: var(--accent);
}

.user-logout {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 34px;
  margin-top: 8px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
  color: var(--soft);
  cursor: pointer;
  font: inherit;
  font-size: 13px;
  font-weight: 800;
  transition: background 160ms ease, border-color 160ms ease, color 160ms ease;
}

.user-logout:hover:not(:disabled),
.user-logout:focus-visible {
  border-color: rgba(var(--accent-rgb), 0.42);
  background: var(--surface-hover);
  color: var(--text);
  outline: none;
}

.user-logout:disabled {
  cursor: wait;
  opacity: 0.68;
}

.toolbar {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  flex: 0 0 auto;
  flex-wrap: wrap;
}

#activityToolbar,
#adminToolbar,
#imageCacheToolbar {
  width: auto;
}

#activityToolbar .refresh,
#adminToolbar .refresh,
#imageCacheToolbar .refresh {
  min-width: 104px;
}

.meta {
  color: var(--muted);
  font-size: 13px;
  white-space: nowrap;
  font-weight: 500;
}

.button,
.refresh {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  gap: 8px;
  min-height: 38px;
  padding: 0 15px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface-soft);
  color: var(--soft);
  cursor: pointer;
  font-weight: 700;
  font-size: 14px;
  white-space: nowrap;
  transition: background 180ms ease, border-color 180ms ease, color 180ms ease, box-shadow 180ms ease, opacity 180ms ease;
  overflow: hidden;
  position: relative;
}

.button.primary,
.refresh {
  border: none;
  background: var(--accent-gradient);
  color: var(--accent-fg);
  box-shadow: 0 6px 14px rgba(var(--accent-rgb), 0.14);
}

.button.primary::after,
.refresh::after {
  content: '';
  position: absolute;
  inset: -1px;
  background: linear-gradient(115deg, transparent 0%, rgba(255, 255, 255, 0.36) 44%, transparent 62%);
  opacity: 0;
  transform: translateX(-120%);
  pointer-events: none;
}

.nav-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  gap: 8px;
  min-height: 34px;
  padding: 0 12px;
  border: 1px solid transparent;
  border-radius: 7px;
  background: transparent;
  color: var(--soft);
  cursor: pointer;
  font-weight: 700;
  font-size: 14px;
  white-space: nowrap;
  text-decoration: none;
  box-shadow: none;
  transition: background 180ms ease, border-color 180ms ease, color 180ms ease;
  position: relative;
  overflow: hidden;
}

.nav-link.active {
  border-color: rgba(var(--accent-rgb), 0.35);
  background: var(--accent-soft);
  color: var(--accent);
}

.button:not(.primary):not(:disabled):hover,
.nav-link:hover {
  background: var(--surface-hover);
  color: var(--text);
  border-color: var(--accent);
}

.button.primary:hover:not(:disabled),
.refresh:hover:not(:disabled) {
  border: none;
  background: var(--accent-gradient);
  color: var(--accent-fg);
  transform: translateY(-1px) translateZ(0);
  box-shadow: 0 9px 20px rgba(var(--accent-rgb), 0.26);
  opacity: 0.95;
}

.button.primary:hover:not(:disabled)::after,
.refresh:hover:not(:disabled)::after {
  animation: buttonSweep 720ms ease-out both;
}

.button:active,
.refresh:active,
.nav-link:active {
  transform: translateY(0);
}

.button:disabled {
  cursor: not-allowed;
  opacity: 0.6;
  transform: none;
  box-shadow: none;
}

.refresh:disabled,
.button.is-working:disabled {
  cursor: wait;
  opacity: 0.6;
  transform: none;
  box-shadow: none;
}

.summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
  margin-top: 20px;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  overflow: visible;
  animation: summaryEnter 560ms var(--ease-out) 80ms both;
}

.metric {
  min-height: 96px;
  padding: 18px 20px;
  border: 1px solid var(--line);
  border-right: 1px solid var(--line);
  border-radius: var(--radius-md);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.035), transparent 58%),
    color-mix(in srgb, var(--surface-solid) 92%, transparent);
  box-shadow: var(--shadow-card);
  transition: background 180ms ease, transform 180ms ease, border-color 180ms ease, box-shadow 180ms ease;
  position: relative;
  overflow: hidden;
}

.metric:last-child {
  border-right: 1px solid var(--line);
}

.metric::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background:
    linear-gradient(135deg, rgba(var(--accent-rgb), 0.1), transparent 42%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.02), transparent 52%);
  opacity: 0;
  pointer-events: none;
  transition: opacity 180ms ease;
}

.metric:hover {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.04), transparent 58%),
    var(--surface-card-hover);
  border-color: rgba(var(--accent-rgb), 0.28);
  transform: translateY(-2px);
  box-shadow: var(--shadow-elevated);
}

.metric:hover::before {
  opacity: 1;
}

.metric span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.metric span b {
  font: inherit;
}

.metric strong {
  display: block;
  margin-top: 10px;
  font-family: var(--font-display);
  font-size: 28px;
  line-height: 1;
  font-weight: 800;
  background: var(--value-gradient);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  transform-origin: left center;
}

.metric strong.is-value-updated,
.meta.is-value-updated,
.selection-hint.is-value-updated,
.pending-task-page-info.is-value-updated {
  animation: valuePulse 560ms var(--ease-spring) both;
}

.metric-action {
  padding: 0;
}

.metric-action::after {
  content: '';
  position: absolute;
  inset: 0;
  border: 1px solid transparent;
  border-radius: inherit;
  pointer-events: none;
  transition: border-color 180ms ease, box-shadow 180ms ease;
}

.metric-action:hover::after,
.metric-action:focus-within::after {
  border-color: rgba(var(--accent-rgb), 0.36);
  box-shadow: inset 0 0 0 1px rgba(var(--accent-rgb), 0.08);
}

.metric-button {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-content: start;
  column-gap: 12px;
  width: 100%;
  min-height: 100%;
  padding: 18px 20px;
  border: 0;
  border-radius: inherit;
  background: transparent;
  color: inherit;
  cursor: pointer;
  font: inherit;
  text-align: left;
}

.metric-button strong {
  grid-column: 1 / -1;
}

.metric-button-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 18px;
  color: rgba(var(--accent-rgb), 0.82);
  font-size: 12px;
  font-weight: 800;
  line-height: 1.2;
  white-space: nowrap;
  text-transform: none;
  letter-spacing: 0;
  opacity: 0.78;
  transition: color 180ms ease, opacity 180ms ease, transform 180ms ease;
}

.metric-button-action::after {
  content: '›';
  margin-left: 6px;
  font-size: 16px;
  line-height: 0.8;
}

.metric-button:hover .metric-button-action,
.metric-button:focus-visible .metric-button-action {
  color: var(--accent);
  opacity: 1;
  transform: translateX(2px);
}

.metric-button:focus-visible {
  outline: 2px solid rgba(var(--accent-rgb), 0.65);
  outline-offset: -4px;
  border-radius: inherit;
}

.notice {
  --notice-anchor-x: 0;
  position: sticky;
  top: 12px;
  z-index: 20;
  margin-top: 20px;
  padding: 12px 16px;
  border-radius: var(--radius-md);
  border: 1px solid rgba(var(--accent-rgb), 0.2);
  background: rgba(var(--notice-bg-rgb), var(--notice-bg-alpha));
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  color: var(--soft);
  font-size: 14px;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 12px;
  box-shadow: 0 12px 26px rgba(0, 0, 0, 0.26);
}

.notice-slot {
  position: sticky;
  top: 12px;
  z-index: 20;
  min-height: 46px;
  margin-top: 14px;
}

.notice-slot > .notice {
  position: absolute;
  inset: 0 0 auto;
  max-height: min(32svh, 180px);
  margin-top: 0;
  overflow: auto;
}

.notice::before {
  content: "\2139";
  flex: 0 0 auto;
  color: var(--accent);
  font-weight: 900;
  font-size: 18px;
}

.notice.error {
  border-color: rgba(var(--bad-rgb), 0.25);
  background: rgba(var(--notice-bg-rgb), var(--notice-bg-alpha));
  color: var(--bad);
}

.notice.error::before {
  content: "\26A0";
  color: var(--bad);
}

.notice.is-notice-updated {
  animation: noticePulse 520ms var(--ease-out) both;
}

.empty {
  padding: 36px 24px;
  color: var(--muted);
  text-align: center;
  background: var(--surface-soft);
  font-style: italic;
}

.skeleton-line,
.skeleton-block,
.skeleton-swatch {
  border-radius: 999px;
  background:
    linear-gradient(90deg,
      rgba(255, 255, 255, 0.04) 0%,
      rgba(var(--accent-rgb), 0.12) 45%,
      rgba(255, 255, 255, 0.04) 100%);
  background-size: 200% 100%;
  animation: skeletonShimmer 1.35s ease-in-out infinite;
}

.skeleton-block {
  border-radius: var(--radius-sm);
}

.skeleton-account {
  pointer-events: none;
}

.skeleton-account .account-head {
  min-height: 76px;
}

.skeleton-title-lines {
  display: grid;
  gap: 10px;
  min-width: 0;
  flex: 1 1 auto;
}

.skeleton-line {
  height: 12px;
}

.skeleton-line.is-lg {
  height: 18px;
  width: min(52%, 220px);
}

.skeleton-line.is-md {
  width: min(38%, 160px);
}

.skeleton-line.is-sm {
  width: min(24%, 96px);
  height: 10px;
}

.skeleton-status {
  width: 58px;
  height: 24px;
  border-radius: 999px;
}

.skeleton-account .stat {
  gap: 10px;
}

.skeleton-account .stat .skeleton-line.is-sm {
  width: 48%;
}

.skeleton-account .stat .skeleton-line.is-lg {
  width: 36%;
  height: 22px;
}

.skeleton-account .account-section > summary {
  pointer-events: none;
}

.skeleton-list {
  display: grid;
  gap: 10px;
  padding: 16px 20px 18px;
}

.skeleton-list-row {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
}

.skeleton-swatch {
  width: 48px;
  height: 40px;
  border-radius: 8px;
}

.skeleton-list-copy {
  display: grid;
  gap: 8px;
}

.skeleton-list-copy .skeleton-line.is-md {
  width: 72%;
}

.skeleton-list-copy .skeleton-line.is-sm {
  width: 44%;
}

.data-panel tbody tr.skeleton-row {
  pointer-events: none;
}

.data-panel tbody tr.skeleton-row td {
  vertical-align: middle;
}

.data-panel tbody tr.skeleton-row .skeleton-line {
  width: 78%;
  max-width: 180px;
  height: 12px;
}

.cache-panel tbody tr.skeleton-row .skeleton-swatch {
  width: 56px;
  height: 56px;
  border-radius: 10px;
}

@keyframes skeletonShimmer {
  0% { background-position: 100% 0; }
  100% { background-position: -100% 0; }
}

html[data-theme="white"] .skeleton-line,
html[data-theme="white"] .skeleton-block,
html[data-theme="white"] .skeleton-swatch {
  background:
    linear-gradient(90deg,
      rgba(25, 33, 46, 0.06) 0%,
      rgba(var(--accent-rgb), 0.14) 45%,
      rgba(25, 33, 46, 0.06) 100%);
  background-size: 200% 100%;
}

.refresh-icon {
  width: 16px;
  height: 16px;
  transition: transform 240ms ease;
}

.loading .refresh-icon {
  animation: spin 1s linear infinite;
}

.admin-loading #adminReloadButton .refresh-icon {
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

@keyframes appEnter {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes topbarEnter {
  from { opacity: 0; transform: translateY(-10px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes summaryEnter {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes noticePulse {
  0% { transform: translateX(var(--notice-anchor-x)) translateY(-2px); box-shadow: 0 12px 26px rgba(0, 0, 0, 0.26); }
  42% { transform: translateX(var(--notice-anchor-x)) translateY(-4px); box-shadow: 0 16px 32px rgba(var(--accent-rgb), 0.16); }
  100% { transform: translateX(var(--notice-anchor-x)) translateY(0); box-shadow: 0 12px 26px rgba(0, 0, 0, 0.26); }
}

@keyframes valuePulse {
  0% { transform: translateY(0) scale(1); filter: brightness(1); }
  38% { transform: translateY(-2px) scale(1.045); filter: brightness(1.2); }
  100% { transform: translateY(0) scale(1); filter: brightness(1); }
}

@keyframes buttonSweep {
  0% { opacity: 0; transform: translateX(-120%); }
  24% { opacity: 0.85; }
  100% { opacity: 0; transform: translateX(120%); }
}

@keyframes themeTriggerPulse {
  0% { transform: scale(1); }
  38% { transform: scale(1.08); box-shadow: 0 0 0 4px rgba(var(--accent-rgb), 0.1); }
  100% { transform: scale(1); }
}

@keyframes themeTintSettle {
  0% { opacity: 0; }
  24% { opacity: 1; }
  100% { opacity: 0; }
}

@keyframes themeLineSettle {
  0% { opacity: 0.38; transform: scaleX(0.62); }
  34% { opacity: 1; transform: scaleX(1.18); }
  100% { opacity: 0.72; transform: scaleX(1); }
}

@keyframes themeNewBadgePulse {
  0%, 100% { transform: translateY(0); box-shadow: 0 0 0 2px var(--surface-soft), 0 6px 14px rgba(var(--accent-rgb), 0.2); }
  45% { transform: translateY(-1px); box-shadow: 0 0 0 2px var(--surface-soft), 0 8px 18px rgba(var(--accent-rgb), 0.32); }
}

@media (max-width: 980px) {
  .app {
    padding:
      calc(20px + env(safe-area-inset-top, 0px))
      calc(16px + env(safe-area-inset-right, 0px))
      calc(40px + env(safe-area-inset-bottom, 0px))
      calc(16px + env(safe-area-inset-left, 0px));
  }

  .topbar {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: start;
    gap: 14px;
  }

  .title-block,
  .topbar-actions,
  .main-nav {
    width: 100%;
  }

  .topbar-side {
    display: contents;
  }

  .topbar-tools {
    grid-column: 2;
    grid-row: 1;
    justify-content: flex-end;
  }

  .theme-trigger {
    width: 36px;
    min-width: 36px;
    min-height: 36px;
  }

  .user-trigger {
    width: 36px;
    min-width: 36px;
    min-height: 36px;
  }

  .theme-menu-list {
    top: calc(100% + 6px);
  }

  .user-menu-list {
    top: calc(100% + 6px);
  }

  .topbar-actions {
    grid-column: 1 / -1;
    grid-row: 2;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    justify-content: stretch;
    gap: 10px;
  }

  .main-nav {
    width: auto;
    align-self: stretch;
  }

  .main-nav .nav-link {
    flex: 1 1 0;
  }

  .admin-section-nav {
    display: flex;
    width: 100%;
  }

  .admin-section-nav .nav-link {
    flex: 1 1 0;
    min-width: 0;
  }

  .toolbar {
    width: auto;
    justify-content: flex-end;
  }

  #activityToolbar,
  #adminToolbar {
    margin-left: 0;
  }

  .meta {
    flex: 1 1 auto;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    margin-top: 18px;
  }

  .metric {
    padding: 14px 16px;
    min-height: 88px;
    border-right: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
  }

  .metric:nth-child(2n) {
    border-right: 1px solid var(--line);
  }

  .metric:nth-last-child(-n + 2) {
    border-bottom: 1px solid var(--line);
  }

  .metric-action {
    padding: 0;
  }

  .metric-button {
    padding: 14px 16px;
  }

  .metric strong {
    font-size: 24px;
  }

  h1 {
    font-size: 30px;
  }
}

@media (max-width: 520px) {
  .app {
    padding-top: 18px;
  }

  .metric,
  .metric:nth-last-child(-n + 2) {
    border-bottom: 1px solid var(--line);
  }

  .metric:nth-child(2n) {
    border-right: 1px solid var(--line);
  }

  .metric:nth-last-child(-n + 2) {
    border-bottom: 1px solid var(--line);
  }

  h1 {
    font-size: 28px;
  }
}

select option {
  background: var(--popover);
  color: var(--soft);
}

select option:checked {
  background: var(--accent);
  color: var(--accent-fg);
}

select:focus {
  border-color: var(--accent);
  background-color: var(--surface-hover);
  box-shadow: 0 0 12px rgba(var(--accent-rgb), 0.1);
}

.select-shell {
  position: relative;
  display: inline-flex;
  width: 190px;
  max-width: 100%;
}

.select-shell.limit-select-shell {
  width: 160px;
}

.select-shell select {
  width: 100%;
  min-height: 42px;
  padding: 0 12px 0 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
  color: var(--soft);
  outline: none;
  font: inherit;
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  transition: all 0.25s ease;
}

.select-shell.is-enhanced select {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.select-trigger {
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  min-height: 42px;
  padding: 0 12px 0 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
  color: var(--soft);
  outline: none;
  cursor: pointer;
  font: inherit;
  font-size: 13.5px;
  font-weight: 600;
  text-align: left;
  transition: all 0.25s ease;
}

.select-trigger::after {
  content: "";
  width: 14px;
  height: 14px;
  flex: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238e96a4' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: center;
  background-size: 14px;
  transition: transform 0.2s ease;
}

.select-trigger:hover,
.select-trigger:focus-visible,
.select-shell.open .select-trigger {
  border-color: var(--accent);
  background-color: var(--surface-hover);
  box-shadow: 0 0 12px rgba(var(--accent-rgb), 0.1);
}

.select-shell.open .select-trigger::after {
  transform: rotate(180deg);
}

.select-trigger:disabled {
  cursor: wait;
  opacity: 0.6;
}

.select-trigger-label {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.select-menu {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  z-index: 80;
  display: none;
  max-height: min(320px, 60vh);
  overflow-y: auto;
  padding: 6px;
  border: 1px solid rgba(var(--accent-rgb), 0.28);
  border-radius: 8px;
  background: var(--popover);
  box-shadow: 0 18px 42px rgba(0, 0, 0, 0.58);
}

.select-shell.open .select-menu {
  display: grid;
  gap: 2px;
  animation: selectMenuIn 0.16s ease-out both;
}

@keyframes selectMenuIn {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: translateY(0); }
}

.select-option {
  width: 100%;
  min-height: 34px;
  padding: 0 10px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--soft);
  cursor: pointer;
  font: inherit;
  font-size: 13.5px;
  font-weight: 600;
  text-align: left;
}

.select-option:hover,
.select-option:focus-visible {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  outline: 2px solid rgba(var(--accent-rgb), 0.62);
  outline-offset: -2px;
}

.select-option.is-selected {
  background: var(--accent);
  color: var(--accent-fg);
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }

  .skeleton-line,
  .skeleton-block,
  .skeleton-swatch {
    animation: none !important;
  }
}
/* assets/activity_info.css */

.accounts > .notice {
  position: static;
  grid-column: 1 / -1;
  margin-top: 0;
}

.accounts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: start;
  gap: 18px;
  margin-top: 16px;
}

.accounts.is-accounts-updated {
  animation: accountsRefresh 520ms var(--ease-out) both;
}

.account {
  position: relative;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background:
    linear-gradient(90deg, rgba(var(--accent-rgb), 0.12), transparent 24%) 0 0 / 100% 1px no-repeat,
    color-mix(in srgb, var(--surface-solid) 90%, transparent);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.025) inset;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: border-color 180ms ease, background 180ms ease, transform 180ms ease, box-shadow 180ms ease, filter 220ms ease;
  animation: enter 0.6s cubic-bezier(0.16, 1, 0.3, 1) both;
  /* 视口外账号卡跳过布局/绘制，刷新大量账号时更省 */
  content-visibility: auto;
  contain-intrinsic-size: auto 320px;
}

.account::after {
  content: none;
}

.account:hover {
  border-color: var(--line-strong);
  background:
    linear-gradient(90deg, rgba(var(--accent-rgb), 0.14), transparent 24%) 0 0 / 100% 1px no-repeat,
    var(--surface-card-hover);
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.22);
}

@keyframes enter {
  from { opacity: 0; transform: translateY(16px) scale(0.992); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes accountsRefresh {
  from { filter: brightness(1.12); }
  to { filter: brightness(1); }
}

.account-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 20px 16px;
  border-bottom: 1px solid var(--line-soft);
  position: relative;
}

.account-head::before {
  content: '';
  position: absolute;
  left: 16px;
  top: 0;
  width: 42px;
  height: 2px;
  background: linear-gradient(90deg, var(--accent), rgba(var(--accent-rgb), 0));
  opacity: 0.78;
}

.account-title {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.account-main {
  display: grid;
  gap: 12px;
  min-width: 0;
  flex: 1 1 auto;
}

.account-index {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  min-width: 48px;
  height: 24px;
  padding: 0 8px;
  border-radius: 3px;
  background: rgba(var(--accent-rgb), 0.08);
  border: 1px solid rgba(var(--accent-rgb), 0.2);
  color: var(--accent);
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.05em;
  transition: border-color 180ms ease, background 180ms ease, transform 180ms ease;
}

.account:hover .account-index {
  border-color: rgba(var(--accent-rgb), 0.36);
  background: rgba(var(--accent-rgb), 0.13);
  transform: translateY(-1px);
}

.account-name {
  min-width: 0;
  margin: 0;
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 700;
  letter-spacing: 0;
  overflow-wrap: anywhere;
}

.account-copy {
  display: inline;
  min-width: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  cursor: pointer;
  font: inherit;
  letter-spacing: inherit;
  text-align: left;
  text-decoration: none;
  overflow-wrap: anywhere;
  transition: color 160ms ease, text-shadow 160ms ease;
}

.account-copy:hover,
.account-copy:focus-visible {
  color: var(--accent);
  outline: none;
  text-decoration: none;
  text-shadow: 0 0 14px rgba(var(--accent-rgb), 0.24);
}

.account-note-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 9px;
  min-width: 0;
}

.account-note-label,
.account-note-state {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}

.account-note-label {
  color: var(--muted-dim);
}

.account-note-state {
  min-width: 0;
  color: var(--accent);
  text-align: right;
}

.account-note-row:focus-within .account-note-label {
  color: rgba(var(--accent-rgb), 0.82);
}

.account-note-input {
  width: 100%;
  height: 30px;
  min-width: 0;
  padding: 0;
  border: 0;
  border-bottom: 1px solid transparent;
  border-radius: 0;
  background: transparent;
  color: var(--soft);
  font: inherit;
  font-size: 13px;
  line-height: 30px;
  outline: none;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.account-note-input::placeholder {
  color: var(--muted-dim);
}

.account-note-input:hover,
.account-note-input:focus {
  border-bottom-color: rgba(var(--accent-rgb), 0.36);
  background: transparent;
  box-shadow: none;
}

.account-note-row:focus-within .account-note-input {
  animation: inputLinePulse 620ms var(--ease-out) both;
}

.account-note-input:disabled {
  cursor: wait;
  opacity: 0.7;
}

.status {
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
  height: 24px;
  padding: 0 12px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
  transition: transform 180ms ease, box-shadow 180ms ease;
}

.account:hover .status {
  transform: translateY(-1px);
}

.status.ok {
  background: var(--ok-soft);
  border: 1px solid rgba(76, 217, 100, 0.2);
  color: var(--ok);
}

.status.failed {
  background: var(--bad-soft);
  border: 1px solid rgba(255, 107, 107, 0.2);
  color: var(--bad);
}

.account-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0;
  padding: 0;
  border-bottom: 1px solid var(--line-soft);
}

.stat {
  min-height: 84px;
  padding: 16px 18px;
  border-right: 1px solid var(--line-soft);
  display: grid;
  align-content: center;
  position: relative;
  overflow: hidden;
  transition: background 180ms ease;
}

.pending-task-stat {
  width: 100%;
  border-top: 0;
  border-bottom: 0;
  border-left: 0;
  background: transparent;
  color: inherit;
  cursor: default;
  font: inherit;
  text-align: left;
}

.pending-task-static,
.pending-task-details {
  width: 100%;
}

.stat::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(var(--accent-rgb), 0.075), transparent 44%);
  opacity: 0;
  transition: opacity 180ms ease;
  pointer-events: none;
}

.stat:hover {
  background: var(--surface-subtle-hover);
}

.stat:hover::before {
  opacity: 1;
}

.stat:first-child {
  padding-left: 20px;
}

.stat:last-child {
  padding-right: 20px;
  border-right: none;
}

.stat span {
  display: block;
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.stat strong {
  display: block;
  margin-top: 6px;
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 700;
  color: var(--soft);
  line-height: 1.1;
}

.lottery-stat {
  position: relative;
}

.lottery-details {
  position: relative;
}

.lottery-details summary {
  display: grid;
  grid-template-columns: max-content;
  align-items: end;
  cursor: pointer;
  list-style: none;
}

.lottery-label {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  width: max-content;
}

.lottery-details .lottery-label::after {
  content: "\25BE";
  color: var(--accent);
  font-size: 18px;
  line-height: 1;
  opacity: 0.9;
  transition: transform 180ms ease;
}

.lottery-details[open] .lottery-label::after {
  transform: rotate(180deg);
}

.lottery-static {
  display: grid;
  align-content: center;
}

.lottery-details summary strong {
  grid-column: 1;
  grid-row: 2;
}

.lottery-details summary::-webkit-details-marker {
  display: none;
}

.lottery-panel {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--line-soft);
  display: flex;
  align-items: center;
  justify-content: flex-start;
  animation: panelReveal 220ms var(--ease-out) both;
}

.lottery-empty {
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}

.account-actions {
  display: inline-flex;
  flex: 0 0 auto;
}

.account-sections {
  background: var(--surface-table);
}

.account-section + .account-section {
  border-top: 1px solid var(--line-soft);
}

.account-section > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 46px;
  padding: 0 20px;
  color: var(--soft);
  cursor: pointer;
  list-style: none;
  font-size: 13px;
  font-weight: 750;
  transition: background 160ms ease, color 160ms ease;
}

.account-section > summary::-webkit-details-marker {
  display: none;
}

.account-section > summary::after {
  content: "\203A";
  flex: 0 0 auto;
  color: var(--accent);
  font-size: 20px;
  line-height: 1;
  transform: rotate(90deg);
  transition: transform 180ms ease;
}

.account-section[open] > summary::after {
  transform: rotate(-90deg);
}

.account-section > summary:hover,
.account-section > summary:focus-visible {
  background: var(--surface-subtle-hover);
  color: var(--text);
  outline: none;
}

.account-section-meta {
  margin-left: auto;
  color: var(--muted);
  font-size: 11.5px;
  font-weight: 650;
  white-space: nowrap;
}

.account-section-body {
  border-top: 1px solid var(--line-soft);
  animation: panelReveal 180ms var(--ease-out) both;
}

.tasks {
  padding: 0;
  overflow-x: auto;
  flex-grow: 1;
  background: var(--surface-table);
}

.tasks table {
  width: 100%;
  min-width: 500px;
  border-collapse: collapse;
  table-layout: fixed;
}

.tasks th,
.tasks td {
  padding: 11px 20px;
  text-align: left;
  font-size: 14px;
  border-bottom: 1px solid var(--line-soft);
  vertical-align: middle;
}

.tasks th {
  color: var(--muted);
  font-weight: 700;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  background: var(--surface-soft);
}

.tasks tbody tr {
  animation: rowReveal 360ms var(--ease-out) both;
  transition: background 150ms ease, transform 150ms ease;
}

.tasks tbody tr:hover {
  background: var(--surface-subtle-hover);
}

.tasks tbody tr:nth-child(2) { animation-delay: 24ms; }
.tasks tbody tr:nth-child(3) { animation-delay: 48ms; }
.tasks tbody tr:nth-child(4) { animation-delay: 72ms; }
.tasks tbody tr:nth-child(5) { animation-delay: 96ms; }
.tasks tbody tr:nth-child(n + 6) { animation-delay: 120ms; }

.tasks td {
  color: var(--soft);
}

.tasks th:nth-child(1),
.tasks td:nth-child(1) {
  width: 104px;
}

.tasks th:nth-child(3),
.tasks td:nth-child(3) {
  width: 72px;
  text-align: center;
}

.tasks th:nth-child(4),
.tasks td:nth-child(4) {
  width: 112px;
  text-align: center;
}

.tasks tr:last-child td {
  border-bottom: none;
}

.task-received {
  opacity: 0.45;
}

.task-received .task-name {
  text-decoration: line-through rgba(255, 255, 255, 0.2);
}

.task-received .task-name,
.task-received .receive-status {
  color: var(--muted);
}

.task-empty-row td {
  color: var(--muted);
  text-align: center;
  padding: 28px;
  font-style: italic;
}

.received-tasks {
  padding: 14px 16px 0;
  border-top: 1px solid var(--line-soft);
}

.received-tasks summary,
.reward-history summary {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 34px;
  padding: 0 8px;
  color: var(--soft);
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
  list-style: none;
  border-radius: 8px;
  overflow: hidden;
  transition: color 180ms ease, background 180ms ease, transform 180ms ease;
}

.received-tasks summary {
  -webkit-tap-highlight-color: rgba(var(--accent-rgb), 0.16);
}

.received-tasks summary::-webkit-details-marker,
.reward-history summary::-webkit-details-marker {
  display: none;
}

.received-tasks summary::before,
.reward-history summary::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent 0%, rgba(var(--accent-rgb), 0.18) 48%, transparent 100%);
  opacity: 0;
  transform: translateX(-120%);
  pointer-events: none;
}

.received-tasks summary span,
.reward-history summary span {
  position: relative;
  z-index: 1;
}

.received-tasks summary:hover,
.reward-history summary:hover {
  color: var(--text);
  background: rgba(var(--accent-rgb), 0.055);
}

.received-tasks summary::after,
.reward-history summary::after {
  content: '+';
  display: inline-grid;
  place-items: center;
  width: 20px;
  height: 20px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--accent);
  font-size: 15px;
  line-height: 1;
  position: relative;
  z-index: 1;
  transition: transform 320ms cubic-bezier(0.34, 1.56, 0.64, 1), border-color 180ms ease, background 180ms ease, box-shadow 180ms ease;
}

.received-tasks[open] summary::after,
.reward-history[open] summary::after {
  content: '-';
  background: rgba(var(--accent-rgb), 0.16);
  border-color: rgba(var(--accent-rgb), 0.55);
  box-shadow: 0 0 16px rgba(var(--accent-rgb), 0.2);
  transform: rotate(180deg);
}

.received-tasks.is-reward-history-sweeping summary,
.reward-history.is-reward-history-sweeping summary {
  color: var(--text);
  background: rgba(var(--accent-rgb), 0.075);
}

.received-tasks.is-reward-history-sweeping summary::before,
.reward-history.is-reward-history-sweeping summary::before {
  animation: rewardHistorySweep 520ms ease-out both;
}

.received-tasks.is-reward-history-collapsing summary::before,
.reward-history.is-reward-history-collapsing summary::before {
  animation-name: rewardHistorySweepReverse;
}

.received-tasks[open] table {
  margin-top: 10px;
  animation: panelReveal 260ms var(--ease-out) both;
}

.received-tasks table th {
  border-bottom-color: rgba(var(--accent-rgb), 0.18);
}

.task-name {
  color: var(--text);
  font-weight: 600;
}

.task-desc {
  white-space: pre-line;
  color: var(--muted);
  font-size: 13px;
  overflow-wrap: anywhere;
}

.receive-status {
  white-space: nowrap;
}

.task-action,
.task-bulk-action,
.draw-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 72px;
  min-height: 30px;
  padding: 0 14px;
  border: 1px solid rgba(255, 255, 255, 0.075);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.025);
  color: var(--soft);
  cursor: pointer;
  font: inherit;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
  position: relative;
  overflow: hidden;
  transition: background 160ms ease, border-color 160ms ease, color 160ms ease, opacity 160ms ease, transform 160ms ease;
}

.draw-action {
  min-width: 64px;
  min-height: 28px;
  padding: 0 12px;
  background: transparent;
  color: var(--muted);
}

.task-bulk-action {
  min-width: 76px;
  border-color: rgba(var(--accent-rgb), 0.22);
  background: rgba(var(--accent-rgb), 0.075);
  color: var(--accent);
}

.task-action:hover:not(:disabled),
.task-bulk-action:hover:not(:disabled),
.draw-action:hover:not(:disabled) {
  border-color: rgba(var(--accent-rgb), 0.34);
  background: rgba(var(--accent-rgb), 0.1);
  color: var(--text);
  transform: translateY(-1px);
}

.task-action:disabled,
.task-bulk-action:disabled,
.draw-action:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.task-action.is-working,
.task-bulk-action.is-working,
.draw-action.is-working,
.reward-item.is-working {
  opacity: 0.82;
}

.task-action.is-working::after,
.task-bulk-action.is-working::after,
.draw-action.is-working::after,
.reward-item.is-working::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(110deg, transparent 0%, rgba(var(--accent-rgb), 0.22) 45%, transparent 62%);
  animation: workingSweep 1s ease-in-out infinite;
  pointer-events: none;
}

.error-text {
  padding: 14px 24px;
  color: var(--bad);
  background: var(--bad-soft);
  border-bottom: 1px solid var(--line-soft);
  word-break: break-word;
  font-size: 14px;
}

.reward-section {
  padding: 16px 20px 18px;
  border-bottom: 0;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.018), transparent),
    var(--surface-panel);
  animation: sectionReveal 420ms var(--ease-out) both;
}

.reward-list {
  display: grid;
  gap: 8px;
}

.reward-day {
  display: grid;
  gap: 8px;
  animation: panelReveal 340ms var(--ease-out) both;
}

.reward-day + .reward-day {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--line-soft);
}

.reward-day-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  line-height: 1.2;
}

.reward-day-count {
  color: var(--muted);
  font-size: 11.5px;
  font-weight: 700;
  white-space: nowrap;
}

.reward-history {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--line-soft);
}

.reward-list > .reward-history:first-child {
  margin: 0;
}

.reward-history-body {
  display: grid;
  gap: 10px;
  margin-top: 10px;
  animation: panelReveal 260ms var(--ease-out) both;
}

@keyframes rewardHistorySweep {
  0% {
    opacity: 0;
    transform: translateX(-120%);
  }
  25% {
    opacity: 1;
  }
  100% {
    opacity: 0;
    transform: translateX(120%);
  }
}

@keyframes rewardHistorySweepReverse {
  0% {
    opacity: 0;
    transform: translateX(120%);
  }
  25% {
    opacity: 1;
  }
  100% {
    opacity: 0;
    transform: translateX(-120%);
  }
}

.reward-item {
  width: 100%;
  min-height: 56px;
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 8px 10px;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.022);
  color: var(--soft);
  cursor: pointer;
  text-align: left;
  position: relative;
  overflow: hidden;
  animation: rowReveal 360ms var(--ease-out) both;
  transition: background 160ms ease, border-color 160ms ease, transform 160ms ease, opacity 160ms ease, box-shadow 160ms ease;
}

.reward-item:nth-child(3) { animation-delay: 24ms; }
.reward-item:nth-child(4) { animation-delay: 48ms; }
.reward-item:nth-child(5) { animation-delay: 72ms; }
.reward-item:nth-child(n + 6) { animation-delay: 96ms; }

.reward-item:hover:not(:disabled) {
  border-color: rgba(var(--accent-rgb), 0.32);
  background: rgba(var(--accent-rgb), 0.08);
  transform: translateY(-1px);
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.22);
}

.reward-item:disabled {
  cursor: wait;
  opacity: 0.6;
}

.reward-thumb,
.reward-thumb-placeholder {
  width: 48px;
  height: 40px;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.04);
  object-fit: cover;
  transition: transform 180ms ease, filter 180ms ease;
}

.reward-item:hover:not(:disabled) .reward-thumb,
.reward-item:hover:not(:disabled) .reward-thumb-placeholder {
  filter: brightness(1.08);
  transform: scale(1.035);
}

.reward-thumb-placeholder {
  position: relative;
  display: block;
  background:
    linear-gradient(135deg, rgba(var(--accent-rgb), 0.18), transparent 42%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.055), rgba(255, 255, 255, 0.018));
  overflow: hidden;
}

.reward-thumb-placeholder::before {
  content: '';
  position: absolute;
  inset: 10px 12px;
  border: 1px solid rgba(var(--accent-rgb), 0.46);
  border-radius: 3px;
}

.reward-thumb-placeholder::after {
  content: '';
  position: absolute;
  left: 50%;
  top: 8px;
  bottom: 8px;
  width: 1px;
  background: linear-gradient(180deg, transparent, rgba(var(--accent-rgb), 0.42), transparent);
  opacity: 0.75;
}

.reward-main {
  min-width: 0;
}

.reward-title {
  display: block;
  overflow: hidden;
  color: var(--text);
  font-size: 13.5px;
  font-weight: 750;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.reward-time {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}

.reward-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  margin-top: 2px;
  white-space: nowrap;
}

.reward-session {
  flex: 0 0 auto;
  color: var(--accent);
  font-size: 11.5px;
  font-weight: 800;
}

.reward-open {
  color: var(--accent);
  font-size: 11.5px;
  font-weight: 800;
  white-space: nowrap;
}

.reward-empty,
.reward-error {
  padding: 14px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.025);
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
  text-align: center;
}

.reward-error {
  color: var(--bad);
  background: var(--bad-soft);
  text-align: left;
  word-break: break-word;
}

body.reward-modal-open {
  overflow: hidden;
}

.reward-modal[hidden] {
  display: none;
}

.reward-modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding:
    calc(18px + env(safe-area-inset-top, 0px))
    calc(18px + env(safe-area-inset-right, 0px))
    calc(18px + env(safe-area-inset-bottom, 0px))
    calc(18px + env(safe-area-inset-left, 0px));
}

.reward-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.72);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  animation: rewardFade 180ms ease both;
}

.reward-dialog {
  position: relative;
  width: min(960px, calc(100vw - 36px));
  max-height: calc(100svh - 36px);
  display: grid;
  grid-template-columns: minmax(280px, 420px) minmax(0, 1fr);
  gap: 0;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-xl);
  background: var(--surface-solid);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.58);
  animation: rewardEnter 240ms var(--ease-out) both;
}

@keyframes rewardFade {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes rewardEnter {
  from { opacity: 0; transform: translateY(18px) scale(0.976); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.reward-preview {
  display: grid;
  place-items: center;
  min-height: 420px;
  padding: 24px;
  background:
    linear-gradient(135deg, rgba(var(--accent-rgb), 0.07), transparent 34%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.035), rgba(255, 255, 255, 0)),
    rgba(5, 7, 11, 0.7);
}

#rewardImagePreview {
  width: min(100%, 360px);
  height: auto;
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.35);
  -webkit-touch-callout: default;
  user-select: auto;
  animation: rewardImagePop 320ms var(--ease-spring) both;
}

#rewardImagePreview:not([src]) {
  display: none;
}

#rewardCanvas {
  display: none;
}

.reward-detail {
  min-width: 0;
  padding: 28px;
  overflow-y: auto;
}

.reward-detail h2 {
  margin: 0;
  color: var(--text);
  font-size: 24px;
  line-height: 1.25;
  font-weight: 850;
  overflow-wrap: anywhere;
}

.reward-detail-meta {
  margin: 8px 0 22px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
}

.reward-code-box {
  display: grid;
  gap: 8px;
  margin-bottom: 22px;
}

.reward-code-label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.reward-code-value {
  padding: 13px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.035);
  color: var(--text);
  font-family: "Segoe UI", Consolas, monospace;
  font-size: 18px;
  font-weight: 700;
  line-height: 1.35;
  overflow-wrap: anywhere;
  animation: codeReveal 360ms var(--ease-out) both;
}

.reward-dialog-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.reward-dialog-button,
.reward-close {
  min-height: 38px;
  padding: 0 14px;
  border: 1px solid rgba(var(--accent-rgb), 0.24);
  border-radius: 8px;
  background: var(--accent-soft);
  color: var(--accent);
  cursor: pointer;
  font-weight: 800;
  transition: background 160ms ease, border-color 160ms ease, color 160ms ease, opacity 160ms ease;
}

.reward-dialog-button.primary {
  border: none;
  background: var(--accent-gradient);
  color: var(--accent-fg);
}

.reward-dialog-button:hover:not(:disabled),
.reward-close:hover {
  border-color: rgba(var(--accent-rgb), 0.48);
  background: rgba(var(--accent-rgb), 0.16);
  color: var(--text);
}

.reward-dialog-button.primary:hover:not(:disabled) {
  background: var(--accent-gradient);
  color: var(--accent-fg);
  opacity: 0.92;
}

.reward-dialog-button:disabled {
  cursor: wait;
  opacity: 0.55;
}

.reward-close {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 2;
  min-width: 34px;
  width: 34px;
  min-height: 34px;
  padding: 0;
  background: rgba(255, 255, 255, 0.06);
  color: var(--soft);
}

body.detail-modal-open,
body.pending-task-modal-open,
body.claim-detail-modal-open {
  overflow: hidden;
}

.detail-modal[hidden],
.pending-task-modal[hidden],
.claim-detail-modal[hidden] {
  display: none;
}

.detail-modal,
.pending-task-modal,
.claim-detail-modal {
  position: fixed;
  inset: 0;
  z-index: 96;
  display: grid;
  place-items: center;
  padding:
    calc(18px + env(safe-area-inset-top, 0px))
    calc(18px + env(safe-area-inset-right, 0px))
    calc(18px + env(safe-area-inset-bottom, 0px))
    calc(18px + env(safe-area-inset-left, 0px));
}

.detail-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.72);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  animation: rewardFade 160ms ease both;
}

.detail-dialog {
  position: relative;
  width: min(780px, calc(100vw - 36px));
  max-height: calc(100svh - 36px);
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-xl);
  background: var(--surface-solid);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.58);
  animation: rewardEnter 240ms var(--ease-out) both;
}

.detail-head {
  padding: 24px 56px 18px 24px;
  border-bottom: 1px solid var(--line-soft);
}

.detail-head h2 {
  margin: 0;
  color: var(--text);
  font-size: 22px;
  line-height: 1.25;
  font-weight: 850;
}

.detail-meta {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
}

.detail-close {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 2;
  width: 34px;
  min-width: 34px;
  min-height: 34px;
  padding: 0;
  border: 1px solid rgba(var(--accent-rgb), 0.24);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--soft);
  cursor: pointer;
  font: inherit;
  font-size: 18px;
  font-weight: 800;
  transition: background 160ms ease, border-color 160ms ease, color 160ms ease;
}

.detail-close:hover {
  border-color: rgba(var(--accent-rgb), 0.48);
  background: rgba(var(--accent-rgb), 0.16);
  color: var(--text);
}

.detail-body {
  min-height: 220px;
  overflow-y: auto;
  padding: 18px 24px;
  display: grid;
  gap: 12px;
  scrollbar-color: rgba(142, 150, 164, 0.42) rgba(255, 255, 255, 0.05);
  scrollbar-width: thin;
}

.detail-body.is-page-updated {
  animation: panelReveal 300ms var(--ease-out) both;
}

.detail-body::-webkit-scrollbar {
  width: 12px;
}

.detail-body::-webkit-scrollbar-track {
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.05);
}

.detail-body::-webkit-scrollbar-thumb {
  border: 3px solid #10141f;
  border-radius: 999px;
  background: rgba(142, 150, 164, 0.42);
}

.detail-body::-webkit-scrollbar-thumb:hover {
  background: rgba(var(--accent-rgb), 0.58);
}

.detail-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 24px;
  border-top: 1px solid var(--line-soft);
  background: var(--surface-panel);
}

.pending-task-account {
  display: grid;
  gap: 10px;
  padding: 14px;
  border: 1px solid var(--line-soft);
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.025);
  animation: rowReveal 340ms var(--ease-out) both;
  transition: border-color 160ms ease, background 160ms ease, transform 160ms ease;
}

.pending-task-account:nth-child(2) { animation-delay: 24ms; }
.pending-task-account:nth-child(3) { animation-delay: 48ms; }
.pending-task-account:nth-child(4) { animation-delay: 72ms; }
.pending-task-account:nth-child(n + 5) { animation-delay: 96ms; }

.pending-task-account:hover {
  border-color: rgba(var(--accent-rgb), 0.22);
  background: rgba(var(--accent-rgb), 0.045);
  transform: translateY(-1px);
}

.pending-task-account-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.pending-task-title {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  min-width: 0;
}

.pending-task-name {
  min-width: 0;
  color: var(--text);
  font-size: 15px;
  font-weight: 800;
  overflow-wrap: anywhere;
}

.pending-task-note {
  min-width: 0;
  max-width: min(280px, 100%);
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pending-task-status {
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.pending-task-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 64px;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.pending-task-count.has-pending {
  border: 1px solid rgba(var(--accent-rgb), 0.24);
  background: var(--accent-soft);
  color: var(--accent);
}

.pending-task-count.no-pending {
  border: 1px solid rgba(76, 217, 100, 0.2);
  background: var(--ok-soft);
  color: var(--ok);
}

.pending-task-count.unavailable {
  border: 1px solid rgba(255, 107, 107, 0.2);
  background: var(--bad-soft);
  color: var(--bad);
}

.pending-task-list {
  display: grid;
  gap: 6px;
  margin: 0;
  padding-left: 24px;
  color: var(--soft);
  font-size: 13px;
  line-height: 1.45;
}

.pending-task-list li::marker {
  color: var(--accent);
}

.pending-task-task-desc {
  color: var(--muted);
}

.pending-task-empty {
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
}

.pending-task-page-info {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.pending-task-pager {
  display: flex;
  align-items: center;
  gap: 10px;
}

.pending-task-page-button {
  min-width: 72px;
  min-height: 34px;
  padding: 0 12px;
  border: 1px solid rgba(var(--accent-rgb), 0.24);
  border-radius: 8px;
  background: var(--accent-soft);
  color: var(--accent);
  cursor: pointer;
  font: inherit;
  font-size: 12px;
  font-weight: 800;
  transition: background 160ms ease, border-color 160ms ease, color 160ms ease, opacity 160ms ease;
}

.pending-task-page-button:hover:not(:disabled) {
  border-color: rgba(var(--accent-rgb), 0.48);
  background: rgba(var(--accent-rgb), 0.16);
  color: var(--text);
}

.pending-task-page-button:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

.claim-detail-dialog {
  grid-template-rows: auto auto minmax(0, 1fr);
}

.claim-detail-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  padding: 14px 24px;
  border-bottom: 1px solid var(--line-soft);
  background: var(--surface-panel);
}

.claim-detail-chip {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 11px;
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--soft);
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.claim-detail-chip.is-success {
  border-color: rgba(76, 217, 100, 0.2);
  background: var(--ok-soft);
  color: var(--ok);
}

.claim-detail-chip.is-failed {
  border-color: rgba(255, 107, 107, 0.2);
  background: var(--bad-soft);
  color: var(--bad);
}

.claim-detail-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  align-items: start;
  padding: 14px;
  border: 1px solid var(--line-soft);
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.025);
  animation: rowReveal 340ms var(--ease-out) both;
}

.claim-detail-item:nth-child(2) { animation-delay: 24ms; }
.claim-detail-item:nth-child(3) { animation-delay: 48ms; }
.claim-detail-item:nth-child(4) { animation-delay: 72ms; }
.claim-detail-item:nth-child(n + 5) { animation-delay: 96ms; }

.claim-detail-item.is-success {
  border-color: rgba(76, 217, 100, 0.16);
}

.claim-detail-item.is-failed {
  border-color: rgba(255, 107, 107, 0.18);
  background: rgba(255, 107, 107, 0.04);
}

.claim-detail-item-main {
  min-width: 0;
  display: grid;
  gap: 6px;
}

.claim-detail-item-title {
  color: var(--text);
  font-size: 14px;
  font-weight: 800;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.claim-detail-desc,
.claim-detail-item-message {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
  overflow-wrap: anywhere;
  white-space: pre-line;
}

.claim-detail-item-message {
  color: var(--soft);
}

.claim-detail-status {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 48px;
  min-height: 26px;
  padding: 0 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.claim-detail-item.is-success .claim-detail-status {
  border: 1px solid rgba(76, 217, 100, 0.2);
  background: var(--ok-soft);
  color: var(--ok);
}

.claim-detail-item.is-failed .claim-detail-status {
  border: 1px solid rgba(255, 107, 107, 0.2);
  background: var(--bad-soft);
  color: var(--bad);
}

.claim-detail-empty {
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
}

@keyframes rowReveal {
  from { opacity: 0; transform: translateY(7px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes panelReveal {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes sectionReveal {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes workingSweep {
  0% { transform: translateX(-120%); opacity: 0; }
  30% { opacity: 1; }
  100% { transform: translateX(120%); opacity: 0; }
}

@keyframes inputLinePulse {
  0% { box-shadow: none; }
  38% { box-shadow: 0 7px 12px -10px rgba(var(--accent-rgb), 0.7); }
  100% { box-shadow: none; }
}

@keyframes rewardImagePop {
  from { opacity: 0; transform: scale(0.97); }
  to { opacity: 1; transform: scale(1); }
}

@keyframes codeReveal {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 1140px) {
  .accounts {
    grid-template-columns: 1fr;
    gap: 20px;
  }
}

@media (max-width: 768px) {
  .account-head {
    align-items: stretch;
    flex-direction: column;
    gap: 10px;
    padding: 16px 18px 12px;
  }

  .account-head .status {
    align-self: flex-start;
  }

  .tasks {
    overflow: visible;
  }

  .tasks table,
  .tasks tbody {
    display: block;
    min-width: 0;
  }

  .tasks thead {
    display: none;
  }

  .tasks tbody tr {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 4px 12px;
    padding: 12px 18px;
    border-bottom: 1px solid var(--line-soft);
  }

  .tasks tbody tr:last-child {
    border-bottom: 0;
  }

  .tasks td,
  .tasks th:nth-child(1),
  .tasks td:nth-child(1),
  .tasks th:nth-child(3),
  .tasks td:nth-child(3),
  .tasks th:nth-child(4),
  .tasks td:nth-child(4) {
    display: block;
    width: auto;
    padding: 0;
    border: 0;
    text-align: left;
  }

  .tasks .task-name {
    grid-column: 1;
    grid-row: 1;
    min-width: 0;
    font-size: 13px;
    font-weight: 750;
  }

  .tasks .task-name-layout {
    display: flex;
    align-items: baseline;
    column-gap: 24px;
    min-width: 0;
  }

  .tasks .task-name-prefix {
    display: inline-block;
    flex: 0 0 auto;
    color: var(--muted);
    font-weight: 700;
  }

  .tasks .task-name-text {
    min-width: 0;
    overflow-wrap: anywhere;
  }

  .tasks .task-desc {
    grid-column: 1 / -1;
    grid-row: 2;
    font-size: 12px;
    line-height: 1.45;
  }

  .tasks td:nth-child(3) {
    grid-column: 1;
    grid-row: 3;
    color: var(--muted);
    font-size: 11.5px;
  }

  .tasks td:nth-child(3)::before {
    content: "积分 ";
  }

  .tasks .receive-status {
    grid-column: 2;
    grid-row: 1;
    align-self: center;
  }

  .tasks .task-empty-row td {
    grid-column: 1 / -1;
  }

  .reward-dialog {
    grid-template-columns: 1fr;
    overflow-y: auto;
  }

  .reward-preview {
    min-height: auto;
    padding: 56px 18px 18px;
  }

  .reward-detail {
    padding: 20px;
  }
}

@media (max-width: 480px) {
  .account-title {
    gap: 10px;
  }

  .account-main {
    gap: 8px;
  }

  .account-name {
    font-size: 16px;
  }

  .account-note-row {
    grid-template-columns: auto minmax(0, 1fr);
    gap: 6px 8px;
  }

  .account-note-state {
    grid-column: 2;
    min-height: 14px;
    text-align: left;
  }

  .account-note-state:empty {
    display: none;
  }

  .account-grid {
    grid-template-columns: 1fr;
    gap: 0;
    padding: 0;
  }

  .stat {
    display: flex;
    justify-content: space-between;
    align-items: center;
    min-height: auto;
    padding: 10px 18px;
    border-right: none;
    border-bottom: 1px solid var(--line-soft);
  }

  .stat:first-child,
  .stat:last-child {
    padding-left: 18px;
    padding-right: 18px;
  }

  .stat:last-child {
    border-bottom: none;
  }

  .account-note-input {
    font-size: 12px;
  }

  .stat strong {
    margin-top: 0;
    font-size: 18px;
    text-align: right;
  }

  .lottery-details {
    width: 100%;
  }

  .lottery-static {
    width: 100%;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: center;
    column-gap: 8px;
  }

  .lottery-details summary {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: center;
    column-gap: 8px;
  }

  .lottery-label {
    grid-column: 1;
    gap: 16px;
  }

  .lottery-details summary strong {
    grid-column: 2;
    grid-row: 1;
    justify-self: end;
    text-align: right;
  }

  .lottery-static strong {
    grid-column: 2;
    grid-row: 1;
    justify-self: end;
  }

  .lottery-panel {
    justify-content: flex-end;
  }

  .reward-section {
    padding: 14px 18px;
  }

  .account-section > summary {
    min-height: 44px;
    padding: 0 16px 0 18px;
  }

  .reward-item {
    grid-template-columns: 44px minmax(0, 1fr);
    min-height: 52px;
    gap: 10px;
    padding: 7px 8px;
  }

  .reward-thumb,
  .reward-thumb-placeholder {
    width: 44px;
    height: 38px;
  }

  .reward-open {
    grid-column: 2;
    justify-self: start;
    margin-top: -4px;
  }

  .reward-dialog {
    width: calc(100vw - 20px - env(safe-area-inset-left, 0px) - env(safe-area-inset-right, 0px));
    max-height: calc(100svh - 20px - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px));
  }

  .reward-modal {
    padding:
      calc(10px + env(safe-area-inset-top, 0px))
      calc(10px + env(safe-area-inset-right, 0px))
      calc(10px + env(safe-area-inset-bottom, 0px))
      calc(10px + env(safe-area-inset-left, 0px));
  }

  .reward-dialog-actions {
    display: grid;
  }

  .reward-dialog-button {
    width: 100%;
  }

  .detail-modal {
    padding:
      calc(10px + env(safe-area-inset-top, 0px))
      calc(10px + env(safe-area-inset-right, 0px))
      calc(10px + env(safe-area-inset-bottom, 0px))
      calc(10px + env(safe-area-inset-left, 0px));
  }

  .detail-dialog {
    width: calc(100vw - 20px - env(safe-area-inset-left, 0px) - env(safe-area-inset-right, 0px));
    max-height: calc(100svh - 20px - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px));
  }

  .detail-head {
    padding: 20px 52px 14px 18px;
  }

  .detail-body {
    gap: 10px;
    padding: 12px 18px;
  }

  .pending-task-account {
    gap: 8px;
    padding: 12px;
  }

  .pending-task-account-head,
  .detail-foot {
    align-items: stretch;
    flex-direction: column;
  }

  .pending-task-pager {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .pending-task-page-button {
    width: 100%;
  }

  .claim-detail-summary {
    padding: 12px 18px;
  }

  .claim-detail-item {
    grid-template-columns: 1fr;
    gap: 10px;
    padding: 12px;
  }

  .claim-detail-status {
    justify-self: start;
  }
}


/* assets/admin.css */

.log-actions {
  position: relative;
  top: auto;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 14px;
  padding: 8px 0;
  background:
    linear-gradient(180deg, rgba(var(--notice-bg-rgb), 0.96), rgba(var(--notice-bg-rgb), 0.86)),
    var(--body-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  animation: actionsEnter 500ms var(--ease-out) 120ms both;
}

.log-action-left {
  display: flex;
  align-items: center;
  gap: 16px;
  min-width: 0;
  flex-wrap: wrap;
}

.filter-controls {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.filter-controls .select-shell {
  animation: filterEnter 420ms var(--ease-out) both;
}

.filter-controls .select-shell.open {
  z-index: 120;
}

.filter-controls .select-shell:nth-child(2) {
  animation-delay: 50ms;
}

.filter-controls .select-shell:nth-child(3) {
  animation-delay: 100ms;
}

.selection-hint {
  display: inline-flex;
  align-items: center;
  min-height: 18px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
  line-height: 18px;
}

.selection-controls {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.mobile-select-all {
  display: none;
  align-items: center;
  gap: 8px;
  min-height: 18px;
  color: var(--muted);
  font-size: 13.5px;
  font-weight: 600;
  line-height: 18px;
}

.admin-action-buttons {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

.cache-actions {
  position: relative;
  top: auto;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 14px;
  padding: 8px 0;
  background:
    linear-gradient(180deg, rgba(var(--notice-bg-rgb), 0.96), rgba(var(--notice-bg-rgb), 0.86)),
    var(--body-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  animation: actionsEnter 500ms var(--ease-out) 120ms both;
}

.cache-action-left {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
  padding-left: 14px;
  flex-wrap: wrap;
}

.data-panel {
  position: relative;
  z-index: 1;
  margin-top: 14px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.02), transparent 120px),
    color-mix(in srgb, var(--surface-solid) 94%, transparent);
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.24);
}

.data-panel::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(110deg, transparent 0%, rgba(var(--accent-rgb), 0.07) 44%, transparent 62%);
  opacity: 0;
  transform: translateX(-110%);
  pointer-events: none;
}

body.admin-loading .log-panel::after,
body.image-cache-loading .cache-panel::after {
  animation: logPanelSweep 1.1s ease-in-out infinite;
}

.data-panel table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}

.data-panel th,
.data-panel td {
  min-width: 0;
  padding: 10px 14px;
  border-bottom: 1px solid var(--line-soft);
  text-align: left;
  font-size: 12.5px;
  overflow-wrap: anywhere;
}

.log-panel th,
.log-panel td {
  vertical-align: top;
}

.cache-panel th,
.cache-panel td {
  vertical-align: middle;
}

.data-panel th {
  color: var(--muted);
  font-size: 10.5px;
  font-weight: 800;
  text-transform: uppercase;
  background:
    linear-gradient(90deg, rgba(var(--accent-rgb), 0.045), transparent 34%),
    var(--surface-soft);
  border-bottom: 1px solid var(--line);
}

.log-panel th {
  letter-spacing: 0.08em;
}

.cache-panel th {
  letter-spacing: 0;
  border-bottom-color: var(--line);
}

.data-panel tbody tr {
  animation: logRowEnter 360ms var(--ease-out) both;
  transition: background 160ms ease, box-shadow 160ms ease;
}

/* 大表行：视口外跳过布局/绘制（骨架行除外；浏览器不支持时自动忽略） */
.log-panel tbody tr:not(.skeleton-row),
.cache-panel tbody tr:not(.skeleton-row) {
  content-visibility: auto;
  contain-intrinsic-size: auto 72px;
}

.log-panel tbody tr {
  transition: background 160ms ease, transform 160ms ease, box-shadow 160ms ease;
}

.data-panel tbody tr:hover {
  background: rgba(var(--accent-rgb), 0.025);
}

.log-panel tbody tr:nth-child(2) { animation-delay: 22ms; }
.log-panel tbody tr:nth-child(3) { animation-delay: 44ms; }
.log-panel tbody tr:nth-child(4) { animation-delay: 66ms; }
.log-panel tbody tr:nth-child(5) { animation-delay: 88ms; }
.log-panel tbody tr:nth-child(n + 6) { animation-delay: 110ms; }

.data-panel tbody tr.log-row-selected,
.data-panel tbody tr.cache-row-selected {
  background: rgba(var(--accent-rgb), 0.055);
  box-shadow: inset 2px 0 0 var(--accent);
}

.data-panel tr:last-child td {
  border-bottom: none;
}

.cache-preview-col {
  width: 88px;
}

.cache-type-col {
  width: 132px;
}

.cache-size-col {
  width: 96px;
}

.cache-time-col {
  width: 224px;
}

.cache-status-col {
  width: 92px;
}

.cache-thumbnail {
  display: block;
  width: 56px;
  height: 56px;
  object-fit: contain;
  border: 1px solid var(--line-soft);
  border-radius: 6px;
  background: var(--surface-soft);
}

.cache-source-cell,
.cache-time-cell {
  min-width: 0;
}

.cache-source-link {
  display: block;
  overflow: hidden;
  color: var(--text);
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cache-source-link:hover {
  color: var(--accent);
}

.cache-key,
.cache-time-cell span {
  display: block;
  margin-top: 4px;
  overflow: hidden;
  color: var(--muted-dim);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cache-time-cell strong,
.cache-size-cell {
  color: var(--soft);
  font-weight: 650;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.log-rows-updated,
.cache-rows-updated {
  animation: rowsRefresh 420ms var(--ease-out) both;
}

.button.danger {
  border: 1px solid rgba(255, 107, 107, 0.25);
  background: rgba(255, 107, 107, 0.085);
  color: var(--bad);
  box-shadow: none;
}

.button.danger:hover:not(:disabled) {
  background: #ff6b6b;
  color: #0d0f12;
  border-color: transparent;
  box-shadow: 0 4px 12px rgba(255, 107, 107, 0.25);
  transform: translateY(-1px);
}

.button.danger:disabled {
  filter: saturate(0.75);
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  display: none;
  place-items: center;
  padding:
    calc(24px + env(safe-area-inset-top, 0px))
    calc(24px + env(safe-area-inset-right, 0px))
    calc(24px + env(safe-area-inset-bottom, 0px))
    calc(24px + env(safe-area-inset-left, 0px));
  background: rgba(4, 5, 8, 0.7);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 999;
  animation: fadeIn 0.2s ease-out;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.modal-backdrop.open {
  display: grid;
}

.modal {
  width: min(100%, 420px);
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  background: var(--surface-solid);
  box-shadow: 0 32px 64px rgba(0, 0, 0, 0.6), inset 0 1px 1px rgba(255, 255, 255, 0.05);
  animation: modalEnter 0.28s var(--ease-spring) both;
}

@keyframes modalEnter {
  from { opacity: 0; transform: scale(0.94); }
  to { opacity: 1; transform: scale(1); }
}

.modal-body {
  padding: 28px 28px 20px;
}

.modal-title {
  margin: 0;
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: 0;
}

.modal-text {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  padding: 0 28px 28px;
}

.time-col { width: 200px; }
.select-col { width: 52px; }
.account-col { width: 140px; }
.ip-col { width: 156px; }
.event-col { width: 132px; }
.result-col { width: 96px; }
.count-col { width: 170px; }
.duration-col { width: 118px; }

input[type="checkbox"] {
  appearance: none;
  -webkit-appearance: none;
  width: 18px;
  height: 18px;
  border: 1px solid rgba(var(--accent-rgb), 0.36);
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.045);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  position: relative;
  outline: none;
}

input[type="checkbox"]:hover {
  border-color: rgba(var(--accent-rgb), 0.62);
  background: rgba(var(--accent-rgb), 0.08);
}

input[type="checkbox"]:checked {
  background: var(--accent);
  border-color: transparent;
  animation: checkboxPop 220ms var(--ease-spring) both;
}

input[type="checkbox"]:indeterminate {
  background: var(--accent-soft);
  border-color: var(--accent);
  animation: checkboxPop 220ms var(--ease-spring) both;
}

input[type="checkbox"]:checked::after {
  content: '';
  width: 10px;
  height: 5px;
  border-left: 2px solid var(--accent-fg);
  border-bottom: 2px solid var(--accent-fg);
  transform: rotate(-45deg) translate(1px, -1px);
}

input[type="checkbox"]:indeterminate::after {
  content: '';
  width: 8px;
  height: 2px;
  background: var(--accent);
}

input[type="checkbox"]:focus {
  border-color: var(--accent);
  box-shadow: 0 0 8px rgba(var(--accent-rgb), 0.3);
}

.log-time {
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.log-duration {
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.log-ip {
  white-space: nowrap;
  overflow-wrap: normal;
  word-break: normal;
  font-variant-numeric: tabular-nums;
}

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 0 8px;
  border-radius: 5px;
  font-size: 10.5px;
  font-weight: 700;
  white-space: nowrap;
  transition: transform 160ms ease, filter 160ms ease;
}

.log-panel tbody tr:hover .badge {
  filter: brightness(1.12);
  transform: translateY(-1px);
}

.badge.ok {
  background: var(--ok-soft);
  border: 1px solid rgba(76, 217, 100, 0.2);
  color: var(--ok);
}

.badge.failed {
  background: var(--bad-soft);
  border: 1px solid rgba(255, 107, 107, 0.2);
  color: var(--bad);
}

.badge.cache {
  background: var(--warn-soft);
  border: 1px solid rgba(240, 193, 93, 0.2);
  color: var(--warn);
}

.detail {
  color: var(--muted-dim);
  font-size: 11.5px;
  word-break: break-word;
  line-height: 1.45;
}

.log-stats {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.log-stats .detail {
  overflow-wrap: anywhere;
}

.log-panel .error-text {
  margin-top: 4px;
  color: var(--bad);
  font-size: 11.5px;
  word-break: break-word;
  line-height: 1.45;
}

.log-detail-stack {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.log-mobile-details {
  display: none;
}

@keyframes actionsEnter {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes filterEnter {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes logRowEnter {
  from { opacity: 0; transform: translateY(7px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes rowsRefresh {
  from { filter: brightness(1.12); }
  to { filter: brightness(1); }
}

@keyframes logPanelSweep {
  0% { opacity: 0; transform: translateX(-110%); }
  30% { opacity: 1; }
  100% { opacity: 0; transform: translateX(110%); }
}

@keyframes checkboxPop {
  0% { transform: scale(0.86); }
  70% { transform: scale(1.08); }
  100% { transform: scale(1); }
}

@media (max-width: 980px) {
  .theme-menu-list {
    grid-template-columns: repeat(5, 36px);
    max-width: min(calc(100vw - 24px), 240px);
  }

  .theme-menu-item {
    width: 36px;
    min-width: 36px;
    height: 36px;
    min-height: 36px;
  }

  .data-panel tbody tr.skeleton-row {
    display: grid;
    grid-template-columns: 28px minmax(0, 1fr) auto;
    gap: 8px 10px;
    padding: 12px 14px;
  }

  .data-panel tbody tr.skeleton-row td {
    display: none;
  }

  .log-panel tbody tr.skeleton-row td.select-cell,
  .log-panel tbody tr.skeleton-row td.log-time,
  .log-panel tbody tr.skeleton-row td.log-type,
  .cache-panel tbody tr.skeleton-row td.select-cell,
  .cache-panel tbody tr.skeleton-row td.cache-preview-cell,
  .cache-panel tbody tr.skeleton-row td.cache-source-cell {
    display: block;
  }

  .data-panel tbody tr.skeleton-row td.select-cell {
    grid-column: 1;
    grid-row: 1 / 3;
  }

  .log-panel tbody tr.skeleton-row td.log-time,
  .cache-panel tbody tr.skeleton-row td.cache-preview-cell {
    grid-column: 2;
    grid-row: 1;
  }

  .log-panel tbody tr.skeleton-row td.log-type,
  .cache-panel tbody tr.skeleton-row td.cache-source-cell {
    grid-column: 2;
    grid-row: 2;
  }

  .log-actions {
    position: relative;
    align-items: stretch;
    flex-direction: column;
    gap: 12px;
    padding: 0;
    background: transparent;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }

  .cache-actions {
    position: relative;
    align-items: stretch;
    flex-direction: column;
    gap: 12px;
    padding: 0;
    background: transparent;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }

  .cache-action-left {
    width: 100%;
  }

  .cache-panel table,
  .cache-panel thead,
  .cache-panel tbody,
  .cache-panel tr,
  .cache-panel td {
    display: block;
  }

  .cache-panel table {
    table-layout: auto;
  }

  .cache-panel thead {
    display: none;
  }

  .cache-panel tr {
    display: grid;
    grid-template-columns: 28px 60px minmax(0, 1fr) auto;
    gap: 6px 12px;
    padding: 12px 14px;
    border-bottom: 1px solid var(--line-soft);
  }

  .cache-panel tr:last-child {
    border-bottom: 0;
  }

  .cache-panel td {
    padding: 0;
    border: 0;
  }

  .cache-panel td.empty {
    grid-column: 1 / -1;
    padding: 24px 12px;
    text-align: center;
  }

  .cache-panel td.select-cell {
    grid-column: 1;
    grid-row: 1 / 4;
    align-self: start;
  }

  .cache-preview-cell {
    grid-column: 2;
    grid-row: 1 / 4;
  }

  .cache-source-cell {
    grid-column: 3;
    grid-row: 1;
    align-self: center;
  }

  .cache-status-cell {
    grid-column: 4;
    grid-row: 1;
    align-self: center;
  }

  .cache-type-cell {
    grid-column: 3;
    grid-row: 2;
  }

  .cache-size-cell {
    grid-column: 4;
    grid-row: 2;
  }

  .cache-time-cell {
    grid-column: 3 / 5;
    grid-row: 3;
  }

  .cache-panel td::before,
  .cache-panel td.select-cell::before,
  .cache-panel td.cache-preview-cell::before {
    display: none;
  }

  .cache-thumbnail {
    width: 60px;
    height: 60px;
  }

  .log-action-left,
  .filter-controls {
    align-items: stretch;
    width: 100%;
  }

  .filter-controls .select-shell {
    flex: 1 1 180px;
    width: auto;
  }

  .admin-action-buttons {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    width: 100%;
  }

  .log-actions .admin-action-buttons {
    grid-template-columns: 1fr;
  }

  .admin-action-buttons .button {
    width: 100%;
  }

  .mobile-select-all {
    display: inline-flex;
  }

  .log-panel table,
  .log-panel thead,
  .log-panel tbody,
  .log-panel tr,
  .log-panel td {
    display: block;
  }

  .log-panel table { table-layout: auto; }
  .log-panel thead { display: none; }

  .log-panel tr {
    display: grid;
    grid-template-columns: 28px minmax(0, 1fr) auto;
    gap: 6px 10px;
    padding: 12px 14px;
    border-bottom: 1px solid var(--line-soft);
  }

  .log-panel tr:last-child {
    border-bottom: none;
  }

  .log-panel td {
    display: block;
    padding: 0;
    border: none;
    font-size: 12.5px;
  }

  .log-panel td::before {
    content: attr(data-label);
    color: var(--muted);
    font-weight: 700;
    font-size: 11.5px;
  }

  .log-panel td.select-cell {
    grid-column: 1;
    grid-row: 1 / 3;
    align-self: start;
    padding-top: 1px;
  }

  .log-panel td.select-cell::before {
    content: "";
  }

  .log-panel td.log-time {
    grid-column: 2;
    grid-row: 1;
    color: var(--text);
    font-size: 12px;
  }

  .log-panel td.log-time::before,
  .log-panel td.log-account::before,
  .log-panel td.log-type::before,
  .log-panel td.log-result::before {
    display: none;
  }

  .log-panel td.log-account {
    grid-column: 2;
    grid-row: 2;
    color: var(--muted);
  }

  .log-panel td.log-type {
    grid-column: 3;
    grid-row: 1;
  }

  .log-panel td.log-result {
    grid-column: 3;
    grid-row: 2;
  }

  .log-panel td.log-ip,
  .log-panel td.log-stats-cell,
  .log-panel td.log-duration {
    display: none;
  }

  .log-panel td.log-detail-cell {
    grid-column: 1 / -1;
    grid-row: 3;
    margin-top: 2px;
  }

  .log-panel td.log-detail-cell::before,
  .log-desktop-detail {
    display: none;
  }

  .log-mobile-details {
    display: block;
  }

  .log-mobile-details > summary {
    display: flex;
    align-items: center;
    gap: 6px;
    width: max-content;
    min-height: 26px;
    color: var(--muted);
    cursor: pointer;
    list-style: none;
    font-size: 11.5px;
    font-weight: 700;
  }

  .log-mobile-details > summary::-webkit-details-marker {
    display: none;
  }

  .log-mobile-details > summary::after {
    content: "\203A";
    color: var(--accent);
    font-size: 17px;
    line-height: 1;
    transition: transform 160ms ease;
  }

  .log-mobile-details[open] > summary::after {
    transform: rotate(90deg);
  }

  .log-mobile-detail-grid {
    display: grid;
    gap: 8px;
    margin-top: 6px;
    padding: 10px 12px;
    border: 1px solid var(--line-soft);
    border-radius: 6px;
    background: var(--surface-soft);
  }

  .log-mobile-detail-row {
    display: grid;
    grid-template-columns: 72px minmax(0, 1fr);
    gap: 10px;
    align-items: start;
    min-width: 0;
  }

  .log-mobile-detail-row > span {
    color: var(--muted);
    font-size: 11.5px;
    font-weight: 700;
  }

  .log-mobile-detail-row > strong {
    color: var(--soft);
    font-size: 12px;
    font-weight: 600;
    overflow-wrap: anywhere;
  }

  .log-mobile-detail-row .log-stats,
  .log-mobile-detail-row .log-detail-stack {
    width: 100%;
  }
}

@media (max-width: 520px) {
  #adminView .metric:nth-last-child(-n + 2) {
    border-bottom: 1px solid var(--line);
  }

  #adminView .metric:last-child {
    grid-column: 1 / -1;
    min-height: 78px;
    border-right: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
  }

  #imageCacheView .metric:nth-last-child(-n + 2) {
    border-bottom: 1px solid var(--line);
  }

  #imageCacheView .metric:last-child {
    grid-column: auto;
    min-height: inherit;
    border-right: 1px solid var(--line);
  }

  .log-action-left {
    gap: 10px;
  }

  .filter-controls {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .filter-controls .select-shell {
    width: 100%;
    min-width: 0;
  }

  .filter-controls .account-select-shell {
    grid-column: 1 / -1;
  }

  .selection-controls {
    justify-content: space-between;
  }

  .admin-action-buttons {
    gap: 8px;
  }

  .cache-action-left {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 10px;
  }

  .cache-action-left .mobile-select-all,
  .cache-action-left .selection-hint {
    grid-column: auto;
  }

  .cache-panel tr {
    grid-template-columns: 24px 52px minmax(0, 1fr) auto;
    gap: 5px 9px;
    padding: 11px 10px;
  }

  .cache-thumbnail {
    width: 52px;
    height: 52px;
  }
}

/* SPA login view */
.login-view {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: grid;
  place-items: center;
  padding:
    calc(24px + env(safe-area-inset-top, 0px))
    calc(24px + env(safe-area-inset-right, 0px))
    calc(24px + env(safe-area-inset-bottom, 0px))
    calc(24px + env(safe-area-inset-left, 0px));
}

.login-form {
  position: relative;
  z-index: 1;
  width: min(100%, 390px);
  padding: 36px 32px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-xl);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.03), transparent 96px),
    var(--surface);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  box-shadow:
    0 24px 52px rgba(0, 0, 0, 0.5),
    inset 0 1px 1px rgba(255, 255, 255, 0.08);
  overflow: hidden;
  animation: formEnter 0.6s var(--ease-out) both;
}

.login-form::before {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(var(--accent-rgb), 0.78), transparent);
  animation: topLight 2.8s ease-in-out infinite;
  pointer-events: none;
}

.login-form::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(115deg, transparent 0%, rgba(255, 255, 255, 0.055) 42%, transparent 58%);
  opacity: 0;
  transform: translateX(-120%);
  pointer-events: none;
}

.login-form:hover::after {
  animation: formSweep 1s ease-out both;
}

.login-brand {
  margin: 0 0 12px;
  color: var(--accent);
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  opacity: 0.9;
}

.login-form h1 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: 0;
  background: var(--heading-gradient);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.login-subtitle {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
}

.login-form label {
  display: block;
  margin-top: 24px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.login-input-wrapper {
  position: relative;
  margin-top: 8px;
}

.login-input-wrapper::after {
  content: '';
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  opacity: 0;
  transform: scaleX(0.4);
  transition: opacity 180ms ease, transform 240ms var(--ease-out);
  pointer-events: none;
}

.login-input-wrapper:focus-within::after {
  opacity: 1;
  transform: scaleX(1);
}

.login-form input {
  width: 100%;
  min-height: 48px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface-soft);
  color: var(--text);
  font: inherit;
  outline: none;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.2);
}

.login-form input:focus {
  border-color: var(--accent);
  background: var(--surface-hover);
  box-shadow:
    0 0 16px rgba(var(--accent-rgb), 0.2),
    inset 0 1px 1px rgba(255, 255, 255, 0.04);
  transform: translateZ(0);
}

.login-submit {
  width: 100%;
  min-height: 46px;
  margin-top: 24px;
  border: none;
  border-radius: 7px;
  background: var(--accent-gradient);
  color: #0d0f12;
  cursor: pointer;
  font: inherit;
  font-weight: 700;
  letter-spacing: 0.05em;
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  box-shadow: 0 4px 12px rgba(var(--accent-rgb), 0.2);
  position: relative;
  overflow: hidden;
}

.login-submit::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(115deg, transparent 0%, rgba(255, 255, 255, 0.36) 44%, transparent 62%);
  opacity: 0;
  transform: translateX(-120%);
  pointer-events: none;
}

.login-submit:hover:not(:disabled) {
  opacity: 0.95;
  transform: translateY(-2px) translateZ(0);
  box-shadow: 0 8px 24px rgba(var(--accent-rgb), 0.35);
}

.login-submit:hover:not(:disabled)::after {
  animation: buttonSweep 720ms ease-out both;
}

.login-submit:active {
  transform: translateY(0);
  box-shadow: 0 2px 8px rgba(var(--accent-rgb), 0.2);
}

.login-submit:disabled {
  cursor: wait;
  opacity: 0.65;
}

.login-error {
  margin: 16px 0 -8px;
  padding: 10px 14px;
  color: var(--bad);
  font-size: 13px;
  font-weight: 500;
  background: rgba(255, 107, 107, 0.1);
  border-left: 3px solid var(--bad);
  border-radius: 4px;
}

.login-error.is-login-error-updated {
  animation: shake 0.4s ease;
}

@keyframes formEnter {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-4px); }
  75% { transform: translateX(4px); }
}

@keyframes topLight {
  0%, 100% { opacity: 0.45; transform: scaleX(0.55); }
  50% { opacity: 1; transform: scaleX(1); }
}

@keyframes formSweep {
  0% { opacity: 0; transform: translateX(-120%); }
  20% { opacity: 0.7; }
  100% { opacity: 0; transform: translateX(120%); }
}

@media (max-width: 480px) {
  .login-view {
    padding:
      calc(16px + env(safe-area-inset-top, 0px))
      calc(16px + env(safe-area-inset-right, 0px))
      calc(16px + env(safe-area-inset-bottom, 0px))
      calc(16px + env(safe-area-inset-left, 0px));
  }

  .login-form {
    padding: 30px 24px;
  }
}


/* Modern SaaS glass language: scoped so existing dynamic classes and theme values remain intact. */
body.ios-ui {
  --ios-surface: color-mix(in srgb, var(--surface-solid) 78%, transparent);
  --ios-surface-elevated: color-mix(in srgb, var(--surface-solid) 92%, transparent);
  --ios-fill: rgba(var(--accent-rgb), 0.08);
  --ios-separator: color-mix(in srgb, var(--line) 88%, transparent);
  --ios-separator-soft: color-mix(in srgb, var(--line-soft) 92%, transparent);
  --ios-blue: var(--accent);
  --ios-blue-rgb: var(--accent-rgb);
  --ios-card: color-mix(in srgb, var(--surface-solid) 86%, transparent);
  --ios-inset: color-mix(in srgb, var(--surface-solid) 54%, transparent);
  --ios-highlight: color-mix(in srgb, var(--text) 6%, transparent);
  --ios-control: color-mix(in srgb, var(--surface-solid) 68%, transparent);
  --ios-shadow: var(--shadow-card);
  --ios-shadow-elevated: var(--shadow-elevated);
  background: var(--body-bg);
  letter-spacing: 0;
}

html[data-theme="white"] body.ios-ui {
  --ios-surface: color-mix(in srgb, var(--surface-solid) 82%, transparent);
  --ios-surface-elevated: color-mix(in srgb, var(--surface-solid) 96%, transparent);
  --ios-fill: rgba(var(--accent-rgb), 0.08);
  --ios-separator: rgba(25, 33, 46, 0.1);
  --ios-separator-soft: rgba(25, 33, 46, 0.06);
  --ios-card: color-mix(in srgb, #ffffff 90%, transparent);
  --ios-inset: color-mix(in srgb, #f4f6f9 72%, transparent);
  --ios-highlight: rgba(25, 33, 46, 0.04);
  --ios-control: rgba(25, 33, 46, 0.05);
  --ios-shadow: var(--shadow-card);
  --ios-shadow-elevated: var(--shadow-elevated);
  background: var(--body-bg);
}

body.ios-ui::before {
  display: block;
  opacity: 0.55;
}

body.ios-ui::after {
  display: block;
  opacity: 0.7;
}

body.ios-ui .app {
  max-width: 1400px;
  padding: 24px clamp(16px, 3.5vw, 44px) 56px;
}

body.ios-ui .topbar {
  position: relative;
  top: auto;
  z-index: 120;
  min-height: 78px;
  margin: -24px calc(-1 * clamp(16px, 3.5vw, 44px)) 0;
  padding: 18px clamp(16px, 3.5vw, 44px) 16px;
  border-bottom: 1px solid var(--ios-separator-soft);
  background: color-mix(in srgb, var(--bg) 78%, transparent);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
}

body.ios-ui .topbar::after {
  display: block;
  left: clamp(16px, 3.5vw, 44px);
  width: min(280px, 36vw);
  height: 2px;
  opacity: 0.85;
  background: linear-gradient(90deg, var(--accent), rgba(var(--accent-rgb), 0.15), transparent);
  box-shadow: 0 0 12px rgba(var(--accent-rgb), 0.25);
}

body.ios-ui .topbar-actions {
  gap: 10px;
  padding-top: 28px;
}

body.ios-ui .eyebrow {
  margin-bottom: 4px;
  color: var(--accent);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  opacity: 0.92;
}

body.ios-ui h1 {
  background: var(--heading-gradient);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  font-size: 32px;
  font-weight: 800;
  letter-spacing: -0.02em;
}

body.ios-ui .subtitle {
  margin-top: 4px;
  color: color-mix(in srgb, var(--muted) 90%, var(--text));
  font-size: 13.5px;
}

body.ios-ui .main-nav,
body.ios-ui .admin-section-nav {
  gap: 2px;
  padding: 3px;
  border: 1px solid var(--ios-separator-soft);
  border-radius: var(--radius-md);
  background: var(--ios-control);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

body.ios-ui .theme-trigger,
body.ios-ui .user-trigger {
  border: 1px solid var(--ios-separator-soft);
  border-radius: var(--radius-sm);
  background: var(--ios-control);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
  width: 38px;
  min-height: 38px;
}

body.ios-ui .nav-link {
  min-height: 34px;
  border: 0;
  border-radius: calc(var(--radius-md) - 4px);
  color: var(--muted);
  font-size: 13px;
  font-weight: 650;
}

body.ios-ui .nav-link.active {
  border: 0;
  background: color-mix(in srgb, var(--surface-solid) 88%, transparent);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.18), 0 0 0 1px rgba(var(--accent-rgb), 0.12);
  color: var(--text);
}

body.ios-ui .nav-link:hover,
body.ios-ui .nav-link:focus-visible {
  border: 0;
  background: var(--ios-highlight);
  color: var(--text);
}

body.ios-ui .theme-new-badge {
  display: none;
}

body.ios-ui .theme-menu-list,
body.ios-ui .user-menu-list {
  border: 1px solid var(--ios-separator);
  border-radius: var(--radius-md);
  background: var(--ios-surface-elevated);
  box-shadow: var(--ios-shadow-elevated);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
}

body.ios-ui .theme-menu-item {
  border-radius: var(--radius-sm);
}

body.ios-ui .button,
body.ios-ui .refresh,
body.ios-ui .task-action,
body.ios-ui .task-bulk-action,
body.ios-ui .draw-action,
body.ios-ui .reward-dialog-button,
body.ios-ui .pending-task-page-button {
  min-height: 38px;
  border: 1px solid var(--ios-separator-soft);
  border-radius: var(--radius-sm);
  background: var(--ios-control);
  color: var(--soft);
  box-shadow: none;
  font-weight: 700;
  transition: transform 160ms ease, opacity 160ms ease, background 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
}

body.ios-ui .button.primary,
body.ios-ui .refresh,
body.ios-ui .reward-dialog-button.primary {
  border: 0;
  background: var(--accent-gradient);
  color: var(--accent-fg);
  box-shadow: 0 8px 18px rgba(var(--accent-rgb), 0.22);
}

body.ios-ui .button.primary::after,
body.ios-ui .refresh::after {
  display: block;
}

body.ios-ui .button:hover:not(:disabled),
body.ios-ui .task-action:hover:not(:disabled),
body.ios-ui .task-bulk-action:hover:not(:disabled),
body.ios-ui .draw-action:hover:not(:disabled),
body.ios-ui .reward-dialog-button:hover:not(:disabled),
body.ios-ui .pending-task-page-button:hover:not(:disabled) {
  border-color: rgba(var(--accent-rgb), 0.35);
  background: var(--ios-highlight);
  color: var(--text);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.12);
  transform: translateY(-1px);
}

body.ios-ui .button.primary:hover:not(:disabled),
body.ios-ui .refresh:hover:not(:disabled),
body.ios-ui .reward-dialog-button.primary:hover:not(:disabled) {
  border: 0;
  background: var(--accent-gradient);
  color: var(--accent-fg);
  opacity: 0.96;
  box-shadow: 0 10px 24px rgba(var(--accent-rgb), 0.3);
  transform: translateY(-1px);
}

body.ios-ui .button:active:not(:disabled),
body.ios-ui .refresh:active:not(:disabled),
body.ios-ui .task-action:active:not(:disabled),
body.ios-ui .task-bulk-action:active:not(:disabled),
body.ios-ui .draw-action:active:not(:disabled),
body.ios-ui .reward-dialog-button:active:not(:disabled),
body.ios-ui .pending-task-page-button:active:not(:disabled) {
  opacity: 0.88;
  transform: translateY(0) scale(0.985);
}

body.ios-ui .button.danger {
  border: 1px solid rgba(var(--bad-rgb), 0.28);
  background: rgba(var(--bad-rgb), 0.1);
  color: var(--bad);
}

body.ios-ui .button.danger:hover:not(:disabled) {
  border-color: transparent;
  background: var(--bad);
  color: #0d0f12;
  box-shadow: 0 8px 18px rgba(var(--bad-rgb), 0.28);
}

body.ios-ui .summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
  margin-top: 20px;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  overflow: visible;
}

body.ios-ui .metric {
  min-height: 102px;
  padding: 18px 20px;
  border: 1px solid var(--ios-separator);
  border-radius: var(--radius-lg);
  background:
    linear-gradient(160deg, rgba(var(--accent-rgb), 0.08), transparent 46%),
    var(--ios-card);
  box-shadow: var(--ios-shadow);
  overflow: hidden;
}

body.ios-ui .metric::before {
  display: block;
  opacity: 0;
  background:
    radial-gradient(120% 90% at 0% 0%, rgba(var(--accent-rgb), 0.16), transparent 55%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.03), transparent 60%);
}

body.ios-ui .metric-action::after {
  display: none;
}

body.ios-ui .metric:hover {
  border-color: rgba(var(--accent-rgb), 0.3);
  background:
    linear-gradient(160deg, rgba(var(--accent-rgb), 0.12), transparent 48%),
    var(--ios-surface-elevated);
  box-shadow: var(--ios-shadow-elevated);
  transform: translateY(-2px);
}

body.ios-ui .metric:hover::before {
  opacity: 1;
}

body.ios-ui .metric span,
body.ios-ui .stat span,
body.ios-ui .reward-code-label {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}

body.ios-ui .metric strong {
  margin-top: 10px;
  background: var(--value-gradient);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  font-size: 30px;
  font-weight: 800;
  letter-spacing: -0.02em;
}

body.ios-ui .notice,
body.ios-ui .log-actions,
body.ios-ui .cache-actions {
  border: 1px solid var(--ios-separator);
  border-radius: var(--radius-md);
  background: color-mix(in srgb, var(--surface-solid) 88%, transparent);
  box-shadow: var(--ios-shadow);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
}

body.ios-ui .notice-slot {
  position: sticky;
  top: 12px;
  z-index: 110;
}

body.ios-ui .notice {
  padding: 12px 16px;
}

body.ios-ui .accounts {
  gap: 18px;
}

body.ios-ui .account,
body.ios-ui .data-panel {
  border: 1px solid var(--ios-separator);
  border-radius: var(--radius-lg);
  background: var(--ios-card);
  box-shadow: var(--ios-shadow);
}

body.ios-ui .account {
  border-color: var(--ios-separator-soft);
  background:
    linear-gradient(90deg, rgba(var(--accent-rgb), 0.14), transparent 28%) 0 0 / 100% 1px no-repeat,
    var(--ios-card);
  overflow: clip;
}

body.ios-ui .account:hover {
  border-color: rgba(var(--accent-rgb), 0.28);
  background:
    linear-gradient(90deg, rgba(var(--accent-rgb), 0.22), transparent 34%) 0 0 / 100% 1px no-repeat,
    var(--ios-surface-elevated);
  box-shadow: var(--ios-shadow-elevated);
  transform: translateY(-2px);
}

body.ios-ui .account-head,
body.ios-ui .account-grid,
body.ios-ui .account-section + .account-section,
body.ios-ui .account-section-body,
body.ios-ui .detail-head,
body.ios-ui .detail-foot,
body.ios-ui .claim-detail-summary {
  border-color: var(--ios-separator-soft);
}

body.ios-ui .account-head {
  gap: 18px;
  padding: 20px 22px 16px;
}

body.ios-ui .account-head::before {
  display: block;
  left: 20px;
  width: 48px;
  height: 2px;
  opacity: 0.9;
}

body.ios-ui .account-index {
  min-width: 46px;
  height: 24px;
  border: 1px solid rgba(var(--accent-rgb), 0.22);
  border-radius: var(--radius-pill);
  background: rgba(var(--accent-rgb), 0.1);
  color: var(--accent);
  font-size: 11px;
  letter-spacing: 0.04em;
}

body.ios-ui .account-name {
  font-size: 17px;
  font-weight: 750;
}

body.ios-ui .account-copy:hover,
body.ios-ui .account-copy:focus-visible {
  color: var(--accent);
  text-shadow: 0 0 16px rgba(var(--accent-rgb), 0.2);
}

body.ios-ui .account-note-input {
  height: 32px;
  padding: 0 10px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: var(--ios-control);
  color: var(--text);
  line-height: 32px;
}

body.ios-ui .account-note-input:hover,
body.ios-ui .account-note-input:focus {
  border-color: rgba(var(--accent-rgb), 0.28);
  background: var(--ios-highlight);
  box-shadow: 0 0 0 3px rgba(var(--ios-blue-rgb), 0.14);
}

body.ios-ui .status,
body.ios-ui .pending-task-count,
body.ios-ui .claim-detail-chip,
body.ios-ui .claim-detail-status {
  border: 1px solid transparent;
  font-weight: 700;
}

body.ios-ui .status.ok,
body.ios-ui .pending-task-count.no-pending,
body.ios-ui .claim-detail-chip.is-success,
body.ios-ui .claim-detail-item.is-success .claim-detail-status {
  border-color: rgba(76, 217, 100, 0.18);
  background: var(--ok-soft);
  color: var(--ok);
}

body.ios-ui .status.failed,
body.ios-ui .pending-task-count.unavailable,
body.ios-ui .claim-detail-chip.is-failed,
body.ios-ui .claim-detail-item.is-failed .claim-detail-status {
  border-color: rgba(var(--bad-rgb), 0.2);
  background: var(--bad-soft);
  color: var(--bad);
}

body.ios-ui .account-grid {
  background: var(--ios-inset);
}

body.ios-ui .data-panel,
body.ios-ui .data-panel th,
body.ios-ui .reward-preview {
  background: transparent;
}

body.ios-ui .stat {
  min-height: 92px;
  padding: 16px 20px;
  border-right-color: var(--ios-separator-soft);
}

body.ios-ui .stat strong {
  margin-top: 6px;
  font-size: 26px;
  font-weight: 750;
  color: var(--soft);
}

body.ios-ui .account-section > summary {
  min-height: 50px;
  padding: 0 20px;
  background: transparent;
  font-size: 13.5px;
  font-weight: 700;
}

body.ios-ui .account-section > summary::after {
  margin-left: 3px;
  color: var(--accent);
  font-size: 18px;
}

body.ios-ui .tasks th,
body.ios-ui .tasks td,
body.ios-ui .data-panel th,
body.ios-ui .data-panel td {
  border-bottom-color: var(--ios-separator-soft);
}

body.ios-ui .tasks th,
body.ios-ui .data-panel th {
  color: var(--muted);
  font-size: 11px;
  font-weight: 750;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

body.ios-ui .tasks tbody tr:hover,
body.ios-ui .data-panel tbody tr:hover {
  background: var(--ios-highlight);
}

body.ios-ui .received-tasks summary,
body.ios-ui .reward-history summary {
  border-radius: var(--radius-sm);
  font-weight: 700;
}

body.ios-ui .received-tasks summary::before,
body.ios-ui .reward-history summary::before {
  display: block;
}

body.ios-ui .data-panel::after {
  display: block;
}

body.ios-ui .received-tasks summary::after,
body.ios-ui .reward-history summary::after {
  border: 1px solid var(--ios-separator-soft);
  background: var(--ios-control);
  box-shadow: none;
}

body.ios-ui .reward-dialog,
body.ios-ui .detail-dialog,
body.ios-ui .modal {
  border: 1px solid var(--ios-separator);
  border-radius: var(--radius-xl);
  background: var(--ios-surface-elevated);
  box-shadow: var(--shadow-float);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
}

body.ios-ui .reward-preview {
  border-right: 1px solid var(--ios-separator-soft);
  background:
    linear-gradient(145deg, rgba(var(--accent-rgb), 0.08), transparent 42%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.03), transparent);
}

body.ios-ui #rewardImagePreview {
  border-radius: var(--radius-md);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.28);
}

body.ios-ui .reward-detail,
body.ios-ui .detail-head {
  padding: 24px;
}

body.ios-ui .reward-detail h2,
body.ios-ui .detail-head h2,
body.ios-ui .modal-title {
  font-weight: 800;
  letter-spacing: -0.01em;
}

body.ios-ui .reward-code-value,
body.ios-ui .pending-task-account,
body.ios-ui .claim-detail-item {
  border: 1px solid var(--ios-separator-soft);
  border-radius: var(--radius-md);
  background: var(--ios-inset);
}

body.ios-ui .pending-task-account:hover {
  border-color: rgba(var(--accent-rgb), 0.24);
  background: color-mix(in srgb, var(--ios-inset) 80%, rgba(var(--accent-rgb), 0.08));
  transform: translateY(-1px);
}

body.ios-ui .reward-close,
body.ios-ui .detail-close {
  width: 34px;
  min-width: 34px;
  min-height: 34px;
  border: 1px solid var(--ios-separator-soft);
  border-radius: var(--radius-pill);
  background: var(--ios-control);
  color: var(--muted);
}

body.ios-ui .detail-close:hover,
body.ios-ui .reward-close:hover {
  border-color: rgba(var(--accent-rgb), 0.35);
  background: rgba(var(--accent-rgb), 0.12);
  color: var(--text);
}

body.ios-ui .modal-backdrop,
body.ios-ui .detail-backdrop,
body.ios-ui .reward-backdrop {
  background: rgba(0, 0, 0, 0.58);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

body.ios-ui .login-view {
  background:
    radial-gradient(520px 280px at 18% 18%, rgba(var(--accent-rgb), 0.16), transparent 68%),
    radial-gradient(420px 260px at 86% 78%, rgba(var(--accent-rgb), 0.1), transparent 72%),
    var(--body-bg);
}

body.ios-ui .login-form {
  border: 1px solid var(--ios-separator);
  border-radius: var(--radius-xl);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.04), transparent 40%),
    var(--ios-surface-elevated);
  box-shadow: var(--shadow-float);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
}

body.ios-ui .login-form::before,
body.ios-ui .login-form::after,
body.ios-ui .login-input-wrapper::after,
body.ios-ui .login-submit::after {
  display: block;
}

body.ios-ui .login-brand {
  color: var(--accent);
  letter-spacing: 0.12em;
}

body.ios-ui .login-form h1 {
  background: var(--heading-gradient);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

body.ios-ui .login-input-wrapper {
  border: 0;
  background: transparent;
}

body.ios-ui .login-form input {
  border: 1px solid var(--ios-separator);
  border-radius: var(--radius-sm);
  background: var(--ios-control);
}

body.ios-ui .login-form input:focus {
  border-color: rgba(var(--accent-rgb), 0.45);
  box-shadow: 0 0 0 3px rgba(var(--ios-blue-rgb), 0.18);
}

body.ios-ui .login-submit {
  border-radius: var(--radius-sm);
  background: var(--accent-gradient);
  color: var(--accent-fg);
  box-shadow: 0 10px 24px rgba(var(--accent-rgb), 0.24);
}

body.ios-ui .title-block {
  align-self: center;
}

body.ios-ui .title-block h1 {
  font-size: 32px;
  line-height: 1.1;
}

body.ios-ui .theme-trigger:hover,
body.ios-ui .theme-trigger:focus-visible,
body.ios-ui .user-trigger:hover,
body.ios-ui .user-trigger:focus-visible {
  border-color: rgba(var(--accent-rgb), 0.35);
  background: var(--ios-highlight);
  box-shadow: 0 0 0 3px rgba(var(--ios-blue-rgb), 0.12);
}

body.ios-ui .metric:first-child,
body.ios-ui .metric:last-child {
  border-radius: var(--radius-lg);
}

body.ios-ui .metric strong,
body.ios-ui .stat strong,
body.ios-ui .log-time,
body.ios-ui .log-duration {
  font-variant-numeric: tabular-nums;
}

body.ios-ui .metric.metric-action {
  padding: 0;
}

body.ios-ui .metric-button {
  padding: 18px 20px;
  border-radius: inherit;
}

body.ios-ui .metric-button-action {
  color: var(--accent);
  font-weight: 700;
  opacity: 0.9;
}

body.ios-ui .account-main {
  gap: 10px;
}

body.ios-ui .account-title {
  gap: 10px;
}

body.ios-ui .account-note-row {
  gap: 8px;
}

body.ios-ui .account-note-label,
body.ios-ui .account-note-state {
  font-size: 12px;
  font-weight: 650;
}

body.ios-ui .status {
  min-height: 26px;
  padding: 0 11px;
  font-size: 12px;
  border-radius: var(--radius-pill);
}

body.ios-ui .stat:first-child {
  padding-left: 20px;
}

body.ios-ui .stat:last-child {
  padding-right: 20px;
}

body.ios-ui .lottery-details summary {
  gap: 2px;
}

body.ios-ui .lottery-details .lottery-label::after {
  color: var(--accent);
  font-size: 15px;
}

body.ios-ui .lottery-panel {
  margin-top: 8px;
  padding-top: 8px;
  border-top-color: var(--ios-separator-soft);
}

body.ios-ui .account-sections {
  background: transparent;
}

body.ios-ui .account-section > summary:hover,
body.ios-ui .account-section > summary:focus-visible {
  background: var(--ios-highlight);
}

body.ios-ui .account-section-meta {
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}

body.ios-ui .account-section-body {
  background: var(--ios-inset);
}

body.ios-ui .tasks th,
body.ios-ui .tasks td {
  padding: 12px 20px;
}

body.ios-ui .tasks th {
  background: color-mix(in srgb, var(--ios-inset) 86%, transparent);
}

body.ios-ui .tasks tbody tr:hover {
  background: var(--ios-highlight);
}

body.ios-ui .task-action,
body.ios-ui .task-bulk-action,
body.ios-ui .draw-action {
  min-height: 32px;
  border-radius: var(--radius-pill);
  border-color: rgba(var(--accent-rgb), 0.22);
  background: rgba(var(--accent-rgb), 0.1);
  color: var(--accent);
  font-size: 12px;
}

body.ios-ui .task-action:hover:not(:disabled),
body.ios-ui .task-bulk-action:hover:not(:disabled),
body.ios-ui .draw-action:hover:not(:disabled) {
  border-color: rgba(var(--accent-rgb), 0.4);
  background: rgba(var(--accent-rgb), 0.16);
  color: var(--accent);
}

body.ios-ui .reward-section {
  padding: 18px 20px 20px;
  background: var(--ios-inset);
}

body.ios-ui .reward-day + .reward-day,
body.ios-ui .reward-history {
  border-top-color: var(--ios-separator-soft);
}

body.ios-ui .reward-item {
  min-height: 62px;
  border: 1px solid var(--ios-separator-soft);
  border-radius: var(--radius-md);
  background: color-mix(in srgb, var(--ios-card) 88%, transparent);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

body.ios-ui .reward-item:hover:not(:disabled) {
  border-color: rgba(var(--accent-rgb), 0.28);
  background: var(--ios-highlight);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.14);
  transform: translateY(-1px);
}

body.ios-ui .reward-thumb,
body.ios-ui .reward-thumb-placeholder {
  border: 1px solid var(--ios-separator-soft);
  border-radius: 10px;
  background: var(--ios-control);
}

body.ios-ui .log-actions,
body.ios-ui .cache-actions {
  padding: 12px 14px;
}

body.ios-ui .select-shell select,
body.ios-ui .select-trigger {
  min-height: 40px;
  border: 1px solid var(--ios-separator-soft);
  border-radius: var(--radius-sm);
  background: var(--ios-control);
  color: var(--text);
  box-shadow: none;
}

body.ios-ui .select-shell select:focus,
body.ios-ui .select-shell.open .select-trigger {
  border-color: rgba(var(--accent-rgb), 0.4);
  background: var(--ios-control);
  box-shadow: 0 0 0 3px rgba(var(--ios-blue-rgb), 0.14);
}

body.ios-ui .select-menu {
  border: 1px solid var(--ios-separator);
  border-radius: var(--radius-md);
  background: var(--ios-surface-elevated);
  box-shadow: var(--ios-shadow-elevated);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
}

body.ios-ui .select-option {
  border-radius: 8px;
}

body.ios-ui .select-option.is-selected {
  background: rgba(var(--accent-rgb), 0.16);
  color: var(--accent);
}

body.ios-ui .data-panel {
  background: var(--ios-card);
}

body.ios-ui .data-panel th {
  padding-top: 12px;
  padding-bottom: 12px;
  background: var(--ios-inset);
}

body.ios-ui .data-panel td {
  padding-top: 12px;
  padding-bottom: 12px;
}

body.ios-ui .data-panel tbody tr:hover,
body.ios-ui .data-panel tbody tr.log-row-selected,
body.ios-ui .data-panel tbody tr.cache-row-selected {
  background: var(--ios-highlight);
  box-shadow: inset 3px 0 0 var(--accent);
}

body.ios-ui input[type="checkbox"] {
  width: 18px;
  height: 18px;
  border: 1px solid var(--ios-separator);
  border-radius: 6px;
  background: var(--ios-control);
}

body.ios-ui input[type="checkbox"]:checked {
  border-color: var(--accent);
  background: var(--accent);
}

body.ios-ui .badge {
  min-height: 24px;
  border: 1px solid transparent;
  border-radius: var(--radius-pill);
  font-size: 11px;
  font-weight: 700;
}

body.ios-ui .data-panel tbody tr:hover .badge {
  filter: none;
  transform: none;
}

body.ios-ui .pending-task-account,
body.ios-ui .claim-detail-item,
body.ios-ui .reward-code-value {
  background: var(--ios-inset);
}

body.ios-ui .pending-task-account {
  padding: 16px;
}

body.ios-ui .claim-detail-item {
  padding: 16px;
}

body.ios-ui .modal-actions {
  padding-top: 4px;
}

body.ios-ui .pending-task-count.has-pending {
  border-color: rgba(var(--accent-rgb), 0.24);
  background: var(--accent-soft);
  color: var(--accent);
}

@media (max-width: 980px) {
  body.ios-ui .topbar {
    margin-left: calc(-16px - env(safe-area-inset-left, 0px));
    margin-right: calc(-16px - env(safe-area-inset-right, 0px));
    padding-left: calc(16px + env(safe-area-inset-left, 0px));
    padding-right: calc(16px + env(safe-area-inset-right, 0px));
  }

  body.ios-ui .topbar::after {
    left: calc(16px + env(safe-area-inset-left, 0px));
  }

  body.ios-ui .summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }

  body.ios-ui .metric,
  body.ios-ui .metric:first-child,
  body.ios-ui .metric:nth-child(2),
  body.ios-ui .metric:nth-last-child(2),
  body.ios-ui .metric:last-child {
    border-radius: var(--radius-md);
  }
}

@media (max-width: 768px) {
  body.ios-ui .app {
    padding:
      calc(16px + env(safe-area-inset-top, 0px))
      calc(14px + env(safe-area-inset-right, 0px))
      calc(36px + env(safe-area-inset-bottom, 0px))
      calc(14px + env(safe-area-inset-left, 0px));
  }

  body.ios-ui .topbar {
    position: relative;
    margin:
      calc(-16px - env(safe-area-inset-top, 0px))
      calc(-14px - env(safe-area-inset-right, 0px))
      0
      calc(-14px - env(safe-area-inset-left, 0px));
    padding:
      calc(16px + env(safe-area-inset-top, 0px))
      calc(14px + env(safe-area-inset-right, 0px))
      16px
      calc(14px + env(safe-area-inset-left, 0px));
  }

  body.ios-ui .topbar-side,
  body.ios-ui .topbar-actions {
    width: 100%;
  }

  body.ios-ui .summary {
    gap: 10px;
  }

  body.ios-ui .data-panel {
    border-radius: var(--radius-md);
  }

  body.ios-ui .reward-preview {
    border-right: 0;
    border-bottom: 1px solid var(--ios-separator-soft);
  }

  body.ios-ui .stat:last-child {
    padding-right: 18px;
  }
}

@media (max-width: 520px) {
  body.ios-ui .topbar {
    min-height: auto;
  }

  body.ios-ui .metric {
    padding: 14px 16px;
    min-height: 90px;
  }

  body.ios-ui .metric strong {
    font-size: 26px;
  }

  body.ios-ui .metric-button {
    grid-template-columns: minmax(0, 1fr) auto;
    column-gap: 8px;
    padding: 14px 16px;
  }

  body.ios-ui .metric-button-label {
    grid-column: 1 / -1;
    font-size: 11px;
    white-space: nowrap;
  }

  body.ios-ui .metric-button strong {
    grid-column: 1;
    grid-row: 2;
  }

  body.ios-ui .metric-button-action {
    grid-column: 2;
    grid-row: 2;
    align-self: center;
    justify-self: end;
  }

  body.ios-ui .metric-button-action::after {
    margin-left: 2px;
  }

  body.ios-ui .title-block h1 {
    font-size: 28px;
  }

  body.ios-ui .account {
    border-radius: var(--radius-lg);
  }

  body.ios-ui .detail-dialog,
  body.ios-ui .reward-dialog {
    width: calc(100vw - 24px);
    max-height: calc(100svh - 24px);
    border-radius: var(--radius-xl);
  }

  body.ios-ui .account-head,
  body.ios-ui .stat,
  body.ios-ui .account-section > summary,
  body.ios-ui .reward-section,
  body.ios-ui .tasks th,
  body.ios-ui .tasks td {
    padding-left: 16px;
    padding-right: 16px;
  }
}
