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

:root {
    /* Light page shell + figure accent colors (charts stay dark in JS) */
    --bg-start: #ffffff;
    --bg-end: #f2f6fb;
    --text-primary: #1a1a1a;
    --text-secondary: #5c6670;
    --text-muted: #888888;
    --border: #d4deea;
    --card: #ffffff;
    --muted: #eef3f9;
    --surface-elevated: #f8fafc;
    /* Figure accent palette (panels a–d) */
    --fig-blue: #5B9BD5;
    --fig-blue-deep: #4472C4;
    --fig-orange: #ED7D31;
    --fig-green: #70AD47;
    --fig-purple: #7030A0;
    --fig-teal: #00B0F0;
    --fig-red: #FF0000;
    --fig-grey: #A5A5A5;
    --brand-1: var(--fig-blue);
    --brand-2: var(--fig-blue-deep);
    --focus: var(--fig-teal);
    --surface: rgba(255, 255, 255, 0.97);
    --surface-strong: #ffffff;
    --glass-border: 1px solid var(--border);
    --radius-sm: 8px;
    --radius-md: 14px;
    --radius-lg: 18px;
    --shadow-sm: 0 6px 16px rgba(91, 155, 213, 0.08);
    --shadow-md: 0 12px 28px rgba(91, 155, 213, 0.12);
    --shadow-lg: 0 18px 44px rgba(91, 155, 213, 0.16);
    /* Section accents */
    --accent-blue: var(--fig-blue);
    --accent-red: var(--fig-red);
    --accent-purple: var(--fig-purple);
    --accent-teal: var(--fig-teal);
    --accent-gold: var(--fig-orange);
    /* 基础字号偏大，便于截图放入论文/文章后仍清晰可读 */
    --font-base: 24px;
}

html {
    font-size: var(--font-base);
}

body {
    font-family: 'Source Sans 3', Arial, Helvetica, sans-serif;
    line-height: 1.6;
    color: var(--text-primary);
    background: linear-gradient(180deg, var(--bg-start) 0%, var(--bg-end) 100%);
    min-height: 100vh;
    position: relative;
}

body::before {
    content: '';
    position: fixed;
    inset: 0;
    pointer-events: none;
    background: radial-gradient(700px 340px at 85% 90%, rgba(91, 155, 213, 0.05), transparent 60%);
    z-index: 0;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 24px;
}

/* 顶部控制区 */
.top-controls {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1000;
    display: flex;
    align-items: center;
    gap: 12px;
}

/* 语言切换器 */
.language-switcher {
    background: var(--surface);
    border-radius: 25px;
    padding: 5px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.08);
    backdrop-filter: blur(12px);
    border: var(--glass-border);
}

.gesture-master-toggle {
    height: 46px;
    padding: 0 16px;
    border-radius: 23px;
    border: 1px solid rgba(91, 155, 213, 0.4);
    background: var(--fig-blue);
    color: #ffffff;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
}

.gesture-master-toggle.off {
    background: #94a3b8;
}

.lang-btn {
    background: none;
    border: none;
    padding: 8px 16px;
    border-radius: 20px;
    cursor: pointer;
    font-size: 0.875rem;
    font-weight: 500;
    transition: all 0.3s ease;
    color: var(--text-secondary);
}

.lang-btn.active {
    background: var(--brand-1);
    color: #fff;
    box-shadow: 0 8px 24px rgba(91, 155, 213, 0.2);
}

.lang-btn:hover:not(.active) {
    background: rgba(91, 155, 213, 0.12);
    color: var(--fig-blue);
}

/* 头部样式 */
.header {
    background: linear-gradient(135deg, var(--fig-blue-deep) 0%, var(--fig-blue) 100%);
    padding: 44px 0 40px;
    text-align: center;
    box-shadow: 0 4px 20px rgba(68, 114, 196, 0.22);
    margin-bottom: 0;
    border-bottom: 3px solid rgba(255, 255, 255, 0.25);
    position: relative;
}

.header::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    bottom: -3px;
    height: 3px;
    background: linear-gradient(90deg, var(--fig-blue), var(--fig-orange), var(--fig-green));
    opacity: 0.9;
}

.main-title {
    font-size: 2.85rem;
    font-weight: 700;
    color: #ffffff;
    margin-bottom: 10px;
    letter-spacing: -0.02em;
}

.subtitle {
    font-size: 1.35rem;
    color: rgba(255, 255, 255, 0.9);
    font-weight: 400;
}

/* 导航栏 */
.navbar {
    background: var(--card);
    backdrop-filter: blur(10px);
    padding: 15px 0;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 4px 16px rgba(91, 155, 213, 0.08);
    border-bottom: 1px solid var(--border);
    margin-bottom: 30px;
}

.nav-menu {
    display: flex;
    justify-content: center;
    list-style: none;
    gap: 40px;
}

.nav-link {
    text-decoration: none;
    color: var(--text-primary);
    font-weight: 500;
    padding: 10px 20px;
    border-radius: 25px;
    transition: all 0.3s ease;
    position: relative;
}

.nav-link::after {
    content: '';
    position: absolute;
    left: 20px;
    right: 20px;
    bottom: 6px;
    height: 2px;
    background: var(--brand-1);
    opacity: 0;
    transform: translateY(4px);
    transition: all .25s ease;
    border-radius: 2px;
}

.nav-link:hover {
    color: var(--text-primary);
    background: var(--muted);
}

.nav-link:hover::after { opacity: 1; transform: translateY(0); }

.nav-link.active {
    color: var(--fig-blue);
    background: rgba(91, 155, 213, 0.12);
}

/* 主要内容 */
.main-content {
    padding: 40px 0;
    position: relative;
    z-index: 1;
}

.module {
    background: var(--surface-strong);
    backdrop-filter: blur(12px);
    border-radius: var(--radius-lg);
    margin-bottom: 40px;
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border: var(--glass-border);
}

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

.module-header {
    background: var(--card);
    color: var(--text-primary);
    padding: 30px;
    display: flex;
    align-items: center;
    gap: 20px;
    border-bottom: var(--glass-border);
    position: relative;
}

/* Section-specific soft accents */
#dashboard .module-header {
    background: var(--card);
    border-bottom: 1px solid rgba(91, 155, 213, 0.25);
}
#concentration .module-header {
    background: var(--card);
    border-bottom: 1px solid rgba(255, 0, 0, 0.25);
}
#standard-curve .module-header {
    background: var(--card);
    border-bottom: 1px solid rgba(0, 176, 240, 0.25);
}
#auto-upload .module-header {
    background: var(--card);
    border-bottom: 1px solid rgba(112, 48, 160, 0.25);
}
#history .module-header {
    background: var(--card);
    border-bottom: 1px solid rgba(237, 125, 49, 0.3);
}

/* ACS-like subtle accent rail on the left of each section header */
#dashboard .module-header::before,
#concentration .module-header::before,
#standard-curve .module-header::before,
#auto-upload .module-header::before,
#history .module-header::before {
    content: '';
    position: absolute;
    left: 16px;
    top: 16px;
    bottom: 16px;
    width: 4px;
    border-radius: 3px;
}

#dashboard .module-header::before { background: var(--accent-blue); }
#concentration .module-header::before { background: var(--accent-red); }
#standard-curve .module-header::before { background: var(--accent-purple); }
#auto-upload .module-header::before { background: var(--accent-teal); }
#history .module-header::before { background: var(--accent-gold); }

.module-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    border-radius: 12px;
    background: var(--surface-elevated);
    color: var(--text-primary);
    border: 1px solid var(--border);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.35);
}

#dashboard .module-icon { color: var(--accent-blue); border-color: rgba(91, 155, 213, 0.35); }
#concentration .module-icon { color: var(--accent-red); border-color: rgba(255, 0, 0, 0.3); }
#standard-curve .module-icon { color: var(--accent-teal); border-color: rgba(0, 176, 240, 0.3); }
#auto-upload .module-icon { color: var(--accent-purple); border-color: rgba(112, 48, 160, 0.3); }
#history .module-icon { color: var(--accent-gold); border-color: rgba(237, 125, 49, 0.35); }

.module-header h2 {
    font-size: 2rem;
    font-weight: 600;
}

.module-content {
    padding: 30px;
}

/* 上传区域 */
.upload-section {
    margin-bottom: 30px;
}

.upload-area {
    border: 3px dashed var(--border);
    border-radius: 15px;
    padding: 40px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    background: rgba(91, 155, 213, 0.05);
}

.upload-area:hover {
    border-color: var(--fig-blue);
    background: rgba(91, 155, 213, 0.1);
    transform: scale(1.02);
}

.upload-area.dragover {
    border-color: var(--fig-teal);
    background: rgba(0, 176, 240, 0.12);
    transform: scale(1.05);
}

.upload-icon {
    font-size: 3rem;
    margin-bottom: 15px;
    display: block;
}

.upload-text p {
    margin-bottom: 10px;
    color: var(--text-secondary);
}

.file-types {
    font-size: 0.9rem;
    color: var(--text-muted);
}

.folder-selector {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 20px;
}

.file-count {
    color: var(--brand-1);
    font-weight: 500;
}

/* 按钮样式 */
.button-group {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin-top: 20px;
}

.btn {
    padding: 13px 32px;
    border: none;
    border-radius: 28px;
    font-size: 1.05rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-block;
    text-align: center;
    min-width: 120px;
    will-change: transform, box-shadow;
}

.btn-primary {
    background: linear-gradient(135deg, var(--fig-blue), var(--fig-blue-deep));
    color: #fff;
    box-shadow: 0 8px 20px rgba(91, 155, 213, 0.25);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 14px 28px rgba(91, 155, 213, 0.35);
}

.btn:focus-visible {
    outline: 3px solid rgba(0, 176, 240, 0.45);
    outline-offset: 2px;
}

.btn-secondary {
    background: var(--surface-elevated);
    color: var(--text-primary);
    border: 1px solid var(--border);
}

.gesture-status-panel {
    position: fixed;
    left: 20px;
    top: 20px;
    z-index: 1001;
    min-width: 300px;
    min-height: 260px;
    width: 320px;
    height: 560px;
    resize: both;
    overflow: auto;
    background: var(--card);
    border: 1px solid var(--border);
    border-top: 3px solid var(--fig-blue);
    border-radius: 10px;
    box-shadow: var(--shadow-md);
    padding: 10px 12px;
    font-size: 0.875rem;
    color: var(--text-primary);
}

.gesture-status-title {
    font-size: 1rem;
    color: var(--fig-blue);
    font-weight: 700;
}

.gesture-status-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 6px;
    cursor: move;
    user-select: none;
}

.gesture-status-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
}

.gesture-status-label {
    color: var(--text-secondary);
    font-weight: 600;
}

.gesture-hands-hint,
.gesture-action-hint,
.gesture-error-hint {
    font-size: 0.8125rem;
    line-height: 1.4;
    margin-bottom: 4px;
    color: var(--text-secondary);
}

.gesture-action-hint {
    color: var(--fig-teal);
    font-weight: 600;
}

.gesture-error-hint {
    color: var(--fig-orange);
}

.gesture-badge {
    border-radius: 999px;
    padding: 2px 8px;
    font-weight: 700;
    text-transform: lowercase;
}

.gesture-badge-active {
    background: rgba(112, 173, 71, 0.2);
    color: var(--fig-green);
}

.gesture-badge-paused {
    background: rgba(237, 125, 49, 0.2);
    color: var(--fig-orange);
}

.gesture-badge-unavailable {
    background: rgba(165, 165, 165, 0.15);
    color: var(--fig-grey);
}

.gesture-hint {
    color: var(--text-secondary);
    line-height: 1.4;
}

.gesture-enable-btn {
    margin-top: 8px;
    width: 100%;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--fig-blue);
    color: #fff;
    font-size: 0.875rem;
    padding: 8px 10px;
    cursor: pointer;
}

.gesture-enable-btn:hover {
    opacity: 0.9;
}

.gesture-help-title {
    margin-top: 10px;
    font-size: 0.875rem;
    font-weight: 700;
    color: var(--text-primary);
}

.gesture-help-list {
    margin: 6px 0 0 16px;
    padding: 0;
    font-size: 0.8125rem;
    color: var(--text-secondary);
}

.gesture-help-list li {
    line-height: 1.35;
    margin-bottom: 2px;
}

.gesture-camera-container {
    position: relative;
    right: auto;
    bottom: auto;
    left: auto;
    top: auto;
    margin-top: 8px;
    width: 100%;
    height: 240px;
    overflow: hidden;
    min-height: 180px;
    border-radius: 12px;
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
    background: #111;
    z-index: 1000;
}

.gesture-camera-handle {
    height: 28px;
    line-height: 28px;
    text-align: center;
    font-size: 0.75rem;
    color: #e5e7eb;
    background: rgba(17, 24, 39, 0.92);
    cursor: default;
    user-select: none;
}

.gesture-recognition-frame {
    position: absolute;
    left: 6px;
    right: 6px;
    top: 34px;
    bottom: 6px;
    border: 2px solid var(--fig-orange);
    border-radius: 10px;
    background: transparent;
    color: #e5e7eb;
    font-size: 0.875rem;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 8px;
    pointer-events: none;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8);
    font-weight: 600;
}

.gesture-recognition-frame-on {
    border-color: var(--fig-green);
}

.gesture-recognition-frame-off {
    border-color: var(--fig-orange);
}

.gesture-camera-preview {
    width: 100%;
    height: calc(100% - 28px);
    display: block;
    object-fit: cover;
    background: #111;
}

.btn-secondary:hover {
    background: var(--muted);
    transform: translateY(-2px);
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* 结果区域 */
.results-section {
    margin-top: 30px;
    padding-top: 30px;
    border-top: 2px solid var(--border);
}

.results-section h3 {
    color: var(--text-primary);
    margin-bottom: 20px;
    font-size: 1.5rem;
}

.analysis-time {
    background: var(--muted);
    color: var(--text-primary);
    padding: 10px 20px;
    border-radius: 20px;
    display: inline-block;
    margin-bottom: 20px;
    font-weight: 500;
    box-shadow: none;
}

.results-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    margin-top: 20px;
}

/* 浓度分析结果改为纵向完整展示，避免图表和表格互相挤压 */
#concentration .results-grid {
    grid-template-columns: 1fr;
    gap: 20px;
}

.result-card {
    background: var(--card);
    border-radius: 15px;
    padding: 25px;
    box-shadow: 0 10px 24px rgba(0,0,0,0.06);
    border: 1px solid var(--border);
    transition: transform 0.3s ease;
}

.result-card:hover {
    transform: translateY(-3px);
}

.result-card.full-width {
    grid-column: 1 / -1;
}

.result-card h4 {
    color: var(--text-primary);
    margin-bottom: 20px;
    font-size: 1.3rem;
    border-bottom: 2px solid var(--border);
    padding-bottom: 10px;
}

.peak-switcher {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-bottom: 14px;
    flex-wrap: wrap;
}

.peak-current-label {
    font-weight: 600;
    color: var(--text-primary);
    min-width: 180px;
    text-align: center;
}

.peak-schematic-layout {
    display: flex;
    flex-wrap: nowrap;
    gap: 14px;
    align-items: stretch;
}

.peak-sample-nav {
    flex: 0 0 200px;
    max-width: 100%;
    align-self: stretch;
    overflow-y: auto;
    background: var(--muted);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 10px 8px;
}

.peak-nav-title {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--brand-2);
    margin-bottom: 8px;
    padding: 0 4px;
}

.peak-nav-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.peak-nav-item {
    display: block;
    width: 100%;
    text-align: left;
    padding: 8px 10px;
    margin-bottom: 4px;
    border: 1px solid transparent;
    border-radius: 8px;
    background: var(--surface-strong);
    color: var(--text-primary);
    font-size: 1rem;
    line-height: 1.35;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s;
}

.peak-nav-item:hover {
    background: rgba(91, 155, 213, 0.12);
    border-color: rgba(91, 155, 213, 0.35);
}

.peak-nav-item.is-active {
    background: rgba(91, 155, 213, 0.18);
    border-color: var(--fig-blue);
    font-weight: 600;
}

.peak-schematic-center {
    flex: 1 1 300px;
    min-width: 0;
    align-self: stretch;
    display: flex;
    flex-direction: column;
}

#concentration .chart-container.chart-container--peak {
    flex: 1 1 auto;
    min-height: 380px;
    height: auto;
    max-height: none;
    display: flex;
    flex-direction: column;
}

#peakCurrentChart .js-plotly-plot,
#peakCurrentChart .plot-container.plotly {
    flex: 1 1 auto;
    width: 100% !important;
    height: 100% !important;
    min-height: 360px;
}

.peak-current-stats {
    flex: 0 0 300px;
    max-width: 100%;
    align-self: stretch;
    background: rgba(91, 155, 213, 0.08);
    border-radius: 10px;
    padding: 16px 18px;
    border: 1px solid var(--border);
    font-size: 1rem;
    line-height: 1.45;
}

.peak-current-stats h5 {
    margin: 0 0 10px;
    font-size: 1rem;
    color: var(--brand-2);
}

.peak-current-stats .peak-stats-subtitle {
    margin: 14px 0 8px;
    font-size: 0.92rem;
    color: var(--text-secondary);
}

.peak-current-stats table {
    width: 100%;
    border-collapse: collapse;
}

.peak-current-stats th,
.peak-current-stats td {
    padding: 6px 8px;
    text-align: left;
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

.peak-current-stats tr:last-child td {
    border-bottom: none;
}

.peak-current-stats .peak-stats-val {
    font-variant-numeric: tabular-nums;
    text-align: right;
}

.parameters .reference-curve-note {
    margin-top: 14px;
    padding-top: 10px;
    border-top: 1px dashed var(--border);
}

/* 表格样式 */
.table-container {
    overflow-x: auto;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

#concentration .table-container {
    max-height: 520px;
    overflow: auto;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--card);
}

.data-table th,
.data-table td {
    padding: 15px 18px;
    text-align: left;
    border-bottom: 1px solid var(--border);
    font-size: 1.08rem;
    color: var(--text-primary);
}

.data-table th {
    background: var(--muted);
    color: var(--text-primary);
    font-weight: 600;
    position: sticky;
    top: 0;
}

.data-table tr:hover {
    background: rgba(91, 155, 213, 0.08);
}

.data-table tr:nth-child(even) {
    background: rgba(91, 155, 213, 0.04);
}

/* 图表容器 */
.chart-container {
    width: 100%;
    height: 400px;
    border-radius: 10px;
    overflow: visible;
    box-shadow: 0 4px 16px rgba(91, 155, 213, 0.1);
    background: #ffffff;
    border: 1px solid var(--border);
}

#concentration .chart-container {
    min-height: 500px;
    height: 56vh;
    max-height: 700px;
}

#concentrationChart .js-plotly-plot,
#concentrationChart .plot-container.plotly {
    width: 100% !important;
}

#autoUploadChart .js-plotly-plot,
#autoUploadChart .plot-container.plotly {
    width: 100% !important;
}

/* 参数显示 */
.parameters {
    background: rgba(91, 155, 213, 0.08);
    padding: 20px;
    border-radius: 10px;
    border-left: 4px solid var(--fig-blue);
}

.parameters p {
    margin-bottom: 10px;
    font-size: 1.1rem;
}

.parameters strong {
    color: var(--brand-2);
}

/* 加载覆盖层 */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    backdrop-filter: blur(5px);
}

.loading-content {
    background: var(--card);
    padding: 40px;
    border-radius: 20px;
    text-align: center;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.spinner {
    width: 50px;
    height: 50px;
    border: 4px solid var(--border);
    border-top: 4px solid var(--fig-blue);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loading-content p {
    color: var(--text-primary);
    font-size: 1.1rem;
    font-weight: 500;
}

/* 消息提示 */
.message-container {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10000;
}

.message {
    background: var(--card);
    padding: 16px 28px;
    border-radius: 25px;
    box-shadow: var(--shadow-md);
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 10px;
    animation: slideIn 0.3s ease;
    font-size: 1.05rem;
    color: var(--text-primary);
    border: 1px solid var(--border);
}

.message.success {
    border-left: 4px solid var(--fig-green);
}

.message.error {
    border-left: 4px solid var(--fig-red);
}

.message.info {
    border-left: 4px solid var(--fig-teal);
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

/* 响应式设计 */
@media (max-width: 768px) {
    .container {
        padding: 0 15px;
    }

    .peak-schematic-layout {
        flex-wrap: wrap;
    }

    .peak-sample-nav {
        flex: 1 1 100%;
        max-height: 220px;
    }
    
    .main-title {
        font-size: 2rem;
    }
    
    .nav-menu {
        flex-direction: column;
        gap: 10px;
    }
    
    .results-grid {
        grid-template-columns: 1fr;
    }
    
    .button-group {
        flex-direction: column;
    }
    
    .module-header {
        flex-direction: column;
        text-align: center;
    }
    
    .upload-area {
        padding: 20px;
    }
    
    .language-switcher {
        top: 10px;
        right: 10px;
    }
}

@media (max-width: 480px) {
    .main-title {
        font-size: 1.5rem;
    }
    
    .subtitle {
        font-size: 1rem;
    }
    
    .module-content {
        padding: 20px;
    }
    
    .btn {
        padding: 10px 20px;
        font-size: 0.9rem;
    }
} 

/* 导出控制按钮样式 */
.export-controls {
    margin: 20px 0;
    text-align: center;
}

.export-controls .btn {
    margin: 0 10px;
    padding: 10px 20px;
    border-radius: 8px;
    font-weight: 600;
    transition: all 0.3s ease;
}

.export-controls .btn-success {
    background: linear-gradient(135deg, var(--fig-green), #528a32);
    border: none;
    color: white;
}

.export-controls .btn-success:hover {
    background: linear-gradient(135deg, #528a32, var(--fig-green));
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(112, 173, 71, 0.35);
}

.export-controls .btn-info {
    background: linear-gradient(135deg, var(--fig-blue), var(--fig-teal));
    border: none;
    color: white;
}

.export-controls .btn-info:hover {
    background: linear-gradient(135deg, var(--fig-blue-deep), var(--fig-blue));
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(91, 155, 213, 0.35);
}

/* 历史记录模块样式 */
.history-controls {
    margin-bottom: 20px;
    text-align: center;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
    align-items: center;
}

.history-controls .btn {
    margin: 0 10px;
    padding: 10px 20px;
    border-radius: 8px;
    font-weight: 600;
    transition: all 0.3s ease;
}

.history-date-input {
    height: 42px;
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 0 12px;
    font-size: 0.875rem;
    color: var(--text-primary);
    background: var(--surface-elevated);
}

.history-tabs {
    display: flex;
    justify-content: center;
    margin-bottom: 30px;
    border-bottom: 2px solid var(--border);
}

.history-tab {
    background: none;
    border: none;
    padding: 15px 30px;
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.3s ease;
    border-bottom: 3px solid transparent;
    margin: 0 5px;
}

.history-tab.active {
    color: var(--fig-blue);
    border-bottom-color: var(--fig-blue);
    background: rgba(91, 155, 213, 0.12);
}

.history-tab:hover {
    color: var(--fig-blue);
    background: rgba(91, 155, 213, 0.06);
}

.history-controls .btn-danger {
    background: linear-gradient(135deg, #c0392b, #e74c3c);
    border: none;
    color: white;
}

.history-controls .btn-danger:hover {
    background: linear-gradient(135deg, #a93226, #c0392b);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(192, 57, 43, 0.35);
}

.history-content {
    min-height: 400px;
}

.history-section {
    display: none;
}

.history-section.active {
    display: block;
}

.history-list {
    display: grid;
    gap: 20px;
    max-height: 500px;
    overflow-y: auto;
}

.history-item {
    background: var(--card);
    border-radius: 12px;
    padding: 20px;
    box-shadow: var(--shadow-sm);
    transition: all 0.3s ease;
    border: 1px solid var(--border);
    border-left: 4px solid var(--fig-blue);
}

.history-item:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.history-item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.history-item-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
}

.history-item-time {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.history-item-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 15px;
    margin-bottom: 15px;
}

.history-stat {
    text-align: center;
    padding: 10px;
    background: var(--muted);
    border-radius: 8px;
}

.history-stat-label {
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-bottom: 5px;
}

.history-stat-value {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--fig-blue);
}

.history-item-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

.history-item-actions .btn {
    padding: 8px 16px;
    font-size: 0.875rem;
    border-radius: 6px;
    transition: all 0.3s ease;
}

.history-item-actions .btn-sm {
    padding: 6px 12px;
    font-size: 0.75rem;
}

/* 空历史记录状态 */
.history-empty {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-secondary);
}

.history-empty-icon {
    font-size: 48px;
    margin-bottom: 20px;
    opacity: 0.5;
}

.history-empty-text {
    font-size: 1.25rem;
    margin-bottom: 10px;
}

.history-empty-subtext {
    font-size: 0.875rem;
    opacity: 0.7;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .history-tabs {
        flex-direction: column;
        align-items: center;
    }
    
    .history-tab {
        width: 100%;
        max-width: 300px;
        margin: 5px 0;
    }
    
    .history-item-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .history-item-stats {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .history-item-actions {
        justify-content: center;
    }
    
    .export-controls .btn {
        margin: 5px;
        width: calc(50% - 10px);
    }
}

/* 加载动画优化 */
.loading-spinner {
    border: 3px solid var(--border);
    border-top: 3px solid var(--fig-blue);
    border-radius: 50%;
    width: 30px;
    height: 30px;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* 成功/错误消息样式优化 */
.message {
    padding: 15px 20px;
    border-radius: 8px;
    margin: 10px 0;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 10px;
    animation: slideIn 0.3s ease;
}

.message.success {
    background: rgba(112, 173, 71, 0.12);
    color: #3d6b1f;
    border-left: 4px solid var(--fig-green);
}

.message.error {
    background: rgba(255, 0, 0, 0.08);
    color: #b91c1c;
    border-left: 4px solid var(--fig-red);
}

.message.info {
    background: rgba(0, 176, 240, 0.1);
    color: #0369a1;
    border-left: 4px solid var(--fig-teal);
}

.message.warning {
    background: rgba(237, 125, 49, 0.12);
    color: #9a3412;
    border-left: 4px solid var(--fig-orange);
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
} 

/* 仪表板样式 */
.dashboard-controls {
    margin-bottom: 30px;
    text-align: center;
}

.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 30px;
    margin-bottom: 40px;
}

.dashboard-card {
    background: var(--card);
    border-radius: 16px;
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    transition: all 0.3s ease;
    border: 1px solid var(--border);
}

.dashboard-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-md);
}

.dashboard-card-header {
    background: linear-gradient(135deg, var(--fig-blue-deep) 0%, var(--fig-blue) 100%);
    color: white;
    padding: 20px;
    text-align: center;
    border-bottom: none;
}

.dashboard-card-header h3 {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 600;
}

.dashboard-card-content {
    padding: 25px;
}

/* 统计项样式 */
.stat-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 0;
    border-bottom: 1px solid var(--border);
}

.stat-item:last-child {
    border-bottom: none;
}

.stat-label {
    font-size: 0.875rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.stat-value {
    font-size: 24px;
    font-weight: 700;
    color: var(--fig-blue);
    background: linear-gradient(135deg, var(--fig-blue), var(--fig-teal));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* 图表容器 */
.dashboard-chart {
    height: 300px;
    width: 100%;
    background: #ffffff;
    border-radius: 8px;
    border: 1px solid var(--border);
}

/* 最新记录样式 */
.latest-records {
    max-height: 400px;
    overflow-y: auto;
}

.records-section {
    margin-bottom: 25px;
}

.records-section h4 {
    color: var(--text-primary);
    font-size: 1.125rem;
    font-weight: 600;
    margin-bottom: 15px;
    padding-bottom: 8px;
    border-bottom: 2px solid var(--border);
}

.records-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.record-item {
    background: var(--muted);
    border-radius: 8px;
    padding: 12px;
    border-left: 3px solid var(--fig-teal);
    transition: all 0.3s ease;
}

.record-item:hover {
    background: var(--surface-elevated);
    transform: translateX(5px);
}

.record-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.record-title {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.875rem;
}

.record-time {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.record-details {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(80px, 1fr));
    gap: 8px;
    font-size: 0.75rem;
}

.record-detail {
    text-align: center;
    padding: 4px 8px;
    background: var(--card);
    border-radius: 4px;
    border: 1px solid #e9ecef;
}

.record-detail-label {
    color: var(--text-secondary);
    font-size: 0.625rem;
    margin-bottom: 2px;
}

.record-detail-value {
    color: var(--text-primary);
    font-weight: 600;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .dashboard-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .dashboard-card-content {
        padding: 20px;
    }
    
    .stat-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
    }
    
    .stat-value {
        font-size: 20px;
    }
    
    .dashboard-chart {
        height: 250px;
    }
    
    .record-details {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* 加载状态 */
.dashboard-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 200px;
    color: var(--text-secondary);
}

.dashboard-loading .loading-spinner {
    margin-right: 15px;
}

/* 空状态 */
.dashboard-empty {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-secondary);
}

.dashboard-empty-icon {
    font-size: 48px;
    margin-bottom: 15px;
    opacity: 0.5;
}

.dashboard-empty-text {
    font-size: 1.125rem;
    margin-bottom: 8px;
}

.dashboard-empty-subtext {
    font-size: 0.875rem;
    opacity: 0.7;
} 