/* whenreset.today — 多风格主题扩展层 (Theme Presets)
 *
 * 包含 4 套截然不同的视觉风格：
 *   1. pop       - 默认：新野蛮复古 / 暖纸底色 / 粗黑边框 / 俏皮微倾斜
 *   2. cyberpunk - 极客黑客终端 / 黑曜石暗底 / 荧光霓虹绿青 / 点阵科技感 / 严整直角发光
 *   3. linear    - 现代 SaaS 极简 / 超细灰阶边框 / 柔和多层弥散阴影 / 优雅微圆角
 *   4. editorial - 报刊杂志纸墨 / 纯净米白与深墨灰 / 典雅衬线标题 / 极简沉稳排版
 */

/* ==========================================================================
   风格选择器与菜单组件样式（所有风格共享基础几何，局部随主题变色）
   ========================================================================== */

.style-toggle {
  width: 40px;
  height: 40px;
  color: var(--ink);
  box-shadow: none;
  cursor: pointer;
  touch-action: manipulation;
  background: 0 0;
  border: 0;
  border-radius: 50%;
  flex: 0 0 40px;
  place-items: center;
  padding: 0;
  transition: transform .1s;
  display: inline-grid;
  position: relative;
}

.style-toggle:before {
  content: "";
  box-sizing: border-box;
  border: var(--border);
  background: var(--card);
  box-shadow: 1px 1px 0 var(--shadow-ink);
  pointer-events: none;
  border-radius: 50%;
  transition: box-shadow .1s;
  position: absolute;
  inset: 5px;
}

.style-toggle:active {
  transform: translate(2px, 2px);
}
.style-toggle:active:before {
  box-shadow: 0 0 0 var(--shadow-ink);
}

@media (hover: hover) {
  .style-toggle:hover {
    transform: translate(-1px, -1px);
  }
  .style-toggle:hover:before {
    box-shadow: 2px 2px 0 var(--shadow-ink);
  }
}

.style-toggle-icon {
  z-index: 1;
  fill: none;
  stroke: currentColor;
  stroke-width: 2px;
  stroke-linecap: round;
  stroke-linejoin: round;
  width: 15px;
  height: 15px;
  position: relative;
}

/* 风格弹出菜单 */
.style-menu {
  inset: auto 16px auto auto;
  top: var(--style-menu-top, 80px);
  left: var(--style-menu-left, auto);
  border: var(--border);
  background: var(--card);
  width: 210px;
  max-width: calc(100vw - 32px);
  color: var(--ink);
  box-shadow: var(--shadow);
  border-radius: var(--radius);
  margin: 0;
  padding: 8px;
  position: fixed;
  z-index: 50;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.style-menu:not(:popover-open):not(.is-open) {
  display: none;
}

.style-menu-item {
  min-height: 40px;
  font: 600 13px/1.2 var(--font-body);
  color: var(--ink);
  background: transparent;
  border: 1.5px solid transparent;
  border-radius: 8px;
  align-items: center;
  gap: 10px;
  padding: 7px 10px;
  cursor: pointer;
  text-align: left;
  display: flex;
  width: 100%;
  transition: background .12s, border-color .12s, transform .08s;
}

.style-menu-item:hover,
.style-menu-item:focus-visible {
  background: var(--sun);
  color: var(--on-sun);
}

.style-menu-item[aria-current="true"] {
  border-color: var(--accent);
  background: var(--sun);
  color: var(--on-sun);
  font-weight: 700;
}

.style-menu-item[aria-current="true"]::after {
  content: "✓";
  margin-left: auto;
  font-weight: 800;
}

.style-swatch {
  width: 16px;
  height: 16px;
  border-radius: 4px;
  border: 1.5px solid var(--ink);
  flex-shrink: 0;
}

.style-swatch--pop {
  background: linear-gradient(135deg, #ffd84d 50%, #ff5c2b 50%);
}
.style-swatch--cyberpunk {
  background: linear-gradient(135deg, #05080c 50%, #00ff66 50%);
}
.style-swatch--linear {
  background: linear-gradient(135deg, #f8fafc 50%, #3b82f6 50%);
}
.style-swatch--editorial {
  background: linear-gradient(135deg, #f6f3ee 50%, #1c1917 50%);
}

/* ==========================================================================
   1. 赛博朋克极客终端风格 (Cyberpunk Terminal)
   ========================================================================== */

html[data-style="cyberpunk"] {
  color-scheme: dark;
  --paper: #080c10;
  --card: #0e1520;
  --ink: #dcf7ff;
  --ink-2: #84a2b6;
  --ink-3: #4d6779;
  --accent: #00ff66;
  --accent-hover: #2aff7d;
  --sun: #00e5ff;
  --sun-hover: #3debff;
  --watch-paper: #0a1b24;
  --watch-copy: #00ffd5;
  --rose: #ff2d87;
  --sky: #00d0ff;
  --peach: #ff9d00;
  --mint: #00ffaa;
  --on-accent: #041008;
  --on-sun: #041018;
  --on-rose: #ffffff;
  --on-sky: #041018;
  --on-mint: #041008;
  --banked-copy: #ffaa33;
  --dot-ink: rgba(0, 255, 102, 0.12);
  --shadow-ink: rgba(0, 255, 102, 0.35);
  --border: 1px solid rgba(0, 255, 102, 0.4);
  --shadow: 0 0 14px rgba(0, 255, 102, 0.2), 0 0 2px rgba(0, 255, 102, 0.6);
  --shadow-sm: 0 0 8px rgba(0, 255, 102, 0.18);
  --radius: 4px;
  --font-display: var(--font-mono);
  --cg-empty: #142230;
  --cg-fill: #00ff66;
  --cg-banked: #ff9d00;
}

html[data-style="cyberpunk"] body {
  background-color: var(--paper);
  background-image: 
    linear-gradient(rgba(0, 255, 102, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 255, 102, 0.03) 1px, transparent 1px);
  background-size: 24px 24px;
}

/* 赛博风：取消歪斜，回归硬核直角网格 */
html[data-style="cyberpunk"] :is(
  .hero-card,
  .hero-figure,
  .masthead-avatar,
  .stat-tile--sun,
  .stat-tile--rose,
  .stat-tile--sky,
  .log-bubble:before,
  .reset-plea-button:active,
  .sponsor-card
) {
  transform: none !important;
}

html[data-style="cyberpunk"] .hero-figure {
  box-shadow: 0 0 16px rgba(0, 229, 255, 0.5);
  letter-spacing: .04em;
}

html[data-style="cyberpunk"] .log-bubble {
  border-radius: 4px;
}
html[data-style="cyberpunk"] .log-avatar,
html[data-style="cyberpunk"] .masthead-avatar {
  border-radius: 4px;
}

html[data-style="cyberpunk"] .stat-tile {
  box-shadow: 0 0 12px var(--shadow-ink);
}

/* ==========================================================================
   2. 现代极简质感科技风格 (Linear Modern)
   ========================================================================== */

html[data-style="linear"] {
  color-scheme: light;
  --paper: #f8fafc;
  --card: #ffffff;
  --ink: #0f172a;
  --ink-2: #475569;
  --ink-3: #94a3b8;
  --accent: #2563eb;
  --accent-hover: #1d4ed8;
  --sun: #e2e8f0;
  --sun-hover: #cbd5e1;
  --watch-paper: #eff6ff;
  --watch-copy: #1e40af;
  --rose: #f43f5e;
  --sky: #38bdf8;
  --peach: #f97316;
  --mint: #10b981;
  --on-accent: #ffffff;
  --on-sun: #0f172a;
  --on-rose: #ffffff;
  --on-sky: #0f172a;
  --on-mint: #ffffff;
  --banked-copy: #c2410c;
  --dot-ink: rgba(148, 163, 184, 0.25);
  --shadow-ink: rgba(15, 23, 42, 0.08);
  --border: 1px solid #e2e8f0;
  --shadow: 0 4px 20px -2px rgba(15, 23, 42, 0.06), 0 2px 6px -1px rgba(15, 23, 42, 0.03);
  --shadow-sm: 0 1px 3px rgba(15, 23, 42, 0.06);
  --radius: 12px;
  --font-display: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --cg-empty: #edf2f7;
  --cg-fill: #2563eb;
  --cg-banked: #f97316;
}

html[data-style="linear"][data-theme="dark"],
html[data-style="linear"] :root[data-theme="dark"] {
  color-scheme: dark;
  --paper: #0b0f19;
  --card: #111827;
  --ink: #f8fafc;
  --ink-2: #94a3b8;
  --ink-3: #64748b;
  --accent: #3b82f6;
  --accent-hover: #60a5fa;
  --sun: #1e293b;
  --sun-hover: #334155;
  --watch-paper: #132238;
  --watch-copy: #93c5fd;
  --border: 1px solid rgba(255, 255, 255, 0.1);
  --shadow: 0 8px 30px rgba(0, 0, 0, 0.4);
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
  --cg-empty: #1f2937;
}

/* Linear 风格：精细质感、消除卡通倾斜、精致对齐 */
html[data-style="linear"] :is(
  .hero-card,
  .hero-figure,
  .masthead-avatar,
  .stat-tile--sun,
  .stat-tile--rose,
  .stat-tile--sky,
  .log-bubble:before,
  .reset-plea-button:active,
  .sponsor-card
) {
  transform: none !important;
}

html[data-style="linear"] .hero-figure {
  background: var(--accent);
  color: #ffffff;
  border-radius: 8px;
}

html[data-style="linear"] .stat-tile:hover {
  transform: translateY(-2px) !important;
}

/* ==========================================================================
   3. 纸墨报刊静读风格 (Zen Editorial)
   ========================================================================== */

html[data-style="editorial"] {
  color-scheme: light;
  --paper: #f5f2eb;
  --card: #fcfbf9;
  --ink: #1c1917;
  --ink-2: #44403c;
  --ink-3: #78716c;
  --accent: #991b1b;
  --accent-hover: #7f1d1d;
  --sun: #e7e2d7;
  --sun-hover: #d6cfc1;
  --watch-paper: #eae5da;
  --watch-copy: #292524;
  --rose: #b91c1c;
  --sky: #475569;
  --peach: #b45309;
  --mint: #15803d;
  --on-accent: #ffffff;
  --on-sun: #1c1917;
  --on-rose: #ffffff;
  --on-sky: #ffffff;
  --on-mint: #ffffff;
  --banked-copy: #9a3412;
  --dot-ink: rgba(28, 25, 23, 0.1);
  --shadow-ink: #292524;
  --border: 1.5px solid #292524;
  --shadow: 3px 3px 0 #292524;
  --shadow-sm: 2px 2px 0 #292524;
  --radius: 3px;
  --font-display: "Georgia", "Charter", "Noto Serif", "Songti SC", "SimSun", serif;
  --cg-empty: #e2ddd4;
  --cg-fill: #991b1b;
  --cg-banked: #b45309;
}

html[data-style="editorial"][data-theme="dark"],
html[data-style="editorial"] :root[data-theme="dark"] {
  color-scheme: dark;
  --paper: #171513;
  --card: #201e1b;
  --ink: #f5f5f4;
  --ink-2: #d6d3d1;
  --ink-3: #a8a29e;
  --accent: #dc2626;
  --accent-hover: #ef4444;
  --sun: #312e2b;
  --sun-hover: #44403c;
  --watch-paper: #282522;
  --watch-copy: #f5f5f4;
  --border: 1.5px solid #57534e;
  --shadow: 3px 3px 0 #0c0a09;
  --shadow-sm: 2px 2px 0 #0c0a09;
  --cg-empty: #2d2a27;
}

/* 报刊风：严谨端庄排版 */
html[data-style="editorial"] :is(
  .hero-card,
  .hero-figure,
  .masthead-avatar,
  .stat-tile--sun,
  .stat-tile--rose,
  .stat-tile--sky,
  .log-bubble:before,
  .reset-plea-button:active,
  .sponsor-card
) {
  transform: none !important;
}

html[data-style="editorial"] .hero-figure {
  border-radius: 2px;
  letter-spacing: .02em;
}

html[data-style="editorial"] .masthead-avatar,
html[data-style="editorial"] .log-avatar {
  border-radius: 4px;
}
