/* ========================================
   DataConsole — 现代化数据平台 UI
   配色：深靛蓝主调 + 紫蓝渐变点缀
   布局：顶部导航 + 内容流式
   ======================================== */

/* ---- 变量 ---- */
:root {
    --pri: #4f46e5;          /* 靛蓝主色 */
    --pri-dark: #3730a3;
    --pri-light: #818cf8;
    --accent: #06b6d4;       /* 青色点缀 */
    --success: #10b981;
    --danger: #ef4444;
    --bg-body: #f1f5f9;
    --bg-card: #ffffff;
    --text-1: #0f172a;        /* 主文字 */
    --text-2: #64748b;        /* 次文字 */
    --text-3: #94a3b8;        /* 辅助文字 */
    --border: #e2e8f0;
    --shadow-sm: 0 1px 2px rgba(0,0,0,.05);
    --shadow-md: 0 4px 12px rgba(0,0,0,.08);
    --shadow-lg: 0 10px 30px rgba(0,0,0,.12);
    --radius: 14px;
    --radius-sm: 10px;
    --radius-xs: 8px;
}

/* ---- Reset ---- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'PingFang SC', sans-serif;
    background: var(--bg-body);
    color: var(--text-1);
    line-height: 1.6;
}


/* ==============================
   登录页面
   ============================== */
.login-page-body {
    overflow: hidden;
}

.login-bg {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #0f172a 0%, #1e1b4b 50%, #0c1222 100%);
}

.bg-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: .35;
}
.bg-orb-1 {
    width: 500px; height: 500px;
    top: -120px; left: -100px;
    background: var(--pri);
}
.bg-orb-2 {
    width: 400px; height: 400px;
    bottom: -80px; right: -60px;
    background: var(--accent);
}

.login-panel {
    position: relative;
    width: 400px;
    padding: 48px 40px;
    background: rgba(255,255,255,.95);
    backdrop-filter: blur(20px);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    z-index: 1;
}

.login-brand {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-bottom: 8px;
}
.brand-icon {
    font-size: 32px;
    color: var(--pri);
}
.login-brand h1 {
    font-size: 22px;
    font-weight: 700;
    color: var(--text-1);
    letter-spacing: -.3px;
}

.login-subtitle {
    text-align: center;
    color: var(--text-3);
    font-size: 14px;
    margin-bottom: 32px;
}

.field-group { margin-bottom: 22px; }
.field-group label {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-2);
    margin-bottom: 7px;
}
.field-icon { font-size: 16px; color: var(--text-3); }
.field-group input {
    width: 100%;
    padding: 11px 14px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-xs);
    font-size: 14px;
    background: #f8fafc;
    transition: all .2s;
}
.field-group input:focus {
    outline: none;
    border-color: var(--pri);
    background: #fff;
    box-shadow: 0 0 0 3px rgba(79,70,229,.12);
}

.btn-login {
    width: 100%;
    padding: 13px;
    border: none;
    border-radius: var(--radius-xs);
    background: linear-gradient(135deg, var(--pri), #6366f1);
    color: #fff;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: transform .15s, box-shadow .2s;
    box-shadow: 0 4px 14px rgba(79,70,229,.35);
}
.btn-login:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(79,70,229,.45);
}
.btn-login:active { transform: translateY(0); }

.error-msg {
    text-align: center;
    color: var(--danger);
    font-size: 13px;
    margin-top: 14px;
    min-height: 18px;
    font-weight: 500;
}


/* ==============================
   顶部导航
   ============================== */
.topbar {
    position: sticky;
    top: 0;
    z-index: 100;
    background: #0f172a;
    box-shadow: 0 1px 3px rgba(0,0,0,.2);
}
.topbar-inner {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 28px;
    height: 62px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.topbar-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}
.topbar-brand .brand-icon {
    font-size: 26px;
    color: var(--pri-light);
}
.brand-text {
    font-size: 19px;
    font-weight: 700;
    color: #e2e8f0;
    letter-spacing: .3px;
}

.topbar-nav {
    display: flex;
    gap: 4px;
    height: 100%;
}
.nav-tab {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 0 22px;
    color: var(--text-3);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: color .2s, border-color .2s;
    border-bottom: 3px solid transparent;
    height: 100%;
}
.nav-tab:hover { color: #e2e8f0; background: rgba(255,255,255,.04); }
.nav-tab.active {
    color: #fff;
    border-bottom-color: var(--pri-light);
}
.nav-tab .material-icons { font-size: 18px; }

.btn-logout {
    display: flex;
    align-items: center;
    gap: 5px;
    background: transparent;
    border: 1px solid rgba(239,68,68,.4);
    color: #f87171;
    padding: 6px 16px;
    border-radius: var(--radius-xs);
    font-size: 13px;
    cursor: pointer;
    transition: all .2s;
}
.btn-logout:hover { background: rgba(239,68,68,.1); border-color: var(--danger); }


/* ==============================
   主内容区
   ============================== */
.main-body {
    max-width: 1400px;
    margin: 0 auto;
    padding: 32px 28px;
    min-height: calc(100vh - 62px);
}

.page-section { display: none; }
.page-section.active { display: block; }

.page-header {
    margin-bottom: 28px;
}
.page-header h2 {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-1);
}
.page-header p {
    font-size: 14px;
    color: var(--text-3);
    margin-top: 4px;
}


/* ==============================
   指标卡片行
   ============================== */
.metric-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 20px;
    margin-bottom: 28px;
}
.metric-card {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 24px;
    display: flex;
    align-items: center;
    gap: 18px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border);
    transition: transform .2s, box-shadow .2s;
}
.metric-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.metric-icon {
    width: 52px;
    height: 52px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    background: #eef2ff;
    color: var(--pri);
}
.metric-icon .material-icons { font-size: 26px; }

.metric-card.primary {
    background: linear-gradient(135deg, var(--pri) 0%, #6366f1 100%);
    color: #fff;
    border: none;
}
.metric-card.primary .metric-icon {
    background: rgba(255,255,255,.2);
    color: #fff;
}

.metric-info {
    display: flex;
    flex-direction: column;
}
.metric-label {
    font-size: 13px;
    color: var(--text-3);
    font-weight: 500;
}
.metric-card.primary .metric-label { color: rgba(255,255,255,.75); }
.metric-value {
    font-size: 26px;
    font-weight: 800;
    margin-top: 2px;
    line-height: 1.2;
}


/* ==============================
   图表
   ============================== */
.chart-box {
    background: var(--bg-card);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border);
    overflow: hidden;
}
.chart-title-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px 0;
}
.chart-title-row h3 {
    font-size: 17px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-1);
}
.chart-title-row .material-icons {
    color: var(--pri);
    font-size: 20px;
}
.chart-canvas-wrap {
    padding: 12px 24px 24px;
    height: 380px;
}


/* ==============================
   报表筛选 & 表格
   ============================== */
.filter-bar {
    display: flex;
    gap: 12px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}
.filter-item {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-xs);
    padding: 0 14px;
    min-width: 220px;
    flex-grow: 1;
}
.filter-item .material-icons {
    color: var(--text-3);
    font-size: 20px;
    flex-shrink: 0;
}
.filter-item input {
    border: none;
    outline: none;
    padding: 11px 0;
    font-size: 14px;
    width: 100%;
    background: transparent;
}

.btn-search {
    padding: 11px 28px;
    border: none;
    border-radius: var(--radius-xs);
    background: var(--pri);
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: background .2s;
}
.btn-search:hover { background: var(--pri-dark); }

.table-wrap {
    background: var(--bg-card);
    border-radius: var(--radius);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
    overflow-x: auto;
}

table { width: 100%; border-collapse: collapse; }
th, td {
    padding: 14px 18px;
    text-align: left;
    white-space: nowrap;
    border-bottom: 1px solid #f1f5f9;
    font-size: 14px;
}
thead th {
    background: #f8fafc;
    font-weight: 600;
    color: var(--text-2);
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: .3px;
}
tbody tr { transition: background .15s; }
tbody tr:hover { background: #f8fafc; }

.sum-row {
    background: #eef2ff !important;
    font-weight: 700;
    color: var(--pri);
    border-top: 2px solid var(--pri-light);
}
.sum-row:hover { background: #eef2ff !important; }

.pagination {
    margin-top: 20px;
    display: flex;
    justify-content: center;
    gap: 6px;
    flex-wrap: wrap;
}
.pagination button {
    padding: 8px 16px;
    border: 1px solid var(--border);
    background: var(--bg-card);
    border-radius: var(--radius-xs);
    cursor: pointer;
    font-size: 13px;
    color: var(--text-2);
    transition: all .15s;
}
.pagination button:not(:disabled):hover {
    border-color: var(--pri);
    color: var(--pri);
}
.pagination button:disabled {
    background: var(--pri);
    color: #fff;
    border-color: var(--pri);
    cursor: default;
}


/* ==============================
   账户管理
   ============================== */
.account-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(420px, 1fr));
    gap: 24px;
}
.form-card {
    background: var(--bg-card);
    border-radius: var(--radius);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}
.form-card-head {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 22px 24px;
    border-bottom: 1px solid var(--border);
    background: #f8fafc;
}
.form-card-head .material-icons {
    color: var(--pri);
    font-size: 22px;
}
.form-card-head h3 {
    font-size: 17px;
    font-weight: 600;
    color: var(--text-1);
}
.form-card form { padding: 24px; }

.info-row {
    display: flex;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px dashed var(--border);
}
.info-row:last-child { border-bottom: none; }
.info-row label {
    font-size: 14px;
    color: var(--text-3);
    font-weight: 500;
}
.info-val {
    font-weight: 600;
    color: var(--text-1);
}

.divider-line {
    height: 1px;
    background: var(--border);
    margin: 18px 0;
}

.btn-submit {
    width: 100%;
    padding: 12px;
    border: none;
    border-radius: var(--radius-xs);
    background: var(--pri);
    color: #fff;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: background .2s;
    margin-top: 8px;
}
.btn-submit:hover { background: var(--pri-dark); }


/* ==============================
   响应式
   ============================== */
@media (max-width: 768px) {
    .topbar-inner { padding: 0 16px; }
    .nav-tab { padding: 0 14px; font-size: 13px; }
    .nav-tab span.material-icons { display: none; }
    .main-body { padding: 20px 16px; }
    .metric-row { grid-template-columns: 1fr; }
    .account-grid { grid-template-columns: 1fr; }
    .filter-bar { flex-direction: column; }
    .filter-item { min-width: unset; }
    .login-panel { margin: 16px; width: auto; }
}
