:root {
  --surface: #ffffff;
  --text-main: #1f2937;
  --text-subtle: #6b7280;
  --line: #d1d5db;
  --line-strong: #c4c9d1;
  --yellow: #ffe100;
  --tab-active: #111827;
  --bg-color: #f1f3f7;
  --bg-layer:
    radial-gradient(circle at 16% 12%, rgba(255, 255, 255, 0.92) 0, rgba(255, 255, 255, 0) 36%),
    radial-gradient(circle at 84% 4%, rgba(255, 255, 255, 0.72) 0, rgba(255, 255, 255, 0) 33%),
    linear-gradient(165deg, #f8f9fc 0%, #f1f3f7 48%, #e7ebf2 100%);
  --grain-layer:
    repeating-linear-gradient(
      0deg,
      rgba(120, 131, 148, 0.14) 0,
      rgba(120, 131, 148, 0.14) 1px,
      transparent 1px,
      transparent 15px
    ),
    repeating-linear-gradient(
      90deg,
      rgba(120, 131, 148, 0.1) 0,
      rgba(120, 131, 148, 0.1) 1px,
      transparent 1px,
      transparent 17px
    );
  --vignette-layer: radial-gradient(circle at center, rgba(255, 255, 255, 0) 58%, rgba(166, 176, 194, 0.16) 100%);
  --grain-opacity: 0.24;
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
}

body {
  margin: 0;
  color: var(--text-main);
  font-family: "PingFang SC", "Microsoft YaHei", "Segoe UI", Arial, sans-serif;
  background-color: var(--bg-color);
  background-image: var(--bg-layer);
  background-attachment: fixed;
  position: relative;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: var(--grain-opacity);
  background-image: var(--grain-layer);
}

body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background: var(--vignette-layer);
}

body[data-bg-theme="mist-silver"] {
  --bg-color: #eff2f7;
  --bg-layer:
    radial-gradient(circle at 18% 10%, rgba(255, 255, 255, 0.95) 0, rgba(255, 255, 255, 0) 38%),
    radial-gradient(circle at 86% 7%, rgba(255, 255, 255, 0.72) 0, rgba(255, 255, 255, 0) 36%),
    linear-gradient(160deg, #fafbfe 0%, #eef2f8 52%, #e5eaf2 100%);
  --grain-layer:
    repeating-linear-gradient(0deg, rgba(115, 126, 144, 0.13) 0, rgba(115, 126, 144, 0.13) 1px, transparent 1px, transparent 16px),
    repeating-linear-gradient(90deg, rgba(115, 126, 144, 0.08) 0, rgba(115, 126, 144, 0.08) 1px, transparent 1px, transparent 17px);
  --vignette-layer: radial-gradient(circle at center, rgba(255, 255, 255, 0) 58%, rgba(148, 160, 181, 0.14) 100%);
  --grain-opacity: 0.21;
}

body[data-bg-theme="nordic-frost"] {
  --bg-color: #ebf0f6;
  --bg-layer:
    radial-gradient(circle at 14% 8%, rgba(255, 255, 255, 0.88) 0, rgba(255, 255, 255, 0) 35%),
    radial-gradient(circle at 80% 12%, rgba(223, 236, 250, 0.64) 0, rgba(223, 236, 250, 0) 34%),
    linear-gradient(165deg, #f4f8fd 0%, #eaf0f8 50%, #dfe7f1 100%);
  --grain-layer:
    repeating-linear-gradient(0deg, rgba(114, 130, 153, 0.12) 0, rgba(114, 130, 153, 0.12) 1px, transparent 1px, transparent 14px),
    repeating-linear-gradient(90deg, rgba(114, 130, 153, 0.08) 0, rgba(114, 130, 153, 0.08) 1px, transparent 1px, transparent 16px);
  --vignette-layer: radial-gradient(circle at center, rgba(255, 255, 255, 0) 60%, rgba(128, 150, 178, 0.15) 100%);
  --grain-opacity: 0.22;
}

body[data-bg-theme="linen-ivory"] {
  --bg-color: #f4f1eb;
  --bg-layer:
    radial-gradient(circle at 18% 14%, rgba(255, 255, 255, 0.86) 0, rgba(255, 255, 255, 0) 33%),
    radial-gradient(circle at 82% 8%, rgba(255, 249, 236, 0.7) 0, rgba(255, 249, 236, 0) 34%),
    linear-gradient(162deg, #f9f6ef 0%, #f3efe6 48%, #e9e2d6 100%);
  --grain-layer:
    repeating-linear-gradient(0deg, rgba(154, 137, 112, 0.1) 0, rgba(154, 137, 112, 0.1) 1px, transparent 1px, transparent 13px),
    repeating-linear-gradient(90deg, rgba(154, 137, 112, 0.08) 0, rgba(154, 137, 112, 0.08) 1px, transparent 1px, transparent 15px);
  --vignette-layer: radial-gradient(circle at center, rgba(255, 255, 255, 0) 60%, rgba(148, 130, 105, 0.13) 100%);
  --grain-opacity: 0.2;
}

body[data-bg-theme="ink-sand"] {
  --bg-color: #ede8e1;
  --bg-layer:
    radial-gradient(circle at 16% 10%, rgba(255, 255, 255, 0.68) 0, rgba(255, 255, 255, 0) 35%),
    radial-gradient(circle at 84% 10%, rgba(210, 201, 190, 0.48) 0, rgba(210, 201, 190, 0) 33%),
    linear-gradient(168deg, #f3eee7 0%, #ece6de 52%, #ddd3c8 100%);
  --grain-layer:
    repeating-linear-gradient(0deg, rgba(112, 99, 85, 0.12) 0, rgba(112, 99, 85, 0.12) 1px, transparent 1px, transparent 12px),
    repeating-linear-gradient(90deg, rgba(112, 99, 85, 0.09) 0, rgba(112, 99, 85, 0.09) 1px, transparent 1px, transparent 14px);
  --vignette-layer: radial-gradient(circle at center, rgba(255, 255, 255, 0) 57%, rgba(98, 84, 71, 0.18) 100%);
  --grain-opacity: 0.24;
}

body[data-bg-theme="slate-luxe"] {
  --bg-color: #eceff4;
  --bg-layer:
    radial-gradient(circle at 20% 8%, rgba(255, 255, 255, 0.82) 0, rgba(255, 255, 255, 0) 37%),
    radial-gradient(circle at 76% 12%, rgba(227, 232, 240, 0.66) 0, rgba(227, 232, 240, 0) 34%),
    linear-gradient(166deg, #f3f6fb 0%, #e8edf5 50%, #dbe2ec 100%);
  --grain-layer:
    repeating-linear-gradient(0deg, rgba(99, 112, 133, 0.14) 0, rgba(99, 112, 133, 0.14) 1px, transparent 1px, transparent 15px),
    repeating-linear-gradient(90deg, rgba(99, 112, 133, 0.09) 0, rgba(99, 112, 133, 0.09) 1px, transparent 1px, transparent 18px);
  --vignette-layer: radial-gradient(circle at center, rgba(255, 255, 255, 0) 60%, rgba(103, 117, 139, 0.16) 100%);
  --grain-opacity: 0.24;
}

body[data-bg-theme="dawn-blush"] {
  --bg-color: #f3edf0;
  --bg-layer:
    radial-gradient(circle at 14% 8%, rgba(255, 255, 255, 0.9) 0, rgba(255, 255, 255, 0) 34%),
    radial-gradient(circle at 82% 14%, rgba(244, 222, 232, 0.64) 0, rgba(244, 222, 232, 0) 32%),
    linear-gradient(164deg, #faf4f7 0%, #f2e8ee 50%, #e5d7df 100%);
  --grain-layer:
    repeating-linear-gradient(0deg, rgba(140, 114, 129, 0.12) 0, rgba(140, 114, 129, 0.12) 1px, transparent 1px, transparent 14px),
    repeating-linear-gradient(90deg, rgba(140, 114, 129, 0.08) 0, rgba(140, 114, 129, 0.08) 1px, transparent 1px, transparent 16px);
  --vignette-layer: radial-gradient(circle at center, rgba(255, 255, 255, 0) 62%, rgba(145, 111, 128, 0.14) 100%);
  --grain-opacity: 0.2;
}

body[data-bg-theme="aqua-steel"] {
  --bg-color: #e9eff2;
  --bg-layer:
    radial-gradient(circle at 16% 8%, rgba(245, 251, 252, 0.88) 0, rgba(245, 251, 252, 0) 36%),
    radial-gradient(circle at 86% 10%, rgba(208, 228, 235, 0.66) 0, rgba(208, 228, 235, 0) 34%),
    linear-gradient(164deg, #f1f7f8 0%, #e5eef2 52%, #d6e1e7 100%);
  --grain-layer:
    repeating-linear-gradient(0deg, rgba(88, 123, 137, 0.13) 0, rgba(88, 123, 137, 0.13) 1px, transparent 1px, transparent 15px),
    repeating-linear-gradient(90deg, rgba(88, 123, 137, 0.09) 0, rgba(88, 123, 137, 0.09) 1px, transparent 1px, transparent 17px);
  --vignette-layer: radial-gradient(circle at center, rgba(255, 255, 255, 0) 60%, rgba(74, 109, 122, 0.16) 100%);
  --grain-opacity: 0.21;
}

body[data-bg-theme="sage-matte"] {
  --bg-color: #edf2ed;
  --bg-layer:
    radial-gradient(circle at 17% 9%, rgba(250, 253, 250, 0.88) 0, rgba(250, 253, 250, 0) 36%),
    radial-gradient(circle at 82% 10%, rgba(218, 229, 218, 0.64) 0, rgba(218, 229, 218, 0) 34%),
    linear-gradient(165deg, #f4f8f4 0%, #e8efe8 52%, #dae4da 100%);
  --grain-layer:
    repeating-linear-gradient(0deg, rgba(101, 123, 103, 0.12) 0, rgba(101, 123, 103, 0.12) 1px, transparent 1px, transparent 14px),
    repeating-linear-gradient(90deg, rgba(101, 123, 103, 0.08) 0, rgba(101, 123, 103, 0.08) 1px, transparent 1px, transparent 17px);
  --vignette-layer: radial-gradient(circle at center, rgba(255, 255, 255, 0) 60%, rgba(96, 116, 98, 0.14) 100%);
  --grain-opacity: 0.2;
}

body[data-bg-theme="moon-pearl"] {
  --bg-color: #f2f2f6;
  --bg-layer:
    radial-gradient(circle at 15% 12%, rgba(255, 255, 255, 0.9) 0, rgba(255, 255, 255, 0) 35%),
    radial-gradient(circle at 85% 8%, rgba(233, 233, 245, 0.64) 0, rgba(233, 233, 245, 0) 33%),
    linear-gradient(163deg, #fafafd 0%, #f0f1f7 50%, #e3e5ef 100%);
  --grain-layer:
    repeating-linear-gradient(0deg, rgba(128, 129, 154, 0.12) 0, rgba(128, 129, 154, 0.12) 1px, transparent 1px, transparent 14px),
    repeating-linear-gradient(90deg, rgba(128, 129, 154, 0.08) 0, rgba(128, 129, 154, 0.08) 1px, transparent 1px, transparent 17px);
  --vignette-layer: radial-gradient(circle at center, rgba(255, 255, 255, 0) 60%, rgba(122, 124, 150, 0.14) 100%);
  --grain-opacity: 0.2;
}

body[data-bg-theme="graphite-soft"] {
  --bg-color: #e8ecf2;
  --bg-layer:
    radial-gradient(circle at 14% 10%, rgba(247, 249, 252, 0.8) 0, rgba(247, 249, 252, 0) 36%),
    radial-gradient(circle at 86% 6%, rgba(214, 223, 236, 0.62) 0, rgba(214, 223, 236, 0) 33%),
    linear-gradient(166deg, #f0f4f9 0%, #e4eaf2 52%, #d3dce8 100%);
  --grain-layer:
    repeating-linear-gradient(0deg, rgba(86, 100, 123, 0.14) 0, rgba(86, 100, 123, 0.14) 1px, transparent 1px, transparent 14px),
    repeating-linear-gradient(90deg, rgba(86, 100, 123, 0.1) 0, rgba(86, 100, 123, 0.1) 1px, transparent 1px, transparent 18px);
  --vignette-layer: radial-gradient(circle at center, rgba(255, 255, 255, 0) 58%, rgba(80, 93, 113, 0.18) 100%);
  --grain-opacity: 0.24;
}

body[data-bg-theme="velvet-charcoal"] {
  --bg-color: #e3e7ee;
  --bg-layer:
    radial-gradient(circle at 18% 9%, rgba(246, 249, 255, 0.82) 0, rgba(246, 249, 255, 0) 34%),
    radial-gradient(circle at 86% 8%, rgba(195, 205, 221, 0.62) 0, rgba(195, 205, 221, 0) 35%),
    linear-gradient(164deg, #eef3fb 0%, #dce3ee 52%, #c8d2e0 100%);
  --grain-layer:
    repeating-linear-gradient(15deg, rgba(63, 78, 102, 0.14) 0, rgba(63, 78, 102, 0.14) 1px, transparent 1px, transparent 12px),
    repeating-linear-gradient(-15deg, rgba(63, 78, 102, 0.1) 0, rgba(63, 78, 102, 0.1) 1px, transparent 1px, transparent 14px);
  --vignette-layer: radial-gradient(circle at center, rgba(255, 255, 255, 0) 60%, rgba(56, 71, 95, 0.2) 100%);
  --grain-opacity: 0.22;
}

body[data-bg-theme="porcelain-sky"] {
  --bg-color: #e7eff7;
  --bg-layer:
    radial-gradient(circle at 20% 10%, rgba(255, 255, 255, 0.9) 0, rgba(255, 255, 255, 0) 35%),
    radial-gradient(circle at 78% 12%, rgba(214, 232, 250, 0.64) 0, rgba(214, 232, 250, 0) 33%),
    linear-gradient(162deg, #f1f8ff 0%, #e2eef9 50%, #d2e2f1 100%);
  --grain-layer:
    repeating-radial-gradient(circle at 0 0, rgba(93, 125, 160, 0.14) 0, rgba(93, 125, 160, 0.14) 1px, transparent 1px, transparent 11px),
    repeating-radial-gradient(circle at 8px 8px, rgba(93, 125, 160, 0.09) 0, rgba(93, 125, 160, 0.09) 1px, transparent 1px, transparent 13px);
  --vignette-layer: radial-gradient(circle at center, rgba(255, 255, 255, 0) 62%, rgba(86, 118, 151, 0.14) 100%);
  --grain-opacity: 0.18;
}

body[data-bg-theme="silk-lavender"] {
  --bg-color: #ece9f4;
  --bg-layer:
    radial-gradient(circle at 14% 9%, rgba(255, 255, 255, 0.86) 0, rgba(255, 255, 255, 0) 36%),
    radial-gradient(circle at 84% 9%, rgba(224, 214, 241, 0.66) 0, rgba(224, 214, 241, 0) 34%),
    linear-gradient(165deg, #f5f1fb 0%, #e9e3f3 52%, #d9d0ea 100%);
  --grain-layer:
    repeating-linear-gradient(60deg, rgba(119, 105, 146, 0.12) 0, rgba(119, 105, 146, 0.12) 1px, transparent 1px, transparent 16px),
    repeating-linear-gradient(120deg, rgba(119, 105, 146, 0.08) 0, rgba(119, 105, 146, 0.08) 1px, transparent 1px, transparent 13px);
  --vignette-layer: radial-gradient(circle at center, rgba(255, 255, 255, 0) 61%, rgba(111, 96, 140, 0.15) 100%);
  --grain-opacity: 0.2;
}

body[data-bg-theme="alpine-paper"] {
  --bg-color: #eff2f1;
  --bg-layer:
    radial-gradient(circle at 17% 12%, rgba(255, 255, 255, 0.84) 0, rgba(255, 255, 255, 0) 36%),
    radial-gradient(circle at 82% 8%, rgba(226, 234, 230, 0.6) 0, rgba(226, 234, 230, 0) 32%),
    linear-gradient(167deg, #f7faf8 0%, #ecf1ef 52%, #dde6e1 100%);
  --grain-layer:
    repeating-linear-gradient(0deg, rgba(112, 126, 117, 0.11) 0, rgba(112, 126, 117, 0.11) 1px, transparent 1px, transparent 9px),
    repeating-linear-gradient(90deg, rgba(112, 126, 117, 0.06) 0, rgba(112, 126, 117, 0.06) 1px, transparent 1px, transparent 22px);
  --vignette-layer: radial-gradient(circle at center, rgba(255, 255, 255, 0) 60%, rgba(103, 119, 109, 0.13) 100%);
  --grain-opacity: 0.2;
}

body[data-bg-theme="copper-mist"] {
  --bg-color: #efe8e2;
  --bg-layer:
    radial-gradient(circle at 15% 10%, rgba(255, 255, 255, 0.82) 0, rgba(255, 255, 255, 0) 34%),
    radial-gradient(circle at 85% 9%, rgba(232, 209, 190, 0.62) 0, rgba(232, 209, 190, 0) 33%),
    linear-gradient(166deg, #f7eee8 0%, #ecdfd4 52%, #ddcabb 100%);
  --grain-layer:
    repeating-linear-gradient(-25deg, rgba(126, 95, 74, 0.14) 0, rgba(126, 95, 74, 0.14) 1px, transparent 1px, transparent 13px),
    repeating-radial-gradient(circle at 12px 12px, rgba(126, 95, 74, 0.09) 0, rgba(126, 95, 74, 0.09) 1px, transparent 1px, transparent 18px);
  --vignette-layer: radial-gradient(circle at center, rgba(255, 255, 255, 0) 59%, rgba(108, 78, 58, 0.16) 100%);
  --grain-opacity: 0.23;
}

body[data-bg-theme="jade-fiber"] {
  --bg-color: #e5f0ea;
  --bg-layer:
    radial-gradient(circle at 20% 8%, rgba(247, 253, 250, 0.9) 0, rgba(247, 253, 250, 0) 35%),
    radial-gradient(circle at 80% 10%, rgba(194, 223, 205, 0.64) 0, rgba(194, 223, 205, 0) 34%),
    linear-gradient(164deg, #edf8f1 0%, #dfeee4 50%, #cfe2d5 100%);
  --grain-layer:
    repeating-linear-gradient(85deg, rgba(70, 121, 92, 0.12) 0, rgba(70, 121, 92, 0.12) 1px, transparent 1px, transparent 11px),
    repeating-linear-gradient(95deg, rgba(70, 121, 92, 0.08) 0, rgba(70, 121, 92, 0.08) 1px, transparent 1px, transparent 17px);
  --vignette-layer: radial-gradient(circle at center, rgba(255, 255, 255, 0) 60%, rgba(57, 104, 79, 0.15) 100%);
  --grain-opacity: 0.19;
}

body[data-bg-theme="pearl-dust"] {
  --bg-color: #f2f1ef;
  --bg-layer:
    radial-gradient(circle at 13% 10%, rgba(255, 255, 255, 0.88) 0, rgba(255, 255, 255, 0) 36%),
    radial-gradient(circle at 87% 10%, rgba(235, 230, 223, 0.6) 0, rgba(235, 230, 223, 0) 34%),
    linear-gradient(167deg, #faf9f6 0%, #efece7 51%, #e2ddd5 100%);
  --grain-layer:
    repeating-radial-gradient(circle at 3px 3px, rgba(132, 123, 111, 0.14) 0, rgba(132, 123, 111, 0.14) 1px, transparent 1px, transparent 10px),
    repeating-radial-gradient(circle at 11px 12px, rgba(132, 123, 111, 0.09) 0, rgba(132, 123, 111, 0.09) 1px, transparent 1px, transparent 14px);
  --vignette-layer: radial-gradient(circle at center, rgba(255, 255, 255, 0) 62%, rgba(122, 113, 101, 0.13) 100%);
  --grain-opacity: 0.18;
}

body[data-bg-theme="midnight-fabric"] {
  --bg-color: #dde4ef;
  --bg-layer:
    radial-gradient(circle at 12% 8%, rgba(246, 250, 255, 0.7) 0, rgba(246, 250, 255, 0) 35%),
    radial-gradient(circle at 86% 12%, rgba(168, 185, 214, 0.66) 0, rgba(168, 185, 214, 0) 32%),
    linear-gradient(166deg, #eaf0fb 0%, #d4deee 50%, #becde4 100%);
  --grain-layer:
    repeating-linear-gradient(30deg, rgba(46, 72, 110, 0.16) 0, rgba(46, 72, 110, 0.16) 1px, transparent 1px, transparent 10px),
    repeating-linear-gradient(150deg, rgba(46, 72, 110, 0.11) 0, rgba(46, 72, 110, 0.11) 1px, transparent 1px, transparent 12px);
  --vignette-layer: radial-gradient(circle at center, rgba(255, 255, 255, 0) 58%, rgba(38, 63, 100, 0.2) 100%);
  --grain-opacity: 0.24;
}

body[data-bg-theme="cloud-canvas"] {
  --bg-color: #edf1f4;
  --bg-layer:
    radial-gradient(circle at 18% 11%, rgba(255, 255, 255, 0.92) 0, rgba(255, 255, 255, 0) 37%),
    radial-gradient(circle at 83% 10%, rgba(220, 229, 236, 0.62) 0, rgba(220, 229, 236, 0) 35%),
    linear-gradient(162deg, #f5f8fb 0%, #e8edf2 50%, #dbe3ea 100%);
  --grain-layer:
    repeating-linear-gradient(8deg, rgba(110, 123, 139, 0.11) 0, rgba(110, 123, 139, 0.11) 1px, transparent 1px, transparent 20px),
    repeating-linear-gradient(98deg, rgba(110, 123, 139, 0.08) 0, rgba(110, 123, 139, 0.08) 1px, transparent 1px, transparent 24px);
  --vignette-layer: radial-gradient(circle at center, rgba(255, 255, 255, 0) 63%, rgba(104, 119, 135, 0.12) 100%);
  --grain-opacity: 0.17;
}

body[data-bg-theme="glacier-ripple"] {
  --bg-color: #e6edf5;
  --bg-layer:
    radial-gradient(circle at 16% 10%, rgba(248, 252, 255, 0.88) 0, rgba(248, 252, 255, 0) 36%),
    radial-gradient(circle at 84% 8%, rgba(197, 217, 238, 0.62) 0, rgba(197, 217, 238, 0) 34%),
    linear-gradient(168deg, #eef6ff 0%, #dce8f5 50%, #c8d8ea 100%);
  --grain-layer:
    repeating-radial-gradient(circle at 50% 50%, rgba(79, 116, 160, 0.16) 0, rgba(79, 116, 160, 0.16) 1px, transparent 1px, transparent 18px),
    repeating-radial-gradient(circle at 60% 40%, rgba(79, 116, 160, 0.1) 0, rgba(79, 116, 160, 0.1) 1px, transparent 1px, transparent 24px);
  --vignette-layer: radial-gradient(circle at center, rgba(255, 255, 255, 0) 59%, rgba(64, 101, 144, 0.18) 100%);
  --grain-opacity: 0.16;
}

.page {
  position: relative;
  z-index: 1;
  width: min(1000px, calc(100% - 32px));
  margin: 44px auto 24px;
  padding: 2px 0;
}

.theme-switcher {
  position: relative;
  flex-shrink: 0;
  z-index: 1;
}

.theme-toggle-btn {
  position: relative;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 1px solid rgba(203, 213, 225, 0.95);
  border-radius: 12px;
  background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 2px 10px rgba(15, 23, 42, 0.06);
  transition:
    transform 0.18s cubic-bezier(0.34, 1.2, 0.64, 1),
    border-color 0.18s ease,
    box-shadow 0.18s ease,
    background 0.18s ease;
}

.theme-toggle-btn:hover {
  transform: scale(1.04);
  border-color: #cbd5e1;
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.09);
}

.theme-toggle-btn:active {
  transform: scale(0.97);
}

.theme-toggle-btn:focus-visible {
  outline: 0;
  border-color: #facc15;
  box-shadow: 0 0 0 3px rgba(250, 204, 21, 0.28);
}

.theme-switcher.is-open .theme-toggle-btn {
  border-color: rgba(250, 204, 21, 0.65);
  background: linear-gradient(180deg, #fffbeb 0%, #fffef8 100%);
  box-shadow:
    0 2px 10px rgba(15, 23, 42, 0.06),
    0 0 0 1px rgba(250, 204, 21, 0.25);
}

.theme-toggle-icon {
  font-size: 17px;
  line-height: 1;
  transform: translateY(0.5px);
  filter: saturate(1.05);
  transition: transform 0.22s cubic-bezier(0.34, 1.2, 0.64, 1);
}

.theme-switcher.is-open .theme-toggle-icon {
  transform: translateY(0.5px) rotate(-8deg) scale(1.06);
}

.theme-toggle-btn::after {
  content: attr(data-tip);
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  left: auto;
  transform: none;
  padding: 4px 8px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.97);
  color: #475569;
  border: 1px solid #e2e8f0;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.02em;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.18s ease;
  box-shadow: 0 6px 16px rgba(15, 23, 42, 0.08);
  z-index: 5;
}

.theme-toggle-btn:hover::after,
.theme-toggle-btn:focus-visible::after {
  opacity: 1;
}

.theme-picker-panel {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  width: 248px;
  padding: 14px 14px 12px;
  border: 1px solid rgba(226, 232, 240, 0.95);
  border-radius: 16px;
  background: linear-gradient(165deg, #ffffff 0%, #fafbfc 100%);
  opacity: 0;
  transform: translateY(-6px) scale(0.98);
  pointer-events: none;
  transition:
    opacity 0.2s ease,
    transform 0.22s cubic-bezier(0.34, 1.15, 0.64, 1);
  box-shadow:
    0 4px 6px rgba(15, 23, 42, 0.04),
    0 18px 40px rgba(15, 23, 42, 0.12);
}

.theme-switcher.is-open .theme-picker-panel {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

.theme-panel-title {
  margin: 0;
  font-size: 13px;
  color: #3b4758;
  font-weight: 500;
}

.theme-panel-desc {
  margin: 4px 0 10px;
  color: #8b95a5;
  font-size: 12px;
}

.theme-picker-panel select {
  width: 100%;
  height: 36px;
  padding: 0 10px;
  border: 1px solid #d2d9e3;
  border-radius: 8px;
  background: #ffffff;
  color: #445164;
  font-size: 13px;
  outline: none;
}

.theme-picker-panel select:focus {
  border-color: #b8c2d1;
}

.brand {
  position: fixed;
  top: 18px;
  left: 20px;
  z-index: 20;
  display: flex;
  align-items: flex-start;
  justify-content: flex-start;
  user-select: none;
}

.brand-quiet {
  position: relative;
  text-align: center;
  padding: 6px 18px 12px;
}

.brand-main {
  margin: 0;
  color: #636363;
  font-size: clamp(16px, 5.2vw, 25px);
  line-height: 1;
  letter-spacing: 0.66px;
  font-weight: 400;
  font-family: "Trebuchet MS", "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
}

.brand-sub {
  margin: 8px 0 0;
  color: #6b7280;
  font-size: clamp(8px, 1.5vw, 12px);
  line-height: 1;
  letter-spacing: 0.18em;
  font-weight: 400;
}

.brand-ambient {
  position: absolute;
  left: 50%;
  bottom: 0;
  width: min(220px, 60vw);
  height: 1px;
  transform: translateX(-50%);
  background: linear-gradient(90deg, transparent, rgba(107, 114, 128, 0.42), transparent);
  animation: quiet-breathe 9s ease-in-out infinite;
}

@keyframes quiet-breathe {
  0%,
  100% {
    opacity: 0.2;
    transform: translateX(-50%) scaleX(0.9);
  }

  50% {
    opacity: 0.55;
    transform: translateX(-50%) scaleX(1);
  }
}

.search-wrap {
  margin-top: 150px;
}

.search-inner {
  position: relative;
  width: 100%;
}

.search-box {
  display: flex;
  align-items: center;
  overflow: hidden;
  width: 100%;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: var(--surface);
  box-shadow: 0 2px 12px rgba(15, 23, 42, 0.06);
}

.search-engine-trigger {
  flex: 0 0 68px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 0;
  background: transparent;
  cursor: pointer;
  border-right: 1px solid #e5e9f0;
  padding: 0;
  transition: background-color 0.14s ease;
  background: white !important;
}

.search-engine-trigger:hover {
  background: rgba(0, 0, 0, 0.03);
}

.search-engine-trigger:focus-visible {
  outline: 0;
  background: rgba(0, 0, 0, 0.05);
}

.search-engine-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.search-engine-trigger-img {
  width: 22px;
  height: 22px;
  object-fit: contain;
  border-radius: 4px;
}

.search-engine-icon.is-fallback {
  width: 22px;
  height: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  color: #64748b;
  font-weight: 600;
  border-radius: 4px;
  background: #f1f5f9;
}

.search-engine-panel {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  z-index: 50;
  padding: 12px;
  border-radius: 14px;
  background: #ffffff;
  border: 1px solid #dce2ea;
  box-shadow: 0 14px 40px rgba(15, 23, 42, 0.12);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-6px);
  transition: opacity 0.2s ease, visibility 0.2s ease, transform 0.2s ease;
}

.search-engine-panel.is-open {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.search-engine-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px 8px;
}

.search-engine-option.is-selected {
  background: color-mix(in srgb, var(--tab-active, #6366f1) 12%, var(--surface, #fff));
  border: 1px solid color-mix(in srgb, var(--tab-active, #6366f1) 35%, var(--line, #e2e8f0));
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--tab-active, #6366f1) 22%, transparent);
}

.search-engine-option {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid transparent;
  border-radius: 10px;
  background: transparent;
  cursor: pointer;
  font-size: 14px;
  color: #334155;
  text-align: left;
  transition: background-color 0.14s ease, border-color 0.14s ease, box-shadow 0.14s ease;
}

.search-engine-option:hover {
  background: #f1f5f9;
}

.search-engine-option-icon {
  flex: 0 0 28px;
  width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  overflow: hidden;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
}

.search-engine-option-icon img {
  width: 18px;
  height: 18px;
  object-fit: contain;
}

.search-engine-option-icon--fallback {
  font-size: 12px;
  font-weight: 600;
  color: #475569;
}

.search-engine-option-label {
  flex: 1;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.search-box input {
  flex: 1;
  height: 56px;
  border: 0;
  outline: none;
  padding: 0 10px 0 2px;
  color: #000000;
  font-size: 16px;
  background: transparent;
  font-weight: 300;

}

.search-box input::placeholder {
  color: #9ca3af;
}

.search-box button {
  width: 72px;
  height: 56px;
  border: 0;
  background: var(--yellow);
  cursor: pointer;
}

.search-glyph {
  position: relative;
  display: inline-block;
  width: 20px;
  height: 20px;
}

.search-glyph::before {
  content: "";
  position: absolute;
  left: 1px;
  top: 1px;
  width: 12px;
  height: 12px;
  border: 2.2px solid #1f2937;
  border-radius: 50%;
}

.search-glyph::after {
  content: "";
  position: absolute;
  right: 0;
  bottom: 1px;
  width: 8px;
  height: 2.2px;
  background: #1f2937;
  transform: rotate(44deg);
}

.tabs {
  margin: 18px auto 8px;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px 28px;
}

.tab {
  position: relative;
  border: 0;
  background: transparent;
  color: #6b7280;
  cursor: pointer;
  padding: 4px 0;
  font-size: 16px;
}

.tab::after {
  content: "";
  position: absolute;
  left: 5px;
  right: 5px;
  bottom: 0;
  height: 2px;
  background: transparent;
}

.tab.is-active {
  color: var(--tab-active);
  font-weight: 600;
}

.tab.is-active::after {
  background: var(--yellow);
}

.sites {
  margin-top: 40px;
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  column-gap: 14px;
  row-gap: 10px;
}

.site-item {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  padding: 6px 8px;
  border-radius: 10px;
  color: #1f2937;
  text-decoration: none;
  border: 1px solid transparent;
  background: transparent;
}

.site-item:hover {
  border-color: var(--line);
  background: #ffffff;
}

.site-item.emphasis {
  border-color: var(--line);
  background: #ffffff;
}

.site-item.is-hidden {
  display: none;
}

.icon-wrap {
  width: 28px;
  height: 28px;
  flex: 0 0 28px;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.icon-wrap.fallback {
  font-size: 12px;
  color: #4b5563;
  font-weight: 600;
}

.icon {
  width: 18px;
  height: 18px;
  object-fit: contain;
  border-radius: 4px;
}

.site-title {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 16px;
  line-height: 1.15;
  font-weight: 500;
}

.empty-state {
  margin: 22px auto 10px;
  text-align: center;
  color: var(--text-subtle);
  font-size: 14px;
}

.is-hidden {
  display: none;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@media (max-width: 1080px) {
  .page {
    width: min(960px, calc(100% - 24px));
  }

  .brand-main {
    font-size: clamp(16px, 5vw, 25px);
  }

  .brand-sub {
    font-size: clamp(12px, 1.4vw, 14px);
  }

  .tab {
    font-size: 19px;
  }

  .sites {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  body::before {
    opacity: calc(var(--grain-opacity) * 0.7);
  }

  body::after {
    background: radial-gradient(circle at center, rgba(255, 255, 255, 0) 66%, rgba(140, 151, 169, 0.12) 100%);
  }

  .page {
    width: calc(100% - 16px);
    margin-top: 8px;
    /* 固定 user-bar 约 48px 高 + 顶距 8px + 与 brand 间距，含刘海安全区 */
    padding-top: calc(64px + env(safe-area-inset-top, 0px));
  }

  .user-bar {
    top: calc(8px + env(safe-area-inset-top, 0px));
    right: max(10px, env(safe-area-inset-right, 0px));
    padding: 5px 6px 5px 10px;
    gap: 8px;
    max-width: min(calc(100vw - 20px), calc(100vw - env(safe-area-inset-left, 0px) - env(safe-area-inset-right, 0px) - 16px));
  }

  .theme-toggle-btn {
    width: 36px;
    height: 36px;
    border-radius: 10px;
  }

  .theme-toggle-icon {
    font-size: 15px;
  }

  .theme-toggle-btn::after {
    display: none;
  }

  .theme-picker-panel {
    top: calc(100% + 8px);
    width: min(220px, calc(100vw - 32px));
    padding: 12px;
  }

  .theme-picker-panel select {
    height: 32px;
    font-size: 12px;
  }

  .brand {
    position: static;
    top: auto;
    left: auto;
    z-index: auto;
    align-items: center;
    justify-content: center;
    margin-bottom: 2px;
  }

  .brand-quiet {
    padding: 4px 10px 10px;
  }

  .brand-main {
    font-size: clamp(26px, 9vw, 36px);
    letter-spacing: 0.5px;
  }

  .brand-sub {
    margin-top: 6px;
    font-size: 12px;
    letter-spacing: 0.18em;
  }

  .brand-ambient {
    width: min(180px, 74vw);
  }

  .search-wrap {
    margin-top: 8px;
  }

  .search-engine-trigger {
    flex: 0 0 42px;
    height: 44px;
  }

  .search-engine-trigger-img {
    width: 20px;
    height: 20px;
  }

  .search-engine-panel {
    padding: 10px;
    border-radius: 12px;
    top: calc(100% + 4px);
  }

  .search-engine-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 4px 6px;
  }

  .search-engine-option {
    padding: 8px 10px;
    font-size: 13px;
    gap: 8px;
  }

  .search-engine-option-icon {
    flex: 0 0 24px;
    width: 24px;
    height: 24px;
  }

  .search-engine-option-icon img {
    width: 16px;
    height: 16px;
  }

  .search-box input {
    height: 44px;
    font-size: 15px;
    padding-right: 6px;
  }

  .search-box button {
    width: 56px;
    height: 44px;
  }

  .search-glyph {
    transform: scale(0.84);
  }

  .tabs {
    justify-content: flex-start;
    margin-top: 12px;
    gap: 6px 14px;
  }

  .tab {
    font-size: 16px;
    padding: 2px 0;
  }

  .sites {
    margin-top: 20px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    column-gap: 8px;
    row-gap: 8px;
  }

  .site-item {
    min-height: 40px;
    border-radius: 8px;
    padding: 5px 6px;
    gap: 8px;
  }

  .icon-wrap {
    width: 24px;
    height: 24px;
    flex-basis: 24px;
  }

  .icon {
    width: 15px;
    height: 15px;
  }

  .site-title {
    font-size: 15px;
  }
}

.user-bar {
  position: fixed;
  top: 18px;
  right: 20px;
  z-index: 45;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  padding: 6px 8px 6px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(226, 232, 240, 0.85);
  box-shadow: 0 4px 24px rgba(15, 23, 42, 0.06);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.user-bar-btn,
.user-bar-me {
  border: 1px solid rgba(203, 213, 225, 0.95);
  border-radius: 999px;
  background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
  padding: 7px 14px;
  cursor: pointer;
  color: #334155;
  max-width: 240px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  box-shadow: 0 2px 10px rgba(15, 23, 42, 0.06);
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 500;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.user-bar .user-bar-btn,
.user-bar .user-bar-me {
  border-color: rgba(226, 232, 240, 0.95);
  box-shadow: 0 1px 5px rgba(15, 23, 42, 0.04);
}

.user-bar-btn:hover,
.user-bar-me:hover {
  border-color: #cbd5e1;
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.08);
}

.user-bar-name {
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 120px;
}

.user-bar-me.is-hidden,
.user-bar-btn.is-hidden {
  display: none;
}

/* 已登录：默认仅显示用户名；悬停 / 聚焦 / 触摸展开按钮 展开背景主题 */
.user-bar-stealth-cluster {
  display: none;
  align-items: center;
  gap: 2px;
  flex-shrink: 0;
}

.user-bar-stealth-cluster:not(.is-hidden) {
  display: inline-flex;
}

.user-bar-peek-btn {
  display: none;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  margin: 0;
  padding: 0;
  border: 1px solid rgba(203, 213, 225, 0.9);
  border-radius: 10px;
  background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
  color: #64748b;
  cursor: pointer;
  font-size: 12px;
  line-height: 1;
  box-shadow: 0 1px 6px rgba(15, 23, 42, 0.05);
}

.user-bar-peek-btn:hover {
  border-color: #cbd5e1;
  color: #334155;
}

.user-bar-peek-btn:focus-visible {
  outline: 2px solid #94a3b8;
  outline-offset: 2px;
}

@media (hover: none), (pointer: coarse) {
  .user-bar--logged .user-bar-peek-btn {
    display: inline-flex;
  }
}

.user-bar-expand {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  transition:
    max-width 0.38s ease,
    opacity 0.3s ease,
    margin 0.3s ease;
}

.user-bar-stealth-hint {
  position: relative;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 0;
  padding: 6px 11px 6px 9px;
  border-radius: 999px;
  border: 1px solid rgba(203, 213, 225, 0.95);
  background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
  cursor: pointer;
  color: #475569;
  font-size: 12px;
  font-weight: 600;
  font-family: inherit;
  box-shadow: 0 2px 10px rgba(15, 23, 42, 0.06);
  transition:
    border-color 0.15s ease,
    box-shadow 0.15s ease,
    opacity 0.2s ease;
}

.user-bar-stealth-hint:hover {
  border-color: #cbd5e1;
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.08);
}

.user-bar-stealth-hint:focus-visible {
  outline: 2px solid #94a3b8;
  outline-offset: 2px;
}

.user-bar-stealth-line {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  max-width: 100%;
}

.user-bar-stealth-name {
  display: block;
  min-width: 0;
  max-width: 140px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13px;
  font-weight: 600;
  color: #334155;
  letter-spacing: -0.01em;
}

.user-bar-center-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border-radius: 999px;
  background: #eef2ff;
  border: 1px solid #c7d2fe;
  color: #4338ca;
  font-size: 12px;
  line-height: 1;
  flex-shrink: 0;
}

.user-bar-stealth-badge {
  flex-shrink: 0;
  position: relative;
  overflow: hidden;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.07em;
  line-height: 1.2;
  border: 1px solid transparent;
  background-size: 220% 100%;
  transition: filter 0.35s ease;
}

.user-bar-stealth-badge[data-tier="vip"] {
  color: #422006;
  background-image: linear-gradient(
    108deg,
    #fffbeb 0%,
    #fef9c3 22%,
    #fde047 45%,
    #eab308 62%,
    #ca8a04 82%,
    #854d0e 100%
  );
  border-color: rgba(202, 138, 4, 0.45);
  box-shadow: 0 1px 3px rgba(120, 53, 15, 0.12);
}

.user-bar-stealth-badge[data-tier="svip"] {
  color: #faf5ff;
  background-image: linear-gradient(
    108deg,
    #1e1b4b 0%,
    #4c1d95 28%,
    #6d28d9 48%,
    #c5a028 52%,
    #7c3aed 68%,
    #3b0764 100%
  );
  border-color: rgba(212, 175, 55, 0.5);
  box-shadow: 0 1px 4px rgba(30, 27, 75, 0.22);
}

@media (hover: hover) {
  .user-bar-stealth-line:hover .user-bar-stealth-badge[data-tier="vip"],
  .user-bar-stealth-line:hover .user-bar-stealth-badge[data-tier="svip"] {
    filter: brightness(1.06);
  }
}

.user-bar--logged .user-bar-expand {
  flex: 0 1 auto;
  max-width: 0;
  opacity: 0;
  overflow: hidden;
  pointer-events: none;
  margin: 0;
  gap: 0;
}

.user-bar--logged .user-bar-me {
  cursor: default;
}

.user-bar--logged:hover .user-bar-expand,
.user-bar--logged:focus-within .user-bar-expand,
.user-bar--logged.user-bar--peek-open .user-bar-expand {
  flex: 1 1 auto;
  max-width: min(440px, calc(100vw - 100px));
  opacity: 1;
  overflow: visible;
  pointer-events: auto;
  margin-left: 0;
  gap: 10px;
}

@media (max-width: 400px) {
  .user-bar-stealth-name {
    max-width: 72px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .user-bar-expand {
    transition: none;
  }
}

.site-footer {
  position: relative;
  z-index: 1;
  max-width: 1000px;
  margin: 32px auto 48px;
  padding: 0 16px;
  text-align: center;
  color: var(--text-subtle);
  font-size: 13px;
}

.site-footer-inner {
  margin: 0;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(15, 23, 42, 0.42);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.modal-backdrop.is-hidden {
  display: none;
}

.modal {
  width: min(420px, 100%);
  background: #fff;
  border-radius: 20px;
  padding: 22px 22px 20px;
  box-shadow:
    0 4px 6px rgba(15, 23, 42, 0.04),
    0 24px 48px rgba(15, 23, 42, 0.14);
  position: relative;
  border: 1px solid rgba(226, 232, 240, 0.9);
}

.modal-auth {
  padding-top: 26px;
}

.modal-auth-head {
  margin-bottom: 16px;
}

.modal-subtitle {
  margin: 6px 0 0;
  font-size: 13px;
  color: #64748b;
  line-height: 1.45;
}

.modal-wide {
  width: min(440px, 100%);
}

.modal-user {
  padding: 0;
  overflow: hidden;
}

.modal-close {
  position: absolute;
  top: 12px;
  right: 14px;
  z-index: 2;
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 10px;
  background: rgba(248, 250, 252, 0.9);
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  color: #64748b;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s ease, color 0.15s ease;
}

.modal-close:hover {
  background: #f1f5f9;
  color: #0f172a;
}

.modal-close-soft {
  background: rgba(255, 255, 255, 0.65);
}

.modal-title {
  margin: 0;
  font-size: 20px;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: #0f172a;
}

.modal-tabs {
  display: flex;
  gap: 6px;
  margin-bottom: 16px;
  padding: 4px;
  background: #f1f5f9;
  border-radius: 12px;
}

.modal-tab {
  flex: 1;
  border: 0;
  border-radius: 10px;
  padding: 10px 8px;
  background: transparent;
  cursor: pointer;
  font-size: 14px;
  color: #64748b;
  font-weight: 500;
  transition: background 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}

.modal-tab.is-active {
  background: #fff;
  color: #0f172a;
  font-weight: 600;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.08);
}

.modal-panel.is-hidden {
  display: none;
}

.modal-label {
  display: block;
  font-size: 12px;
  font-weight: 500;
  color: #64748b;
  margin: 12px 0 6px;
}

.modal-input {
  width: 100%;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 12px 14px;
  font-size: 15px;
  background: #fafafa;
  transition: border-color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}

.modal-input::placeholder {
  color: #94a3b8;
}

.modal-input:hover {
  border-color: #cbd5e1;
  background: #fff;
}

.modal-input:focus {
  outline: none;
  border-color: #facc15;
  background: #fff;
  box-shadow: 0 0 0 3px rgba(250, 204, 21, 0.22);
}

.modal-primary,
.modal-secondary {
  margin-top: 16px;
  width: 100%;
  border: 0;
  border-radius: 12px;
  padding: 12px 14px;
  cursor: pointer;
  font-size: 15px;
  font-weight: 600;
  transition: transform 0.12s ease, box-shadow 0.15s ease;
}

.modal-primary {
  background: linear-gradient(180deg, #ffec4d 0%, var(--yellow) 55%, #f5d800 100%);
  color: #1f2937;
  box-shadow: 0 2px 0 rgba(180, 150, 0, 0.35);
}

.modal-primary:hover {
  box-shadow: 0 4px 14px rgba(250, 204, 21, 0.45);
}

.modal-primary:active {
  transform: translateY(1px);
}

.modal-secondary {
  background: #e2e8f0;
  font-weight: 600;
  color: #334155;
}

.modal-row {
  display: flex;
  gap: 8px;
}

.modal-row .modal-input {
  flex: 1;
}

.modal-row .modal-secondary {
  width: auto;
  margin-top: 0;
  align-self: flex-end;
}

.modal-btn-outline {
  flex-shrink: 0;
  margin-top: 0;
  padding: 12px 18px;
  border-radius: 12px;
  border: 1px solid #e2e8f0;
  background: #fff;
  font-size: 14px;
  font-weight: 600;
  color: #334155;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.modal-btn-outline:hover {
  border-color: #cbd5e1;
  background: #f8fafc;
}

.modal-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 12px;
}

.modal-summary {
  font-size: 13px;
  color: #475569;
  line-height: 1.5;
}

.modal-hint {
  font-size: 12px;
  color: #94a3b8;
  margin: 8px 0 0;
}

.modal-link {
  margin-top: 12px;
  border: 0;
  background: none;
  color: #64748b;
  cursor: pointer;
  text-decoration: underline;
  font-size: 13px;
}

.modal-msg {
  min-height: 1.2em;
  margin-top: 12px;
  font-size: 13px;
  color: #b45309;
}

/* —— 用户中心 —— */
.user-panel-header {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 24px 22px 20px;
  background: linear-gradient(145deg, #f8fafc 0%, #f1f5f9 48%, #eef2f7 100%);
  border-bottom: 1px solid rgba(226, 232, 240, 0.85);
}

.user-panel-avatar {
  width: 56px;
  height: 56px;
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(135deg, #64748b 0%, #334155 100%);
  box-shadow:
    0 4px 12px rgba(51, 65, 85, 0.25),
    inset 0 1px 0 rgba(255, 255, 255, 0.2);
  flex-shrink: 0;
}

.user-panel-headtext {
  min-width: 0;
  flex: 1;
}

.user-panel-name-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.user-panel-name-block {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  min-width: 0;
  max-width: min(220px, 100%);
}

.user-panel-name-block .user-panel-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-panel-nick-edit {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  margin: 0;
  padding: 0;
  border: none;
  border-radius: 10px;
  background: #f1f5f9;
  color: #64748b;
  cursor: pointer;
  font-family: inherit;
  transition:
    background 0.15s ease,
    color 0.15s ease;
}

.user-panel-nick-edit:hover {
  background: #e2e8f0;
  color: #334155;
}

.user-panel-nick-edit:focus-visible {
  outline: 2px solid #94a3b8;
  outline-offset: 2px;
}

.user-panel-nick-edit-glyph {
  font-size: 14px;
  line-height: 1;
  opacity: 0.9;
}

.user-panel-name {
  font-size: 18px;
  font-weight: 700;
  color: #0f172a;
  letter-spacing: -0.02em;
}

.user-panel-logout {
  padding: 5px 11px;
  border-radius: 999px;
  border: 1px solid #e2e8f0;
  background: #fff;
  font-size: 12px;
  font-weight: 600;
  color: #64748b;
  cursor: pointer;
  font-family: inherit;
  transition:
    border-color 0.15s ease,
    color 0.15s ease,
    background 0.15s ease;
}

.user-panel-logout:hover {
  border-color: #cbd5e1;
  color: #334155;
  background: #f8fafc;
}

.user-panel-logout:focus-visible {
  outline: 2px solid #94a3b8;
  outline-offset: 2px;
}

.user-tier-badge {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  padding: 5px 12px;
  border-radius: 999px;
  border: 1px solid transparent;
  overflow: hidden;
  background-size: 220% 100%;
  text-transform: none;
  transition: filter 0.35s ease;
}

.user-tier-badge[data-tier="normal"] {
  color: #475569;
  background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
  background-size: 100% 100%;
  border-color: #e2e8f0;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

.user-tier-badge[data-tier="vip"] {
  color: #422006;
  background-image: linear-gradient(
    108deg,
    #fffbeb 0%,
    #fef9c3 22%,
    #fde047 45%,
    #eab308 62%,
    #ca8a04 82%,
    #854d0e 100%
  );
  border-color: rgba(202, 138, 4, 0.5);
  box-shadow: 0 2px 8px rgba(180, 83, 9, 0.15);
}

.user-tier-badge[data-tier="svip"] {
  color: #faf5ff;
  background-image: linear-gradient(
    108deg,
    #1e1b4b 0%,
    #4c1d95 28%,
    #6d28d9 48%,
    #c5a028 52%,
    #7c3aed 68%,
    #3b0764 100%
  );
  border-color: rgba(212, 175, 55, 0.55);
  box-shadow: 0 2px 10px rgba(76, 29, 149, 0.22);
}

@media (hover: hover) {
  .user-panel-header:hover .user-tier-badge[data-tier="vip"],
  .user-panel-header:hover .user-tier-badge[data-tier="svip"] {
    filter: brightness(1.05);
  }
}

@media (prefers-reduced-motion: no-preference) {
  .user-bar-stealth-badge[data-tier="vip"] {
    animation: tier-badge-gold-flow 5.5s ease-in-out infinite;
  }

  .user-bar-stealth-badge[data-tier="svip"] {
    animation: tier-badge-svip-flow 6.5s ease-in-out infinite;
  }

  .user-tier-badge[data-tier="vip"] {
    animation: tier-badge-gold-flow-panel 5.5s ease-in-out infinite;
  }

  .user-tier-badge[data-tier="svip"] {
    animation: tier-badge-svip-flow-panel 6.5s ease-in-out infinite;
  }
}

@keyframes tier-badge-gold-flow {
  0%,
  100% {
    background-position: 0% 50%;
    box-shadow: 0 1px 3px rgba(120, 53, 15, 0.12), 0 0 0 rgba(251, 191, 36, 0);
  }

  50% {
    background-position: 100% 50%;
    box-shadow: 0 1px 3px rgba(120, 53, 15, 0.12), 0 0 14px rgba(251, 191, 36, 0.28);
  }
}

@keyframes tier-badge-svip-flow {
  0%,
  100% {
    background-position: 100% 50%;
    box-shadow: 0 1px 4px rgba(30, 27, 75, 0.22), 0 0 0 rgba(167, 139, 250, 0);
  }

  50% {
    background-position: 0% 50%;
    box-shadow: 0 1px 4px rgba(30, 27, 75, 0.22), 0 0 16px rgba(167, 139, 250, 0.35);
  }
}

@keyframes tier-badge-gold-flow-panel {
  0%,
  100% {
    background-position: 0% 50%;
    box-shadow: 0 2px 8px rgba(180, 83, 9, 0.15), 0 0 0 rgba(251, 191, 36, 0);
  }

  50% {
    background-position: 100% 50%;
    box-shadow: 0 2px 10px rgba(180, 83, 9, 0.18), 0 0 20px rgba(251, 191, 36, 0.22);
  }
}

@keyframes tier-badge-svip-flow-panel {
  0%,
  100% {
    background-position: 100% 50%;
    box-shadow: 0 2px 10px rgba(76, 29, 149, 0.22), 0 0 0 rgba(212, 175, 55, 0);
  }

  50% {
    background-position: 0% 50%;
    box-shadow: 0 2px 12px rgba(76, 29, 149, 0.26), 0 0 22px rgba(167, 139, 250, 0.28);
  }
}

@media (prefers-reduced-motion: reduce) {
  .user-bar-stealth-badge[data-tier="vip"],
  .user-bar-stealth-badge[data-tier="svip"],
  .user-tier-badge[data-tier="vip"],
  .user-tier-badge[data-tier="svip"] {
    background-size: 100% 100%;
  }
}

.user-panel-phone {
  margin: 6px 0 0;
  font-size: 13px;
  color: #64748b;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.02em;
}

.user-panel-sun {
  position: relative;
  margin: 0 18px;
  margin-top: 18px;
  padding: 14px 16px 12px;
  border-radius: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: linear-gradient(135deg, #fffbeb 0%, #fef9c3 40%, #fff7ed 100%);
  border: 1px solid rgba(251, 191, 36, 0.35);
  overflow: hidden;
}

.user-panel-sun-row {
  display: flex;
  align-items: stretch;
  gap: 10px;
  flex-wrap: wrap;
}

.user-panel-sun-main {
  position: relative;
  flex: 1 1 160px;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0;
  padding: 10px 12px;
  border: none;
  border-radius: 14px;
  cursor: pointer;
  text-align: left;
  font-family: inherit;
  background: rgba(255, 255, 255, 0.55);
  border: 1px solid rgba(251, 191, 36, 0.4);
  box-shadow: 0 2px 12px rgba(180, 83, 9, 0.06);
  transition:
    background 0.15s ease,
    box-shadow 0.15s ease,
    transform 0.12s ease;
}

.user-panel-sun-main:hover {
  background: rgba(255, 255, 255, 0.88);
  box-shadow: 0 4px 18px rgba(180, 83, 9, 0.1);
}

.user-panel-sun-main:active {
  transform: scale(0.99);
}

.user-panel-sun-main:focus-visible {
  outline: 2px solid #d97706;
  outline-offset: 2px;
}

.user-panel-sign-btn {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  min-width: 108px;
  padding: 10px 14px;
  margin: 0;
  border-radius: 14px;
  border: 1px solid rgba(5, 150, 105, 0.35);
  background: linear-gradient(180deg, #ecfdf5 0%, #d1fae5 100%);
  cursor: pointer;
  font-family: inherit;
  transition:
    box-shadow 0.15s ease,
    transform 0.12s ease;
}

.user-panel-sign-btn:hover {
  box-shadow: 0 4px 16px rgba(5, 150, 105, 0.15);
}

.user-panel-sign-btn:active {
  transform: scale(0.98);
}

.user-panel-sign-btn:focus-visible {
  outline: 2px solid #059669;
  outline-offset: 2px;
}

.user-panel-sign-btn-title {
  font-size: 13px;
  font-weight: 700;
  color: #065f46;
}

.user-panel-sign-btn-reward {
  font-size: 12px;
  font-weight: 800;
  color: #047857;
}

.user-panel-sign-btn:disabled {
  opacity: 0.72;
  cursor: not-allowed;
  filter: grayscale(0.12);
  box-shadow: none;
  transform: none;
}

.user-panel-sign-btn:disabled:hover {
  box-shadow: none;
}

.user-panel-sign-btn:disabled .user-panel-sign-btn-title {
  color: #64748b;
}

.user-panel-sign-btn:disabled .user-panel-sign-btn-reward {
  color: #94a3b8;
  font-weight: 700;
}

.user-panel-sun-main:disabled {
  opacity: 0.72;
  cursor: not-allowed;
  transform: none;
}

.user-panel-sun-main:disabled:hover {
  background: rgba(255, 255, 255, 0.55);
  box-shadow: 0 2px 12px rgba(180, 83, 9, 0.06);
}

.user-panel-sun-main:disabled:active {
  transform: none;
}

.user-panel-sun-hint {
  margin: 0;
  font-size: 11px;
  line-height: 1.45;
  color: #a16207;
  opacity: 0.92;
}

.user-panel-sun-glow {
  position: absolute;
  right: -20px;
  top: -30px;
  width: 100px;
  height: 100px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(251, 191, 36, 0.35) 0%, transparent 70%);
  pointer-events: none;
}

.user-panel-sun-icon {
  position: relative;
  font-size: 32px;
  line-height: 1;
  filter: drop-shadow(0 2px 4px rgba(180, 83, 9, 0.2));
}

.user-panel-sun-meta {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.user-panel-sun-label {
  font-size: 12px;
  font-weight: 600;
  color: #b45309;
  letter-spacing: 0.06em;
}

.user-panel-sun-val {
  font-size: 28px;
  font-weight: 800;
  color: #92400e;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.03em;
  line-height: 1.1;
}

.user-panel-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  padding: 16px 18px 0;
}

.user-stat-card {
  padding: 12px 14px;
  border-radius: 14px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.user-stat-label {
  font-size: 11px;
  font-weight: 600;
  color: #94a3b8;
  letter-spacing: 0.04em;
}

.user-stat-val {
  font-size: 16px;
  font-weight: 700;
  color: #1e293b;
  font-variant-numeric: tabular-nums;
}

.user-panel-section {
  padding: 18px 18px 0;
}

.user-panel-section-title {
  margin: 0 0 10px;
  font-size: 12px;
  font-weight: 700;
  color: #94a3b8;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.user-panel-nick-row {
  display: flex;
  gap: 10px;
  align-items: stretch;
}

.user-panel-nick-row .modal-input {
  flex: 1;
  margin-top: 0;
}

.user-panel-nick-row .modal-btn-outline {
  align-self: stretch;
  display: flex;
  align-items: center;
}

.user-panel-vip-desc {
  margin: 0 0 12px;
  font-size: 13px;
  line-height: 1.65;
  color: #475569;
}

.user-panel-vip-desc strong {
  color: #b45309;
  font-weight: 700;
}

.user-panel-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.user-panel-actions-vip {
  margin-top: 0;
}

.user-action-btn {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 14px 16px;
  border-radius: 14px;
  border: 1px solid #e2e8f0;
  background: #fff;
  cursor: pointer;
  text-align: left;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.12s ease;
}

.user-action-btn:hover {
  border-color: #cbd5e1;
  box-shadow: 0 4px 16px rgba(15, 23, 42, 0.06);
}

.user-action-btn:active {
  transform: scale(0.99);
}

.user-action-icon {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  flex-shrink: 0;
}

.user-action-sign .user-action-icon {
  background: linear-gradient(135deg, #ecfdf5 0%, #d1fae5 100%);
  color: #047857;
}

.user-action-vip .user-action-icon {
  background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%);
  color: #b45309;
}

.user-action-text {
  flex: 1;
  font-size: 15px;
  font-weight: 600;
  color: #0f172a;
}

.user-action-tag {
  font-size: 12px;
  font-weight: 700;
  color: #64748b;
  padding: 4px 10px;
  border-radius: 999px;
  background: #f1f5f9;
}

.user-action-sign .user-action-tag {
  color: #047857;
  background: #ecfdf5;
}

.user-action-vip .user-action-tag {
  color: #b45309;
  background: #fffbeb;
}

.user-panel-hint {
  margin: 12px 0 0;
  font-size: 12px;
  color: #94a3b8;
  line-height: 1.5;
}

.user-panel-inline-a {
  color: #4338ca;
  font-weight: 600;
  text-decoration: none;
}

.user-panel-inline-a:hover {
  text-decoration: underline;
}

a.user-action-btn.user-action-exchange {
  text-decoration: none;
  color: inherit;
  box-sizing: border-box;
}

.user-action-exchange .user-action-icon {
  background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%);
  color: #d97706;
}

.user-nick-dialog {
  display: none;
  padding: 0;
  border: none;
  border-radius: 18px;
  width: min(400px, calc(100vw - 32px));
  max-width: 100%;
  box-shadow:
    0 24px 64px rgba(15, 23, 42, 0.2),
    0 0 0 1px rgba(255, 255, 255, 0.06) inset;
}

.user-nick-dialog[open] {
  display: block;
}

.user-nick-dialog::backdrop {
  background: rgba(15, 23, 42, 0.45);
  backdrop-filter: blur(5px);
}

.user-nick-dialog-inner {
  padding: 22px 22px 20px;
  background: linear-gradient(165deg, #ffffff 0%, #f8fafc 100%);
  border-radius: 18px;
}

.user-nick-dialog-title {
  margin: 0 0 14px;
  font-size: 17px;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: #0f172a;
}

.user-nick-dialog-actions {
  display: flex;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
}

.user-panel-footer {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 20px 18px 22px;
  margin-top: 4px;
  border-top: 1px solid #f1f5f9;
}

.user-footer-link {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 12px 16px;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  border: 0;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}

.user-footer-manage {
  background: linear-gradient(180deg, #ffec4d 0%, var(--yellow) 55%, #f5d800 100%);
  color: #1f2937;
  box-shadow: 0 2px 0 rgba(180, 150, 0, 0.3);
}

.user-footer-manage:hover {
  filter: brightness(1.03);
}

.user-footer-theme {
  background: #f1f5f9;
  color: #334155;
  border: 1px solid #e2e8f0;
}

.user-footer-theme:hover {
  background: #e2e8f0;
}

.user-footer-membership {
  background: #faf5ff;
  color: #5b21b6;
  border: 1px solid #e9d5ff;
}

.user-footer-membership:hover {
  background: #f3e8ff;
}

.user-footer-logout {
  background: transparent;
  color: #64748b;
  border: 1px solid #e2e8f0;
}

.user-footer-logout:hover {
  background: #f8fafc;
  color: #475569;
}

/* —— 全局提示弹窗（登录/用户中心） —— */
.kuai-notice-backdrop {
  position: fixed;
  inset: 0;
  z-index: 320;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
  background: rgba(15, 23, 42, 0.45);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.kuai-notice-backdrop.is-hidden {
  display: none;
}

.kuai-notice {
  width: min(400px, 100%);
  padding: 22px 22px 18px;
  border-radius: 18px;
  background: linear-gradient(165deg, #ffffff 0%, #f8fafc 100%);
  border: 1px solid rgba(226, 232, 240, 0.95);
  box-shadow:
    0 24px 64px rgba(15, 23, 42, 0.18),
    0 0 0 1px rgba(255, 255, 255, 0.6) inset;
}

.kuai-notice-title {
  margin: 0 0 10px;
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: #0f172a;
}

.kuai-notice-body {
  margin: 0 0 18px;
  font-size: 14px;
  line-height: 1.6;
  color: #475569;
  white-space: pre-wrap;
  word-break: break-word;
}

.kuai-notice--success .kuai-notice-title {
  color: #065f46;
}

.kuai-notice--error .kuai-notice-title {
  color: #b91c1c;
}

.kuai-notice--warn .kuai-notice-title {
  color: #b45309;
}

.kuai-notice-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

.kuai-notice-btn {
  min-width: 88px;
  padding: 10px 18px;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  border: 1px solid transparent;
  transition:
    background 0.15s ease,
    border-color 0.15s ease,
    transform 0.1s ease;
}

.kuai-notice-btn-primary {
  background: linear-gradient(180deg, #334155 0%, #1e293b 100%);
  color: #f8fafc;
  border-color: #1e293b;
  box-shadow: 0 2px 8px rgba(30, 41, 59, 0.25);
}

.kuai-notice-btn-primary:hover {
  filter: brightness(1.06);
}

.kuai-notice-btn-secondary {
  background: #fff;
  color: #64748b;
  border-color: #e2e8f0;
}

.kuai-notice-btn-secondary:hover {
  background: #f8fafc;
  border-color: #cbd5e1;
}

.kuai-notice-btn:active {
  transform: scale(0.98);
}

@media (max-width: 760px) {
  .user-bar-name {
    max-width: 72px;
  }

  .user-panel-nick-row {
    flex-direction: column;
  }

  .user-panel-nick-row .modal-btn-outline {
    width: 100%;
    justify-content: center;
  }
}

.cms-article {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 24px 20px;
  box-shadow: 0 4px 18px rgba(15, 23, 42, 0.06);
}

.cms-article h1 {
  margin: 0 0 16px;
  font-size: 22px;
}

.cms-body {
  font-size: 15px;
  line-height: 1.7;
  color: #334155;
}

/* ---------- 右侧悬浮便签 ---------- */
.kuai-sticky {
  position: fixed;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  z-index: 90;
  display: flex;
  flex-direction: row-reverse;
  align-items: stretch;
  pointer-events: none;
  max-height: min(72vh, 520px);
}

.kuai-sticky > * {
  pointer-events: auto;
}

.kuai-sticky-fab {
  flex-shrink: 0;
  width: 44px;
  min-height: 52px;
  margin: 0;
  padding: 0;
  border: 1px solid var(--line-strong);
  border-right: none;
  border-radius: 12px 0 0 12px;
  background: linear-gradient(180deg, #fffef5 0%, #fff8dc 100%);
  box-shadow: -4px 4px 18px rgba(15, 23, 42, 0.1);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition:
    background 0.2s,
    box-shadow 0.2s;
}

.kuai-sticky-fab:hover,
.kuai-sticky-fab:focus-visible {
  background: linear-gradient(180deg, #fff 0%, #fff3bf 100%);
  box-shadow: -6px 6px 22px rgba(15, 23, 42, 0.14);
  outline: none;
}

.kuai-sticky-fab-icon {
  font-size: 22px;
  line-height: 1;
  filter: drop-shadow(0 1px 1px rgba(0, 0, 0, 0.08));
}

.kuai-sticky-panel {
  width: min(92vw, 300px);
  max-height: min(72vh, 520px);
  display: flex;
  flex-direction: column;
  background: #fffef7;
  border: 1px solid #e8ddc0;
  border-right: none;
  border-radius: 14px 0 0 14px;
  box-shadow: -8px 8px 28px rgba(15, 23, 42, 0.12);
  overflow: hidden;
  opacity: 0;
  transform: translateX(8px);
  pointer-events: none;
  transition:
    opacity 0.22s ease,
    transform 0.22s ease;
}

.kuai-sticky--open .kuai-sticky-panel {
  opacity: 1;
  transform: translateX(0);
  pointer-events: auto;
}

.kuai-sticky-head {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  border-bottom: 1px solid #ebe4d4;
  background: linear-gradient(180deg, rgba(255, 250, 230, 0.9) 0%, rgba(255, 248, 220, 0.5) 100%);
}

.kuai-sticky-title {
  font-size: 14px;
  font-weight: 600;
  color: #5c4d2e;
}

.kuai-sticky-close {
  border: none;
  background: transparent;
  color: #78716c;
  font-size: 22px;
  line-height: 1;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.kuai-sticky-close:hover {
  background: rgba(0, 0, 0, 0.06);
  color: #44403c;
}

.kuai-sticky-guest {
  padding: 16px 14px;
  flex: 1;
  overflow: auto;
}

.kuai-sticky-guest-text {
  margin: 0 0 12px;
  font-size: 13px;
  line-height: 1.55;
  color: #57534e;
}

.kuai-sticky-login-btn {
  width: 100%;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--line-strong);
  background: #fff;
  color: var(--text-main);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
}

.kuai-sticky-login-btn:hover {
  background: #fafafa;
}

.kuai-sticky-editor {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  padding: 10px 12px 12px;
}

.kuai-sticky-editor.is-hidden,
.kuai-sticky-guest.is-hidden {
  display: none !important;
}

.kuai-sticky-textarea {
  flex: 1;
  min-height: 160px;
  width: 100%;
  resize: none;
  border: 1px solid #e8ddc0;
  border-radius: 10px;
  padding: 10px 11px;
  font-size: 14px;
  line-height: 1.5;
  color: #44403c;
  background: rgba(255, 255, 255, 0.85);
  font-family: inherit;
}

.kuai-sticky-textarea:focus {
  outline: 2px solid rgba(251, 191, 36, 0.45);
  outline-offset: 1px;
  border-color: #d4c4a0;
}

.kuai-sticky-textarea:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.kuai-sticky-foot {
  flex-shrink: 0;
  margin-top: 8px;
}

.kuai-sticky-status {
  font-size: 12px;
  color: #78716c;
}

.kuai-sticky-status.kuai-sticky-status--ok {
  color: #15803d;
}

.kuai-sticky-status.kuai-sticky-status--err {
  color: #b91c1c;
}

@media (max-width: 520px) {
  .kuai-sticky {
    top: auto;
    bottom: max(16px, env(safe-area-inset-bottom, 0px));
    transform: none;
    max-height: min(56vh, 400px);
  }

  .kuai-sticky-fab {
    width: 32px;
    min-height: 0;
    height: 36px;
    max-height: 36px;
    border-radius: 10px 0 0 10px;
    padding: 0 2px;
  }

  .kuai-sticky-fab-icon {
    font-size: 15px;
    line-height: 1;
    display: block;
    transform: scale(0.92);
    transform-origin: center center;
  }

  .kuai-sticky-panel {
    width: min(calc(100vw - 40px), 300px);
    max-height: min(56vh, 400px);
  }
}
