:root {
    --bg: #0f1220;
    --bg-2: #171a2e;
    --card: #1d2138;
    --border: #2c3152;
    --text: #e8eaf6;
    --muted: #8b90ab;
    --primary: #6c7bff;
    --primary-2: #8a5cff;
    --green: #34d399;
    --red: #f87171;
    --amber: #fbbf24;
    --radius: 16px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
    background: radial-gradient(1200px 600px at 20% -10%, #232748 0%, var(--bg) 55%);
    color: var(--text);
    min-height: 100vh;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

.wrap { max-width: 480px; margin: 0 auto; padding: 24px 16px 40px; }

/* ============ 响应式布局 ============ */
.layout { display: flex; flex-direction: column; }
.layout-main { min-width: 0; }
.layout-side { min-width: 0; }

/* PC 端（≥900px）：双栏布局 */
@media (min-width: 900px) {
    .wrap { max-width: 1080px; padding: 40px 32px 60px; }
    .masthead { padding-bottom: 32px; }
    .logo { font-size: 26px; }
    .layout { flex-direction: row; gap: 28px; align-items: flex-start; }
    .layout-main { flex: 1 1 460px; max-width: 560px; }
    .layout-side { flex: 0 0 380px; position: sticky; top: 24px; }
    .notice-wrap { margin-top: 0; }
    .card { padding: 26px 26px; }
    .card h2 { font-size: 19px; }
    .phone-box, .code-box { font-size: 34px; }
}

/* 移动端（<900px）：单列，说明区在下方 */
@media (max-width: 899px) {
    .layout-side { order: 2; }
}

.masthead { display: flex; align-items: center; justify-content: space-between; padding: 8px 4px 20px; }
.logo { font-size: 20px; font-weight: 700; }
.tag { font-size: 13px; color: var(--muted); }
.pill {
    display: inline-block; padding: 2px 10px; border-radius: 999px;
    background: rgba(108,123,255,.15); color: #9aa6ff; font-weight: 600; font-size: 12px;
}

.card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 22px 20px;
    margin-bottom: 16px;
    position: relative;
    box-shadow: 0 8px 30px rgba(0,0,0,.25);
}
.card h2 { font-size: 17px; margin-bottom: 6px; }
.muted { color: var(--muted); font-size: 13px; margin-bottom: 16px; }

.step-badge {
    position: absolute; top: -12px; left: 18px;
    width: 26px; height: 26px; border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--primary-2));
    color: #fff; font-weight: 700; font-size: 13px;
    display: flex; align-items: center; justify-content: center;
    box-shadow: 0 4px 12px rgba(108,123,255,.4);
}

.btn {
    display: inline-block; width: 100%; padding: 13px 18px; border-radius: 12px;
    border: none; cursor: pointer; font-size: 15px; font-weight: 600;
    transition: transform .12s ease, opacity .2s ease, box-shadow .2s ease;
    color: #fff;
}
.btn:active { transform: scale(.98); }
.btn:disabled { opacity: .45; cursor: not-allowed; }

.btn-primary { background: linear-gradient(135deg, var(--primary), var(--primary-2)); box-shadow: 0 6px 18px rgba(108,123,255,.35); }
.btn-outline { background: transparent; border: 1px solid var(--border); color: var(--text); }
.btn-outline:hover { border-color: var(--primary); }
.btn-ghost { background: transparent; border: 1px dashed var(--border); color: var(--muted); }
.btn-ghost:hover { color: var(--red); border-color: var(--red); }
.btn-danger { background: linear-gradient(135deg, #f87171, #ef4444); box-shadow: 0 6px 18px rgba(239,68,68,.35); }
.btn-lg { padding: 16px 18px; font-size: 16px; }
.btn-sm { width: auto; padding: 8px 14px; font-size: 13px; border-radius: 9px; }
.btn + .btn { margin-top: 10px; }

.phone-box, .code-box {
    font-size: 30px; font-weight: 800; letter-spacing: 2px; text-align: center;
    padding: 18px; margin-bottom: 14px; border-radius: 12px;
    background: rgba(0,0,0,.25); border: 1px dashed var(--border);
    font-family: "SF Mono", "Menlo", "Consolas", monospace;
}
.code-box { display: flex; align-items: center; justify-content: center; gap: 12px; font-size: 24px; }
.code-box.highlight {
    border: 1px solid var(--green);
    background: rgba(52,211,153,.08);
    animation: code-pulse 1.2s ease;
}
@keyframes code-pulse {
    0% { box-shadow: 0 0 0 0 rgba(52,211,153,.55); }
    100% { box-shadow: 0 0 0 18px rgba(52,211,153,0); }
}

.status-line { min-height: 20px; margin-top: 12px; font-size: 13px; color: var(--muted); text-align: center; }
.status-line.err { color: var(--red); }
.status-line.ok { color: var(--green); }

.lock-tip { margin-top: 12px; font-size: 12px; color: var(--amber); text-align: center; }

.invalidated-tip {
    margin-top: 12px; padding: 10px 14px; border-radius: 10px;
    background: rgba(251,191,36,.1); border: 1px solid var(--amber);
    color: var(--amber); font-size: 13px; text-align: center; font-weight: 600;
}

.switch-row {
    display: flex; align-items: center; gap: 10px;
    margin: 12px 0; padding: 10px 14px; border-radius: 10px;
    background: rgba(108,123,255,.08); border: 1px solid var(--border);
    cursor: pointer; font-size: 14px; user-select: none;
}
.switch-row input[type="checkbox"] {
    width: 18px; height: 18px; accent-color: var(--primary); cursor: pointer;
}
.switch-row:hover { border-color: var(--primary); }

.error-card { text-align: center; }
.err-icon { font-size: 34px; margin-bottom: 8px; }

.foot { text-align: center; color: var(--muted); font-size: 12px; padding: 12px 0; }

/* ============ 底部服务说明 ============ */
.notice-wrap { margin-top: 8px; padding-bottom: 32px; }

.notice-hero {
    text-align: center; padding: 20px 18px; margin-bottom: 14px;
    background: linear-gradient(135deg, rgba(108,123,255,.16), rgba(138,92,255,.16));
    border: 1px solid rgba(108,123,255,.35); border-radius: var(--radius);
}
.notice-hero-title {
    font-size: 19px; font-weight: 800; letter-spacing: .5px;
    background: linear-gradient(135deg, #9aa6ff, #c49aff);
    -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
}
.notice-hero-sub { color: var(--muted); font-size: 13px; margin-top: 6px; }

.notice-card {
    background: var(--card); border: 1px solid var(--border);
    border-radius: var(--radius); padding: 16px 16px; margin-bottom: 12px;
}
.notice-tag { font-size: 14px; font-weight: 700; margin-bottom: 10px; }
.notice-text { font-size: 13px; color: var(--muted); line-height: 1.8; }
.notice-text strong { color: var(--text); }
.notice-text strong.hl { color: var(--green); }

.notice-qa { margin-bottom: 12px; }
.notice-qa:last-child { margin-bottom: 0; }
.notice-q {
    font-size: 13px; font-weight: 600; color: var(--text);
    padding: 8px 12px; border-radius: 8px; margin-bottom: 6px;
    background: rgba(0,0,0,.2); border-left: 3px solid var(--primary);
}
.notice-a { font-size: 13px; color: var(--muted); line-height: 1.7; padding-left: 12px; }

.notice-list { list-style: none; padding: 0; margin: 0; }
.notice-list li {
    font-size: 13px; color: var(--muted); line-height: 1.7;
    padding: 6px 0 6px 22px; position: relative;
}
.notice-list li::before {
    content: '✓'; position: absolute; left: 0; top: 6px;
    color: var(--green); font-weight: 700;
}

.spinner {
    width: 34px; height: 34px; margin: 14px auto;
    border: 3px solid var(--border); border-top-color: var(--primary);
    border-radius: 50%; animation: spin 1s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.hidden { display: none !important; }

/* ============ 管理端 ============ */
.admin-wrap { max-width: 1080px; margin: 0 auto; padding: 24px 16px 60px; }
.admin-top { display: flex; align-items: center; justify-content: space-between; padding: 12px 4px 24px; }
.admin-nav { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 20px; }
.admin-nav button {
    padding: 9px 16px; border-radius: 10px; border: 1px solid var(--border);
    background: transparent; color: var(--muted); cursor: pointer; font-size: 14px; font-weight: 600;
}
.admin-nav button.active { background: var(--primary); color: #fff; border-color: var(--primary); }

.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 14px; margin-bottom: 22px; }
.stat {
    background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
    padding: 18px; text-align: center;
}
.stat .num { font-size: 28px; font-weight: 800; }
.stat .lbl { color: var(--muted); font-size: 13px; margin-top: 4px; }

.panel {
    background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
    padding: 20px; margin-bottom: 18px;
}
.panel h3 { font-size: 16px; margin-bottom: 16px; }

.table { width: 100%; border-collapse: collapse; font-size: 13px; }
.table th, .table td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--border); }
.table th { color: var(--muted); font-weight: 600; white-space: nowrap; }
.table td { word-break: break-all; }
.table tr:last-child td { border-bottom: none; }

.form-row { margin-bottom: 14px; }
.form-row label { display: block; font-size: 13px; color: var(--muted); margin-bottom: 6px; }
.form-row input, .form-row select, .form-row textarea {
    width: 100%; padding: 11px 13px; border-radius: 10px;
    border: 1px solid var(--border); background: rgba(0,0,0,.2); color: var(--text);
    font-size: 14px; outline: none;
}
.form-row input:focus, .form-row select:focus, .form-row textarea:focus { border-color: var(--primary); }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 600px) { .form-grid { grid-template-columns: 1fr; } }

.badge { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 11px; font-weight: 600; }
.badge.green { background: rgba(52,211,153,.15); color: var(--green); }
.badge.red { background: rgba(248,113,113,.15); color: var(--red); }
.badge.amber { background: rgba(251,191,36,.15); color: var(--amber); }
.badge.blue { background: rgba(108,123,255,.15); color: #9aa6ff; }

.batch-result { margin-top: 16px; }
.batch-result textarea {
    width: 100%; min-height: 160px; padding: 12px; border-radius: 10px;
    background: rgba(0,0,0,.25); border: 1px solid var(--border); color: var(--green);
    font-family: monospace; font-size: 12px; resize: vertical;
}

.toast {
    position: fixed; top: 20px; left: 50%; transform: translateX(-50%);
    background: var(--green); color: #062; padding: 12px 22px; border-radius: 10px;
    font-weight: 600; font-size: 14px; box-shadow: 0 8px 24px rgba(0,0,0,.3);
    z-index: 999; opacity: 0; transition: opacity .3s ease; pointer-events: none;
}
.toast.err { background: var(--red); color: #fff; }
.toast.show { opacity: 1; }

.pagination { display: flex; gap: 8px; align-items: center; justify-content: center; margin-top: 16px; }
.pagination button { padding: 6px 14px; border-radius: 8px; border: 1px solid var(--border); background: transparent; color: var(--text); cursor: pointer; }
.pagination button:disabled { opacity: .4; cursor: not-allowed; }
.pagination span { color: var(--muted); font-size: 13px; }
