@font-face { font-family: "Space Grotesk"; src: url("/assets/space-grotesk.woff2") format("woff2"); font-weight: 300 700; font-display: swap; }
@font-face { font-family: "JetBrains Mono"; src: url("/assets/jetbrains-mono.woff2") format("woff2"); font-weight: 100 800; font-display: swap; }

:root {
  --bg-rgb: 255, 255, 255; --fg-rgb: 0, 0, 0;
  --blue: #0066ff; --signal: #8cff00;
  --bg: rgb(var(--bg-rgb)); --fg: rgb(var(--fg-rgb));
  --fg-2: rgba(var(--fg-rgb), .62); --fg-3: rgba(var(--fg-rgb), .38);
  --line: rgba(var(--fg-rgb), .12); --card: rgba(var(--fg-rgb), .035);
  --f-sans: "Space Grotesk", "HarmonyOS Sans SC", "PingFang SC", "Microsoft YaHei", "Noto Sans SC", sans-serif;
  --f-mono: "JetBrains Mono", ui-monospace, Consolas, monospace;
  --ease: cubic-bezier(.16, 1, .3, 1); --jelly: cubic-bezier(.34, 1.8, .5, 1);
  --pad: clamp(16px, 5vw, 72px);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) { --bg-rgb: 0, 0, 0; --fg-rgb: 255, 255, 255; --signal: #d4ff3a; --line: rgba(255,255,255,.14); --card: rgba(255,255,255,.05); color-scheme: dark; }
}
:root[data-theme="dark"] { --bg-rgb: 0, 0, 0; --fg-rgb: 255, 255, 255; --signal: #d4ff3a; --line: rgba(255,255,255,.14); --card: rgba(255,255,255,.05); color-scheme: dark; }

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body { margin: 0; min-height: 100vh; background: var(--bg); color: var(--fg); font-family: var(--f-sans); font-size: 16px; line-height: 1.7; -webkit-font-smoothing: antialiased; overflow-x: hidden; transition: background-color .4s, color .4s; }
a { color: inherit; text-decoration: none; }
button, input { font: inherit; color: inherit; }
button { background: none; border: 0; padding: 0; cursor: pointer; }
h1, h2, h3, p, ul { margin: 0; }
ul { padding: 0; list-style: none; }
::selection { background: var(--blue); color: #fff; }
:focus-visible { outline: 2px solid var(--blue); outline-offset: 3px; border-radius: 6px; }
.mono { font-family: var(--f-mono); }

/* 顶栏 */
.nav { position: sticky; top: 0; z-index: 50; display: flex; align-items: center; justify-content: space-between; gap: 16px; height: 68px; padding: 0 var(--pad); background: rgba(var(--bg-rgb), .72); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; letter-spacing: .04em; }
.brand img { width: 26px; height: 26px; }
.brand small { font-family: var(--f-mono); font-weight: 400; font-size: 12px; color: var(--fg-3); letter-spacing: .1em; }
.nav-links { display: flex; align-items: center; gap: clamp(14px, 3vw, 34px); font-size: 14px; color: var(--fg-2); }
.nav-links a:hover { color: var(--fg); }
.theme { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: rgba(var(--fg-rgb), .07); }
.theme:hover { background: rgba(var(--fg-rgb), .14); }
@media (max-width: 640px) { .brand small, .nav-links .hide-sm { display: none; } }

/* 按钮、标签 */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .5em; height: 46px; padding: 0 24px; border-radius: 999px; background: var(--blue); color: #fff; font-weight: 600; white-space: nowrap; transition: transform .5s var(--jelly), background-color .3s; }
.btn:hover { transform: scale(1.05); }
.btn:active { transform: scale(.95); transition-duration: .12s; }
.btn .arr { transition: transform .4s var(--jelly); }
.btn:hover .arr { transform: translateX(4px); }
.btn-ghost { background: rgba(var(--fg-rgb), .08); color: var(--fg); }
.btn-ghost:hover { background: rgba(var(--fg-rgb), .14); }
.btn-sm { height: 34px; padding: 0 14px; font-size: 13px; }
.btn-danger { background: #e5484d; }
.chip { display: inline-flex; align-items: center; height: 34px; padding: 0 16px; border-radius: 999px; border: 1px solid var(--line); font-size: 14px; color: var(--fg-2); transition: all .35s var(--jelly); cursor: pointer; }
.chip:hover { color: var(--fg); transform: translateY(-2px); }
.chip.on { background: var(--blue); border-color: var(--blue); color: #fff; }
.tag { font-family: var(--f-mono); font-size: 11px; padding: 2px 8px; border-radius: 999px; background: rgba(var(--fg-rgb), .07); color: var(--fg-2); }

/* 首屏 */
.hero { padding: clamp(64px, 14vh, 150px) var(--pad) clamp(48px, 9vh, 100px); max-width: 1200px; margin: 0 auto; }
.eyebrow { font-family: var(--f-mono); font-size: 13px; letter-spacing: .2em; text-transform: uppercase; color: var(--fg-3); }
.eyebrow b { color: var(--blue); font-weight: 400; margin-right: 12px; }
.hero h1 { margin-top: 18px; font-size: clamp(36px, 7vw, 84px); line-height: 1.08; letter-spacing: -.02em; font-weight: 700; }
.hero h1 em { font-style: normal; color: var(--blue); }
.hero .lead { margin-top: 24px; max-width: 640px; font-size: clamp(16px, 1.6vw, 19px); color: var(--fg-2); }
.hero .cta { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 36px; }
.mark { display: inline-block; padding: 0 .2em; background: var(--signal); color: #000; border-radius: 4px; }

/* 区块 */
.section { max-width: 1200px; margin: 0 auto; padding: clamp(48px, 9vh, 100px) var(--pad); border-top: 1px solid var(--line); }
.section h2 { margin-top: 12px; font-size: clamp(26px, 4vw, 44px); line-height: 1.2; letter-spacing: -.01em; }
.section h2 em { font-style: normal; color: var(--blue); }
.section .sub { margin-top: 12px; color: var(--fg-2); max-width: 680px; }
.steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; margin-top: 36px; }
.step { padding: 24px; border-radius: 20px; background: var(--card); border: 1px solid var(--line); }
.step .n { font-family: var(--f-mono); color: var(--blue); font-size: 13px; }
.step h3 { margin: 10px 0 6px; font-size: 19px; }
.step p { color: var(--fg-2); font-size: 15px; }

/* 搜索 + 分类 + 卡片 */
.search { display: flex; align-items: center; gap: 10px; margin-top: 32px; height: 54px; padding: 0 8px 0 20px; border-radius: 999px; border: 1px solid var(--line); background: var(--card); max-width: 640px; }
.search:focus-within { border-color: var(--blue); }
.search input { flex: 1; min-width: 0; border: 0; outline: 0; background: none; font-size: 16px; }
.cats { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; margin-top: 28px; }
.card { display: flex; flex-direction: column; gap: 10px; padding: 22px; border-radius: 20px; background: var(--card); border: 1px solid var(--line); transition: transform .5s var(--jelly), border-color .3s; min-width: 0; }
.card:hover { transform: translateY(-4px); border-color: var(--blue); }
.card .top { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.card .cat { font-size: 12px; color: var(--blue); font-family: var(--f-mono); }
.card .id { font-size: 12px; color: var(--fg-3); font-family: var(--f-mono); }
.card h3 { font-size: 18px; line-height: 1.35; overflow-wrap: anywhere; }
.card p { font-size: 14px; color: var(--fg-2); overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.card .tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: auto; }
.empty { margin-top: 28px; padding: 40px 20px; text-align: center; color: var(--fg-3); border: 1px dashed var(--line); border-radius: 20px; }

/* 发行 */
.publish { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 24px; padding: clamp(24px, 4vw, 44px); border-radius: 28px; background: var(--blue); color: #fff; }
.publish h2 { margin: 0; color: #fff; }
.publish p { margin-top: 8px; opacity: .82; }
.publish .btn { background: #fff; color: var(--blue); }

footer { max-width: 1200px; margin: 0 auto; padding: 36px var(--pad) 48px; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; color: var(--fg-3); font-size: 13px; border-top: 1px solid var(--line); }
footer a:hover { color: var(--fg); }

/* 管理页 */
.panel { max-width: 960px; margin: 0 auto; padding: clamp(40px, 8vh, 80px) var(--pad); }
.box { margin-top: 24px; padding: clamp(18px, 3vw, 28px); border-radius: 22px; background: var(--card); border: 1px solid var(--line); }
.code { margin: 18px 0; font-family: var(--f-mono); font-size: clamp(26px, 6vw, 44px); font-weight: 700; letter-spacing: .04em; overflow-wrap: anywhere; }
.code b { color: var(--blue); }
.muted { color: var(--fg-2); font-size: 14px; }
.row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.between { justify-content: space-between; }
.site-head h3 { font-size: 20px; overflow-wrap: anywhere; }
.site-head a.u { font-family: var(--f-mono); font-size: 13px; color: var(--blue); overflow-wrap: anywhere; }
.switch { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; cursor: pointer; user-select: none; }
.switch input { appearance: none; width: 40px; height: 24px; border-radius: 999px; background: rgba(var(--fg-rgb), .18); position: relative; cursor: pointer; transition: background .3s; margin: 0; }
.switch input::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; transition: transform .35s var(--jelly); box-shadow: 0 1px 3px rgba(0,0,0,.25); }
.switch input:checked { background: var(--blue); }
.switch input:checked::after { transform: translateX(16px); }
.files { margin-top: 16px; width: 100%; border-collapse: collapse; font-size: 14px; table-layout: fixed; }
.files td { padding: 9px 6px; border-top: 1px solid var(--line); vertical-align: middle; }
.files td.p { font-family: var(--f-mono); font-size: 13px; overflow-wrap: anywhere; }
.files td.s { width: 84px; color: var(--fg-3); font-family: var(--f-mono); font-size: 12px; text-align: right; }
.files td.a { width: 112px; text-align: right; white-space: nowrap; }
.files td.a button { font-size: 13px; color: var(--blue); margin-left: 10px; }
.files td.a button.del { color: #e5484d; }
.files tr.dir td.p { color: var(--fg-3); }
.admin-table { width: 100%; border-collapse: collapse; font-size: 13px; margin-top: 12px; }
.admin-table th, .admin-table td { text-align: left; padding: 8px 6px; border-top: 1px solid var(--line); }
.admin-table th { color: var(--fg-3); font-weight: 400; font-family: var(--f-mono); font-size: 12px; }
.scroll-x { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.toast { position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%) translateY(20px); opacity: 0; padding: 10px 20px; border-radius: 999px; background: var(--fg); color: var(--bg); font-size: 14px; transition: all .4s var(--ease); pointer-events: none; z-index: 99; max-width: calc(100% - 32px); }
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.hidden { display: none !important; }

/* 主题图标：浅色显示月亮，深色显示太阳 */
.theme { color: var(--fg); }
.theme svg { display: block; }
.theme .i-sun { display: none; }
[data-theme="dark"] .theme .i-sun { display: block; }
[data-theme="dark"] .theme .i-moon { display: none; }

/* 管理页：项目列表 / 项目详情 */
.proj-list { display: grid; gap: 12px; margin-top: 16px; }
.proj { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; padding: 14px 16px; border-radius: 16px; border: 1px solid var(--line); background: rgba(var(--fg-rgb), .02); }
.proj .info { flex: 1 1 220px; min-width: 0; cursor: pointer; }
.proj .info h4 { font-size: 17px; overflow-wrap: anywhere; }
.proj .info .u { font-family: var(--f-mono); font-size: 12px; color: var(--fg-3); overflow-wrap: anywhere; }
.proj .info:hover h4 { color: var(--blue); }
.proj.off .info h4 { color: var(--fg-3); text-decoration: line-through; }
.newp { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 16px; }
.newp input { flex: 1 1 180px; min-width: 0; padding: 10px 14px; border-radius: 999px; border: 1px solid var(--line); background: var(--bg); color: var(--fg); font: inherit; font-family: var(--f-mono); font-size: 14px; }
.crumb { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 4px; font-size: 14px; }
.crumb button { color: var(--blue); }

/* 流量统计 */
.spark-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 4px; }
.spark { display: block; }
.tchart { margin-top: 20px; padding: 16px; border-radius: 16px; border: 1px solid var(--line); }
.tkpi { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.tkpi .k { font-size: 12px; color: var(--fg-3); }
.tkpi .v { font-family: var(--f-mono); font-size: clamp(20px, 4vw, 28px); font-weight: 600; font-variant-numeric: tabular-nums; }
.legend { display: flex; gap: 14px; flex-wrap: wrap; margin: 14px 0 6px; font-size: 12px; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 5px; vertical-align: middle; }
.tchart svg.big { width: 100%; height: auto; display: block; }
.tchart .ax { font-size: 10px; fill: var(--fg-3); font-family: var(--f-mono); }
.tchart .bar:hover rect + rect { opacity: .75; }
