/* ==========================================
   用户兑换页面 - 简洁设计
   ========================================== */

:root {
    --primary: #2563eb;
    --primary-hover: #1d4ed8;
    --primary-light: #eff6ff;

    --bg-page: #f8fafc;
    --bg-card: #ffffff;
    --bg-hover: #f1f5f9;

    --text-primary: #0f172a;
    --text-secondary: #64748b;
    --text-muted: #94a3b8;

    --border: #e2e8f0;
    --border-hover: #cbd5e1;

    --success: #10b981;
    --success-light: #d1fae5;
    --warning: #f59e0b;
    --warning-light: #fef3c7;
    --danger: #ef4444;
    --danger-light: #fee2e2;
    --info: #3b82f6;
    --info-light: #dbeafe;

    --shadow-sm: 0 1px 3px rgba(15, 23, 42, 0.06);
    --shadow-md: 0 8px 20px -6px rgba(15, 23, 42, 0.10);
    --shadow-lg: 0 20px 44px -16px rgba(15, 23, 42, 0.18);

    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 20px;
    --radius-full: 9999px;

    --transition: 200ms cubic-bezier(0.4, 0, 0.2, 1);
}

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

body.redeem-page {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: var(--bg-page);
    color: var(--text-primary);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    min-height: 100vh;
}

/* 移除过度装饰 */
.bg-scene,
.grid-overlay,
.cartoon-deco {
    display: none !important;
}

/* 页面容器 */
.page-wrap {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem 1rem;
}

.container {
    max-width: 600px;
    width: 100%;
    margin: 0 auto;
}

/* 头部 */
.hero-header {
    text-align: center;
    margin-bottom: 2rem;
}

.hero-header h1 {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.hero-highlight {
    color: var(--primary);
}

.hero-subtitle {
    font-size: 1rem;
    color: var(--text-secondary);
    margin-bottom: 1rem;
}

.spots-row {
    display: flex;
    justify-content: center;
    gap: 1rem;
    flex-wrap: wrap;
    margin-top: 1rem;
}

.spots-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: var(--info-light);
    color: var(--info);
    border-radius: var(--radius-full);
    font-size: 0.875rem;
    font-weight: 600;
}

.welfare-spots-badge {
    background: var(--success-light);
    color: var(--success);
}

.seats-count {
    font-weight: 700;
}

/* 主卡片 */
.main-shell {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-md);
}

/* 标签导航 */
.top-nav-tabs {
    display: flex;
    border-bottom: 1px solid var(--border);
    background: var(--bg-hover);
    position: relative;
    padding: 0.5rem;
    gap: 0.5rem;
}

.tab-indicator {
    display: none;
}

.top-tab {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    border-radius: var(--radius-md);
    transition: var(--transition);
}

.top-tab:hover {
    color: var(--text-primary);
    background: rgba(0, 0, 0, 0.05);
}

.top-tab.active {
    background: var(--bg-card);
    color: var(--primary);
    box-shadow: var(--shadow-sm);
}

/* 面板内容 */
.step {
    display: none;
}

.step.active {
    display: block;
}

/* 步骤内容容器（原标签页面板，标签页已下线） */
.step-body {
    display: block;
    padding: 2rem;
}

.panel-head {
    margin-bottom: 1.5rem;
}

.panel-head h2 {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.panel-head p {
    color: var(--text-secondary);
    font-size: 0.875rem;
}

.panel-head-with-meta {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
}

.panel-meta-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.panel-meta-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.375rem 0.75rem;
    background: var(--bg-hover);
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-secondary);
    white-space: nowrap;
}

/* 信息提示框 */
.info-box {
    display: flex;
    gap: 0.75rem;
    padding: 1rem;
    background: var(--info-light);
    border-left: 4px solid var(--info);
    border-radius: var(--radius-md);
    margin-bottom: 1.5rem;
    font-size: 0.875rem;
    color: var(--info);
}

.info-icon {
    flex-shrink: 0;
    width: 20px;
    height: 20px;
}

.warning-box {
    display: flex;
    gap: 0.75rem;
    padding: 1rem;
    background: var(--warning-light);
    border-left: 4px solid var(--warning);
    border-radius: var(--radius-md);
    margin-top: 1.5rem;
    font-size: 0.875rem;
    color: var(--warning);
}

/* 表单 */
.stack-form {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.form-group {
    display: flex;
    flex-direction: column;
}

.form-group label {
    font-size: 0.875rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.required-star {
    color: var(--danger);
}

.field-wrap {
    position: relative;
}

.field-icon {
    position: absolute;
    left: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    width: 16px;
    height: 16px;
}

.form-input {
    width: 100%;
    padding: 0.625rem 0.75rem 0.625rem 2.5rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    font-size: 0.875rem;
    background: var(--bg-card);
    color: var(--text-primary);
    transition: var(--transition);
}

.form-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-light);
}

.field-hint {
    margin-top: 0.375rem;
    font-size: 0.75rem;
    color: var(--text-secondary);
}

/* 按钮 */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.625rem 1.25rem;
    border: 1px solid transparent;
    border-radius: var(--radius-md);
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
}

.btn i {
    width: 16px;
    height: 16px;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

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

.btn-primary:hover:not(:disabled) {
    background: var(--primary-hover);
    border-color: var(--primary-hover);
}

.btn-secondary {
    background: var(--bg-card);
    border-color: var(--border);
    color: var(--text-primary);
}

.btn-secondary:hover:not(:disabled) {
    background: var(--bg-hover);
    border-color: var(--border-hover);
}

/* 质保查询 */
.warranty-query-form {
    margin-bottom: 1.5rem;
}

.warranty-query-row {
    display: flex;
    gap: 0.75rem;
    align-items: flex-end;
}

.warranty-query-field {
    flex: 1;
}

.warranty-query-btn {
    flex-shrink: 0;
}

.warranty-query-hint {
    margin-top: 0.5rem;
}

.warranty-result-container {
    margin-top: 1.5rem;
    padding: 1.5rem;
    background: var(--bg-hover);
    border-radius: var(--radius-md);
}

/* 结果显示 */
.result-shell {
    padding: 2rem;
}

/* Toast 通知 */
.toast {
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    min-width: 300px;
    max-width: 400px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1rem;
    box-shadow: var(--shadow-lg);
    transform: translateY(100px);
    opacity: 0;
    transition: all var(--transition);
    z-index: 9999;
}

.toast.show {
    transform: translateY(0);
    opacity: 1;
}

.toast.success {
    border-left: 4px solid var(--success);
}

.toast.error {
    border-left: 4px solid var(--danger);
}

.toast.warning {
    border-left: 4px solid var(--warning);
}

.toast.info {
    border-left: 4px solid var(--info);
}

/* 公告模态框 */
.announcement-modal {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--transition);
    padding: 1rem;
}

.announcement-modal[aria-hidden="false"] {
    opacity: 1;
    pointer-events: auto;
}

.announcement-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: -1;
}

.announcement-dialog {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    max-width: 500px;
    width: 100%;
    max-height: 90vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow-lg);
}

.announcement-header {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.announcement-header h3 {
    font-size: 1.125rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.announcement-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--text-secondary);
    cursor: pointer;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-md);
}

.announcement-close:hover {
    background: var(--bg-hover);
}

.announcement-body {
    padding: 1.5rem;
    overflow-y: auto;
    flex: 1;
}

.announcement-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: flex-end;
}

.renewal-reminder-footer {
    gap: 0.5rem;
}

/* 移动端响应 */
@media (max-width: 768px) {
    .page-wrap {
        padding: 1rem 0.5rem;
    }

    .hero-header h1 {
        font-size: 1.5rem;
    }

    .step-body {
        padding: 1.5rem 1rem;
    }

    .panel-head-with-meta {
        flex-direction: column;
    }

    .warranty-query-row {
        flex-direction: column;
    }

    .warranty-query-btn {
        width: 100%;
    }

    .spots-row {
        flex-direction: column;
        align-items: center;
    }

    .toast {
        right: 0.75rem;
        bottom: 0.75rem;
        min-width: auto;
        max-width: calc(100vw - 1.5rem);
    }
}

/* 打印样式 */
@media print {
    .bg-scene,
    .grid-overlay,
    .cartoon-deco,
    .toast,
    .announcement-modal {
        display: none !important;
    }

    body {
        background: white;
    }

    .main-shell {
        border: 1px solid #ddd;
        box-shadow: none;
    }
}

/* ---------- 步骤徽章（卡密 → 账号信息 两步流程） ---------- */
.step-badge {
    display: inline-block;
    margin-bottom: 0.5rem;
    padding: 0.15rem 0.6rem;
    background: var(--primary-light);
    color: var(--primary);
    border-radius: var(--radius-full, 999px);
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.02em;
}

/* 单流程页面：面板内边距与标题间距收紧，去掉重复留白 */
.main-shell .panel-head {
    margin-bottom: 1.25rem;
}

.main-shell .panel-head h2 {
    margin: 0 0 0.35rem;
}

.main-shell .panel-head p {
    margin: 0;
}

/* ---------- 圆润化打磨 ---------- */
/* 主卡片：更大圆角、更柔阴影、更宽松内边距 */
.main-shell {
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
}

.main-shell .panel-head h2 {
    letter-spacing: -0.01em;
}

/* 输入框：更高更圆，聚焦时柔和描边 */
.form-input {
    height: 46px;
    border-radius: var(--radius-md);
    border-color: var(--border);
    transition: border-color var(--transition), box-shadow var(--transition);
}

.form-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px var(--primary-light);
}

/* 按钮：更圆润、按压有反馈 */
.btn {
    height: 46px;
    border-radius: var(--radius-md);
    font-weight: 600;
    letter-spacing: 0.01em;
    transition: transform var(--transition), background var(--transition), box-shadow var(--transition);
}

.btn-primary {
    box-shadow: 0 6px 16px -6px rgba(37, 99, 235, 0.55);
}

.btn-primary:hover:not(:disabled) { transform: translateY(-1px); }
.btn:active:not(:disabled) { transform: translateY(0); }

/* 标题区更透气 */
.hero-header h1 {
    letter-spacing: -0.02em;
}

.hero-subtitle {
    margin-top: 0.6rem;
    font-size: 0.95rem;
}

/* 步骤徽章更圆润 */
.step-badge {
    padding: 0.2rem 0.7rem;
    border-radius: var(--radius-full);
}
