/* 用户兑换页 · 冰川清透 */
:root {
    color-scheme: light;
    --base: #f2f5f9;
    --b1: #cfe6ff;
    --b2: #dfe3ff;
    --b3: #d4f2ee;
    --b4: #eaf1ff;
    --text: #1c1c1e;
    --muted: #636369;
    --faint: #8e8e93;
    --glass: rgba(255, 255, 255, .58);
    --sheen: rgba(255, 255, 255, .72);
    --spec: rgba(255, 255, 255, .8);
    --rim-a: #ffffff;
    --rim-b: rgba(208, 218, 233, .45);
    --shadow: 0 1px 1px rgba(15, 25, 45, .04), 0 18px 48px rgba(30, 50, 90, .10);
    --shadow-sm: 0 1px 2px rgba(15, 25, 45, .05), 0 6px 16px rgba(30, 50, 90, .06);
    --blur: 24px;
    --sat: 140%;
    --field: rgba(255, 255, 255, .7);
    --field-rim: rgba(203, 212, 226, .9);
    --blue: #007aff;
    --blue-press: #0062cc;
    --green: #34c759;
    --orange: #ff9500;
    --red: #ff3b30;
    --purple: #af52de;
    --track: rgba(118, 118, 128, .12);
    --lens: #ffffff;
    --radius-xl: 30px;
    --radius-lg: 22px;
    --radius-md: 16px;
    --spring: cubic-bezier(.34, 1.56, .64, 1);
    --ease: cubic-bezier(.2, .8, .2, 1);
    --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Segoe UI", sans-serif;
    --font-num: "SF Pro Display", -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", sans-serif;
    --font-mono: "SF Mono", ui-monospace, Menlo, Consolas, monospace;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
    margin: 0;
    min-height: 100vh;
    background: var(--base);
    color: var(--text);
    font-family: var(--font);
    font-size: 15px;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}
body.modal-open { overflow: hidden; }
h1, h2, h3, p { margin: 0; }
button, input, textarea { font: inherit; color: inherit; }
a { color: var(--blue); }
[hidden] { display: none !important; }
[tabindex="-1"]:focus { outline: none; }
svg.lucide { width: 18px; height: 18px; flex-shrink: 0; stroke-width: 1.9; }

/* ---------- 壁纸 ---------- */
.wall { position: fixed; inset: 0; z-index: 0; overflow: hidden; pointer-events: none; }
.wall i { position: absolute; border-radius: 50%; filter: blur(70px); animation: drift 28s ease-in-out infinite alternate; }
.wall i:nth-child(1) { width: 62vw; height: 62vw; max-width: 820px; max-height: 820px; left: -14vw; top: -22vw; background: var(--b1); opacity: .85; }
.wall i:nth-child(2) { width: 52vw; height: 52vw; max-width: 700px; max-height: 700px; right: -12vw; top: 6vh; background: var(--b2); opacity: .8; animation-duration: 33s; animation-delay: -8s; }
.wall i:nth-child(3) { width: 48vw; height: 48vw; max-width: 640px; max-height: 640px; left: 22vw; bottom: -26vw; background: var(--b3); opacity: .8; animation-duration: 37s; animation-delay: -15s; }
.wall i:nth-child(4) { width: 34vw; height: 34vw; max-width: 460px; max-height: 460px; right: 16vw; bottom: -8vw; background: var(--b4); opacity: .7; animation-duration: 31s; animation-delay: -4s; }
.caustics {
    position: absolute; inset: -20%; opacity: .55; filter: blur(18px);
    background: repeating-linear-gradient(115deg, rgba(255, 255, 255, 0) 0 60px, rgba(255, 255, 255, .55) 80px, rgba(255, 255, 255, 0) 110px 200px);
    animation: rays 20s linear infinite;
}
.grain {
    position: absolute; inset: 0; opacity: .035; mix-blend-mode: overlay;
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
}
@keyframes drift {
    0% { transform: translate3d(0, 0, 0) scale(1); }
    50% { transform: translate3d(6vw, 4vh, 0) scale(1.1); }
    100% { transform: translate3d(-4vw, 2vh, 0) scale(.94); }
}
@keyframes rays { to { transform: translateX(200px); } }

/* ---------- 玻璃材质 ---------- */
.glass {
    position: relative;
    isolation: isolate;
    background: linear-gradient(135deg, var(--sheen) 0%, rgba(255, 255, 255, 0) 45%), var(--glass);
    -webkit-backdrop-filter: blur(var(--blur)) saturate(var(--sat));
    backdrop-filter: blur(var(--blur)) saturate(var(--sat));
    box-shadow: var(--shadow);
}
.glass::before {
    content: ""; position: absolute; inset: 0; z-index: 0; border-radius: inherit; padding: 1px; pointer-events: none;
    background: linear-gradient(140deg, var(--rim-a), var(--rim-b) 36%, var(--rim-b) 64%, var(--rim-a));
    -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
    -webkit-mask-composite: xor;
    mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0);
}
.glass::after {
    content: ""; position: absolute; inset: 0; z-index: 0; border-radius: inherit; pointer-events: none;
    background: radial-gradient(320px circle at var(--mx, 20%) var(--my, -20%), var(--spec), transparent 62%);
    opacity: 0; transition: opacity .4s ease;
}
.glass:hover::after { opacity: 1; }
.glass > * { position: relative; z-index: 1; }

/* ---------- 布局 ---------- */
.page-wrap {
    position: relative; z-index: 1;
    width: 100%; max-width: 1080px; margin: 0 auto;
    padding: max(28px, env(safe-area-inset-top)) 18px 48px;
    display: grid; gap: 26px;
}
.hero-header { padding: 4px 4px 0; animation: rise .7s var(--ease) both; }
.brand { display: inline-flex; align-items: center; gap: 10px; font-size: 15px; font-weight: 700; }
.brand-mark {
    width: 34px; height: 34px; border-radius: 11px; display: grid; place-items: center; color: var(--blue);
    background: linear-gradient(145deg, #fff, rgba(255, 255, 255, .55));
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .9), var(--shadow-sm);
}
.hero-header h1 { margin-top: 18px; font-size: clamp(32px, 6vw, 46px); line-height: 1.12; font-weight: 800; letter-spacing: -.025em; }
.hero-header h1 em { font-style: normal; color: var(--blue); }
.hero-subtitle { margin-top: 12px; max-width: 30em; font-size: 15px; line-height: 1.7; color: var(--muted); }
.hero-pills { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; }
.pill { display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 14px; border-radius: 999px; font-size: 13px; font-weight: 600; }
.pill svg.lucide { width: 15px; height: 15px; color: var(--blue); }

.main-shell { border-radius: var(--radius-xl); padding: 20px; animation: rise .8s var(--ease) .08s both; }
@keyframes rise { from { opacity: 0; transform: translateY(14px) scale(.985); } to { opacity: 1; transform: none; } }

/* ---------- 分段切换 ---------- */
.top-nav-tabs {
    position: relative; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr));
    padding: 4px; border-radius: 999px; background: var(--track);
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, .05);
}
.top-tab {
    position: relative; z-index: 1; height: 40px; padding: 0 6px; border: 0; border-radius: 999px; background: transparent;
    display: inline-flex; align-items: center; justify-content: center; gap: 6px;
    color: var(--muted); font-size: 14px; font-weight: 600; cursor: pointer; white-space: nowrap;
    transition: color .3s ease, transform .35s var(--spring);
}
.top-tab svg.lucide { width: 16px; height: 16px; }
.top-tab:hover { color: var(--text); }
.top-tab:active { transform: scale(.95); }
.top-tab.active { color: var(--text); }
.top-tab:focus-visible { outline: 3px solid rgba(0, 122, 255, .35); outline-offset: 1px; }
.tab-indicator {
    position: absolute; z-index: 0; top: 4px; bottom: 4px; left: 4px; width: calc((100% - 8px) / 2);
    border-radius: 999px; background: var(--lens);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .9), 0 4px 14px rgba(0, 0, 0, .08);
    transition: left .55s var(--spring), width .55s var(--spring);
}
.tab-indicator.is-moving { animation: squish .55s var(--ease); }
@keyframes squish {
    0% { transform: scale(1, 1); }
    40% { transform: scale(1.08, .88); }
    70% { transform: scale(.98, 1.04); }
    100% { transform: scale(1, 1); }
}

.step { display: none; }
.step.active { display: block; animation: fadeUp .45s var(--ease) both; }
.tab-panel { display: none; padding-top: 18px; }
.tab-panel.active { display: block; animation: fadeUp .45s var(--ease) both; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

.panel-head { margin-bottom: 14px; }
.panel-head h2 { font-size: 19px; font-weight: 750; letter-spacing: -.01em; }
.panel-head p { margin-top: 4px; font-size: 14px; color: var(--muted); }

/* ---------- 提示条 ---------- */
.info-box, .warning-box {
    display: flex; align-items: flex-start; gap: 10px; padding: 12px 14px; border-radius: var(--radius-md);
    font-size: 13.5px; line-height: 1.6;
}
.info-box { background: rgba(0, 122, 255, .07); color: #1e3a5f; }
.info-box svg.lucide { color: var(--blue); margin-top: 2px; }
.warning-box { margin-top: 16px; background: rgba(255, 149, 0, .09); color: #6b4a12; }
.warning-box svg.lucide { color: var(--orange); margin-top: 2px; }
.info-box p, .warning-box p { margin: 0; }
.info-box[hidden] { display: none; }
.term-confirm-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 12px; }

/* ---------- 表单 ---------- */
.stack-form { display: grid; gap: 14px; margin-top: 16px; }
.form-group label { display: block; margin: 0 0 6px 4px; font-size: 13px; font-weight: 600; color: var(--muted); }
.required-star { color: var(--red); }
.field-wrap {
    display: flex; align-items: center; gap: 10px; height: 52px; padding: 0 16px; border-radius: 18px;
    background: var(--field); box-shadow: inset 0 1px 2px rgba(0, 0, 0, .04), inset 0 0 0 1px var(--field-rim);
    transition: box-shadow .3s ease, background-color .3s ease;
}
.field-wrap:focus-within { background: #fff; box-shadow: inset 0 0 0 1.5px var(--blue), 0 0 0 4px rgba(0, 122, 255, .16); }
.field-icon { color: var(--faint); transition: color .3s ease; }
.field-wrap:focus-within .field-icon { color: var(--blue); }
.form-input { flex: 1; min-width: 0; height: 100%; border: 0; outline: 0; background: transparent; font-size: 16px; }
.form-input::placeholder { color: #a5a5ab; }
.field-hint { margin: 6px 0 0 4px; font-size: 12.5px; color: var(--faint); }

.warranty-query-form { display: grid; gap: 6px; }
.warranty-query-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: end; gap: 10px; }
.warranty-query-btn { height: 52px; padding: 0 20px; }
.warranty-result-container { margin-top: 16px; }

/* ---------- 按钮 ---------- */
.btn {
    position: relative; overflow: hidden; height: 50px; padding: 0 22px; border: 0; border-radius: 999px;
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    font-size: 15px; font-weight: 650; cursor: pointer; text-decoration: none; white-space: nowrap;
    transition: transform .45s var(--spring), box-shadow .3s ease, background-color .25s ease, opacity .25s ease;
}
.btn::after {
    content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
    background: radial-gradient(160px circle at var(--mx, 50%) var(--my, 0%), rgba(255, 255, 255, .35), transparent 62%);
    opacity: 0; transition: opacity .3s ease;
}
.btn:hover::after { opacity: 1; }
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: scale(.96); transition-duration: .15s; }
.btn:focus-visible { outline: 3px solid rgba(0, 122, 255, .35); outline-offset: 2px; }
.btn:disabled, .btn[disabled] { opacity: .6; cursor: not-allowed; transform: none; }
.btn-primary { background: var(--blue); color: #fff; box-shadow: inset 0 1px 0 rgba(255, 255, 255, .25), 0 10px 24px rgba(0, 122, 255, .28); }
.btn-primary:hover { background: #0a84ff; }
.btn-secondary { background: rgba(255, 255, 255, .78); color: var(--text); box-shadow: inset 0 0 0 1px var(--field-rim), var(--shadow-sm); }
.btn-secondary:hover { background: #fff; }
.stack-form > .btn { width: 100%; height: 54px; margin-top: 4px; font-size: 16px; }
.spinning { animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.buy-link {
    justify-self: center; display: inline-flex; align-items: center; gap: 6px; margin-top: 2px;
    color: var(--muted); font-size: 14px; font-weight: 600; text-decoration: none; transition: color .25s ease;
}
.buy-link svg.lucide { width: 16px; height: 16px; transition: transform .35s var(--spring); }
.buy-link:hover { color: var(--blue); }
.buy-link:hover svg.lucide { transform: translateX(3px); }

/* ---------- 结果 ---------- */
.result-shell { padding-top: 4px; }
.result-card, .empty-result { display: grid; gap: 16px; text-align: center; animation: pop .6s var(--spring) both; }
@keyframes pop { from { opacity: 0; transform: scale(.94) translateY(10px); filter: blur(6px); } to { opacity: 1; transform: none; filter: none; } }
.result-card-header { display: grid; justify-items: center; gap: 6px; padding-top: 8px; }
.result-icon {
    position: relative; width: 76px; height: 76px; border-radius: 50%; display: grid; place-items: center; margin-bottom: 6px;
    background: rgba(0, 122, 255, .1); color: var(--blue);
}
.result-icon svg.lucide { width: 38px; height: 38px; stroke-width: 2.2; animation: iconIn .6s var(--spring) .1s both; }
.result-icon::after { content: ""; position: absolute; inset: 0; border-radius: 50%; border: 2px solid currentColor; animation: ripple 1.1s var(--ease) .35s both; }
.result-icon.success { background: rgba(52, 199, 89, .12); color: var(--green); }
.result-icon.error { background: rgba(255, 59, 48, .1); color: var(--red); }
.result-icon.info { background: rgba(0, 122, 255, .1); color: var(--blue); }
@keyframes iconIn { from { transform: scale(.4); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes ripple { from { transform: scale(.9); opacity: .7; } to { transform: scale(1.55); opacity: 0; } }
.result-title { font-size: 22px; font-weight: 800; letter-spacing: -.01em; }
.result-message { font-size: 14px; color: var(--muted); }
.result-details { display: grid; gap: 2px; padding: 6px; border-radius: var(--radius-md); background: rgba(255, 255, 255, .6); box-shadow: inset 0 0 0 1px var(--field-rim); text-align: left; }
.result-detail-item { display: flex; justify-content: space-between; gap: 12px; padding: 10px 12px; border-radius: 12px; font-size: 14px; }
.result-detail-item + .result-detail-item { border-top: 1px solid rgba(203, 212, 226, .55); border-radius: 0; }
.result-detail-label { color: var(--muted); }
.result-detail-value { font-weight: 600; text-align: right; word-break: break-all; }
.result-inline-note { padding: 12px 14px; border-radius: var(--radius-md); background: rgba(0, 122, 255, .07); color: #1e3a5f; font-size: 13.5px; line-height: 1.7; text-align: left; }
.result-card-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }
.result-card-actions .btn { flex: 1 1 180px; }
.inline-code-box { display: flex; gap: 8px; }
.inline-code-input {
    flex: 1; min-width: 0; height: 48px; padding: 0 14px; border: 0; border-radius: 14px; outline: 0;
    background: var(--field); box-shadow: inset 0 0 0 1px var(--field-rim); font-family: var(--font-mono); font-size: 14px;
}
.empty-result { padding: 10px 0 4px; justify-items: center; }

/* ---------- 质保记录 ---------- */
.warranty-view { display: grid; gap: 16px; text-align: left; }
.warranty-summary {
    display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px;
}
.warranty-summary > div { padding: 14px; border-radius: var(--radius-md); background: rgba(255, 255, 255, .66); box-shadow: inset 0 0 0 1px var(--field-rim); }
.summary-card-label { font-size: 12.5px; color: var(--muted); }
.summary-card-value { margin-top: 6px; font-family: var(--font-num); font-size: 16px; font-weight: 700; }
.records-section { display: grid; gap: 10px; }
.records-section-title { font-size: 15px; font-weight: 700; }
.records-list { display: grid; gap: 10px; }
.record-card { padding: 14px; border-radius: var(--radius-md); background: rgba(255, 255, 255, .7); box-shadow: inset 0 0 0 1px var(--field-rim), var(--shadow-sm); animation: fadeUp .45s var(--ease) both; }
.record-card-header { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.record-code { font-family: var(--font-mono); font-size: 14px; font-weight: 600; word-break: break-all; }
.record-meta-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 14px; margin-top: 12px; }
.record-meta-label { font-size: 12px; color: var(--faint); }
.record-meta-value { margin-top: 2px; font-size: 13.5px; font-weight: 600; word-break: break-all; }
.record-meta-value.inline { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.record-footer { display: grid; gap: 10px; margin-top: 12px; padding-top: 12px; border-top: 1px solid rgba(203, 212, 226, .6); }
.record-footer-copy { font-size: 13px; color: var(--muted); }
.record-footer-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.record-footer-actions .btn { height: 40px; padding: 0 16px; font-size: 14px; }

/* ---------- 标签 ---------- */
.badge { display: inline-flex; align-items: center; height: 24px; padding: 0 10px; border-radius: 999px; font-size: 12px; font-weight: 700; white-space: nowrap; background: rgba(118, 118, 128, .12); color: var(--muted); }
.badge-success { background: rgba(52, 199, 89, .14); color: #1f8a3c; }
.badge-error { background: rgba(255, 59, 48, .12); color: #c62a20; }
.badge-warn { background: rgba(255, 149, 0, .14); color: #a35f00; }
.badge-neutral { background: rgba(118, 118, 128, .12); color: var(--muted); }

/* ---------- 轻提示 ---------- */
.toast {
    position: fixed; z-index: 60; top: max(16px, env(safe-area-inset-top)); left: 50%;
    display: flex; align-items: center; gap: 10px; max-width: calc(100vw - 32px); padding: 12px 18px; border-radius: 999px;
    background: rgba(255, 255, 255, .86); color: var(--text); font-size: 14px; font-weight: 600;
    -webkit-backdrop-filter: blur(20px) saturate(160%); backdrop-filter: blur(20px) saturate(160%);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .9), 0 12px 32px rgba(30, 50, 90, .16);
    opacity: 0; pointer-events: none; transform: translate(-50%, -18px) scale(.96);
    transition: opacity .3s ease, transform .5s var(--spring);
}
.toast.show { opacity: 1; transform: translate(-50%, 0) scale(1); }
.toast svg.lucide { color: var(--blue); }
.toast.success svg.lucide { color: var(--green); }
.toast.error svg.lucide { color: var(--red); }

/* ---------- 公告与提醒弹窗 ---------- */
.announcement-modal {
    position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: 18px;
    opacity: 0; visibility: hidden; transition: opacity .3s ease, visibility .3s ease;
}
.announcement-modal.show { opacity: 1; visibility: visible; }
.announcement-backdrop { position: absolute; inset: 0; background: rgba(226, 232, 242, .5); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); }
.announcement-dialog {
    width: min(520px, 100%); max-height: min(80vh, 640px); display: grid; grid-template-rows: auto minmax(0, 1fr) auto;
    border-radius: 28px; transform: translateY(16px) scale(.96); transition: transform .55s var(--spring);
    --glass: rgba(255, 255, 255, .82);
}
.announcement-modal.show .announcement-dialog { transform: none; }
.announcement-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 20px 20px 8px; }
.announcement-header h3 { display: flex; align-items: center; gap: 8px; font-size: 18px; font-weight: 750; }
.announcement-header h3 svg.lucide { color: var(--blue); }
.announcement-close {
    width: 34px; height: 34px; border: 0; border-radius: 50%; display: grid; place-items: center; cursor: pointer;
    background: var(--track); color: var(--muted); transition: transform .35s var(--spring), background-color .2s ease;
}
.announcement-close:hover { background: rgba(118, 118, 128, .2); color: var(--text); }
.announcement-close:active { transform: scale(.9); }
.announcement-body { overflow: auto; padding: 4px 20px 8px; font-size: 14.5px; line-height: 1.75; color: #3a3a3c; }
.announcement-body h1, .announcement-body h2, .announcement-body h3 { margin: 12px 0 6px; font-size: 16px; color: var(--text); }
.announcement-body p { margin: 8px 0; }
.announcement-body ul, .announcement-body ol { margin: 8px 0; padding-left: 20px; }
.announcement-body code { padding: 1px 6px; border-radius: 6px; background: var(--track); font-family: var(--font-mono); font-size: 13px; }
.announcement-footer { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 10px; padding: 12px 20px 20px; }
.announcement-footer .btn { height: 44px; }
.renewal-reminder-footer .btn { flex: 1 1 auto; }

/* ---------- 宽屏 ---------- */
@media (min-width: 980px) {
    .page-wrap { grid-template-columns: minmax(0, 1fr) 470px; align-items: center; gap: 56px; min-height: 100vh; padding-top: 48px; }
    .hero-header h1 { font-size: 50px; }
    .hero-subtitle { font-size: 16px; }
    .main-shell { padding: 24px; }
}
@media (max-width: 420px) {
    .page-wrap { padding-left: 14px; padding-right: 14px; }
    .main-shell { padding: 16px; border-radius: 26px; }
    .top-tab { font-size: 13.5px; gap: 4px; }
    .warranty-query-row { grid-template-columns: 1fr; }
    .warranty-query-btn { width: 100%; }
    .record-meta-grid, .warranty-summary { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
