/* ============================================================
   猛犸余额退款收录表单 · 样式表
   移动端优先，桌面端自适应
   ============================================================ */

:root {
    --bg: #f2f4fa;
    --card: #ffffff;
    --ink: #111827;
    --body: #374151;
    --muted: #6b7280;
    --line: #e6e9f2;
    --line-strong: #d5dae8;

    --brand: #4f46e5;
    --brand-dark: #4338ca;
    --brand-light: #7c6ff0;
    --brand-soft: #eef0ff;

    --ok: #059669;
    --ok-soft: #e8f7f1;
    --ok-line: #b7e6d4;
    --warn: #b45309;
    --warn-soft: #fff5e5;
    --warn-line: #f6dcae;
    --danger: #dc2626;
    --danger-soft: #fdecec;
    --danger-line: #f7c9c9;

    --radius: 18px;
    --radius-sm: 12px;
    --shadow-sm: 0 1px 2px rgba(16, 24, 40, .05);
    --shadow: 0 2px 4px rgba(16, 24, 40, .04), 0 18px 40px -20px rgba(16, 24, 40, .30);

    --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
            "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }

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

body {
    margin: 0;
    font-family: var(--font);
    font-size: 15px;
    line-height: 1.6;
    color: var(--body);
    background: var(--bg);
    background-image:
        radial-gradient(760px 380px at 8% -8%, #e6e6ff 0%, rgba(230, 230, 255, 0) 62%),
        radial-gradient(680px 320px at 100% 0%, #e2f0ff 0%, rgba(226, 240, 255, 0) 58%);
    background-repeat: no-repeat;
    -webkit-font-smoothing: antialiased;
}

a { color: var(--brand); text-decoration: none; }
h1, h2, h3 { color: var(--ink); margin: 0; line-height: 1.3; }
em { font-style: normal; color: var(--danger); }

.wrap {
    max-width: 720px;
    margin: 0 auto;
    padding: 28px 16px calc(32px + env(safe-area-inset-bottom));
}

/* ---------------- Hero ---------------- */
.hero { padding: 6px 4px 22px; }

.brand {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: .02em;
    color: var(--brand-dark);
    background: #fff;
    border: 1px solid var(--line);
    padding: 6px 12px;
    border-radius: 999px;
    box-shadow: var(--shadow-sm);
}

.brand-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--brand), var(--brand-light));
    box-shadow: 0 0 0 3px rgba(79, 70, 229, .14);
    flex: none;
}

.hero h1 {
    font-size: 26px;
    font-weight: 700;
    letter-spacing: -.4px;
    margin: 14px 0 8px;
}

.hero-sub {
    margin: 0;
    font-size: 14px;
    color: var(--muted);
}

/* ---------------- Tabs ---------------- */
.tabs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
    padding: 6px;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 14px;
    box-shadow: var(--shadow-sm);
    margin-bottom: 18px;
}

.tab {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding: 11px 10px;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 600;
    color: var(--muted);
    transition: background .18s ease, color .18s ease, box-shadow .18s ease;
}

.tab:hover { color: var(--ink); background: #f7f8fc; }

.tab.is-active {
    color: #fff;
    background: linear-gradient(135deg, var(--brand), var(--brand-light));
    box-shadow: 0 6px 16px -6px rgba(79, 70, 229, .7);
}

.tab-ico { font-size: 15px; line-height: 1; opacity: .9; }

/* ---------------- Card / Panel ---------------- */
.card {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 24px 20px;
}

.panel-head { margin-bottom: 18px; }
.panel-head h2 {
    font-size: 18px;
    font-weight: 700;
    letter-spacing: -.2px;
}
.panel-head p {
    margin: 6px 0 0;
    font-size: 13px;
    color: var(--muted);
}

/* ---------------- Alerts ---------------- */
.alert {
    border-radius: var(--radius-sm);
    padding: 12px 14px;
    font-size: 14px;
    margin-bottom: 16px;
    border: 1px solid transparent;
    line-height: 1.55;
}
.alert strong { display: block; margin-bottom: 2px; color: inherit; }
.alert-error { background: var(--danger-soft); border-color: var(--danger-line); color: #991b1b; }
.alert-ok { background: var(--ok-soft); border-color: var(--ok-line); color: #06654a; }

/* ---------------- Form ---------------- */
.hp { position: absolute; left: -9999px; opacity: 0; height: 0; overflow: hidden; }

.field { margin-bottom: 18px; }

.field label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: var(--ink);
    margin-bottom: 8px;
}

.input {
    display: block;
    width: 100%;
    padding: 13px 14px;
    font-family: inherit;
    font-size: 16px;   /* 16px 可避免 iOS 自动放大 */
    line-height: 1.4;
    color: var(--ink);
    background: #fbfcfe;
    border: 1.5px solid var(--line-strong);
    border-radius: var(--radius-sm);
    transition: border-color .16s ease, box-shadow .16s ease, background .16s ease;
    -webkit-appearance: none;
    appearance: none;
}

.input::placeholder { color: #a8afbd; }

.input:focus {
    outline: none;
    background: #fff;
    border-color: var(--brand);
    box-shadow: 0 0 0 4px rgba(79, 70, 229, .13);
}

.input.has-error {
    border-color: #e78181;
    background: #fffafa;
}
.input.has-error:focus { box-shadow: 0 0 0 4px rgba(220, 38, 38, .12); }

.hint, .err {
    margin: 6px 2px 0;
    font-size: 12.5px;
    line-height: 1.5;
}
.hint { color: var(--muted); }
.err { color: var(--danger); font-weight: 500; }

.input-row { display: flex; gap: 10px; align-items: stretch; }
.input-row .input { flex: 1; min-width: 0; }

/* ---------------- Buttons ---------------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 15px;
    font-weight: 600;
    padding: 13px 20px;
    cursor: pointer;
    transition: transform .12s ease, box-shadow .18s ease, background .18s ease, color .18s ease;
    text-align: center;
    white-space: nowrap;
}
.btn:active { transform: translateY(1px); }

.btn-primary {
    width: 100%;
    color: #fff;
    background: linear-gradient(135deg, var(--brand), var(--brand-light));
    box-shadow: 0 10px 22px -10px rgba(79, 70, 229, .85);
}
.btn-primary:hover { background: linear-gradient(135deg, var(--brand-dark), var(--brand)); }
.btn-primary:focus-visible { outline: 3px solid rgba(79, 70, 229, .35); outline-offset: 2px; }

.btn-inline { width: auto; padding: 13px 22px; }

.btn-ghost {
    color: var(--body);
    background: #fff;
    border-color: var(--line-strong);
    box-shadow: var(--shadow-sm);
}
.btn-ghost:hover { color: var(--brand); border-color: #c3c9e0; background: #fafaff; }

.btn-sm { font-size: 13.5px; padding: 8px 14px; border-radius: 10px; }

/* ---------------- Notes ---------------- */
.notes {
    margin-top: 22px;
    padding: 16px 16px 6px;
    background: #f8f9fd;
    border: 1px dashed var(--line-strong);
    border-radius: var(--radius-sm);
}

.notes ol {
    margin: 0;
    padding-left: 18px;
    counter-reset: note;
    list-style: none;
}

.notes li {
    counter-increment: note;
    position: relative;
    font-size: 12.8px;
    color: #5b6472;
    line-height: 1.75;
    margin-bottom: 10px;
    padding-left: 2px;
}

.notes li::before {
    content: counter(note) ".";
    position: absolute;
    left: -18px;
    top: 0;
    font-weight: 700;
    color: var(--brand);
}

/* ---------------- Query result ---------------- */
.empty-state {
    text-align: center;
    padding: 34px 16px 30px;
    border: 1px dashed var(--line-strong);
    border-radius: var(--radius-sm);
    background: #fbfcfe;
    margin-top: 18px;
}

.empty-ico {
    width: 46px;
    height: 46px;
    margin: 0 auto 12px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    font-size: 20px;
    font-weight: 700;
    color: var(--brand);
    background: var(--brand-soft);
}

.empty-title { margin: 0; font-size: 15px; font-weight: 600; color: var(--ink); }
.empty-sub { margin: 6px 0 16px; font-size: 13px; color: var(--muted); }

.record {
    margin-top: 18px;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    padding: 16px;
    background: #fff;
    box-shadow: var(--shadow-sm);
}

.record:first-of-type { margin-top: 20px; }

.record-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 14px;
}

.badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 12.5px;
    font-weight: 600;
    padding: 4px 11px;
    border-radius: 999px;
    border: 1px solid transparent;
}
.badge::before {
    content: "";
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: currentColor;
}
.badge-wait { color: var(--warn); background: var(--warn-soft); border-color: var(--warn-line); }
.badge-done { color: var(--ok); background: var(--ok-soft); border-color: var(--ok-line); }

.record-id { font-size: 12.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
.record-time { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }

.progress-box {
    position: relative;
    padding: 14px 16px;
    background: linear-gradient(180deg, #f8f8ff, #f6f7fc);
    border: 1px solid #e9e9f8;
    border-left: 3px solid var(--brand);
    border-radius: 10px;
}

.progress-label {
    font-size: 12px;
    font-weight: 600;
    letter-spacing: .06em;
    color: #8b8fb3;
    margin-bottom: 4px;
}

.progress-text {
    font-size: 14.5px;
    color: var(--ink);
    line-height: 1.7;
    word-break: break-word;
}

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

.record-meta div { min-width: 0; }
.record-meta dt { font-size: 12px; color: var(--muted); margin-bottom: 1px; }
.record-meta dd {
    margin: 0;
    font-size: 14px;
    color: var(--ink);
    word-break: break-all;
}

.tip-line {
    margin: 18px 2px 0;
    font-size: 12.5px;
    color: var(--muted);
    text-align: center;
}

.foot {
    text-align: center;
    padding: 22px 8px 4px;
    font-size: 12px;
    color: #9aa1b1;
}
.foot p { margin: 0; }

/* ============================================================
   后台登录页
   ============================================================ */
.login-body {
    display: grid;
    place-items: center;
    min-height: 100vh;
    padding: 24px 16px;
}
.login-wrap { width: 100%; max-width: 400px; }
.login-card {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 22px;
    box-shadow: var(--shadow);
    padding: 30px 24px 20px;
    text-align: center;
}
.login-logo {
    width: 54px;
    height: 54px;
    margin: 0 auto 14px;
    border-radius: 16px;
    display: grid;
    place-items: center;
    font-size: 24px;
    font-weight: 700;
    color: #fff;
    background: linear-gradient(135deg, var(--brand), var(--brand-light));
    box-shadow: 0 12px 24px -10px rgba(79, 70, 229, .9);
}
.login-card h1 { font-size: 19px; font-weight: 700; }
.login-sub { margin: 6px 0 20px; font-size: 13px; color: var(--muted); }
.login-card .field { text-align: left; }
.login-back { margin: 18px 0 0; font-size: 13px; }

/* ============================================================
   后台管理
   ============================================================ */
.admin-body { font-size: 14.5px; }

.admin-top {
    position: sticky;
    top: 0;
    z-index: 20;
    background: rgba(255, 255, 255, .88);
    backdrop-filter: saturate(180%) blur(12px);
    border-bottom: 1px solid var(--line);
}

.admin-top-inner {
    max-width: 1100px;
    margin: 0 auto;
    padding: 11px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.admin-title {
    display: flex;
    align-items: center;
    gap: 9px;
    font-size: 15px;
    color: var(--ink);
    letter-spacing: -.2px;
}

.admin-actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }

.admin-wrap {
    max-width: 1100px;
    margin: 0 auto;
    padding: 20px 16px calc(40px + env(safe-area-inset-bottom));
}

.stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-bottom: 18px;
}

.stat {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    padding: 14px 16px;
    box-shadow: var(--shadow-sm);
}
.stat-num {
    font-size: 24px;
    font-weight: 700;
    color: var(--ink);
    line-height: 1.2;
    font-variant-numeric: tabular-nums;
}
.stat-wait { color: var(--warn); }
.stat-done { color: var(--ok); }
.stat-label { font-size: 12.5px; color: var(--muted); margin-top: 2px; }

.filters {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    padding: 14px;
    box-shadow: var(--shadow-sm);
    margin-bottom: 14px;
}

.filter-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    margin-top: 10px;
}

.filters .input { font-size: 14.5px; padding: 11px 13px; }

.seg {
    display: inline-flex;
    padding: 4px;
    background: #f3f4fa;
    border-radius: 10px;
    gap: 3px;
}
.seg-item { position: relative; cursor: pointer; }
.seg-item input { position: absolute; opacity: 0; pointer-events: none; }
.seg-item span {
    display: block;
    padding: 7px 14px;
    font-size: 13.5px;
    font-weight: 600;
    color: var(--muted);
    border-radius: 8px;
    transition: background .16s ease, color .16s ease, box-shadow .16s ease;
}
.seg-item input:checked + span {
    color: var(--brand-dark);
    background: #fff;
    box-shadow: 0 1px 3px rgba(16, 24, 40, .14);
}

.list-count { font-size: 12.5px; color: var(--muted); margin: 0 2px 12px; }

.record-list {
    display: grid;
    gap: 14px;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
}

.admin-card {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-sm);
    padding: 14px 16px 12px;
    transition: box-shadow .18s ease, border-color .18s ease;
}
.admin-card:hover { box-shadow: var(--shadow); border-color: #dcdfee; }

.admin-card-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 12px;
}
.ac-left { display: flex; align-items: center; gap: 8px; }
.ac-time { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }

.admin-meta {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 8px 14px;
    margin: 0 0 12px;
}
.admin-meta div { min-width: 0; }
.admin-meta dt { font-size: 11.5px; color: var(--muted); }
.admin-meta dd {
    margin: 0;
    font-size: 13.5px;
    color: var(--ink);
    word-break: break-all;
}
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 13px; }

.admin-form .textarea {
    font-size: 14px;
    line-height: 1.6;
    resize: vertical;
    min-height: 62px;
    background: #fbfcfe;
}

.admin-form-row {
    display: flex;
    gap: 8px;
    margin-top: 8px;
    align-items: stretch;
}

.admin-form-row .select {
    flex: 1 1 auto;
    width: auto;
    min-width: 0;
    font-size: 13.5px;
    padding: 9px 32px 9px 12px;
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%236b7280' stroke-width='1.7' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    cursor: pointer;
}

.admin-form-row .btn {
    flex: 0 0 auto;
    width: auto;
    padding: 9px 18px;
}

.admin-card-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-top: 10px;
    padding-top: 9px;
    border-top: 1px solid #f0f2f8;
}
.ac-note {
    font-size: 11.5px;
    color: #9aa1b1;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.link-danger {
    background: none;
    border: 0;
    padding: 2px 4px;
    font-family: inherit;
    font-size: 12.5px;
    color: #98a0b0;
    cursor: pointer;
    transition: color .16s ease;
}
.link-danger:hover { color: var(--danger); }

.pager {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    justify-content: center;
    margin-top: 22px;
}
.pager-item {
    min-width: 34px;
    height: 34px;
    padding: 0 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 13.5px;
    border-radius: 9px;
    background: #fff;
    border: 1px solid var(--line);
    color: var(--body);
}
.pager-item:hover { border-color: #c3c9e0; color: var(--brand); }
.pager-item.is-current {
    color: #fff;
    border-color: transparent;
    background: linear-gradient(135deg, var(--brand), var(--brand-light));
}

/* ============================================================
   响应式微调
   ============================================================ */
@media (max-width: 480px) {
    .wrap { padding: 20px 13px 28px; }
    .hero h1 { font-size: 22px; }
    .hero-sub { font-size: 13px; }
    .card { padding: 20px 15px; border-radius: 16px; }
    .panel-head h2 { font-size: 16.5px; }
    .tab { font-size: 14px; padding: 10px 6px; }
    .stat { padding: 12px; }
    .stat-num { font-size: 20px; }
    .admin-top-inner { padding: 10px 13px; flex-wrap: wrap; }
    .admin-wrap { padding: 16px 13px 32px; }
    .record-list { grid-template-columns: 1fr; }
    .btn-sm { padding: 7px 11px; font-size: 13px; }
    .input-row { flex-direction: column; }
    .input-row .btn-inline { width: 100%; }
}

@media (min-width: 900px) {
    .hero h1 { font-size: 30px; }
    .card { padding: 30px 32px; }
    body { font-size: 15.5px; }
}

@media (prefers-reduced-motion: reduce) {
    * { transition: none !important; animation: none !important; }
}
