/* ==================== 联通抢兑 — 中国红主题 ==================== */

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

:root {
    --red: #C41230;
    --red-dark: #9B0012;
    --red-light: #FFF0F0;
    --gold: #C4922E;
    --bg: #F5F5F5;
    --white: #FFFFFF;
    --text: #1A1A1A;
    --text-secondary: #666666;
    --border: #E8E8E8;
    --radius: 12px;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC',
                 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    line-height: 1.6;
}

/* ==================== 顶部导航 ==================== */
.top-bar {
    background: var(--red);
    padding: 14px 20px;
    color: #fff;
}

.top-bar .logo {
    font-size: 17px;
    font-weight: 700;
    letter-spacing: 1px;
}

.top-bar .logo-en {
    font-size: 12px;
    opacity: 0.85;
    margin-top: 2px;
}

/* ==================== 容器 ==================== */
.container {
    max-width: 480px;
    margin: 0 auto;
    padding: 16px;
}

/* ==================== 搜索栏 ==================== */
.search-bar {
    display: flex;
    gap: 10px;
    background: var(--white);
    padding: 16px;
    border-radius: var(--radius);
    margin-bottom: 12px;
    box-shadow: 0 1px 4px rgba(0,0,0,.04);
}

.search-bar input {
    flex: 1;
    height: 44px;
    border: 1.5px solid var(--border);
    border-radius: 10px;
    padding: 0 14px;
    font-size: 15px;
    outline: none;
    transition: border-color .2s;
    background: #FAFAFA;
}

.search-bar input:focus {
    border-color: var(--red);
}

.search-bar button {
    height: 44px;
    padding: 0 22px;
    background: var(--red);
    color: #fff;
    border: none;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: background .2s;
}

.search-bar button:active {
    background: var(--red-dark);
}

.search-bar button:disabled {
    opacity: .6;
}

/* ==================== 余额卡片 ==================== */
.balance-card {
    background: linear-gradient(135deg, #B71C1C 0%, var(--red) 40%, #D32F2F 100%);
    border-radius: 16px;
    padding: 24px 20px;
    color: #fff;
    margin-bottom: 12px;
    box-shadow: 0 4px 16px rgba(196,18,48,.2);
}

.balance-label {
    font-size: 13px;
    opacity: .85;
    letter-spacing: 1px;
}

.balance-row {
    display: flex;
    align-items: baseline;
    margin: 8px 0;
}

.balance-symbol {
    font-size: 22px;
    font-weight: 300;
    margin-right: 2px;
    opacity: .8;
}

.balance-value {
    font-size: 48px;
    font-weight: 700;
    line-height: 1;
    letter-spacing: -1px;
}

.balance-expire {
    font-size: 12px;
    opacity: .7;
    margin-bottom: 6px;
    background: rgba(255,255,255,.15);
    display: inline-block;
    padding: 2px 10px;
    border-radius: 10px;
}

.balance-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 12px;
    opacity: .75;
    margin-top: 8px;
}

.setting-tag {
    background: rgba(255,255,255,.2);
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 12px;
}

/* ==================== 用户信息行 ==================== */
.info-row {
    display: flex;
    gap: 10px;
    margin-bottom: 12px;
}

.info-item {
    flex: 1;
    background: var(--white);
    border-radius: var(--radius);
    padding: 12px 14px;
    text-align: center;
    box-shadow: 0 1px 4px rgba(0,0,0,.04);
}

.info-item .label {
    font-size: 11px;
    color: var(--text-secondary);
    margin-bottom: 2px;
}

.info-item .value {
    font-size: 15px;
    font-weight: 600;
    color: var(--text);
}

/* ==================== 兑换区域 ==================== */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.section-title {
    font-size: 17px;
    font-weight: 700;
}

.section-desc {
    font-size: 12px;
    color: var(--text-secondary);
}

.coupon-list {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 8px;
    margin-bottom: 12px;
}

.coupon-card {
    background: var(--white);
    border: 2px solid var(--border);
    border-radius: 14px;
    padding: 14px 6px;
    text-align: center;
    cursor: pointer;
    transition: all .2s;
    position: relative;
    min-width: 0;
}

.coupon-card:active { transform: scale(.96); }

.coupon-card.selected {
    border-color: var(--red);
    background: var(--red-light);
    box-shadow: 0 0 0 3px rgba(196,18,48,.1);
}

.coupon-card.selected::after {
    content: '✓';
    position: absolute;
    top: 6px;
    right: 8px;
    width: 20px;
    height: 20px;
    background: var(--red);
    color: #fff;
    border-radius: 50%;
    font-size: 11px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.coupon-card.disabled {
    opacity: .35;
    pointer-events: none;
}

.coupon-card .amount {
    font-size: 26px;
    font-weight: 800;
    color: var(--red);
    margin-bottom: 2px;
}

.coupon-card .name {
    font-size: 12px;
    color: var(--text-secondary);
    margin-bottom: 2px;
}

.coupon-card .condition {
    font-size: 11px;
    color: #999;
}

/* ==================== 余额提示 ==================== */
.balance-tip {
    background: #FFF3E0;
    border-left: 3px solid #F57C00;
    border-radius: 8px;
    padding: 10px 14px;
    font-size: 13px;
    color: #E65100;
    margin-bottom: 12px;
}

/* ==================== 按钮 ==================== */
.btn-primary {
    height: 44px;
    padding: 0 24px;
    background: var(--red);
    color: #fff;
    border: none;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    flex: 1;
}

.btn-primary:active { background: var(--red-dark); }
.btn-primary:disabled { opacity: .5; }

.btn-ghost {
    flex: 1;
    height: 44px;
    background: #F5F5F5;
    color: var(--text-secondary);
    border: none;
    border-radius: 10px;
    font-size: 15px;
    cursor: pointer;
}

/* ==================== 弹窗 ==================== */
.overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.45);
    z-index: 100;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.overlay.show { display: flex; }

.dialog {
    background: #fff;
    border-radius: 20px;
    width: 100%;
    max-width: 360px;
    overflow: hidden;
    animation: dialogIn .25s ease;
}

@keyframes dialogIn {
    from { opacity: 0; transform: translateY(20px) scale(.96); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

.dialog-title {
    padding: 20px 20px 8px;
    font-size: 17px;
    font-weight: 700;
    text-align: center;
}

.dialog-body {
    padding: 8px 20px 16px;
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.8;
    text-align: center;
}

.dialog-actions {
    display: flex;
    gap: 10px;
    padding: 12px 20px 20px;
}

/* ==================== 步骤列表 ==================== */
.steps { text-align: left; }
.step {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 0;
    font-size: 14px;
    color: var(--text);
    border-bottom: 1px solid #F0F0F0;
}
.step:last-child { border: none; }
.step-num {
    width: 24px;
    height: 24px;
    background: var(--red);
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 700;
    flex-shrink: 0;
}

/* ==================== 底部 ==================== */
.footer {
    text-align: center;
    font-size: 12px;
    color: #BBB;
    padding: 24px 0;
}

/* ==================== 加载动画 ==================== */
.spinner {
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255,255,255,.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin .6s linear infinite;
    display: inline-block;
}

@keyframes spin { to { transform: rotate(360deg); } }
