:root {
    --bg: #f5f6fa;
    --surface: #ffffff;
    --text: #1c2430;
    --muted: #6a7386;
    --line: #e6e9f1;
    --primary: #4f46e5;
    --primary-dark: #4338ca;
    --primary-soft: #eef0ff;
    --green: #0f9d6e;
    --green-soft: #e7f7f1;
    --amber: #b45309;
    --amber-soft: #fef3c7;
    --red: #dc2626;
    --red-soft: #fee2e2;
    --violet: #7c3aed;
    --radius: 14px;
    --shadow: 0 1px 2px rgba(17, 24, 39, .04), 0 10px 30px -14px rgba(17, 24, 39, .14);
}

* { box-sizing: border-box; }

html {
    -webkit-text-size-adjust: 100%;
    scroll-behavior: smooth;
}

body {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    font-size: 15px;
}

a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-dark); }
img { max-width: 100%; }
h1, h2, h3 { line-height: 1.3; margin: 0; }
code, .mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace; }

.container { width: min(1180px, 92vw); margin: 0 auto; }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.nowrap { white-space: nowrap; }
.center { text-align: center; }
.danger-text { color: var(--red) !important; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 220px; }

/* ---------- Buttons ---------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    border: 1px solid transparent;
    border-radius: 10px;
    padding: 9px 16px;
    font-size: 14px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: background .15s, border-color .15s, color .15s;
    background: #fff;
    color: var(--text);
    white-space: nowrap;
}
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); color: #fff; }
.btn-outline { border-color: var(--line); background: #fff; color: var(--text); }
.btn-outline:hover { border-color: #c9cede; background: #fafbff; color: var(--text); }
.btn-ghost { background: transparent; color: var(--muted); }
.btn-ghost:hover { background: #f0f2f8; color: var(--text); }
.btn-danger-ghost { background: transparent; color: var(--red); }
.btn-danger-ghost:hover { background: var(--red-soft); color: var(--red); }
.btn-sm { padding: 6px 12px; font-size: 13px; border-radius: 8px; }
.btn-xs { padding: 3px 8px; font-size: 12.5px; border-radius: 7px; }
.btn-block { width: 100%; }
.inline-form { display: inline; margin: 0; }

/* ---------- Topbar ---------- */
.topbar {
    background: rgba(255, 255, 255, .92);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--line);
    position: sticky;
    top: 0;
    z-index: 40;
}
.topbar-inner { display: flex; align-items: center; gap: 28px; height: 64px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); font-weight: 800; font-size: 17px; }
.brand:hover { color: var(--text); }
.brand-mark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: 10px;
    background: linear-gradient(135deg, #4f46e5, #8b5cf6);
    color: #fff;
    box-shadow: 0 6px 14px -4px rgba(79, 70, 229, .5);
    flex: none;
}
.brand-mark svg { width: 20px; height: 20px; }
.brand-sub { color: var(--muted); font-weight: 600; margin-left: 2px; }
.main-nav { display: flex; gap: 6px; flex: 1; }
.main-nav a { padding: 8px 14px; border-radius: 999px; color: var(--muted); font-weight: 600; font-size: 14px; }
.main-nav a:hover { background: #f1f3f9; color: var(--text); }
.main-nav a.active { background: var(--primary-soft); color: var(--primary); }
.topbar-actions { display: flex; align-items: center; gap: 10px; margin-left: auto; }

/* ---------- Layout / headings ---------- */
.page { padding: 32px 0 48px; }
.page-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 22px;
    flex-wrap: wrap;
}
.page-head h1 { font-size: 26px; font-weight: 800; letter-spacing: -.02em; }
.page-sub { color: var(--muted); margin: 6px 0 0; font-size: 13.5px; }
.back-link { display: inline-block; color: var(--muted); font-size: 13px; margin-bottom: 8px; }
.back-link:hover { color: var(--primary); }
.title-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.page-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

/* ---------- Cards ---------- */
.card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
}
.card + .card { margin-top: 18px; }
.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 17px 22px;
    border-bottom: 1px solid var(--line);
    flex-wrap: wrap;
}
.card-title { font-size: 16px; font-weight: 700; }
.card-body { padding: 22px; }

/* ---------- Alerts ---------- */
.alert { border-radius: 12px; padding: 12px 16px; font-size: 14px; margin-bottom: 18px; border: 1px solid transparent; }
.alert a { font-weight: 600; text-decoration: underline; }
.alert-success { background: var(--green-soft); color: #0a6b4c; border-color: #c9efe3; }
.alert-success a { color: #0a6b4c; }
.alert-error { background: var(--red-soft); color: #991b1b; border-color: #fecaca; }
.alert-warning { background: var(--amber-soft); color: #92400e; border-color: #fde68a; }
.alert-inline { margin: 0 0 14px; }
.flash-wrap { margin-top: 18px; }
.flash-wrap .alert { margin-bottom: 0; }

/* ---------- Stats ---------- */
.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 22px; }
.stat-card {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 18px 20px;
    display: flex;
    align-items: center;
    gap: 14px;
    box-shadow: var(--shadow);
}
.stat-icon { width: 42px; height: 42px; border-radius: 12px; display: flex; align-items: center; justify-content: center; flex: none; }
.stat-icon svg { width: 20px; height: 20px; }
.stat-icon.blue { background: #e8efff; color: #2563eb; }
.stat-icon.green { background: var(--green-soft); color: var(--green); }
.stat-icon.violet { background: #f2ecff; color: var(--violet); }
.stat-icon.amber { background: #fff4e5; color: #d97706; }
.stat-label { font-size: 13px; color: var(--muted); }
.stat-value { font-size: 24px; font-weight: 800; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; font-size: 14px; min-width: 860px; }
.data-table th {
    text-align: left;
    font-size: 12px;
    letter-spacing: .04em;
    color: var(--muted);
    padding: 12px 18px;
    background: #fafbfd;
    border-bottom: 1px solid var(--line);
    font-weight: 600;
    white-space: nowrap;
}
.data-table td { padding: 13px 18px; border-bottom: 1px solid #eef0f6; vertical-align: middle; }
.data-table tr:last-child td { border-bottom: none; }
.data-table tbody tr:hover { background: #fafbff; }
.data-table .num { text-align: right; font-variant-numeric: tabular-nums; }
.actions-col { text-align: right; }
.row-actions { display: flex; gap: 2px; justify-content: flex-end; align-items: center; flex-wrap: wrap; }
.name-cell { display: flex; gap: 12px; align-items: center; min-width: 190px; }
.name-link { font-weight: 600; color: var(--text); }
.name-link:hover { color: var(--primary); }
.qr-mini { width: 34px; height: 34px; border: 1px solid var(--line); border-radius: 8px; background: #fff; padding: 2px; flex: none; }
.slug-code { background: #f3f4f9; border-radius: 7px; padding: 2px 8px; font-size: 12.5px; color: #475069; white-space: nowrap; }

/* ---------- Pills / badges ---------- */
.pill {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
}
.pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.pill-green { background: var(--green-soft); color: #0b7a58; }
.pill-gray { background: #eef0f5; color: #687080; }
.pill-amber { background: var(--amber-soft); color: #a16207; }
.badge { display: inline-flex; align-items: center; padding: 2px 9px; border-radius: 6px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.badge-blue { background: #e8efff; color: #1d4ed8; }
.badge-violet { background: #f2ecff; color: #6d28d9; }
.badge-green { background: var(--green-soft); color: #0b7a58; }

/* ---------- Empty state ---------- */
.empty-state { padding: 56px 24px; text-align: center; }
.empty-state h3 { font-size: 17px; margin-bottom: 6px; }
.empty-state p { color: var(--muted); margin: 0 0 18px; font-size: 14px; }
.empty-state.compact { padding: 32px 20px; }
.empty-art {
    width: 64px;
    height: 64px;
    margin: 0 auto 16px;
    border-radius: 18px;
    background: var(--primary-soft);
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
}
.empty-art svg { width: 30px; height: 30px; }

/* ---------- Forms ---------- */
.stack { display: flex; flex-direction: column; gap: 16px; }
.stack-tight { display: flex; flex-direction: column; gap: 8px; }
.field { display: flex; flex-direction: column; gap: 6px; font-weight: 600; min-width: 0; }
.field > span { font-size: 13px; color: #4a5264; }
.field input,
.field textarea,
.field select {
    width: 100%;
    min-width: 0;
    border: 1px solid #d8dce8;
    border-radius: 10px;
    padding: 10px 12px;
    font: inherit;
    font-weight: 400;
    color: var(--text);
    background: #fff;
    transition: border-color .15s, box-shadow .15s;
    outline: none;
}
.field input:focus,
.field textarea:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(79, 70, 229, .12); }
.field input::placeholder,
.field textarea::placeholder { color: #a3a9b8; }
.field textarea { resize: vertical; min-height: 60px; }
.help { font-size: 12.5px; color: var(--muted); font-weight: 400; }
.error-text { font-size: 12.5px; color: var(--red); font-style: normal; font-weight: 500; }
.field-full { grid-column: 1 / -1; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.form-grid > * { min-width: 0; }
.form-layout { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 20px; align-items: start; }
.form-main { display: flex; flex-direction: column; gap: 18px; min-width: 0; }
.form-main .card + .card { margin-top: 0; }
.form-side { display: flex; flex-direction: column; gap: 18px; position: sticky; top: 88px; }
.form-side .card + .card { margin-top: 0; }
.form-actions { display: flex; flex-direction: column; gap: 8px; }
.divider { height: 1px; background: var(--line); margin: 18px 0; }

.slug-group {
    display: flex;
    align-items: stretch;
    border: 1px solid #d8dce8;
    border-radius: 10px;
    overflow: hidden;
    background: #fff;
    transition: border-color .15s, box-shadow .15s;
}
.slug-group:focus-within { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(79, 70, 229, .12); }
.slug-prefix {
    padding: 10px 0 10px 12px;
    color: var(--muted);
    font-size: 12.5px;
    font-weight: 400;
    background: #f8f9fc;
    white-space: nowrap;
    display: flex;
    align-items: center;
    flex: 0 1 auto;
    min-width: 0;
    max-width: 60%;
    overflow: hidden;
    text-overflow: ellipsis;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
.slug-group input {
    flex: 1 1 70px;
    width: auto;
    border: none !important;
    box-shadow: none !important;
    border-radius: 0 !important;
    padding-left: 4px;
    min-width: 0;
}
.slug-group .btn { border: none; border-left: 1px solid var(--line); border-radius: 0; }

.mode-group { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.mode-option { position: relative; min-width: 0; }
.mode-option input { position: absolute; opacity: 0; pointer-events: none; }
.mode-card {
    display: flex;
    flex-direction: column;
    gap: 3px;
    border: 1px solid #dfe3ee;
    border-radius: 12px;
    padding: 12px 14px;
    cursor: pointer;
    transition: .15s;
    background: #fff;
    font-weight: 400;
}
.mode-card strong { font-size: 14px; }
.mode-card small { color: var(--muted); font-size: 12.5px; line-height: 1.45; }
.mode-option input:checked + .mode-card {
    border-color: var(--primary);
    background: var(--primary-soft);
    box-shadow: 0 0 0 1px var(--primary) inset;
}
.mode-option input:focus-visible + .mode-card { outline: 2px solid var(--primary); outline-offset: 2px; }

.dest-list { display: flex; flex-direction: column; gap: 10px; }
.dest-row {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 10px;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: #fbfcfe;
}
.dest-index {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--primary-soft);
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 700;
    margin-bottom: 8px;
    flex: none;
}
.field-sm { gap: 4px; }
.field-sm > span { font-size: 12px; color: var(--muted); }
.field-sm input { padding: 8px 10px; border-radius: 8px; }
.dest-row .dest-label-field { flex: 1 1 130px; min-width: 110px; }
.dest-row .field-grow { flex: 2 1 240px; min-width: 190px; }
.dest-row .weight-field { flex: 0 0 78px; }
.dest-remove {
    color: var(--muted);
    font-size: 18px;
    line-height: 1;
    height: 36px;
    width: 32px;
    padding: 0;
    margin-bottom: 1px;
    flex: none;
}
.dest-remove:hover { background: var(--red-soft); color: var(--red); }
.rotate-hint { margin-top: 0; margin-bottom: 12px; }

.switch-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; cursor: pointer; }
.switch-row small { display: block; color: var(--muted); font-weight: 400; font-size: 12.5px; }
.switch { position: relative; display: inline-flex; flex: none; }
.switch input { position: absolute; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; z-index: 2; }
.switch-track { width: 44px; height: 25px; border-radius: 999px; background: #d5d9e5; position: relative; transition: .18s; }
.switch-track::after {
    content: "";
    position: absolute;
    top: 3px;
    left: 3px;
    width: 19px;
    height: 19px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, .2);
    transition: .18s;
}
.switch input:checked + .switch-track { background: var(--primary); }
.switch input:checked + .switch-track::after { transform: translateX(19px); }

/* ---------- Detail ---------- */
.detail-grid { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr); gap: 18px; margin-bottom: 18px; }
.detail-grid .card { margin-top: 0; }
.qr-body { display: flex; flex-direction: column; align-items: center; gap: 14px; }
.qr-frame { border: 1px solid var(--line); border-radius: 16px; padding: 12px; background: #fff; box-shadow: 0 10px 24px -16px rgba(20, 25, 60, .3); }
.qr-frame img { display: block; width: 220px; height: 220px; }
.copy-row { display: flex; gap: 8px; width: 100%; max-width: 430px; }
.copy-row input {
    flex: 1;
    min-width: 0;
    border: 1px solid #d8dce8;
    border-radius: 9px;
    padding: 8px 10px;
    font-size: 12.5px;
    background: #f8f9fc;
    color: #3f4757;
}
.qr-actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; }
.mini-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.mini-stats > div { background: #f8f9fd; border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; }
.mini-stats span { display: block; font-size: 12px; color: var(--muted); margin-bottom: 2px; }
.mini-stats strong { font-size: 20px; font-weight: 800; font-variant-numeric: tabular-nums; }
.mini-stats .mini-time { font-size: 13px; font-weight: 600; line-height: 1.4; word-break: break-all; }
.meta-line { display: flex; justify-content: space-between; gap: 16px; padding: 10px 0; border-top: 1px dashed var(--line); font-size: 13.5px; margin-top: 10px; }
.meta-line:first-child { border-top: none; margin-top: 0; }
.meta-line > span:first-child { color: var(--muted); flex: none; }
.meta-line > span:last-child,
.meta-line > a { text-align: right; word-break: break-all; }
.dest-view-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.dest-view-list li { display: flex; gap: 12px; align-items: flex-start; padding-bottom: 12px; border-bottom: 1px solid #f0f2f7; }
.dest-view-list li:last-child { border-bottom: none; padding-bottom: 0; }
.dest-num {
    width: 26px;
    height: 26px;
    border-radius: 8px;
    background: var(--primary-soft);
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 700;
    flex: none;
}
.dest-view-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.dest-view-main .mono { font-size: 12.5px; word-break: break-all; }
.qr-inline { display: flex; justify-content: center; padding: 8px 0; }
.chart { display: flex; align-items: flex-end; gap: 10px; height: 196px; padding-top: 10px; }
.chart-col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 8px; height: 100%; justify-content: flex-end; min-width: 0; }
.chart-value { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.chart-track { width: 100%; max-width: 46px; height: 130px; background: #f5f6fa; border-radius: 8px; display: flex; align-items: flex-end; overflow: hidden; }
.chart-bar { width: 100%; border-radius: 8px; background: linear-gradient(180deg, #8b7cf6, #4f46e5); min-height: 3px; }
.chart-label { font-size: 12px; color: var(--muted); white-space: nowrap; }

/* ---------- Settings ---------- */
.settings-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; align-items: start; }
.settings-grid .card { margin-top: 0; }

/* ---------- Auth ---------- */
.auth-section { min-height: calc(100vh - 64px - 80px); display: flex; align-items: center; justify-content: center; padding: 48px 0; }
.auth-card { width: min(420px, 92vw); padding: 34px 32px; border-radius: 18px; }
.auth-icon {
    width: 54px;
    height: 54px;
    border-radius: 16px;
    background: linear-gradient(135deg, #4f46e5, #8b5cf6);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 18px;
    box-shadow: 0 12px 26px -10px rgba(79, 70, 229, .6);
}
.auth-icon svg { width: 28px; height: 28px; }
.auth-card h1 { font-size: 22px; margin-bottom: 6px; }
.auth-sub { color: var(--muted); font-size: 14px; margin: 0 0 22px; }
.auth-note { margin: 20px 0 0; font-size: 12.5px; color: var(--muted); line-height: 1.6; border-top: 1px dashed var(--line); padding-top: 16px; }
.auth-note code { background: #f2f3f8; padding: 1px 5px; border-radius: 4px; }

/* ---------- Landing page ---------- */
.hero {
    padding: 72px 0 60px;
    position: relative;
    overflow: hidden;
    background:
        radial-gradient(800px 400px at 85% -10%, rgba(99, 102, 241, .16), transparent 60%),
        radial-gradient(600px 300px at 0% 110%, rgba(16, 185, 129, .10), transparent 60%);
}
.hero-grid { display: grid; grid-template-columns: 1.05fr .95fr; gap: 48px; align-items: center; }
.eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 999px;
    padding: 6px 13px;
    font-size: 12.5px;
    font-weight: 600;
    color: #4b5266;
    box-shadow: var(--shadow);
}
.eyebrow-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 3px rgba(15, 157, 110, .14); }
.hero h1 { font-size: clamp(36px, 4.6vw, 56px); font-weight: 900; letter-spacing: -.03em; line-height: 1.1; margin: 20px 0 18px; }
.grad { background: linear-gradient(100deg, #4f46e5, #8b5cf6 55%, #06b6d4); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero-sub { font-size: 16px; color: #5b6375; max-width: 520px; margin: 0 0 26px; line-height: 1.75; }
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; }
.hero-actions .btn { padding: 11px 22px; font-size: 15px; border-radius: 11px; }
.hero-points { display: flex; gap: 18px; margin-top: 22px; font-size: 13px; color: var(--muted); flex-wrap: wrap; }
.hero-points span { display: flex; align-items: center; gap: 6px; }
.hero-points span::before { content: "✓"; color: var(--green); font-weight: 700; }
.hero-visual { position: relative; display: flex; justify-content: center; padding: 20px 0; }
.visual-card {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 22px;
    box-shadow: 0 30px 60px -24px rgba(31, 41, 90, .3), 0 10px 30px -18px rgba(31, 41, 90, .2);
    padding: 18px;
    width: min(320px, 100%);
    transform: rotate(-2deg);
}
.visual-head { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 700; color: #555e72; padding: 2px 4px 12px; }
.visual-dot { width: 9px; height: 9px; border-radius: 50%; background: linear-gradient(135deg, #4f46e5, #8b5cf6); }
.qr-art { background: #f7f8fc; border-radius: 16px; padding: 18px; }
.qr-art svg { display: block; width: 100%; height: auto; }
.visual-foot { display: flex; align-items: center; gap: 8px; padding: 13px 4px 2px; font-size: 13px; color: #414a5c; font-weight: 600; }
.live-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 4px rgba(15, 157, 110, .15); animation: pulse 2s infinite; }
@keyframes pulse {
    0%, 100% { box-shadow: 0 0 0 4px rgba(15, 157, 110, .15); }
    50% { box-shadow: 0 0 0 7px rgba(15, 157, 110, .05); }
}
.visual-chip {
    position: absolute;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 10px 14px;
    font-size: 12.5px;
    font-weight: 600;
    color: #4a5264;
    box-shadow: var(--shadow);
}
.chip-a { left: 0; bottom: 38px; transform: rotate(-2deg); }
.chip-a strong { display: block; font-size: 18px; color: var(--text); }
.chip-b { right: 2%; top: 10px; transform: rotate(3deg); background: #1f2430; color: #fff; border-color: #1f2430; }
.section { padding: 64px 0; }
.section-soft { background: #fff; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.section-head { text-align: center; max-width: 560px; margin: 0 auto 36px; }
.section-head h2 { font-size: clamp(24px, 3vw, 32px); font-weight: 800; letter-spacing: -.02em; margin-bottom: 8px; }
.section-head p { color: var(--muted); margin: 0; }
.feature-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.feature-card { background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 26px; box-shadow: var(--shadow); }
.feature-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: var(--primary-soft);
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 16px;
}
.feature-icon svg { width: 22px; height: 22px; }
.feature-card h3 { font-size: 17px; margin-bottom: 8px; }
.feature-card p { color: var(--muted); font-size: 14px; margin: 0; line-height: 1.7; }
.step-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.step-list li { display: flex; gap: 14px; align-items: flex-start; }
.step-list li > span {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: #fff;
    border: 1px solid var(--line);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    color: var(--primary);
    flex: none;
    box-shadow: var(--shadow);
}
.step-list h3 { font-size: 15px; margin-bottom: 4px; }
.step-list p { color: var(--muted); font-size: 13.5px; margin: 0; }
.cta-band { padding: 56px 0; }
.cta-inner {
    background: linear-gradient(120deg, #312e81, #4f46e5 55%, #7c3aed);
    border-radius: 20px;
    padding: 38px 42px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    color: #fff;
    box-shadow: 0 24px 50px -20px rgba(79, 70, 229, .5);
}
.cta-inner h2 { font-size: 22px; margin-bottom: 4px; }
.cta-inner p { margin: 0; color: rgba(255, 255, 255, .78); font-size: 14px; }
.cta-inner .btn { background: #fff; color: #312e81; }
.cta-inner .btn:hover { background: #eef0ff; }

/* ---------- Site footer ---------- */
.site-footer { margin-top: auto; border-top: 1px solid var(--line); background: #fff; padding: 22px 0; }
.footer-inner { display: flex; justify-content: space-between; gap: 12px; font-size: 13px; color: var(--muted); flex-wrap: wrap; }
.public-body { min-height: 100vh; display: flex; flex-direction: column; }
.public-body main { flex: 1; }
.admin-body { min-height: 100vh; display: flex; flex-direction: column; }
.admin-body main { flex: 1; }
.admin-footer { border-top: 1px solid var(--line); padding: 20px 0; color: #8a91a3; font-size: 12.5px; text-align: center; background: #fff; }

/* ---------- Message page ---------- */
.message-body { background: radial-gradient(700px 350px at 50% -10%, rgba(99, 102, 241, .12), transparent 60%), var(--bg); }
.message-wrap { min-height: 80vh; display: flex; align-items: center; justify-content: center; padding: 60px 20px; }
.message-card {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 18px;
    box-shadow: var(--shadow);
    padding: 40px 36px;
    max-width: 440px;
    width: 100%;
    text-align: center;
}
.message-icon {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: var(--amber-soft);
    color: var(--amber);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    font-weight: 800;
    margin: 0 auto 18px;
}
.message-icon.danger { background: var(--red-soft); color: var(--red); }
.message-card h1 { font-size: 21px; margin-bottom: 8px; }
.message-card p { color: var(--muted); font-size: 14px; margin: 0 0 22px; line-height: 1.7; }
.message-brand {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 26px;
    padding-top: 18px;
    border-top: 1px dashed var(--line);
    font-size: 12.5px;
    color: var(--muted);
    font-weight: 600;
}
.message-brand .brand-mark { width: 26px; height: 26px; border-radius: 8px; }
.message-brand .brand-mark svg { width: 16px; height: 16px; }

/* ---------- Responsive ---------- */
@media (max-width: 1024px) {
    .hero-grid { grid-template-columns: 1fr; gap: 32px; }
    .hero-visual { order: 2; }
    .stat-grid { grid-template-columns: repeat(2, 1fr); }
    .form-layout { grid-template-columns: 1fr; }
    .form-side { position: static; flex-direction: row; flex-wrap: wrap; }
    .form-side .card { flex: 1 1 280px; }
    .feature-grid { grid-template-columns: 1fr; }
    .step-list { grid-template-columns: 1fr; gap: 18px; }
    .detail-grid { grid-template-columns: 1fr; }
    .settings-grid { grid-template-columns: 1fr; }
}

@media (max-width: 700px) {
    .topbar-inner { height: auto; padding: 12px 0; flex-wrap: wrap; gap: 10px; }
    .main-nav { order: 3; flex: 1 1 100%; width: 100%; overflow-x: auto; gap: 4px; }
    .main-nav a { flex: 0 0 auto; white-space: nowrap; }
    .topbar-actions { margin-left: auto; }
    .page { padding-top: 22px; }
    .page-head { align-items: flex-start; }
    .form-grid { grid-template-columns: minmax(0, 1fr); }
    .stat-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
    .stat-card { padding: 14px; gap: 10px; }
    .stat-value { font-size: 20px; }
    .card-body { padding: 18px; }
    .qr-frame img { width: 190px; height: 190px; }
    .cta-inner { flex-direction: column; text-align: center; padding: 30px 24px; }
    .mode-group { grid-template-columns: minmax(0, 1fr); }
    .copy-row { flex-direction: column; }
    .dest-row { padding: 10px; }
    .chart { gap: 5px; }
    .chart-track { max-width: 34px; }
    .hero { padding: 48px 0 40px; }
    .hero-actions .btn { flex: 1; }
    .section { padding: 46px 0; }
    .chip-a { display: none; }
    .chip-b { right: -2px; top: -4px; }

    .codes-table { min-width: 0; }
    .codes-table thead { display: none; }
    .codes-table tbody,
    .codes-table tr,
    .codes-table td { display: block; width: 100%; }
    .codes-table tr {
        display: flex;
        flex-wrap: wrap;
        align-items: center;
        gap: 8px 10px;
        padding: 14px 16px;
        border-bottom: 1px solid #eef0f6;
    }
    .codes-table td { padding: 0; border: none; }
    .codes-table td:nth-child(1),
    .codes-table td:nth-child(2) { flex: 1 1 100%; }
    .codes-table td:nth-child(3) { order: 4; }
    .codes-table td:nth-child(4) { order: 5; }
    .codes-table td:nth-child(5) { order: 6; margin-left: auto; font-size: 12.5px; color: var(--muted); }
    .codes-table td:nth-child(5)::before { content: "累计 "; }
    .codes-table td:nth-child(6) { order: 7; font-size: 12.5px; color: var(--muted); }
    .codes-table td:nth-child(6)::before { content: "今日 "; }
    .codes-table td:nth-child(7) { display: none; }
    .codes-table td:nth-child(8) {
        flex: 1 1 100%;
        order: 8;
        margin-top: 2px;
        padding-top: 10px;
        border-top: 1px dashed var(--line);
    }
    .codes-table td.num { text-align: left; }
    .codes-table .name-cell { min-width: 0; }
    .codes-table .row-actions { justify-content: flex-start; gap: 4px; }

    .scans-table { min-width: 0; }
    .scans-table thead { display: none; }
    .scans-table tbody,
    .scans-table tr,
    .scans-table td { display: block; width: 100%; }
    .scans-table tr {
        display: flex;
        flex-wrap: wrap;
        gap: 3px 10px;
        padding: 12px 16px;
        border-bottom: 1px solid #eef0f6;
    }
    .scans-table td { padding: 0; border: none; font-size: 13px; }
    .scans-table td:nth-child(1) { flex: 1 1 100%; font-size: 12px; color: var(--muted); }
    .scans-table td:nth-child(2) { flex: 1 1 100%; }
    .scans-table td:nth-child(3) { font-size: 12px; color: var(--muted); }
    .scans-table td:nth-child(4) { margin-left: auto; font-size: 12px; color: var(--muted); }
}
