/* ==========================================================================
 * persona.css — shared design system for wl-forever.com personal homepages
 * (Wesley + dreamy). Modern-tech aesthetic, pure-CSS visuals (no heavy images),
 * light/dark themes, per-page accent via html[data-accent], fully responsive.
 * A slim sticky header that condenses on scroll + a real mobile drawer.
 * ======================================================================== */

:root {
  color-scheme: dark;
  --bg: #0a0e1a; --bg-1: #0c1124; --bg-2: #090d1a;
  --surface: #121829; --surface-2: #161d31; --surface-3: #1d2540;
  --border: #232c44; --border-2: #313c5a;
  --text: #e9edf7; --text-2: #aeb8cc; --muted: #7d889e;
  --on-accent: #fff;
  --good: #34d399; --good-soft: rgba(52,211,153,.14); --good-bd: rgba(52,211,153,.32);
  --warn: #fbbf24; --pink: #f472b6; --danger: #f87171;
  --shadow-sm: 0 1px 2px rgba(0,0,0,.4);
  --shadow: 0 16px 44px rgba(0,0,0,.46);
  --shadow-lg: 0 28px 70px rgba(0,0,0,.5);
  --r-sm: 8px; --r: 12px; --r-lg: 16px; --r-xl: 22px;
  --nav-h: 64px; --nav-h-scrolled: 54px;
  --maxw: 1200px;
  --font: "Inter", "PingFang SC", "Microsoft YaHei", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "SFMono-Regular", "JetBrains Mono", Consolas, monospace;
  --grid: rgba(150,165,205,.05);
  --ease: cubic-bezier(.22,.61,.36,1);
}

/* accent themes — Wesley = indigo, dreamy = rose */
html[data-accent="indigo"] { --accent: #7070f6; --accent-600: #6161f2; --accent-700: #9a9bff; --accent-soft: #1b1d3a; --accent-rgb: 112,112,246; --accent-2: #2dd4bf; }
html[data-accent="rose"]   { --accent: #fb6f9d; --accent-600: #f4548a; --accent-700: #ff9bbb; --accent-soft: #34182a; --accent-rgb: 251,111,157; --accent-2: #c084fc; }
/* dreamy = 莫兰迪（沉静的灰调藕紫 + 雾蓝），深色高级、浅色克制 */
html[data-accent="morandi"] { --accent: #c6a4ae; --accent-600: #b6909c; --accent-700: #dac1c8; --accent-soft: #2b2329; --accent-rgb: 198,164,174; --accent-2: #a6aebd; }
html:not([data-accent]) { --accent: #7070f6; --accent-600: #6161f2; --accent-700: #9a9bff; --accent-soft: #1b1d3a; --accent-rgb: 112,112,246; --accent-2: #2dd4bf; }

html[data-theme="light"] {
  color-scheme: light;
  --bg: #f5f6fb; --bg-1: #eef0fb; --bg-2: #f7f8fc;
  --surface: #ffffff; --surface-2: #f3f5fa; --surface-3: #eaeef6;
  --border: #e5e8f0; --border-2: #d3d9e6;
  --text: #18202f; --text-2: #4a5365; --muted: #79839a;
  --shadow-sm: 0 1px 2px rgba(20,27,45,.06);
  --shadow: 0 16px 44px rgba(28,36,60,.10);
  --shadow-lg: 0 26px 64px rgba(24,32,56,.16);
  --grid: rgba(60,70,100,.05);
}
html[data-theme="light"][data-accent="indigo"] { --accent: #5b5bf0; --accent-600: #4f46e5; --accent-700: #4338ca; --accent-soft: #ececff; --accent-rgb: 91,91,240; --accent-2: #0d9488; }
html[data-theme="light"][data-accent="rose"]   { --accent: #e23e7a; --accent-600: #d22d6b; --accent-700: #b21e56; --accent-soft: #ffe6ef; --accent-rgb: 226,62,122; --accent-2: #9333ea; }
html[data-theme="light"][data-accent="morandi"] { --accent: #9c7682; --accent-600: #876370; --accent-700: #6f505b; --accent-soft: #ece3e5; --accent-rgb: 156,118,130; --accent-2: #7e8b97; }

* { box-sizing: border-box; }
html, body { margin: 0; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } * { transition: none !important; animation: none !important; } }
body {
  font-family: var(--font); color: var(--text); background: var(--bg);
  -webkit-font-smoothing: antialiased; line-height: 1.6;
  min-height: 100vh;
}
/* pure-CSS backdrop: a cheap fixed gradient layer + faint grid that fades out.
   No raster image, no background-attachment repaint jank. */
body::before {
  content: ""; position: fixed; inset: 0; z-index: -2; pointer-events: none;
  background:
    radial-gradient(900px 540px at 12% -8%, rgba(var(--accent-rgb), .20), transparent 60%),
    radial-gradient(760px 520px at 98% 2%, rgba(var(--accent-rgb), .10), transparent 58%),
    linear-gradient(180deg, var(--bg-1), var(--bg-2));
}
body::after {
  content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none; opacity: .55;
  background-image: linear-gradient(var(--grid) 1px, transparent 1px), linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: 56px 56px;
  -webkit-mask-image: linear-gradient(180deg, #000, transparent 72%);
  mask-image: linear-gradient(180deg, #000, transparent 72%);
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.wrap { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 22px; }
.muted { color: var(--muted); }
section { scroll-margin-top: calc(var(--nav-h) + 16px); }

/* ---------- buttons / chips ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 44px; padding: 0 18px; border-radius: var(--r); border: 1px solid var(--border-2); background: var(--surface); color: var(--text); font-weight: 600; font-size: 14.5px; cursor: pointer; transition: transform .08s, background .15s, border-color .15s, box-shadow .15s; white-space: nowrap; }
.btn:hover { background: var(--surface-2); }
.btn:active { transform: translateY(1px); }
.btn-primary { background: linear-gradient(135deg, var(--accent), var(--accent-600)); border-color: transparent; color: var(--on-accent); box-shadow: 0 8px 24px rgba(var(--accent-rgb), .32); }
.btn-primary:hover { filter: brightness(1.06); background: linear-gradient(135deg, var(--accent), var(--accent-600)); }
.btn-sm { height: 38px; padding: 0 14px; font-size: 13.5px; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 5px 11px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--border); color: var(--text-2); font-size: 12.5px; font-weight: 500; }

/* ---------- header (slim sticky, condenses on scroll) ---------- */
.nav { position: sticky; top: 0; z-index: 60; height: var(--nav-h); background: color-mix(in srgb, var(--surface) 82%, transparent); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); border-bottom: 1px solid transparent; transition: height .22s var(--ease), background .22s, border-color .22s; }
.nav.scrolled { height: var(--nav-h-scrolled); border-bottom-color: var(--border); background: color-mix(in srgb, var(--surface) 92%, transparent); }
/* 顶栏项目多（dreamy 6 个导航 + 时钟/语言/主题/返回/用户），比正文列略宽，避免品牌名被挤截断。
 * 用 max(--maxw, 1360px)：宽屏(maxw≥1360)与正文同宽、完全对齐；正文较窄时顶栏单独放宽到 1360 容下所有项。 */
.nav-in { height: 100%; display: flex; align-items: center; gap: 14px; max-width: max(var(--maxw), 1360px); }
.brand { display: flex; align-items: center; gap: 11px; min-width: 0; flex: 0 1 auto; }
.logo { width: 38px; height: 38px; border-radius: 11px; flex: 0 0 auto; display: grid; place-items: center; font-weight: 800; color: #fff; background: linear-gradient(135deg, var(--accent), var(--accent-600)); box-shadow: 0 6px 18px rgba(var(--accent-rgb), .4); transition: width .22s var(--ease), height .22s var(--ease); }
.nav.scrolled .logo { width: 32px; height: 32px; }
.brand-txt { min-width: 0; }
.brand b { display: block; font-size: 14.5px; font-weight: 700; line-height: 1.2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.brand small { display: block; font-size: 11px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nav-links { display: flex; gap: 2px; margin-left: 6px; }
.nav-links a { padding: 8px 11px; border-radius: 9px; font-size: 14px; color: var(--text-2); font-weight: 500; white-space: nowrap; }
.nav-links a:hover { background: var(--surface-2); color: var(--text); }
.nav-sp { flex: 1 1 auto; min-width: 8px; }
.nav-actions { display: flex; align-items: center; gap: 9px; }
.clock { display: none; flex-direction: column; align-items: flex-end; line-height: 1.2; gap: 0; }
/* 实时时钟：精确到秒 + 等宽数字字体（更利落、跳秒不抖动） */
.clock b { font-family: ui-monospace, "SF Mono", "JetBrains Mono", "Cascadia Code", "Roboto Mono", Menlo, Consolas, monospace; font-size: 13px; font-weight: 600; font-variant-numeric: tabular-nums; letter-spacing: .6px; }
.clock small { color: var(--muted); font-size: 10.5px; white-space: nowrap; font-variant-numeric: tabular-nums; }
/* 顶栏项目较多（dreamy 有 6 个导航），窄于 1500px 时时钟先收起，避免把品牌名挤到截断；宽屏照常显示 */
@media (min-width: 1500px) { .clock { display: flex; } }
.seg { display: inline-flex; padding: 3px; border-radius: 10px; background: var(--surface-2); border: 1px solid var(--border); flex: 0 0 auto; }
.seg button { border: none; background: transparent; color: var(--muted); font-size: 12px; font-weight: 700; padding: 5px 9px; border-radius: 7px; cursor: pointer; }
.seg button[aria-pressed="true"] { background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm); }
.icon-btn { width: 38px; height: 38px; border-radius: 10px; border: 1px solid var(--border); background: var(--surface-2); color: var(--text-2); cursor: pointer; font-size: 16px; display: grid; place-items: center; flex: 0 0 auto; }
.icon-btn:hover { color: var(--text); }
.nav-tools { display: inline-flex; align-items: center; gap: 7px; height: 38px; padding: 0 13px; border-radius: 10px; background: var(--accent-soft); border: 1px solid var(--border-2); color: var(--accent-700); font-weight: 600; font-size: 13.5px; white-space: nowrap; }
.nav-cta { height: 38px; padding: 0 14px; border-radius: 10px; border: none; background: linear-gradient(135deg, var(--accent), var(--accent-600)); color: #fff; font-weight: 600; font-size: 13.5px; cursor: pointer; display: inline-flex; align-items: center; gap: 7px; white-space: nowrap; }
.menu-btn { display: none; width: 40px; height: 40px; border-radius: 10px; border: 1px solid var(--border); background: var(--surface-2); color: var(--text); cursor: pointer; align-items: center; justify-content: center; font-size: 19px; flex: 0 0 auto; }

/* mobile drawer */
.drawer-scrim { position: fixed; inset: 0; z-index: 70; background: rgba(5,8,16,.5); -webkit-backdrop-filter: blur(2px); backdrop-filter: blur(2px); opacity: 0; visibility: hidden; transition: opacity .2s; }
.drawer-scrim.open { opacity: 1; visibility: visible; }
.drawer { position: fixed; top: 0; right: 0; z-index: 71; height: 100%; width: min(86vw, 340px); background: var(--surface); border-left: 1px solid var(--border); box-shadow: var(--shadow-lg); transform: translateX(100%); transition: transform .26s var(--ease); display: flex; flex-direction: column; padding: 16px; gap: 6px; overflow-y: auto; }
.drawer.open { transform: translateX(0); }
.drawer-head { display: flex; align-items: center; justify-content: space-between; padding: 4px 4px 12px; border-bottom: 1px solid var(--border); margin-bottom: 8px; }
.drawer-head b { font-size: 15px; }
.drawer a.d-link, .drawer button.d-link { display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; padding: 13px 12px; border-radius: var(--r); border: none; background: transparent; color: var(--text); font-size: 15px; font-weight: 500; cursor: pointer; }
.drawer a.d-link:hover, .drawer button.d-link:hover { background: var(--surface-2); }
.drawer .d-sep { height: 1px; background: var(--border); margin: 8px 2px; }
.drawer .d-row { display: flex; align-items: center; gap: 10px; padding: 8px 4px; flex-wrap: wrap; }
.drawer .d-row .seg { flex: 1 1 auto; justify-content: center; }
.drawer .nav-tools, .drawer .nav-cta { height: 46px; justify-content: center; width: 100%; }
.drawer .nav-cta { margin-top: 4px; }
.drawer .d-clock { font-size: 12.5px; color: var(--muted); padding: 6px 6px 2px; font-variant-numeric: tabular-nums; }
body.no-scroll { overflow: hidden; }

/* ---------- hero ---------- */
.hero { display: grid; grid-template-columns: 1.15fr .85fr; gap: 36px; align-items: center; padding: 56px 0 32px; }
.badge { display: inline-flex; align-items: center; gap: 8px; padding: 6px 13px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--border); font-size: 12.5px; color: var(--text-2); font-weight: 500; }
.badge i { width: 7px; height: 7px; border-radius: 50%; background: var(--good); box-shadow: 0 0 0 4px var(--good-soft); }
.hero h1 { font-size: clamp(30px, 4.6vw, 50px); line-height: 1.1; margin: 18px 0 0; font-weight: 800; letter-spacing: -.5px; }
.hero h1 span.grad { background: linear-gradient(120deg, var(--accent-700), var(--accent-2)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero p.sub { margin: 18px 0 0; color: var(--text-2); font-size: 15.5px; max-width: 40em; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 26px; }
.hero-meta { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 26px; }
.meta-item { display: flex; flex-direction: column; gap: 3px; padding: 10px 14px; border-radius: var(--r); background: var(--surface); border: 1px solid var(--border); min-width: 130px; }
.meta-item .k { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .4px; }
.meta-item .v { font-size: 13.5px; font-weight: 600; }
button.meta-item { cursor: pointer; text-align: left; transition: border-color .15s, background .15s; font-family: inherit; }
button.meta-item:hover { border-color: var(--border-2); background: var(--surface-2); }
.like-heart { color: var(--pink); }
[data-like-button][aria-pressed="true"] { border-color: var(--pink); }

/* profile / spotlight card */
.profile { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-xl); padding: 22px; box-shadow: var(--shadow); overflow: hidden; }
.pf-top { display: flex; align-items: center; gap: 13px; }
.pf-top > .pf-id { flex: 1; min-width: 0; }
.avatar { width: 56px; height: 56px; border-radius: 16px; flex: 0 0 auto; display: grid; place-items: center; font-weight: 800; font-size: 18px; color: #fff; background: linear-gradient(135deg, var(--accent), var(--accent-2)); box-shadow: 0 8px 22px rgba(var(--accent-rgb), .4); }
.pf-top b { font-size: 15.5px; }
.pf-top small { display: block; color: var(--muted); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pf-badge { font-size: 11.5px; color: var(--good); background: var(--good-soft); border: 1px solid var(--good-bd); padding: 4px 10px; border-radius: 999px; font-weight: 600; white-space: nowrap; flex: 0 0 auto; }
.pf-rows { margin: 18px 0 0; display: flex; flex-direction: column; gap: 11px; }
.pf-row { display: flex; justify-content: space-between; gap: 12px; font-size: 13.5px; }
.pf-row .pk { color: var(--muted); } .pf-row .pv { color: var(--text); font-weight: 500; text-align: right; }
.pf-tags { display: flex; flex-wrap: wrap; gap: 7px; margin: 16px 0 0; }
.pf-foot { display: flex; align-items: center; justify-content: space-between; margin-top: 18px; padding-top: 15px; border-top: 1px solid var(--border); font-size: 11.5px; color: var(--muted); gap: 10px; }
.dot-on { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--good); margin-right: 6px; box-shadow: 0 0 0 3px var(--good-soft); }

/* ---------- sections ---------- */
.sec { padding: 48px 0; }
.sec-head { max-width: 680px; margin-bottom: 28px; }
.sec-head h2 { font-size: clamp(23px, 3vw, 32px); margin: 0; font-weight: 750; letter-spacing: -.3px; }
.sec-head p { margin: 9px 0 0; color: var(--muted); font-size: 15px; }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); padding: 22px; box-shadow: var(--shadow-sm); }

.two-col { display: grid; grid-template-columns: 1.3fr 1fr; gap: 18px; }
.two-col .card p { margin: 0; color: var(--text-2); font-size: 14.5px; }
.info-list { list-style: none; margin: 0; padding: 0; }
.info-list li { display: flex; justify-content: space-between; gap: 14px; padding: 12px 0; border-bottom: 1px solid var(--border); font-size: 14px; }
.info-list li:last-child { border-bottom: none; }
.info-list .ik { color: var(--muted); } .info-list .iv { color: var(--text); font-weight: 500; text-align: right; }

.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 18px; }
.feature { display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); padding: 20px; transition: transform .15s, border-color .15s; color: inherit; }
.feature .proj-link { margin-top: 14px; }
.feature:hover { transform: translateY(-3px); border-color: var(--border-2); }
.feature .fi { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; font-size: 20px; margin-bottom: 13px; background: var(--accent-soft); border: 1px solid var(--border); }
.feature h3 { margin: 0 0 6px; font-size: 15.5px; }
.feature p { margin: 0 0 12px; color: var(--muted); font-size: 13px; }
.feature .tags { display: flex; flex-wrap: wrap; gap: 6px; }

/* project cards */
.proj-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 18px; }
.proj { position: relative; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); padding: 24px; display: flex; flex-direction: column; gap: 13px; overflow: hidden; transition: transform .16s, border-color .16s, box-shadow .16s; }
.proj:hover { transform: translateY(-4px); border-color: var(--border-2); box-shadow: var(--shadow); }
.proj.flag { grid-column: 1 / -1; background: radial-gradient(600px 220px at 92% -10%, rgba(var(--accent-rgb), .16), transparent 60%), var(--surface); }
.proj.flag .proj-body { display: grid; grid-template-columns: 1.4fr .9fr; gap: 24px; align-items: center; }
/* 「已上线」徽标全站统一为绿色款（与旗舰卡的 .online-chip 一致），避免同义不同色引发歧义 */
.proj-badge { position: absolute; top: 16px; right: 16px; font-size: 11px; font-weight: 700; color: var(--good); background: var(--good-soft); border: 1px solid var(--good-bd); padding: 4px 10px; border-radius: 999px; }
.proj.flag .proj-badge { display: none; }
.proj h3 { margin: 0; font-size: 19px; font-weight: 750; letter-spacing: -.2px; padding-right: 70px; }
.proj.flag h3 { font-size: 24px; padding-right: 0; }
.proj .pd { margin: 0; color: var(--text-2); font-size: 14px; }
.proj-tags { display: flex; flex-wrap: wrap; gap: 7px; }
.ptag { font-size: 12px; padding: 4px 10px; border-radius: 8px; background: var(--surface-2); border: 1px solid var(--border); color: var(--text-2); }
.proj-link { display: inline-flex; align-items: center; gap: 7px; color: var(--accent-700); font-weight: 650; font-size: 14px; margin-top: auto; }
.proj-link:hover { gap: 10px; }
.online-chip { font-size: 11.5px; font-weight: 700; color: var(--good); background: var(--good-soft); border: 1px solid var(--good-bd); padding: 3px 10px; border-radius: 999px; white-space: nowrap; }

/* annotation-style preview visual (pure CSS) */
/* 配图别太高：描述字少时 4/3 会撑出一大片空白，改宽扁比例并封顶高度，与左侧文字高度大致齐平 */
.proj-visual { aspect-ratio: 16/10; max-height: 232px; border-radius: 14px; overflow: hidden; position: relative; border: 1px solid var(--border-2); background: radial-gradient(130% 120% at 78% 12%, rgba(125,211,252,.20), transparent 46%), radial-gradient(130% 120% at 12% 92%, rgba(129,140,248,.22), transparent 50%), linear-gradient(135deg, #16233f, #1d2b4d 55%, #141f3a); }
.viz-bar { position: absolute; top: 0; left: 0; right: 0; height: 24px; display: flex; align-items: center; gap: 6px; padding: 0 10px; background: rgba(8,13,26,.45); border-bottom: 1px solid rgba(255,255,255,.07); }
.viz-bar i { width: 7px; height: 7px; border-radius: 50%; }
.viz-title { margin-left: 5px; font-size: 10.5px; color: rgba(255,255,255,.62); font-weight: 600; letter-spacing: .2px; }
.bb { position: absolute; border-radius: 5px; border: 2.5px solid; }
.bb .bl { position: absolute; top: -20px; left: -2px; font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 5px; white-space: nowrap; box-shadow: 0 2px 8px rgba(0,0,0,.35); }
.bb.a { left: 13%; top: 34%; width: 37%; height: 44%; border-color: #34d399; background: rgba(52,211,153,.16); }
.bb.a .bl { background: #34d399; color: #04241e; }
.bb.b { right: 11%; bottom: 12%; width: 35%; height: 42%; border-color: #818cf8; background: rgba(129,140,248,.18); }
.bb.b .bl { background: #818cf8; color: #0b1020; }

/* toolbox teaser */
.toolbox { background: radial-gradient(520px 200px at 8% 0%, rgba(var(--accent-rgb), .12), transparent 60%), var(--surface); border: 1px solid var(--border); border-radius: var(--r-xl); padding: 26px; display: grid; grid-template-columns: 1fr auto; gap: 22px; align-items: center; }
.tb-tools { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 16px; }
.tb-tool { display: inline-flex; align-items: center; gap: 8px; padding: 9px 13px; border-radius: 11px; background: var(--surface-2); border: 1px solid var(--border); font-size: 13.5px; color: var(--text); font-weight: 500; transition: transform .12s, border-color .12s; }
.tb-tool:hover { transform: translateY(-2px); border-color: var(--border-2); }
.tb-cta { text-align: center; }

/* contact */
.contact-grid { display: grid; grid-template-columns: .9fr 1.1fr; gap: 18px; }
.social a { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 13px 0; border-bottom: 1px solid var(--border); font-size: 14px; }
.social a:last-child { border-bottom: none; }
.social .sl { color: var(--muted); display: flex; align-items: center; gap: 9px; }
.social .sv { color: var(--text); font-weight: 500; word-break: break-all; text-align: right; }
.social a:hover .sv { color: var(--accent-700); }
.contact-note { margin: 16px 0 0; color: var(--muted); font-size: 12.5px; }
.form { display: flex; flex-direction: column; gap: 14px; }
.fg { display: flex; flex-direction: column; gap: 6px; }
.fg label { font-size: 13px; color: var(--text-2); font-weight: 500; }
.form input, .form textarea { width: 100%; padding: 11px 13px; border-radius: var(--r); border: 1px solid var(--border-2); background: var(--surface-2); color: var(--text); font: inherit; font-size: 14px; transition: border-color .14s, box-shadow .14s; }
.form input:focus, .form textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.form textarea { resize: vertical; min-height: 108px; line-height: 1.55; }
.c-status { font-size: 12.5px; color: var(--muted); }
.c-status.success { color: var(--good); } .c-status.error { color: var(--danger); }

/* footer + to-top */
.footer { border-top: 1px solid var(--border); margin-top: 30px; padding: 26px 0; }
.footer-in { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; color: var(--muted); font-size: 13px; }
.footer-links { display: flex; gap: 18px; flex-wrap: wrap; }
.footer-links a:hover { color: var(--text); }
#toTop { position: fixed; right: 22px; bottom: 22px; width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--border-2); background: var(--surface); color: var(--text); font-size: 18px; cursor: pointer; box-shadow: var(--shadow); opacity: 0; transform: translateY(10px); transition: opacity .2s, transform .2s; z-index: 40; }
#toTop.show { opacity: 1; transform: translateY(0); }
/* 超管登录后右下角会多出「⚙ 管理后台」角标：把「回到顶部」箭头上移避让，两者上下错开、互不重叠（仅超管界面生效，普通用户不变） */
body.admin-badge-on #toTop { bottom: 74px; }

/* ---------- tool pages (unified with the homepage) ---------- */
.tool-main { padding: 32px 0 64px; }
.tool-head { max-width: 760px; margin-bottom: 24px; }
.tool-head .badge { margin-bottom: 14px; }
.tool-head h1 { font-size: clamp(24px, 3.4vw, 34px); margin: 0; font-weight: 780; letter-spacing: -.3px; }
.tool-head h1 .grad { background: linear-gradient(120deg, var(--accent-700), var(--accent-2)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.tool-head p { margin: 10px 0 0; color: var(--muted); font-size: 15px; line-height: 1.6; }
.tool-grid { display: grid; gap: 18px; }
.tool-grid.cols-2 { grid-template-columns: 1fr 1fr; }
.card h3.card-t { margin: 0 0 14px; font-size: 16px; font-weight: 650; }
.field { display: flex; flex-direction: column; gap: 7px; margin-bottom: 14px; }
.field:last-child { margin-bottom: 0; }
.field > label { font-size: 13px; color: var(--text-2); font-weight: 500; }
.t-input, .t-area, .t-select { width: 100%; padding: 11px 13px; border-radius: var(--r); border: 1px solid var(--border-2); background: var(--surface-2); color: var(--text); font: inherit; font-size: 14px; transition: border-color .14s, box-shadow .14s; }
.t-input:focus, .t-area:focus, .t-select:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.t-area { resize: vertical; min-height: 150px; line-height: 1.55; }
.t-area.code, .t-out.code { font-family: var(--mono); font-size: 13px; }
.t-out { width: 100%; min-height: 150px; padding: 11px 13px; border-radius: var(--r); border: 1px solid var(--border); background: var(--bg-1); color: var(--text); font: inherit; font-size: 14px; resize: vertical; line-height: 1.55; }
.t-out.big { min-height: 200px; }
.btn-row { display: flex; flex-wrap: wrap; gap: 9px; margin-top: 14px; }
.opt-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 10px; }
.opt { display: flex; align-items: center; gap: 9px; padding: 11px 13px; border-radius: var(--r); border: 1px solid var(--border); background: var(--surface-2); cursor: pointer; font-size: 13.5px; user-select: none; transition: border-color .14s, background .14s; }
.opt:hover { border-color: var(--border-2); }
.opt input { width: 17px; height: 17px; accent-color: var(--accent); cursor: pointer; flex: 0 0 auto; }
.opt.range { flex-direction: column; align-items: stretch; gap: 8px; cursor: default; }
.opt.range .opt-top { display: flex; align-items: center; justify-content: space-between; }
.opt.range input[type="range"] { width: 100%; accent-color: var(--accent); height: 18px; }
.t-result { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-radius: var(--r); border: 1px solid var(--border-2); background: var(--surface-2); font-family: var(--mono); font-size: 16px; word-break: break-all; min-height: 22px; }
.t-result .v { flex: 1; color: var(--text); }
.t-meta { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.t-meta .chip { font-variant-numeric: tabular-nums; }
.copy-btn { flex: 0 0 auto; }
.t-status { font-size: 12.5px; color: var(--muted); margin-top: 10px; min-height: 16px; }
.t-status.ok { color: var(--good); } .t-status.err { color: var(--danger); }
.strength { height: 7px; border-radius: 999px; background: var(--surface-3); overflow: hidden; margin-top: 12px; }
.strength > i { display: block; height: 100%; width: 0; border-radius: 999px; transition: width .25s, background .25s; }
@media (max-width: 820px) { .tool-grid.cols-2 { grid-template-columns: 1fr; } }

/* reveal-on-scroll */
.reveal { opacity: 0; transform: translateY(14px); transition: opacity .5s var(--ease), transform .5s var(--ease); }
.reveal.in { opacity: 1; transform: none; }

/* ---------- responsive ---------- */
@media (max-width: 980px) {
  .nav-links, .nav-actions { display: none; }
  .menu-btn { display: flex; }
  .hero { grid-template-columns: 1fr; gap: 26px; padding: 32px 0 16px; }
  .two-col, .contact-grid, .toolbox { grid-template-columns: 1fr; }
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
  .grid-2, .proj-grid { grid-template-columns: 1fr; }
  .proj.flag .proj-body { grid-template-columns: 1fr; }
}
@media (max-width: 600px) {
  .wrap { padding: 0 16px; }
  .grid-4, .grid-3 { grid-template-columns: 1fr; }
  .hero-meta { gap: 8px; }
  .meta-item { min-width: calc(50% - 4px); flex: 1 1 calc(50% - 4px); }
  .sec { padding: 38px 0; }
  .proj.flag h3 { font-size: 21px; }
  .footer-in { flex-direction: column; align-items: flex-start; }
}

/* ============================================================
 * modern polish — richer hero, accent section titles, lively cards
 * ============================================================ */
.hero { position: relative; }
.hero::before {
  content: ""; position: absolute; z-index: -1; left: -8%; top: -18%; width: 56%; height: 150%;
  background: radial-gradient(closest-side, rgba(var(--accent-rgb), .16), transparent 72%);
  filter: blur(6px); pointer-events: none;
}
.hero h1 { font-size: clamp(34px, 5vw, 56px); }
.hero h1 .grad { text-shadow: 0 8px 40px rgba(var(--accent-rgb), .22); }
.badge { background: color-mix(in srgb, var(--surface-2) 70%, transparent); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); }
.sec-head h2 { display: flex; align-items: center; gap: 13px; }
.sec-head h2::before { content: ""; flex: 0 0 auto; width: 5px; height: 1.05em; border-radius: 3px; background: linear-gradient(180deg, var(--accent), var(--accent-2)); }
.card, .feature, .proj, .profile { transition: transform .18s var(--ease), border-color .18s, box-shadow .18s; }
.feature:hover, .proj:hover { box-shadow: 0 20px 54px rgba(var(--accent-rgb), .12); }
.feature, .proj, .toolbox, .profile { position: relative; }
.proj.flag::after, .profile::after {
  content: ""; position: absolute; inset: 0 0 auto 0; height: 3px; border-radius: var(--r-lg) var(--r-lg) 0 0;
  background: linear-gradient(90deg, var(--accent), var(--accent-2)); opacity: .85; pointer-events: none;
}
/* 注意：这条线只有 3px 高，border-radius 会被自身高度钳到 ~3px，靠它自己永远贴不上卡片的大圆角。
   真正让线贴合圆角的是卡片自身的 overflow:hidden 裁剪——.proj 本就有，.profile 之前漏了（已在上面补上）。 */
.btn-primary { box-shadow: 0 10px 26px rgba(var(--accent-rgb), .34); }
.meta-item, .chip { -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }

/* ============================================================
 * fluid / adaptive typography — comfortably larger on phones
 * (the px sizes that read fine on desktop are too small on mobile)
 * ============================================================ */
/* 引言/副标题字号抬高：与下调后的大标题更协调（标题:副标题 ≈ 2–2.8×，不再是 4× 的突兀落差） */
.hero p.sub { font-size: clamp(16px, 1.4vw, 18px); line-height: 1.7; }
.sec-head p { font-size: clamp(15px, 1.05vw, 16.5px); }
@media (max-width: 760px) {
  body { font-size: 16px; line-height: 1.65; }
  .hero p.sub { font-size: 16px; line-height: 1.7; }
  .sec-head p { font-size: 15.5px; }
  .pd, .proj .pd { font-size: 15px; line-height: 1.65; }
  .two-col .card p, .feature p { font-size: 15px; }
  .info-list li, .pf-row { font-size: 15px; }
  .meta-item .v { font-size: 15px; } .meta-item .k { font-size: 12px; }
  .chip, .ptag { font-size: 13px; }
  .nav-tools, .drawer .d-link { font-size: 16px; }
  .social a, .social .sv { font-size: 15px; }
  .tool-head p { font-size: 16px; line-height: 1.7; }
  .card h3.card-t, .feature h3 { font-size: 16.5px; }
  .field > label, .opt, .t-meta .chip { font-size: 15px; }
  /* 16px inputs stop iOS Safari from auto-zooming on focus */
  .t-input, .t-area, .t-select, .t-out, .form input, .form textarea { font-size: 16px; }
  .footer-in, .footer-links { font-size: 14px; }
}
@media (max-width: 420px) {
  .hero h1 { font-size: clamp(28px, 9vw, 34px); }
  .meta-item { min-width: 100%; flex: 1 1 100%; }
}

/* ============================================================
 * large / high-res screens — scale the whole design UP so it
 * fills 2K / 4K comfortably without the user zooming the browser.
 * Bigger container + bigger type + taller header at tiered widths.
 * ============================================================ */
/* 大标题收一档：原 hero 70px / 区块 40px 在宽屏上过于夸张、与正文/副标题脱节。
   收到 hero≤52px、区块≤32px，配合上面抬高的副标题，整页节奏更现代、更协调。 */
.hero h1 { font-size: clamp(33px, 3.5vw, 52px); line-height: 1.12; }
.sec-head h2 { font-size: clamp(22px, 2vw, 32px); }
@media (min-width: 1500px) {
  :root { --maxw: 1300px; --nav-h: 68px; --nav-h-scrolled: 58px; }
  body { font-size: 16.5px; }
  .hero p.sub { font-size: 18px; }
  .sec-head p { font-size: 16.5px; }
  .nav-links a { font-size: 14.5px; } .brand b { font-size: 15.5px; }
  .pd, .proj .pd { font-size: 14.5px; }
  .feature p, .two-col .card p, .info-list li, .pf-row { font-size: 14.5px; }
  .chip, .ptag { font-size: 13px; } .tool-head p { font-size: 16.5px; }
}
@media (min-width: 1920px) {
  :root { --maxw: 1380px; --nav-h: 74px; --nav-h-scrolled: 62px; }
  body { font-size: 18px; line-height: 1.66; }
  .hero { gap: 48px; padding: 70px 0 40px; }
  .hero p.sub { font-size: 18.5px; line-height: 1.7; }
  .sec-head p { font-size: 17.5px; }
  .nav-links a { font-size: 16px; } .nav-tools, .nav-cta { font-size: 15px; height: 42px; }
  .brand b { font-size: 17px; } .brand small { font-size: 12px; } .logo { width: 42px; height: 42px; }
  .pd, .proj .pd { font-size: 16px; line-height: 1.66; }
  .feature p, .two-col .card p, .info-list li, .pf-row { font-size: 16px; }
  .chip, .ptag { font-size: 14px; } .meta-item .v { font-size: 15.5px; } .meta-item .k { font-size: 12px; }
  .card, .feature, .proj { padding: 26px 28px; }
  .sec { padding: 60px 0; } .tool-head p { font-size: 18px; }
  .t-input, .t-area, .t-select, .t-out, .form input, .form textarea { font-size: 15.5px; }
}
@media (min-width: 2400px) {
  :root { --maxw: 1480px; --nav-h: 82px; }
  body { font-size: 20px; }
  .hero p.sub { font-size: 20.5px; }
  .sec-head p { font-size: 19.5px; }
  .nav-links a { font-size: 17.5px; } .brand b { font-size: 19px; } .logo { width: 46px; height: 46px; }
  .pd, .proj .pd, .feature p, .info-list li, .pf-row { font-size: 17.5px; }
  .chip, .ptag { font-size: 15px; }
  .sec { padding: 74px 0; }
}

/* ============================================================
 * round8 可读性协调 —— 表单/控件/小 UI 的字号在“所有宽度”整体抬高一档，
 * 让它们与放大后的标题更协调（注册/工具/后台等卡片里的提示文字不再偏小）。
 * 这些选择器没有出现在上面的高分屏分级里，放在文件末尾全宽生效、不冲突。
 * 取值 ≥ 移动端块的对应值，避免回退手机端体验。
 * ============================================================ */
.btn { font-size: 15px; }
.btn-sm { font-size: 14px; }
.badge { font-size: 13.5px; }
.chip, .ptag { font-size: 13px; }
.fg label, .field > label { font-size: 15px; }
.form input, .form textarea, .t-input, .t-area, .t-select { font-size: 16px; }
.c-status { font-size: 14px; }
.t-status { font-size: 13.5px; }
.card h3.card-t { font-size: 16.5px; }
.feature p { font-size: 14.5px; }
.info-list li, .pf-row, .social a { font-size: 14.5px; }
.opt { font-size: 14.5px; }
/* 分段控件：语言切换略放大；注册/登录这类“标签页”要明显可读（之前只有 12px） */
.seg button { font-size: 13.5px; }
.seg.tabs button { font-size: 16px; font-weight: 750; padding: 11px 9px; }
.brand small { font-size: 12px; }
.clock small { font-size: 11.5px; }
.pf-top small, .pf-foot, .proj-badge, .online-chip, .pf-badge { font-size: 12px; }

/* ============================================================
 * round11: 通用登录/账户控件（persona.js 注入到每个页面的 .nav-actions），
 * 通用时钟、Cookie 同意条 —— 让工具箱等二级页面与未来服务都自动具备。
 * ============================================================ */
.nav-auth { display: inline-flex; align-items: center; }
.nav-user { display: inline-flex; align-items: center; gap: 7px; height: 38px; padding: 0 6px 0 12px; border-radius: 10px; background: var(--accent-soft); border: 1px solid var(--border-2); color: var(--accent-700); font-weight: 600; font-size: 13.5px; white-space: nowrap; }
.nav-user .nu-name { max-width: 120px; overflow: hidden; text-overflow: ellipsis; }
.nav-user .nu-logout { border: none; background: transparent; color: var(--muted); cursor: pointer; font: inherit; font-size: 12.5px; padding: 4px 8px; border-left: 1px solid var(--border-2); border-radius: 0 8px 8px 0; }
.nav-user .nu-logout:hover { color: var(--danger); background: var(--surface-2); }
.nav-clock { display: inline-flex; flex-direction: column; align-items: flex-end; line-height: 1.05; padding-right: 4px; }
.cookie-bar { position: fixed; left: 50%; bottom: 18px; transform: translateX(-50%); z-index: 70; max-width: min(94vw, 640px); display: flex; align-items: center; gap: 14px; padding: 12px 18px; border-radius: 16px; background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow); font-size: 13.5px; color: var(--text-2); }
.cookie-bar .ck-ok { flex: 0 0 auto; }
.d-auth { display: flex; flex-direction: column; gap: 4px; }
.d-auth .d-user { padding: 11px 12px; font-size: 14.5px; color: var(--text-2); }
.d-auth .d-user b { color: var(--text); }
.d-auth .d-login, .d-auth .d-logout { display: block; width: 100%; text-align: left; padding: 13px 12px; border-radius: var(--r); border: none; background: transparent; color: var(--text); font-size: 15px; font-weight: 500; cursor: pointer; text-decoration: none; }
.d-auth .d-logout { color: var(--danger); }
@media (max-width: 760px) {
  /* 手机端：顶栏注入的时钟/登录态会挤占空间，交给抽屉里的账户区即可 */
  .nav-clock, #personaAuth { display: none; }
}
/* round11 #6a 原意：防超宽内容把页面撑出横向滚动。但在 html/body 上设 overflow-x(无论 hidden 还是 clip)
 * 都会副作用——hidden 破坏顶栏 sticky，clip 在 Chrome 下连竖向滚动一起废掉。
 * 改用"治本"：根上完全不设 overflow-x（竖向滚动 + sticky 都原生正常），横向溢出靠下方的
 * max-width 容器 + 文字强制换行(overflow-wrap)在源头消除，不再需要在根上裁剪。 */
html, body { max-width: 100%; }
/* ⚠ 这里只能约束 main，绝不能把 .wrap 也设成 max-width:100%——那会覆盖上面 .wrap{max-width:var(--maxw)}
 * 的居中容器，导致全站内容拉满整屏、贴边、像没加载完。横向溢出已由 .wrap 自身的 maxw + 文字 overflow-wrap 兜住。 */
main { max-width: 100%; }
/* round23h: 顶栏悬挂式（桌面/平板生效）；手机窄屏不悬挂，省竖向空间 */
/* round23h: 顶栏悬挂式（桌面/平板生效）；手机窄屏不悬挂，省竖向空间 */
.nav { position: -webkit-sticky; position: sticky; top: 0; }
@media (max-width: 600px) { .nav { position: static; } }
@media (max-width: 760px) {
  .hero h1, .sec-head h2, .brand b { overflow-wrap: anywhere; word-break: break-word; }
  .sub, .pd, .proj .pd, .feature p, .info-list li, .two-col .card p, .social a, .social .sv, td, .contact-note { overflow-wrap: break-word; word-break: break-word; }
  .wrap, .hero, .sec, main { min-width: 0; max-width: 100%; }
}
/* round12: 多窗口登录态变化提示 */
.persona-note { position: fixed; left: 50%; top: 18px; transform: translateX(-50%) translateY(-12px); z-index: 80; max-width: 90vw; padding: 11px 18px; border-radius: 12px; background: var(--danger); color: #fff; font-size: 13.5px; font-weight: 600; box-shadow: var(--shadow); opacity: 0; pointer-events: none; transition: opacity .25s, transform .25s; }
.persona-note.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* round14: 主题三态分段控件（浅/深/系统）+ 通用密码框内眼睛 */
.theme-seg button { font-size: 14.5px; line-height: 1; padding: 5px 8px; }
.theme-seg button[aria-pressed="true"], .seg button[aria-pressed="true"] { background: var(--accent-soft); color: var(--accent-700); }
.pw-eye { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); border: none; background: transparent; cursor: pointer; font-size: 17px; line-height: 1; opacity: .55; padding: 4px; color: var(--text-2); }
.pw-eye:hover { opacity: .9; }
