/* ==========================================================================
   Computing 工具页公共样式
   主色: #6366f1 (靛紫) — 全站统一 (design-spec-public v3.1 · 紧凑版)
   暗色模式: 响应 [data-theme="dark"]
   设计理念: 一屏展示、紧凑高效、占满屏幕
   ========================================================================== */

:root {
    /* 主题色 — 靛紫渐变（全站统一） */
    --accent: #6366f1;
    --accent-hover: #4f46e5;
    --accent-light: rgba(99, 102, 241, 0.12);

    /* 背景层 — 浅靛紫渐变 */
    --bg: #f5f3ff;
    --bg-card: #fff;

    /* 文字 */
    --text: #1e293b;
    --text-muted: #64748b;

    /* 边框 */
    --border: #e2e8f0;

    /* 涨跌色 — 金融数据 */
    --up: #dc3545;
    --dn: #28a745;
    --warn: #ff8f00;
    --info: #1976d2;
}

[data-theme="dark"] {
    --accent: #818cf8;
    --accent-hover: #6366f1;
    --accent-light: rgba(129, 140, 248, 0.15);
    --bg: #0f0f1a;
    --bg-card: #1a1a2e;
    --text: #e0e0e0;
    --text-muted: #999;
    --border: #333355;
}

* { box-sizing: border-box; }

html, body {
    height: 100%;
    overflow: hidden;
    margin: 0;
}

body {
    font-family: "PingFang SC", "Microsoft YaHei", sans-serif;
    background: linear-gradient(135deg, #f5f3ff 0%, #ede9fe 100%);
    color: var(--text);
    padding: 0;
    font-size: 13px;
}

/* --------------------------------------------------------------------------
   毛玻璃布局骨架（v3.1 新增）
-------------------------------------------------------------------------- */
.page-wrapper {
    height: 100%;
    display: flex;
    flex-direction: column;
}

.glass-header {
    flex-shrink: 0;
    padding: 6px 14px;
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(10px);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}
.glass-header-left {
    display: flex;
    align-items: center;
    gap: 8px;
}
.glass-header-icon {
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    border-radius: 8px;
    padding: 5px 7px;
    box-shadow: 0 3px 8px rgba(99, 102, 241, 0.3);
    display: flex;
    align-items: center;
}
.glass-header-icon i {
    color: #fff;
    font-size: 15px;
}
.glass-header-title {
    font-size: 15px;
    font-weight: 700;
    background: linear-gradient(90deg, #4f46e5, #8b5cf6);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    line-height: 1.2;
}
.glass-header-sub {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 1px;
}
.glass-header-back {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    border-radius: 5px;
    border: 1px solid var(--border);
    background: #fff;
    color: var(--text-muted);
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
}
.glass-header-back:hover {
    border-color: var(--accent);
    color: var(--accent);
}

.page-content {
    flex: 1;
    overflow: auto;
    padding: 8px;
    max-width: 1600px;
    width: 100%;
    margin: 0 auto;
}

/* --------------------------------------------------------------------------
   旧 container 兼容（逐步废弃，改用 page-content）
-------------------------------------------------------------------------- */
.container {
    max-width: 1600px;
    padding: 6px 8px;
    margin: 0 auto;
}

/* --------------------------------------------------------------------------
   Card 通用 · 紧凑版 (v3.1 收紧)
-------------------------------------------------------------------------- */
.card, .tool-card, .calc-card, .base-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 8px 10px;
    margin-bottom: 8px;
}
.base-card-header {
    background: linear-gradient(135deg, rgba(99,102,241,0.06) 0%, rgba(139,92,246,0.02) 100%);
    border-bottom: 1px solid var(--border);
    padding: 6px 10px;
    font-size: 12px;
    font-weight: 600;
    color: var(--accent);
    display: flex;
    align-items: center;
    gap: 6px;
    margin: -8px -10px 8px -10px;
    border-radius: 6px 6px 0 0;
}
.base-card-body {
    padding: 0;
}

/* --------------------------------------------------------------------------
   表单控件 · 紧凑版 (v3.1 收紧)
-------------------------------------------------------------------------- */
.form-label, label {
    font-size: 10px;
    color: var(--text-muted);
    margin-bottom: 2px;
    display: block;
}

.form-control, .form-select, input[type="number"],
input[type="text"], input[type="date"], select {
    font-size: 12px;
    border: 1px solid var(--border);
    border-radius: 5px;
    padding: 3px 8px;
    background: var(--bg-card);
    color: var(--text);
    width: 100%;
    transition: border-color .15s;
    height: 26px;
}

textarea.form-control, textarea {
    height: auto;
    padding: 5px 8px;
    font-size: 12px;
    font-family: 'JetBrains Mono', 'Consolas', monospace;
    line-height: 1.5;
}

.form-control:focus, .form-select:focus, input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.08);
}

/* --------------------------------------------------------------------------
   按钮 · 紧凑版 (v3.1 收紧)
-------------------------------------------------------------------------- */
.btn-primary, button[type="submit"].btn-primary,
.btn {
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    color: #fff;
    border: none;
    border-radius: 5px;
    padding: 3px 10px;
    font-size: 12px;
    cursor: pointer;
    transition: all .2s;
    height: 26px;
    font-weight: 500;
}
.btn-primary:hover, .btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 3px 10px rgba(99, 102, 241, 0.25);
}

.btn-secondary {
    background: transparent;
    color: var(--text-muted);
    border: 1px solid var(--border);
}
.btn-secondary:hover { color: var(--accent); border-color: var(--accent); }

/* --------------------------------------------------------------------------
   指标卡 stat-card · 紧凑版 (v3.1 收紧)
-------------------------------------------------------------------------- */
.stat-row {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    margin-bottom: 8px;
}
.stat-card {
    flex: 1;
    min-width: 110px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 6px 10px;
    text-align: center;
    border-left: 3px solid var(--accent);
}
.stat-card.success { border-left-color: var(--up); }
.stat-card.warning { border-left-color: var(--warn); }
.stat-card.error   { border-left-color: var(--dn); }
.stat-card.info    { border-left-color: var(--info); }
.stat-card .ind-label { font-size: 10px; color: var(--text-muted); }
.stat-card .ind-val   { font-size: 16px; font-weight: bold; color: var(--text); }
.stat-card .ind-sub   { font-size: 9px; color: var(--text-muted); }

/* --------------------------------------------------------------------------
   结果区高亮色条
-------------------------------------------------------------------------- */
.result-highlight {
    background: var(--accent-light);
    border-left: 3px solid var(--accent);
    padding: 6px 8px;
    border-radius: 5px;
    margin: 4px 0;
}

/* --------------------------------------------------------------------------
   表格 · 紧凑版 (v3.1 收紧)
-------------------------------------------------------------------------- */
table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
}
table th, table td {
    padding: 4px 8px;
    border-bottom: 1px solid var(--border);
    text-align: left;
}
table th {
    background: var(--bg-card);
    font-weight: 600;
    color: var(--text);
    font-size: 12px;
}
table tr:hover td { background: var(--accent-light); }

/* --------------------------------------------------------------------------
   图表容器 · 自适应占满 (v3.1)
-------------------------------------------------------------------------- */
.chart-box {
    width: 100%;
    flex: 1;
    min-height: 200px;
}

/* --------------------------------------------------------------------------
   筛选栏 · 紧凑版 (v3.1)
-------------------------------------------------------------------------- */
.filter-row {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 6px 8px;
    margin-bottom: 8px;
}
.filter-actions {
    margin-left: auto;
    display: flex;
    gap: 6px;
}

/* --------------------------------------------------------------------------
   响应式
-------------------------------------------------------------------------- */
@media (max-width: 900px) {
    .stat-row > .stat-card { min-width: 100%; }
    .container { padding: 4px 6px; }
    .page-content { padding: 6px; }
}
