/* ==========================================
   闪电官网 · 统一前端样式
   配色：品牌橙 #ff6700 / 中性灰阶
   ========================================== */

:root {
    --brand: #ff6700;
    --brand-dark: #e65c00;
    --brand-light: #fff3ea;
    --brand-border: #ffd9bf;

    --text: #1f2329;
    --text-2: #5b6472;
    --text-3: #98a1ae;

    --bg: #f5f6f8;
    --surface: #ffffff;
    --surface-2: #fafbfc;

    --line: #e8eaee;
    --line-2: #dfe2e7;

    --ok: #17a34a;
    --warn: #f59e0b;
    --danger: #e5484d;

    --r-sm: 8px;
    --r-md: 12px;
    --r-lg: 16px;
    --r-full: 999px;

    --shadow-sm: 0 1px 2px rgba(16, 24, 40, .04);
    --shadow-md: 0 4px 16px rgba(16, 24, 40, .07);
    --shadow-lg: 0 12px 32px rgba(16, 24, 40, .10);
}

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

body {
    background: var(--bg);
    color: var(--text);
    font-family: "PingFang SC", "Microsoft YaHei", -apple-system, "Helvetica Neue", sans-serif;
    font-size: 15px;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

a { color: var(--brand); text-decoration: none; }
img { max-width: 100%; display: block; }

.container {
    width: 100%;
    max-width: 1180px;
    margin: 0 auto;
    padding: 0 20px;
}

/* ============ 顶部导航 ============ */

.site-header {
    background: var(--surface);
    border-bottom: 1px solid var(--line);
    position: sticky;
    top: 0;
    z-index: 100;
}

.navbar {
    display: flex;
    align-items: center;
    gap: 28px;
    height: 66px;
}

.brand {
    display: flex;
    align-items: center;
    gap: 9px;
    font-size: 19px;
    font-weight: 700;
    color: var(--text);
    white-space: nowrap;
}

.brand img { height: 30px; width: auto; }

.nav-menu {
    display: flex;
    align-items: center;
    gap: 4px;
    list-style: none;
    flex: 1;
}

.nav-menu a {
    display: block;
    padding: 8px 14px;
    border-radius: var(--r-sm);
    color: var(--text-2);
    font-size: 15px;
    transition: all .18s ease;
}

.nav-menu a:hover {
    background: var(--surface-2);
    color: var(--text);
}

.nav-menu a.on {
    background: var(--brand-light);
    color: var(--brand);
    font-weight: 600;
}

.nav-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-left: auto;
}

.nav-toggle {
    display: none;
    width: 40px;
    height: 40px;
    border: 1px solid var(--line-2);
    border-radius: var(--r-sm);
    background: var(--surface);
    cursor: pointer;
    padding: 0;
    position: relative;
}

.nav-toggle span,
.nav-toggle span::before,
.nav-toggle span::after {
    position: absolute;
    left: 50%;
    width: 18px;
    height: 2px;
    background: var(--text);
    border-radius: 2px;
    transform: translateX(-50%);
    transition: all .2s ease;
}
.nav-toggle span { top: 50%; margin-top: -1px; }
.nav-toggle span::before { content: ""; left: 0; transform: none; top: -6px; }
.nav-toggle span::after { content: ""; left: 0; transform: none; top: 6px; }

/* ============ 按钮 ============ */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 20px;
    border: 1px solid transparent;
    border-radius: var(--r-sm);
    font-size: 15px;
    font-family: inherit;
    font-weight: 500;
    cursor: pointer;
    transition: all .18s ease;
    white-space: nowrap;
}

.btn-primary {
    background: var(--brand);
    color: #fff;
}
.btn-primary:hover { background: var(--brand-dark); }

.btn-ghost {
    background: var(--surface);
    color: var(--text-2);
    border-color: var(--line-2);
}
.btn-ghost:hover { border-color: var(--brand); color: var(--brand); }

.btn-light {
    background: rgba(255, 255, 255, .18);
    color: #fff;
    border-color: rgba(255, 255, 255, .45);
    backdrop-filter: blur(6px);
}
.btn-light:hover { background: rgba(255, 255, 255, .3); }

.btn-lg { padding: 13px 30px; font-size: 16px; }
.btn-block { width: 100%; }

.btn[disabled],
.btn.is-disabled {
    background: var(--line-2);
    color: #fff;
    cursor: not-allowed;
    border-color: transparent;
}

/* ============ 页头横幅 ============ */

.page-head {
    padding: 30px 0 6px;
}

.page-head h1 {
    font-size: 26px;
    font-weight: 700;
    letter-spacing: -.3px;
}

.page-head p {
    color: var(--text-2);
    font-size: 14px;
    margin-top: 6px;
}

/* ============ 卡片 ============ */

.main { padding: 24px 0 40px; }

.card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--r-md);
    box-shadow: var(--shadow-sm);
}

.card-pad { padding: 22px; }

.card-title {
    font-size: 16px;
    font-weight: 600;
    padding-bottom: 12px;
    margin-bottom: 16px;
    border-bottom: 1px solid var(--line);
    display: flex;
    align-items: center;
    gap: 8px;
}

.card-title::before {
    content: "";
    width: 3px;
    height: 15px;
    background: var(--brand);
    border-radius: 2px;
}

.tag {
    display: inline-block;
    padding: 2px 9px;
    border-radius: var(--r-full);
    font-size: 12px;
    font-weight: 500;
    line-height: 1.7;
}

.tag-orange { background: var(--brand-light); color: var(--brand-dark); }
.tag-green { background: #e8f7ee; color: var(--ok); }
.tag-gray { background: var(--surface-2); color: var(--text-3); border: 1px solid var(--line); }

/* ============ 首页 Hero ============ */

.hero {
    background: linear-gradient(135deg, #ff7a1a 0%, #ff6700 45%, #f25400 100%);
    border-radius: var(--r-lg);
    padding: 40px 44px;
    color: #fff;
    display: flex;
    align-items: center;
    gap: 32px;
    overflow: hidden;
    position: relative;
}

.hero::after {
    content: "";
    position: absolute;
    right: -60px;
    top: -60px;
    width: 260px;
    height: 260px;
    border-radius: 50%;
    background: rgba(255, 255, 255, .08);
}

.hero-text { flex: 1; position: relative; z-index: 1; }

.hero-badge {
    display: inline-block;
    background: rgba(255, 255, 255, .2);
    border: 1px solid rgba(255, 255, 255, .3);
    padding: 4px 13px;
    border-radius: var(--r-full);
    font-size: 13px;
    margin-bottom: 16px;
}

.hero h1 {
    font-size: 34px;
    font-weight: 700;
    line-height: 1.3;
    letter-spacing: -.5px;
}

.hero p {
    margin-top: 12px;
    font-size: 15px;
    opacity: .92;
    max-width: 460px;
}

.hero-btns {
    display: flex;
    gap: 12px;
    margin-top: 26px;
    flex-wrap: wrap;
}

.hero-figure {
    width: 190px;
    flex-shrink: 0;
    position: relative;
    z-index: 1;
    display: flex;
    justify-content: center;
}

.hero-figure img {
    width: 168px;
    border-radius: var(--r-md);
    box-shadow: 0 10px 30px rgba(0, 0, 0, .22);
}

/* ============ 快捷入口 ============ */

.quick-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 14px;
}

.quick-card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--r-md);
    padding: 22px 16px;
    text-align: center;
    transition: all .2s ease;
}

.quick-card:hover {
    transform: translateY(-3px);
    border-color: var(--brand-border);
    box-shadow: var(--shadow-md);
}

.quick-ico {
    width: 44px;
    height: 44px;
    margin: 0 auto 12px;
    border-radius: var(--r-md);
    background: var(--brand-light);
    color: var(--brand);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 21px;
}

.quick-card b { display: block; font-size: 15px; font-weight: 600; }
.quick-card span { font-size: 12.5px; color: var(--text-3); }

/* ============ 公告时间轴 ============ */

.notice-list { display: flex; flex-direction: column; }

.notice-item {
    display: flex;
    gap: 14px;
    padding: 13px 0;
    border-bottom: 1px solid var(--line);
}
.notice-item:last-child { border-bottom: none; }

.notice-date {
    flex-shrink: 0;
    width: 62px;
    text-align: center;
    font-size: 12px;
    color: var(--text-3);
    background: var(--surface-2);
    border-radius: var(--r-sm);
    height: 26px;
    line-height: 26px;
    font-weight: 500;
}

.notice-item p {
    font-size: 14.5px;
    color: var(--text);
    line-height: 1.55;
}

.notice-item.is-important p { font-weight: 600; }

/* ============ 通用表单 ============ */

.form-box { max-width: 400px; margin: 0 auto; }

.field {
    display: block;
    margin-bottom: 14px;
}

.field > label {
    display: block;
    font-size: 13.5px;
    color: var(--text-2);
    margin-bottom: 7px;
    font-weight: 500;
}

.input,
input[type="text"],
input[type="password"],
input[type="tel"],
input[type="number"],
select,
textarea {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid var(--line-2);
    border-radius: var(--r-sm);
    background: var(--surface);
    font-size: 15px;
    font-family: inherit;
    color: var(--text);
    transition: all .18s ease;
}

.input:focus,
input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: var(--brand);
    box-shadow: 0 0 0 3px var(--brand-light);
}

.form-hint { font-size: 13px; color: var(--text-3); margin-top: 10px; }

.captcha-row {
    display: flex;
    gap: 10px;
    align-items: stretch;
}

.captcha-row input { flex: 1; }

.captcha-img {
    width: 108px;
    flex-shrink: 0;
    border-radius: var(--r-sm);
    background: var(--brand);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    font-weight: 700;
    letter-spacing: 5px;
    cursor: pointer;
    user-select: none;
}

/* ============ 表格 ============ */

.table-wrap {
    overflow-x: auto;
    border-radius: var(--r-md);
    border: 1px solid var(--line);
    background: var(--surface);
    -webkit-overflow-scrolling: touch;
}

.table {
    width: 100%;
    border-collapse: collapse;
    min-width: 560px;
    font-size: 14px;
}

.table th,
.table td {
    padding: 12px 14px;
    text-align: center;
    border-bottom: 1px solid var(--line);
    white-space: nowrap;
}

.table th {
    background: var(--surface-2);
    color: var(--text-2);
    font-weight: 600;
    font-size: 13.5px;
}

.table tbody tr:last-child td { border-bottom: none; }
.table tbody tr:hover { background: var(--brand-light); }

.table .num {
    font-family: "SF Mono", Consolas, monospace;
    letter-spacing: .3px;
}

.empty {
    text-align: center;
    color: var(--text-3);
    padding: 44px 0;
    font-size: 14px;
}

/* ============ 页脚 ============ */

.site-footer {
    background: var(--surface);
    border-top: 1px solid var(--line);
    padding: 34px 0 24px;
    margin-top: 20px;
}

.footer-copy {
    text-align: center;
    font-size: 13px;
    color: var(--text-3);
    padding-top: 20px;
}

/* ============ 页面通用 ============ */

.page-title {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 6px;
}

.page-sub {
    color: var(--text-2);
    font-size: 14px;
    margin-bottom: 22px;
}

.section-gap { margin-top: 18px; }

/* ============ 记录类页面通用组件 ============ */

.page-top {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}

.page-top h1 {
    font-size: 22px;
    font-weight: 700;
}

.back-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 7px 14px;
    border: 1px solid var(--line-2);
    border-radius: var(--r-sm);
    background: var(--surface);
    color: var(--text-2);
    font-size: 14px;
    transition: all .18s ease;
}

.back-btn:hover { border-color: var(--brand); color: var(--brand); }

/* 提示条 */
.tip-box {
    background: var(--brand-light);
    border-left: 3px solid var(--brand);
    border-radius: var(--r-sm);
    padding: 12px 14px;
    font-size: 13.5px;
    color: #8a4b12;
    line-height: 1.7;
    margin-bottom: 16px;
}

.tip-box.is-danger {
    background: #fdeced;
    border-left-color: var(--danger);
    color: #b3282d;
}

.tip-box.is-info {
    background: #eef4fd;
    border-left-color: var(--brand);
    color: var(--text-2);
}

/* 搜索行 */
.search-row {
    display: flex;
    gap: 10px;
    margin-bottom: 16px;
}

.search-row input { flex: 1; min-width: 0; }

.search-row .btn { flex-shrink: 0; }

/* 记录卡片列表 */
.record-list { display: flex; flex-direction: column; gap: 12px; }

.record-item {
    background: var(--surface-2);
    border: 1px solid var(--line);
    border-left: 3px solid var(--brand);
    border-radius: var(--r-sm);
    padding: 14px 16px;
}

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

.record-code {
    font-size: 15px;
    font-weight: 600;
    color: var(--text);
    word-break: break-all;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.record-amount {
    font-size: 17px;
    font-weight: 700;
    color: var(--brand);
    white-space: nowrap;
}

.detail-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 10px 18px;
}

.detail-item {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    font-size: 13.5px;
    min-width: 0;
}

.detail-label { color: var(--text-3); flex-shrink: 0; }

.detail-value {
    color: var(--brand);
    font-weight: 600;
    text-align: right;
    word-break: break-all;
    min-width: 0;
}

.detail-value.plain { color: var(--text); font-weight: 400; }

.record-action { margin-top: 12px; }

.record-note {
    font-size: 12.5px;
    color: var(--danger);
    margin-top: 6px;
}

/* 状态徽标 */
.st {
    display: inline-block;
    padding: 2px 9px;
    border-radius: var(--r-full);
    font-size: 12px;
    font-weight: 500;
    white-space: nowrap;
}

.st-bound { background: #fdeced; color: var(--danger); }
.st-free { background: #e8f7ee; color: var(--ok); }
.st-other { background: var(--surface); color: var(--text-3); border: 1px solid var(--line-2); }

/* 分页 */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 20px;
}

.pagination a,
.pagination span {
    min-width: 34px;
    height: 34px;
    padding: 0 11px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--line-2);
    border-radius: var(--r-sm);
    background: var(--surface);
    color: var(--text-2);
    font-size: 14px;
}

.pagination a:hover { border-color: var(--brand); color: var(--brand); }

.pagination .active {
    background: var(--brand);
    border-color: var(--brand);
    color: #fff;
    font-weight: 500;
}

.pagination .disabled {
    color: var(--text-3);
    background: var(--surface-2);
    cursor: not-allowed;
}

/* 区块小标题 */
.block-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--text);
    margin: 24px 0 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.block-title::before {
    content: "";
    width: 3px;
    height: 14px;
    background: var(--brand);
    border-radius: 2px;
}

.block-title:first-child { margin-top: 0; }

/* 指标卡 */
.metric-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
    gap: 12px;
    margin-bottom: 20px;
}

.metric {
    background: var(--surface-2);
    border: 1px solid var(--line);
    border-radius: var(--r-sm);
    padding: 14px 16px;
}

.metric span {
    display: block;
    font-size: 13px;
    color: var(--text-3);
    margin-bottom: 5px;
}

.metric b {
    font-size: 22px;
    font-weight: 700;
    color: var(--brand);
    line-height: 1.2;
}

.metric b small { font-size: 13px; font-weight: 400; color: var(--text-3); margin-left: 3px; }

/* 规则列表 */
.rule-list { display: flex; flex-direction: column; gap: 11px; }

.rule-item {
    position: relative;
    padding-left: 18px;
    font-size: 14px;
    color: var(--text-2);
    line-height: 1.7;
}

.rule-item::before {
    content: "";
    position: absolute;
    left: 3px;
    top: 9px;
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: var(--brand);
}

.rule-item strong { color: var(--text); font-weight: 600; }

.rule-highlight {
    background: var(--brand-light);
    border-radius: var(--r-sm);
    padding: 13px 15px;
    margin-bottom: 16px;
    font-size: 14px;
    color: #8a4b12;
}

.rule-highlight b { color: var(--brand-dark); font-size: 15px; }

/* 推广码展示 */
.promo-box {
    background: var(--brand-light);
    border: 1px dashed var(--brand-border);
    border-radius: var(--r-sm);
    padding: 15px;
    text-align: center;
    margin-bottom: 12px;
}

.promo-label { font-size: 13px; color: var(--text-3); margin-bottom: 6px; }

.promo-value {
    font-size: 20px;
    font-weight: 700;
    color: var(--brand);
    letter-spacing: 1px;
    word-break: break-all;
}

.promo-value.small { font-size: 14px; font-weight: 400; letter-spacing: 0; }

/* ============ 商品购买 ============ */

.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
}

.product-card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--r-md);
    padding: 24px 18px;
    text-align: center;
    display: flex;
    flex-direction: column;
    transition: all .2s ease;
}

.product-card:hover {
    border-color: var(--brand-border);
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.product-card.is-out { opacity: .62; }

.product-name { font-size: 16px; font-weight: 600; margin-bottom: 7px; }

.product-meta { font-size: 13px; color: var(--text-3); margin-bottom: 14px; }

.product-price {
    font-size: 30px;
    font-weight: 700;
    color: var(--brand);
    line-height: 1.1;
    margin-bottom: 8px;
}

.product-price small { font-size: 15px; font-weight: 500; }

.product-badge {
    display: inline-block;
    font-size: 12px;
    color: var(--brand-dark);
    background: var(--brand-light);
    padding: 2px 10px;
    border-radius: var(--r-full);
    margin-bottom: 14px;
}

.product-btn { margin-top: auto; }

/* ============ 个人中心 ============ */

.user-hero {
    background: linear-gradient(135deg, #ff7a1a 0%, #ff6700 45%, #f25400 100%);
    border-radius: var(--r-md);
    padding: 26px 28px;
    color: #fff;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 18px;
    flex-wrap: wrap;
}

.user-id { display: flex; align-items: center; gap: 15px; }

.user-avatar {
    width: 54px;
    height: 54px;
    border-radius: 50%;
    background: rgba(255, 255, 255, .22);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    font-weight: 700;
    flex-shrink: 0;
}

.user-name { font-size: 21px; font-weight: 700; }

.user-level {
    display: inline-block;
    margin-top: 6px;
    background: rgba(255, 255, 255, .22);
    padding: 2px 11px;
    border-radius: var(--r-full);
    font-size: 12.5px;
}

/* 2026-10-24：一级代理徽章改为白底橙字 + 阴影，在橙色卡片上清晰可辨 */
.user-level.is-agent {
    background: #ffffff;
    color: var(--brand-dark);
    font-weight: 700;
    padding: 3px 12px;
    box-shadow: 0 2px 8px rgba(120, 53, 15, .28);
}

.user-balance { text-align: right; }

.user-balance span {
    display: block;
    font-size: 13px;
    opacity: .9;
    margin-bottom: 3px;
}

.user-balance b { font-size: 28px; font-weight: 700; }

/* 功能九宫格 */
.action-grid {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 12px;
    margin-bottom: 18px;
}

.action-card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--r-md);
    padding: 18px 12px;
    text-align: center;
    transition: all .2s ease;
}

.action-card:hover {
    transform: translateY(-2px);
    border-color: var(--brand-border);
    box-shadow: var(--shadow-md);
}

.action-ico {
    width: 38px;
    height: 38px;
    margin: 0 auto 10px;
    border-radius: 10px;
    background: var(--brand-light);
    color: var(--brand);
    display: flex;
    align-items: center;
    justify-content: center;
}

.action-card b { display: block; font-size: 14px; font-weight: 600; }

/* 统计双栏 */
.stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 14px;
}

.stat-list { display: flex; flex-direction: column; }

.stat-row {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 0;
    border-bottom: 1px solid var(--line);
    font-size: 14px;
}

.stat-row:last-child { border-bottom: none; }
.stat-row span { color: var(--text-3); }
.stat-row b { color: var(--brand); font-weight: 600; }


/* 消息条 */
.msg {
    padding: 12px 16px;
    border-radius: var(--r-sm);
    font-size: 14px;
    margin-bottom: 16px;
}

.msg-success { background: #e8f7ee; color: #14663a; }
.msg-error { background: #fdeced; color: #b3282d; }

/* ============ 授权查询结果 ============ */

.result-card {
    background: var(--surface);
    border: 1px solid var(--brand-border);
    border-radius: var(--r-md);
    overflow: hidden;
}

.result-banner {
    background: var(--brand-light);
    padding: 16px 22px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}

.result-banner b { font-size: 17px; font-weight: 700; color: var(--brand-dark); }

.result-body { padding: 22px; }

.result-code {
    font-family: "SF Mono", Consolas, monospace;
    font-size: 19px;
    font-weight: 700;
    color: var(--text);
    word-break: break-all;
    letter-spacing: .5px;
}

/* ============ 下载页 ============ */

.dl-hero {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--r-md);
    padding: 34px 28px;
    text-align: center;
}

.dl-icon {
    width: 66px;
    height: 66px;
    margin: 0 auto 16px;
    border-radius: var(--r-lg);
    background: var(--brand-light);
    color: var(--brand);
    display: flex;
    align-items: center;
    justify-content: center;
}

.dl-hero h2 { font-size: 24px; font-weight: 700; margin-bottom: 7px; }

.dl-hero p { color: var(--text-2); font-size: 14px; margin-bottom: 22px; }

.dl-btns { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }

.qrcode-box {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--r-md);
    padding: 26px;
    text-align: center;
    max-width: 340px;
    margin: 0 auto;
}

.qrcode-box img {
    width: 100%;
    border-radius: var(--r-sm);
    border: 1px solid var(--line);
}

.qrcode-box figcaption {
    font-size: 14px;
    color: var(--text-2);
    margin-top: 14px;
}

/* ============ 旧的通用类，保留兼容 ============ */
.home-section { display: flex; flex-direction: column; gap: 18px; }

/* ============ 响应式 ============ */

@media screen and (max-width: 900px) {
    .hero { padding: 32px 28px; }
    .hero h1 { font-size: 27px; }
    .hero-figure { display: none; }
    .action-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media screen and (max-width: 768px) {
    body { font-size: 14.5px; }
    .container { padding: 0 16px; }

    .navbar { height: 58px; gap: 12px; }
    .brand { font-size: 17px; }
    .brand img { height: 26px; }

    .nav-toggle { display: block; }

    .nav-menu {
        display: none;
        position: absolute;
        top: 58px;
        left: 0;
        right: 0;
        background: var(--surface);
        border-bottom: 1px solid var(--line);
        box-shadow: var(--shadow-md);
        flex-direction: column;
        align-items: stretch;
        gap: 0;
        padding: 8px 16px 14px;
    }

    .nav-menu.open { display: flex; }

    .nav-menu a {
        padding: 12px 10px;
        border-radius: var(--r-sm);
        border-bottom: 1px solid var(--line);
    }

    .nav-menu li:last-child a { border-bottom: none; }

    .nav-actions { margin-left: auto; }
    .nav-actions .btn { padding: 8px 15px; font-size: 14px; }

    .hero { padding: 26px 22px; border-radius: var(--r-md); }
    .hero h1 { font-size: 23px; }
    .hero p { font-size: 14px; }
    .hero-btns .btn { flex: 1; }

    .quick-grid { grid-template-columns: repeat(2, 1fr); gap: 11px; }
    .quick-card { padding: 17px 12px; }

    .card-pad { padding: 17px; }
    .page-title { font-size: 20px; }
    .main { padding: 18px 0 30px; }

    .page-top { margin-bottom: 13px; }
    .page-top h1 { font-size: 19px; }

    .record-item { padding: 13px 14px; }
    .record-head { margin-bottom: 10px; }
    .record-code { font-size: 14px; }
    .detail-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 12px; }
    .detail-item { font-size: 13px; flex-direction: column; gap: 1px; }
    .detail-value { text-align: left; }

    .user-hero { padding: 20px; }
    .user-balance { text-align: left; }
    .user-balance b { font-size: 24px; }
    .user-name { font-size: 18px; }
    .action-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
    .stat-grid { grid-template-columns: 1fr; }

    .product-grid { grid-template-columns: repeat(2, 1fr); gap: 11px; }
    .product-card { padding: 18px 12px; }
    .product-price { font-size: 24px; }

    .dl-hero { padding: 26px 20px; }
    .dl-hero h2 { font-size: 20px; }
    .qrcode-box { padding: 20px; }

    .search-row { flex-wrap: wrap; }
    .search-row input { flex: 1 1 100%; }

    .pagination a, .pagination span { min-width: 30px; height: 30px; padding: 0 9px; font-size: 13px; }
}

@media screen and (max-width: 400px) {
    .container { padding: 0 13px; }
    .brand span { font-size: 16px; }
    .hero h1 { font-size: 21px; }
    .nav-actions .btn { padding: 7px 12px; font-size: 13.5px; }

    .product-price { font-size: 22px; }
    .product-card { padding: 16px 10px; }
    .detail-grid { grid-template-columns: 1fr; }
    .user-balance b { font-size: 22px; }
    .metric-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .metric { padding: 12px; }
    .metric b { font-size: 19px; }
}

/* ===== 多件购买 + 授权码复制弹窗 (2026-10-27) ===== */
/* 购买数量步进器 */
.qty-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-bottom: 10px;
}

.qty-btn {
    width: 30px;
    height: 30px;
    flex: 0 0 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    border: 1px solid var(--line-2);
    border-radius: var(--r-sm);
    background: var(--surface);
    color: var(--text-2);
    font-size: 17px;
    font-family: inherit;
    line-height: 1;
    cursor: pointer;
    transition: all .15s ease;
    user-select: none;
    -webkit-user-select: none;
}

.qty-btn:hover:not(:disabled) { border-color: var(--brand); color: var(--brand); }
.qty-btn:active:not(:disabled) { background: var(--brand-light); }
.qty-btn:disabled { opacity: .45; cursor: not-allowed; }

.product-card .qty-input {
    width: 46px;
    height: 30px;
    padding: 0 2px;
    border: 1px solid var(--line-2);
    border-radius: var(--r-sm);
    background: var(--surface);
    color: var(--text);
    font-size: 14px;
    font-weight: 600;
    font-family: inherit;
    text-align: center;
    appearance: textfield;
    -moz-appearance: textfield;
}

.product-card .qty-input:focus {
    outline: none;
    border-color: var(--brand);
    box-shadow: 0 0 0 3px rgba(255, 103, 0, .1);
}

.product-card .qty-input:disabled { opacity: .5; }

.product-card .qty-input::-webkit-outer-spin-button,
.product-card .qty-input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

.product-total {
    min-height: 18px;
    margin-bottom: 12px;
    font-size: 12.5px;
    color: var(--text-3);
}

.product-total b {
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
}

/* ============ 购买成功弹窗 ============ */

.buy-modal-mask {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    background: rgba(15, 23, 42, .46);
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
    overflow-y: auto;
    animation: buy-fade .2s ease;
}

.buy-modal {
    width: 100%;
    max-width: 360px;
    max-height: calc(100vh - 32px);
    background: var(--surface);
    border-radius: var(--r-lg);
    box-shadow: var(--shadow-lg);
    position: relative;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: buy-rise .26s cubic-bezier(.2, .8, .3, 1);
}

.buy-modal-inner {
    padding: 20px;
    overflow-y: auto;
    min-height: 0;
}

.buy-modal:focus { outline: none; }

@keyframes buy-fade {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes buy-rise {
    from { opacity: 0; transform: translateY(14px) scale(.98); }
    to { opacity: 1; transform: none; }
}

@media (prefers-reduced-motion: reduce) {
    .buy-modal-mask, .buy-modal { animation: none; }
}

.buy-modal-x {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 30px;
    height: 30px;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: var(--text-3);
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
}

.buy-modal-x:hover { background: var(--surface-2); color: var(--text-2); }

.buy-ok {
    width: 48px;
    height: 48px;
    margin: 2px auto 12px;
    border-radius: 50%;
    background: #e8f7ee;
    display: flex;
    align-items: center;
    justify-content: center;
}

.buy-modal-title {
    text-align: center;
    font-size: 19px;
    font-weight: 700;
    letter-spacing: -.2px;
}

.buy-modal-sub {
    margin-top: 6px;
    text-align: center;
    font-size: 12.5px;
    color: var(--text-2);
    line-height: 1.6;
}

.buy-codebox {
    margin-top: 14px;
    padding: 12px 14px;
    background: var(--brand-light);
    border: 1px dashed var(--brand-border);
    border-radius: 10px;
    cursor: pointer;
    transition: border-color .18s ease;
}

.buy-codebox:hover { border-color: var(--brand); }

.buy-code-label {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    font-size: 11.5px;
    color: #8a4b12;
    letter-spacing: .3px;
}

.buy-copy-mini {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    border: 1px solid var(--brand-border);
    border-radius: 6px;
    background: var(--surface);
    color: var(--brand-dark);
    font-size: 12px;
    font-family: inherit;
    cursor: pointer;
}

.buy-copy-mini:hover { border-color: var(--brand); }

.buy-code {
    margin-top: 6px;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 23px;
    font-weight: 700;
    letter-spacing: 1.2px;
    line-height: 1.25;
    color: var(--text);
    word-break: break-all;
    user-select: all;
    -webkit-user-select: all;
}

.buy-info { margin-top: 10px; }

/* 批量购买的授权码列表 */
.buy-code-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
    max-height: 188px;
    margin-top: 7px;
    overflow-y: auto;
    overscroll-behavior: contain;
}

.buy-code-item {
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 6px 8px;
    border: 1px solid #ffe6d3;
    border-radius: 7px;
    background: rgba(255, 255, 255, .8);
}

.buy-code-idx {
    flex: 0 0 16px;
    font-size: 11px;
    color: var(--text-3);
    text-align: center;
    font-variant-numeric: tabular-nums;
}

.buy-code-txt {
    flex: 1 1 auto;
    min-width: 0;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 13.5px;
    font-weight: 600;
    letter-spacing: .4px;
    line-height: 1.35;
    color: var(--text);
    word-break: break-all;
    user-select: all;
    -webkit-user-select: all;
}

.buy-code-cp {
    flex: 0 0 auto;
    padding: 3px 8px;
    border: 1px solid var(--brand-border);
    border-radius: 5px;
    background: var(--surface);
    color: var(--brand-dark);
    font-size: 11.5px;
    font-family: inherit;
    cursor: pointer;
}

.buy-code-cp:hover { border-color: var(--brand); }

/* 多码弹窗：内容更长，纵向间距收紧，保证小屏也能一屏看到复制按钮 */
.buy-modal.is-multi .buy-modal-inner { padding: 16px; }

.buy-modal.is-multi .buy-ok {
    width: 42px;
    height: 42px;
    margin-bottom: 10px;
}

.buy-modal.is-multi .buy-modal-sub { margin-top: 4px; }

.buy-modal.is-multi .buy-codebox { margin-top: 12px; padding: 10px 12px; }

.buy-modal.is-multi .buy-code-list { max-height: 152px; gap: 5px; }

.buy-modal.is-multi .buy-code-item { padding: 5px 8px; }

.buy-modal.is-multi .buy-info { margin-top: 6px; }

.buy-modal.is-multi .buy-row { padding: 6px 0; font-size: 12.5px; }

.buy-modal.is-multi .buy-note { margin-top: 6px; }

.buy-modal.is-multi .buy-act { margin-top: 10px; }

.buy-modal.is-multi .buy-act-ghost { margin-top: 6px; height: 38px; }

.buy-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 8px 0;
    font-size: 13px;
    border-bottom: 1px solid #f0f2f5;
}

.buy-row:last-child { border-bottom: 0; }
.buy-row > span { color: var(--text-3); flex-shrink: 0; }

.buy-row > b {
    font-weight: 500;
    color: var(--text);
    text-align: right;
    word-break: break-all;
}

.buy-row > b.em { color: var(--brand-dark); font-weight: 600; }

.buy-row > b small {
    margin-left: 2px;
    font-size: 11.5px;
    font-weight: 400;
    color: var(--text-3);
}

.buy-note {
    margin-top: 8px;
    text-align: center;
    font-size: 11.5px;
    color: var(--text-3);
    line-height: 1.6;
}

.buy-act {
    height: 44px;
    margin-top: 12px;
    font-size: 15px;
    font-weight: 600;
}

.buy-act.is-done { background: var(--ok); }

.buy-act-ghost {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 40px;
    margin-top: 8px;
    border: 1px solid var(--line-2);
    border-radius: var(--r-sm);
    background: var(--surface);
    color: var(--text-2);
    font-size: 14px;
    transition: all .18s ease;
}

.buy-act-ghost:hover { border-color: var(--brand); color: var(--brand); }

.buy-toast {
    position: fixed;
    top: 18px;
    left: 50%;
    z-index: 1001;
    transform: translate(-50%, -8px);
    padding: 8px 16px;
    border-radius: var(--r-full);
    background: rgba(31, 35, 41, .94);
    color: #fff;
    font-size: 12.5px;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: all .22s ease;
}

.buy-toast.on { opacity: 1; transform: translate(-50%, 0); }

@media screen and (max-width: 400px) {
    .buy-modal-inner { padding: 18px 16px; }
    .buy-code { font-size: 21px; letter-spacing: 1px; }
    .buy-code-txt { font-size: 12.5px; letter-spacing: .3px; }
    .buy-code-item { padding: 5px 7px; gap: 6px; }
    .qty-btn { width: 28px; height: 28px; flex-basis: 28px; font-size: 16px; }
    .product-card .qty-input { width: 42px; height: 28px; font-size: 13.5px; }
    .qty-row { gap: 6px; }
    .product-total { font-size: 12px; margin-bottom: 10px; }
}
