/* ============================================
   黔地香谱 · 数字化资产库
   深色科技风 Dashboard 样式表
   ============================================ */

/* ---------- CSS 变量 ---------- */
:root {
    /* 背景色 */
    --bg-deep: #070b14;
    --bg-main: #0d1117;
    --bg-card: #111827;
    --bg-card-hover: #1a2332;
    --bg-input: #0f1623;
    --bg-sidebar: #090d16;

    /* 边框色 */
    --border: #1e2d3d;
    --border-light: #2a3a4e;
    --border-glow: rgba(0, 212, 170, 0.3);

    /* 文字色 */
    --text-primary: #e2e8f0;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    --text-dark: #334155;

    /* 主色调 - 青绿色 */
    --primary: #00d4aa;
    --primary-light: #2dd4bf;
    --primary-dark: #00a88a;
    --primary-bg: rgba(0, 212, 170, 0.08);
    --primary-glow: rgba(0, 212, 170, 0.4);

    /* 辅助色 */
    --blue: #0ea5e9;
    --purple: #8b5cf6;
    --orange: #f59e0b;
    --red: #ef4444;
    --green: #22c55e;

    /* 品牌金色 - 仅用于强调 */
    --gold: #d4a853;
    --gold-light: #f0c674;

    /* 尺寸 */
    --sidebar-width: 240px;
    --sidebar-collapsed: 64px;
    --topbar-height: 56px;
    --radius: 8px;
    --radius-sm: 4px;
    --radius-lg: 12px;

    /* 阴影 */
    --shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    --shadow-glow: 0 0 20px rgba(0, 212, 170, 0.15);
    --shadow-card: 0 2px 12px rgba(0, 0, 0, 0.25);

    /* 过渡 */
    --transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ---------- 全局重置 ---------- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    height: 100%;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
    font-size: 14px;
    color: var(--text-primary);
    background: var(--bg-deep);
    overflow: hidden;
    -webkit-font-smoothing: antialiased;
}

/* 滚动条 */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: transparent;
}
::-webkit-scrollbar-thumb {
    background: var(--border-light);
    border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
    background: var(--primary-dark);
}

ul { list-style: none; }
a { color: inherit; text-decoration: none; }
button { cursor: pointer; border: none; background: none; color: inherit; font-family: inherit; }
input { font-family: inherit; outline: none; border: none; }

/* ---------- 加载动画 ---------- */
#loading-screen {
    position: fixed;
    inset: 0;
    background: var(--bg-deep);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    transition: opacity 0.5s, visibility 0.5s;
}
#loading-screen.hidden {
    opacity: 0;
    visibility: hidden;
}
.loading-content {
    text-align: center;
}
.loading-logo {
    font-size: 32px;
    font-weight: 700;
    color: var(--gold);
    letter-spacing: 8px;
    margin-bottom: 12px;
    text-shadow: 0 0 30px rgba(212, 168, 83, 0.3);
}
.loading-title {
    font-size: 18px;
    color: var(--text-secondary);
    margin-bottom: 32px;
    letter-spacing: 2px;
}
.loading-bar {
    width: 280px;
    height: 3px;
    background: var(--border);
    border-radius: 2px;
    margin: 0 auto 16px;
    overflow: hidden;
}
.loading-progress {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--primary-dark), var(--primary));
    border-radius: 2px;
    animation: loadingProgress 1.8s ease-out forwards;
    box-shadow: 0 0 10px var(--primary-glow);
}
@keyframes loadingProgress {
    0% { width: 0%; }
    60% { width: 75%; }
    100% { width: 100%; }
}
.loading-text {
    font-size: 12px;
    color: var(--text-muted);
}

/* ---------- 布局 ---------- */
.app-container {
    display: flex;
    height: 100vh;
    width: 100%;
}

/* ---------- 左侧导航 ---------- */
.sidebar {
    width: var(--sidebar-width);
    min-width: var(--sidebar-width);
    background: var(--bg-sidebar);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    transition: var(--transition);
    z-index: 100;
}
.sidebar.collapsed {
    width: var(--sidebar-collapsed);
    min-width: var(--sidebar-collapsed);
}
.sidebar.collapsed .logo-text,
.sidebar.collapsed .nav-label,
.sidebar.collapsed .nav-num,
.sidebar.collapsed .nav-section,
.sidebar.collapsed .sidebar-footer {
    display: none;
}

.sidebar-logo {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 20px 16px;
    border-bottom: 1px solid var(--border);
}
.logo-icon {
    width: 40px;
    height: 40px;
    min-width: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--gold);
    background: var(--primary-bg);
    border-radius: var(--radius);
    border: 1px solid rgba(212, 168, 83, 0.2);
}
.logo-icon svg { width: 26px; height: 26px; }
.brand-name {
    font-size: 16px;
    font-weight: 700;
    color: var(--gold);
    letter-spacing: 2px;
}
.platform-name {
    font-size: 13px;
    color: var(--text-primary);
    margin-top: 2px;
}
.platform-sub {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 1px;
}

.sidebar-nav {
    flex: 1;
    overflow-y: auto;
    padding: 12px 0;
}
.nav-section {
    font-size: 11px;
    color: var(--text-muted);
    padding: 8px 20px;
    letter-spacing: 1px;
    text-transform: uppercase;
}
.nav-list { padding: 0 8px; }
.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: var(--radius);
    cursor: pointer;
    transition: var(--transition);
    position: relative;
    margin-bottom: 2px;
    color: var(--text-secondary);
}
.nav-item:hover {
    background: var(--bg-card);
    color: var(--text-primary);
}
.nav-item:hover .nav-icon {
    color: var(--primary);
    box-shadow: 0 0 12px var(--primary-glow);
}
.nav-item.active {
    background: var(--primary-bg);
    color: var(--primary);
}
.nav-item.active::before {
    content: '';
    position: absolute;
    left: -8px;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 20px;
    background: var(--primary);
    border-radius: 0 2px 2px 0;
    box-shadow: 0 0 8px var(--primary-glow);
}
.nav-icon {
    width: 32px;
    height: 32px;
    min-width: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    transition: var(--transition);
}
.nav-icon svg { width: 18px; height: 18px; }
.nav-label {
    flex: 1;
    font-size: 13px;
}
.nav-num {
    font-size: 11px;
    color: var(--text-muted);
    font-family: "Courier New", monospace;
}
.nav-item.active .nav-num { color: var(--primary); }

.sidebar-footer {
    padding: 16px;
    border-top: 1px solid var(--border);
}
.system-status-mini {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: var(--text-secondary);
    margin-bottom: 6px;
}
.version-info {
    font-size: 11px;
    color: var(--text-muted);
}

/* ---------- 主内容区 ---------- */
.main-wrapper {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    min-width: 0;
}

/* ---------- 顶部栏 ---------- */
.topbar {
    height: var(--topbar-height);
    min-height: var(--topbar-height);
    background: rgba(13, 17, 23, 0.85);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    z-index: 50;
}
.topbar-left {
    display: flex;
    align-items: center;
    gap: 16px;
}
.sidebar-toggle {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    transition: var(--transition);
}
.sidebar-toggle:hover {
    background: var(--bg-card);
    color: var(--primary);
}
.sidebar-toggle svg { width: 18px; height: 18px; }
.breadcrumb {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
}
.breadcrumb-root { color: var(--text-muted); }
.breadcrumb-sep { color: var(--text-dark); }
.breadcrumb-current { color: var(--text-primary); font-weight: 500; }

.topbar-right {
    display: flex;
    align-items: center;
    gap: 16px;
}
.search-box {
    position: relative;
    width: 280px;
}
.search-icon {
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    width: 16px;
    height: 16px;
    color: var(--text-muted);
}
.search-box input {
    width: 100%;
    height: 36px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 0 12px 0 34px;
    color: var(--text-primary);
    font-size: 13px;
    transition: var(--transition);
}
.search-box input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-bg);
}
.search-box input::placeholder { color: var(--text-muted); }
.search-results {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    right: 0;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    max-height: 360px;
    overflow-y: auto;
    display: none;
    z-index: 200;
}
.search-results.show { display: block; }
.search-result-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    cursor: pointer;
    transition: var(--transition);
    border-bottom: 1px solid var(--border);
}
.search-result-item:last-child { border-bottom: none; }
.search-result-item:hover { background: var(--bg-card-hover); }
.search-result-type {
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 3px;
    background: var(--primary-bg);
    color: var(--primary);
    white-space: nowrap;
}
.search-result-name { font-size: 13px; color: var(--text-primary); flex: 1; }
.search-result-meta { font-size: 11px; color: var(--text-muted); }
.search-empty { padding: 24px; text-align: center; color: var(--text-muted); font-size: 13px; }

.topbar-status {
    display: flex;
    gap: 14px;
}
.status-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: var(--text-secondary);
}
.status-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--text-muted);
}
.status-dot.online {
    background: var(--green);
    box-shadow: 0 0 6px rgba(34, 197, 94, 0.5);
    animation: pulse 2s infinite;
}
@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}
.topbar-time {
    font-size: 12px;
    color: var(--text-secondary);
    font-family: "Courier New", monospace;
    padding: 4px 10px;
    background: var(--bg-input);
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
}
.icon-btn {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    transition: var(--transition);
    position: relative;
}
.icon-btn:hover { background: var(--bg-card); color: var(--primary); }
.icon-btn svg { width: 18px; height: 18px; }
.badge {
    position: absolute;
    top: 4px;
    right: 4px;
    min-width: 16px;
    height: 16px;
    background: var(--red);
    color: #fff;
    font-size: 10px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
}
.user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-dark), var(--primary));
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: var(--transition);
}
.user-avatar:hover { box-shadow: 0 0 12px var(--primary-glow); }

/* ---------- 内容区 ---------- */
.content-area {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    background: var(--bg-main);
    position: relative;
}
.page {
    animation: fadeIn 0.3s ease-out;
}
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ---------- 页面标题 ---------- */
.page-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 20px;
}
.page-title-group h1 {
    font-size: 22px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
}
.page-title-group .page-subtitle {
    font-size: 13px;
    color: var(--text-muted);
}
.page-actions {
    display: flex;
    gap: 10px;
}

/* ---------- 通用卡片 ---------- */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 18px;
    transition: var(--transition);
}
.card:hover {
    border-color: var(--border-light);
}
.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}
.card-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 8px;
}
.card-title::before {
    content: '';
    width: 3px;
    height: 14px;
    background: var(--primary);
    border-radius: 2px;
}
.card-action {
    font-size: 12px;
    color: var(--text-muted);
    cursor: pointer;
    transition: var(--transition);
}
.card-action:hover { color: var(--primary); }

/* ---------- 数据统计卡片 ---------- */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 14px;
    margin-bottom: 20px;
}
.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 16px;
    position: relative;
    overflow: hidden;
    transition: var(--transition);
    cursor: pointer;
}
.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--primary);
    opacity: 0;
    transition: var(--transition);
}
.stat-card:hover {
    border-color: var(--primary);
    box-shadow: var(--shadow-glow);
    transform: translateY(-2px);
}
.stat-card:hover::before { opacity: 1; }
.stat-card.purple::before { background: var(--purple); }
.stat-card.blue::before { background: var(--blue); }
.stat-card.orange::before { background: var(--orange); }
.stat-card.gold::before { background: var(--gold); }
.stat-card.green::before { background: var(--green); }

.stat-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}
.stat-icon {
    width: 38px;
    height: 38px;
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--primary-bg);
    color: var(--primary);
}
.stat-card.purple .stat-icon { background: rgba(139, 92, 246, 0.1); color: var(--purple); }
.stat-card.blue .stat-icon { background: rgba(14, 165, 233, 0.1); color: var(--blue); }
.stat-card.orange .stat-icon { background: rgba(245, 158, 11, 0.1); color: var(--orange); }
.stat-card.gold .stat-icon { background: rgba(212, 168, 83, 0.1); color: var(--gold); }
.stat-card.green .stat-icon { background: rgba(34, 197, 94, 0.1); color: var(--green); }
.stat-icon svg { width: 20px; height: 20px; }
.stat-trend {
    font-size: 11px;
    padding: 2px 6px;
    border-radius: 4px;
    background: rgba(34, 197, 94, 0.1);
    color: var(--green);
    display: flex;
    align-items: center;
    gap: 2px;
}
.stat-trend.down { background: rgba(239, 68, 68, 0.1); color: var(--red); }
.stat-label {
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 6px;
}
.stat-value {
    font-size: 28px;
    font-weight: 700;
    color: var(--text-primary);
    font-family: "Courier New", "DIN", monospace;
    line-height: 1;
    margin-bottom: 8px;
}
.stat-sparkline {
    height: 28px;
    width: 100%;
}

/* ---------- Dashboard 主网格 ---------- */
.dashboard-grid {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 16px;
    margin-bottom: 16px;
}
.dashboard-grid .span-2 { grid-column: span 2; }
.dashboard-grid .span-3 { grid-column: span 3; }

.chart-container {
    width: 100%;
    height: 280px;
}
.chart-container.sm { height: 200px; }
.chart-container.lg { height: 360px; }

/* ---------- 香材分类统计 ---------- */
.category-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
    margin-top: 14px;
}
.category-stat-item {
    text-align: center;
    padding: 10px 6px;
    background: var(--bg-input);
    border-radius: var(--radius);
    border: 1px solid var(--border);
}
.category-stat-num {
    font-size: 18px;
    font-weight: 700;
    color: var(--primary);
    font-family: "Courier New", monospace;
}
.category-stat-label {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 2px;
}

/* ---------- 贵州地图 ---------- */
.guizhou-map {
    width: 100%;
    height: 300px;
    position: relative;
}
.guizhou-map svg {
    width: 100%;
    height: 100%;
}
.map-region {
    cursor: pointer;
    transition: var(--transition);
    stroke: var(--border-light);
    stroke-width: 1;
}
.map-region:hover {
    filter: brightness(1.3);
    stroke: var(--primary);
    stroke-width: 1.5;
}
.map-region.active {
    stroke: var(--primary);
    stroke-width: 2;
    filter: drop-shadow(0 0 8px var(--primary-glow));
}
.map-label {
    font-size: 11px;
    fill: var(--text-secondary);
    pointer-events: none;
    text-anchor: middle;
}
.map-legend {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-top: 10px;
    font-size: 11px;
    color: var(--text-muted);
}
.map-legend-item {
    display: flex;
    align-items: center;
    gap: 4px;
}
.map-legend-color {
    width: 14px;
    height: 10px;
    border-radius: 2px;
}

/* 地图弹窗 */
.region-popup {
    position: fixed;
    background: var(--bg-card);
    border: 1px solid var(--primary);
    border-radius: var(--radius);
    padding: 14px;
    box-shadow: var(--shadow-glow);
    z-index: 300;
    display: none;
    min-width: 180px;
    pointer-events: none;
}
.region-popup.show { display: block; }
.region-popup-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--primary);
    margin-bottom: 10px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border);
}
.region-popup-row {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    margin-bottom: 6px;
}
.region-popup-row:last-child { margin-bottom: 0; }
.region-popup-label { color: var(--text-muted); }
.region-popup-value { color: var(--text-primary); font-weight: 600; font-family: "Courier New", monospace; }

/* ---------- 香材卡片网格 ---------- */
.herb-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 12px;
}
.herb-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    cursor: pointer;
    transition: var(--transition);
}
.herb-card:hover {
    border-color: var(--primary);
    box-shadow: var(--shadow-glow);
    transform: translateY(-3px);
}
.herb-card-image {
    width: 100%;
    height: 100px;
    background: var(--bg-input);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}
.herb-card-image svg { width: 48px; height: 48px; color: var(--primary); opacity: 0.6; }
.herb-card-image .herb-img-bg {
    position: absolute;
    inset: 0;
    opacity: 0.15;
}
.herb-card-body {
    padding: 10px 12px;
}
.herb-card-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
}
.herb-card-category {
    font-size: 11px;
    color: var(--primary);
    background: var(--primary-bg);
    padding: 1px 6px;
    border-radius: 3px;
    display: inline-block;
    margin-bottom: 8px;
}
.herb-card-meta {
    font-size: 11px;
    color: var(--text-muted);
    line-height: 1.6;
}
.herb-card-meta span { display: block; }
.herb-card-status {
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.herb-card-id {
    font-size: 10px;
    color: var(--text-dark);
    font-family: "Courier New", monospace;
}

/* ---------- 状态标签 ---------- */
.status-tag {
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 3px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}
.status-tag::before {
    content: '';
    width: 5px;
    height: 5px;
    border-radius: 50%;
}
.status-tag.archived { background: rgba(34, 197, 94, 0.1); color: var(--green); }
.status-tag.archived::before { background: var(--green); }
.status-tag.pending { background: rgba(245, 158, 11, 0.1); color: var(--orange); }
.status-tag.pending::before { background: var(--orange); }
.status-tag.processing { background: rgba(14, 165, 233, 0.1); color: var(--blue); }
.status-tag.processing::before { background: var(--blue); }
.status-tag.updated { background: rgba(139, 92, 246, 0.1); color: var(--purple); }
.status-tag.updated::before { background: var(--purple); }

/* ---------- 数据表格 ---------- */
.data-table-wrapper {
    overflow-x: auto;
    border-radius: var(--radius);
}
.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}
.data-table thead th {
    background: var(--bg-input);
    color: var(--text-secondary);
    font-weight: 500;
    text-align: left;
    padding: 10px 14px;
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
    cursor: pointer;
    user-select: none;
    transition: var(--transition);
}
.data-table thead th:hover { color: var(--primary); }
.data-table thead th .sort-icon {
    display: inline-block;
    margin-left: 4px;
    font-size: 10px;
    opacity: 0.4;
}
.data-table thead th.sort-asc .sort-icon,
.data-table thead th.sort-desc .sort-icon {
    opacity: 1;
    color: var(--primary);
}
.data-table tbody td {
    padding: 10px 14px;
    border-bottom: 1px solid var(--border);
    color: var(--text-secondary);
    white-space: nowrap;
}
.data-table tbody tr {
    transition: var(--transition);
    cursor: pointer;
}
.data-table tbody tr:hover {
    background: var(--bg-card-hover);
}
.data-table tbody tr:hover td { color: var(--text-primary); }
.data-table .col-id {
    font-family: "Courier New", monospace;
    color: var(--text-muted);
    font-size: 12px;
}
.data-table .col-name {
    color: var(--text-primary);
    font-weight: 500;
}

/* ---------- 分页 ---------- */
.pagination {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 14px;
    padding-top: 14px;
    border-top: 1px solid var(--border);
}
.pagination-info {
    font-size: 12px;
    color: var(--text-muted);
}
.pagination-controls {
    display: flex;
    gap: 4px;
}
.page-btn {
    min-width: 30px;
    height: 30px;
    padding: 0 8px;
    border-radius: var(--radius-sm);
    background: var(--bg-input);
    border: 1px solid var(--border);
    color: var(--text-secondary);
    font-size: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}
.page-btn:hover:not(:disabled) {
    border-color: var(--primary);
    color: var(--primary);
}
.page-btn.active {
    background: var(--primary);
    border-color: var(--primary);
    color: var(--bg-deep);
    font-weight: 600;
}
.page-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

/* ---------- 近期更新列表 ---------- */
.update-list {
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.update-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 8px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: var(--transition);
}
.update-item:hover { background: var(--bg-card-hover); }
.update-icon {
    width: 32px;
    height: 32px;
    min-width: 32px;
    border-radius: var(--radius-sm);
    background: var(--primary-bg);
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
}
.update-icon svg { width: 16px; height: 16px; }
.update-info { flex: 1; min-width: 0; }
.update-name {
    font-size: 13px;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.update-meta {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 2px;
}
.update-date {
    font-size: 11px;
    color: var(--text-muted);
    font-family: "Courier New", monospace;
    white-space: nowrap;
}

/* ---------- 筛选栏 ---------- */
.filter-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 16px;
    padding: 14px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}
.filter-group {
    display: flex;
    align-items: center;
    gap: 6px;
}
.filter-label {
    font-size: 12px;
    color: var(--text-muted);
    white-space: nowrap;
}
.filter-select {
    height: 32px;
    padding: 0 10px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 12px;
    cursor: pointer;
    transition: var(--transition);
    outline: none;
}
.filter-select:focus { border-color: var(--primary); }
.filter-select option { background: var(--bg-card); color: var(--text-primary); }
.filter-search {
    height: 32px;
    padding: 0 10px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 12px;
    width: 200px;
    transition: var(--transition);
}
.filter-search:focus { border-color: var(--primary); }
.btn {
    height: 32px;
    padding: 0 14px;
    border-radius: var(--radius-sm);
    font-size: 12px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: var(--transition);
    cursor: pointer;
    white-space: nowrap;
}
.btn-primary {
    background: var(--primary);
    color: var(--bg-deep);
    font-weight: 600;
}
.btn-primary:hover { background: var(--primary-light); box-shadow: 0 0 12px var(--primary-glow); }
.btn-outline {
    background: transparent;
    border: 1px solid var(--border-light);
    color: var(--text-secondary);
}
.btn-outline:hover { border-color: var(--primary); color: var(--primary); }

/* ---------- 工艺流程图 ---------- */
.craft-flow {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 0;
    padding: 20px 0;
}
.craft-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    cursor: pointer;
    transition: var(--transition);
    position: relative;
}
.craft-step-node {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: var(--bg-card);
    border: 2px solid var(--border-light);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    transition: var(--transition);
    position: relative;
    z-index: 2;
}
.craft-step:hover .craft-step-node {
    border-color: var(--primary);
    color: var(--primary);
    box-shadow: 0 0 20px var(--primary-glow);
    transform: scale(1.08);
}
.craft-step.active .craft-step-node {
    background: var(--primary-bg);
    border-color: var(--primary);
    color: var(--primary);
}
.craft-step-node svg { width: 26px; height: 26px; }
.craft-step-label {
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: 8px;
    white-space: nowrap;
}
.craft-step:hover .craft-step-label { color: var(--primary); }
.craft-arrow {
    width: 40px;
    height: 2px;
    background: var(--border-light);
    position: relative;
    margin: 0 4px;
    align-self: flex-start;
    margin-top: 31px;
}
.craft-arrow::after {
    content: '';
    position: absolute;
    right: 0;
    top: -4px;
    border: 5px solid transparent;
    border-left-color: var(--border-light);
}

/* 工艺卡片网格 */
.craft-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 14px;
}
.craft-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px;
    cursor: pointer;
    transition: var(--transition);
}
.craft-card:hover {
    border-color: var(--primary);
    box-shadow: var(--shadow-glow);
}
.craft-card-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}
.craft-card-icon {
    width: 44px;
    height: 44px;
    border-radius: var(--radius);
    background: var(--primary-bg);
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
}
.craft-card-icon svg { width: 22px; height: 22px; }
.craft-card-title { font-size: 15px; font-weight: 600; color: var(--text-primary); }
.craft-card-step { font-size: 11px; color: var(--text-muted); margin-top: 2px; }
.craft-card-desc { font-size: 12px; color: var(--text-secondary); line-height: 1.6; margin-bottom: 12px; }
.craft-card-meta {
    display: flex;
    gap: 16px;
    padding-top: 10px;
    border-top: 1px solid var(--border);
}
.craft-meta-item { font-size: 11px; color: var(--text-muted); }
.craft-meta-item strong { color: var(--primary); font-weight: 600; }

/* ---------- 文化知识卡片 ---------- */
.culture-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 14px;
}
.culture-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    cursor: pointer;
    transition: var(--transition);
}
.culture-card:hover {
    border-color: var(--primary);
    box-shadow: var(--shadow-glow);
    transform: translateY(-2px);
}
.culture-card-image {
    width: 100%;
    height: 120px;
    background: var(--bg-input);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}
.culture-card-image svg { width: 40px; height: 40px; color: var(--gold); opacity: 0.5; }
.culture-card-category {
    position: absolute;
    top: 8px;
    left: 8px;
    font-size: 10px;
    padding: 2px 8px;
    border-radius: 3px;
    background: rgba(0, 0, 0, 0.6);
    color: var(--gold);
    backdrop-filter: blur(4px);
}
.culture-card-body { padding: 12px; }
.culture-card-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 6px;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.culture-card-summary {
    font-size: 12px;
    color: var(--text-muted);
    line-height: 1.5;
    margin-bottom: 10px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.culture-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 11px;
    color: var(--text-dark);
}

/* ---------- 数字资产库 ---------- */
.asset-stats {
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    gap: 10px;
    margin-bottom: 16px;
}
.asset-stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 12px;
    text-align: center;
    cursor: pointer;
    transition: var(--transition);
}
.asset-stat-card:hover {
    border-color: var(--primary);
    background: var(--primary-bg);
}
.asset-stat-card.active {
    border-color: var(--primary);
    background: var(--primary-bg);
}
.asset-stat-icon {
    width: 32px;
    height: 32px;
    margin: 0 auto 6px;
    border-radius: var(--radius-sm);
    background: var(--primary-bg);
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
}
.asset-stat-icon svg { width: 16px; height: 16px; }
.asset-stat-num {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-primary);
    font-family: "Courier New", monospace;
}
.asset-stat-label {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 2px;
}

/* ---------- 数据分析页面 ---------- */
.analysis-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}
.analysis-grid .span-2 { grid-column: span 2; }

/* ---------- 系统管理页面 ---------- */
.system-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}
.system-status-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 20px;
}
.system-status-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 0;
    border-bottom: 1px solid var(--border);
}
.system-status-row:last-child { border-bottom: none; }
.system-status-label {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 13px;
    color: var(--text-secondary);
}
.system-status-label svg { width: 18px; height: 18px; color: var(--primary); }
.system-status-value {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
    font-family: "Courier New", monospace;
}
.system-status-value.online { color: var(--green); }

/* ---------- 详情模态框 ---------- */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    z-index: 500;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 30px;
}
.modal-overlay.show {
    display: flex;
    animation: fadeIn 0.2s ease-out;
}
.modal-container {
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 1000px;
    max-height: 85vh;
    overflow-y: auto;
    position: relative;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    animation: modalIn 0.3s ease-out;
}
@keyframes modalIn {
    from { opacity: 0; transform: scale(0.96) translateY(10px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}
.modal-close {
    position: absolute;
    top: 14px;
    right: 14px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--bg-input);
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    transition: var(--transition);
}
.modal-close:hover { background: var(--red); color: #fff; }
.modal-close svg { width: 16px; height: 16px; }
.modal-content { padding: 24px; }

/* 详情页头部 */
.detail-header {
    display: flex;
    gap: 24px;
    margin-bottom: 24px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border);
}
.detail-image {
    width: 200px;
    min-width: 200px;
    height: 200px;
    background: var(--bg-input);
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--border);
}
.detail-image svg { width: 80px; height: 80px; color: var(--primary); opacity: 0.4; }
.detail-info { flex: 1; }
.detail-title {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 4px;
}
.detail-id {
    font-size: 12px;
    color: var(--text-muted);
    font-family: "Courier New", monospace;
    margin-bottom: 12px;
}
.detail-tags {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 14px;
}
.detail-tag {
    font-size: 11px;
    padding: 3px 10px;
    border-radius: 3px;
    background: var(--primary-bg);
    color: var(--primary);
}
.detail-meta-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
}
.detail-meta-item {
    padding: 8px 10px;
    background: var(--bg-input);
    border-radius: var(--radius-sm);
}
.detail-meta-label {
    font-size: 11px;
    color: var(--text-muted);
    margin-bottom: 2px;
}
.detail-meta-value {
    font-size: 13px;
    color: var(--text-primary);
    font-weight: 500;
}

/* 详情内容区 */
.detail-section {
    margin-bottom: 20px;
}
.detail-section-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}
.detail-section-title::before {
    content: '';
    width: 3px;
    height: 14px;
    background: var(--primary);
    border-radius: 2px;
}
.detail-section-content {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.8;
}
.detail-two-col {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

/* 香方比例可视化 */
.recipe-ratio {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.ratio-item {
    display: flex;
    align-items: center;
    gap: 10px;
}
.ratio-name {
    width: 70px;
    font-size: 12px;
    color: var(--text-secondary);
    text-align: right;
}
.ratio-bar {
    flex: 1;
    height: 20px;
    background: var(--bg-input);
    border-radius: 3px;
    overflow: hidden;
    position: relative;
}
.ratio-fill {
    height: 100%;
    border-radius: 3px;
    transition: width 0.8s ease-out;
}
.ratio-value {
    width: 45px;
    font-size: 12px;
    color: var(--text-primary);
    font-weight: 600;
    font-family: "Courier New", monospace;
}

/* 数字资产状态 */
.asset-status-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
}
.asset-status-item {
    padding: 12px;
    background: var(--bg-input);
    border-radius: var(--radius);
    text-align: center;
    border: 1px solid var(--border);
}
.asset-status-icon {
    width: 32px;
    height: 32px;
    margin: 0 auto 6px;
    border-radius: 50%;
    background: var(--primary-bg);
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
}
.asset-status-icon svg { width: 16px; height: 16px; }
.asset-status-label { font-size: 11px; color: var(--text-muted); }
.asset-status-state {
    font-size: 12px;
    color: var(--green);
    font-weight: 600;
    margin-top: 2px;
}

/* 相关列表 */
.related-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.related-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 12px;
    background: var(--bg-input);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: var(--transition);
}
.related-item:hover { background: var(--bg-card-hover); }
.related-name { font-size: 13px; color: var(--text-primary); }
.related-meta { font-size: 11px; color: var(--text-muted); }

/* ---------- 空状态 ---------- */
.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-muted);
}
.empty-state svg {
    width: 48px;
    height: 48px;
    margin-bottom: 12px;
    opacity: 0.3;
}

/* ---------- 响应式 ---------- */
@media (max-width: 1600px) {
    .stats-grid { grid-template-columns: repeat(3, 1fr); }
    .herb-grid { grid-template-columns: repeat(4, 1fr); }
    .asset-stats { grid-template-columns: repeat(4, 1fr); }
}
@media (max-width: 1366px) {
    .dashboard-grid { grid-template-columns: 1fr 1fr; }
    .dashboard-grid .span-2 { grid-column: span 2; }
    .dashboard-grid .span-3 { grid-column: span 2; }
    .culture-grid { grid-template-columns: repeat(3, 1fr); }
    .craft-grid { grid-template-columns: repeat(2, 1fr); }
    .analysis-grid { grid-template-columns: 1fr; }
    .analysis-grid .span-2 { grid-column: span 1; }
    .system-grid { grid-template-columns: 1fr; }
}
@media (max-width: 1024px) {
    .stats-grid { grid-template-columns: repeat(2, 1fr); }
    .herb-grid { grid-template-columns: repeat(3, 1fr); }
    .culture-grid { grid-template-columns: repeat(2, 1fr); }
    .topbar-status { display: none; }
    .search-box { width: 200px; }
    .detail-two-col { grid-template-columns: 1fr; }
    .detail-meta-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 768px) {
    .sidebar { position: fixed; left: -240px; top: 0; bottom: 0; z-index: 200; }
    .sidebar.mobile-open { left: 0; }
    .stats-grid { grid-template-columns: 1fr; }
    .herb-grid { grid-template-columns: repeat(2, 1fr); }
    .culture-grid { grid-template-columns: 1fr; }
    .craft-grid { grid-template-columns: 1fr; }
    .asset-stats { grid-template-columns: repeat(2, 1fr); }
    .dashboard-grid { grid-template-columns: 1fr; }
    .dashboard-grid .span-2, .dashboard-grid .span-3 { grid-column: span 1; }
    .topbar-time { display: none; }
    .detail-header { flex-direction: column; }
    .detail-image { width: 100%; height: 160px; }
}
