/* ==================== 基础重置 ==================== */
* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: 'Microsoft YaHei', -apple-system, sans-serif; background: #0a0a1a; color: #e0e0e0; min-height: 100vh; }

/* ==================== 顶部导航 ==================== */
.top-bar { background: #12122a; border-bottom: 1px solid #1e1e3a; padding: 0 24px; height: 56px; display: flex; align-items: center; justify-content: space-between; position: fixed; top: 0; left: 0; right: 0; z-index: 100; }
.top-bar .logo { font-size: 18px; font-weight: 700; color: #FFD700; }
.top-bar .logo span { color: #888; font-weight: 400; font-size: 13px; margin-left: 12px; }
.top-bar .user-info { display: flex; align-items: center; gap: 12px; font-size: 13px; color: #aaa; }
.top-bar .user-info .email { color: #e0e0e0; }
.btn-logout { background: none; border: 1px solid #444; color: #aaa; padding: 5px 14px; border-radius: 4px; cursor: pointer; font-size: 12px; }
.btn-logout:hover { border-color: #ff4444; color: #ff4444; }

/* ==================== 侧边栏 ==================== */
.sidebar { position: fixed; top: 56px; left: 0; width: 200px; height: calc(100vh - 56px); background: #10102a; border-right: 1px solid #1e1e3a; padding: 16px 0; overflow-y: auto; }
.sidebar .nav-item { display: block; padding: 10px 24px; color: #999; font-size: 14px; cursor: pointer; transition: all 0.2s; border-left: 3px solid transparent; text-decoration: none; }
.sidebar .nav-item:hover { background: #1a1a3a; color: #ddd; }
.sidebar .nav-item.active { color: #FFD700; background: #1a1a3a; border-left-color: #FFD700; }
.sidebar .nav-section { padding: 12px 24px 6px; font-size: 11px; color: #555; text-transform: uppercase; letter-spacing: 1px; }

/* ==================== 主内容区 ==================== */
.main { margin-left: 200px; margin-top: 56px; padding: 24px; min-height: calc(100vh - 56px); }

/* ==================== 面板 ==================== */
.panel { background: #12122a; border: 1px solid #1e1e3a; border-radius: 8px; margin-bottom: 24px; }
.panel-header { padding: 16px 20px; border-bottom: 1px solid #1e1e3a; display: flex; align-items: center; justify-content: space-between; }
.panel-header h3 { font-size: 15px; color: #e0e0e0; font-weight: 600; }
.panel-body { padding: 16px 20px; }

/* ==================== 工具栏 ==================== */
.toolbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.toolbar input, .toolbar select { background: #0a0a1a; border: 1px solid #333; color: #e0e0e0; padding: 7px 12px; border-radius: 4px; font-size: 13px; outline: none; }
.toolbar input:focus, .toolbar select:focus { border-color: #FFD700; }
.toolbar input { width: 200px; }

/* ==================== 按钮 ==================== */
.btn { padding: 7px 16px; border-radius: 4px; font-size: 13px; cursor: pointer; border: none; transition: all 0.2s; }
.btn-primary { background: #FFD700; color: #000; font-weight: 600; }
.btn-primary:hover { background: #ffe44d; }
.btn-sm { padding: 4px 10px; font-size: 12px; }
.btn-danger { background: #c62828; color: #fff; }
.btn-danger:hover { background: #e53935; }
.btn-outline { background: none; border: 1px solid #555; color: #aaa; }
.btn-outline:hover { border-color: #FFD700; color: #FFD700; }

/* ==================== 表格 ==================== */
.data-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.data-table th { text-align: left; padding: 10px 12px; color: #888; font-weight: 500; border-bottom: 1px solid #1e1e3a; font-size: 12px; white-space: nowrap; }
.data-table td { padding: 10px 12px; border-bottom: 1px solid #0f0f2a; white-space: nowrap; }
.data-table tr:hover td { background: #0f0f2a; }

/* ==================== 徽章 ==================== */
.badge { display: inline-block; padding: 2px 8px; border-radius: 10px; font-size: 11px; font-weight: 600; }
.badge-pro { background: #1b5e20; color: #69f0ae; }
.badge-free { background: #1a1a3a; color: #888; }
.badge-admin { background: #e65100; color: #ffab40; }
.badge-unused { background: #0d47a1; color: #64b5f6; }
.badge-used { background: #1b5e20; color: #69f0ae; }
.badge-disabled { background: #b71c1c; color: #ef9a9a; }
.badge-success { background: #1b5e20; color: #69f0ae; }
.badge-failed { background: #b71c1c; color: #ef9a9a; }

/* ==================== 分页 ==================== */
.pagination { display: flex; justify-content: center; gap: 6px; margin-top: 16px; }
.pagination .page-btn { padding: 5px 12px; background: #1a1a3a; border: 1px solid #333; color: #aaa; border-radius: 4px; cursor: pointer; font-size: 12px; }
.pagination .page-btn:hover { border-color: #FFD700; color: #FFD700; }
.pagination .page-btn.active { background: #FFD700; color: #000; border-color: #FFD700; font-weight: 600; }
.pagination .page-btn.disabled { opacity: 0.3; cursor: default; }
.page-info { text-align: center; color: #666; font-size: 12px; margin-top: 8px; }

/* ==================== 模态框 ==================== */
.modal-overlay { display: none; position: fixed; top: 0; left: 0; right: 0; bottom: 0; background: rgba(0,0,0,0.7); z-index: 200; justify-content: center; align-items: center; }
.modal-overlay.show { display: flex; }
.modal { background: #16162e; border: 1px solid #2a2a4a; border-radius: 8px; padding: 24px; width: 480px; max-width: 90vw; max-height: 80vh; overflow-y: auto; }
.modal h3 { color: #FFD700; margin-bottom: 20px; font-size: 16px; }
.modal label { display: block; font-size: 12px; color: #888; margin-bottom: 4px; margin-top: 12px; }
.modal input, .modal select, .modal textarea { width: 100%; background: #0a0a1a; border: 1px solid #333; color: #e0e0e0; padding: 8px 12px; border-radius: 4px; font-size: 13px; outline: none; }
.modal input:focus, .modal select:focus { border-color: #FFD700; }
.modal textarea { height: 60px; resize: vertical; }
.modal .modal-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 20px; }

/* ==================== Toast ==================== */
.toast { position: fixed; top: 70px; right: 24px; background: #1b5e20; color: #69f0ae; padding: 12px 20px; border-radius: 6px; font-size: 13px; z-index: 300; opacity: 0; transition: opacity 0.3s; }
.toast.show { opacity: 1; }
.toast.error { background: #b71c1c; color: #ef9a9a; }

/* ==================== 加载动画 ==================== */
.loading { text-align: center; padding: 40px; color: #666; }

/* ==================== 汉堡菜单（手机端） ==================== */
.hamburger { display: none; background: none; border: none; color: #FFD700; font-size: 22px; cursor: pointer; padding: 4px 8px; line-height: 1; }
.sidebar-overlay { display: none; position: fixed; top: 0; left: 0; right: 0; bottom: 0; background: rgba(0,0,0,0.5); z-index: 140; }

/* ==================== 响应式 ==================== */
@media (max-width: 768px) {
    .hamburger { display: block; }
    .sidebar { transform: translateX(-100%); transition: transform 0.3s ease; z-index: 150; width: 220px; }
    .sidebar.open { transform: translateX(0); }
    .sidebar-overlay.show { display: block; }
    .main { margin-left: 0; padding: 16px; }
    .top-bar { padding: 0 12px; }
    .top-bar .logo span { display: none; }
    .top-bar .logo { font-size: 15px; }
    .top-bar .user-info .email { display: none; }
    .panel-body { padding: 12px; overflow-x: auto; }
    .panel-header { padding: 12px 14px; flex-wrap: wrap; gap: 8px; }
    .toolbar { gap: 8px; }
    .toolbar input { width: 100%; }
    .btn { min-height: 40px; }
    .modal { width: 95vw; padding: 18px; }
    .toast { right: 12px; left: 12px; }
    .data-table { font-size: 12px; }
    .data-table th, .data-table td { padding: 8px 8px; }
    .pagination { flex-wrap: wrap; }
}
@media (max-width: 480px) {
    .stats-grid { grid-template-columns: 1fr; }
}
