/* ============================================================
 * BCP 控制面板样式 | Dashboard Styles
 * 设计风格：深色侧边栏 + 卡片内容区
 * ============================================================ */

:root {
    --bg-deep: #080810;
    --bg-sidebar: #0a0a16;
    --bg-main: #0e0e1c;
    --bg-card: rgba(16, 16, 30, 0.9);
    --bg-card-hover: rgba(20, 20, 38, 0.95);
    --bg-input: rgba(255, 255, 255, 0.04);
    --border-gold: rgba(212, 175, 55, 0.3);
    --border-subtle: rgba(255, 255, 255, 0.07);
    --gold: #d4af37;
    --gold-light: #f0d78c;
    --gold-dark: #b8941f;
    --text-white: #ffffff;
    --text-light: rgba(255, 255, 255, 0.7);
    --text-dim: rgba(255, 255, 255, 0.4);
    --font-sans: 'Inter', -apple-system, sans-serif;
    --font-display: 'Playfair Display', serif;
    --sidebar-w: 240px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body.dashboard {
    font-family: var(--font-sans);
    background: var(--bg-deep);
    color: var(--text-white);
    min-height: 100vh;
    display: flex;
}

/* ============================================================
   侧边栏 | Sidebar
   ============================================================ */
.sidebar {
    position: fixed;
    top: 0; left: 0;
    width: var(--sidebar-w);
    height: 100vh;
    background: var(--bg-sidebar);
    border-right: 1px solid var(--border-subtle);
    display: flex;
    flex-direction: column;
    z-index: 200;
    transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

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

.sidebar-logo {
    width: 40px; height: 40px;
    object-fit: contain;
    flex-shrink: 0;
    filter: drop-shadow(0 2px 8px rgba(212, 175, 55, 0.25));
}

.sidebar-title {
    font-family: var(--font-display);
    font-size: 18px; font-weight: 600;
    background: linear-gradient(135deg, var(--gold-light) 0%, var(--gold) 100%);
    -webkit-background-clip: text; -webkit-text-fill-color: transparent;
    background-clip: text; line-height: 1.2;
}

.sidebar-subtitle {
    font-size: 10px; color: var(--text-dim);
    letter-spacing: 2px; text-transform: uppercase;
}

.sidebar-nav {
    flex: 1;
    padding: 12px 12px;
    display: flex; flex-direction: column; gap: 2px;
    overflow-y: auto;
}

.sidebar-link {
    display: flex; align-items: center; gap: 12px;
    width: 100%;
    padding: 11px 14px;
    background: transparent;
    border: none; border-radius: 8px;
    color: var(--text-dim);
    font-size: 14px; font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: var(--font-sans);
    text-align: left;
}

.sidebar-link svg {
    width: 18px; height: 18px; flex-shrink: 0;
}

.sidebar-link:hover {
    background: rgba(255, 255, 255, 0.04);
    color: var(--text-light);
}

.sidebar-link.active {
    background: rgba(212, 175, 55, 0.12);
    color: var(--gold);
}

.sidebar-footer {
    padding: 12px;
    border-top: 1px solid var(--border-subtle);
    display: flex; flex-direction: column; gap: 4px;
}

.sidebar-back, .sidebar-logout {
    display: flex; align-items: center; gap: 10px;
    width: 100%;
    padding: 10px 14px;
    border-radius: 8px;
    font-size: 13px; font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    font-family: var(--font-sans);
}
.sidebar-back svg, .sidebar-logout svg { width: 16px; height: 16px; flex-shrink: 0; }

.sidebar-back {
    background: transparent; border: none;
    color: var(--text-dim);
}
.sidebar-back:hover { background: rgba(255, 255, 255, 0.04); color: var(--text-light); }

.sidebar-logout {
    background: rgba(255, 107, 107, 0.06); border: none;
    color: #ff8a8a;
}
.sidebar-logout:hover { background: rgba(255, 107, 107, 0.14); }

/* ============================================================
   移动端切换按钮 | Mobile Toggle
   ============================================================ */
.mobile-toggle {
    display: none;
    position: fixed; top: 12px; left: 12px;
    z-index: 250;
    width: 40px; height: 40px;
    background: var(--bg-sidebar);
    border: 1px solid var(--border-subtle);
    border-radius: 8px;
    cursor: pointer;
    flex-direction: column;
    align-items: center; justify-content: center;
    gap: 5px;
    padding: 10px 8px;
}

.mobile-toggle span {
    display: block; width: 20px; height: 2px;
    background: var(--text-light);
    border-radius: 1px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ============================================================
   主内容区 | Main Content
   ============================================================ */
.main-content {
    margin-left: var(--sidebar-w);
    flex: 1;
    min-height: 100vh;
    display: flex; flex-direction: column;
    background: var(--bg-main);
    min-width: 0;
}

/* 顶部栏 | Topbar */
.topbar {
    position: sticky; top: 0; z-index: 100;
    padding: 16px 32px;
    background: var(--bg-sidebar);
    border-bottom: 1px solid var(--border-subtle);
    display: flex; justify-content: space-between; align-items: center;
    backdrop-filter: blur(12px);
}

.topbar-title {
    font-family: var(--font-display);
    font-size: 20px; font-weight: 600;
    color: var(--text-white);
}

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

.lang-switcher {
    display: flex; align-items: center; gap: 2px;
    padding: 3px; border-radius: 20px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border-subtle);
}

.lang-btn {
    padding: 5px 13px;
    border: none; background: transparent;
    color: var(--text-dim);
    font-size: 12px; font-weight: 500;
    cursor: pointer;
    transition: all 0.25s ease;
    font-family: var(--font-sans);
    border-radius: 16px;
}
.lang-btn:hover { color: var(--text-white); }
.lang-btn.active {
    color: var(--bg-sidebar);
    background: linear-gradient(135deg, var(--gold) 0%, var(--gold-dark) 100%);
    font-weight: 600;
}

/* ============================================================
   页面切换 | Page Switching
   ============================================================ */
.page { display: none; padding: 32px; flex: 1; }
.page.active { display: block; }

.page-header { margin-bottom: 28px; }
.page-header h2 {
    font-family: var(--font-display);
    font-size: 24px; font-weight: 600; margin-bottom: 6px;
    background: linear-gradient(135deg, #fff 0%, rgba(255,255,255,0.7) 100%);
    -webkit-background-clip: text; -webkit-text-fill-color: transparent;
    background-clip: text;
}
.page-header p { color: var(--text-dim); font-size: 14px; }

/* ============================================================
   统计卡片 | Stats Grid
   ============================================================ */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: 14px;
    padding: 24px;
    display: flex; align-items: center; gap: 16px;
    transition: all 0.3s ease;
}
.stat-card:hover {
    border-color: var(--border-gold);
    background: var(--bg-card-hover);
    transform: translateY(-2px);
}

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

.stat-info { min-width: 0; }

.stat-num {
    font-family: var(--font-display);
    font-size: 30px; font-weight: 600;
    background: linear-gradient(135deg, var(--gold-light) 0%, var(--gold) 100%);
    -webkit-background-clip: text; -webkit-text-fill-color: transparent;
    background-clip: text; line-height: 1.2;
}

.stat-desc {
    font-size: 12px; color: var(--text-dim);
    letter-spacing: 0.5px;
    margin-top: 4px;
}

/* ============================================================
   双列布局 | 2-Column Grid
   ============================================================ */
.dash-grid-2col {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 20px;
    margin-bottom: 20px;
}
.dash-grid-2col:last-child { margin-bottom: 0; }
/* 防止子内容（超长标题/表格）撑开 grid 列宽导致整页横向溢出 */
.dash-grid-2col > .dash-card { min-width: 0; }
@media (max-width: 900px) { .dash-grid-2col { grid-template-columns: 1fr; } }

.dash-card {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: 14px;
    padding: 24px;
}

.dash-card-title {
    font-size: 15px; font-weight: 600;
    color: var(--text-light);
    margin-bottom: 20px;
}

/* Quick actions */
.quick-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.quick-action {
    display: flex; flex-direction: column;
    align-items: center; gap: 10px;
    padding: 20px 12px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-subtle);
    border-radius: 10px;
    color: var(--text-dim);
    font-size: 13px; font-weight: 500;
    cursor: pointer;
    transition: all 0.25s ease;
    font-family: var(--font-sans);
}
.quick-action svg { width: 24px; height: 24px; }
.quick-action:hover {
    background: rgba(212, 175, 55, 0.06);
    border-color: var(--border-gold);
    color: var(--gold);
}

/* ============================================================
   表格 | Tables
   ============================================================ */
.dash-table {
    width: 100%;
    border-collapse: collapse;
}
.dash-table th {
    text-align: left;
    padding: 10px 14px;
    font-size: 11px; font-weight: 600;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 1px;
    border-bottom: 1px solid var(--border-subtle);
}
.dash-table td {
    padding: 12px 14px;
    font-size: 13px;
    color: var(--text-light);
    border-bottom: 1px solid var(--border-subtle);
}
.dash-table tr:last-child td { border-bottom: none; }
.dash-table tr:hover td { background: rgba(255, 255, 255, 0.015); }

.loading-cell { color: var(--text-dim); text-align: center !important; }

/* ============================================================
   世界地图 | World Map (ECharts)
   ============================================================ */
.world-map-container {
    position: relative;
    width: 100%;
    height: 420px;
    background: #0a0f1a;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid var(--border-subtle);
}
.world-map-loading {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-dim);
    font-size: 14px;
    z-index: 1;
}
/* 地图图例 | Map legend */
.dash-map-legend {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 12px;
    padding: 8px 4px 0;
    border-top: 1px solid var(--border-subtle);
}
.legend-item {
    display: flex; align-items: center; gap: 8px;
    font-size: 12px; color: var(--text-light);
}
.legend-dot {
    width: 10px; height: 10px;
    border-radius: 50%;
    background: var(--gold);
    box-shadow: 0 0 6px rgba(212, 175, 55, 0.5);
}
.legend-hint {
    font-size: 11px; color: var(--text-dim);
}

/* 国家列表 | Country List */
.country-list {
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.country-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    border-radius: 6px;
    transition: background 0.2s ease;
}
.country-item:hover {
    background: rgba(255, 255, 255, 0.02);
}
.country-flag {
    font-size: 18px;
    width: 24px;
    text-align: center;
    flex-shrink: 0;
}
.country-code {
    font-size: 11px;
    font-weight: 700;
    color: var(--gold);
    width: 28px;
    flex-shrink: 0;
    font-family: monospace;
}
.country-name {
    font-size: 13px;
    color: var(--text-light);
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.country-count {
    font-size: 13px;
    font-weight: 600;
    color: var(--gold);
    flex-shrink: 0;
}
.country-bar {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 2px;
    background: var(--gold);
    border-radius: 1px;
    opacity: 0.3;
}
.country-item { position: relative; overflow: hidden; }

/* 仪表板新闻列表 | Dashboard News List */
.dash-news-list {
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.dash-news-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: 6px;
    transition: background 0.2s ease;
    cursor: pointer;
}
.dash-news-item:hover {
    background: rgba(255, 255, 255, 0.02);
}
.dash-news-thumb {
    width: 48px;
    height: 36px;
    border-radius: 4px;
    object-fit: cover;
    flex-shrink: 0;
    background: var(--bg-card);
}
.dash-news-thumb-placeholder {
    width: 48px;
    height: 36px;
    border-radius: 4px;
    flex-shrink: 0;
    background: rgba(212, 175, 55, 0.08);
    display: flex;
    align-items: center;
    justify-content: center;
}
.dash-news-thumb-placeholder svg {
    width: 18px;
    height: 18px;
    color: var(--text-dim);
}
.dash-news-info {
    flex: 1;
    overflow: hidden;
}
.dash-news-title {
    font-size: 13px;
    color: var(--text-light);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    margin-bottom: 2px;
}
.dash-news-meta {
    font-size: 11px;
    color: var(--text-dim);
    display: flex;
    gap: 8px;
    align-items: center;
}
.dash-news-badge {
    font-size: 10px;
    padding: 1px 6px;
    border-radius: 3px;
    font-weight: 600;
}
.dash-news-badge.published { background: rgba(76, 175, 80, 0.15); color: #66bb6a; }
.dash-news-badge.unpublished { background: rgba(239, 83, 80, 0.15); color: #ef5350; }

/* ============================================================
   表单卡片 | Form Card
   ============================================================ */
.form-card {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: 14px;
    padding: 32px;
}

.form-group { margin-bottom: 22px; }
.form-group:last-child { margin-bottom: 0; }

.form-group label {
    display: block;
    font-size: 11px; font-weight: 500;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 1.5px;
    margin-bottom: 10px;
}

.form-group input[type="text"],
.form-group input[type="password"],
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 12px 15px;
    background: var(--bg-input);
    border: 1px solid var(--border-subtle);
    border-radius: 8px;
    color: var(--text-white);
    font-size: 14px;
    font-family: var(--font-sans);
    transition: all 0.25s ease;
}
.form-group input[type="text"]:focus,
.form-group input[type="password"]:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--gold);
    background: rgba(212, 175, 55, 0.04);
    box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.06);
}
.form-group textarea { resize: vertical; min-height: 80px; }

.input-row {
    display: flex; gap: 10px;
}
.input-row input { flex: 1; }

.range-label {
    display: inline-block;
    margin-left: 10px;
    color: var(--gold);
    font-weight: 600;
    font-size: 14px;
}

.radio-group { display: flex; gap: 24px; }
.radio-label {
    display: flex; align-items: center; gap: 8px;
    cursor: pointer; font-size: 14px; color: var(--text-light);
}
.radio-label input[type="radio"] {
    width: 16px; height: 16px; accent-color: var(--gold);
}

.form-group input[type="range"] {
    width: 100%; height: 6px;
    -webkit-appearance: none; appearance: none;
    background: var(--bg-input); border-radius: 3px; cursor: pointer;
}
.form-group input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none; appearance: none;
    width: 18px; height: 18px;
    background: var(--gold); border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(212, 175, 55, 0.4);
}

.hint { font-size: 12px; color: var(--text-dim); margin-top: 8px; }

/* Buttons */
.btn-primary {
    padding: 11px 26px;
    background: linear-gradient(135deg, var(--gold) 0%, var(--gold-dark) 100%);
    border: none; color: #0a0a16;
    font-size: 14px; font-weight: 600;
    cursor: pointer; border-radius: 8px;
    font-family: var(--font-sans);
    box-shadow: 0 4px 16px rgba(212, 175, 55, 0.2);
    transition: all 0.25s ease;
}
.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 24px rgba(212, 175, 55, 0.35);
}

.btn-secondary {
    padding: 11px 26px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border-subtle);
    color: var(--text-light);
    font-size: 14px; font-weight: 500;
    cursor: pointer; border-radius: 8px;
    font-family: var(--font-sans);
    transition: all 0.25s ease;
}
.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.15);
    color: var(--text-white);
}

.btn-danger {
    padding: 11px 26px;
    background: rgba(255, 107, 107, 0.08);
    border: 1px solid rgba(255, 107, 107, 0.2);
    color: #ff8a8a;
    font-size: 14px; font-weight: 500;
    cursor: pointer; border-radius: 8px;
    font-family: var(--font-sans);
    transition: all 0.25s ease;
}
.btn-danger:hover {
    background: rgba(255, 107, 107, 0.15);
    border-color: rgba(255, 107, 107, 0.4);
}

.btn-small { padding: 7px 14px; font-size: 12px; }

.btn-remove {
    padding: 7px 10px;
    background: rgba(255, 107, 107, 0.08);
    border: 1px solid rgba(255, 107, 107, 0.2);
    color: #ff8a8a;
    font-size: 13px; cursor: pointer; border-radius: 6px;
    transition: all 0.25s ease;
}
.btn-remove:hover { background: rgba(255, 107, 107, 0.15); }

.form-actions {
    display: flex; gap: 14px;
    padding-top: 22px;
    border-top: 1px solid var(--border-subtle);
}

/* ============================================================
   预览框 | Preview
   ============================================================ */
.preview-box {
    width: 100%; height: 200px;
    background: var(--bg-input);
    border: 1px dashed var(--border-subtle);
    border-radius: 8px;
    display: flex; align-items: center; justify-content: center;
    overflow: hidden; position: relative;
}
.preview-box img, .preview-box video {
    width: 100%; height: 100%; object-fit: cover;
}
.preview-placeholder { text-align: center; color: var(--text-dim); }
.preview-placeholder p { font-size: 14px; }

/* ============================================================
   产品管理 | Products
   ============================================================ */
.toolbar {
    display: flex; justify-content: space-between; align-items: center;
    margin-bottom: 20px;
}
.toolbar-hint { font-size: 13px; color: var(--text-dim); }
.toolbar-hint strong { color: var(--gold); }

.product-list-container {
    display: flex; flex-direction: column; gap: 16px;
}

.product-card {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: 14px;
    padding: 24px;
}
.product-card-header {
    display: flex; justify-content: space-between; align-items: center;
    margin-bottom: 20px;
    padding-bottom: 14px;
    border-bottom: 1px solid var(--border-subtle);
}
.product-card-title { font-size: 15px; font-weight: 600; color: var(--gold); }

/* 产品卡片折叠/展开 */
.product-card-header { cursor: pointer; user-select: none; }
.product-card-actions { display: flex; align-items: center; gap: 6px; }
.btn-toggle {
    width: 28px; height: 28px;
    display: flex; align-items: center; justify-content: center;
    background: transparent;
    border: 1px solid var(--border-subtle);
    border-radius: 6px;
    color: var(--text-dim);
    cursor: pointer;
    transition: all 0.2s ease;
    padding: 0;
}
.btn-toggle:hover { color: var(--gold); border-color: var(--gold); background: rgba(212,175,55,0.08); }
.btn-toggle svg { width: 14px; height: 14px; }
.toggle-icon { transition: transform 0.3s ease; }
.product-card-body {
    overflow: hidden;
    transition: max-height 0.35s ease, opacity 0.25s ease, padding 0.25s ease, margin 0.25s ease;
    max-height: 2000px;
    opacity: 1;
}
.product-card-body.collapsed {
    max-height: 0;
    opacity: 0;
    padding-top: 0; padding-bottom: 0;
    margin-top: 0; margin-bottom: 0;
}
/* 折叠状态：header 去掉下划线和底部间距 */
.product-card.card-collapsed .product-card-header {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: 1px solid transparent;
}
.product-card.card-collapsed { padding-bottom: 18px; }

.specs-container { display: flex; flex-direction: column; gap: 10px; margin-bottom: 14px; }

.spec-row { display: flex; gap: 10px; }
.spec-row input {
    flex: 1;
    padding: 10px 12px;
    background: var(--bg-input);
    border: 1px solid var(--border-subtle);
    border-radius: 6px;
    color: var(--text-white);
    font-size: 13px;
    font-family: var(--font-sans);
}
.spec-row input:focus { outline: none; border-color: var(--gold); }
.spec-value { flex: 0.5 !important; }
.spec-unit { flex: 0.3 !important; }
.spec-label { flex: 1 !important; }

/* ============================================================
   数据库管理 | Database
   ============================================================ */
.info-list {
    display: flex; flex-direction: column; gap: 2px;
}
.info-row {
    display: flex; justify-content: space-between; align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid var(--border-subtle);
    font-size: 13px;
}
.info-row:last-child { border-bottom: none; }
.info-label { color: var(--text-dim); }
.info-value { color: var(--text-light); font-family: monospace; font-size: 12px; }

.db-actions {
    display: flex; gap: 10px; flex-wrap: wrap;
}

.status-online { color: #66bb6a; }
.status-offline { color: #ff8a8a; }

/* ============================================================
   操作日志 | Operation Logs
   ============================================================ */
.logs-toolbar {
    display: flex; justify-content: space-between; align-items: center;
    flex-wrap: wrap; gap: 12px;
}

.log-filters { display: flex; gap: 4px; flex-wrap: wrap; }

.log-filter-btn {
    padding: 6px 14px;
    border: 1px solid var(--border-subtle);
    background: transparent;
    color: var(--text-dim);
    font-size: 12px; font-weight: 500;
    cursor: pointer; border-radius: 16px;
    font-family: var(--font-sans);
    transition: all 0.2s ease;
}
.log-filter-btn:hover { color: var(--text-light); border-color: rgba(255, 255, 255, 0.15); }
.log-filter-btn.active {
    color: var(--gold);
    border-color: var(--border-gold);
    background: rgba(212, 175, 55, 0.08);
}

.log-search { display: flex; gap: 8px; }
.log-search input {
    padding: 7px 14px;
    background: var(--bg-input);
    border: 1px solid var(--border-subtle);
    border-radius: 8px;
    color: var(--text-white);
    font-size: 13px;
    font-family: var(--font-sans);
    width: 180px;
    transition: all 0.25s ease;
}
.log-search input:focus { outline: none; border-color: var(--gold); }
.log-search input::placeholder { color: var(--text-dim); }

.logs-table { margin-bottom: 0; }

.logs-table th:nth-child(1) { width: 160px; }
.logs-table th:nth-child(2) { width: 80px; }
.logs-table th:nth-child(3) { width: 100px; }
.logs-table th:nth-child(5) { width: 120px; }

.log-time { font-family: monospace; font-size: 12px; color: var(--text-dim); }
.log-user { color: var(--gold-light); font-weight: 500; }

.log-badge {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 10px;
    font-size: 11px; font-weight: 600;
}
.badge-success { background: rgba(76, 175, 80, 0.15); color: #66bb6a; }
.badge-danger { background: rgba(255, 107, 107, 0.12); color: #ff8a8a; }
.badge-warning { background: rgba(255, 183, 77, 0.12); color: #ffa726; }
.badge-info { background: rgba(33, 150, 243, 0.12); color: #42a5f5; }
.badge-default { background: rgba(255, 255, 255, 0.06); color: var(--text-dim); }

.log-detail { max-width: 300px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.log-ip { font-family: monospace; font-size: 12px; color: var(--text-dim); }

.logs-footer {
    display: flex; justify-content: space-between; align-items: center;
    padding: 16px 0 0;
    border-top: 1px solid var(--border-subtle);
    margin-top: 12px;
}
.logs-total { font-size: 13px; color: var(--text-dim); }
.logs-total strong { color: var(--gold); }

.logs-pagination { display: flex; align-items: center; gap: 10px; }
.pg-btn {
    padding: 6px 14px;
    background: var(--bg-input);
    border: 1px solid var(--border-subtle);
    color: var(--text-dim);
    font-size: 12px; font-weight: 500;
    cursor: pointer; border-radius: 6px;
    font-family: var(--font-sans);
    transition: all 0.2s ease;
}
.pg-btn:hover:not(:disabled) {
    border-color: var(--border-gold);
    color: var(--gold);
}
.pg-btn:disabled { opacity: 0.3; cursor: default; }
.pg-info { font-size: 12px; color: var(--text-dim); letter-spacing: 0.5px; }

/* ============================================================
   新闻管理 | News Management
   ============================================================ */
.news-card {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: 10px;
    padding: 18px 20px;
    margin-bottom: 14px;
    display: flex;
    align-items: flex-start;
    gap: 16px;
    transition: border-color 0.2s ease;
}
.news-card:hover { border-color: var(--border-gold); }

.news-card-thumb {
    width: 80px; height: 60px;
    border-radius: 6px;
    object-fit: cover;
    flex-shrink: 0;
    background: var(--bg-input);
}
.news-card-thumb-placeholder {
    width: 80px; height: 60px;
    border-radius: 6px;
    flex-shrink: 0;
    background: var(--bg-input);
    display: flex; align-items: center; justify-content: center;
    color: var(--text-dim); font-size: 22px;
}

.news-card-body { flex: 1; min-width: 0; }
.news-card-title {
    font-size: 15px; font-weight: 600;
    color: var(--text-light);
    margin-bottom: 4px;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.news-card-meta {
    display: flex; align-items: center; gap: 10px;
    font-size: 12px; color: var(--text-dim);
    margin-bottom: 6px;
}
.news-card-category {
    display: inline-block;
    padding: 1px 8px;
    border-radius: 8px;
    background: rgba(212,175,55,0.12);
    color: var(--gold-light);
    font-size: 11px; font-weight: 500;
}
.news-card-summary {
    font-size: 13px; color: var(--text-dim);
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}
.news-card-actions {
    display: flex; flex-direction: column; gap: 6px;
    flex-shrink: 0;
}
.news-card-actions .btn-small { font-size: 12px; padding: 5px 12px; }
.news-status-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 8px;
    font-size: 11px; font-weight: 500;
}
.news-status-published { background: rgba(76,175,80,0.15); color: #66bb6a; }
.news-status-draft { background: rgba(255,183,77,0.12); color: #ffa726; }

.news-empty {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-dim);
    font-size: 14px;
}

/* ----- 新闻编辑弹窗 | News Editor Modal ----- */
.news-editor-overlay {
    position: fixed; inset: 0;
    background: rgba(0,0,0,0.65);
    backdrop-filter: blur(6px);
    z-index: 500;
    display: flex; align-items: center; justify-content: center;
    padding: 20px;
}
.news-editor-modal {
    background: var(--bg-sidebar);
    border: 1px solid var(--border-gold);
    border-radius: 12px;
    width: 100%; max-width: 680px;
    max-height: 90vh;
    display: flex; flex-direction: column;
    box-shadow: 0 20px 60px rgba(0,0,0,0.6);
}
.news-editor-header {
    display: flex; justify-content: space-between; align-items: center;
    padding: 18px 24px;
    border-bottom: 1px solid var(--border-subtle);
}
.news-editor-header h3 {
    font-size: 16px; font-weight: 600;
    color: var(--gold-light);
    margin: 0;
}
.news-editor-close {
    background: none; border: none;
    color: var(--text-dim);
    cursor: pointer; padding: 4px;
    border-radius: 6px;
    display: flex; align-items: center; justify-content: center;
    transition: all 0.2s ease;
}
.news-editor-close svg { width: 20px; height: 20px; }
.news-editor-close:hover { color: var(--gold); background: rgba(212,175,55,0.1); }

.news-editor-body {
    padding: 20px 24px;
    overflow-y: auto;
    flex: 1;
}
.news-editor-body .form-group { margin-bottom: 16px; }
.news-editor-body label {
    display: block;
    font-size: 13px; font-weight: 500;
    color: var(--text-dim);
    margin-bottom: 6px;
}
.news-edit-input {
    width: 100%;
    padding: 10px 14px;
    background: var(--bg-input);
    border: 1px solid var(--border-subtle);
    border-radius: 8px;
    color: var(--text-light);
    font-size: 14px;
    font-family: var(--font-sans);
    transition: border-color 0.2s ease;
    box-sizing: border-box;
}
.news-edit-input:focus {
    outline: none;
    border-color: var(--border-gold);
}
textarea.news-edit-input {
    resize: vertical;
    line-height: 1.6;
    min-height: 38px;
}
.radio-label {
    display: flex; align-items: center; gap: 8px;
    cursor: pointer;
    color: var(--text-light);
    font-size: 14px;
}
.radio-label input[type="checkbox"] {
    width: 16px; height: 16px;
    accent-color: var(--gold);
    cursor: pointer;
}

/* ===== 封面图片上传 | Cover Image Upload ===== */
.news-cover-upload {
    display: flex;
    gap: 16px;
    align-items: flex-start;
}
.news-cover-preview {
    width: 200px;
    height: 130px;
    flex-shrink: 0;
    border: 2px dashed var(--border-subtle);
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    cursor: pointer;
    transition: border-color 0.2s ease;
    overflow: hidden;
    position: relative;
    background: var(--bg-input);
    color: var(--text-dim);
}
.news-cover-preview:hover {
    border-color: var(--border-gold);
}
.news-cover-preview svg {
    opacity: 0.4;
}
.news-cover-preview span {
    font-size: 12px;
    text-align: center;
    padding: 0 12px;
}
.news-cover-preview img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.news-cover-preview.has-image svg,
.news-cover-preview.has-image span {
    display: none;
}
.news-cover-actions {
    flex: 1;
    min-width: 0;
}
.news-cover-actions .btn-small {
    margin-right: 8px;
}

/* ===== 富文本编辑器 | Rich Text Editor ===== */
.news-rich-editor {
    border: 1px solid var(--border-subtle);
    border-radius: 8px;
    overflow: hidden;
    background: var(--bg-input);
}
.news-editor-toolbar {
    display: flex;
    align-items: center;
    gap: 2px;
    padding: 8px 10px;
    background: rgba(255,255,255,0.03);
    border-bottom: 1px solid var(--border-subtle);
    flex-wrap: wrap;
}
.rte-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 32px;
    height: 32px;
    padding: 0 8px;
    background: transparent;
    border: 1px solid transparent;
    border-radius: 6px;
    color: var(--text-dim);
    font-size: 14px;
    font-family: var(--font-sans);
    cursor: pointer;
    transition: all 0.15s ease;
}
.rte-btn:hover {
    background: rgba(212,175,55,0.1);
    border-color: var(--border-gold);
    color: var(--gold-light);
}
.rte-btn:active {
    transform: scale(0.95);
}
.rte-btn svg {
    pointer-events: none;
}
.rte-divider {
    display: inline-block;
    width: 1px;
    height: 20px;
    background: var(--border-subtle);
    margin: 0 4px;
}
.news-editor-content {
    min-height: 300px;
    max-height: 500px;
    overflow-y: auto;
    padding: 16px 18px;
    color: var(--text-light);
    font-size: 14px;
    font-family: var(--font-sans);
    line-height: 1.7;
    outline: none;
}
.news-editor-content:empty::before {
    content: attr(data-placeholder);
    color: var(--text-dim);
    opacity: 0.5;
    pointer-events: none;
}
.news-editor-content:focus {
    outline: none;
}
.news-editor-content h2 {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-light);
    margin: 16px 0 8px;
}
.news-editor-content h3 {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-light);
    margin: 12px 0 6px;
}
.news-editor-content p {
    margin: 8px 0;
}
.news-editor-content img {
    max-width: 100%;
    height: auto;
    border-radius: 6px;
    margin: 10px 0;
    display: block;
}
.news-editor-content ul,
.news-editor-content ol {
    margin: 8px 0;
    padding-left: 24px;
}
.news-editor-content li {
    margin: 4px 0;
}
.news-editor-content a {
    color: var(--gold-light);
    text-decoration: underline;
}

/* ===== 新闻编辑器弹窗适配 | News Editor Modal Responsive ===== */
@media (max-width: 768px) {
    .news-cover-upload {
        flex-direction: column;
    }
    .news-cover-preview {
        width: 100%;
        height: 160px;
    }
    .news-editor-toolbar {
        gap: 1px;
        padding: 6px;
    }
    .rte-btn {
        min-width: 28px;
        height: 28px;
        padding: 0 6px;
        font-size: 12px;
    }
}

.news-editor-footer {
    display: flex; justify-content: flex-end; gap: 10px;
    padding: 16px 24px;
    border-top: 1px solid var(--border-subtle);
}
.news-editor-footer .btn-primary,
.news-editor-footer .btn-secondary { min-width: 90px; }

/* ============================================================
   Toast
   ============================================================ */
.toast {
    position: fixed; top: 28px; left: 50%;
    transform: translateX(-50%) translateY(-20px);
    padding: 13px 26px;
    background: rgba(18, 18, 30, 0.97);
    border: 1px solid var(--border-gold);
    color: var(--gold-light);
    font-size: 14px; border-radius: 8px;
    opacity: 0; pointer-events: none;
    transition: all 0.3s ease;
    z-index: 1000;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.6);
}
.toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* ============================================================
   侧边栏遮罩 | Sidebar Overlay (mobile)
   ============================================================ */
.sidebar-overlay {
    display: none;
    position: fixed; inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 190;
    backdrop-filter: blur(4px);
}

/* ============================================================
   响应式 | Responsive
   ============================================================ */
@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
        box-shadow: none;
    }
    .sidebar.open {
        transform: translateX(0);
        box-shadow: 8px 0 32px rgba(0,0,0,0.5);
    }

    .sidebar-overlay.visible { display: block; }

    .mobile-toggle { display: flex; }

    .main-content { margin-left: 0; }

    .topbar { padding: 16px 20px; padding-left: 60px; }
    .topbar-title { font-size: 17px; }

    .page { padding: 20px; }

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

    .quick-actions { grid-template-columns: 1fr 1fr; }

    /* Dashboard 总览移动端适配 | Dashboard responsive */
    .dash-card { padding: 18px; }
    .dash-card-title { font-size: 14px; margin-bottom: 16px; }
    .world-map-container { height: 320px; }
    .dash-card:has(.dash-table) { overflow-x: auto; -webkit-overflow-scrolling: touch; }

    .form-card { padding: 20px; }

    .radio-group { flex-direction: column; gap: 10px; }
    .spec-row { flex-direction: column; }
    .form-actions { flex-direction: column; }
    .form-actions .btn-primary,
    .form-actions .btn-secondary { width: 100%; }

    .toolbar { flex-direction: column; gap: 10px; align-items: flex-start; }

    .db-actions { flex-direction: column; }
    .db-actions .btn-primary,
    .db-actions .btn-secondary,
    .db-actions .btn-danger { width: 100%; }
}

@media (max-width: 480px) {
    .stats-grid { grid-template-columns: 1fr; }
    .quick-actions { grid-template-columns: 1fr; }
    .dash-card { padding: 14px; }
    .dash-card-title { font-size: 13px; margin-bottom: 12px; }
    .world-map-container { height: 260px; }
    .dash-table th { padding: 8px 10px; font-size: 10px; }
    .dash-table td { padding: 10px 10px; font-size: 12px; }
}
