* { margin: 0; padding: 0; box-sizing: border-box; }
html { font-size: 10px; }
::selection { color: #fff; background-color: #a855f7; }
body { font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif; background: linear-gradient(135deg, #050810 0%, #0a1128 100%); color: #e2e8f0; min-height: 100vh; display: flex; flex-direction: column; }

/* Header */
.header { background: rgba(8, 12, 21, 0.9); backdrop-filter: blur(12px); border-bottom: none; position: sticky; top: 0; z-index: 100; }
.nav { display: flex; justify-content: space-between; align-items: center; max-width: 120rem; margin: 0 auto; padding: 1.5rem 3rem; gap: 2rem; }
.logo { font-size: 2.4rem; font-weight: 700; background: linear-gradient(90deg, #a855f7, #ec4899); -webkit-background-clip: text; background-clip: text; color: transparent; flex-shrink: 0; }
.nav-list { display: flex; list-style: none; gap: 0.5rem; }
.nav-list li { display: flex; align-items: center; }
.nav-list a { text-decoration: none; color: #94a3b8; font-size: 1.6rem; padding: 0.5rem 1rem; transition: all 0.3s ease; border-radius: 0.8rem; white-space: nowrap; }
.nav-list a:hover, .nav-list a.active { color: #a855f7; background: rgba(168, 85, 247, 0.1); }

.nav-avatar { display: flex; align-items: center; gap: 1rem; padding: 0.4rem 1rem; border-radius: 2rem; text-decoration: none; transition: all 0.3s ease; flex-shrink: 0; }
.nav-avatar:hover { background: rgba(168, 85, 247, 0.1); }
.nav-avatar img { width: 3.2rem; height: 3.2rem; border-radius: 50%; object-fit: cover; border: 2px solid rgba(168, 85, 247, 0.4); transition: all 0.3s ease; }
.nav-avatar:hover img { border-color: #a855f7; box-shadow: 0 0 12px rgba(168, 85, 247, 0.4); }
.nav-avatar-name { font-size: 1.4rem; color: #e2e8f0; font-weight: 500; white-space: nowrap; }

/* 导航栏搜索 */
.nav-search { position: relative; flex-shrink: 0; }
.nav-search input { height: 3.6rem; width: 20rem; padding: 0 1rem 0 3.2rem; font-size: 1.4rem; border: 1px solid rgba(168, 85, 247, 0.2); border-radius: 2rem; outline: none; background: rgba(255, 255, 255, 0.04); color: #e2e8f0; transition: all 0.3s; }
.nav-search input::placeholder { color: #475569; }
.nav-search input:focus { border-color: #a855f7; width: 26rem; background: rgba(255, 255, 255, 0.07); box-shadow: 0 0 20px rgba(168, 85, 247, 0.15); }
.nav-search::before { content: '🔍'; position: absolute; left: 1rem; top: 50%; transform: translateY(-50%); font-size: 1.3rem; pointer-events: none; }

/* 账号切换下拉 */
.account-dropdown { display: none; position: absolute; top: calc(100% + 0.8rem); right: 0; min-width: 22rem; background: rgba(15, 23, 42, 0.98); border: 1px solid rgba(168, 85, 247, 0.2); border-radius: 1rem; box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6); z-index: 200; overflow: hidden; backdrop-filter: blur(20px); }
.account-dropdown.show { display: block; animation: dropIn 0.2s ease; }
@keyframes dropIn { from { opacity: 0; transform: translateY(-0.5rem); } to { opacity: 1; transform: translateY(0); } }
.dropdown-header { padding: 1rem 1.5rem; font-size: 1.2rem; color: #64748b; border-bottom: 1px solid rgba(255, 255, 255, 0.05); }
.dropdown-empty { padding: 1.5rem; text-align: center; font-size: 1.3rem; color: #475569; }
.dropdown-item { display: flex; align-items: center; gap: 1rem; padding: 1rem 1.5rem; cursor: pointer; transition: background 0.2s ease; }
.dropdown-item:hover { background: rgba(168, 85, 247, 0.1); }
.dropdown-item img { width: 3rem; height: 3rem; border-radius: 50%; object-fit: cover; border: 1px solid rgba(168, 85, 247, 0.2); }
.dropdown-item span { flex: 1; font-size: 1.4rem; color: #e2e8f0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dropdown-remove { background: none; border: none; color: #475569; cursor: pointer; font-size: 1.2rem; padding: 0.3rem; border-radius: 0.3rem; transition: all 0.2s; }
.dropdown-remove:hover { color: #ef4444; background: rgba(239, 68, 68, 0.1); }
.dropdown-footer { padding: 0.8rem 1.5rem; border-top: 1px solid rgba(255, 255, 255, 0.05); }
.dropdown-footer a { font-size: 1.3rem; color: #94a3b8; text-decoration: none; transition: color 0.2s; }
.dropdown-footer a:hover { color: #a855f7; }

/* 通知铃铛 */
.notification-bell { position: relative; flex-shrink: 0; }
.bell-btn { background: none; border: none; font-size: 1.8rem; cursor: pointer; padding: 0.4rem; transition: transform 0.2s; }
.bell-btn:hover { transform: scale(1.15); }
.bell-badge { position: absolute; top: -0.3rem; right: -0.3rem; min-width: 1.6rem; height: 1.6rem; background: linear-gradient(135deg, #ef4444, #dc2626); color: #fff; font-size: 1rem; border-radius: 1rem; display: flex; align-items: center; justify-content: center; font-weight: 700; line-height: 1; }
.notification-panel { display: none; position: fixed; top: 6rem; right: 3rem; width: 36rem; max-height: 50rem; background: rgba(15, 23, 42, 0.98); border: 1px solid rgba(168, 85, 247, 0.2); border-radius: 1rem; box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6); z-index: 250; overflow: hidden; backdrop-filter: blur(20px); }
.notification-panel.show { display: flex; flex-direction: column; animation: dropIn 0.2s ease; }
.notif-header { display: flex; justify-content: space-between; align-items: center; padding: 1.2rem 1.5rem; border-bottom: 1px solid rgba(255, 255, 255, 0.05); font-size: 1.5rem; color: #e2e8f0; font-weight: 600; }
.notif-read-all { background: none; border: none; color: #a855f7; font-size: 1.2rem; cursor: pointer; padding: 0.3rem 0.6rem; border-radius: 0.3rem; transition: all 0.2s; }
.notif-read-all:hover { background: rgba(168, 85, 247, 0.1); }
.notif-list { flex: 1; overflow-y: auto; max-height: 40rem; }
.notif-empty { text-align: center; padding: 3rem; color: #475569; font-size: 1.3rem; }
.notif-item { display: flex; gap: 0.8rem; padding: 1rem 1.5rem; cursor: pointer; transition: background 0.2s; border-bottom: 1px solid rgba(255, 255, 255, 0.03); }
.notif-item:hover { background: rgba(168, 85, 247, 0.05); }
.notif-item.unread { background: rgba(168, 85, 247, 0.04); }
.notif-dot { width: 0.6rem; height: 0.6rem; border-radius: 50%; background: #a855f7; margin-top: 0.6rem; flex-shrink: 0; opacity: 0; }
.notif-item.unread .notif-dot { opacity: 1; }
.notif-title { font-size: 1.3rem; color: #e2e8f0; }
.notif-item.unread .notif-title { font-weight: 600; }
.notif-content { font-size: 1.2rem; color: #64748b; margin-top: 0.3rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.notif-time { font-size: 1.1rem; color: #475569; margin-top: 0.3rem; }

/* Main Layout */
.main { max-width: 120rem; width: 100%; margin: 0 auto; padding: 3rem 2rem; flex: 1; }

/* Stats Cards */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr)); gap: 1.5rem; margin-bottom: 3rem; }
.stat-card { background: linear-gradient(135deg, rgba(168, 85, 247, 0.06) 0%, rgba(236, 72, 153, 0.04) 100%); border: 1px solid rgba(168, 85, 247, 0.15); border-radius: 1.2rem; padding: 2rem; text-align: center; transition: all 0.3s ease; }
.stat-card:hover { transform: translateY(-3px); box-shadow: 0 10px 30px rgba(168, 85, 247, 0.15); border-color: rgba(168, 85, 247, 0.3); }
.stat-card .stat-icon { font-size: 3rem; margin-bottom: 1rem; }
.stat-card .stat-number { font-size: 3rem; font-weight: 700; background: linear-gradient(90deg, #a855f7, #ec4899); -webkit-background-clip: text; background-clip: text; color: transparent; }
.stat-card .stat-label { font-size: 1.4rem; color: #94a3b8; margin-top: 0.5rem; }

/* Tabs */
.admin-tabs { display: flex; gap: 0.5rem; margin-bottom: 2rem; border-bottom: 1px solid rgba(168, 85, 247, 0.1); padding-bottom: 0; }
.admin-tab { padding: 1rem 2rem; font-size: 1.5rem; color: #94a3b8; cursor: pointer; border: none; background: none; transition: all 0.3s ease; border-radius: 0.8rem 0.8rem 0 0; }
.admin-tab:hover { color: #e2e8f0; background: rgba(168, 85, 247, 0.05); }
.admin-tab.active { color: #a855f7; background: rgba(168, 85, 247, 0.1); border-bottom: 2px solid #a855f7; margin-bottom: -1px; }

/* Tab Content */
.tab-content { display: none; }
.tab-content.active { display: block; }

/* Admin Panel */
.admin-panel { background: linear-gradient(135deg, rgba(168, 85, 247, 0.06) 0%, rgba(236, 72, 153, 0.04) 100%); border: 1px solid rgba(168, 85, 247, 0.15); border-radius: 1.5rem; padding: 2.5rem; box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.5); }

.admin-panel h3 { font-size: 2rem; color: #e2e8f0; margin-bottom: 2rem; display: flex; justify-content: space-between; align-items: center; }

/* Table */
.admin-table { width: 100%; border-collapse: collapse; }
.admin-table thead th { text-align: left; padding: 1rem 1.2rem; font-size: 1.3rem; color: #94a3b8; border-bottom: 1px solid rgba(168, 85, 247, 0.15); white-space: nowrap; }
.admin-table tbody td { padding: 1.2rem 1.2rem; font-size: 1.4rem; border-bottom: 1px solid rgba(255, 255, 255, 0.03); color: #cbd5e1; vertical-align: middle; }
.admin-table tbody tr { transition: background 0.2s ease; }
.admin-table tbody tr:hover { background: rgba(168, 85, 247, 0.05); }

.table-wrap { overflow-x: auto; }
.admin-table .td-avatar { width: 3.5rem; height: 3.5rem; border-radius: 50%; object-fit: cover; border: 1px solid rgba(168, 85, 247, 0.2); }
.admin-table .td-title { color: #e2e8f0; font-weight: 500; max-width: 20rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.admin-table .td-content { max-width: 25rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.admin-table .td-id { color: #64748b; font-size: 1.2rem; }

/* Buttons */
.btn { padding: 0.6rem 1.4rem; border: none; border-radius: 0.6rem; font-size: 1.3rem; cursor: pointer; transition: all 0.3s ease; white-space: nowrap; }
.btn-sm { padding: 0.4rem 1rem; font-size: 1.2rem; }
.btn-primary { background: linear-gradient(135deg, #a855f7, #ec4899); color: #fff; box-shadow: 0 4px 15px rgba(168, 85, 247, 0.3); }
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 6px 20px rgba(168, 85, 247, 0.5); filter: brightness(1.1); }
.btn-danger { background: linear-gradient(135deg, #ef4444, #dc2626); color: #fff; }
.btn-danger:hover { transform: translateY(-2px); box-shadow: 0 4px 15px rgba(239, 68, 68, 0.4); filter: brightness(1.1); }
.btn-warning { background: linear-gradient(135deg, #f59e0b, #d97706); color: #fff; }
.btn-warning:hover { transform: translateY(-2px); box-shadow: 0 4px 15px rgba(245, 158, 11, 0.4); filter: brightness(1.1); }
.btn-success { background: linear-gradient(135deg, #10b981, #059669); color: #fff; }
.btn-success:hover { transform: translateY(-2px); box-shadow: 0 4px 15px rgba(16, 185, 129, 0.4); filter: brightness(1.1); }
.btn-outline { background: transparent; color: #94a3b8; border: 1px solid rgba(148, 163, 184, 0.3); }
.btn-outline:hover { border-color: #a855f7; color: #a855f7; }
.btn-group { display: flex; gap: 0.5rem; align-items: center; }

/* Badge */
.badge { display: inline-block; padding: 0.3rem 0.8rem; border-radius: 1rem; font-size: 1.1rem; font-weight: 500; }
.badge-admin { background: linear-gradient(135deg, rgba(168, 85, 247, 0.2), rgba(236, 72, 153, 0.15)); color: #a855f7; border: 1px solid rgba(168, 85, 247, 0.3); }
.badge-superadmin { background: linear-gradient(135deg, rgba(245, 158, 11, 0.2), rgba(239, 68, 68, 0.15)); color: #f59e0b; border: 1px solid rgba(245, 158, 11, 0.3); }
.badge-user { background: rgba(148, 163, 184, 0.1); color: #94a3b8; border: 1px solid rgba(148, 163, 184, 0.2); }
.badge-active { background: rgba(16, 185, 129, 0.1); color: #10b981; border: 1px solid rgba(16, 185, 129, 0.2); }
.badge-disabled { background: rgba(239, 68, 68, 0.1); color: #ef4444; border: 1px solid rgba(239, 68, 68, 0.2); }

/* Form inline */
.form-inline { display: flex; gap: 1rem; align-items: center; flex-wrap: wrap; }
.form-inline input { padding: 0.8rem 1.2rem; background: rgba(255, 255, 255, 0.03); border: 1px solid rgba(168, 85, 247, 0.2); border-radius: 0.6rem; color: #e2e8f0; font-size: 1.4rem; outline: none; transition: border-color 0.3s ease; }
.form-inline input:focus { border-color: #a855f7; }
.form-inline input::placeholder { color: #64748b; }

/* Empty state */
.empty-state { text-align: center; padding: 4rem 2rem; color: #64748b; font-size: 1.5rem; }

/* No access */
.no-access { text-align: center; padding: 10rem 2rem; }
.no-access p { font-size: 2rem; color: #94a3b8; margin-bottom: 2rem; }
.no-access a { color: #a855f7; text-decoration: none; }

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

.btn-info { background: linear-gradient(135deg, #0ea5e9, #0284c7); }
.btn-info:hover { filter: brightness(1.1); transform: translateY(-1px); }

/* Modal */
.modal-overlay { position: fixed; inset: 0; background: rgba(0, 0, 0, 0.7); display: flex; align-items: center; justify-content: center; z-index: 500; backdrop-filter: blur(4px); }
.modal-box { background: rgba(15, 23, 42, 0.98); border: 1px solid rgba(168, 85, 247, 0.2); border-radius: 1.2rem; padding: 2.5rem; min-width: 36rem; box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6); }
.modal-box h3 { font-size: 2rem; color: #e2e8f0; margin-bottom: 1rem; }
.modal-box p { font-size: 1.5rem; color: #94a3b8; margin-bottom: 1.5rem; }
.modal-box strong { color: #a855f7; }
.modal-box input { width: 100%; padding: 1rem 1.5rem; background: rgba(255, 255, 255, 0.05); border: 1px solid rgba(168, 85, 247, 0.2); border-radius: 0.8rem; color: #e2e8f0; font-size: 1.5rem; outline: none; transition: border-color 0.3s; }
.modal-box input:focus { border-color: #a855f7; }
.modal-actions { display: flex; justify-content: flex-end; gap: 1rem; margin-top: 1.5rem; }

/* Footer */
.footer { background: rgba(8, 12, 21, 0.9); border-top: 1px solid rgba(168, 85, 247, 0.1); text-align: center; padding: 2rem; }
.footer p { font-size: 1.4rem; color: #64748b; }

/* Settings form */
.settings-form { display: flex; flex-direction: column; gap: 1.5rem; }
.settings-item { display: flex; flex-direction: column; gap: 0.5rem; }
.settings-item label { font-size: 1.3rem; color: #94a3b8; }
.settings-input { padding: 0.8rem 1.2rem; background: rgba(255, 255, 255, 0.03); border: 1px solid rgba(168, 85, 247, 0.2); border-radius: 0.6rem; color: #e2e8f0; font-size: 1.4rem; outline: none; transition: border-color 0.3s; }
.settings-input:focus { border-color: #a855f7; }
.settings-textarea { padding: 1rem 1.2rem; background: rgba(255, 255, 255, 0.03); border: 1px solid rgba(168, 85, 247, 0.2); border-radius: 0.6rem; color: #e2e8f0; font-size: 1.4rem; outline: none; resize: vertical; min-height: 8rem; font-family: inherit; line-height: 1.6; transition: border-color 0.3s; }
.settings-textarea:focus { border-color: #a855f7; }

/* Charts */
.chart-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1.5rem; margin-top: 1.5rem; }
.chart-box { background: rgba(0, 0, 0, 0.2); border: 1px solid rgba(168, 85, 247, 0.1); border-radius: 1rem; padding: 1.5rem; min-height: 25rem; }
.chart-box h4 { font-size: 1.4rem; color: #94a3b8; margin-bottom: 1rem; }
.chart-box canvas { max-width: 100%; height: auto !important; }
.chart-box-wide { grid-column: 1 / -1; min-height: 20rem; }

.checkbox-col { width: 4rem; text-align: center; }
.checkbox-col input[type="checkbox"] { width: 1.6rem; height: 1.6rem; cursor: pointer; accent-color: #a855f7; }

.batch-actions { margin-left: auto; gap: 1rem; display: flex; align-items: center; }

@media (max-width: 768px) {
    .chart-grid { grid-template-columns: 1fr !important; }
    .chart-box { min-height: 18rem !important; padding: 1rem; }
    .chart-box-wide { min-height: 18rem !important; }
    .chart-box h4 { font-size: 1.2rem; }
    .settings-item { flex-direction: column; }
}

@media (max-width: 80rem) { .main { padding: 2rem 1rem; } .admin-panel { padding: 1.5rem; } .stats-grid { grid-template-columns: repeat(2, 1fr); } }

/* 移动端汉堡菜单 */
.nav-hamburger { display: none; flex-direction: column; gap: 0.5rem; background: none; border: none; cursor: pointer; padding: 0.5rem; z-index: 300; }
.nav-hamburger span { display: block; width: 2.4rem; height: 0.2rem; background: #e2e8f0; border-radius: 0.1rem; transition: all 0.3s; }
.nav-hamburger.open span:nth-child(1) { transform: rotate(45deg) translate(0.5rem, 0.5rem); }
.nav-hamburger.open span:nth-child(2) { opacity: 0; }
.nav-hamburger.open span:nth-child(3) { transform: rotate(-45deg) translate(0.5rem, -0.5rem); }
.mobile-overlay { display: none; position: fixed; inset: 0; background: rgba(0, 0, 0, 0.6); z-index: 50; backdrop-filter: blur(4px); }
.mobile-overlay.show { display: block; }
body.no-scroll { overflow: hidden; }

@media (max-width: 50rem) {
    .stats-grid { grid-template-columns: 1fr; }
    .admin-tabs { overflow-x: auto; -webkit-overflow-scrolling: touch; }
    .form-inline { flex-direction: column; align-items: stretch; }
}
@media (max-width: 768px) {
    .nav-hamburger { display: flex; }
    .nav-search { display: none; }
    .nav-list { display: none; position: fixed; top: 0; left: 0; width: min(28rem, 80vw); height: 100vh; background: rgba(8, 12, 21, 0.98); flex-direction: column; padding: 8rem 2rem 3rem; gap: 0.5rem; z-index: 200; border-right: 1px solid rgba(168, 85, 247, 0.2); overflow-y: auto; backdrop-filter: blur(20px); }
    .nav-list.mobile-open { display: flex; animation: slideIn 0.3s ease; }
    @keyframes slideIn { from { transform: translateX(-100%); } to { transform: translateX(0); } }
    .nav-list a { font-size: 1.8rem; padding: 1.2rem 1.5rem; }
    .nav-avatar-name { display: none; }
    .admin-panel { padding: 1rem; }
    .modal-box { min-width: auto; margin: 1rem; width: calc(100% - 2rem); }
    .chart-grid { grid-template-columns: 1fr !important; }
    .chart-row { grid-template-columns: 1fr !important; display: flex !important; flex-direction: column; gap: 1rem; }
    .chart-box { min-height: 18rem !important; padding: 1rem; width: 100%; }
    .chart-box-wide { min-height: 18rem !important; }
    .chart-box h4 { font-size: 1.2rem; }
    .settings-item { flex-direction: column; }
    .table-wrap { -webkit-overflow-scrolling: touch; }
    .notification-panel { width: calc(100% - 2rem); right: 1rem; left: 1rem; max-height: 60vh; }
    .account-dropdown { min-width: 28rem; width: 90vw; max-width: 40rem; right: 1rem; }
    .dropdown-item { padding: 1.2rem 1.5rem; }
    .dropdown-item img { width: 4rem; height: 4rem; }
    .dropdown-item span { font-size: 1.6rem; }
    .bell-btn { padding: 0.6rem; font-size: 2rem; }
}
