/* ========== 全局样式 ========== */
* { margin: 0; padding: 0; box-sizing: border-box; }

body {
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', sans-serif;
background: #0a120a;
color: #e0e0e0;
min-height: 100vh;
font-size: 14px;
line-height: 1.6;
}

a { color: #4ADE80; text-decoration: none; }
a:hover { color: #6BEFA0; }

.text-muted { color: #6a8a90; }

/* ========== 登录页 ========== */
body.login-page {
display: flex;
align-items: center;
justify-content: center;
background: linear-gradient(135deg, #0a120a 0%, #0d1b1e 50%, #0a120a 100%);
}

.login-container {
width: 400px;
max-width: 95vw;
}

.login-card {
background: #162123;
border-radius: 16px;
padding: 40px;
text-align: center;
box-shadow: 0 8px 32px rgba(0,0,0,0.5);
border: 1px solid #1a2a2e;
}

.login-icon { font-size: 56px; margin-bottom: 12px; }

.login-card h1 {
color: #4ADE80;
font-size: 22px;
margin-bottom: 6px;
}

.login-desc {
color: #6a8a90;
font-size: 14px;
margin-bottom: 24px;
}

.login-form { text-align: left; }

.login-form .form-group {
margin-bottom: 16px;
}

.login-form label {
display: block;
font-size: 13px;
color: #b0c0c8;
margin-bottom: 6px;
}

.login-form input {
width: 100%;
padding: 12px 14px;
border: 1px solid #2a3a3e;
border-radius: 8px;
background: #1a2a2e;
color: #e0e0e0;
font-size: 14px;
outline: none;
transition: border-color 0.2s;
}

.login-form input:focus {
border-color: #4ADE80;
}

/* ========== 布局 ========== */
.admin-container {
display: flex;
min-height: 100vh;
}

.sidebar {
width: 240px;
background: #162123;
border-right: 1px solid #1a2a2e;
display: flex;
flex-direction: column;
position: fixed;
top: 0;
left: 0;
bottom: 0;
z-index: 100;
}

.main-content {
flex: 1;
margin-left: 240px;
padding: 0;
min-height: 100vh;
}

/* ========== 侧边栏 ========== */
.sidebar-brand {
padding: 20px;
display: flex;
align-items: center;
gap: 10px;
border-bottom: 1px solid #1a2a2e;
}

.brand-icon { font-size: 28px; }

.brand-text {
font-size: 16px;
font-weight: 700;
color: #4ADE80;
}

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

.nav-item {
display: flex;
align-items: center;
gap: 10px;
padding: 12px 20px;
color: #b0c0c8;
font-size: 14px;
transition: all 0.2s;
border-left: 3px solid transparent;
}

.nav-item:hover {
background: #1a2a2e;
color: #e0e0e0;
}

.nav-item.active {
background: #0a2a1a;
color: #4ADE80;
border-left-color: #4ADE80;
}

.nav-icon { font-size: 18px; width: 24px; text-align: center; }

.sidebar-footer {
padding: 16px 20px;
border-top: 1px solid #1a2a2e;
}

.admin-info {
display: flex;
align-items: center;
gap: 8px;
margin-bottom: 10px;
}

.admin-avatar { font-size: 20px; }
.admin-name { font-size: 13px; color: #b0c0c8; }

.btn-logout {
display: block;
text-align: center;
padding: 8px;
background: #2a1a1a;
color: #e06060;
border-radius: 6px;
font-size: 13px;
transition: background 0.2s;
}

.btn-logout:hover {
background: #3a1a1a;
color: #ff6060;
}

/* ========== 顶部栏 ========== */
.top-bar {
padding: 20px 28px;
border-bottom: 1px solid #1a2a2e;
background: #162123;
}

.page-title {
font-size: 20px;
color: #4ADE80;
font-weight: 600;
}

.content-body {
padding: 24px 28px;
}

/* ========== 统计卡片 ========== */
.stats-grid {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
gap: 16px;
margin-bottom: 24px;
}

.stat-card {
background: #162123;
border-radius: 12px;
padding: 20px;
display: flex;
align-items: center;
gap: 16px;
border: 1px solid #1a2a2e;
transition: transform 0.2s;
}

.stat-card:hover {
transform: translateY(-2px);
border-color: #2a3a3e;
}

.stat-icon {
width: 48px;
height: 48px;
border-radius: 12px;
display: flex;
align-items: center;
justify-content: center;
font-size: 24px;
flex-shrink: 0;
}

.stat-icon-users { background: #0a2a1a; }
.stat-icon-vip { background: #2a2a0a; }
.stat-icon-today { background: #0a1a2a; }
.stat-icon-time { background: #1a0a2a; }

.stat-number {
font-size: 28px;
font-weight: 700;
color: #ffffff;
line-height: 1.2;
}

.stat-label {
font-size: 13px;
color: #6a8a90;
margin-top: 2px;
}

/* ========== 卡片 ========== */
.card {
background: #162123;
border-radius: 12px;
border: 1px solid #1a2a2e;
margin-bottom: 20px;
overflow: hidden;
}

.card-header {
padding: 16px 20px;
border-bottom: 1px solid #1a2a2e;
display: flex;
align-items: center;
justify-content: space-between;
flex-wrap: wrap;
gap: 12px;
}

.card-header h2 {
font-size: 16px;
color: #e0e0e0;
font-weight: 600;
}

.card-actions {
display: flex;
align-items: center;
gap: 8px;
}

.card-body {
padding: 20px;
}

/* ========== 表格 ========== */
.table {
width: 100%;
border-collapse: collapse;
font-size: 14px;
}

.table th {
text-align: left;
padding: 12px 10px;
border-bottom: 2px solid #1a2a2e;
color: #6a8a90;
font-weight: 600;
font-size: 12px;
text-transform: uppercase;
letter-spacing: 0.5px;
}

.table td {
padding: 12px 10px;
border-bottom: 1px solid #1a2a2e;
color: #d0d0d0;
}

.table tr:hover td {
background: #1a2a2e;
}

.table tr.rank-top td {
background: #0a2a1a;
}

.rank-medal { font-size: 20px; }
.rank-number {
font-weight: 700;
color: #6a8a90;
}

.user-cell {
display: flex;
align-items: center;
gap: 8px;
}

.user-avatar-small {
width: 28px;
height: 28px;
border-radius: 50%;
background: #2a3a3e;
display: flex;
align-items: center;
justify-content: center;
font-size: 12px;
color: #4ADE80;
flex-shrink: 0;
}

.stat-cell {
font-weight: 500;
}

/* ========== 徽章 ========== */
.badge {
display: inline-block;
padding: 2px 8px;
border-radius: 4px;
font-size: 12px;
background: #2a3a3e;
color: #6a8a90;
}

.badge-vip {
background: #3a2a0a;
color: #f0c040;
}

/* ========== 表单 ========== */
.form { max-width: 800px; }

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

.form-group label {
display: block;
font-size: 13px;
color: #b0c0c8;
margin-bottom: 6px;
font-weight: 500;
}

.form-group input[type="text"],
.form-group input[type="number"],
.form-group input[type="password"],
.form-group select,
.form-group textarea {
width: 100%;
padding: 10px 12px;
border: 1px solid #2a3a3e;
border-radius: 8px;
background: #1a2a2e;
color: #e0e0e0;
font-size: 14px;
outline: none;
transition: border-color 0.2s;
font-family: inherit;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
border-color: #4ADE80;
}

.form-group textarea {
resize: vertical;
min-height: 80px;
}

.form-group select {
cursor: pointer;
}

.form-group input:disabled {
opacity: 0.5;
cursor: not-allowed;
}

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

.form-actions {
margin-top: 20px;
display: flex;
gap: 12px;
}

.help-text {
font-size: 12px;
color: #6a8a90;
margin-top: 4px;
line-height: 1.6;
}

/* ========== 搜索框 ========== */
.search-form {
display: flex;
gap: 8px;
}

.search-form input {
padding: 8px 12px;
border: 1px solid #2a3a3e;
border-radius: 6px;
background: #1a2a2e;
color: #e0e0e0;
font-size: 13px;
outline: none;
width: 200px;
}

.search-form input:focus {
border-color: #4ADE80;
}

/* ========== 按钮 ========== */
.btn {
display: inline-flex;
align-items: center;
justify-content: center;
padding: 10px 20px;
border: none;
border-radius: 8px;
font-size: 14px;
font-weight: 500;
cursor: pointer;
transition: all 0.2s;
text-decoration: none;
background: #2a3a3e;
color: #e0e0e0;
line-height: 1;
}

.btn:hover { background: #3a4a4e; color: #ffffff; }

.btn-primary {
background: #4ADE80;
color: #0a120a;
}

.btn-primary:hover {
background: #3bc96f;
color: #0a120a;
}

.btn-secondary {
background: #2a3a3e;
color: #b0c0c8;
}

.btn-sm {
padding: 6px 12px;
font-size: 12px;
border-radius: 6px;
}

.btn-danger {
background: #3a1a1a;
color: #e06060;
}

.btn-danger:hover {
background: #4a1a1a;
color: #ff6060;
}

.btn-block {
width: 100%;
}

/* ========== 提示消息 ========== */
.alert {
padding: 12px 16px;
border-radius: 8px;
margin-bottom: 16px;
font-size: 14px;
}

.alert-success {
background: #0a2a1a;
border: 1px solid #4ADE80;
color: #4ADE80;
}

.alert-error {
background: #2a0a0a;
border: 1px solid #e05050;
color: #e05050;
}

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

.page-link {
padding: 6px 12px;
border: 1px solid #2a3a3e;
border-radius: 6px;
font-size: 13px;
color: #b0c0c8;
transition: all 0.2s;
}

.page-link:hover {
border-color: #4ADE80;
color: #4ADE80;
}

.page-link.active {
background: #4ADE80;
color: #0a120a;
border-color: #4ADE80;
font-weight: 600;
}

/* ========== 响应式 ========== */
@media (max-width: 768px) {
.sidebar {
width: 60px;
}

.sidebar .brand-text,
.sidebar .nav-label,
.sidebar .admin-name,
.sidebar .btn-logout { display: none; }

.sidebar-brand { padding: 12px; justify-content: center; }
.nav-item { padding: 12px; justify-content: center; }
.sidebar-footer { padding: 12px; }
.admin-info { justify-content: center; }

.main-content {
margin-left: 60px;
}

.stats-grid {
grid-template-columns: 1fr 1fr;
}

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

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

.content-body {
padding: 16px;
}

.top-bar {
padding: 16px;
}
}
