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

:root {
    --primary: #4f46e5;
    --primary-dark: #3730a3;
    --success: #10b981;
    --danger: #ef4444;
    --warning: #f59e0b;
    --bg: #f1f5f9;
    --card: #ffffff;
    --text: #1e293b;
    --text-muted: #64748b;
    --border: #e2e8f0;
    --sidebar-w: 240px;
    --radius: 10px;
    --shadow: 0 1px 3px rgba(0,0,0,.08), 0 4px 12px rgba(0,0,0,.04);
}

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

a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

/* Auth pages */
.auth-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 20px;
}

.auth-card {
    background: var(--card);
    border-radius: 16px;
    padding: 40px;
    width: 100%;
    max-width: 420px;
    box-shadow: 0 20px 60px rgba(0,0,0,.15);
}

.auth-card h1 {
    font-size: 1.6rem;
    text-align: center;
    margin-bottom: 8px;
}

.auth-card .subtitle {
    text-align: center;
    color: var(--text-muted);
    margin-bottom: 28px;
    font-size: .9rem;
}

/* Layout */
.layout { display: flex; min-height: 100vh; }

.sidebar {
    width: var(--sidebar-w);
    background: #1e293b;
    color: #cbd5e1;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0; left: 0; bottom: 0;
    z-index: 100;
}

.sidebar-brand {
    padding: 24px 20px;
    font-size: 1.1rem;
    font-weight: 700;
    color: #fff;
    border-bottom: 1px solid #334155;
}

.sidebar-nav { flex: 1; padding: 12px 0; overflow-y: auto; }

.nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 11px 20px;
    color: #94a3b8;
    cursor: pointer;
    transition: all .2s;
    border: none;
    background: none;
    width: 100%;
    text-align: left;
    font-size: .9rem;
    text-decoration: none;
    box-sizing: border-box;
}

.nav-item:hover, .nav-item.active {
    background: #334155;
    color: #fff;
}

.nav-item.active { border-left: 3px solid var(--primary); }

.nav-item .nav-icon { width: 18px; text-align: center; flex-shrink: 0; }
.nav-item .nav-label { flex: 1; }
.nav-item .nav-arrow { font-size: .7rem; transition: transform .2s; }

.nav-group-toggle {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
}

.nav-group.open .nav-group-toggle {
    background: rgba(239, 68, 68, 0.12);
    color: #fca5a5;
    border-left: 3px solid #ef4444;
}

.nav-group.open .nav-arrow { transform: rotate(180deg); }

.nav-submenu {
    display: none;
    background: #fff;
    margin: 0 8px 8px;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: inset 0 0 0 1px rgba(255,255,255,.08);
}

.nav-group.open .nav-submenu { display: block; }

.nav-subitem {
    display: block;
    padding: 11px 16px 11px 20px;
    color: #475569;
    font-size: .875rem;
    text-decoration: none;
    transition: all .15s;
    border-bottom: 1px solid #f1f5f9;
}

.nav-subitem:last-child { border-bottom: none; }

.nav-subitem:hover { background: #f8fafc; color: #1e293b; }

.nav-subitem.active {
    color: var(--primary);
    font-weight: 600;
    background: #eef2ff;
}

/* ========== 控制台页面（1:1 参考样式） ========== */
.dashboard-page {
    font-family: 'Microsoft YaHei', 'PingFang SC', -apple-system, BlinkMacSystemFont, sans-serif;
    color: #333;
}

.dash-top-cards {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 18px;
    margin-bottom: 18px;
}

.dash-stat-card {
    background: #fff;
    border: 1px solid #e8e8e8;
    border-radius: 4px;
    padding: 18px 20px 16px;
    min-height: 130px;
    position: relative;
    box-shadow: 0 1px 2px rgba(0, 0, 0, .04);
}

.dash-stat-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 14px;
    min-height: 22px;
}

.dash-stat-title {
    font-size: 14px;
    color: #666;
    font-weight: 400;
}

.dash-tag {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 3px;
    font-size: 12px;
    color: #fff;
    line-height: 1.6;
    font-weight: 400;
}

.dash-tag-blue  { background: #5dade2; }
.dash-tag-teal  { background: #48c9b0; }
.dash-tag-pink  { background: #f1948a; }

.dash-stat-main {
    font-size: 15px;
    color: #333;
    font-weight: 400;
    line-height: 1.5;
    margin-bottom: 6px;
}

.dash-stat-sub {
    font-size: 13px;
    color: #999;
    line-height: 1.5;
}

.dash-stat-key {
    color: #666;
    word-break: break-all;
    padding-right: 80px;
}

.dash-stat-foot {
    position: absolute;
    right: 16px;
    bottom: 14px;
}

.dash-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 12px;
    border-radius: 3px;
    font-size: 13px;
    font-family: inherit;
    cursor: pointer;
    background: #fff;
    text-decoration: none;
    line-height: 1.5;
    transition: opacity .2s;
    white-space: nowrap;
}

.dash-btn:hover { opacity: .85; text-decoration: none; }

.dash-btn-blue {
    color: #3498db;
    border: 1px solid #3498db;
}

.dash-btn-teal {
    color: #1abc9c;
    border: 1px solid #1abc9c;
}

.dash-btn-pink {
    color: #e74c3c;
    border: 1px solid #e74c3c;
}

.dash-btn-sm {
    padding: 3px 10px;
    font-size: 12px;
}

.dash-btn-icon {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
}

/* 主区域网格 */
.dash-main-grid {
    display: grid;
    grid-template-columns: 1fr 360px;
    gap: 18px;
    align-items: start;
}

/* 已授权系统面板 */
.dash-auth-panel {
    background: #fff;
    border: 1px solid #e8e8e8;
    border-radius: 4px;
    overflow: hidden;
    box-shadow: 0 1px 2px rgba(0, 0, 0, .04);
}

.dash-auth-header {
    background: #1abc9c;
    color: #fff;
    padding: 12px 18px;
    font-size: 15px;
    font-weight: 400;
    letter-spacing: .5px;
}

.dash-key-bar {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 12px 18px;
    background: #fff;
    border-bottom: 1px solid #eee;
    flex-wrap: wrap;
    font-size: 13px;
}

.dash-key-label {
    color: #666;
    flex-shrink: 0;
}

.dash-key-value {
    color: #3498db;
    word-break: break-all;
    flex: 1;
    font-family: Consolas, 'Courier New', monospace;
    font-size: 13px;
}

.dash-key-bar .dash-btn {
    margin-left: auto;
    flex-shrink: 0;
}

.dash-table-wrap {
    overflow-x: auto;
}

.dash-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.dash-table th {
    background: #fafafa;
    color: #666;
    font-weight: 400;
    padding: 11px 14px;
    text-align: left;
    border-bottom: 1px solid #eee;
    white-space: nowrap;
}

.dash-table td {
    padding: 12px 14px;
    border-bottom: 1px solid #f0f0f0;
    color: #333;
    vertical-align: middle;
}

.dash-table tbody tr:last-child td {
    border-bottom: none;
}

.dash-table tbody tr:hover td {
    background: #fafafa;
}

.dash-td-code {
    word-break: break-all;
}

.dash-empty {
    padding: 40px 18px;
    text-align: center;
    color: #999;
    font-size: 14px;
}

/* 公告侧栏 */
.dash-notice-panel {
    background: #fff;
    border: 1px solid #e8e8e8;
    border-radius: 4px;
    overflow: hidden;
    box-shadow: 0 1px 2px rgba(0, 0, 0, .04);
}

.dash-notice-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    font-size: 14px;
    color: #333;
    border-bottom: 1px solid #f0f0f0;
}

.dash-notice-arrow {
    color: #ccc;
    font-size: 18px;
    line-height: 1;
}

.dash-notice-list {
    padding: 10px 12px;
}

.dash-notice-item {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    padding: 10px 12px;
    margin-bottom: 8px;
    border: 1px solid #eee;
    border-radius: 3px;
    background: #fafafa;
    font-size: 13px;
    line-height: 1.6;
}

.dash-notice-item:last-child {
    margin-bottom: 0;
}

.dash-notice-icon {
    flex-shrink: 0;
    font-size: 14px;
    line-height: 1.6;
}

.dash-notice-text {
    flex: 1;
    color: #555;
    word-break: break-all;
}

.dash-notice-date {
    flex-shrink: 0;
    color: #c0392b;
    font-size: 12px;
    white-space: nowrap;
    margin-left: 4px;
}

.dash-notice-empty {
    padding: 30px 16px;
    text-align: center;
    color: #999;
    font-size: 13px;
}

/* 控制台页 content 区域背景 */
body.page-dashboard .content {
    background: #f0f2f5;
    padding: 20px 24px;
}

body.page-dashboard .topbar {
    background: #fff;
    border-bottom: 1px solid #e8e8e8;
}

@media (max-width: 1200px) {
    .dash-main-grid { grid-template-columns: 1fr; }
}

@media (max-width: 900px) {
    .dash-top-cards { grid-template-columns: 1fr; }
    .dash-stat-foot { position: static; margin-top: 12px; text-align: right; }
    .dash-stat-key { padding-right: 0; }
}


.sidebar-footer {
    padding: 16px 20px;
    border-top: 1px solid #334155;
    font-size: .85rem;
}

.main {
    margin-left: var(--sidebar-w);
    flex: 1;
    display: flex;
    flex-direction: column;
}

.topbar {
    background: var(--card);
    padding: 16px 28px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 50;
}

.topbar h2 { font-size: 1.2rem; font-weight: 600; }

.content { padding: 28px; flex: 1; }

/* Cards */
.card {
    background: var(--card);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 24px;
    margin-bottom: 20px;
}

.card-title {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border);
}

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

.stat-card {
    background: var(--card);
    border-radius: var(--radius);
    padding: 20px;
    box-shadow: var(--shadow);
}

.stat-card .label { font-size: .85rem; color: var(--text-muted); }
.stat-card .value { font-size: 1.8rem; font-weight: 700; margin-top: 4px; }
.stat-card .value.primary { color: var(--primary); }
.stat-card .value.success { color: var(--success); }
.stat-card .value.warning { color: var(--warning); }

/* Forms */
.form-group { margin-bottom: 16px; }
.form-group label { display: block; font-size: .875rem; font-weight: 500; margin-bottom: 6px; }

.form-control {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: .9rem;
    transition: border-color .2s;
    background: #fff;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(79,70,229,.12);
}

.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

select.form-control { cursor: pointer; }

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    font-size: .9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all .2s;
}

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

.btn-success { background: var(--success); color: #fff; }
.btn-success:hover { background: #059669; }

.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: #dc2626; }

.btn-outline {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text);
}
.btn-outline:hover { background: var(--bg); }

.btn-sm { padding: 6px 12px; font-size: .8rem; }
.btn-block { width: 100%; }

.btn:disabled { opacity: .6; cursor: not-allowed; }

/* Table */
.table-wrap { overflow-x: auto; }

table {
    width: 100%;
    border-collapse: collapse;
    font-size: .875rem;
}

th, td {
    padding: 12px 14px;
    text-align: left;
    border-bottom: 1px solid var(--border);
}

th { font-weight: 600; color: var(--text-muted); background: #f8fafc; }
tr:hover td { background: #f8fafc; }

/* Badge */
.badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: .75rem;
    font-weight: 500;
}

.badge-success { background: #d1fae5; color: #065f46; }
.badge-danger { background: #fee2e2; color: #991b1b; }
.badge-warning { background: #fef3c7; color: #92400e; }
.badge-info { background: #dbeafe; color: #1e40af; }

/* Machine code box */
.machine-box {
    background: #f8fafc;
    border: 2px dashed var(--border);
    border-radius: var(--radius);
    padding: 20px;
    text-align: center;
}

.machine-code {
    font-family: 'Courier New', monospace;
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--primary);
    letter-spacing: 1px;
    word-break: break-all;
    margin: 12px 0;
    padding: 12px;
    background: #fff;
    border-radius: 8px;
    border: 1px solid var(--border);
}

/* Package cards */
.package-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 16px;
}

.package-card {
    border: 2px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
    cursor: pointer;
    transition: all .2s;
    position: relative;
}

.package-card:hover { border-color: var(--primary); }
.package-card.selected { border-color: var(--primary); background: #eef2ff; }

.package-card .price {
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--primary);
}

.package-card .duration { color: var(--text-muted); font-size: .85rem; }

/* Announcement */
.announcement-item {
    padding: 14px 0;
    border-bottom: 1px solid var(--border);
}

.announcement-item:last-child { border-bottom: none; }
.announcement-item .title { font-weight: 600; }
.announcement-item .time { font-size: .8rem; color: var(--text-muted); }
.announcement-item .content { margin-top: 6px; color: var(--text-muted); font-size: .9rem; }

/* Toast */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.toast {
    padding: 12px 20px;
    border-radius: 8px;
    color: #fff;
    font-size: .9rem;
    box-shadow: 0 4px 12px rgba(0,0,0,.15);
    animation: slideIn .3s ease;
    max-width: 360px;
}

.toast-success, .toast-success.toast { background: var(--success); }
.toast-error, .toast-error.toast { background: var(--danger); }
.toast-info, .toast-info.toast { background: var(--primary); }

@keyframes slideIn {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

/* Modal */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.45);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 20px;
}

.modal {
    background: var(--card);
    border-radius: 12px;
    padding: 28px;
    width: 100%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
}

.modal h3 { margin-bottom: 20px; }

.modal-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 20px;
}

/* 机器码授权弹窗 */
.auth-modal {
    background: #fff;
    border-radius: 4px;
    width: 100%;
    max-width: 680px;
    max-height: 90vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 8px 32px rgba(0,0,0,.18);
    border: 1px solid #e2e8f0;
}

.auth-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 20px;
    border-bottom: 1px solid #e2e8f0;
    background: #fafafa;
}

.auth-modal-header h3 {
    font-size: 1rem;
    font-weight: 600;
    margin: 0;
}

.auth-modal-close {
    background: none;
    border: none;
    font-size: 1.4rem;
    color: #94a3b8;
    cursor: pointer;
    line-height: 1;
    padding: 0 4px;
}

.auth-modal-close:hover { color: #475569; }

.auth-modal-body {
    padding: 24px 28px;
    overflow-y: auto;
    flex: 1;
}

.auth-form-row {
    display: flex;
    align-items: flex-start;
    margin-bottom: 20px;
}

.auth-form-label {
    width: 100px;
    flex-shrink: 0;
    text-align: right;
    padding-top: 10px;
    font-size: .9rem;
    color: #475569;
    padding-right: 12px;
}

.auth-form-label .required { color: #ef4444; margin-right: 2px; }

.auth-form-field { flex: 1; min-width: 0; }

.auth-form-field .form-control.readonly,
.auth-form-field .form-control[readonly] {
    background: #f1f5f9;
    color: #64748b;
}

.auth-warn-box {
    background: #fffbeb;
    border: 1px solid #fde68a;
    color: #92400e;
    padding: 10px 14px;
    border-radius: 4px;
    font-size: .85rem;
    line-height: 1.6;
    margin-bottom: 10px;
}

.auth-token-area {
    font-family: 'Courier New', monospace;
    font-size: .8rem;
    line-height: 1.5;
    resize: vertical;
    min-height: 120px;
    word-break: break-all;
}

.auth-modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 14px 20px;
    border-top: 1px solid #e2e8f0;
    background: #fafafa;
}

.mb-2 { margin-bottom: 8px; }

/* 授权代码 SDK 页面 */
.sdk-info-grid { display: flex; flex-direction: column; gap: 12px; }
.sdk-info-item { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-size: .9rem; }
.sdk-info-item .label { color: var(--text-muted); min-width: 70px; }
.sdk-code-inline { background: #f8fafc; padding: 6px 10px; border-radius: 6px; font-size: .85rem; word-break: break-all; }
.sdk-pre {
    background: #1e293b; color: #e2e8f0; padding: 16px 20px; border-radius: 8px;
    font-size: .8rem; line-height: 1.6; overflow-x: auto; max-height: 480px;
    font-family: Consolas, 'Courier New', monospace; white-space: pre-wrap; word-break: break-all;
}
.sdk-tabs { display: flex; gap: 8px; margin-bottom: 12px; }
.sdk-tab {
    padding: 8px 18px; border: 1px solid var(--border); background: #fff;
    border-radius: 6px; cursor: pointer; font-size: .875rem;
}
.sdk-tab.active { background: var(--primary); color: #fff; border-color: var(--primary); }
.sdk-code-block { margin-top: 0; }
.sdk-steps { padding-left: 24px; line-height: 2; color: var(--text-muted); font-size: .9rem; }
.sdk-steps code { background: #f1f5f9; padding: 2px 6px; border-radius: 4px; }
.mt-2 { margin-top: 8px; }

.hidden { display: none !important; }

.text-center { text-align: center; }
.text-muted { color: var(--text-muted); }
.text-sm { font-size: .85rem; }
.mt-2 { margin-top: 8px; }
.mt-3 { margin-top: 16px; }
.mb-3 { margin-bottom: 16px; }

.copy-btn { cursor: pointer; color: var(--primary); font-size: .8rem; }
.copy-btn:hover { text-decoration: underline; }

.pagination {
    display: flex;
    gap: 8px;
    justify-content: center;
    margin-top: 16px;
}

/* ========== 管理后台侧边栏 ========== */
body.layout-admin {
    --sidebar-w: 260px;
    --sidebar-mini-w: 78px;
    --admin-accent: #3b82f6;
    --admin-accent-soft: rgba(59, 130, 246, 0.15);
}

.sidebar-admin {
    background: linear-gradient(180deg, #0b1220 0%, #111827 42%, #0f172a 100%);
    border-right: 1px solid rgba(148, 163, 184, 0.08);
    box-shadow: 4px 0 24px rgba(0, 0, 0, 0.18);
    overflow: hidden;
    transition: width 0.28s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.28s ease;
    width: var(--sidebar-w);
}

body.layout-admin .main {
    transition: margin-left 0.28s cubic-bezier(0.4, 0, 0.2, 1);
}

body.layout-admin.sidebar-mini {
    --sidebar-w: var(--sidebar-mini-w);
}

body.layout-admin.sidebar-mini .sidebar-admin {
    box-shadow: 2px 0 16px rgba(0, 0, 0, 0.12);
}

body.layout-admin.sidebar-mini .sidebar-admin-brand {
    justify-content: center;
    padding: 16px 0;
    gap: 0;
}

body.layout-admin.sidebar-mini .sidebar-admin-search-wrap,
body.layout-admin.sidebar-mini .sidebar-admin-nav-empty,
body.layout-admin.sidebar-mini .sidebar-nav-section-title,
body.layout-admin.sidebar-mini .sidebar-admin-user-meta,
body.layout-admin.sidebar-mini .sidebar-admin-logout {
    display: none !important;
}

body.layout-admin.sidebar-mini .sidebar-admin-nav {
    padding: 8px 0 14px;
}

body.layout-admin.sidebar-mini .sidebar-nav-section {
    margin-bottom: 8px;
    padding: 0 11px;
}

body.layout-admin.sidebar-mini .sidebar-admin-nav-group {
    margin-bottom: 4px;
}

body.layout-admin.sidebar-mini .sidebar-admin-item,
body.layout-admin.sidebar-mini .sidebar-admin-group-toggle {
    justify-content: center;
    align-items: center;
    padding: 6px 0;
    margin-left: 0;
    margin-right: 0;
    gap: 0;
    transform: none !important;
}

body.layout-admin.sidebar-mini .sidebar-admin-item:hover,
body.layout-admin.sidebar-mini .sidebar-admin-item.active,
body.layout-admin.sidebar-mini .sidebar-admin-group-toggle:hover,
body.layout-admin.sidebar-mini .sidebar-admin-group-toggle.active {
    transform: none !important;
}

body.layout-admin.sidebar-mini .sidebar-admin-item .nav-label,
body.layout-admin.sidebar-mini .sidebar-admin-item .sidebar-admin-arrow,
body.layout-admin.sidebar-mini .sidebar-admin-item .sidebar-admin-indicator,
body.layout-admin.sidebar-mini .sidebar-admin-brand-text {
    display: none !important;
    width: 0 !important;
    height: 0 !important;
    max-width: 0 !important;
    flex: 0 0 0 !important;
    overflow: hidden;
    margin: 0 !important;
    padding: 0 !important;
    opacity: 0;
    pointer-events: none;
}

body.layout-admin.sidebar-mini .sidebar-admin-logo {
    width: 36px;
    height: 36px;
    margin: 0 auto;
    flex-shrink: 0;
}

body.layout-admin.sidebar-mini .sidebar-admin-logo svg {
    width: 18px;
    height: 18px;
}

body.layout-admin.sidebar-mini .sidebar-admin-icon {
    width: 36px;
    height: 36px;
    margin: 0 auto;
    flex-shrink: 0;
    border-radius: 9px;
}

body.layout-admin.sidebar-mini .sidebar-admin-icon svg {
    width: 17px;
    height: 17px;
    display: block;
}

body.layout-admin.sidebar-mini .sidebar-admin-submenu {
    display: none !important;
}

body.layout-admin.sidebar-mini .sidebar-admin-user {
    justify-content: center;
}

body.layout-admin.sidebar-mini .sidebar-admin-avatar {
    width: 36px;
    height: 36px;
    margin: 0 auto;
    border-radius: 9px;
}

body.layout-admin.sidebar-mini .sidebar-admin-footer {
    padding: 14px 11px 16px;
}

body.layout-admin:not(.sidebar-mini) .sidebar-admin-brand-text,
body.layout-admin:not(.sidebar-mini) .nav-label,
body.layout-admin:not(.sidebar-mini) .sidebar-admin-arrow,
body.layout-admin:not(.sidebar-mini) .sidebar-admin-indicator,
body.layout-admin:not(.sidebar-mini) .sidebar-nav-section-title {
    opacity: 1;
    max-width: 220px;
    transition: opacity 0.28s ease, max-width 0.28s ease, transform 0.28s ease;
}

body.layout-admin.sidebar-mini .sidebar-admin-brand-text,
body.layout-admin.sidebar-mini .nav-label {
    transform: translateX(-6px);
}

body.layout-admin:not(.sidebar-mini) .nav-label,
body.layout-admin:not(.sidebar-mini) .sidebar-admin-brand-text {
    transform: translateX(0);
}

.sidebar-admin-brand-text,
.nav-label,
.sidebar-admin-arrow,
.sidebar-admin-indicator,
.sidebar-nav-section-title {
    transition: opacity 0.28s ease, max-width 0.28s ease, transform 0.28s ease;
    white-space: nowrap;
}

.sidebar-admin::before {
    content: '';
    position: absolute;
    top: -80px;
    right: -60px;
    width: 180px;
    height: 180px;
    background: radial-gradient(circle, rgba(59, 130, 246, 0.22) 0%, transparent 70%);
    pointer-events: none;
}

.sidebar-admin::after {
    content: '';
    position: absolute;
    bottom: 120px;
    left: -40px;
    width: 140px;
    height: 140px;
    background: radial-gradient(circle, rgba(99, 102, 241, 0.12) 0%, transparent 70%);
    pointer-events: none;
}

.sidebar-admin-brand {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 22px 18px;
    border-bottom: 1px solid rgba(148, 163, 184, 0.1);
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.08) 0%, transparent 60%);
    transition: padding 0.28s ease, justify-content 0.28s ease;
}

.sidebar-admin-logo {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #3b82f6 0%, #6366f1 100%);
    box-shadow: 0 8px 20px rgba(59, 130, 246, 0.35);
    flex-shrink: 0;
    animation: adminLogoPulse 3s ease-in-out infinite;
}

.sidebar-admin-logo svg {
    width: 22px;
    height: 22px;
    color: #fff;
}

.sidebar-admin-brand-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.sidebar-admin-brand-text strong {
    font-size: 1.05rem;
    font-weight: 700;
    color: #f8fafc;
    letter-spacing: 0.02em;
}

.sidebar-admin-brand-text span {
    font-size: 0.68rem;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.sidebar-admin-nav {
    position: relative;
    z-index: 1;
    padding: 14px 12px 18px;
    scrollbar-width: thin;
    scrollbar-color: rgba(148, 163, 184, 0.25) transparent;
}

.sidebar-admin-nav::-webkit-scrollbar { width: 4px; }
.sidebar-admin-nav::-webkit-scrollbar-thumb {
    background: rgba(148, 163, 184, 0.25);
    border-radius: 4px;
}

.sidebar-admin-search-wrap {
    margin-bottom: 14px;
    padding: 0 2px;
}

.sidebar-admin-search {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0 12px;
    height: 38px;
    border-radius: 10px;
    background: rgba(15, 23, 42, 0.72);
    border: 1px solid rgba(148, 163, 184, 0.14);
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.sidebar-admin-search:focus-within {
    border-color: rgba(59, 130, 246, 0.45);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.12);
    background: rgba(15, 23, 42, 0.92);
}

.sidebar-admin-search-icon {
    width: 16px;
    height: 16px;
    color: #64748b;
    flex-shrink: 0;
    transition: color 0.2s ease;
}

.sidebar-admin-search:focus-within .sidebar-admin-search-icon {
    color: #60a5fa;
}

.sidebar-admin-search input {
    flex: 1;
    min-width: 0;
    border: none;
    outline: none;
    background: transparent;
    color: #e2e8f0;
    font-size: 0.84rem;
}

.sidebar-admin-search input::placeholder {
    color: #64748b;
}

.sidebar-admin-search input::-webkit-search-cancel-button {
    display: none;
}

.sidebar-admin-search-clear {
    width: 22px;
    height: 22px;
    border: none;
    border-radius: 6px;
    background: rgba(148, 163, 184, 0.12);
    color: #94a3b8;
    font-size: 1rem;
    line-height: 1;
    cursor: pointer;
    flex-shrink: 0;
    transition: background 0.2s ease, color 0.2s ease;
}

.sidebar-admin-search-clear:hover {
    background: rgba(239, 68, 68, 0.18);
    color: #fca5a5;
}

.sidebar-admin-search-status {
    min-height: 16px;
    margin-top: 6px;
    padding: 0 4px;
    font-size: 0.68rem;
    color: #475569;
}

.sidebar-admin-nav-empty {
    margin: 0 2px 12px;
    padding: 14px 12px;
    border-radius: 10px;
    text-align: center;
    font-size: 0.82rem;
    color: #64748b;
    background: rgba(15, 23, 42, 0.55);
    border: 1px dashed rgba(148, 163, 184, 0.16);
}

.sidebar-nav-section.is-hidden,
.sidebar-admin-item.is-hidden,
.sidebar-admin-nav-group.is-hidden,
.sidebar-admin-subitem.is-hidden {
    display: none !important;
}

.sidebar-admin-nav-group {
    margin-bottom: 4px;
}

.sidebar-admin-group-toggle {
    width: 100%;
    cursor: pointer;
}

.sidebar-admin-group-toggle .sidebar-admin-arrow {
    margin-left: auto;
    font-size: 0.72rem;
    color: #64748b;
    transition: transform 0.25s ease, color 0.2s ease;
    flex-shrink: 0;
}

.sidebar-admin-nav-group.open .sidebar-admin-arrow {
    transform: rotate(180deg);
    color: #93c5fd;
}

.sidebar-admin-submenu {
    display: none;
    margin: 2px 0 6px;
    padding: 4px 0 4px 8px;
}

.sidebar-admin-nav-group.open .sidebar-admin-submenu {
    display: block;
}

.sidebar-admin-subitem {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0 0 4px;
    padding: 8px 10px;
    border-radius: 8px;
    color: #94a3b8;
    font-size: 0.84rem;
    text-decoration: none;
    transition: color 0.2s ease, background 0.2s ease, transform 0.2s ease;
    opacity: 0;
    animation: adminNavFadeIn 0.35s ease forwards;
    animation-delay: calc(var(--nav-i, 1) * 0.03s);
}

.sidebar-admin-subicon {
    width: 28px;
    height: 28px;
    border-radius: 7px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(15, 23, 42, 0.45);
    border: 1px solid rgba(148, 163, 184, 0.1);
    flex-shrink: 0;
    transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.sidebar-admin-subicon svg {
    width: 14px;
    height: 14px;
}

.sidebar-admin-subitem .nav-label {
    flex: 1;
    min-width: 0;
    font-weight: 500;
}

.sidebar-admin-subitem:hover {
    color: #e2e8f0;
    background: rgba(148, 163, 184, 0.08);
    text-decoration: none;
    transform: translateX(3px);
}

.sidebar-admin-subitem:hover .sidebar-admin-subicon {
    border-color: rgba(59, 130, 246, 0.3);
    color: #93c5fd;
}

.sidebar-admin-subitem.active {
    color: #fff;
    background: linear-gradient(90deg, rgba(59, 130, 246, 0.18) 0%, rgba(59, 130, 246, 0.05) 100%);
    box-shadow: inset 0 0 0 1px rgba(59, 130, 246, 0.2);
}

.sidebar-admin-subitem.active .sidebar-admin-subicon {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.85) 0%, rgba(99, 102, 241, 0.85) 100%);
    border-color: transparent;
    color: #fff;
}

.user-level-badge {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 600;
}

.user-module-sync {
    font-size: 0.75rem;
    color: #64748b;
    font-weight: 400;
    margin-left: 8px;
}

.checkbox-label {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}

.sidebar-nav-section { margin-bottom: 18px; }

.sidebar-nav-section-title {
    padding: 0 12px 8px;
    font-size: 0.68rem;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: #475569;
}

.sidebar-admin-item {
    position: relative;
    margin: 0 0 4px;
    padding: 10px 12px;
    border-radius: 10px;
    color: #94a3b8;
    overflow: hidden;
    opacity: 0;
    animation: adminNavFadeIn 0.4s ease forwards;
    animation-delay: calc(var(--nav-i, 1) * 0.04s);
    border-left: none !important;
    transition: color 0.25s ease, transform 0.25s ease, background 0.25s ease, box-shadow 0.25s ease;
}

.sidebar-admin-item::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background: linear-gradient(90deg, rgba(59, 130, 246, 0.18) 0%, rgba(59, 130, 246, 0.04) 100%);
    opacity: 0;
    transition: opacity 0.25s ease;
}

.sidebar-admin-item:hover {
    color: #e2e8f0;
    transform: translateX(4px);
    background: rgba(148, 163, 184, 0.08);
    text-decoration: none;
}

.sidebar-admin-item:hover::before { opacity: 0.5; }

.sidebar-admin-item.active {
    color: #fff;
    background: linear-gradient(90deg, rgba(59, 130, 246, 0.22) 0%, rgba(59, 130, 246, 0.06) 100%);
    box-shadow: inset 0 0 0 1px rgba(59, 130, 246, 0.25), 0 4px 14px rgba(59, 130, 246, 0.12);
    transform: translateX(6px);
}

.sidebar-admin-item.active::before { opacity: 1; }

.sidebar-admin-icon {
    position: relative;
    z-index: 1;
    width: 34px;
    height: 34px;
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(15, 23, 42, 0.55);
    border: 1px solid rgba(148, 163, 184, 0.12);
    flex-shrink: 0;
    transition: background 0.25s ease, border-color 0.25s ease, transform 0.25s ease, box-shadow 0.25s ease;
}

.sidebar-admin-icon svg {
    width: 17px;
    height: 17px;
    display: block;
    flex-shrink: 0;
}

.sidebar-admin-item:hover .sidebar-admin-icon {
    border-color: rgba(59, 130, 246, 0.35);
    transform: scale(1.05);
}

.sidebar-admin-item.active .sidebar-admin-icon {
    background: linear-gradient(135deg, #3b82f6 0%, #6366f1 100%);
    border-color: transparent;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.4);
    color: #fff;
}

.sidebar-admin-item .nav-label {
    position: relative;
    z-index: 1;
    flex: 1;
    font-size: 0.88rem;
    font-weight: 500;
}

.sidebar-admin-indicator {
    position: relative;
    z-index: 1;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: transparent;
    flex-shrink: 0;
    transition: background 0.25s ease, box-shadow 0.25s ease, transform 0.25s ease;
}

.sidebar-admin-item.active .sidebar-admin-indicator {
    background: #60a5fa;
    box-shadow: 0 0 10px rgba(96, 165, 250, 0.9);
    animation: adminDotPulse 1.8s ease-in-out infinite;
}

.sidebar-admin-footer {
    position: relative;
    z-index: 1;
    padding: 16px 14px 18px;
    border-top: 1px solid rgba(148, 163, 184, 0.1);
    background: linear-gradient(180deg, transparent 0%, rgba(15, 23, 42, 0.65) 100%);
}

.sidebar-admin-user {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.sidebar-admin-avatar {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.95rem;
    font-weight: 700;
    color: #fff;
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    box-shadow: 0 6px 16px rgba(99, 102, 241, 0.35);
    flex-shrink: 0;
}

.sidebar-admin-user-meta {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.sidebar-admin-user-meta strong {
    color: #f1f5f9;
    font-size: 0.88rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar-admin-user-meta span {
    color: #64748b;
    font-size: 0.72rem;
}

.sidebar-admin-logout {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 10px 14px;
    border-radius: 10px;
    font-size: 0.84rem;
    color: #94a3b8;
    text-decoration: none;
    border: 1px solid rgba(148, 163, 184, 0.18);
    background: rgba(15, 23, 42, 0.45);
    transition: color 0.2s ease, border-color 0.2s ease, background 0.2s ease, transform 0.2s ease;
}

.sidebar-admin-logout svg {
    width: 16px;
    height: 16px;
}

.sidebar-admin-logout:hover {
    color: #fca5a5;
    border-color: rgba(248, 113, 113, 0.35);
    background: rgba(239, 68, 68, 0.12);
    transform: translateY(-1px);
    text-decoration: none;
}

.topbar-admin {
    background: linear-gradient(90deg, #ffffff 0%, #f8fafc 100%);
}

.topbar-admin-left {
    display: flex;
    align-items: center;
    gap: 14px;
    min-width: 0;
}

.topbar-admin-left h2 {
    margin: 0;
}

.topbar-admin-toggle {
    width: 38px;
    height: 38px;
    padding: 0;
    border: 1px solid rgba(148, 163, 184, 0.22);
    border-radius: 10px;
    background: rgba(248, 250, 252, 0.95);
    cursor: pointer;
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    flex-shrink: 0;
    transition: background 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.topbar-admin-toggle span {
    display: block;
    width: 18px;
    height: 2px;
    border-radius: 2px;
    background: #475569;
    transition: transform 0.25s ease, opacity 0.25s ease, width 0.25s ease;
}

.topbar-admin-toggle:hover {
    background: #fff;
    border-color: rgba(99, 102, 241, 0.28);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.12);
}

.topbar-admin-toggle:hover span {
    background: #334155;
}

.topbar-admin-toggle.is-active {
    background: rgba(99, 102, 241, 0.1);
    border-color: rgba(99, 102, 241, 0.28);
}

.topbar-admin-toggle.is-active span:nth-child(1) {
    transform: translateY(6px) rotate(45deg);
}

.topbar-admin-toggle.is-active span:nth-child(2) {
    opacity: 0;
    width: 0;
}

.topbar-admin-toggle.is-active span:nth-child(3) {
    transform: translateY(-6px) rotate(-45deg);
}

body.layout-admin:not(.sidebar-mini) .topbar-admin-toggle:not(.is-active) {
    background: rgba(59, 130, 246, 0.08);
    border-color: rgba(59, 130, 246, 0.22);
}

.topbar-admin-badge {
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #6366f1;
    background: rgba(99, 102, 241, 0.1);
    padding: 6px 12px;
    border-radius: 999px;
    border: 1px solid rgba(99, 102, 241, 0.15);
}

@keyframes adminNavFadeIn {
    from { opacity: 0; transform: translateX(-10px); }
    to { opacity: 1; transform: translateX(0); }
}

@keyframes adminLogoPulse {
    0%, 100% { box-shadow: 0 8px 20px rgba(59, 130, 246, 0.35); }
    50% { box-shadow: 0 8px 28px rgba(59, 130, 246, 0.55); }
}

@keyframes adminDotPulse {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.35); opacity: 0.75; }
}

/* ========== 可视化大数据 ========== */
.bigdata-page {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.bigdata-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
}

.bigdata-title {
    font-size: 1.15rem;
    font-weight: 700;
    color: #0f172a;
    margin: 0 0 4px;
}

.bigdata-sub {
    margin: 0;
    font-size: 0.88rem;
    color: #64748b;
}

.bigdata-sync {
    font-size: 0.78rem;
    color: #6366f1;
    background: rgba(99, 102, 241, 0.08);
    border: 1px solid rgba(99, 102, 241, 0.15);
    padding: 6px 12px;
    border-radius: 999px;
    white-space: nowrap;
}

.bigdata-kpi-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
}

.bigdata-kpi {
    background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    padding: 18px 20px;
    box-shadow: 0 4px 16px rgba(15, 23, 42, 0.04);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.bigdata-kpi:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.08);
}

.bigdata-kpi-label {
    font-size: 0.82rem;
    color: #64748b;
}

.bigdata-kpi-value {
    margin-top: 8px;
    font-size: 1.75rem;
    font-weight: 700;
    color: #0f172a;
    line-height: 1.2;
}

.bigdata-kpi-value.primary { color: #4f46e5; }
.bigdata-kpi-value.success { color: #10b981; }
.bigdata-kpi-value.warning { color: #f59e0b; }

.bigdata-kpi-foot {
    margin-top: 8px;
    font-size: 0.75rem;
    color: #94a3b8;
}

.bigdata-charts-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

.bigdata-chart-card {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    padding: 18px;
    box-shadow: 0 4px 16px rgba(15, 23, 42, 0.04);
}

.bigdata-chart-wide {
    grid-column: span 2;
}

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

.bigdata-chart-head strong {
    font-size: 0.95rem;
    color: #1e293b;
}

.bigdata-chart-head span {
    font-size: 0.75rem;
    color: #94a3b8;
}

.bigdata-chart-body {
    position: relative;
    width: 100%;
}

.bigdata-donut-wrap {
    display: flex;
    align-items: center;
    gap: 12px;
}

.bigdata-donut-wrap canvas {
    flex: 1;
    min-width: 0;
}

.bigdata-donut-legend {
    flex: 0 0 120px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.bigdata-legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.78rem;
    color: #64748b;
}

.bigdata-legend-item strong {
    margin-left: auto;
    color: #1e293b;
}

.bigdata-legend-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

@media (max-width: 1100px) {
    .bigdata-kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .bigdata-chart-wide { grid-column: span 2; }
}

@media (max-width: 768px) {
    .bigdata-kpi-grid,
    .bigdata-charts-grid { grid-template-columns: 1fr; }
    .bigdata-chart-wide { grid-column: span 1; }
    .bigdata-donut-wrap { flex-direction: column; }
    .bigdata-donut-legend { flex: 1; width: 100%; }
}

@media (max-width: 768px) {
    .sidebar { transform: translateX(-100%); }
    .main { margin-left: 0; }
    .form-row { grid-template-columns: 1fr; }
    .stats-grid { grid-template-columns: 1fr 1fr; }
}

/* ========== 购买套餐页（套餐商城 1:1） ========== */
body.page-purchase .content {
    background: #f0f2f5;
    padding: 20px 24px;
}

.purchase-page {
    font-family: 'Microsoft YaHei', 'PingFang SC', -apple-system, sans-serif;
    color: #333;
    max-width: 1400px;
}

.purchase-section-label {
    font-size: 13px;
    color: #999;
    margin-bottom: 12px;
}

/* 余额卡片 */
.purchase-balance-card {
    background: #fff;
    border: 1px solid #e8e8e8;
    border-radius: 6px;
    padding: 18px 22px;
    margin-bottom: 18px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, .04);
}

.purchase-balance-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
}

.purchase-balance-value {
    font-size: 22px;
    color: #409eff;
    font-weight: 400;
}

.purchase-balance-value strong {
    font-weight: 700;
    font-size: 26px;
}

.purchase-recharge-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 8px 18px;
    background: #409eff;
    color: #fff;
    border-radius: 4px;
    font-size: 14px;
    text-decoration: none;
    white-space: nowrap;
    transition: background .2s;
}

.purchase-recharge-btn:hover {
    background: #66b1ff;
    color: #fff;
    text-decoration: none;
}

.purchase-recharge-icon {
    font-size: 16px;
    font-weight: 700;
    line-height: 1;
}

/* 套餐商城 */
.purchase-mall-section {
    background: #fff;
    border: 1px solid #e8e8e8;
    border-radius: 6px;
    padding: 18px 22px 22px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, .04);
}

.purchase-mall-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 16px;
}

.purchase-mall-head .purchase-section-label {
    margin-bottom: 0;
}

.purchase-system-filter {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.purchase-filter-btn {
    padding: 5px 14px;
    border: 1px solid #dcdfe6;
    background: #fff;
    border-radius: 4px;
    font-size: 13px;
    color: #606266;
    cursor: pointer;
    font-family: inherit;
}

.purchase-filter-btn:hover { border-color: #409eff; color: #409eff; }
.purchase-filter-btn.active {
    background: #409eff;
    border-color: #409eff;
    color: #fff;
}

.purchase-mall-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 18px;
}

@media (max-width: 1100px) {
    .purchase-mall-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 640px) {
    .purchase-mall-grid { grid-template-columns: 1fr; }
    .purchase-balance-value { font-size: 18px; }
    .purchase-balance-value strong { font-size: 22px; }
}

/* 套餐卡片 */
.purchase-package-card {
    border: 1px solid #e8e8e8;
    border-radius: 6px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    background: #fff;
    transition: box-shadow .2s;
}

.purchase-package-card:hover {
    box-shadow: 0 4px 16px rgba(64, 158, 255, .12);
}

.purchase-pkg-header {
    background: #409eff;
    color: #fff;
    padding: 12px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    min-height: 48px;
}

.purchase-pkg-name {
    font-size: 14px;
    font-weight: 400;
    flex: 1;
    line-height: 1.4;
}

.purchase-pkg-header-price {
    font-size: 15px;
    font-weight: 600;
    white-space: nowrap;
}

.purchase-pkg-body {
    padding: 14px 16px 12px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

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

.purchase-pkg-label { color: #999; }
.purchase-pkg-val { color: #333; text-align: right; max-width: 60%; word-break: break-all; }

.purchase-pkg-price-block {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 0 12px;
}

.purchase-pkg-price-label {
    font-size: 15px;
    color: #409eff;
    font-weight: 500;
}

.purchase-pkg-price-num {
    font-size: 22px;
    color: #409eff;
    font-weight: 700;
}

.purchase-pkg-desc {
    text-align: center;
    font-size: 12px;
    color: #999;
    line-height: 1.8;
    padding: 8px 4px;
    flex: 1;
    word-break: break-all;
}

.purchase-pkg-extra {
    text-align: center;
    font-size: 12px;
    color: #e6a23c;
    margin-bottom: 8px;
}

.purchase-buy-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    width: calc(100% - 32px);
    margin: 0 16px 16px;
    padding: 11px;
    background: #409eff;
    color: #fff;
    border: none;
    border-radius: 4px;
    font-size: 14px;
    cursor: pointer;
    font-family: inherit;
    transition: background .2s;
}

.purchase-buy-btn svg {
    width: 16px;
    height: 16px;
}

.purchase-buy-btn:hover { background: #66b1ff; }
.purchase-buy-btn:disabled { opacity: .6; cursor: not-allowed; }

.purchase-empty {
    grid-column: 1 / -1;
    text-align: center;
    padding: 60px 20px;
    color: #999;
    font-size: 14px;
}

/* 购买成功横幅 */
.purchase-success-banner {
    background: #f0f9eb;
    border: 1px solid #e1f3d8;
    border-radius: 6px;
    padding: 16px 20px;
    margin-bottom: 18px;
}

.purchase-success-title {
    color: #67c23a;
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 10px;
}

.purchase-success-row {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    font-size: 14px;
}

.purchase-success-row code {
    font-family: Consolas, monospace;
    background: #fff;
    padding: 4px 10px;
    border-radius: 4px;
    border: 1px solid #e1f3d8;
    word-break: break-all;
}

.purchase-copy-btn {
    padding: 4px 12px;
    border: 1px solid #67c23a;
    background: #fff;
    color: #67c23a;
    border-radius: 4px;
    font-size: 12px;
    cursor: pointer;
}

.purchase-success-meta {
    margin-top: 8px;
    font-size: 13px;
    color: #999;
}

/* 购买弹窗 */
.purchase-modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: rgba(0, 0, 0, .5);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.purchase-modal {
    background: #fff;
    border-radius: 6px;
    width: 100%;
    max-width: 480px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, .15);
    overflow: hidden;
}

.purchase-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid #eee;
}

.purchase-modal-header h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    color: #333;
}

.purchase-modal-close {
    background: none;
    border: none;
    font-size: 22px;
    color: #999;
    cursor: pointer;
    line-height: 1;
}

.purchase-modal-body { padding: 20px; }

.purchase-modal-row {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    font-size: 14px;
    border-bottom: 1px solid #f5f5f5;
}

.purchase-modal-label { color: #999; }
.purchase-modal-val { color: #333; text-align: right; max-width: 60%; word-break: break-all; }
.purchase-modal-price { color: #409eff; font-weight: 700; font-size: 18px; }

.purchase-modal-field {
    margin-top: 16px;
}

.purchase-modal-field label {
    display: block;
    font-size: 13px;
    color: #666;
    margin-bottom: 8px;
}

.purchase-modal-input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #dcdfe6;
    border-radius: 4px;
    font-size: 13px;
    font-family: Consolas, monospace;
    box-sizing: border-box;
}

.purchase-modal-input:focus {
    outline: none;
    border-color: #409eff;
}

.purchase-modal-msg {
    margin-top: 12px;
    padding: 8px 12px;
    border-radius: 4px;
    font-size: 13px;
    display: none;
}

.purchase-modal-msg.show { display: block; }
.purchase-modal-msg.error { background: #fef0f0; color: #f56c6c; border: 1px solid #fde2e2; }
.purchase-modal-msg.success { background: #f0f9eb; color: #67c23a; border: 1px solid #e1f3d8; }
.purchase-modal-msg.info { background: #ecf5ff; color: #409eff; border: 1px solid #d9ecff; }

.purchase-modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    padding: 14px 20px;
    border-top: 1px solid #eee;
}

.purchase-modal-cancel {
    padding: 9px 20px;
    border: 1px solid #dcdfe6;
    background: #fff;
    border-radius: 4px;
    font-size: 14px;
    cursor: pointer;
    color: #606266;
    font-family: inherit;
}

.purchase-modal-confirm {
    padding: 9px 20px;
    border: none;
    background: #409eff;
    color: #fff;
    border-radius: 4px;
    font-size: 14px;
    cursor: pointer;
    font-family: inherit;
}

.purchase-modal-confirm:hover { background: #66b1ff; }
.purchase-modal-confirm:disabled { opacity: .6; cursor: not-allowed; }

