/* ===== 全局变量与重置 ===== */
:root {
    --primary: #c9a24e;
    --primary-dark: #a6833a;
    --primary-light: #2a2520;
    --accent: #d4a854;
    --accent-dark: #b8943a;
    --bg: #0d0d0d;
    --bg-card: #1a1a1a;
    --text: #e5d5b7;
    --text-secondary: #a89870;
    --text-muted: #5a4e3a;
    --border: #2a2520;
    --border-light: #1f1c18;
    --success: #10b981;
    --danger: #ef4444;
    --danger-light: #1a1010;
    --warning: #f59e0b;
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.4);
    --shadow: 0 2px 4px rgba(0,0,0,0.5);
    --shadow-md: 0 4px 8px rgba(0,0,0,0.5);
    --shadow-lg: 0 8px 16px rgba(0,0,0,0.6);
    --radius-sm: 8px;
    --radius: 12px;
    --radius-lg: 16px;
    --radius-xl: 20px;
    --nav-height: 64px;
}

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

html, body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", Roboto, Helvetica, Arial, sans-serif;
    background: var(--bg);
    color: var(--text);
    font-size: 16px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body { padding-bottom: var(--nav-height); }

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

/* ===== SVG 图标通用 ===== */
.svg-icon {
    width: 24px; height: 24px;
    display: inline-block; vertical-align: middle;
    flex-shrink: 0;
}
.svg-icon-sm { width: 18px; height: 18px; }
.svg-icon-lg { width: 32px; height: 32px; }
.svg-icon-xl { width: 48px; height: 48px; }

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

/* ===== 头部 ===== */
.page-header {
    padding: 8px 0 16px;
    display: flex; align-items: center; justify-content: space-between;
    gap: 12px;
}
.page-header h1 {
    font-size: 20px; font-weight: 700; color: var(--text);
    white-space: nowrap; flex-shrink: 0;
}
.page-header .header-sub {
    font-size: 14px; color: var(--text-secondary); font-weight: 400;
}

/* ===== 头部搜索 ===== */
.header-search {
    display: flex; align-items: center;
    background: var(--bg-card);
    border-radius: 24px;
    border: 1px solid var(--border);
    padding: 0 4px 0 14px;
    max-width: 220px;
    flex: 1;
    transition: border-color 0.2s;
}
.header-search:focus-within {
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(201,162,78,0.15);
}
.header-search .search-icon {
    flex-shrink: 0; color: var(--text-muted);
    margin-right: 4px;
}
.header-search:focus-within .search-icon { color: var(--primary); }
.header-search input {
    flex: 1; min-width: 0; padding: 9px 4px;
    background: transparent; border: none; outline: none;
    font-size: 14px; color: var(--text);
}
.header-search input::placeholder { color: var(--text-muted); }
.header-search .search-tip {
    display: none; font-size: 12px; color: var(--primary);
    white-space: nowrap; padding-right: 12px;
}

/* ===== 卡片 ===== */
.card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: 20px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border);
    margin-bottom: 16px;
}
.card-header {
    display: flex; align-items: center; justify-content: space-between;
    margin-bottom: 16px; padding-bottom: 12px;
    border-bottom: 1px solid var(--border-light);
}
.card-header h3 {
    font-size: 17px; font-weight: 600; color: var(--text);
    display: flex; align-items: center; gap: 8px;
}
.card-header h3 .svg-icon { color: var(--primary); }

/* ===== 按钮 ===== */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 6px;
    padding: 10px 20px; border-radius: var(--radius);
    font-size: 15px; font-weight: 600; cursor: pointer;
    border: 1px solid transparent;
    transition: all 0.15s ease;
    text-decoration: none; color: var(--text);
    background: var(--bg-card);
}
.btn:active { transform: scale(0.97); }
.btn-primary {
    background: var(--primary); color: #fff; border-color: var(--primary);
    box-shadow: 0 2px 8px rgba(37,99,235,0.25);
}
.btn-primary:hover { background: var(--primary-dark); }
.btn-accent {
    background: var(--accent); color: #fff; border-color: var(--accent);
    box-shadow: 0 2px 8px rgba(245,158,11,0.25);
}
.btn-danger { background: var(--danger); color: #fff; }
.btn-success { background: var(--success); color: #fff; }
.btn-outline {
    background: transparent; border: 1.5px solid var(--border); color: var(--text-secondary);
}
.btn-outline:hover { border-color: var(--primary); color: var(--primary); }
.btn-sm { padding: 6px 14px; font-size: 13px; border-radius: var(--radius-sm); }
.btn-lg { padding: 14px 28px; font-size: 17px; border-radius: var(--radius-xl); }
.btn-block { width: 100%; }
.btn-icon {
    width: 40px; height: 40px; padding: 0; border-radius: 50%;
    display: inline-flex; align-items: center; justify-content: center;
}

/* ===== 输入框 ===== */
.input-group { margin-bottom: 16px; }
.input-group label {
    display: block; font-size: 14px; font-weight: 600;
    color: var(--text-secondary); margin-bottom: 6px;
}
.input-wrap {
    display: flex; align-items: center;
    background: var(--bg);
    border-radius: var(--radius);
    border: 1.5px solid var(--border);
    transition: border-color 0.2s, box-shadow 0.2s;
    overflow: hidden;
}
.input-wrap:focus-within {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(201,162,78,0.15);
    background: #1e1e1e;
}
.input-wrap .input-icon {
    padding: 0 10px 0 14px; flex-shrink: 0;
    color: var(--text-muted);
}
.input-wrap:focus-within .input-icon { color: var(--primary); }
.input-wrap input, .input-wrap textarea, .input-wrap select {
    flex: 1; padding: 14px 16px 14px 0;
    background: transparent; border: none; outline: none;
    font-size: 15px; color: var(--text); min-width: 0;
}
.input-wrap input::placeholder { color: var(--text-muted); }
.input-wrap textarea { resize: vertical; min-height: 80px; padding-right: 16px; }
select.form-select {
    width: 100%; padding: 14px 16px;
    background: var(--bg); border: 1.5px solid var(--border);
    border-radius: var(--radius); font-size: 15px; color: var(--text);
    outline: none; cursor: pointer; appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' fill='none' stroke='%2394a3b8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
    background-repeat: no-repeat; background-position: right 12px center;
}
select.form-select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(201,162,78,0.15);
}

/* ===== 底部导航 ===== */
.bottom-nav {
    position: fixed; bottom: 0; left: 0; width: 100%;
    background: var(--bg-card); border-top: 1px solid var(--border);
    display: flex; align-items: center; justify-content: space-around;
    z-index: 999; padding: 4px 0 env(safe-area-inset-bottom);
}
.bottom-nav .nav-item {
    display: flex; flex-direction: column; align-items: center; gap: 2px;
    padding: 6px 0; font-size: 11px; color: var(--text-muted);
    text-decoration: none; font-weight: 500;
    border: none; background: none; cursor: pointer;
    flex: 1; min-width: 0;
}
.bottom-nav .nav-item .nav-icon {
    width: 24px; height: 24px;
}
.bottom-nav .nav-item.active { color: var(--primary); }
.bottom-nav .nav-item.active .nav-icon { color: var(--primary); }
.bottom-nav .nav-vip {
    flex: 0 0 auto; margin-top: -18px; padding: 0 8px;
}
.bottom-nav .nav-vip a {
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    width: 52px; height: 52px; border-radius: 50%;
    background: linear-gradient(135deg, var(--accent), #d97706);
    color: #fff; text-decoration: none; font-size: 10px; font-weight: 600;
    box-shadow: 0 4px 16px rgba(245,158,11,0.4);
    transition: transform 0.15s;
}
.bottom-nav .nav-vip a:active { transform: scale(0.92); }
.bottom-nav .nav-vip .nav-icon { color: #fff; }

/* ===== 轮播图 ===== */
.carousel-section {
    margin-bottom: 20px;
    position: relative;
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border);
    aspect-ratio: 16 / 9;
    background: var(--bg-card);
}

.carousel-track {
    display: flex;
    transition: transform 0.5s ease-in-out;
    height: 100%;
}

.carousel-slide {
    min-width: 100%;
    position: relative;
    flex-shrink: 0;
}

.carousel-slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.carousel-slide a {
    display: block;
    width: 100%;
    height: 100%;
}

.carousel-caption {
    position: absolute;
    bottom: 0; left: 0; right: 0;
    padding: 24px 16px 16px;
    background: linear-gradient(transparent, rgba(0,0,0,0.75));
    color: #fff;
}

.carousel-caption h3 {
    font-size: 17px;
    font-weight: 700;
    line-height: 1.3;
    text-shadow: 0 1px 4px rgba(0,0,0,0.6);
}

.carousel-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0,0,0,0.45);
    color: #fff;
    border: none;
    width: 36px; height: 36px;
    border-radius: 50%;
    font-size: 18px;
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    z-index: 2;
    transition: background 0.2s;
}

.carousel-btn:hover { background: rgba(0,0,0,0.7); }
.carousel-prev { left: 10px; }
.carousel-next { right: 10px; }

.carousel-dots {
    position: absolute;
    bottom: 10px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 8px;
    z-index: 2;
}

.carousel-dot {
    width: 8px; height: 8px;
    border-radius: 50%;
    background: rgba(255,255,255,0.4);
    border: none;
    cursor: pointer;
    padding: 0;
    transition: background 0.2s, transform 0.2s;
}

.carousel-dot.active {
    background: var(--primary);
    transform: scale(1.25);
}

.carousel-empty {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: var(--text-muted);
    font-size: 14px;
}

.carousel-empty .svg-icon { opacity: 0.4; margin-right: 8px; }

/* ===== 视频网格 ===== */
.video-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}
.video-card {
    background: var(--bg-card);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border);
    text-decoration: none; color: var(--text);
    transition: transform 0.15s, box-shadow 0.15s;
    position: relative;
}
.video-card:active { transform: scale(0.97); }
.video-card .card-thumb {
    position: relative; width: 100%; aspect-ratio: 16/9;
    background: var(--bg); overflow: hidden;
}
.video-card .card-thumb img {
    width: 100%; height: 100%; object-fit: cover; display: block;
}
.video-card h3 {
    padding: 10px 12px 12px; font-size: 14px; font-weight: 500;
    text-align: center; margin: 0;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
    color: var(--text); line-height: 1.3;
}
.video-badge {
    position: absolute; top: 8px; right: 8px;
    padding: 2px 10px; border-radius: 20px;
    font-size: 11px; font-weight: 700; z-index: 2;
    box-shadow: 0 2px 6px rgba(0,0,0,0.15);
}
.badge-free { background: var(--success); color: #fff; }
.badge-vip { background: linear-gradient(135deg, var(--accent), #d97706); color: #fff; }

/* ===== 搜索框 ===== */
.search-card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: 16px;
    margin-bottom: 16px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border);
}
.search-inner {
    display: flex; align-items: center;
    background: var(--bg);
    border-radius: 60px;
    border: 1.5px solid var(--border);
    transition: all 0.3s;
    overflow: hidden;
}
.search-inner:focus-within {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(201,162,78,0.15);
    background: #1e1e1e;
}
.search-inner .search-icon {
    flex-shrink: 0; padding: 0 6px 0 16px;
    color: var(--text-muted);
}
.search-inner:focus-within .search-icon { color: var(--primary); }
.search-inner input {
    flex: 1; min-width: 0; padding: 12px 4px;
    background: transparent; border: none; outline: none;
    font-size: 15px; color: var(--text);
}
.search-inner input::placeholder { color: var(--text-muted); }
.search-inner button {
    flex-shrink: 0; padding: 8px 18px; margin: 4px 4px 4px 0;
    background: var(--primary); color: #fff; border: none;
    border-radius: 40px; font-weight: 600; font-size: 14px;
    cursor: pointer; transition: transform 0.15s;
}
.search-inner button:active:not(:disabled) { transform: scale(0.95); }
.search-inner button:disabled { opacity: 0.6; cursor: not-allowed; }
.search-tip { font-size: 13px; color: var(--primary); margin-top: 8px; padding-left: 4px; display: none; }
.search-status {
    display: flex; justify-content: space-between; align-items: center;
    padding: 10px 4px 16px; font-size: 14px; color: var(--text-secondary);
    border-bottom: 1px solid var(--border); margin-bottom: 16px;
}
.search-status strong { color: var(--text); }
.clear-search {
    color: var(--primary); text-decoration: none; font-weight: 600;
    padding: 4px 12px; border-radius: 20px; background: var(--primary-light);
    font-size: 13px;
}

/* ===== 空状态 ===== */
.empty-state {
    grid-column: 1 / -1; text-align: center; padding: 40px 0;
    color: var(--text-muted); font-size: 15px;
}
.empty-state .empty-icon {
    display: block; margin: 0 auto 12px; color: var(--text-muted);
    opacity: 0.5;
}

/* ===== 认证页面 ===== */
.auth-page {
    min-height: 100vh; display: flex; align-items: center; justify-content: center;
    padding: 20px;
    background: linear-gradient(135deg, #0d0d0d 0%, #141414 50%, #0d0d0d 100%);
}
.auth-card {
    background: var(--bg-card); border-radius: var(--radius-xl);
    padding: 40px 32px 32px; width: 100%; max-width: 420px;
    box-shadow: var(--shadow-lg); border: 1px solid var(--border);
}
.auth-card .auth-header { text-align: center; margin-bottom: 28px; }
.auth-card .auth-header .auth-icon {
    display: inline-flex; width: 56px; height: 56px;
    background: var(--primary); border-radius: var(--radius);
    align-items: center; justify-content: center;
    color: #fff; margin-bottom: 12px;
    box-shadow: 0 4px 16px rgba(37,99,235,0.3);
}
.auth-card h2 {
    font-size: 24px; font-weight: 700; color: var(--text); margin: 0 0 4px;
}
.auth-card .subtitle { color: var(--text-secondary); font-size: 15px; }
.auth-card .btn-primary { width: 100%; padding: 14px; font-size: 17px; border-radius: var(--radius); margin-top: 8px; }
.auth-links { text-align: center; margin-top: 20px; font-size: 15px; color: var(--text-secondary); }
.auth-links a { color: var(--primary); font-weight: 600; }

/* ===== 消息提示 ===== */
.msg-box {
    padding: 14px 18px; border-radius: var(--radius);
    margin-bottom: 16px; font-size: 14px;
    display: flex; align-items: center; gap: 10px;
}
.msg-box.error { background: var(--danger-light); color: var(--danger); border: 1px solid #3b1010; }
.msg-box.success { background: #152a15; color: #34d399; border: 1px solid #064e3b; }
.msg-box.warning { background: #2a251a; color: #f59e0b; border: 1px solid #78350f; }
.msg-box.info { background: var(--primary-light); color: #8a6e2e; border: 1px solid #3d3520; }
.msg-box .msg-icon { flex-shrink: 0; }

/* ===== 弹窗 / 模态框 ===== */
.modal-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.5); z-index: 1000;
    display: flex; align-items: center; justify-content: center;
    padding: 20px;
    animation: fadeIn 0.2s ease;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.modal {
    background: var(--bg-card); border-radius: var(--radius-xl);
    padding: 32px 24px 24px; width: 100%; max-width: 400px;
    box-shadow: var(--shadow-lg); text-align: center;
    animation: slideUp 0.25s ease;
}
@keyframes slideUp { from { transform: translateY(20px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
.modal .modal-icon {
    width: 56px; height: 56px; margin: 0 auto 16px;
    color: var(--warning);
}
.modal h3 { font-size: 20px; font-weight: 700; margin-bottom: 8px; color: var(--text); }
.modal p { color: var(--text-secondary); font-size: 14px; margin-bottom: 20px; line-height: 1.6; }
.modal .modal-actions {
    display: flex; flex-direction: column; gap: 10px;
}

/* ===== 个人中心 ===== */
.my-container { max-width: 520px; margin: 0 auto; padding: 0 16px 20px; position: relative; z-index: 1; }
.my-header-bg {
    position: fixed; top: 0; left: 0; width: 100%; height: 160px;
    background: linear-gradient(135deg, var(--primary), #a6833a);
    border-radius: 0 0 32px 32px; z-index: 0;
}
.profile-card {
    background: var(--bg-card); border-radius: var(--radius-xl);
    padding: 24px; display: flex; align-items: center; gap: 16px;
    box-shadow: var(--shadow-md); border: 1px solid var(--border);
    margin-top: 20px; position: relative; z-index: 1;
}
.avatar-wrapper { position: relative; flex-shrink: 0; }
.avatar-circle {
    width: 64px; height: 64px; border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), #a6833a);
    color: #fff; display: flex; align-items: center; justify-content: center;
    font-size: 28px; font-weight: 700;
    box-shadow: 0 4px 12px rgba(37,99,235,0.3);
}
.status-dot {
    position: absolute; bottom: 2px; right: 2px;
    width: 14px; height: 14px; border-radius: 50%;
    border: 3px solid #1a1a1a;
}
.status-dot.active { background: var(--success); }
.status-dot.inactive { background: var(--text-muted); }
.user-details { flex: 1; }
.username-text { font-size: 20px; font-weight: 700; color: var(--text); }
.user-meta-text { font-size: 13px; color: var(--text-secondary); margin-top: 2px; }

.status-banner {
    display: flex; align-items: center; gap: 14px;
    background: var(--bg-card); border-radius: var(--radius-lg);
    padding: 16px 20px; margin: 16px 0;
    border: 1px solid var(--border); box-shadow: var(--shadow-sm);
    position: relative; z-index: 1;
}
.status-banner .banner-icon { flex-shrink: 0; }
.status-banner .banner-content { flex: 1; }
.status-banner .banner-title { font-weight: 600; font-size: 16px; color: var(--text); }
.status-banner .banner-desc { font-size: 13px; color: var(--text-secondary); margin-top: 2px; line-height: 1.5; }
.status-banner.success { border-left: 4px solid var(--success); }
.status-banner.warning { border-left: 4px solid var(--warning); }
.status-banner code {
    background: var(--bg); padding: 2px 8px; border-radius: 6px;
    font-size: 13px; color: var(--primary); border: 1px solid var(--border);
}

.card-form {
    background: var(--bg-card); border-radius: var(--radius-lg);
    padding: 20px; border: 1px solid var(--border);
    box-shadow: var(--shadow-sm); margin-bottom: 16px;
    position: relative; z-index: 1;
}
.menu-list {
    background: var(--bg-card); border-radius: var(--radius-lg);
    border: 1px solid var(--border); box-shadow: var(--shadow-sm);
    overflow: hidden; position: relative; z-index: 1;
    margin-bottom: 16px;
}
.menu-item {
    display: flex; align-items: center; padding: 16px 20px;
    border-bottom: 1px solid var(--border-light);
    text-decoration: none; color: var(--text);
    transition: background 0.1s;
}
.menu-item:last-child { border-bottom: none; }
.menu-item:active { background: var(--bg); }
.menu-item .menu-icon { margin-right: 14px; color: var(--text-secondary); flex-shrink: 0; }
.menu-item .menu-label { flex: 1; font-size: 15px; font-weight: 500; }
.menu-item .menu-label.accent { color: var(--accent); }
.menu-item .menu-label.danger { color: var(--danger); }
.menu-item .menu-arrow { color: var(--text-muted); flex-shrink: 0; }

/* ===== 推荐网格 ===== */
.recommend-section {
    margin-top: 24px; padding-top: 20px;
    border-top: 1px solid var(--border);
}
.recommend-section .section-title {
    font-size: 17px; font-weight: 700; color: var(--text);
    margin-bottom: 12px; display: flex; align-items: center; gap: 8px;
}
.recommend-grid {
    display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 10px;
}
.recommend-item {
    background: var(--bg-card); border-radius: var(--radius);
    overflow: hidden; border: 1px solid var(--border);
    text-decoration: none; color: var(--text);
    transition: transform 0.15s;
}
.recommend-item:active { transform: scale(0.96); }
.recommend-item .rec-thumb {
    position: relative; width: 100%; aspect-ratio: 16/9;
    background: var(--bg); overflow: hidden;
}
.recommend-item .rec-thumb img {
    width: 100%; height: 100%; object-fit: cover; display: block;
}
.recommend-item .rec-title {
    padding: 8px 10px; font-size: 12px; font-weight: 500;
    text-align: center; line-height: 1.3;
    display: -webkit-box; -webkit-line-clamp: 2;
    -webkit-box-orient: vertical; overflow: hidden; height: 38px;
}
.rec-badge {
    position: absolute; top: 4px; right: 4px;
    padding: 1px 8px; border-radius: 20px;
    font-size: 10px; font-weight: 700; z-index: 2;
}
.rec-badge.free { background: var(--success); color: #fff; }
.rec-badge.vip { background: linear-gradient(135deg, var(--accent), #d97706); color: #fff; }

/* ===== 视频播放器 ===== */
.video-wrapper {
    background: #000; border-radius: var(--radius);
    overflow: hidden; margin: 8px 0;
    border: 1px solid var(--border);
}
video { width: 100%; display: block; max-height: 60vh; background: #000; }
.back-link {
    display: inline-flex; align-items: center; gap: 6px;
    color: var(--text-secondary); text-decoration: none;
    font-size: 14px; margin: 8px 0; transition: color 0.2s;
}
.back-link:hover { color: var(--primary); }

/* ===== 客服聊天 ===== */
.chat-page { padding-bottom: 0; }
.chat-contact-list {
    background: var(--bg-card); border-radius: var(--radius-lg);
    overflow: hidden; box-shadow: var(--shadow-sm);
    border: 1px solid var(--border);
}
.chat-contact-item {
    display: flex; align-items: center; padding: 14px 16px; gap: 12px;
    border-bottom: 1px solid var(--border-light);
    text-decoration: none; color: var(--text);
    transition: background 0.1s; cursor: pointer;
}
.chat-contact-item:last-child { border-bottom: none; }
.chat-contact-item:active { background: var(--bg); }
.chat-contact-item.pinned { background: var(--primary-light); }
.chat-contact-item .contact-avatar {
    width: 48px; height: 48px; border-radius: 50%;
    background: var(--primary-light); color: var(--primary);
    display: flex; align-items: center; justify-content: center;
    font-size: 20px; font-weight: 700; flex-shrink: 0;
    overflow: hidden;
}
.chat-contact-item .contact-avatar img {
    width: 100%; height: 100%; object-fit: cover;
}
.chat-contact-item .contact-info { flex: 1; min-width: 0; }
.chat-contact-item .contact-name {
    font-size: 16px; font-weight: 600; color: var(--text);
}
.chat-contact-item .contact-preview {
    font-size: 13px; color: var(--text-muted);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
    margin-top: 2px;
}
.chat-contact-item .contact-badge {
    padding: 2px 8px; border-radius: 20px;
    font-size: 11px; font-weight: 600;
    background: var(--primary-light); color: var(--primary);
}

/* 聊天对话 */
.chat-conversation {
    display: flex; flex-direction: column; height: calc(100vh - var(--nav-height));
}
.chat-header-bar {
    display: flex; align-items: center; gap: 12px;
    padding: 12px 16px; background: var(--bg-card);
    border-bottom: 1px solid var(--border);
    position: sticky; top: 0; z-index: 10;
}
.chat-header-bar .chat-avatar {
    width: 40px; height: 40px; border-radius: 50%;
    background: var(--primary-light); color: var(--primary);
    display: flex; align-items: center; justify-content: center;
    font-size: 18px; font-weight: 700; flex-shrink: 0;
    overflow: hidden;
}
.chat-header-bar .chat-avatar img {
    width: 100%; height: 100%; object-fit: cover;
}
.chat-header-bar .chat-title {
    font-size: 17px; font-weight: 600; color: var(--text);
}
.chat-header-bar .chat-subtitle {
    font-size: 12px; color: var(--text-muted);
}
.chat-messages {
    flex: 1; overflow-y: auto; padding: 16px;
    display: flex; flex-direction: column; gap: 12px;
}
.chat-msg {
    display: flex; flex-direction: column; max-width: 75%;
}
.chat-msg.admin { align-self: flex-start; }
.chat-msg.user { align-self: flex-end; }
.chat-msg .msg-bubble {
    padding: 10px 14px; border-radius: 16px;
    font-size: 15px; line-height: 1.5; word-break: break-word;
}
.chat-msg.admin .msg-bubble {
    background: var(--bg); color: var(--text);
    border-top-left-radius: 4px;
}
.chat-msg.user .msg-bubble {
    background: var(--primary); color: #fff;
    border-top-right-radius: 4px;
}
.chat-msg .msg-time {
    font-size: 11px; color: var(--text-muted); margin-top: 4px;
}
.chat-msg.admin .msg-time { padding-left: 4px; }
.chat-msg.user .msg-time { text-align: right; padding-right: 4px; }
.chat-msg .msg-time { text-align: right; padding-right: 4px; }
.chat-msg .msg-image {
    max-width: 200px; border-radius: var(--radius);
    cursor: pointer;
}
.chat-msg .chat-avatar-img {
    width: 34px; height: 34px; border-radius: 8px;
    flex-shrink: 0; object-fit: cover;
}
.chat-msg .msg-body { flex: 1; min-width: 0; }
.chat-system-msg {
    text-align: center; padding: 40px 0;
    color: var(--text-muted); font-size: 14px;
}
.chat-input-bar {
    display: flex; align-items: flex-end; gap: 8px;
    padding: 12px 16px; background: var(--bg-card);
    border-top: 1px solid var(--border);
}
.chat-input-bar textarea {
    flex: 1; padding: 10px 14px; border-radius: 20px;
    border: 1.5px solid var(--border); background: var(--bg);
    font-size: 15px; color: var(--text); outline: none;
    resize: none; max-height: 100px; font-family: inherit;
    transition: border-color 0.2s;
}
.chat-input-bar textarea:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(201,162,78,0.15);
}
.chat-input-bar .btn-send {
    width: 40px; height: 40px; border-radius: 50%;
    background: var(--primary); color: #fff; border: none;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer; flex-shrink: 0; transition: transform 0.15s;
}
.chat-input-bar .btn-send:active { transform: scale(0.9); }
.chat-input-bar .btn-image {
    width: 40px; height: 40px; border-radius: 50%;
    background: var(--bg); color: var(--text-secondary); border: 1.5px solid var(--border);
    display: flex; align-items: center; justify-content: center;
    cursor: pointer; flex-shrink: 0;
}
.chat-input-bar .btn-image:active { background: var(--primary-light); color: var(--primary); }
.chat-readonly-hint {
    text-align: center; padding: 8px; font-size: 12px;
    color: var(--text-muted); background: var(--bg);
    border-top: 1px solid var(--border);
}

/* ===== 套餐卡片 ===== */
.plans-grid {
    display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 12px;
    margin-bottom: 16px;
}
.plan-card {
    background: var(--bg-card); border-radius: var(--radius);
    padding: 16px 12px; text-align: center;
    border: 2px solid var(--border); box-shadow: var(--shadow-sm);
    transition: all 0.2s;
}
.plan-card:hover { border-color: var(--primary); }
.plan-card.active { border-color: var(--primary); background: var(--primary-light); }
.plan-card .plan-icon {
    width: 36px; height: 36px; margin: 0 auto 8px; color: var(--primary);
}
.plan-card .plan-name {
    font-size: 15px; font-weight: 700; color: var(--text); margin-bottom: 4px;
}
.plan-card .plan-duration {
    font-size: 12px; color: var(--text-secondary);
}
.plan-card.active .plan-name { color: var(--primary); }

/* ===== 会员中心 ===== */
.vip-container { max-width: 520px; margin: 0 auto; padding: 20px 16px; }
.vip-header { text-align: center; padding: 20px 0 16px; }
.vip-header .vip-icon {
    width: 56px; height: 56px; margin: 0 auto 12px;
    color: var(--accent);
}
.vip-header h1 { font-size: 26px; font-weight: 700; color: var(--text); margin: 0; }
.vip-header p { color: var(--text-secondary); font-size: 15px; margin-top: 4px; }
.vip-card {
    background: var(--bg-card); border-radius: var(--radius-xl);
    padding: 28px 24px; border: 1px solid var(--border);
    box-shadow: var(--shadow-sm); margin-bottom: 16px; text-align: center;
}
.vip-card .card-title {
    font-size: 18px; font-weight: 600; color: var(--text); margin-bottom: 8px;
}
.vip-card .card-desc {
    font-size: 14px; color: var(--text-secondary); line-height: 1.6; margin-bottom: 20px;
}
.vip-card .card-desc strong { color: var(--accent); }
.vip-features {
    display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 10px; margin-top: 12px;
}
.vip-features .feature-item {
    background: var(--bg); border-radius: var(--radius);
    padding: 14px 8px; text-align: center;
}
.vip-features .feature-item .fi-icon {
    width: 24px; height: 24px; margin: 0 auto 4px; color: var(--accent);
}
.vip-features .feature-item .fi-label { font-size: 12px; color: var(--text-secondary); font-weight: 500; }

/* ===== 后台管理通用 ===== */
.admin-page { background: var(--bg); min-height: 100vh; padding-bottom: 0; }
.admin-nav {
    background: var(--bg-card); color: var(--text);
    padding: 0 20px; display: flex; align-items: center;
    justify-content: space-between; height: 56px;
    position: sticky; top: 0; z-index: 100;
    border-bottom: 1px solid var(--border);
}
.admin-nav h1 {
    font-size: 18px; font-weight: 700; color: var(--text);
    display: flex; align-items: center; gap: 8px;
}
.admin-nav .nav-links { display: flex; gap: 4px; }
.admin-nav .nav-links a {
    color: var(--text-secondary); text-decoration: none; padding: 8px 14px;
    border-radius: var(--radius-sm); font-size: 14px; font-weight: 500;
    transition: all 0.15s;
}
.admin-nav .nav-links a:hover { background: var(--bg); color: var(--text); }
.admin-nav .nav-links a.active { background: var(--primary); color: #fff; }
.admin-content { max-width: 1100px; margin: 0 auto; padding: 24px 20px; }
.admin-stats {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 16px; margin-bottom: 24px;
}
.admin-stat-card {
    background: var(--bg-card); border-radius: var(--radius-lg);
    padding: 20px; border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
}
.admin-stat-card .stat-number { font-size: 32px; font-weight: 700; color: var(--text); }
.admin-stat-card .stat-label { font-size: 14px; color: var(--text-secondary); margin-top: 4px; }
.admin-card {
    background: var(--bg-card); border-radius: var(--radius-lg);
    padding: 24px; border: 1px solid var(--border);
    box-shadow: var(--shadow-sm); margin-bottom: 24px;
}
.admin-card h3 {
    font-size: 18px; font-weight: 600; color: var(--text);
    margin-bottom: 20px; display: flex; align-items: center; gap: 8px;
}
.admin-card h3 .svg-icon { color: var(--primary); }
.form-row {
    display: grid; grid-template-columns: 1fr 1fr; gap: 16px;
    margin-bottom: 16px;
}
.form-row > div label {
    display: block; font-size: 13px; font-weight: 600;
    color: var(--text-secondary); margin-bottom: 6px;
}
.form-row input, .form-row select {
    width: 100%; padding: 10px 14px; border: 1.5px solid var(--border);
    border-radius: var(--radius-sm); font-size: 14px; color: var(--text);
    background: #1e1e1e; outline: none; transition: border-color 0.2s;
}
.form-row input:focus, .form-row select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(201,162,78,0.15);
}
.admin-table-wrap { overflow-x: auto; }
.admin-table {
    width: 100%; border-collapse: collapse; font-size: 14px;
}
.admin-table th {
    text-align: left; padding: 12px 14px; font-weight: 600;
    color: var(--text-secondary); border-bottom: 2px solid var(--border);
    white-space: nowrap; font-size: 13px;
}
.admin-table td {
    padding: 12px 14px; border-bottom: 1px solid var(--border-light);
    color: var(--text); vertical-align: middle;
}
.admin-table tr:hover { background: var(--bg); }
.admin-table code {
    background: var(--bg); padding: 2px 8px; border-radius: 4px;
    font-size: 13px; color: var(--primary);
}
.admin-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.admin-tabs {
    display: flex; gap: 2px; margin-bottom: 20px;
    background: var(--bg); border-radius: var(--radius); padding: 4px;
}
.admin-tabs a {
    padding: 8px 20px; border-radius: var(--radius-sm);
    font-size: 14px; font-weight: 500; color: var(--text-secondary);
    text-decoration: none; transition: all 0.15s;
}
.admin-tabs a.active { background: #1e1e1e; color: var(--primary); box-shadow: var(--shadow-sm); }
.admin-tabs a:hover:not(.active) { color: var(--text); }

/* ===== 客服后台面板 ===== */
.chat-admin-container {
    display: grid; grid-template-columns: 320px 1fr; gap: 16px;
    min-height: calc(100vh - 80px);
}
.chat-admin-sidebar {
    background: var(--bg-card); border-radius: var(--radius-lg);
    border: 1px solid var(--border); overflow: hidden;
    display: flex; flex-direction: column;
}
.chat-admin-sidebar .sidebar-header {
    padding: 16px; border-bottom: 1px solid var(--border);
    font-weight: 600; font-size: 16px; display: flex; align-items: center; gap: 8px;
}
.chat-admin-sidebar .user-list {
    flex: 1; overflow-y: auto;
}
.chat-admin-sidebar .user-item {
    display: flex; align-items: center; gap: 12px; padding: 12px 16px;
    border-bottom: 1px solid var(--border-light);
    cursor: pointer; transition: background 0.1s;
}
.chat-admin-sidebar .user-item:hover { background: var(--bg); }
.chat-admin-sidebar .user-item.active { background: var(--primary-light); border-left: 3px solid var(--primary); }
.chat-admin-sidebar .user-item .user-avatar {
    width: 40px; height: 40px; border-radius: 50%;
    background: var(--primary-light); color: var(--primary);
    display: flex; align-items: center; justify-content: center;
    font-size: 16px; font-weight: 700; flex-shrink: 0;
}
.chat-admin-sidebar .user-item .user-info { flex: 1; min-width: 0; }
.chat-admin-sidebar .user-item .user-name { font-size: 14px; font-weight: 600; color: var(--text); }
.chat-admin-sidebar .user-item .user-preview {
    font-size: 12px; color: var(--text-muted);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.chat-admin-main {
    background: var(--bg-card); border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    display: flex; flex-direction: column;
}
.chat-admin-main .no-chat {
    flex: 1; display: flex; align-items: center; justify-content: center;
    color: var(--text-muted); font-size: 15px;
}
label.checkbox-label {
    display: flex; align-items: center; gap: 8px;
    font-size: 14px; color: var(--text); cursor: pointer;
    padding: 8px 0;
}
label.checkbox-label input[type="checkbox"] {
    width: 18px; height: 18px; accent-color: var(--primary);
}

/* ===== 响应式 ===== */
@media (max-width: 768px) {
    .chat-admin-container { grid-template-columns: 1fr; }
    .form-row { grid-template-columns: 1fr; }
    .plans-grid { grid-template-columns: 1fr 1fr 1fr; gap: 8px; }
    .recommend-grid { grid-template-columns: 1fr 1fr; }
    .admin-stats { grid-template-columns: 1fr 1fr; }
    .admin-nav { padding: 0 12px; }
    .admin-nav .nav-links a { padding: 6px 10px; font-size: 13px; }
}
@media (max-width: 420px) {
    .plans-grid { grid-template-columns: 1fr 1fr 1fr; gap: 6px; }
    .plan-card { padding: 12px 8px; }
    .plan-card .plan-name { font-size: 13px; }
    .recommend-grid { grid-template-columns: 1fr 1fr; gap: 8px; }
    .admin-stats { grid-template-columns: 1fr 1fr; gap: 10px; }
    .chat-msg { max-width: 85%; }
}

/* 滚动条 */
::-webkit-scrollbar { width: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }
