/* ========== 新粗野主义风格 ========== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary: #6C63FF;
    --secondary: #FF6B6B;
    --success: #4ECDC4;
    --warning: #FFE66D;
    --danger: #FF6B6B;
    --dark: #2D3436;
    --light: #FFEAA7;
    --bg: #F8F9FA;
    --border: 3px solid #2D3436;
    --shadow: 6px 6px 0px #2D3436;
    --shadow-sm: 4px 4px 0px #2D3436;
    --shadow-hover: 8px 8px 0px #2D3436;
    --sidebar-bg: #E8E4F8;
    --sidebar-accent: #B8B4E0;
    --sidebar-text: #4A4A6A;
}

body {
    font-family: 'Segoe UI', 'Microsoft YaHei', sans-serif;
    background: var(--bg);
    color: var(--dark);
    display: flex;
    min-height: 100vh;
    background-image:
        radial-gradient(circle at 20% 80%, rgba(108, 99, 255, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(255, 107, 107, 0.1) 0%, transparent 50%);
}

/* ========== 侧边栏 ========== */
.sidebar {
    width: 240px;
    background: var(--sidebar-bg);
    color: var(--sidebar-text);
    padding: 0;
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    display: flex;
    flex-direction: column;
    border-right: var(--border);
    box-shadow: var(--shadow);
    z-index: 100;
}

.logo {
    padding: 24px 20px;
    background: var(--primary);
    border-bottom: var(--border);
}

.logo h2 {
    font-size: 20px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: #fff;
}

.nav-menu {
    list-style: none;
    padding: 16px 12px;
    flex: 1;
}

.nav-menu li a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    color: var(--sidebar-text);
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 8px;
    border: 2px solid var(--dark);
    border-radius: 10px;
    background: #fff;
    transition: all 0.2s ease;
}

.nav-menu li a:hover {
    background: var(--sidebar-accent);
    transform: translateX(-2px);
    box-shadow: 4px 4px 0px var(--dark);
}

.nav-menu li a.active {
    background: var(--primary);
    color: #fff;
    border: 2px solid var(--dark);
    box-shadow: var(--shadow-sm);
}

.nav-footer {
    padding: 16px 20px;
    background: var(--sidebar-accent);
    border-top: var(--border);
    font-size: 12px;
    font-weight: 600;
    text-align: center;
    color: var(--sidebar-text);
}

/* ========== 主内容 ========== */
.main-content {
    margin-left: 240px;
    padding: 24px 32px;
    flex: 1;
    min-height: 100vh;
}

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

.header h1 {
    font-size: 32px;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 1px;
    position: relative;
}

.header h1::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 0;
    width: 60px;
    height: 6px;
    background: var(--primary);
    border: 2px solid var(--dark);
}

.header-actions {
    display: flex;
    gap: 12px;
    align-items: center;
}

.header-info {
    font-size: 14px;
    font-weight: 600;
    color: var(--dark);
    background: var(--light);
    padding: 8px 16px;
    border: 2px solid var(--dark);
    border-radius: 8px;
    box-shadow: var(--shadow-sm);
}

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

.stat-card {
    background: #fff;
    border: var(--border);
    border-radius: 12px;
    padding: 24px;
    display: flex;
    align-items: center;
    gap: 16px;
    box-shadow: var(--shadow);
    transition: all 0.2s ease;
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 6px;
    height: 100%;
    background: var(--primary);
}

.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-hover);
}

.stat-card.success::before { background: var(--success); }
.stat-card.danger::before { background: var(--danger); }
.stat-card.warning::before { background: var(--warning); }

.stat-icon {
    font-size: 40px;
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--light);
    border: 2px solid var(--dark);
    border-radius: 12px;
}

.stat-card.success .stat-icon { background: #D4EDDA; }
.stat-card.danger .stat-icon { background: #F8D7DA; }
.stat-card.warning .stat-icon { background: #FFF3CD; }

.stat-info h3 {
    font-size: 12px;
    color: #666;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 4px;
}

.stat-value {
    font-size: 36px;
    font-weight: 900;
    color: var(--dark);
}

/* ========== 仪表盘网格 ========== */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}

/* ========== 卡片 ========== */
.card {
    background: #fff;
    border: var(--border);
    border-radius: 12px;
    padding: 24px;
    box-shadow: var(--shadow);
    transition: all 0.2s ease;
}

.card:hover {
    box-shadow: var(--shadow-hover);
}

.card h3 {
    font-size: 16px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 3px solid var(--dark);
    display: flex;
    align-items: center;
    gap: 8px;
}

.card h3::before {
    content: '';
    width: 8px;
    height: 8px;
    background: var(--primary);
    border: 2px solid var(--dark);
}

/* ========== 统计条 ========== */
.stats-bar {
    background: #fff;
    border: var(--border);
    border-radius: 12px;
    padding: 16px 24px;
    margin-bottom: 20px;
    display: flex;
    gap: 32px;
    box-shadow: var(--shadow-sm);
    font-size: 14px;
    font-weight: 600;
}

.stats-bar strong {
    color: var(--primary);
    font-size: 18px;
}

/* ========== 表格 ========== */
.data-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}

.data-table th {
    text-align: left;
    padding: 14px 16px;
    background: var(--dark);
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    border-bottom: 3px solid var(--dark);
}

.data-table th:first-child {
    border-radius: 8px 0 0 0;
}

.data-table th:last-child {
    border-radius: 0 8px 0 0;
}

.data-table td {
    padding: 14px 16px;
    border-bottom: 2px solid #E0E0E0;
    font-size: 13px;
    font-weight: 500;
}

.data-table tr:hover td {
    background: var(--light);
}

.data-table .loading,
.data-table .empty {
    text-align: center;
    color: #999;
    padding: 40px;
    font-weight: 600;
}

.title-cell {
    cursor: pointer;
    color: var(--primary);
    font-weight: 600;
}

.title-cell:hover {
    text-decoration: underline;
}

/* ========== 状态徽章 ========== */
.status-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border: 2px solid var(--dark);
}

.status-pending {
    background: var(--warning);
    color: var(--dark);
}
.status-processing {
    background: var(--primary);
    color: #fff;
}
.status-completed {
    background: var(--success);
    color: var(--dark);
}
.status-failed {
    background: var(--danger);
    color: #fff;
}
.status-cancelled {
    background: #E0E0E0;
    color: var(--dark);
}

/* ========== 进度条 ========== */
.progress-bar {
    position: relative;
    width: 100%;
    height: 24px;
    background: #E0E0E0;
    border-radius: 12px;
    overflow: hidden;
    border: 2px solid var(--dark);
}

.progress-bar .progress {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), var(--success));
    border-radius: 10px;
    transition: width 0.3s ease;
}

.progress-bar span {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 11px;
    font-weight: 700;
    color: var(--dark);
}

/* ========== 按钮 ========== */
.btn {
    padding: 10px 20px;
    border: 2px solid var(--dark);
    border-radius: 8px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: all 0.2s ease;
    display: inline-block;
    box-shadow: var(--shadow-sm);
}

.btn:hover {
    transform: translate(-2px, -2px);
    box-shadow: var(--shadow);
}

.btn:active {
    transform: translate(2px, 2px);
    box-shadow: none;
}

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

.btn-secondary {
    background: var(--light);
    color: var(--dark);
}
.btn-secondary:hover { background: #F0D78C; }

.btn-warning {
    background: var(--warning);
    color: var(--dark);
}
.btn-warning:hover { background: #F0D78C; }

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

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

.btn-secondary.active {
    background: var(--warning);
    box-shadow: var(--shadow-sm);
}

/* ========== 配置 ========== */
.config-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}

.config-item {
    display: flex;
    justify-content: space-between;
    padding: 12px 0;
    border-bottom: 2px dashed #E0E0E0;
    font-size: 14px;
}

.config-item .label {
    color: #666;
    font-weight: 600;
}

.config-item .value {
    color: var(--dark);
    font-weight: 700;
}

.cache-stats .stat-item,
.config-list .config-item {
    display: flex;
    justify-content: space-between;
    padding: 12px 0;
    border-bottom: 2px dashed #E0E0E0;
}

/* ========== 快速操作 ========== */
.quick-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

/* ========== 弹窗 ========== */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(45, 52, 54, 0.8);
    z-index: 1000;
    backdrop-filter: blur(4px);
}

.modal-content {
    background: #fff;
    margin: 60px auto;
    padding: 32px;
    border: var(--border);
    border-radius: 16px;
    max-width: 720px;
    max-height: 80vh;
    overflow-y: auto;
    position: relative;
    box-shadow: 12px 12px 0px var(--dark);
}

.modal-close {
    position: absolute;
    top: 16px;
    right: 20px;
    font-size: 28px;
    cursor: pointer;
    color: var(--dark);
    font-weight: 900;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid var(--dark);
    border-radius: 8px;
    background: var(--light);
    transition: all 0.2s ease;
}

.modal-close:hover {
    background: var(--danger);
    color: #fff;
}

.summary-box {
    background: var(--light);
    padding: 20px;
    border-radius: 12px;
    margin: 16px 0;
    font-size: 14px;
    line-height: 1.8;
    white-space: pre-wrap;
    border: 2px solid var(--dark);
}

.hint {
    font-size: 13px;
    color: #666;
    margin-bottom: 16px;
    font-weight: 500;
}

/* ========== 选择框 ========== */
select {
    padding: 10px 16px;
    border: 2px solid var(--dark);
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    background: #fff;
    cursor: pointer;
}

select:focus {
    outline: none;
    border-color: var(--primary);
}

/* ========== 响应式 ========== */
@media (max-width: 1024px) {
    .stats-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
    .sidebar {
        width: 70px;
        padding: 0;
    }
    .sidebar .logo h2 { font-size: 12px; text-align: center; }
    .sidebar .logo h2 span { display: none; }
    .nav-menu li a { padding: 12px; justify-content: center; }
    .nav-menu li a span { display: none; }
    .main-content { margin-left: 70px; padding: 16px; }
    .stats-grid { grid-template-columns: 1fr; }
    .dashboard-grid, .config-grid { grid-template-columns: 1fr; }
}

/* ========== 编辑模式 ========== */
.edit-input, .edit-select {
    padding: 8px 12px;
    border: 2px solid var(--dark);
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    width: 200px;
    max-width: 100%;
}

.edit-input:focus, .edit-select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(108, 99, 255, 0.2);
}

.edit-select {
    width: 140px;
}

/* ========== 提示框 ========== */
.config-notice {
    padding: 16px 24px;
    border-radius: 12px;
    margin-bottom: 20px;
    font-size: 14px;
    font-weight: 600;
    border: 2px solid var(--dark);
}

.notice-success {
    background: #D4EDDA;
    color: #155724;
}

.notice-error {
    background: #F8D7DA;
    color: #721C24;
}

/* ========== 图表容器 ========== */
.chart-container {
    width: 100%;
    height: 280px;
}

/* ========== 动画 ========== */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.stat-card, .card {
    animation: fadeIn 0.3s ease forwards;
}

.stat-card:nth-child(1) { animation-delay: 0.05s; }
.stat-card:nth-child(2) { animation-delay: 0.1s; }
.stat-card:nth-child(3) { animation-delay: 0.15s; }
.stat-card:nth-child(4) { animation-delay: 0.2s; }

/* ========== 滚动条 ========== */
::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: #E0E0E0;
    border-radius: 5px;
}

::-webkit-scrollbar-thumb {
    background: var(--dark);
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--primary);
}
