/* ============================================================
   zerotop · 极简中性（明 / 暗）
   无渐变 / 无 emoji / 线性图标 / 系统字体
   ============================================================ */

:root {
    --fg:        #0a0a0a;
    --fg-2:      #1d1d1f;
    --bg:        #ffffff;
    --surface:   #f5f5f7;
    --surface-2: #ededf0;
    --line:      #d2d2d7;
    --line-2:    #e8e8ec;
    --muted:     #86868b;
    --accent:    #0a0a0a;
    --on-accent: #ffffff;
    --ring:      #0a0a0a;
    --ring-soft: rgba(10, 10, 10, .12);
    --ok:        #1a7f43;
    --ok-bg:     #f1faf4;
    --ok-line:   #bfe0cb;
    --warn:      #9a5b00;
    --warn-bg:   #fdf8f0;
    --warn-line: #ecd7b6;
    --err:       #b3261e;
    --shadow:    0 1px 2px rgba(0, 0, 0, .04);
    --shadow-lg: 0 10px 30px rgba(0, 0, 0, .10);
    --radius:    10px;
}

@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
        --fg:        #f5f5f7;
        --fg-2:      #e8e8ed;
        --bg:        #0a0a0a;
        --surface:   #16161a;
        --surface-2: #1e1e24;
        --line:      #303038;
        --line-2:    #232329;
        --muted:     #8a8a92;
        --accent:    #f5f5f7;
        --on-accent: #0a0a0a;
        --ring:      #f5f5f7;
        --ring-soft: rgba(245, 245, 247, .16);
        --ok:        #4ec27d;
        --ok-bg:     #0f1a14;
        --ok-line:   #1f3a2a;
        --warn:      #d9a54a;
        --warn-bg:   #1a150d;
        --warn-line: #3a2f1c;
        --err:       #ff6b62;
        --shadow:    0 1px 2px rgba(0, 0, 0, .5);
        --shadow-lg: 0 10px 30px rgba(0, 0, 0, .6);
    }
}

[data-theme="dark"] {
    --fg:        #f5f5f7;
    --fg-2:      #e8e8ed;
    --bg:        #0a0a0a;
    --surface:   #16161a;
    --surface-2: #1e1e24;
    --line:      #303038;
    --line-2:    #232329;
    --muted:     #8a8a92;
    --accent:    #f5f5f7;
    --on-accent: #0a0a0a;
    --ring:      #f5f5f7;
    --ring-soft: rgba(245, 245, 247, .16);
    --ok:        #4ec27d;
    --ok-bg:     #0f1a14;
    --ok-line:   #1f3a2a;
    --warn:      #d9a54a;
    --warn-bg:   #1a150d;
    --warn-line: #3a2f1c;
    --err:       #ff6b62;
    --shadow:    0 1px 2px rgba(0, 0, 0, .5);
    --shadow-lg: 0 10px 30px rgba(0, 0, 0, .6);
}

* { box-sizing: border-box; }

html, body { margin: 0; padding: 0; }

body {
    background: var(--bg);
    color: var(--fg);
    font: 15px/1.55 -apple-system, BlinkMacSystemFont, "SF Pro Text",
          "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", system-ui, sans-serif;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    transition: background-color .2s ease, color .2s ease;
}

.mono {
    font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
    letter-spacing: .01em;
}

/* ---------------------------------------------------------- 图标 */

.i {
    width: 16px;
    height: 16px;
    flex: 0 0 auto;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.5;
    stroke-linecap: round;
    stroke-linejoin: round;
    vertical-align: -2px;
}

.ico.big .i { width: 28px; height: 28px; stroke-width: 1.25; }

/* ---------------------------------------------------------- 顶栏 */

.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 16px 32px;
    border-bottom: 1px solid var(--line-2);
    background: var(--bg);
}

.brand {
    font-size: 15px;
    font-weight: 600;
    letter-spacing: -.01em;
    color: var(--fg);
    text-decoration: none;
}

.top-right {
    display: flex;
    align-items: center;
    gap: 18px;
}

.top-actions {
    display: flex;
    align-items: center;
    gap: 18px;
    flex-wrap: wrap;
}

.link-quiet {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--muted);
    text-decoration: none;
    font-size: 14px;
    padding: 4px 0;
    transition: color .14s ease;
}

.link-quiet:hover { color: var(--fg); }

.theme-btn {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    border: 1px solid transparent;
    transition: background .14s ease, border-color .14s ease, transform .14s ease;
}

.theme-btn:hover { background: var(--surface); border-color: var(--line-2); }
.theme-btn:active { transform: scale(.94); }

/* ---------------------------------------------------------- 布局 */

.wrap {
    flex: 1;
    width: 100%;
    max-width: 780px;
    margin: 0 auto;
    padding: 44px 24px 64px;
}

.foot {
    padding: 22px;
    text-align: center;
    color: var(--muted);
    font-size: 12px;
    border-top: 1px solid var(--line-2);
}

/* ---------------------------------------------------------- 卡片 */

.card {
    background: var(--bg);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 28px;
    box-shadow: var(--shadow);
    animation: rise .26s cubic-bezier(.2, .7, .3, 1) both;
}

@keyframes rise {
    from { opacity: 0; transform: translateY(6px); }
    to   { opacity: 1; transform: none; }
}

.card.narrow { max-width: 430px; margin: 0 auto; }
.card.center { text-align: center; }

.card-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 18px;
}

h1 {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0 0 8px;
    font-size: 20px;
    font-weight: 600;
    letter-spacing: -.015em;
}

h2 { margin: 22px 0 12px; font-size: 15px; font-weight: 600; }

p { margin: 8px 0 20px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.nowrap { white-space: nowrap; }
.right { text-align: right; }

.divider { height: 1px; background: var(--line-2); margin: 22px 0; }

/* ---------------------------------------------------------- 表单 */

.field { display: block; margin-bottom: 16px; }

.field-label {
    display: block;
    font-size: 13px;
    color: var(--muted);
    margin-bottom: 6px;
}

input[type="text"],
input[type="url"],
input[type="password"],
input[type="number"],
select {
    width: 100%;
    padding: 11px 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--bg);
    color: var(--fg);
    font-size: 15px;
    font-family: inherit;
    transition: border-color .15s ease, box-shadow .15s ease, background .15s ease;
    appearance: none;
}

input::placeholder { color: var(--muted); opacity: .7; }

input:hover, select:hover { border-color: var(--muted); }

input:focus, select:focus {
    outline: none;
    border-color: var(--ring);
    box-shadow: 0 0 0 3px var(--ring-soft);
}

select {
    background-image: none;
    padding-right: 34px;
}

select.mini {
    width: auto;
    padding: 4px 22px 4px 8px;
    font-size: 12px;
    border-radius: 6px;
}

.grid2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

#code {
    font-size: 17px;
    letter-spacing: .08em;
    text-transform: uppercase;
    padding: 14px;
    text-align: center;
}

/* ------------------------------------------------ 自绘下拉 */

.select { position: relative; }

.select-btn {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 11px 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--bg);
    color: var(--fg);
    font: inherit;
    font-size: 15px;
    cursor: pointer;
    transition: border-color .15s ease, box-shadow .15s ease, background .15s ease;
}

.select-btn:hover { border-color: var(--muted); }

.select.open .select-btn {
    border-color: var(--ring);
    box-shadow: 0 0 0 3px var(--ring-soft);
}

.select-btn .i { color: var(--muted); transition: transform .18s ease; }
.select.open .select-btn .i { transform: rotate(180deg); }

.select-list {
    position: absolute;
    z-index: 20;
    left: 0;
    right: 0;
    top: calc(100% + 6px);
    margin: 0;
    padding: 4px;
    list-style: none;
    background: var(--bg);
    border: 1px solid var(--line);
    border-radius: 10px;
    box-shadow: var(--shadow-lg);
    opacity: 0;
    transform: translateY(-6px) scale(.985);
    transform-origin: top center;
    pointer-events: none;
    transition: opacity .15s ease, transform .15s cubic-bezier(.2, .7, .3, 1);
}

.select.open .select-list {
    opacity: 1;
    transform: none;
    pointer-events: auto;
}

.select-list li {
    padding: 9px 10px;
    border-radius: 6px;
    font-size: 14px;
    cursor: pointer;
    transition: background .12s ease;
}

.select-list li:hover,
.select-list li:focus-visible { background: var(--surface); outline: none; }

.select-list li.on {
    background: var(--surface-2);
    font-weight: 600;
}

/* ---------------------------------------------------------- 按钮 */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 11px 18px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--bg);
    color: var(--fg);
    font-size: 14px;
    font-weight: 500;
    font-family: inherit;
    text-decoration: none;
    cursor: pointer;
    transition: background .14s ease, border-color .14s ease, transform .12s ease, opacity .14s ease;
}

.btn:hover { background: var(--surface); }
.btn:active { transform: scale(.985); }

.btn.primary {
    background: var(--accent);
    border-color: var(--accent);
    color: var(--on-accent);
}

.btn.primary:hover { opacity: .88; }
.btn.block { width: 100%; }
.btn.ghost { background: var(--bg); }

.ibtn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    padding: 0;
    border: 1px solid transparent;
    border-radius: 6px;
    background: transparent;
    color: var(--muted);
    cursor: pointer;
    transition: background .14s ease, color .14s ease, border-color .14s ease, transform .12s ease;
}

.ibtn:hover { background: var(--surface); color: var(--fg); border-color: var(--line-2); }
.ibtn:active { transform: scale(.92); }

.inline { display: inline-flex; align-items: center; gap: 4px; }

/* ---------------------------------------------------------- 反馈 */

.err, .ok {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    margin: 0 0 16px;
    animation: rise .22s ease both;
}

.err { color: var(--err); }
.ok { color: var(--ok); }

.notice {
    padding: 10px 14px;
    margin-bottom: 18px;
    border: 1px solid var(--line-2);
    border-radius: 8px;
    background: var(--surface);
    color: var(--fg-2);
    font-size: 14px;
    animation: rise .26s ease both;
}

.hints {
    list-style: none;
    margin: 24px 0 0;
    padding: 20px 0 0;
    border-top: 1px solid var(--line-2);
    color: var(--muted);
    font-size: 13px;
}

.hints li { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.hints li:last-child { margin-bottom: 0; }

/* ---------------------------------------------------------- 键值 */

.kv {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 16px 24px;
    margin: 0;
}

.kv dt { font-size: 12px; color: var(--muted); margin-bottom: 3px; }
.kv dd { margin: 0; font-size: 14px; }

/* ---------------------------------------------------------- 下载 */

.dl {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    flex-wrap: wrap;
}

.dl-meta { display: flex; align-items: center; gap: 12px; }

.ico-wrap {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 8px;
    background: var(--surface);
    color: var(--fg-2);
    transition: background .15s ease;
}

.dl-name { font-size: 14px; }

/* ---------------------------------------------------------- 统计 */

.stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(96px, 1fr));
    gap: 1px;
    margin-bottom: 22px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    overflow: hidden;
    background: var(--line);
    animation: rise .26s ease both;
}

.stat {
    background: var(--bg);
    padding: 14px 16px;
    display: flex;
    flex-direction: column;
    gap: 2px;
    transition: background .15s ease;
}

.stat:hover { background: var(--surface); }
.stat b { font-size: 18px; font-weight: 600; letter-spacing: -.02em; }

/* ---------------------------------------------------------- 表格 */

.filters {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
    flex-wrap: wrap;
    align-items: center;
}

.filters input { width: auto; flex: 1 1 160px; }
.filters .select { min-width: 130px; flex: 0 1 150px; }
.filters .select-btn { padding: 9px 12px; font-size: 14px; }

.table-wrap {
    overflow-x: auto;
    border: 1px solid var(--line);
    border-radius: 8px;
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

thead th {
    text-align: left;
    font-weight: 500;
    color: var(--muted);
    font-size: 12px;
    padding: 10px 12px;
    border-bottom: 1px solid var(--line);
    white-space: nowrap;
    background: var(--surface);
}

tbody td {
    padding: 11px 12px;
    border-bottom: 1px solid var(--line-2);
    vertical-align: middle;
    transition: background .12s ease;
}

tbody tr:last-child td { border-bottom: none; }
tbody tr:hover td { background: var(--surface); }

.masked {
    border: none;
    background: none;
    padding: 0;
    font: inherit;
    color: var(--fg);
    cursor: pointer;
    text-decoration: underline dotted var(--line);
    text-underline-offset: 3px;
    transition: color .14s ease;
}

.masked:hover { color: var(--fg-2); }

.badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 12px;
    border: 1px solid;
}

.badge.ok   { color: var(--ok);   border-color: var(--ok-line);   background: var(--ok-bg); }
.badge.warn { color: var(--warn); border-color: var(--warn-line); background: var(--warn-bg); }
.badge.off  { color: var(--muted); border-color: var(--line);      background: var(--surface); }

/* ---------------------------------------------------------- 分页 */

.pager {
    display: flex;
    gap: 4px;
    justify-content: center;
    margin-top: 18px;
    flex-wrap: wrap;
}

.pg {
    padding: 6px 11px;
    border: 1px solid var(--line);
    border-radius: 6px;
    font-size: 13px;
    color: var(--fg);
    text-decoration: none;
    transition: background .14s ease, border-color .14s ease, transform .12s ease;
}

.pg:hover { background: var(--surface); }
.pg:active { transform: scale(.96); }
.pg.on { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }

/* ---------------------------------------------------------- 代码块 */

.codes {
    margin: 0 0 12px;
    padding: 16px;
    background: var(--surface);
    border: 1px solid var(--line-2);
    border-radius: 8px;
    font-size: 13px;
    line-height: 1.9;
    color: var(--fg);
    overflow-x: auto;
    user-select: all;
}

/* ---------------------------------------------------------- 移动端 */

@media (max-width: 640px) {
    .topbar { padding: 13px 16px; }
    .wrap { padding: 26px 16px 48px; }
    .card { padding: 20px; }
    .grid2 { grid-template-columns: 1fr; gap: 0; }
    .top-actions { gap: 12px; }
    .top-actions .link-quiet span { display: none; }
}

/* ---------------------------------------------------------- 动效降级 */

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: .001ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: .001ms !important;
    }
}
