/* ==========================================================
   小酒支付 app.css
   全站统一样式（前台 + 后台 + 电脑端适配）
   ========================================================== */

/* ==========================================================
   0. 设计变量
   ========================================================== */
:root {
    --primary:        #10b981;
    --primary-hover:  #059669;
    --primary-light:  #ecfdf5;
    --primary-ring:   rgba(16, 185, 129, 0.15);

    --success:        #10b981;
    --success-bg:     #ecfdf5;
    --danger:         #ef4444;
    --danger-bg:      #fef2f2;
    --danger-border:  #fecaca;
    --warning:        #f59e0b;
    --warning-bg:     #fffbeb;
    --warning-border: #fde68a;
    --info:           #3b82f6;
    --info-bg:        #eff6ff;
    --info-border:    #bfdbfe;

    --text:           #111827;
    --text-sub:       #374151;
    --text-muted:     #6b7280;
    --text-faint:     #9ca3af;

    --bg:             #f9fafb;
    --bg-card:        #ffffff;
    --bg-hover:       #f3f4f6;
    --bg-subtle:      #f9fafb;

    --border:         #e5e7eb;
    --border-light:   #f3f4f6;
    --border-input:   #d1d5db;

    --radius:         16px;
    --radius-sm:      10px;
    --radius-xs:      8px;
    --gap:            16px;
    --gap-sm:         8px;

    --shadow-sm:      0 1px 2px rgba(0, 0, 0, 0.03);
    --shadow-md:      0 4px 12px rgba(0, 0, 0, 0.05);
}

/* ==========================================================
   1. 全局基础
   ========================================================== */
html {
    -webkit-tap-highlight-color: rgba(0, 0, 0, 0);
    -webkit-tap-highlight-color: transparent;
    -webkit-text-size-adjust: 100%;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.5;
    min-height: 100vh;
}
a { color: inherit; text-decoration: none; }
button, input, textarea, select { font: inherit; }
img { max-width: 100%; display: block; }
a, button, input, textarea, select, label, [role="button"] {
    -webkit-tap-highlight-color: transparent;
    -webkit-touch-callout: none;
}
a:focus:not(:focus-visible),
button:focus:not(:focus-visible),
input:focus:not(:focus-visible),
textarea:focus:not(:focus-visible),
select:focus:not(:focus-visible) { outline: none; }
.btn:active, .header-icon:active, .pkg-btn:active { transform: scale(0.97); }

.hidden { display: none !important; }
.muted { color: var(--text-faint); }
.container { max-width: 720px; margin: 0 auto; padding: 0 16px; }
.flex { display: flex; }
.flex-between { display: flex; justify-content: space-between; align-items: center; }
.gap-2 { gap: var(--gap-sm); }
.text-right { text-align: right; }
.text-sm { font-size: 13px; }
.text-xs { font-size: 12px; }
.text-muted { color: var(--text-muted); }
.text-success { color: var(--success); }
.text-danger { color: var(--danger); }
.text-warning { color: var(--warning); }

/* ==========================================================
   2. 顶部导航 (前台 Header)
   ========================================================== */
.header {
    background: #fff;
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 10;
}
.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    flex-wrap: nowrap;
    padding: 12px 16px;
}
.logo {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text);
    font-weight: 600;
    flex-shrink: 0;
}
.logo span { white-space: nowrap; }
.logo svg {
    color: #fff;
    background: var(--primary);
    padding: 6px;
    border-radius: 8px;
    flex-shrink: 0;
}
.header-right {
    display: flex;
    align-items: center;
    gap: 6px;
    min-width: 0;
    flex-shrink: 1;
}
.user-link { color: #4b5563; }
.user-link:hover { color: var(--text); }

.balance-badge {
    display: inline-block;
    background: var(--primary-light);
    color: #059669;
    padding: 4px 10px;
    border-radius: 999px;
    font-weight: 500;
    font-size: 14px;
    white-space: nowrap;
    max-width: 100px;
    overflow: hidden;
    text-overflow: ellipsis;
    vertical-align: middle;
    flex-shrink: 0;
}
.balance-badge:hover { background: #d1fae5; }
.header-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 10px;
    color: #4b5563;
    position: relative;
    flex-shrink: 0;
    transition: background 0.15s, color 0.15s;
}
.header-icon:hover { background: var(--bg-hover); color: var(--text); }
.header-icon .badge-dot {
    position: absolute;
    top: -2px;
    right: -2px;
    background: var(--danger);
    color: #fff;
    font-size: 10px;
    padding: 1px 5px;
    border-radius: 999px;
    min-width: 16px;
    text-align: center;
    line-height: 14px;
    font-weight: 600;
}

@media (max-width: 480px) {
    .header-inner { padding: 10px 12px; gap: 6px; }
    .logo span { font-size: 15px; }
    .balance-badge { font-size: 13px; padding: 3px 8px; max-width: 85px; }
    .header-icon { width: 34px; height: 34px; }
}
@media (max-width: 320px) {
    .logo span { display: none; }
    .balance-badge { font-size: 12px; padding: 2px 6px; max-width: 70px; }
}
@media (max-width: 340px) {
    .header-icon { width: 30px; height: 30px; }
}

/* ==========================================================
   3. 按钮与表单
   ========================================================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 16px;
    border-radius: var(--radius-xs);
    border: 1px solid transparent;
    font-weight: 500;
    font-size: 14px;
    cursor: pointer;
    transition: 0.15s;
}
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-sm { padding: 6px 12px; font-size: 13px; }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover:not(:disabled) { background: var(--primary-hover); }
.btn-secondary { background: #fff; color: var(--text-sub); border-color: var(--border-input); }
.btn-secondary:hover:not(:disabled) { background: var(--bg-subtle); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover:not(:disabled) { background: #dc2626; }
.btn-block { width: 100%; }

.form-group { margin-bottom: 14px; }
.form-label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-sub);
    margin-bottom: 6px;
}
.form-input, .form-select, .form-textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border-input);
    border-radius: var(--radius-xs);
    font-size: 14px;
    outline: none;
    transition: 0.15s;
    background: #fff;
}
.form-input:focus,
.form-select:focus,
.form-textarea:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-ring);
}
.form-textarea { min-height: 100px; resize: vertical; }

.search-bar {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    align-items: center;
    margin-bottom: 12px;
}
.search-bar .form-input,
.search-bar .form-select { flex: 1; min-width: 140px; }
.search-bar .btn { flex-shrink: 0; }
@media (max-width: 480px) {
    .search-bar .form-input,
    .search-bar .form-select { flex-basis: 100%; }
}

/* 美化原生的文件上传按钮 */
input[type="file"] {
    font-size: 14px;
    color: var(--text-muted);
    cursor: pointer;
}
input[type="file"]::file-selector-button {
    padding: 8px 16px;
    margin-right: 12px;
    border-radius: var(--radius-xs);
    border: 1px solid var(--primary);
    background: var(--primary-light);
    color: var(--primary-hover);
    font-weight: 500;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s;
}
input[type="file"]::file-selector-button:hover {
    background: var(--primary);
    color: #fff;
}

/* ==========================================================
   4. 提示与卡片
   ========================================================== */
.alert {
    padding: 12px 14px;
    border-radius: var(--radius-xs);
    font-size: 14px;
    margin-bottom: 14px;
}
.alert-error   { background: var(--danger-bg);  color: #991b1b; border: 1px solid var(--danger-border); }
.alert-success { background: var(--success-bg); color: #166534; border: 1px solid #bbf7d0; }
.alert-info    { background: var(--info-bg);    color: #1e40af; border: 1px solid var(--info-border); }
.alert-warn    { background: var(--warning-bg); color: #92400e; border: 1px solid var(--warning-border); }

.notice { padding: 14px; border-radius: 12px; border: 1px solid; margin-bottom: 10px; }
.notice-info    { background: var(--info-bg);    border-color: var(--info-border); }
.notice-warning { background: var(--warning-bg); border-color: var(--warning-border); }
.notice-success { background: var(--success-bg); border-color: #bbf7d0; }
.notice-danger  { background: var(--danger-bg);  border-color: var(--danger-border); }
.notice-title   { font-weight: 600; font-size: 14px; }
.notice-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
}
.notice-time { font-size: 12px; color: var(--text-faint); flex-shrink: 0; }
.notice-content {
    display: block;
    font-size: 13px;
    color: var(--text-sub);
    line-height: 1.6;
    word-break: break-word;
}
.notice-content p { margin: 6px 0; }
.notice-content ul, .notice-content ol { margin: 6px 0; padding-left: 20px; }
.notice-content img { max-width: 100%; height: auto; border-radius: 6px; margin: 6px 0; }
.notice-content a { color: var(--primary); }
.notice-content a:hover { text-decoration: underline; }

.card {
    background: #fff;
    border: 1px solid var(--border-light);
    border-radius: var(--radius);
    padding: 20px;
    box-shadow: var(--shadow-sm);
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}
.card + .card { margin-top: 16px; }
.card-title {
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text);
}
.card-title svg { color: var(--primary); }
.card * { min-width: 0; }

/* ==========================================================
   5. 套餐网格与购买弹窗
   ========================================================== */
.pkg-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    margin-top: 18px;
    padding-top: 8px;
}
.pkg-btn {
    position: relative;
    padding: 12px 8px;
    text-align: center;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: #fff;
    cursor: pointer;
    transition: 0.15s;
    min-width: 0;
}
.pkg-btn:hover { border-color: var(--primary); background: #f0fdf4; }
.pkg-btn.recommend { background: var(--primary); color: #fff; border-color: var(--primary); }
.pkg-btn.recommend:hover { background: var(--primary-hover); }
.pkg-btn .pkg-name {
    font-size: 12px;
    opacity: 0.85;
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.pkg-btn .pkg-price {
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-variant-numeric: tabular-nums;
}
.pkg-btn .pkg-badge {
    position: absolute;
    top: -8px;
    left: 50%;
    transform: translateX(-50%);
    background: #fbbf24;
    color: #78350f;
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 999px;
    white-space: nowrap;
    z-index: 1;
}
@media (max-width: 480px) {
    .pkg-btn .pkg-price { font-size: 14px; }
    .pkg-btn .pkg-name { font-size: 11px; }
}

.modal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 50;
    display: none;
    align-items: flex-end;
    justify-content: center;
    padding: 0;
}
.modal.open { display: flex; }
@media (min-width: 640px) { .modal { align-items: center; padding: 16px; } }
.modal-box {
    background: #fff;
    width: 100%;
    max-width: 460px;
    border-radius: 16px 16px 0 0;
    max-height: 90vh;
    overflow-y: auto;
}
@media (min-width: 640px) { .modal-box { border-radius: 16px; } }
.modal-head {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-light);
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    background: #fff;
    z-index: 1;
}
.modal-head h3 { font-size: 15px; font-weight: 600; }
.modal-close {
    background: none;
    border: 0;
    color: var(--text-faint);
    cursor: pointer;
    padding: 4px;
}
.modal-body { padding: 20px; }

/* ==========================================================
   6. 表格与数据展示
   ========================================================== */
.table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
    min-width: 560px;
    white-space: nowrap;
}
.table th, .table td {
    padding: 10px 12px;
    text-align: left;
    border-bottom: 1px solid var(--border-light);
}
.table th { font-weight: 500; color: var(--text-muted); font-size: 12px; }
.table tr:last-child td { border-bottom: none; }
.table td code {
    display: inline-block;
    max-width: 220px;
    overflow: hidden;
    text-overflow: ellipsis;
    vertical-align: middle;
}
@media (max-width: 640px) {
    .table { min-width: 480px; font-size: 12px; }
    .table th, .table td { padding: 8px 10px; }
}

.stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}
.stat {
    background: #fff;
    border-radius: 12px;
    padding: 20px;
    border: 1px solid var(--border-light);
}
.stat .stat-label { font-size: 12px; color: var(--text-muted); margin-bottom: 6px; }
.stat .stat-value { font-size: 24px; font-weight: 600; }

.balance-amount {
    font-size: 32px;
    font-weight: 600;
    margin: 8px 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-variant-numeric: tabular-nums;
}
@media (max-width: 480px) { .balance-amount { font-size: 22px; } }
@media (max-width: 360px) { .balance-amount { font-size: 18px; } }

/* ==========================================================
   7. 其他页面组件
   ========================================================== */
.loading-overlay {
    position: fixed;
    inset: 0;
    background: rgba(255, 255, 255, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
}
.spinner {
    width: 36px;
    height: 36px;
    border: 3px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.footer {
    text-align: center;
    color: var(--text-faint);
    font-size: 12px;
    padding: 24px 0;
    margin-top: 24px;
}

.auth-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}
.auth-box { width: 100%; max-width: 380px; }
.auth-logo { text-align: center; margin-bottom: 24px; }
.auth-logo .logo-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 56px;
    height: 56px;
    background: var(--primary);
    border-radius: 16px;
    color: #fff;
    margin-bottom: 12px;
}
.auth-logo h1 { font-size: 22px; font-weight: 600; }
.auth-logo p { font-size: 13px; color: var(--text-muted); margin-top: 4px; }
.auth-footer {
    text-align: center;
    margin-top: 20px;
    font-size: 13px;
    color: var(--text-muted);
}
.auth-footer a { color: var(--primary); font-weight: 500; }

.admin-layout { display: flex; min-height: 100vh; }
.admin-main { flex: 1; padding: 24px; overflow-x: auto; }

/* ==========================================================
   8. 用户中心菜单折叠 & 服务侧滑
   ========================================================== */
.menu-box {
    border: 1px solid var(--border-light);
    border-radius: 16px;
    background: #fff;
    overflow: hidden;
    margin-top: 16px;
}
.menu-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    font-size: 15px;
    font-weight: 600;
    color: var(--text);
    cursor: pointer;
    user-select: none;
    transition: background 0.15s;
}
.menu-header:hover { background: var(--bg-subtle); }
.menu-header .arrow-icon { color: var(--text-faint); transition: transform 0.3s ease; }
.menu-list { display: none; border-top: 1px solid var(--border-light); }
.menu-box.open .menu-list { display: block; }
.menu-box.open .menu-header .arrow-icon { transform: rotate(180deg); }
.menu-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 20px;
    border-bottom: 1px solid var(--border-light);
    font-size: 14px;
    color: var(--text-sub);
    transition: background 0.15s;
    cursor: pointer;
    text-decoration: none;
}
.menu-item:last-child { border-bottom: none; }
.menu-item:hover { background: var(--bg-subtle); }
.menu-item .menu-left { display: flex; align-items: center; gap: 12px; }
.menu-item .menu-icon {
    color: var(--text-faint);
    display: flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
}
.menu-item .menu-arrow { color: var(--border-input); }

.swipe-item {
    position: relative;
    overflow: hidden;
    border-radius: 16px;
    border: 1px solid var(--border-light);
    background: #fff;
    margin-bottom: 12px;
    isolation: isolate;
}
.swipe-item.offline { opacity: 0.7; }
.swipe-delete {
    position: absolute;
    top: 0; right: 0; bottom: 0;
    width: 72px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--danger);
    color: #fff;
    border: 0;
    cursor: pointer;
    font-size: 20px;
    z-index: 0;
}
.swipe-delete:active { background: #dc2626; }
.swipe-content {
    position: relative;
    z-index: 1;
    background: #fff;
    padding: 16px;
    transform: translateX(0);
    transition: transform 0.2s ease;
    touch-action: pan-y;
    will-change: transform;
}
.swipe-item.open .swipe-content { transform: translateX(-72px); }
.swipe-item.collapsed .swipe-body { display: none; }
.swipe-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 8px;
}
.swipe-title {
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}
.swipe-title strong { font-size: 14px; }
.swipe-actions {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    gap: 4px;
}
.swipe-toggle {
    background: transparent;
    border: 0;
    padding: 4px;
    cursor: pointer;
    color: var(--text-muted);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    transition: 0.15s;
}
.swipe-toggle:hover { background: var(--bg-hover); color: var(--text); }
.swipe-item.collapsed .swipe-toggle svg { transform: rotate(-90deg); }
.swipe-toggle svg { transition: transform 0.2s; }
.offline-badge {
    display: inline-block;
    padding: 1px 8px;
    border-radius: 999px;
    background: var(--bg-hover);
    color: var(--text-muted);
    font-size: 11px;
    font-weight: 500;
    vertical-align: middle;
}
.swipe-links {
    margin-top: 10px;
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}
.swipe-body { margin-top: 10px; }
.swipe-hint {
    font-size: 12px;
    color: var(--text-faint);
    text-align: center;
    padding: 8px 0 4px;
}

/* ==========================================================
   9. 支付密码弹窗与开关
   ========================================================== */
#pinModal, #dynamicPinModal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 99999;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
}
#pinModal.open, #dynamicPinModal.open,
#pinModal[style*="display: flex"], #dynamicPinModal[style*="display: flex"] {
    display: flex !important;
}
.modal-box-pin {
    background: #fff;
    border-radius: 16px;
    max-width: 340px;
    width: 100%;
    padding: 20px;
}
.pin-box {
    flex: 1;
    aspect-ratio: 1;
    border: 1px solid var(--border);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    font-weight: 600;
    color: var(--text);
    background: #fff;
    transition: all 0.3s ease;
}
.pin-box.filled { border-color: var(--primary); background: var(--primary-light); color: #059669; }
.pin-box.active { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-ring); }

@keyframes dropDownIn {
    0%   { opacity: 0; transform: translateY(-150px) scale(0.95); }
    50%  { opacity: 1; transform: translateY(10px) scale(1.02); }
    70%  { transform: translateY(-4px) scale(1); }
    100% { transform: translateY(0) scale(1); }
}
#pinModal .modal-box,
#dynamicPinModal .modal-box-pin {
    animation: dropDownIn 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

.switch {
    position: relative;
    display: inline-block;
    width: 42px;
    height: 24px;
}
.switch input { opacity: 0; width: 0; height: 0; }
.switch .slider {
    position: absolute;
    inset: 0;
    background: #d4d8e0;
    border-radius: 100px;
    cursor: pointer;
    transition: 0.18s;
}
.switch input:checked + .slider { background: var(--primary); }
.switch input:checked + .slider:before { transform: translateX(18px); }
.switch .slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background: white;
    border-radius: 50%;
    transition: 0.18s;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.18);
}

/* ==========================================================
   10. Chat 聊天模块
   ========================================================== */
.chat-layout {
    display: flex;
    flex-direction: column;
    height: 600px;
    max-height: calc(100vh - 120px);
    max-width: 720px;
    margin: 16px auto;
    background: #fff !important;
    border-radius: 16px;
    border: 1px solid var(--border) !important;
    overflow: hidden;
    box-shadow: var(--shadow-md);
}
.chat-header {
    padding: 14px 18px;
    border-bottom: 1px solid var(--border-light) !important;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #fff !important;
    flex-shrink: 0;
}
.chat-title {
    font-size: 15px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--text) !important;
    white-space: nowrap;
}
.chat-title svg { color: var(--primary); }
.chat-badge {
    font-size: 12px;
    padding: 4px 10px;
    border-radius: 999px;
    background: var(--primary-light) !important;
    color: #059669 !important;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    white-space: nowrap;
    flex-shrink: 0;
}
.chat-badge svg { width: 12px; height: 12px; flex-shrink: 0; }
.chat-badge.resolved { background: var(--bg-hover) !important; color: var(--text-muted) !important; }
.chat-content {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    background: var(--bg) !important;
    -webkit-overflow-scrolling: touch;
}
.chat-empty-state {
    text-align: center;
    color: var(--text-faint);
    font-size: 14px;
    padding: 60px 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}
.chat-empty-state svg { width: 64px !important; height: 64px !important; margin-bottom: 16px; color: var(--border-input); }
.chat-bubble-row { display: flex; margin-bottom: 16px; width: 100%; }
.chat-bubble-row.user  { justify-content: flex-end; }
.chat-bubble-row.admin { justify-content: flex-start; }
.chat-bubble-content {
    display: block !important;
    width: fit-content !important;
    max-width: 82% !important;
    min-width: 0 !important;
    padding: 10px 14px;
    border-radius: 12px;
    font-size: 15px;
    line-height: 1.5;
    word-break: break-word;
    box-sizing: border-box;
    text-align: left;
    margin: 0;
}
.chat-bubble-content > span { display: block; width: auto; margin: 0; padding: 0; }
.chat-bubble-content > span > span { display: block; }
.chat-bubble-row.user .chat-bubble-content {
    background: var(--primary) !important;
    color: #fff !important;
    border-bottom-right-radius: 4px;
}
.chat-bubble-row.admin .chat-bubble-content {
    background: #fff !important;
    color: var(--text) !important;
    border: 1px solid var(--border) !important;
    border-bottom-left-radius: 4px;
}
.chat-time {
    display: block !important;
    font-size: 11px !important;
    margin-top: 6px !important;
    opacity: 0.6;
    text-align: right;
}
.chat-input-area {
    padding: 10px 14px;
    padding-bottom: calc(10px + env(safe-area-inset-bottom, 0px));
    border-top: 1px solid var(--border-light) !important;
    display: flex;
    gap: 10px;
    background: #fff !important;
    align-items: flex-end;
    flex-shrink: 0;
}
.chat-input-area .form-textarea {
    flex: 1;
    height: 44px !important;
    min-height: 44px !important;
    max-height: 120px !important;
    resize: none !important;
    margin: 0 !important;
    padding: 10px 16px !important;
    font-size: 15px !important;
    border-radius: 22px !important;
    border: 1px solid var(--border) !important;
    background: var(--bg) !important;
    color: var(--text) !important;
    box-sizing: border-box;
    outline: none !important;
}
.chat-input-area .btn {
    flex-shrink: 0;
    height: 44px !important;
    padding: 0 24px !important;
    border-radius: 22px !important;
    font-size: 15px !important;
}
.chat-resolved-bar {
    padding: 16px;
    padding-bottom: calc(16px + env(safe-area-inset-bottom, 0px));
    background: #fef3c7 !important;
    color: #92400e !important;
    font-size: 13px;
    text-align: center;
    border-top: 1px solid var(--warning-border) !important;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

.admin-chat-layout {
    display: flex;
    flex-direction: column;
    height: 100vh;
    height: 100dvh;
    max-width: 820px;
    margin: 0 auto;
    background: #fff !important;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.05);
}
.admin-chat-header {
    padding: 14px 18px;
    padding-top: calc(14px + env(safe-area-inset-top, 0px));
    border-bottom: 1px solid var(--border-light) !important;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #fff !important;
    flex-shrink: 0;
}
.admin-chat-header .info { min-width: 0; flex: 1; }

/* ==========================================================
   10. Chat 聊天模块 (续)
   ========================================================== */
.admin-chat-header .title svg { color: var(--primary); flex-shrink: 0; }
.admin-chat-header .meta { font-size: 12px; color: var(--text-muted); margin-top: 2px; }

.admin-chat-badge {
    font-size: 12px;
    padding: 4px 10px;
    border-radius: 999px;
    background: var(--primary-light) !important;
    color: #059669 !important;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    white-space: nowrap;
    flex-shrink: 0;
}
.admin-chat-badge svg { width: 12px; height: 12px; flex-shrink: 0; }
.admin-chat-badge.resolved { background: var(--bg-hover) !important; color: var(--text-muted) !important; }

.admin-chat-content {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    background: var(--bg) !important;
    -webkit-overflow-scrolling: touch;
}
.admin-chat-content .chat-bubble-row.user  { justify-content: flex-start; }
.admin-chat-content .chat-bubble-row.admin { justify-content: flex-end; }
.admin-chat-content .chat-bubble-row.admin .chat-bubble-content {
    background: var(--primary) !important;
    color: #fff !important;
    border-bottom-right-radius: 4px;
    border: none !important;
}
.admin-chat-content .chat-bubble-row.user .chat-bubble-content {
    background: #fff !important;
    color: var(--text) !important;
    border: 1px solid var(--border) !important;
    border-bottom-left-radius: 4px;
}
.admin-chat-content .chat-bubble-row.admin .chat-time { text-align: right; }
.admin-chat-content .chat-bubble-row.user .chat-time  { text-align: left; }

.admin-chat-input-area {
    padding: 12px 16px;
    padding-bottom: calc(12px + env(safe-area-inset-bottom, 0px));
    border-top: 1px solid var(--border-light) !important;
    background: #fff !important;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.admin-chat-input-area .row1 { display: flex; gap: 10px; align-items: flex-end; }
.admin-chat-input-area .form-textarea {
    flex: 1;
    height: 44px !important;
    min-height: 44px !important;
    max-height: 120px !important;
    resize: none !important;
    margin: 0 !important;
    padding: 10px 16px !important;
    font-size: 15px !important;
    border-radius: 12px !important;
    border: 1px solid var(--border) !important;
    background: var(--bg) !important;
    color: var(--text) !important;
    box-sizing: border-box;
    outline: none !important;
}
.admin-chat-input-area .btn {
    height: 44px !important;
    border-radius: 12px !important;
    font-size: 15px !important;
    padding: 0 20px !important;
}
.admin-chat-input-area .row2 {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
    margin-top: 4px;
}
.admin-chat-input-area .row2 .btn {
    height: 36px !important;
    border-radius: 8px !important;
    font-size: 13px !important;
    padding: 0 16px !important;
}
.admin-chat-resolved-bar {
    padding: 16px;
    padding-bottom: calc(16px + env(safe-area-inset-bottom, 0px));
    background: #fef3c7 !important;
    color: #92400e !important;
    font-size: 13px;
    text-align: center;
    border-top: 1px solid var(--warning-border) !important;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.chat-image-msg {
    max-width: 100%;
    max-height: 240px;
    border-radius: 8px;
    cursor: zoom-in;
    display: block;
    object-fit: contain;
    background: rgba(0, 0, 0, 0.05);
}
.chat-upload-btn {
    flex-shrink: 0;
    width: 44px;
    height: 44px;
    border-radius: 22px;
    background: var(--bg-subtle) !important;
    color: var(--text-muted) !important;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border: 1px solid var(--border);
    transition: 0.2s;
}
.chat-upload-btn:hover { background: var(--border) !important; color: var(--text) !important; }
.chat-upload-btn input[type="file"] { display: none; }

.gt-modal-mask {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
}
.gt-modal-mask.open { display: flex; }
.gt-modal-box {
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    width: 340px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
}
.gt-modal-header {
    padding: 15px;
    text-align: center;
    border-bottom: 1px solid #eee;
    font-size: 15px;
    font-weight: 600;
    color: #333;
}
.gt-iframe { width: 100%; height: 400px; border: none; background: var(--bg); }

/* ==========================================================
   11. Admin 后台专用（与前台统一主题：白底 + 绿色 active）
   ========================================================== */

/* 侧边栏：白底，和前台卡片统一 */
.admin-sidebar {
    width: 220px;
    background: #ffffff;
    color: var(--text-sub);
    padding: 20px 0;
    flex-shrink: 0;
    border-right: 1px solid var(--border);
}
.admin-sidebar .admin-logo {
    padding: 0 20px 20px;
    border-bottom: 1px solid var(--border-light);
    margin-bottom: 12px;
    font-weight: 600;
    color: var(--text);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}
.admin-sidebar a {
    display: block;
    padding: 10px 20px;
    color: #4b5563;
    font-size: 14px;
    transition: 0.15s;
    text-decoration: none;
}
.admin-sidebar a:hover { background: var(--bg-hover); color: var(--text); }
.admin-sidebar a.active {
    background: var(--primary-light);
    color: #059669;
    font-weight: 600;
    border-left: 3px solid var(--primary);
    padding-left: 17px;
}
.admin-nav a.admin-nav-divider {
    margin-top: 12px;
    border-top: 1px solid var(--border-light);
    padding-top: 14px;
}

/* 后台顶部标题区（桌面端） */
.admin-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}
.admin-header h1 { font-size: 22px; font-weight: 600; color: var(--text); }

/* 移动端顶部栏：白底，和前台 header 一致 */
.admin-topbar {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0;
    height: 56px;
    background: #ffffff;
    color: var(--text);
    align-items: center;
    padding: 0 12px;
    padding-top: env(safe-area-inset-top, 0);
    z-index: 30;
    border-bottom: 1px solid var(--border);
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.03);
}
.admin-topbar-title {
    flex: 1;
    font-size: 15px;
    font-weight: 600;
    text-align: center;
    padding: 0 8px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.admin-topbar-spacer { width: 40px; flex-shrink: 0; }

.admin-menu-btn {
    width: 40px; height: 40px;
    border-radius: 10px;
    background: transparent;
    border: 0;
    color: #4b5563;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.admin-menu-btn:hover { background: var(--bg-hover); color: var(--text); }

.admin-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    z-index: 40;
    opacity: 0;
    transition: opacity 0.2s;
}
.admin-overlay.open { display: block; opacity: 1; }

.admin-close-btn {
    display: none;
    background: transparent;
    border: 0;
    color: var(--text-faint);
    cursor: pointer;
    padding: 4px;
    margin-left: auto;
}
.admin-close-btn:hover { color: var(--text); }

.admin-nav .nav-badge {
    display: inline-block;
    font-size: 10px;
    padding: 1px 6px;
    border-radius: 999px;
    margin-left: 6px;
    vertical-align: middle;
    line-height: 14px;
    color: #fff;
    font-weight: 600;
}
.admin-nav .nav-badge-pending { background: var(--warning); }
.admin-nav .nav-badge-open    { background: var(--primary); margin-left: 4px; }

/* 后台移动端 */
@media (max-width: 768px) {
    .admin-topbar { display: flex; }
    .admin-overlay.open { display: block; }

    .admin-layout { display: block; }

    .admin-sidebar {
        position: fixed;
        top: 0; left: 0; bottom: 0;
        width: 250px;
        max-width: 82vw;
        z-index: 50;
        padding: 20px 0;
        padding-top: calc(20px + env(safe-area-inset-top, 0));
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        transform: translateX(-100%);
        transition: transform 0.25s ease;
        box-shadow: none;
    }
    .admin-sidebar.open {
        transform: translateX(0);
        box-shadow: 4px 0 20px rgba(0, 0, 0, 0.1);
    }
    .admin-close-btn { display: inline-flex; }

    .admin-sidebar a {
        display: block;
        padding: 12px 20px;
        font-size: 14px;
        white-space: normal;
    }

    .admin-main {
        padding: 16px;
        padding-top: calc(56px + 16px + env(safe-area-inset-top, 0));
    }
    .admin-header { display: none; }

    .stats {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
        margin-bottom: 16px;
    }
    .stat { padding: 14px; }
    .stat .stat-value { font-size: 18px; }
    .stat .stat-label { font-size: 11px; }
    .card { padding: 14px; border-radius: 12px; }
}

@media (max-width: 380px) {
    .stats { grid-template-columns: 1fr; }
}

@media (min-width: 769px) {
    .admin-topbar { display: none !important; }
    .admin-overlay { display: none !important; }
    .admin-close-btn { display: none !important; }
    .admin-sidebar {
        position: static;
        transform: none;
        width: 220px;
        padding: 20px 0;
        box-shadow: none;
    }
    .admin-sidebar.open { transform: none; }
}

/* ==========================================================
   12. 前台投票
   ========================================================== */
.vote-bar-wrap { margin-bottom: 12px; }
.vote-bar-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 13px;
    margin-bottom: 5px;
    gap: 8px;
}
.vote-bar-head .label { font-weight: 500; word-break: break-all; }
.vote-bar-head .num {
    color: var(--text-muted);
    font-size: 12px;
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}
.vote-bar-track {
    height: 26px;
    background: var(--bg-hover);
    border-radius: 6px;
    overflow: hidden;
    position: relative;
}
.vote-bar-fill {
    height: 100%;
    border-radius: 6px;
    transition: width 0.4s ease;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding-right: 8px;
    color: #fff;
    font-size: 11px;
    font-weight: 600;
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
}
.vote-bar-fill.mine::after { content: " ✓"; margin-left: 4px; font-size: 12px; }

.vote-choice {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius-xs);
    margin-bottom: 8px;
    cursor: pointer;
    transition: 0.15s;
    user-select: none;
}
.vote-choice:hover { border-color: var(--primary); background: #f0fdf4; }
.vote-choice input { margin: 0; flex-shrink: 0; }
.vote-choice.checked { border-color: var(--primary); background: var(--primary-light); }
.vote-choice .dot { width: 12px; height: 12px; border-radius: 50%; flex-shrink: 0; }

/* ==========================================================
   13. 通用工具类
   ========================================================== */
.bg-subtle   { background: var(--bg-subtle); }
.bg-card     { background: var(--bg-card); }
.bg-hover    { background: var(--bg-hover); }
.border      { border: 1px solid var(--border); }
.border-light{ border: 1px solid var(--border-light); }
.rounded     { border-radius: var(--radius-sm); }
.rounded-sm  { border-radius: var(--radius-xs); }
.mt-2        { margin-top: var(--gap-sm); }
.mt-4        { margin-top: var(--gap); }
.mb-2        { margin-bottom: var(--gap-sm); }
.mb-4        { margin-bottom: var(--gap); }
.w-full      { width: 100%; }

/* ==========================================================
   14. 电脑端/宽屏专属适配 (Desktop Layout)
   ========================================================== */

@media (min-width: 1024px) {
    /* 1. 容器加宽 */
    .container {
        max-width: 1100px;
    }

    /* 2. 头部导航优化 */
    .header-inner {
        padding: 16px 24px;
    }
    .logo span {
        font-size: 18px;
    }

    /* 3. 首页套餐网格：在电脑上变成 3 列或 4 列 */
    .pkg-grid {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
        gap: 16px;
    }
    .pkg-btn {
        padding: 20px 16px;
        border-radius: 12px;
    }
    .pkg-btn:hover {
        transform: translateY(-3px);
        box-shadow: 0 8px 20px rgba(16, 185, 129, 0.15);
    }
    .pkg-btn .pkg-name { font-size: 14px; }
    .pkg-btn .pkg-price { font-size: 22px; margin-top: 6px; }

    /* 4. 表单/卡片留白加大 */
    .card {
        padding: 28px;
        border-radius: 20px;
    }
    .card-title {
        font-size: 18px;
        margin-bottom: 18px;
    }

    /* 5. 登录/注册页：电脑端居中，卡片更大 */
    .auth-box {
        max-width: 440px;
    }
    .auth-box .card {
        padding: 36px;
    }

    /* 6. 个人中心/服务列表：横向铺开 */
    .swipe-item .swipe-content {
        padding: 20px 24px;
    }
    .swipe-links {
        margin-top: 16px;
        gap: 12px;
    }
    .swipe-links .btn {
        padding: 10px 20px;
        font-size: 14px;
    }

    /* 7. 表格优化：表头背景微色，更有质感 */
    .table th {
        background: #f9fafb;
        padding: 14px 16px;
    }
    .table td {
        padding: 16px;
    }

    /* 8. 悬浮客服按钮调整位置 */
    #csFloatBtn {
        right: 40px;
        bottom: 60px;
        width: 64px;
        height: 64px;
    }
    #csFloatBtn svg {
        width: 32px;
        height: 32px;
    }

    /* 9. 模态框居中（之前是手机端从底部弹出的） */
    .modal {
        align-items: center;
        padding: 20px;
    }
    .modal-box {
        border-radius: 20px;
        max-width: 500px;
    }
    
    /* 后台适配 */
    .admin-main {
        padding: 32px 40px;
    }
}

/* 针对超大屏幕的进一步优化 */
@media (min-width: 1440px) {
    .container {
        max-width: 1200px;
    }
}