*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-user-select: none;
    -moz-user-select: none;
    user-select: none;
}

input, textarea { user-select: text; -webkit-user-select: text; }

:root {
    --bg: #0a101c;
    --bg-white: rgba(12, 20, 36, 0.82);
    --bg-elevated: rgba(15, 23, 42, 0.92);
    --bg-secondary: rgba(15, 23, 42, 0.55);
    --bg-dark: #060a14;
    --surface: rgba(12, 20, 36, 0.82);
    --border: rgba(148, 163, 184, 0.16);
    --border-dark: rgba(255, 255, 255, 0.08);
    --primary: #3b82f6;
    --primary-dark: #2563eb;
    --primary-light: rgba(59, 130, 246, 0.14);
    --text: #e2e8f0;
    --text-light: #94a3b8;
    --text-muted: #64748b;
    --success: #10b981;
    --danger: #ef4444;
    --warning: #f59e0b;
    --glass-blur: blur(20px) saturate(140%);
    --card-border: 1px solid rgba(255, 255, 255, 0.08);
    --card-shadow: 0 0 0 1px rgba(255, 255, 255, 0.04) inset, 0 16px 48px rgba(0, 0, 0, 0.35);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg);
    color: var(--text);
    font-size: 14px;
    line-height: 1.5;
}

.hidden { display: none !important; }

/* ===== 启动加载 ===== */
.app-loading {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: #050a14;
    gap: 16px;
}

.app-loading p {
    color: var(--text-light);
    font-size: 14px;
}

.app-loading-spinner {
    width: 36px;
    height: 36px;
    border: 3px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: app-loading-spin 0.8s linear infinite;
}

@keyframes app-loading-spin {
    to { transform: rotate(360deg); }
}

/* ===== 登录页 ===== */
#login-page {
    position: relative;
    min-height: 100vh;
    overflow: hidden;
}

.login-bg {
    position: absolute;
    inset: 0;
    background: #050a14 url('login-bg.jpg') center/cover no-repeat;
    transform: scale(1.02);
}

.login-scrim {
    position: absolute;
    inset: 0;
    background:
        linear-gradient(105deg,
            rgba(5, 10, 20, 0.82) 0%,
            rgba(5, 10, 20, 0.45) 42%,
            rgba(5, 10, 20, 0.28) 62%,
            rgba(5, 10, 20, 0.62) 100%),
        linear-gradient(180deg, rgba(5, 10, 20, 0.35) 0%, transparent 35%, rgba(5, 10, 20, 0.5) 100%);
}

.login-container {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 48px;
    min-height: 100vh;
    width: 100%;
    max-width: 1280px;
    margin: 0 auto;
    padding: 48px clamp(24px, 6vw, 80px);
}

.login-brand {
    flex: 1;
    max-width: 520px;
    color: #fff;
}

.login-brand img {
    width: 88px;
    height: 88px;
    border-radius: 20px;
    margin-bottom: 32px;
    box-shadow:
        0 0 0 1px rgba(255, 255, 255, 0.14),
        0 16px 40px rgba(0, 0, 0, 0.4);
}

.login-brand h1 {
    font-size: clamp(28px, 4vw, 40px);
    font-weight: 600;
    margin-bottom: 14px;
    letter-spacing: 0.02em;
    line-height: 1.2;
    text-shadow: 0 2px 20px rgba(0, 0, 0, 0.45);
}

.login-brand p {
    font-size: 14px;
    font-weight: 400;
    letter-spacing: 0.32em;
    text-transform: uppercase;
    color: rgba(226, 232, 240, 0.78);
}

.login-panel {
    flex: 0 0 min(420px, 100%);
    display: flex;
    justify-content: flex-end;
}

.login-card {
    width: 100%;
    padding: 40px 36px 36px;
    background: rgba(8, 15, 30, 0.72);
    backdrop-filter: blur(20px) saturate(140%);
    -webkit-backdrop-filter: blur(20px) saturate(140%);
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    box-shadow:
        0 0 0 1px rgba(255, 255, 255, 0.04) inset,
        0 24px 64px rgba(0, 0, 0, 0.45);
}

.login-form-title {
    font-size: 22px;
    font-weight: 600;
    margin-bottom: 6px;
    color: #f8fafc;
    letter-spacing: -0.02em;
}

.login-form-desc {
    color: rgba(203, 213, 225, 0.82);
    margin-bottom: 28px;
    font-size: 14px;
}

#login-page .form-group label {
    color: rgba(226, 232, 240, 0.88);
}

#login-page .form-group input {
    background: rgba(15, 23, 42, 0.55);
    border: 1px solid rgba(148, 163, 184, 0.22);
    border-radius: 10px;
    padding: 13px 14px;
    color: #f8fafc;
}

#login-page .form-group input::placeholder {
    color: rgba(148, 163, 184, 0.65);
}

#login-page .form-group input:focus {
    border-color: rgba(96, 165, 250, 0.65);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.18);
    background: rgba(15, 23, 42, 0.72);
}

#login-page .login-submit {
    margin-top: 8px;
    padding: 13px 24px;
    border-radius: 10px;
    font-weight: 600;
    background: linear-gradient(135deg, #3b82f6 0%, #6366f1 100%);
    box-shadow: 0 8px 24px rgba(59, 130, 246, 0.35);
    border: none;
}

#login-page .login-submit:hover {
    background: linear-gradient(135deg, #2563eb 0%, #4f46e5 100%);
    box-shadow: 0 10px 28px rgba(59, 130, 246, 0.42);
    transform: translateY(-1px);
}

#login-page .error-message {
    color: #fca5a5;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: var(--text);
    margin-bottom: 8px;
}

.form-group input, .form-group select {
    width: 100%;
    padding: 12px 16px;
    font-size: 14px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: rgba(15, 23, 42, 0.55);
    color: var(--text);
    outline: none;
    transition: border 0.2s, box-shadow 0.2s;
}

.form-group input:focus, .form-group select:focus {
    border-color: rgba(96, 165, 250, 0.65);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.18);
    background: rgba(15, 23, 42, 0.72);
}

.form-group input::placeholder { color: var(--text-light); }

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

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    font-size: 14px;
    font-weight: 500;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
}

.btn svg { width: 18px; height: 18px; }
.btn-primary {
    background: linear-gradient(135deg, #3b82f6 0%, #6366f1 100%);
    color: #fff;
    box-shadow: 0 4px 14px rgba(59, 130, 246, 0.28);
}
.btn-primary:hover { background: linear-gradient(135deg, #2563eb 0%, #4f46e5 100%); }
.btn-secondary { background: rgba(15, 23, 42, 0.55); color: var(--text); border: 1px solid var(--border); }
.btn-secondary:hover { background: rgba(15, 23, 42, 0.78); border-color: rgba(148, 163, 184, 0.28); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: #dc2626; }
.btn-ghost { background: transparent; color: var(--text-light); padding: 8px 12px; }
.btn-ghost:hover { color: var(--text); background: rgba(255, 255, 255, 0.06); }
.btn-block { width: 100%; }
.btn-sm { padding: 8px 16px; font-size: 13px; }

.error-message { color: var(--danger); font-size: 13px; text-align: center; margin-top: 16px; }

.login-footer {
    margin-top: 24px;
    text-align: center;
}

.contact-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--text-light);
    text-decoration: none;
    font-size: 13px;
    padding: 8px 16px;
    border-radius: 6px;
    transition: all 0.2s;
}

.contact-link:hover {
    color: #0088cc;
    background: rgba(0, 136, 204, 0.08);
}

.contact-link svg { flex-shrink: 0; }

/* ===== 主界面 ===== */
#main-page { display: flex; min-height: 100vh; }

.sidebar {
    width: 260px;
    background: rgba(6, 10, 20, 0.94);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border-right: 1px solid var(--border-dark);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 10;
}

.sidebar-header {
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    border-bottom: 1px solid var(--border-dark);
}

.sidebar-logo { width: 38px; height: 38px; border-radius: 10px; flex-shrink: 0; }

.sidebar-brand { display: flex; flex-direction: column; overflow: hidden; }

.brand-name {
    font-size: 16px;
    font-weight: 600;
    color: #fff;
    line-height: 1.3;
}

.brand-slogan {
    font-size: 11px;
    color: rgba(148, 163, 184, 0.75);
    letter-spacing: 0.12em;
    white-space: nowrap;
}

.sidebar-nav { flex: 1; padding: 20px 16px; }

.nav-section { margin-bottom: 24px; }

.nav-section-title {
    font-size: 11px;
    font-weight: 600;
    color: rgba(100, 116, 139, 0.9);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    padding: 0 12px;
    margin-bottom: 10px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    color: rgba(148, 163, 184, 0.88);
    text-decoration: none;
    border-radius: 8px;
    margin-bottom: 4px;
    transition: all 0.2s;
    font-size: 14px;
    position: relative;
}

.nav-item svg { width: 20px; height: 20px; flex-shrink: 0; }
.nav-item:hover { color: #e2e8f0; background: rgba(255,255,255,0.05); }

.nav-item.active {
    color: #93c5fd;
    background: rgba(59, 130, 246, 0.12);
}

.nav-item.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 20px;
    background: linear-gradient(180deg, #60a5fa, #6366f1);
    border-radius: 0 3px 3px 0;
}

.nav-item.active svg { color: #93c5fd; }

.sidebar-footer { padding: 20px; border-top: 1px solid var(--border-dark); }

.user-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: rgba(255,255,255,0.05);
    border-radius: 10px;
    margin-bottom: 12px;
}

.user-avatar {
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, #3b82f6 0%, #6366f1 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-weight: 600;
    font-size: 14px;
}

.user-card span { color: #fff; font-size: 14px; }

#logout-btn {
    width: 100%;
    justify-content: center;
    background: rgba(255,255,255,0.05);
    color: #9ca3af;
    border: none;
    padding: 10px;
}

#logout-btn:hover { background: rgba(239,68,68,0.15); color: var(--danger); }

/* ===== 主内容 ===== */
.main-content {
    flex: 1;
    margin-left: 260px;
    padding: 32px;
    background: #050a14 url('login-bg.jpg') center/cover no-repeat fixed;
    position: relative;
}

.main-content::before {
    content: '';
    position: fixed;
    top: 0;
    left: 260px;
    right: 0;
    bottom: 0;
    background:
        linear-gradient(105deg,
            rgba(5, 10, 20, 0.88) 0%,
            rgba(5, 10, 20, 0.78) 45%,
            rgba(5, 10, 20, 0.82) 100%);
    z-index: 0;
}

.main-content > * {
    position: relative;
    z-index: 1;
}

.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 28px;
}

.page-header h2 { font-size: 22px; font-weight: 600; color: #f8fafc; }

.content-page { animation: fadeIn 0.2s ease; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

/* ===== 统计卡片 ===== */
.stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }

.stat-card {
    background: var(--bg-white);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border: var(--card-border);
    border-radius: 14px;
    padding: 24px;
    display: flex;
    align-items: center;
    gap: 18px;
    box-shadow: var(--card-shadow);
}

.stat-icon {
    width: 52px;
    height: 52px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.stat-icon svg { width: 24px; height: 24px; }
.stat-icon.blue { background: rgba(59, 130, 246, 0.15); color: #60a5fa; }
.stat-icon.green { background: rgba(16, 185, 129, 0.15); color: #34d399; }
.stat-icon.purple { background: rgba(139, 92, 246, 0.15); color: #a78bfa; }
.stat-icon.orange { background: rgba(245, 158, 11, 0.15); color: #fbbf24; }

.stat-info { display: flex; flex-direction: column; }
.stat-value { font-size: 28px; font-weight: 700; line-height: 1.2; color: #f8fafc; }
.stat-label { font-size: 14px; color: var(--text-light); margin-top: 4px; }

/* ===== 表格 ===== */
.table-container {
    background: var(--bg-white);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border: var(--card-border);
    border-radius: 14px;
    box-shadow: var(--card-shadow);
    overflow: hidden;
}

.data-table { width: 100%; border-collapse: collapse; }

.data-table th, .data-table td {
    padding: 16px 20px;
    text-align: left;
}

.data-table th {
    background: rgba(15, 23, 42, 0.65);
    font-size: 12px;
    font-weight: 600;
    color: var(--text-light);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.data-table td {
    border-top: 1px solid var(--border);
    font-size: 14px;
    color: var(--text);
}

.data-table tbody tr:hover { background: rgba(255, 255, 255, 0.03); }

.data-table code {
    font-family: 'SF Mono', Consolas, monospace;
    font-size: 12px;
    background: rgba(15, 23, 42, 0.55);
    padding: 4px 8px;
    border-radius: 4px;
    color: #93c5fd;
}

/* ===== 标签 ===== */
.badge {
    display: inline-block;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
}

.badge.active, .badge.online { background: rgba(16, 185, 129, 0.15); color: #34d399; }
.badge.disabled, .badge.offline { background: rgba(148, 163, 184, 0.12); color: #94a3b8; }
.badge.admin { background: rgba(139, 92, 246, 0.15); color: #a78bfa; }
.badge.user { background: rgba(59, 130, 246, 0.15); color: #60a5fa; }
.badge.expired { background: rgba(239, 68, 68, 0.15); color: #f87171; }
.badge.warning { background: rgba(245, 158, 11, 0.15); color: #fbbf24; }

/* ===== 操作按钮 ===== */
.action-btns { display: flex; gap: 8px; }

.action-btn {
    width: 34px;
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(15, 23, 42, 0.55);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text-light);
    cursor: pointer;
    transition: all 0.15s;
}

.action-btn:hover { border-color: var(--primary); color: #60a5fa; background: rgba(59, 130, 246, 0.1); }
.action-btn.danger:hover { border-color: var(--danger); color: #f87171; background: rgba(239, 68, 68, 0.12); }
.action-btn.warning:hover { border-color: #fbbf24; color: #fbbf24; background: rgba(245, 158, 11, 0.12); }
.action-btn.success:hover { border-color: #34d399; color: #34d399; background: rgba(16, 185, 129, 0.12); }
.action-btn svg { width: 16px; height: 16px; }

/* ===== 分页 ===== */
.pagination { display: flex; justify-content: center; gap: 6px; padding: 24px; }

.pagination button {
    min-width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(15, 23, 42, 0.55);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text);
    font-size: 14px;
    cursor: pointer;
    transition: all 0.15s;
}

.pagination button:hover:not(:disabled):not(.active) { border-color: var(--primary); color: #60a5fa; }
.pagination button.active { background: linear-gradient(135deg, #3b82f6 0%, #6366f1 100%); border-color: transparent; color: #fff; }
.pagination button:disabled { opacity: 0.4; cursor: not-allowed; }

/* ===== 弹窗 ===== */
.modal {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 20px;
}

.modal-overlay { position: absolute; inset: 0; background: rgba(0, 0, 0, 0.65); backdrop-filter: blur(4px); }

.modal-content {
    position: relative;
    background: var(--bg-elevated);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border: var(--card-border);
    border-radius: 16px;
    width: 100%;
    max-width: 460px;
    box-shadow: var(--card-shadow);
    animation: modalIn 0.2s ease;
}

.modal-small { max-width: 400px; }

@keyframes modalIn { from { opacity: 0; transform: scale(0.95); } to { opacity: 1; transform: scale(1); } }

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 24px;
    border-bottom: 1px solid var(--border);
}

.modal-header h3 { font-size: 18px; font-weight: 600; color: #f8fafc; }

.modal-close {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    color: var(--text-light);
    cursor: pointer;
    border-radius: 8px;
}

.modal-close:hover { background: rgba(255, 255, 255, 0.06); color: var(--text); }
.modal-close svg { width: 20px; height: 20px; }
.modal-content form { padding: 24px; }
.modal-content > p { padding: 24px; color: var(--text-light); }
.modal-footer { display: flex; justify-content: flex-end; gap: 12px; padding-top: 8px; }

/* ===== Toast ===== */
.toast {
    position: fixed;
    bottom: 32px;
    left: 50%;
    transform: translateX(-50%);
    padding: 14px 24px;
    background: var(--bg-dark);
    color: #fff;
    border-radius: 10px;
    font-size: 14px;
    box-shadow: 0 8px 30px rgba(0,0,0,0.2);
    z-index: 2000;
    animation: toastIn 0.25s ease;
}

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

@keyframes toastIn { from { opacity: 0; transform: translateX(-50%) translateY(12px); } to { opacity: 1; transform: translateX(-50%) translateY(0); } }

/* ===== 空状态 ===== */
.empty-state { text-align: center; padding: 60px 20px; color: var(--text-light); }
.empty-state svg { width: 56px; height: 56px; margin-bottom: 16px; opacity: 0.3; }
.empty-state p { font-size: 15px; }

/* ===== 设置页 ===== */
.settings-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
}

.settings-card {
    background: var(--bg-white);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border: var(--card-border);
    border-radius: 14px;
    padding: 28px;
    box-shadow: var(--card-shadow);
}

.settings-card h3 {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 8px;
    color: #f8fafc;
}

.settings-card > p {
    color: var(--text-light);
    font-size: 14px;
    margin-bottom: 24px;
}

.settings-card .form-group { margin-bottom: 18px; }
.settings-card .btn { margin-top: 8px; }

.info-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 0;
    border-bottom: 1px solid var(--border);
}

.info-row:last-child { border-bottom: none; }

.info-label {
    color: var(--text-light);
    font-size: 14px;
}

.info-value {
    font-size: 14px;
    font-weight: 500;
    color: var(--text);
}

.api-copy-row {
    margin-top: 16px;
}

.api-label {
    display: block;
    color: var(--text-light);
    font-size: 13px;
    margin-bottom: 8px;
}

.api-value-box {
    display: flex;
    align-items: center;
    gap: 12px;
    background: rgba(15, 23, 42, 0.55);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 12px 16px;
}

.api-value {
    flex: 1;
    font-family: monospace;
    font-size: 14px;
    color: #60a5fa;
    word-break: break-all;
    user-select: text;
}

.api-input {
    flex: 1;
    font-family: monospace;
    font-size: 14px;
    color: var(--text);
    background: transparent;
    border: none;
    outline: none;
    padding: 0;
}

.btn-copy {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    background: linear-gradient(135deg, #3b82f6 0%, #6366f1 100%);
    color: #fff;
    border: none;
    border-radius: 6px;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.btn-copy:hover {
    background: linear-gradient(135deg, #2563eb 0%, #4f46e5 100%);
}

.btn-copy svg {
    width: 14px;
    height: 14px;
}

/* ===== 响应式设计 ===== */

/* 移动端菜单按钮 */
.mobile-menu-btn {
    display: none;
    position: fixed;
    top: 16px;
    left: 16px;
    z-index: 1001;
    width: 44px;
    height: 44px;
    background: rgba(6, 10, 20, 0.94);
    border: 1px solid var(--border-dark);
    border-radius: 12px;
    color: #fff;
    cursor: pointer;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.35);
}

.mobile-menu-btn svg { width: 22px; height: 22px; }

/* 侧边栏遮罩层 */
.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 99;
}

/* 大屏幕 */
@media (min-width: 1201px) {
    .stats-grid { grid-template-columns: repeat(4, 1fr); }
}

/* 中等屏幕 */
@media (max-width: 1200px) {
    .stats-grid { grid-template-columns: repeat(2, 1fr); }
    .settings-container { grid-template-columns: 1fr; }
}

/* 平板 */
@media (max-width: 900px) {
    .login-container {
        flex-direction: column;
        justify-content: center;
        gap: 36px;
        padding: 40px 24px;
    }

    .login-brand {
        text-align: center;
        max-width: none;
    }

    .login-brand img {
        margin-bottom: 20px;
    }

    .login-panel {
        flex: none;
        width: 100%;
        max-width: 420px;
        justify-content: center;
    }

    .login-card {
        padding: 32px 28px 28px;
    }
    
    .sidebar { 
        width: 260px;
        transform: translateX(-100%);
        transition: transform 0.3s ease;
        z-index: 100;
    }
    
    .sidebar.open { transform: translateX(0); }
    .sidebar-overlay.show { display: block; }
    
    .mobile-menu-btn { display: flex; }
    
    .main-content { 
        margin-left: 0; 
        padding: 80px 20px 20px;
    }
    
    .main-content::before { left: 0; }
    
    .stats-grid { grid-template-columns: 1fr; gap: 16px; }
    
    .page-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 16px;
    }
    
    .page-header h2 { font-size: 20px; }
    
    /* 表格响应式 */
    .table-container { overflow-x: auto; }
    
    .data-table th, .data-table td { 
        padding: 12px;
        white-space: nowrap;
        min-width: 100px;
    }
    
    .data-table th:first-child,
    .data-table td:first-child { 
        position: sticky; 
        left: 0; 
        background: rgba(12, 20, 36, 0.95);
        z-index: 1;
    }
    
    .action-btns { flex-wrap: wrap; gap: 6px; }
    
    /* 弹窗适配 */
    .modal { padding: 16px; }
    .modal-content { max-width: 100%; border-radius: 12px; }
    .modal-header { padding: 20px; }
    .modal-content form { padding: 20px; }
    .form-row { grid-template-columns: 1fr; }
    
    /* 设置页 */
    .settings-card { padding: 20px; }
    .api-value-box { flex-direction: column; gap: 12px; align-items: stretch; }
    .btn-copy { justify-content: center; }
}

/* 小屏手机 */
@media (max-width: 480px) {
    .login-container { padding: 28px 18px; }
    .login-form-title { font-size: 20px; }
    
    .form-group input { padding: 14px 12px; font-size: 16px; }
    
    .btn { padding: 14px 20px; font-size: 15px; }
    
    .main-content { padding: 70px 16px 16px; }
    
    .stat-card { padding: 18px; gap: 14px; }
    .stat-icon { width: 46px; height: 46px; }
    .stat-icon svg { width: 20px; height: 20px; }
    .stat-value { font-size: 24px; }
    .stat-label { font-size: 13px; }
    
    .data-table th, .data-table td { 
        padding: 10px 8px;
        font-size: 13px;
    }
    
    .badge { padding: 4px 10px; font-size: 11px; }
    
    .action-btn { width: 32px; height: 32px; }
    .action-btn svg { width: 14px; height: 14px; }
    
    .pagination { gap: 4px; padding: 16px; }
    .pagination button { min-width: 32px; height: 32px; font-size: 13px; }
    
    .modal-header h3 { font-size: 16px; }
    .modal-close { width: 32px; height: 32px; }
    
    .settings-card h3 { font-size: 16px; }
    
    .toast { 
        left: 16px; 
        right: 16px; 
        transform: none;
        text-align: center;
    }
    
    @keyframes toastIn { 
        from { opacity: 0; transform: translateY(12px); } 
        to { opacity: 1; transform: translateY(0); } 
    }
}

/* ===== APK 构建页 ===== */
.main-content:has(#page-apk-builder:not(.hidden))::before {
    background:
        linear-gradient(105deg,
            rgba(5, 10, 20, 0.9) 0%,
            rgba(5, 10, 20, 0.82) 100%);
}

#page-apk-builder .page-header {
    background: transparent;
    box-shadow: none;
    padding-bottom: 8px;
    margin-bottom: 12px;
}

.apk-builder-shell {
    max-width: 1100px;
    margin: 0 auto;
}

.apk-builder-header {
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
}

.apk-builder-header-main {
    flex: 1;
    min-width: 200px;
}

.apk-builder-header-main h2 {
    margin-bottom: 0;
}

.page-subtitle {
    margin-top: 4px;
    font-size: 13px;
    color: var(--text-light);
}

.page-subtitle code {
    font-family: 'SF Mono', Consolas, monospace;
    font-size: 12px;
    background: rgba(15, 23, 42, 0.55);
    padding: 2px 6px;
    border-radius: 4px;
    color: #60a5fa;
}

.apk-builder-header-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

.apk-health-badge {
    min-width: 88px;
    text-align: center;
    white-space: nowrap;
}

.apk-builder-form {
    display: block;
}

.apk-builder-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 280px;
    gap: 16px;
    align-items: start;
}

.apk-builder-main {
    min-width: 0;
}

.apk-panel {
    background: var(--bg-white);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border: var(--card-border);
    border-radius: 10px;
    padding: 18px 20px;
    box-shadow: var(--card-shadow);
}

.apk-panel-form .form-group {
    margin-bottom: 0;
}

.apk-builder-sidebar {
    position: sticky;
    top: 20px;
}

.apk-sidebar-title {
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 14px;
    color: #f8fafc;
}

.apk-form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px 14px;
}

.apk-form-full {
    grid-column: 1 / -1;
}

.apk-form-grid-compact {
    gap: 10px 12px;
}

.apk-info-strip {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 16px;
    margin-top: 14px;
    padding: 12px 14px;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: var(--bg-secondary, #f8fafc);
}

.apk-info-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 180px;
    flex: 1;
}

.apk-info-label {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-muted, #6b7280);
}

.apk-info-item code {
    font-size: 13px;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    color: var(--text);
    word-break: break-all;
}

.apk-signing-ok {
    font-size: 13px;
    color: var(--success, #16a34a);
}

.apk-signing-missing {
    font-size: 13px;
    color: var(--warning, #d97706);
}

.apk-checkbox-inline-wrap {
    display: flex;
    align-items: stretch;
}

.apk-info-note {
    font-size: 11px;
    color: var(--text-muted, #6b7280);
    line-height: 1.4;
}

.apk-field-hint {
    display: block;
    margin-top: 4px;
    font-size: 11px;
    color: var(--text-muted, #6b7280);
}

.apk-hide-subpanel {
    margin-top: 10px;
    padding: 12px 14px 4px;
    border-radius: 10px;
    border: 1px dashed var(--border);
    background: var(--bg-secondary, #f8fafc);
}

.apk-subpanel-label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted, #6b7280);
    margin-bottom: 8px;
}

.apk-checkbox-group-compact {
    gap: 8px;
}

.apk-feature-fixed {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px 14px;
    margin-bottom: 8px;
    border-radius: 10px;
    border: 1px solid rgba(22, 163, 74, 0.25);
    background: rgba(22, 163, 74, 0.06);
}

.apk-feature-fixed strong {
    display: block;
    font-size: 14px;
    margin-bottom: 2px;
}

.apk-feature-fixed small {
    display: block;
    color: var(--text-muted, #6b7280);
    font-size: 12px;
    line-height: 1.4;
}

.apk-feature-fixed-badge {
    flex-shrink: 0;
    margin-top: 2px;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 600;
    color: #166534;
    background: rgba(22, 163, 74, 0.15);
}

.apk-advanced-intro {
    margin: 0 0 12px;
    padding: 0 2px;
    font-size: 12px;
    color: var(--text-muted, #6b7280);
    line-height: 1.5;
}


.apk-checkbox-inline-wrap .apk-checkbox-row {
    width: 100%;
    margin: 0;
}

.apk-hide-mode-section {
    margin-top: 14px;
    padding-top: 14px;
    border-top: 1px solid var(--border);
}

.apk-behavior-section {
    margin-top: 14px;
    padding-top: 14px;
    border-top: 1px solid var(--border);
}

.apk-checkbox-group {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 8px;
}

.apk-checkbox-row {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    cursor: pointer;
    padding: 12px 14px;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: var(--bg-secondary, #fafafa);
}

.apk-checkbox-row input {
    margin-top: 3px;
    flex-shrink: 0;
}

.apk-checkbox-row strong {
    display: block;
    font-size: 14px;
    margin-bottom: 2px;
}

.apk-checkbox-row small {
    display: block;
    color: var(--text-muted, #6b7280);
    font-size: 12px;
    line-height: 1.4;
}

.apk-section-hint {
    margin: 4px 0 0;
    font-size: 12px;
    color: var(--text-muted, #6b7280);
    line-height: 1.45;
}

.apk-section-label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 8px;
}

.apk-panel textarea {
    width: 100%;
    padding: 9px 12px;
    font-size: 14px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--bg);
    color: var(--text);
    outline: none;
    resize: vertical;
    min-height: 56px;
    font-family: inherit;
    line-height: 1.5;
}

.apk-panel textarea:focus {
    border-color: var(--primary);
}

.apk-panel input[type="file"] {
    width: 100%;
    font-size: 13px;
    color: var(--text-light);
}

.input-with-btn {
    display: flex;
    gap: 10px;
}

.input-with-btn input {
    flex: 1;
}

.radio-group {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.radio-group-inline {
    flex-direction: row;
    flex-wrap: wrap;
}

.radio-card {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px 14px;
    border: 1px solid var(--border);
    border-radius: 10px;
    cursor: pointer;
    transition: border-color 0.2s, background 0.2s;
    flex: 1;
    min-width: 140px;
}

.radio-card-compact {
    padding: 10px 12px;
}

.radio-card:hover {
    border-color: var(--primary);
    background: var(--primary-light);
}

.radio-card input {
    margin-top: 3px;
    accent-color: var(--primary);
}

.radio-card-body {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.radio-card-body strong {
    font-size: 13px;
}

.radio-card-body small {
    color: var(--text-light);
    font-size: 11px;
}

.apk-advanced-details {
    margin-top: 14px;
    padding-top: 14px;
    border-top: 1px solid var(--border);
}

.apk-advanced-details > summary {
    list-style: none;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    gap: 2px;
    user-select: none;
    position: relative;
    padding-right: 24px;
}

.apk-advanced-details > summary::-webkit-details-marker {
    display: none;
}

.apk-advanced-details > summary::after {
    content: '';
    position: absolute;
    right: 0;
    top: 50%;
    width: 7px;
    height: 7px;
    border-right: 2px solid var(--text-light);
    border-bottom: 2px solid var(--text-light);
    transform: translateY(-70%) rotate(45deg);
    transition: transform 0.2s;
}

.apk-advanced-details[open] > summary::after {
    transform: translateY(-30%) rotate(-135deg);
}

.apk-advanced-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
}

.apk-advanced-desc {
    font-size: 12px;
    color: var(--text-light);
}

.apk-advanced-body {
    padding-top: 12px;
}

.apk-advanced-body .form-group {
    margin-bottom: 12px;
}

.apk-advanced-body .form-group:last-child {
    margin-bottom: 0;
}

.apk-build-actions-sidebar {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 14px;
    padding-top: 14px;
    border-top: 1px solid var(--border);
}

.apk-build-idle {
    padding: 12px;
    text-align: center;
    color: var(--text-light);
    font-size: 12px;
    background: var(--bg);
    border-radius: 8px;
}

.apk-build-panel:has(#apk-build-progress-wrap:not(.hidden)) .apk-build-idle,
.apk-build-panel:has(#apk-build-result:not(.hidden)) .apk-build-idle,
.apk-build-panel:has(#apk-build-error:not(.hidden)) .apk-build-idle {
    display: none;
}

.apk-build-progress {
    margin: 0 0 10px;
    padding: 12px;
    background: var(--bg);
    border-radius: 8px;
}

.apk-progress-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    font-size: 13px;
    gap: 8px;
}

.apk-progress-top span:first-child {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.apk-progress-top span:last-child {
    font-weight: 700;
    color: var(--primary);
    flex-shrink: 0;
}

.apk-progress-bar {
    width: 100%;
    height: 8px;
    background: rgba(15, 23, 42, 0.65);
    border-radius: 999px;
    overflow: hidden;
}

.apk-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #3b82f6, #6366f1);
    border-radius: 999px;
    transition: width 0.3s ease;
}

.apk-build-result {
    margin-bottom: 10px;
    padding: 12px;
    background: rgba(16, 185, 129, 0.12);
    border: 1px solid rgba(16, 185, 129, 0.28);
    border-radius: 8px;
}

.apk-result-title {
    font-weight: 600;
    color: #34d399;
    margin-bottom: 8px;
    font-size: 14px;
}

.apk-download-url {
    font-family: 'SF Mono', Consolas, monospace;
    font-size: 11px;
    color: var(--text-light);
    word-break: break-all;
    margin-bottom: 10px;
    max-height: 48px;
    overflow: hidden;
}

.apk-build-error {
    margin-bottom: 10px;
    padding: 10px 12px;
    background: rgba(239, 68, 68, 0.12);
    border: 1px solid rgba(239, 68, 68, 0.28);
    border-radius: 8px;
    color: #f87171;
    font-size: 12px;
    line-height: 1.5;
}

#apk-build-submit-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

@media (max-width: 960px) {
    .apk-builder-layout {
        grid-template-columns: 1fr;
    }

    .apk-builder-sidebar {
        position: static;
        order: 2;
    }

    .apk-form-grid {
        grid-template-columns: 1fr;
    }

    .radio-group-inline {
        flex-direction: column;
    }
}

@media (max-width: 900px) {
    .apk-builder-header {
        flex-direction: column;
    }

    .input-with-btn {
        flex-direction: column;
    }
}

/* 触摸设备优化 */
@media (hover: none) {
    .btn:active { transform: scale(0.98); }
    .nav-item:active { background: rgba(255,255,255,0.08); }
    .action-btn:active { transform: scale(0.95); }
    
    /* 增大触摸目标 */
    .nav-item { min-height: 48px; }
    .action-btn { min-width: 44px; min-height: 44px; }
}
