/* aka · 终端未来风设计系统
   首页 / 文本页 / 密码门共用，保证视觉完全一致。
   近黑磷光底 + 极淡网格 + 等宽字体 + 单色磷光点缀；深色为默认。 */

* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

:root {
  color-scheme: dark;

  /* ---- 磷光点缀（未来终端的单一强调色，非 AI 蓝青渐变）---- */
  --accent: #6CE6B4;
  --accent-2: #4FD6A6;
  --accent-soft: rgba(108, 230, 180, .12);
  --accent-line: rgba(108, 230, 180, .34);
  --accent-glow: rgba(108, 230, 180, .18);

  /* 兼容旧引用 */
  --brand-1: var(--accent);
  --brand-2: var(--accent);
  --brand-3: var(--accent-line);
  --grad: var(--accent);
  --on-grad: #04140D;
  --btn-bg: var(--accent);
  --btn-fg: #04140D;

  /* ---- 中性底：近黑带一丝冷蓝 ---- */
  --bg: #0A0E14;
  --bg-grid: rgba(120, 230, 190, .022);
  --surface: #0E141D;
  --surface-2: #121A24;
  --surface-3: #18222E;
  --surface-hover: #1C2836;
  --border: rgba(120, 160, 190, .14);
  --border-strong: rgba(120, 160, 190, .28);
  --text: #C7D4E2;
  --muted: #6F8093;
  --faint: #46566A;

  /* ---- 语义色（仅真实状态）---- */
  --ok: #6CE6B4;
  --err: #FF7A8A;
  --warn: #F5C451;
  --info: #7DB8E8;
  --ok-bg: rgba(108, 230, 180, .12);
  --err-bg: rgba(255, 122, 138, .12);
  --warn-bg: rgba(245, 196, 81, .12);
  --info-bg: rgba(125, 184, 232, .12);

  /* ---- 扁平：无渐变光泽 ---- */
  --grad-soft: linear-gradient(180deg, rgba(108, 230, 180, .06), transparent 72%);
  --sheen: none;

  /* ---- 形状与投影：纤细、靠发丝边而非大投影 ---- */
  --radius: 12px;
  --radius-sm: 9px;
  --radius-xs: 7px;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .45);
  --shadow-md: 0 10px 30px -18px rgba(0, 0, 0, .8);
  --shadow-lg: 0 24px 60px -28px rgba(0, 0, 0, .9);
  --ring: 0 0 0 3px rgba(108, 230, 180, .24);
  --inner-light: inset 0 1px 0 rgba(255, 255, 255, .04);

  --font: ui-monospace, "SF Mono", SFMono-Regular, "JetBrains Mono", Menlo, Consolas, "Liberation Mono", "PingFang SC", "Microsoft YaHei", "Noto Sans Mono CJK SC", monospace;
  --mono: var(--font);
  --ease: cubic-bezier(.22, .8, .3, 1);
}

/* ---- 浅色：纸白终端（暖中性纸 + 墨绿磷光）---- */
[data-theme="light"] {
  color-scheme: light;
  --accent: #0E9F6E;
  --accent-2: #0B7F58;
  --accent-soft: rgba(14, 159, 110, .10);
  --accent-line: rgba(14, 159, 110, .40);
  --accent-glow: rgba(14, 159, 110, .14);

  --brand-1: var(--accent);
  --brand-2: var(--accent);
  --brand-3: var(--accent-line);
  --grad: var(--accent);
  --on-grad: #FFFFFF;
  --btn-bg: var(--accent);
  --btn-fg: #FFFFFF;

  --bg: #EDF0F4;
  --bg-grid: rgba(20, 50, 40, .03);
  --surface: #FFFFFF;
  --surface-2: #F4F6F9;
  --surface-3: #E8ECF1;
  --surface-hover: #E1E6EC;
  --border: rgba(20, 40, 55, .12);
  --border-strong: rgba(20, 40, 55, .24);
  --text: #15202B;
  --muted: #5C6B79;
  --faint: #8492A2;

  --ok: #0E9F6E;
  --err: #D6455A;
  --warn: #B07A1E;
  --info: #2A7FC0;
  --ok-bg: rgba(14, 159, 110, .10);
  --err-bg: rgba(214, 69, 90, .10);
  --warn-bg: rgba(176, 122, 30, .12);
  --info-bg: rgba(42, 127, 192, .10);

  --grad-soft: linear-gradient(180deg, rgba(14, 159, 110, .05), transparent 70%);
  --shadow-sm: 0 1px 2px rgba(20, 40, 55, .08);
  --shadow-md: 0 10px 28px -18px rgba(20, 40, 55, .22);
  --shadow-lg: 0 24px 56px -28px rgba(20, 40, 55, .26);
  --ring: 0 0 0 3px rgba(14, 159, 110, .24);
  --inner-light: inset 0 1px 0 rgba(255, 255, 255, .9);
}

body {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding: max(44px, env(safe-area-inset-top)) 20px calc(48px + env(safe-area-inset-bottom));
  color: var(--text);
  font-family: var(--font);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-feature-settings: "tnum", "ss01";
  /* 未来网格 + 顶部磷光晕 */
  background-color: var(--bg);
  background-image:
    radial-gradient(120% 80% at 50% -8%, var(--accent-glow), transparent 60%),
    linear-gradient(var(--bg-grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--bg-grid) 1px, transparent 1px);
  background-size: auto, 34px 34px, 34px 34px;
  background-attachment: fixed, fixed, fixed;
}

.container {
  width: 100%;
  max-width: 560px;
  flex: 1 0 auto;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

/* ---- 通用控件：等宽、磷光聚焦 ---- */
textarea, input[type=url], input[type=text], input[type=password], select {
  width: 100%; background: var(--surface-2); border: 1px solid var(--border);
  color: var(--text); padding: 13px 15px; border-radius: var(--radius-sm);
  font-size: 15px; font-family: var(--mono); outline: none;
  transition: border-color .16s var(--ease), box-shadow .16s var(--ease), background .16s var(--ease), color .16s var(--ease);
}
input::placeholder, textarea::placeholder { color: var(--faint); opacity: .8; }
input:hover, textarea:hover, select:hover { border-color: var(--border-strong); }
input:focus, textarea:focus, select:focus {
  border-color: var(--accent-line); box-shadow: var(--ring); background: var(--surface-3);
}
select {
  appearance: none; -webkit-appearance: none; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='none' stroke='%236F8093' stroke-width='1.8' stroke-linecap='round' d='M1.5 1.5L6 6l4.5-4.5'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 14px center; padding-right: 38px;
}

/* ---- 滚动条：极简细条，悬停微亮、拖动用磷光点缀 ---- */
* { scrollbar-width: thin; scrollbar-color: var(--border-strong) transparent; }
html { scrollbar-color: var(--border-strong) transparent; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; margin: 2px; }
::-webkit-scrollbar-thumb {
  background: var(--border-strong);
  border-radius: 999px;
  border: 3px solid transparent;
  background-clip: padding-box;
}
::-webkit-scrollbar-thumb:hover { background: var(--muted); }
::-webkit-scrollbar-thumb:active { background: var(--accent); }
::-webkit-scrollbar-corner { background: transparent; }

/* ---- 线性图标 ---- */
.ico {
  width: 18px; height: 18px; flex: none; stroke: currentColor; fill: none;
  stroke-width: 1.85; stroke-linecap: round; stroke-linejoin: round;
}

/* ---- 数字统一等宽 ---- */
.n, .stat .n, .clicks, .count { font-variant-numeric: tabular-nums; font-feature-settings: "tnum"; }

/* ---- 主题切换：图标按钮（浅色显太阳 / 深色显星芒，无月亮）---- */
.theme-toggle {
  position: fixed; top: max(14px, env(safe-area-inset-top)); right: 16px;
  width: 40px; height: 40px; border-radius: var(--radius-sm); cursor: pointer; padding: 0; z-index: 40;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--surface-2); border: 1px solid var(--border-strong); color: var(--text);
  box-shadow: var(--shadow-sm), var(--inner-light);
  transition: background .2s var(--ease), border-color .2s var(--ease),
              color .2s var(--ease), box-shadow .2s var(--ease), transform .12s var(--ease);
}
.theme-toggle .ico { width: 19px; height: 19px; stroke-width: 1.7; }
.theme-toggle .ico-star { display: none; fill: currentColor; stroke: none; }
.theme-toggle:hover {
  border-color: var(--accent-line); color: var(--accent);
  transform: translateY(-1px); box-shadow: var(--shadow-md), var(--inner-light);
}
.theme-toggle:active { transform: scale(.92); }
.theme-toggle:focus-visible { outline: none; box-shadow: var(--ring), var(--inner-light); }
[data-theme="light"] .theme-toggle .ico-sun { display: block; }
[data-theme="light"] .theme-toggle .ico-star { display: none; }
[data-theme="dark"] .theme-toggle .ico-star { display: block; }
[data-theme="dark"] .theme-toggle .ico-sun { display: none; }
