/* ==========================================
   白可云☁️公益主机平台 - 主样式表
   版本: 1.0
   版权: 白可云☁️工作室 © 2026
   ========================================== */

/* CSS 变量 */
:root {
    --primary: #4f46e5;
    --primary-dark: #3730a3;
    --primary-light: #818cf8;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --info: #3b82f6;
    --dark: #1e293b;
    --gray: #64748b;
    --gray-light: #94a3b8;
    --gray-lighter: #e2e8f0;
    --gray-lightest: #f1f5f9;
    --white: #ffffff;
    --bg: #f8fafc;
    --radius: 8px;
    --radius-sm: 4px;
    --shadow: 0 1px 3px rgba(0,0,0,.1);
    --shadow-lg: 0 4px 12px rgba(0,0,0,.1);
    --transition: .2s ease;
}

/* 重置 */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; scroll-behavior: smooth; }
body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans SC", sans-serif;
    color: var(--dark); background: var(--bg); line-height: 1.6;
    min-height: 100vh; display: flex; flex-direction: column;
}
a { color: var(--primary); text-decoration: none; transition: var(--transition); }
a:hover { color: var(--primary-dark); }
img { max-width: 100%; }

/* 容器 */
.container { max-width: 1200px; margin: 0 auto; padding: 0 20px; }

/* Header */
.header { background: var(--white); border-bottom: 1px solid var(--gray-lighter); position: sticky; top: 0; z-index: 100; }
.header-inner { display: flex; align-items: center; height: 60px; }
.logo { font-size: 1.2rem; font-weight: 700; color: var(--primary); white-space: nowrap; flex-shrink: 0; margin-right: 8px; }
.logo:hover { color: var(--primary-dark); }
.nav { display: flex; gap: 2px; overflow-x: auto; overflow-y: hidden; -webkit-overflow-scrolling: touch; scrollbar-width: none; flex: 1; justify-content: flex-start; min-width: 0; }
/* 用 margin:auto 实现居中（不用 justify-content:center，避免 flex 滚动时左侧内容被裁剪无法滚到） */
.nav::before, .nav::after { content: ''; flex-shrink: 0; margin: auto; }
.nav::-webkit-scrollbar { height: 0; display: none; }
.nav a {
    padding: 7px 13px; border-radius: var(--radius); color: var(--gray); font-size: .9rem; font-weight: 500;
    transition: var(--transition); white-space: nowrap; flex-shrink: 0;
}
.nav a:hover, .nav a.active { background: var(--gray-lightest); color: var(--primary); }
.nav-user { display: flex; align-items: center; gap: 2px; flex-shrink: 0; margin-left: auto; }
.nav-user a {
    padding: 7px 10px; border-radius: var(--radius); color: var(--gray); font-size: .85rem; font-weight: 500;
    transition: var(--transition); white-space: nowrap;
}
.nav-user a:hover, .nav-user a.active { background: var(--gray-lightest); color: var(--primary); }
.nav-user a.nav-logout:hover { color: #ef4444; background: #fef2f2; }
.nav-user .sep { width: 1px; height: 16px; background: var(--gray-lighter); margin: 0 6px; flex-shrink: 0; }

/* Main */
.main { flex: 1; }

/* Hero - 紧凑无空白 */
.hero {
    background: linear-gradient(135deg, var(--primary) 0%, #4338ca 100%);
    color: var(--white); text-align: center;
    position: relative; overflow: hidden;
}
.hero-inner {
    max-width: 1200px; margin: 0 auto; padding: 24px 20px; position: relative;
}
.hero h1 { font-size: 1.2rem; margin-bottom: 4px; font-weight: 800; }
.hero p { font-size: .82rem; opacity: .8; margin-bottom: 12px; max-width: 400px; margin-left: auto; margin-right: auto; }
.hero-actions { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }
.hero-actions .btn { padding: 5px 14px; font-size: .78rem; }

/* 紧凑区块 */
.feature-slim { padding: 16px 0; }
.section-title-slim { font-size: 1rem; text-align: center; margin-bottom: 12px; color: var(--dark); font-weight: 700; }
.section-title-row { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; }
.section { padding: 16px 0; }

/* Buttons */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 6px;
    padding: 10px 24px; border-radius: var(--radius); font-size: .9rem; font-weight: 600;
    border: 2px solid transparent; cursor: pointer; transition: var(--transition);
    text-decoration: none; line-height: 1.4;
}
.btn-primary { background: var(--primary); color: var(--white); }
.btn-primary:hover { background: var(--primary-dark); color: var(--white); }
.btn-success { background: var(--success); color: var(--white); }
.btn-success:hover { background: #059669; color: var(--white); }
.btn-danger { background: var(--danger); color: var(--white); }
.btn-danger:hover { background: #dc2626; color: var(--white); }
.btn-warning { background: var(--warning); color: var(--white); }
.btn-warning:hover { background: #d97706; color: var(--white); }
.btn-info { background: var(--info); color: var(--white); }
.btn-outline { background: transparent; border-color: var(--primary); color: var(--primary); }
.btn-outline:hover { background: var(--primary); color: var(--white); }
.btn-block { display: flex; width: 100%; }
.btn-sm { padding: 6px 12px; font-size: .8rem; }
.btn-disabled { background: var(--gray-lighter); color: var(--gray-light); cursor: not-allowed; }

/* Alerts */
.alert {
    padding: 12px 20px; border-radius: var(--radius); margin-bottom: 20px;
    font-size: .9rem; line-height: 1.5;
}
.alert-success { background: #d1fae5; color: #065f46; border: 1px solid #a7f3d0; }
.alert-error { background: #fee2e2; color: #991b1b; border: 1px solid #fecaca; }
.alert-warning { background: #fef3c7; color: #92400e; border: 1px solid #fde68a; }
.alert-info { background: #dbeafe; color: #1e40af; border: 1px solid #bfdbfe; }

/* Forms */
.form-group { margin-bottom: 16px; }
.form-group label { display: block; font-size: .9rem; font-weight: 600; margin-bottom: 6px; color: var(--dark); }
.form-group input, .form-group select, .form-group textarea {
    width: 100%; padding: 10px 14px; border: 1px solid var(--gray-lighter); border-radius: var(--radius);
    font-size: .9rem; transition: var(--transition); background: var(--white);
}
.form-group input:focus, .form-group select:focus, .form-group textarea:focus {
    outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(79,70,229,.15);
}
.form-row { display: flex; gap: 16px; }
.form-row .form-group { flex: 1; }
.form-inline { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }

/* Cards */
.card { background: var(--white); border-radius: var(--radius); box-shadow: var(--shadow); margin-bottom: 24px; }
.card-header {
    display: flex; justify-content: space-between; align-items: center;
    padding: 16px 24px; border-bottom: 1px solid var(--gray-lightest);
}
.card-header h2 { font-size: 1.1rem; }
.card-body { padding: 20px 24px; }

/* Product Grid - 商品卡片升级 */
.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}
.product-card {
    background: #ffffff;
    border-radius: 14px;
    box-shadow: 0 1px 3px rgba(0,0,0,.06), 0 1px 2px rgba(0,0,0,.04);
    overflow: hidden;
    transition: all .3s ease;
    display: flex;
    flex-direction: column;
    border: 1px solid #edf2f7;
    position: relative;
}
.product-card:hover {
    box-shadow: 0 10px 30px rgba(0,0,0,.08), 0 4px 10px rgba(79,70,229,.05);
    transform: translateY(-3px);
    border-color: #dde4f0;
}
.product-card-header {
    padding: 20px 20px 0;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 8px;
}
.product-card-header h3 {
    font-size: 1.05rem;
    font-weight: 700;
    color: #0f172a;
    line-height: 1.3;
    flex: 1;
}
.product-card-body {
    padding: 10px 20px;
    flex: 1;
    display: flex;
    flex-direction: column;
}
.product-category {
    font-size: .78rem;
    color: #64748b;
    margin-bottom: 6px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}
.product-price {
    margin: 6px 0 8px;
    display: flex;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 2px;
}
.product-price .price-start {
    font-size: 1.5rem;
    font-weight: 800;
    color: #4f46e5;
    letter-spacing: -0.5px;
}
.product-price .price-unit {
    font-size: .82rem;
    color: #94a3b8;
    font-weight: 500;
    margin-left: 2px;
}
.product-price .price-suffix {
    font-size: .82rem;
    color: #4f46e5;
    font-weight: 600;
    margin-left: 2px;
}
.product-price .price-max-text {
    font-size: .72rem;
    color: #b5c0d0;
    margin-left: 6px;
}
.product-desc {
    font-size: .82rem;
    color: #64748b;
    line-height: 1.6;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.product-card-footer {
    padding: 14px 20px 20px;
    border-top: 1px solid #f1f5f9;
    margin-top: auto;
}
.btn-detail {
    background: linear-gradient(135deg, #4f46e5, #6366f1);
    color: #ffffff;
    border: none;
    width: 100%;
    border-radius: 10px;
    padding: 11px 20px;
    font-size: .88rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    cursor: pointer;
    transition: all .25s ease;
    text-decoration: none;
    box-shadow: 0 2px 8px rgba(79,70,229,.2);
}
.btn-detail:hover {
    background: linear-gradient(135deg, #4338ca, #4f46e5);
    box-shadow: 0 4px 14px rgba(79,70,229,.3);
    transform: translateY(-1px);
    color: #ffffff;
}
.btn-detail:active {
    transform: translateY(0);
}

/* Badges */
.badge {
    display: inline-block; padding: 2px 10px; border-radius: 20px; font-size: .75rem; font-weight: 600;
    background: var(--gray-lightest); color: var(--gray);
}
.badge-success { background: #d1fae5; color: #065f46; }
.badge-warning { background: #fef3c7; color: #92400e; }
.badge-danger { background: #fee2e2; color: #991b1b; }
.badge-info { background: #dbeafe; color: #1e40af; }
.badge-primary { background: #e0e7ff; color: var(--primary); }
.badge-vip { background: #fef3c7; color: #92400e; }
.badge-special { background: #ede9fe; color: #6d28d9; }
.badge-free { background: #d1fae5; color: #065f46; }
.badge-normal { background: var(--gray-lightest); color: var(--gray); }

/* Tables */
.table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.table th {
    background: var(--gray-lightest); text-align: left; padding: 10px 12px;
    font-weight: 600; font-size: .8rem; color: var(--gray); white-space: nowrap;
}
.table td { padding: 10px 12px; border-bottom: 1px solid var(--gray-lightest); }
.table tr:hover td { background: var(--gray-lightest); }
.table-compact th, .table-compact td { padding: 6px 8px; }
.action-cell { white-space: nowrap; }
.action-cell form { display: inline; }

/* Stats Grid */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 16px; margin-bottom: 24px; }
.stats-grid.mini { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
.stat-card {
    background: var(--white); border-radius: var(--radius); padding: 20px; text-align: center;
    box-shadow: var(--shadow);
}
.stat-value { font-size: 1.8rem; font-weight: 700; color: var(--dark); }
.stat-label { font-size: .85rem; color: var(--gray); margin-top: 4px; }
.stat-primary .stat-value { color: var(--primary); }
.stat-success .stat-value { color: var(--success); }
.stat-warning .stat-value { color: var(--warning); }
.stat-danger .stat-value { color: var(--danger); }
.stat-info .stat-value { color: var(--info); }

/* Pagination */
.pagination { display: flex; justify-content: center; gap: 4px; margin-top: 20px; }
.page-link {
    display: inline-flex; align-items: center; justify-content: center;
    min-width: 36px; height: 36px; padding: 0 8px;
    border-radius: var(--radius); font-size: .9rem; color: var(--dark);
    background: var(--white); border: 1px solid var(--gray-lighter); transition: var(--transition);
}
.page-link:hover { border-color: var(--primary); color: var(--primary); }
.page-link.active { background: var(--primary); border-color: var(--primary); color: var(--white); }

/* Auth Pages */
.auth-page { display: flex; align-items: center; justify-content: center; min-height: 100vh; background: var(--bg); }
.auth-container { width: 100%; max-width: 420px; padding: 20px; }
.auth-box { background: var(--white); border-radius: 12px; box-shadow: var(--shadow-lg); padding: 40px; }
.auth-header { text-align: center; margin-bottom: 32px; }
.auth-header h1 { font-size: 1.3rem; color: var(--primary); }
.auth-header p { color: var(--gray); margin-top: 4px; }
.auth-form .btn { margin-top: 8px; }
.auth-footer { text-align: center; margin-top: 24px; }
.auth-footer p { font-size: .85rem; color: var(--gray); margin-bottom: 4px; }
.link { color: var(--primary); font-weight: 600; }
.link:hover { text-decoration: underline; }

/* User Info */
.user-info-card {
    background: var(--white); border-radius: var(--radius); box-shadow: var(--shadow);
    padding: 24px; margin-bottom: 24px; display: flex; justify-content: space-between; align-items: center;
    flex-wrap: wrap; gap: 16px;
}
.user-info-main { display: flex; align-items: center; gap: 16px; }
.user-avatar {
    width: 56px; height: 56px; border-radius: 50%; background: var(--primary);
    color: var(--white); display: flex; align-items: center; justify-content: center;
    font-size: 1.4rem; font-weight: 700;
}
.user-detail h2 { font-size: 1.2rem; }
.user-email { color: var(--gray); font-size: .85rem; }
.user-member { font-size: .85rem; margin-top: 4px; }
.member-expire { color: var(--gray-light); font-size: .8rem; margin-left: 8px; }
.user-points-section { text-align: right; }
.points-display { margin-bottom: 12px; }
.points-value { font-size: 2rem; font-weight: 700; color: var(--primary); }
.points-label { color: var(--gray); font-size: .85rem; margin-left: 4px; }
.points-actions { display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; }

/* Quick Actions */
.quick-actions { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; margin-bottom: 24px; }
.quick-action-card {
    display: flex; flex-direction: column; align-items: center; gap: 8px;
    padding: 24px 16px; background: var(--white); border-radius: var(--radius);
    box-shadow: var(--shadow); transition: var(--transition); text-decoration: none; color: var(--dark);
}
.quick-action-card:hover { box-shadow: var(--shadow-lg); transform: translateY(-2px); color: var(--primary); }
.qa-icon { 
    width: 48px; height: 48px; border-radius: 12px;
    display: flex; align-items: center; justify-content: center;
    background: var(--gray-lightest);
}
.qa-icon svg { width: 24px; height: 24px; }
.qa-icon-cart { background: #dbeafe; }
.qa-icon-order { background: #d1fae5; }
.qa-icon-ticket { background: #fef3c7; }
.qa-icon-recharge { background: #e0e7ff; }
.qa-icon-vip { background: #ede9fe; }
.qa-text { font-size: .85rem; font-weight: 600; }

/* Category Tabs */
.category-tabs { display: flex; gap: 4px; margin-bottom: 24px; flex-wrap: wrap; }
.tab {
    padding: 8px 20px; border-radius: 20px; font-size: .85rem; font-weight: 500;
    background: var(--white); color: var(--gray); border: 1px solid var(--gray-lighter);
    cursor: pointer; transition: var(--transition);
}
.tab:hover, .tab.active { background: var(--primary); color: var(--white); border-color: var(--primary); }

/* Filter tabs */
.filter-tabs { display: flex; gap: 4px; margin-bottom: 20px; flex-wrap: wrap; }
.filter-tab {
    padding: 6px 14px; border-radius: var(--radius-sm); font-size: .8rem;
    background: var(--gray-lightest); color: var(--gray); cursor: pointer; transition: var(--transition);
}
.filter-tab:hover, .filter-tab.active { background: var(--primary); color: var(--white); }

/* Product Detail - 全新设计 */
.product-detail {
    display: grid;
    grid-template-columns: 1fr 380px;
    gap: 28px;
    align-items: start;
}

/* 商品顶部信息区 */
.product-head {
    margin-bottom: 24px;
    padding-bottom: 20px;
    border-bottom: 1px solid #e4e9f2;
}
.product-head-main {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
}
.product-head-left h1 {
    font-size: 1.4rem;
    font-weight: 800;
    color: #0f172a;
    margin: 0 0 8px;
    line-height: 1.3;
}
.product-head-badges {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    align-items: center;
}
.product-head-badges .badge {
    padding: 3px 12px;
    border-radius: 20px;
    font-size: .75rem;
    font-weight: 600;
    background: #f1f5f9;
    color: #475569;
}
.product-head-badges .badge-primary {
    background: #eef2ff;
    color: #4f46e5;
}
.product-head-badges .badge-free {
    background: #d1fae5;
    color: #065f46;
}
.product-sales {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: .82rem;
    color: #94a3b8;
}
.product-sales svg {
    color: #94a3b8;
    flex-shrink: 0;
}

/* 返回链接 */
.back-link {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: .82rem;
    color: #64748b;
    margin-bottom: 20px;
    transition: color .2s;
}
.back-link:hover { color: #4f46e5; }
.back-link svg { flex-shrink: 0; }

/* 产品介绍卡片 - 新 */
.product-intro-card {
    background: linear-gradient(135deg, #f8faff 0%, #f0f4ff 100%);
    border: 1px solid #e4e9f2;
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 24px;
    box-shadow: 0 1px 2px rgba(0,0,0,.03);
}
.product-intro-card .intro-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 18px 24px 0;
}
.product-intro-card .intro-header h3 {
    font-size: .95rem;
    font-weight: 700;
    color: #1e293b;
    margin: 0;
}
.product-intro-card .intro-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border-radius: 8px;
    background: linear-gradient(135deg, #eef2ff, #e0e7ff);
    color: #4f46e5;
    flex-shrink: 0;
}
.product-intro-card .intro-body {
    padding: 14px 24px 20px;
    font-size: .9rem;
    color: #334155;
    line-height: 1.85;
    position: relative;
    padding-left: 54px;
}
.product-intro-card .intro-body::before {
    content: '';
    position: absolute;
    left: 24px;
    top: 14px;
    bottom: 20px;
    width: 3px;
    background: linear-gradient(180deg, #6366f1, #a78bfa);
    border-radius: 3px;
}

/* 注意事项卡片 - 新 */
.product-notice-card {
    background: linear-gradient(135deg, #fef2f2 0%, #fff5f5 100%);
    border: 1px solid #fecaca;
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 24px;
    box-shadow: 0 1px 2px rgba(0,0,0,.03);
}
.product-notice-card .notice-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 16px 24px 0;
}
.product-notice-card .notice-header h3 {
    font-size: .9rem;
    font-weight: 700;
    color: #991b1b;
    margin: 0;
}
.product-notice-card .notice-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border-radius: 8px;
    background: linear-gradient(135deg, #fee2e2, #fecaca);
    color: #dc2626;
    flex-shrink: 0;
}
.product-notice-card .notice-body {
    padding: 12px 24px 18px;
    font-size: .85rem;
    color: #b91c1c;
    line-height: 1.8;
    position: relative;
    padding-left: 54px;
}
.product-notice-card .notice-body::before {
    content: '';
    position: absolute;
    left: 24px;
    top: 12px;
    bottom: 18px;
    width: 3px;
    background: linear-gradient(180deg, #ef4444, #f87171);
    border-radius: 3px;
}

/* 主机配置参数区域 */
.product-specs-wrap {
    margin-bottom: 24px;
}
.product-specs-wrap .specs-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: .95rem;
    font-weight: 700;
    color: #1e293b;
    margin: 0 0 14px;
}
.product-specs-wrap .specs-title svg {
    color: #6366f1;
    flex-shrink: 0;
}
.specs-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 10px;
}
.spec-item {
    background: #ffffff;
    border: 1px solid #e4e9f2;
    border-radius: 10px;
    padding: 16px 12px;
    text-align: center;
    transition: box-shadow .2s, transform .2s;
    cursor: default;
}
.spec-item:hover {
    box-shadow: 0 4px 14px rgba(0,0,0,.06);
    transform: translateY(-2px);
    border-color: #c7d2fe;
}
.spec-icon-wrap {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: 10px;
    margin-bottom: 8px;
}
.spec-label {
    display: block;
    font-size: .72rem;
    color: #94a3b8;
    margin-bottom: 3px;
    font-weight: 500;
}
.spec-value {
    display: block;
    font-size: .9rem;
    font-weight: 700;
    color: #0f172a;
}

/* 购买侧边栏 */
.purchase-box {
    background: #ffffff;
    border-radius: 14px;
    box-shadow: 0 4px 20px rgba(0,0,0,.08);
    padding: 28px 24px;
    position: sticky;
    top: 84px;
    border: 1px solid #e4e9f2;
}
.price-display {
    text-align: center;
    margin-bottom: 20px;
    padding-bottom: 20px;
    border-bottom: 1px solid #f1f5f9;
}
.price {
    font-size: 2.6rem;
    font-weight: 800;
    color: #4f46e5;
    line-height: 1.1;
    letter-spacing: -1px;
}
.price-unit-text {
    display: inline-block;
    font-size: .8rem;
    font-weight: 600;
    color: #64748b;
    margin-left: 4px;
}
.price-tag {
    display: inline-block;
    font-size: .72rem;
    font-weight: 600;
    color: #4f46e5;
    background: #eef2ff;
    border: 1px solid #c7d2fe;
    border-radius: 4px;
    padding: 1px 8px;
    margin-left: 4px;
    vertical-align: middle;
}
.price-free {
    font-size: 2.2rem;
    font-weight: 800;
    color: #10b981;
}
.discount-badge {
    display: inline-block;
    background: #ef4444;
    color: #ffffff;
    padding: 2px 10px;
    border-radius: 4px;
    font-size: .72rem;
    font-weight: 700;
    margin-left: 6px;
    vertical-align: middle;
}
.user-points {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #f8fafc;
    border-radius: 8px;
    padding: 10px 14px;
    font-size: .85rem;
    color: #475569;
    margin-bottom: 8px;
}
.user-points strong {
    color: #4f46e5;
    font-size: 1rem;
}
.member-discount {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #fffbeb;
    border-radius: 8px;
    padding: 10px 14px;
    font-size: .85rem;
    color: #92400e;
    margin-bottom: 16px;
}
.member-discount strong {
    color: #d97706;
    font-size: .9rem;
}

/* 时长选择 - 横排卡片 */
.duration-selector { margin: 16px 0; }
.ds-label {
    font-size: .85rem;
    font-weight: 600;
    color: #475569;
    margin-bottom: 10px;
}
.duration-grid {
    display: flex;
    gap: 8px;
}
.dur-card {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 12px 6px;
    border: 2px solid var(--gray-lighter);
    border-radius: var(--radius);
    cursor: pointer;
    background: var(--white);
    transition: var(--transition);
    min-height: 60px;
    justify-content: center;
}
.dur-card:hover {
    border-color: var(--primary-light);
}
.dur-card.active {
    border-color: var(--primary);
    background: #eef2ff;
}
.dur-card input { display: none; }
.dur-label {
    font-size: .85rem;
    font-weight: 700;
    color: var(--dark);
}
.dur-card.active .dur-label {
    color: var(--primary);
}
.dur-price {
    font-size: .72rem;
    font-weight: 600;
    color: var(--primary);
    padding: 1px 8px;
    background: #eef2ff;
    border-radius: 20px;
}
.dur-card.active .dur-price {
    background: var(--primary);
    color: var(--white);
}
.buy-action { margin-top: 18px; }

/* 购买按钮 */
.buy-actions { margin-top: 18px; }
.buy-actions .btn { padding: 12px 24px; font-size: .95rem; border-radius: 10px; }
.btn-buy {
    background: linear-gradient(135deg, #4f46e5, #6366f1);
    color: #ffffff;
    border: none;
    width: 100%;
    font-weight: 700;
    box-shadow: 0 4px 12px rgba(79,70,229,.3);
    transition: all .25s;
}
.btn-buy:hover {
    background: linear-gradient(135deg, #4338ca, #4f46e5);
    box-shadow: 0 6px 20px rgba(79,70,229,.4);
    transform: translateY(-1px);
    color: #fff;
}
.btn-buy:disabled {
    background: #d1d5db;
    box-shadow: none;
    cursor: not-allowed;
    transform: none;
}
.insufficient-msg {
    text-align: center;
    font-size: .82rem;
    color: #ef4444;
    margin-bottom: 10px;
}
.insufficient-msg a {
    color: #4f46e5;
    font-weight: 600;
}
.insufficient-msg a:hover { text-decoration: underline; }

/* 登录提示 */
.login-prompt {
    text-align: center;
    padding: 6px 0;
}

@media (max-width: 768px) {
    .product-detail { grid-template-columns: 1fr; gap: 20px; }
    .purchase-box { position: static; }
    .specs-grid { grid-template-columns: repeat(2, 1fr); gap: 8px; }
    .spec-item { padding: 12px 8px; }
    .spec-icon-wrap { width: 32px; height: 32px; }
    .spec-icon-wrap svg { width: 16px; height: 16px; }
    .spec-value { font-size: .82rem; }
    .product-head-left h1 { font-size: 1.15rem; }
    .price { font-size: 2rem; }
    .product-intro-card .intro-body { padding-left: 20px; }
    .product-intro-card .intro-body::before { display: none; }
    .product-notice-card .notice-body { padding-left: 20px; }
    .product-notice-card .notice-body::before { display: none; }
    .dur-card { padding: 10px 4px; min-height: 52px; }
    .dur-label { font-size: .8rem; }
    .dur-price { font-size: .68rem; padding: 1px 6px; }
}

@media (max-width: 480px) {
    .purchase-box { padding: 20px 16px; }
    .dur-card { padding: 8px 4px; min-height: 48px; }
    .specs-grid { grid-template-columns: repeat(2, 1fr); }
    .product-detail { gap: 16px; }
}

/* Orders */
.order-list { display: flex; flex-direction: column; gap: 16px; }
.order-card { background: var(--white); border-radius: var(--radius); box-shadow: var(--shadow); }
.order-card-header {
    display: flex; justify-content: space-between; align-items: center;
    padding: 12px 20px; border-bottom: 1px solid var(--gray-lightest);
}
.order-no { font-weight: 600; font-size: .85rem; }
.order-card-body { padding: 16px 20px; }
.order-info p { font-size: .85rem; color: var(--gray); margin-bottom: 4px; }
.order-card-footer { padding: 12px 20px; border-top: 1px solid var(--gray-lightest); display: flex; justify-content: space-between; align-items: center; }
.order-time { font-size: .8rem; color: var(--gray-light); }

/* Tickets */
.ticket-content { padding: 16px; background: var(--gray-lightest); border-radius: var(--radius); margin-bottom: 16px; }
.ticket-reply { padding: 12px 16px; margin-bottom: 12px; border-left: 3px solid var(--gray-lighter); }
.ticket-reply.admin-reply { border-left-color: var(--primary); background: #f8f9ff; }
.reply-header { display: flex; justify-content: space-between; margin-bottom: 8px; }
.reply-content { font-size: .9rem; line-height: 1.6; }
.reply-form { margin-top: 20px; }

/* Recharge */
.recharge-box { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }

/* Member */
.member-status-card {
    background: var(--white); border-radius: var(--radius); box-shadow: var(--shadow);
    padding: 32px; text-align: center; margin-bottom: 32px;
}
.member-level { margin-bottom: 16px; }
.member-icon { width: 60px; height: 60px; border-radius: 50%; display: flex; align-items: center; justify-content: center; margin: 0 auto 8px; font-weight: 700; font-size: 1.2rem; }
.member-icon-0 { background: var(--gray-lightest); color: var(--gray); }
.member-icon-1 { background: #fef3c7; color: #92400e; }
.member-icon-2 { background: #ede9fe; color: #6d28d9; }
.member-type-text { font-size: 1.3rem; font-weight: 700; }
.member-info p { color: var(--gray); margin-bottom: 4px; }
.member-plans { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 24px; }
.plan-card { background: var(--white); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.plan-card.featured { border: 2px solid var(--primary); position: relative; }
.plan-header { padding: 24px; text-align: center; border-bottom: 1px solid var(--gray-lightest); }
.plan-header h3 { font-size: 1.1rem; margin-bottom: 8px; }
.plan-price strong { font-size: 2rem; color: var(--primary); }
.plan-duration { color: var(--gray); font-size: .85rem; }
.plan-subtitle { color: var(--gray); }
.plan-body { padding: 24px; }
.plan-features { list-style: none; }
.plan-features li { padding: 8px 0; font-size: .9rem; color: var(--dark); border-bottom: 1px solid var(--gray-lightest); }
.plan-features li:last-child { border-bottom: none; }
.plan-footer { padding: 16px 24px 24px; }

/* Admin Layout */
.admin-body { display: flex; }
.admin-layout { display: flex; min-height: 100vh; }
.admin-sidebar {
    width: 220px; background: var(--dark); color: var(--white); position: fixed;
    top: 0; left: 0; bottom: 0; height: 100vh; height: 100dvh; /* vh兜底 + dvh动态视口：确保侧边栏撑满可视区到底部 */
    overflow-y: auto; overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    z-index: 200;
}
.sidebar-header { padding: 20px; border-bottom: 1px solid rgba(255,255,255,.1); }
.sidebar-header h2 { font-size: 1rem; font-weight: 700; }
.sidebar-nav { padding: 12px 0 8px; }
.sidebar-nav a {
    display: block; padding: 10px 20px; color: rgba(255,255,255,.7); font-size: .85rem;
    transition: var(--transition);
}
.sidebar-nav a:hover { background: rgba(255,255,255,.1); color: var(--white); }
.sidebar-nav a.active { background: var(--primary); color: var(--white); }
.sidebar-nav hr { border: none; border-top: 1px solid rgba(255,255,255,.1); margin: 8px 16px; }
/* 手机端：菜单超出可视区时底部渐变提示可继续下滑 */
.scroll-hint { display: none; }
.admin-main { margin-left: 220px; flex: 1; }
.admin-topbar {
    background: var(--white); padding: 16px 24px; border-bottom: 1px solid var(--gray-lighter);
    display: flex; justify-content: space-between; align-items: center;
}
.admin-topbar h1 { font-size: 1.2rem; }
.admin-user { font-size: .85rem; color: var(--gray); }
.admin-content { padding: 24px; }

/* Two column */
.two-col { display: grid; grid-template-columns: 1fr 2fr; gap: 24px; align-items: start; }

/* Search form */
.search-form { display: flex; gap: 8px; align-items: center; }
.search-form input, .search-form select { padding: 6px 12px; border: 1px solid var(--gray-lighter); border-radius: var(--radius-sm); font-size: .85rem; }

/* Text utilities */
.text-muted { color: var(--gray-light); font-size: .85rem; }
.text-success { color: var(--success); }
.text-danger { color: var(--danger); }
.text-warning { color: var(--warning); }
.text-info { color: var(--info); }
.text-center { text-align: center; }

/* Empty state */
.empty-state { text-align: center; padding: 40px 20px; color: var(--gray-light); }
.empty-state p { margin-bottom: 16px; }

/* Inline form */
.inline-form { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }

/* Footer */
.footer { background: var(--dark); color: var(--white); padding: 24px 0; margin-top: auto; }
.footer-inner { display: flex; flex-direction: column; align-items: center; gap: 12px; }
.footer-links { display: flex; gap: 16px; flex-wrap: wrap; justify-content: center; }
.footer-links a { color: rgba(255,255,255,.6); font-size: .85rem; }
.footer-links a:hover { color: var(--white); }
.copyright { font-size: .8rem; color: rgba(255,255,255,.4); text-align: center; }

/* Page header */
.page-header { padding-top: 24px; margin-bottom: 24px; }
.page-header h1 { font-size: 1.5rem; margin-bottom: 4px; }
.page-header p { color: var(--gray); }

/* Page content (protocols) */
.page-content { max-width: 800px; margin: 0 auto; background: var(--white); border-radius: var(--radius); box-shadow: var(--shadow); padding: 40px; line-height: 1.8; }
.page-content h1 { font-size: 1.5rem; margin-bottom: 8px; }
.page-content h2 { font-size: 1.1rem; margin: 24px 0 12px; }
.page-content hr { margin: 16px 0; border: none; border-top: 1px solid var(--gray-lighter); }
.page-content p { margin-bottom: 12px; color: var(--gray); }

/* Feature grid */
.feature-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 20px; }
.feature-card {
    background: var(--white); border-radius: var(--radius); padding: 32px 24px;
    text-align: center; box-shadow: var(--shadow); transition: var(--transition);
}
.feature-card:hover { box-shadow: var(--shadow-lg); transform: translateY(-2px); }
.feature-icon {
    width: 56px; height: 56px; margin: 0 auto 12px;
    border-radius: 50%; display: flex; align-items: center; justify-content: center;
    font-size: 0; position: relative;
}
.feature-icon-fast { background: #dbeafe; }
.feature-icon-fast::after { content: '>'; color: #3b82f6; font-size: 1.8rem; font-weight: 700; }
.feature-icon-safe { background: #d1fae5; }
.feature-icon-safe::after { content: '!'; color: #10b981; font-size: 2rem; font-weight: 700; }
.feature-icon-points { background: #fef3c7; }
.feature-icon-points::after { content: '$'; color: #f59e0b; font-size: 1.8rem; font-weight: 700; }
.feature-icon-ticket { background: #e0e7ff; }
.feature-icon-ticket::after { content: '?'; color: #4f46e5; font-size: 1.8rem; font-weight: 700; }
.feature-card h3 { font-size: 1.05rem; margin-bottom: 8px; }
.feature-card p { color: var(--gray); font-size: .9rem; }

/* Announcement */
.announcement-list { display: flex; flex-direction: column; gap: 16px; }
.announcement-item { background: var(--white); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); }
.announcement-item h3 { font-size: 1.05rem; margin-bottom: 8px; }
.announcement-content { color: var(--gray); font-size: .9rem; margin-bottom: 8px; }
.announcement-date { font-size: .8rem; color: var(--gray-light); }
.announcement-more { display: inline-flex; align-items: center; gap: 4px; font-size: .85rem; color: var(--primary); font-weight: 500; text-decoration: none; white-space: nowrap; }
.announcement-more:hover { opacity: .8; }
.announcement-more svg { transition: transform .15s; }
.announcement-more:hover svg { transform: translateX(3px); }
.badge-region { background: #fef3c7; color: #b45309; display: inline-flex; align-items: center; }

/* Responsive */
@media (max-width: 768px) {
    .product-detail { grid-template-columns: 1fr; }
    .two-col { grid-template-columns: 1fr; }
    .recharge-box { grid-template-columns: 1fr; }
    .stats-grid { grid-template-columns: repeat(2, 1fr); }
    .admin-sidebar { width: 200px; }
    .admin-main { margin-left: 200px; }
    .form-row { flex-direction: column; gap: 0; }
    .inline-form { flex-direction: column; align-items: stretch; }
    .user-info-card { flex-direction: column; text-align: center; }
    .user-points-section { text-align: center; }
    .points-actions { justify-content: center; }
    .user-info-main { flex-direction: column; }
    /* 移动端顶部紧凑 */
    .header-inner { height: 48px; }
    .page-header { padding-top: 12px; margin-bottom: 12px; }
    .page-header h1 { font-size: 1.15rem; }
    .page-header p { font-size: .82rem; }
    /* 用户页面顶部的标题头在手机上冗余（卡片已显示用户名） */
    .page-header-user { display: none; }
}

@media (max-width: 480px) {
    /* --- 移动端导航：logo 紧凑 + 主导航可滑动 + 用户区精简 --- */
    .header-inner { height: 48px; }
    .logo { font-size: .9rem; max-width: 22vw; overflow: hidden; text-overflow: ellipsis; }
    .nav { gap: 2px; overflow-x: auto; overflow-y: hidden; -webkit-overflow-scrolling: touch; touch-action: pan-x; flex-shrink: 0; max-width: 40vw; }
    .nav::-webkit-scrollbar { height: 0; display: none; }
    .nav a { font-size: .78rem; padding: 6px 8px; white-space: nowrap; }
    .nav-user { gap: 0; }
    .nav-user a { font-size: .74rem; padding: 6px 5px; }
    .nav-user .sep { display: none; }
    .hide-mobile { display: none !important; }
    .theme-toggle { width: 28px; height: 28px; margin-left: 2px; }
    .theme-toggle svg { width: 15px; height: 15px; }
    .product-grid { grid-template-columns: 1fr; }
    .stats-grid { grid-template-columns: repeat(2, 1fr); gap: 8px; }
    .stat-card { padding: 12px 8px; }
    .stat-value { font-size: 1.3rem; }
    .stat-label { font-size: .75rem; }
    .admin-sidebar { width: 180px; }
    .admin-main { margin-left: 180px; }
    /* 用户中心卡片紧凑 */
    .user-info-card { padding: 12px 16px; gap: 8px; }
    .user-info-main { flex-direction: row; gap: 10px; width: 100%; }
    .user-avatar { width: 40px; height: 40px; font-size: 1rem; flex-shrink: 0; }
    .user-detail { text-align: left; flex: 1; min-width: 0; }
    .user-detail h2 { font-size: .95rem; }
    .user-email { font-size: .75rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
    .user-member { font-size: .75rem; }
    .member-expire { display: block; margin-left: 0; }
    /* 积分靠右对齐 */
    .user-points-section { text-align: right; flex-shrink: 0; }
    .points-display { margin-bottom: 0; }
    .points-value { font-size: 1.3rem; }
    .points-label { font-size: .75rem; }
    /* 按钮水平滚动条 */
    .points-actions { justify-content: flex-start; width: 100%; gap: 6px; flex-wrap: nowrap; overflow-x: auto; -webkit-overflow-scrolling: touch; padding-bottom: 4px; }
    .points-actions::-webkit-scrollbar { height: 2px; }
    .points-actions::-webkit-scrollbar-thumb { background: var(--gray-lighter); border-radius: 2px; }
    .points-actions .btn-sm { font-size: .72rem; padding: 5px 10px; white-space: nowrap; }
    /* 快捷操作紧凑 */
    .quick-actions { grid-template-columns: repeat(3, 1fr); gap: 8px; }
    .quick-action-card { padding: 14px 8px; }
    .qa-icon { width: 36px; height: 36px; }
    .qa-icon svg { width: 18px; height: 18px; }
    .qa-text { font-size: .75rem; }
    /* 内容区紧凑 */
    .container { padding: 0 12px; }
}
/* 超小屏额外优化 */
@media (max-width: 380px) {
    .nav a { font-size: .7rem; padding: 4px 6px; }
    .quick-actions { grid-template-columns: repeat(2, 1fr); }
    .stats-grid { grid-template-columns: repeat(2, 1fr); }
}

/* ====== 全局移动端优化 ====== */

/* 1. 所有页面标题统一紧凑 */
@media (max-width: 768px) {
    .page-header { padding-top: 16px; margin-bottom: 16px; }
    .page-header h1 { font-size: 1.2rem; margin-bottom: 2px; }
    .page-header p { font-size: .82rem; }
}

@media (max-width: 640px) {
    .hide-small { display: none !important; }
}

/* 2. 表格在手机上可左右滑动 */
@media (max-width: 640px) {
    .table-wrap {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        margin: 0 -12px;
        padding: 0 12px;
    }
    .table-wrap .table { min-width: 500px; }
    table.table:not(.table-wrap table) {
        display: block;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        white-space: nowrap;
    }
    /* 积分流水等紧凑表格 */
    .table th, .table td { padding: 8px 10px; font-size: .82rem; }
}

/* 3. 卡片在手机上内边距缩小 */
@media (max-width: 640px) {
    .card-body { padding: 16px; }
    .card-header { padding: 12px 16px; }
    .card-header h2 { font-size: 1rem; }
}

/* 4. 分类标签紧凑 */
@media (max-width: 480px) {
    .category-tabs { gap: 6px; margin-bottom: 16px; }
    .tab { padding: 6px 14px; font-size: .78rem; }
    .filter-tabs { gap: 6px; margin-bottom: 14px; }
    .filter-tab { padding: 5px 10px; font-size: .75rem; }
}

/* 5. 商品中心 - 卡片响应式 */
@media (max-width: 640px) {
    .product-grid { gap: 12px; }
    .product-card-header { padding: 16px 16px 0; }
    .product-card-header h3 { font-size: .95rem; }
    .product-card-body { padding: 8px 16px; }
    .product-card-footer { padding: 12px 16px 16px; }
    .product-price .price-start { font-size: 1.2rem; }
    .product-category { font-size: .75rem; margin-bottom: 4px; }
    .product-desc { font-size: .78rem; }
    .btn-detail { padding: 10px 16px; font-size: .82rem; }
}

/* 6. 页脚链接紧凑 */
@media (max-width: 480px) {
    .footer-links { gap: 8px; }
    .footer-links a { font-size: .75rem; }
    .footer { padding: 16px 0; }
}

/* 7. 卡片和区块间隔 */
@media (max-width: 640px) {
    .card { margin-bottom: 16px; }
    .section { padding: 12px 0; }
    .stats-grid { margin-bottom: 16px; }
    .quick-actions { margin-bottom: 16px; }
}

/* 8. 商品中心筛选和内容间距 - 已合并到Product Detail响应式 */

/* 9. 工单页面 */
@media (max-width: 640px) {
    .ticket-content { padding: 12px; font-size: .88rem; }
    .ticket-reply { padding: 10px 12px; }
    .reply-form textarea { font-size: .88rem; }
}

/* 10. 卡密充值页面 */
@media (max-width: 640px) {
    .recharge-box { gap: 16px; }
    .recharge-box .card-body input[name="card_no"] { font-size: 1rem !important; padding: 10px !important; }
}

/* 11. 会员页面 */
@media (max-width: 640px) {
    .member-status-card { padding: 24px 16px; }
    .member-icon { width: 48px; height: 48px; font-size: 1rem; }
    .member-type-text { font-size: 1.1rem; }
    .plan-header { padding: 16px; }
    .plan-body { padding: 16px; }
    .plan-footer { padding: 12px 16px 16px; }
}

/* 12. 空状态 */
@media (max-width: 480px) {
    .empty-state { padding: 24px 16px; font-size: .88rem; }
}

/* 13. 弹窗/提示 */
@media (max-width: 480px) {
    .alert { padding: 10px 14px; font-size: .85rem; margin-bottom: 12px; }
}

/* 14. 分页 */
@media (max-width: 480px) {
    .pagination { gap: 2px; }
    .page-link { min-width: 32px; height: 32px; font-size: .82rem; }
}

/* 15. 分类介绍区 - 简洁白框+分割线 */
.cat-glass-box {
    background: #ffffff;
    border: 1px solid #e4e9f2;
    border-radius: 12px;
    padding: 22px 24px;
    margin-bottom: 28px;
    box-shadow: 0 1px 3px rgba(0,0,0,.04);
}

.cat-glass-desc .cat-desc-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}
.cat-glass-desc .cat-desc-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    background: #eef2ff;
    border-radius: 6px;
    color: #4f46e5;
    flex-shrink: 0;
}
.cat-glass-desc .cat-desc-title {
    font-size: .95rem;
    font-weight: 700;
    color: #1e293b;
}
.cat-glass-desc .cat-desc-body {
    font-size: .88rem;
    color: #475569;
    line-height: 1.75;
    padding-left: 36px;
}

.cat-glass-divider {
    height: 1px;
    margin: 12px 0;
    background: #e4e9f2;
}

.cat-glass-notice .cat-notice-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
}
.cat-glass-notice .cat-notice-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    background: #fee2e2;
    border-radius: 6px;
    color: #dc2626;
    flex-shrink: 0;
}
.cat-glass-notice .cat-notice-title {
    font-size: .88rem;
    font-weight: 700;
    color: #991b1b;
}
.cat-glass-notice .cat-notice-title .highlight {
    color: #dc2626;
}
.cat-glass-notice .cat-notice-body {
    font-size: .85rem;
    color: #92400e;
    line-height: 1.7;
    padding-left: 36px;
}
.cat-glass-notice .cat-notice-body a {
    color: #dc2626;
    font-weight: 600;
    text-decoration: underline;
}
.cat-glass-notice .cat-notice-body a:hover {
    color: #991b1b;
}

@media (max-width: 640px) {
    .cat-glass-box { padding: 14px 16px; margin-bottom: 20px; }
    .cat-glass-desc .cat-desc-body { padding-left: 0; font-size: .83rem; }
    .cat-glass-notice .cat-notice-body { padding-left: 0; font-size: .8rem; }
    .cat-glass-desc .cat-desc-icon,
    .cat-glass-notice .cat-notice-icon { width: 24px; height: 24px; }
    .cat-glass-desc .cat-desc-icon svg,
    .cat-glass-notice .cat-notice-icon svg { width: 14px; height: 14px; }
}

/* 消息未读红点（主导航 + 用户区均适用） */
.nav .nav-badge, .nav-user .nav-badge {
    display: inline-block; background: #ef4444; color: #fff;
    border-radius: 10px; font-size: .68rem; padding: 0 5px;
    line-height: 1.5; margin-left: 2px; vertical-align: top;
}

/* 紧急维护横幅（全站） */
.maintenance-banner {
    display: flex; align-items: center; justify-content: center; gap: 10px;
    background: linear-gradient(135deg, #fef3c7, #fde68a);
    border-bottom: 1px solid #f59e0b;
    padding: 10px 16px; font-size: .9rem; color: #92400e;
    text-align: center;
}
.maintenance-banner-icon {
    width: 30px; height: 30px; border-radius: 50%; flex-shrink: 0;
    background: #f59e0b; color: #fff; display: flex; align-items: center; justify-content: center;
}
@media (max-width: 640px) {
    .maintenance-banner { font-size: .8rem; padding: 8px 12px; }
}

/* ==========================================
   暗色模式
   ========================================== */
[data-theme="dark"] {
    --primary: #818cf8;
    --primary-dark: #a5b4fc;
    --primary-light: #6366f1;
    --success: #34d399;
    --warning: #fbbf24;
    --danger: #f87171;
    --info: #60a5fa;
    --dark: #f1f5f9;
    --gray: #94a3b8;
    --gray-light: #64748b;
    --gray-lighter: #334155;
    --gray-lightest: #1e293b;
    --white: #1e293b;
    --bg: #0f172a;
    --shadow: 0 1px 3px rgba(0,0,0,.4);
    --shadow-lg: 0 4px 12px rgba(0,0,0,.4);
}
[data-theme="dark"] body { background: var(--bg); color: var(--dark); }
[data-theme="dark"] .header,
[data-theme="dark"] .footer { background: #16213a; border-color: #26334d; }
[data-theme="dark"] .card,
[data-theme="dark"] .product-item,
[data-theme="dark"] .section-card,
[data-theme="dark"] .badge-cell,
[data-theme="dark"] .equipped-item { background: #1e293b; }
[data-theme="dark"] .product-item-bottom,
[data-theme="dark"] .product-item-top,
[data-theme="dark"] .card-header,
[data-theme="dark"] .section-card-header { background: #1e293b; }
[data-theme="dark"] .table th { color: var(--gray); }
[data-theme="dark"] input, [data-theme="dark"] select, [data-theme="dark"] textarea {
    background: #0f172a; color: var(--dark); border-color: #334155;
}
[data-theme="dark"] input::placeholder { color: #64748b; }
[data-theme="dark"] .credential-value { background: #0f172a; color: #e2e8f0; }
[data-theme="dark"] .filter-tab { background: #1e293b; border-color: #334155; }
[data-theme="dark"] .type-tab { background: #1e293b; border-color: #334155; }
[data-theme="dark"] .product-remark { background: #3b2f1a; border-color: #6b4f1a; color: #fbbf24; }
[data-theme="dark"] .promo-stat { background: #1e3a5f; border-color: #2d5a8a; }
[data-theme="dark"] .promo-stat-value { color: #93c5fd; }
[data-theme="dark"] .tutorial-chip { background: #1e293b; border-color: #334155; }
[data-theme="dark"] .task-item { border-color: #334155; }
[data-theme="dark"] .task-item.task-done { background: #14351f; border-color: #1f5c33; }
[data-theme="dark"] .pagination .page-link { background: #1e293b; color: var(--gray); border-color: #334155; }
[data-theme="dark"] .pagination .page-link.active { background: var(--primary); color: #fff; }
[data-theme="dark"] .empty-state { color: var(--gray); }
[data-theme="dark"] .text-muted { color: #94a3b8; }

/* 主题切换按钮 */
.theme-toggle {
    display: inline-flex; align-items: center; justify-content: center;
    width: 34px; height: 34px; border-radius: 8px; border: 1px solid var(--gray-lighter);
    background: var(--white); color: var(--gray); cursor: pointer; transition: var(--transition);
    margin-left: 4px; flex-shrink: 0;
}
.theme-toggle:hover { border-color: var(--primary); color: var(--primary); }
.theme-toggle svg { width: 18px; height: 18px; }
.theme-toggle .icon-sun { display: none; }
[data-theme="dark"] .theme-toggle .icon-sun { display: block; }
[data-theme="dark"] .theme-toggle .icon-moon { display: none; }

/* 密码/授权码小眼睛 */
.pwd-field { position: relative; }
.pwd-field input { padding-right: 44px; }
.pwd-eye { position: absolute; right: 4px; top: 50%; transform: translateY(-50%); background: none; border: none; color: var(--gray); cursor: pointer; padding: 6px; display: flex; border-radius: 6px; }
.pwd-eye:hover { color: var(--primary); background: var(--gray-lightest); }
.pwd-eye.showing { color: var(--primary); }

/* ===== 后台手机端：侧边栏抽屉化（放在文件末尾确保覆盖旧规则） ===== */
.admin-menu-btn {
    display: none; background: var(--white); border: 1px solid var(--gray-lighter); border-radius: 8px;
    color: var(--gray); font-size: .8rem; font-weight: 600; height: 34px; padding: 0 10px; cursor: pointer;
    align-items: center; gap: 5px; margin-right: 10px; flex-shrink: 0;
}
.admin-menu-btn:hover { color: var(--primary); border-color: var(--primary); }
.sidebar-close-btn { display: none; }
/* 侧边栏导航：图标 + 更舒适的点击区 */
.sidebar-nav a { display: flex; align-items: center; gap: 10px; padding: 11px 20px; line-height: 1.4; white-space: nowrap; }
.nav-ic { width: 17px; height: 17px; background: currentColor; flex-shrink: 0;
    -webkit-mask-size: contain; mask-size: contain; -webkit-mask-repeat: no-repeat; mask-repeat: no-repeat; -webkit-mask-position: center; mask-position: center; }
.sidebar-nav a.active { background: rgba(255,255,255,.92); color: var(--primary); font-weight: 600; }
.sidebar-nav a.active .nav-ic { background: var(--primary); }
.sidebar-nav a:hover { background: rgba(255,255,255,.1); }
@media (max-width: 768px) {
    .admin-sidebar { transform: translateX(-100%) !important; transition: transform .25s ease; width: 260px !important; box-shadow: 4px 0 16px rgba(0,0,0,.15); }
    .admin-sidebar.open { transform: none !important; }
    .admin-main { margin-left: 0 !important; }
    .admin-menu-btn { display: inline-flex !important; }
    /* 收回按钮：只有点击它才收起侧边栏（无遮罩，展开后内容区仍可操作、侧边栏可上下滑动） */
    .sidebar-close-btn { display: inline-flex; align-items: center; gap: 3px; padding: 5px 10px; border-radius: 8px; border: none; background: rgba(255,255,255,.15); color: #fff; font-size: .75rem; font-weight: 600; cursor: pointer; }
    .sidebar-close-btn:hover { background: rgba(255,255,255,.28); }
    .sidebar-header { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; }
    .sidebar-nav a { padding: 12px 18px; border-radius: 0; margin: 0; font-size: .83rem; }
    .sidebar-nav a.active { border-left: 3px solid var(--primary); background: rgba(255,255,255,.1); color: #fff; }
    .sidebar-nav a.active .nav-ic { background: var(--primary); }
    .sidebar-nav a:hover { background: rgba(255,255,255,.08); }
    .sidebar-nav { padding: 6px 0 8px; }
    .sidebar-nav hr { margin: 8px 16px; }
    .scroll-hint { display: block !important; position: sticky; bottom: 0; padding: 14px 10px 12px; text-align: center; font-size: .7rem; color: rgba(255,255,255,.6); background: linear-gradient(transparent, rgba(15,23,42,.95) 55%); pointer-events: none; }
    .admin-content { padding: 14px; }
    .admin-topbar { padding: 12px 14px; }
    .admin-topbar h1 { font-size: 1.05rem; }
    /* 后台表格：手机端包一层滚动（若页面已用 .table-wrap 则自动生效） */
    .admin-content .table { min-width: 520px; }
    .admin-content .card-body { overflow-x: auto; }
}
/* ==========================================
   用户端手机侧边栏（登录后 ☰ 抽屉）
   ========================================== */
.us-drawer-btn {
    display: inline-flex; align-items: center; justify-content: center;
    width: 34px; height: 34px; border-radius: 8px; border: 1px solid var(--gray-lighter);
    background: var(--white); color: var(--gray); cursor: pointer;
    transition: var(--transition); flex-shrink: 0; margin-left: 4px;
}
.us-drawer-btn:hover { border-color: var(--primary); color: var(--primary); }
.us-drawer-mask {
    position: fixed; inset: 0; background: rgba(15,23,42,.5); z-index: 300;
    opacity: 0; visibility: hidden; transition: opacity .25s ease, visibility .25s ease;
    -webkit-backdrop-filter: blur(1px); backdrop-filter: blur(1px);
}
.us-drawer-mask.open { opacity: 1; visibility: visible; }
.us-drawer {
    position: fixed; top: 0; left: 0; bottom: 0; height: 100vh; height: 100dvh;
    width: min(84vw, 300px); background: var(--white); color: var(--dark);
    z-index: 301; overflow-y: auto; -webkit-overflow-scrolling: touch;
    transform: translateX(-105%); transition: transform .28s ease;
    box-shadow: 4px 0 24px rgba(0,0,0,.12); display: flex; flex-direction: column;
}
.us-drawer.open { transform: none; }
.us-drawer-head {
    display: flex; align-items: center; justify-content: space-between; gap: 10px;
    padding: 16px; border-bottom: 1px solid var(--gray-lightest);
    background: linear-gradient(135deg, var(--primary), #7c3aed); color: #fff; flex-shrink: 0;
}
.us-drawer-user { display: flex; align-items: center; gap: 10px; min-width: 0; color: #fff; text-decoration: none; }
.us-drawer-user:hover { color: #fff; opacity: .92; }
.us-drawer-user img { width: 42px; height: 42px; border-radius: 50%; object-fit: cover; border: 2px solid rgba(255,255,255,.4); flex-shrink: 0; }
.us-avatar-text {
    width: 42px; height: 42px; border-radius: 50%; background: rgba(255,255,255,.2);
    display: inline-flex; align-items: center; justify-content: center;
    font-size: 1.15rem; font-weight: 700; flex-shrink: 0; border: 2px solid rgba(255,255,255,.4);
}
.us-drawer-uid { display: flex; flex-direction: column; min-width: 0; }
.us-drawer-uid b { font-size: .98rem; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.us-drawer-uid i { font-style: normal; font-size: .76rem; opacity: .85; }
.us-drawer-close {
    background: rgba(255,255,255,.16); border: none; color: #fff; width: 30px; height: 30px;
    border-radius: 8px; cursor: pointer; font-size: .9rem; line-height: 1; flex-shrink: 0;
}
.us-drawer-close:hover { background: rgba(255,255,255,.3); }
.us-drawer-nav { padding: 6px 0 16px; flex: 1; }
.us-drawer-group {
    padding: 14px 18px 5px; font-size: .72rem; font-weight: 700; color: var(--gray-light);
    letter-spacing: .5px;
}
.us-drawer-nav a {
    display: flex; align-items: center; gap: 11px;
    padding: 11px 18px; color: var(--gray); font-size: .9rem; text-decoration: none;
    transition: var(--transition); border-left: 3px solid transparent;
}
.us-drawer-nav a:hover { background: var(--gray-lightest); color: var(--primary); }
.us-drawer-nav a svg { width: 18px; height: 18px; flex-shrink: 0; }
.us-drawer-nav a span { flex: 1; min-width: 0; }
.us-badge {
    display: inline-block; min-width: 18px; height: 18px; line-height: 18px; border-radius: 9px;
    background: #ef4444; color: #fff; font-size: .66rem; text-align: center; padding: 0 5px;
    flex-shrink: 0; font-weight: 600;
}
.us-drawer-nav hr { border: none; border-top: 1px solid var(--gray-lightest); margin: 10px 16px; }
.us-drawer-nav a[href*="logout"] { color: #dc2626; }
.us-drawer-nav a[href*="logout"]:hover { background: #fef2f2; color: #dc2626; }
/* 深色模式 */
[data-theme="dark"] .us-drawer { background: #16213a; color: #f1f5f9; }
[data-theme="dark"] .us-drawer-nav a { color: #cbd5e1; }
[data-theme="dark"] .us-drawer-nav a:hover { background: #1e293b; color: #fff; }
[data-theme="dark"] .us-drawer-group { color: #64748b; }
[data-theme="dark"] .us-drawer-nav hr { border-top-color: #26334d; }
[data-theme="dark"] .us-drawer-btn { background: #16213a; border-color: #334155; color: #cbd5e1; }

/* ==========================================
   手机端顶部导航重排（≤768px）
   - logo 完整显示（不再压缩截断）
   - 主导航 .nav 收进抽屉「浏览网站」，顶部不再横向挤压
   - ☰ 按钮固定显示在右侧（主题切换旁），不遮挡标题
   ========================================== */
@media (max-width: 768px) {
    .header-inner { display: flex; align-items: center; justify-content: flex-start; height: 50px; gap: 8px; }
    /* logo 完整展示：不压缩、不截断 */
    .logo { flex-shrink: 0; font-size: 1rem; font-weight: 800; max-width: none; overflow: visible; text-overflow: clip; margin-right: 0; letter-spacing: .2px; }
    /* 主导航收进抽屉：顶部不占横向宽度（登录后由 ☰ 提供全部入口） */
    .nav { display: none !important; }
    /* 用户区：登录后仅保留 ☰ + 主题（文本入口全在抽屉内） */
    .nav-user { margin-left: auto; flex-shrink: 0; }
    .nav-user a { font-size: .82rem; padding: 6px 6px; }
    .us-drawer-btn { width: 36px; height: 36px; margin-left: 2px; }
    .theme-toggle { width: 36px; height: 36px; }
}

/* 抽屉分组开关（可折叠） */
.us-drawer-sec { border-bottom: 1px solid var(--gray-lightest); }
.us-drawer-sec-btn {
    display: flex; align-items: center; justify-content: space-between; width: 100%;
    padding: 13px 18px; background: transparent; border: none; cursor: pointer;
    font-size: .88rem; font-weight: 700; color: var(--primary); letter-spacing: .3px;
    text-align: left;
}
.us-drawer-sec-btn:hover { background: var(--gray-lightest); }
.us-caret {
    width: 8px; height: 8px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor;
    transform: rotate(45deg); transition: transform .2s; display: inline-block; margin-top: -3px;
    opacity: .7;
}
.us-drawer-sec-btn.open .us-caret { transform: rotate(-135deg); margin-top: 5px; }
[data-theme="dark"] .us-drawer-sec { border-bottom-color: #26334d; }
[data-theme="dark"] .us-drawer-sec-btn:hover { background: #1e293b; }

/* ☰ 仅手机端显示：桌面端有完整导航与页面布局，无需抽屉 */
@media (min-width: 769px) {
    .us-drawer-btn { display: none !important; }
}

/* 手机端（≤768px）：登录态文本入口并入抽屉，隐藏顶部文字链 */
@media (max-width: 768px) {
    .header .nav-user a.hide-mobile, .header .nav-user .sep.hide-mobile { display: none !important; }
}

/* 抽屉分组：默认收起；有未读时"工单与消息"自动展开并显示数字 */
.us-drawer-sec-btn .us-dot-num {
    display: inline-flex; align-items: center; justify-content: center;
    min-width: 18px; height: 18px; padding: 0 5px; margin-left: 6px;
    border-radius: 9px; background: #ef4444; color: #fff; font-size: .68rem; font-weight: 700;
    vertical-align: 1px;
}
.us-drawer-sec-btn span { display: flex; align-items: center; min-width: 0; }

/* 抽屉固定快捷入口（首页/商品/用户中心/订单，不折叠始终可见） */
.us-quick {
    display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px;
    padding: 14px 14px 10px; border-bottom: 1px solid var(--gray-lightest); flex-shrink: 0;
}
.us-quick-item {
    display: flex; flex-direction: column; align-items: center; gap: 6px;
    padding: 10px 4px; border-radius: 12px; background: var(--gray-lightest);
    color: var(--dark); font-size: .74rem; font-weight: 600; text-decoration: none;
    transition: var(--transition);
}
.us-quick-item:hover { background: #e0e7ff; color: var(--primary); }
.us-quick-item svg { width: 21px; height: 21px; color: var(--primary); }
[data-theme="dark"] .us-quick { border-bottom-color: #26334d; }
[data-theme="dark"] .us-quick-item { background: #1e293b; color: #e2e8f0; }

/* ==========================================
   协议/合规类页面手机端升级（pages/*.php）
   - 页脚协议链接窄屏自动换行、间距合适、可点区域大
   - 正文卡片窄屏字号/行距/内边距优化
   - 协议页顶部"返回首页"面包屑
   ========================================== */
@media (max-width: 768px) {
    .page-content { padding: 22px 18px; line-height: 1.85; }
    .page-content h1 { font-size: 1.3rem; }
    .page-content h2 { font-size: 1.05rem; margin: 22px 0 10px; }
    .page-content p { font-size: .9rem; }
    /* 协议页返回面包屑 */
    .proto-back {
        display: inline-flex; align-items: center; gap: 4px;
        font-size: .82rem; color: var(--gray); margin: 12px 2px 4px;
        text-decoration: none;
    }
    .proto-back:hover { color: var(--primary); }
    /* 合规中心顶部导航 */
    .compliance-nav { gap: 8px; }
    .compliance-nav a { padding: 7px 12px; font-size: .78rem; }
    /* 页脚：窄屏改为两列网格，整齐、可点区域大 */
    .footer-links { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px 12px; max-width: 460px; margin: 0 auto; width: 100%; }
    .footer-links a { font-size: .8rem; padding: 6px 4px; line-height: 1.5; text-align: center; color: rgba(255,255,255,.72); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
    .footer-links a:active { color: #fff; }
}
