/* ============================================================
   智能建造模块化教学过程评价系统 V1.0
   全局样式 app.css
   配色：工程蓝 + 建造青，卡片式布局，适配 A4 打印
   ============================================================ */

:root {
    --brand: #165dba;
    --brand-dark: #0f4896;
    --accent: #0d9488;
    --bg: #f2f5fa;
    --sidebar-bg: #102a4c;
    --sidebar-active: #165dba;
    --text: #243447;
    --muted: #7b8794;
    --border: #e3e8ef;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: "PingFang SC", "Microsoft YaHei", "Noto Sans CJK SC", sans-serif;
    font-size: 14px;
}

a { text-decoration: none; }

/* ---------- 顶栏 ---------- */
.topbar {
    position: fixed;
    top: 0; left: 0; right: 0;
    height: 58px;
    background: linear-gradient(90deg, var(--brand-dark), var(--brand) 55%, var(--accent));
    box-shadow: 0 2px 10px rgba(15, 72, 150, .25);
    z-index: 1030;
}
.topbar-inner {
    height: 58px;
    padding: 0 20px;
    display: flex;
    align-items: center;
}
.brand { display: flex; align-items: center; color: #fff; font-weight: 600; font-size: 17px; }
.brand-logo {
    width: 34px; height: 34px;
    margin-right: 10px;
    border-radius: 8px;
    background: rgba(255,255,255,.18);
    display: inline-flex; align-items: center; justify-content: center;
    font-size: 19px; font-weight: 700;
}
.brand-ver { font-size: 11px; opacity: .75; margin-left: 6px; font-weight: 400; }
.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 12px; }
.user-chip { color: #fff; display: inline-flex; align-items: center; gap: 6px; font-size: 14px; }
.avatar {
    width: 30px; height: 30px; border-radius: 50%;
    background: rgba(255,255,255,.22);
    display: inline-flex; align-items: center; justify-content: center;
    font-weight: 600;
}

/* ---------- 布局 ---------- */
.layout { display: flex; padding-top: 58px; min-height: 100vh; }

/* ---------- 侧边栏 ---------- */
.sidebar {
    width: 226px;
    flex: 0 0 226px;
    background: var(--sidebar-bg);
    color: #b9c7d9;
    min-height: calc(100vh - 58px);
    position: fixed;
    top: 58px; bottom: 0; left: 0;
    overflow-y: auto;
    padding: 12px 0 70px;
    transition: transform .25s;
}
.nav-item {
    display: flex; align-items: center;
    padding: 11px 22px;
    color: #b9c7d9;
    font-size: 14.5px;
    border-left: 3px solid transparent;
}
.nav-item:hover { background: rgba(255,255,255,.06); color: #fff; }
.nav-item.active {
    background: var(--sidebar-active);
    color: #fff;
    border-left-color: #67e8f9;
}
.nav-item .ico { width: 24px; font-size: 15px; }
.nav-item .arrow { margin-left: auto; transition: transform .2s; }
.nav-parent[aria-expanded="true"] .arrow { transform: rotate(90deg); }
.nav-sub {
    display: block;
    padding: 8px 22px 8px 54px;
    color: #93a7c0;
    font-size: 13.5px;
}
.nav-sub:hover { color: #fff; }
.nav-sub.active { color: #67e8f9; font-weight: 600; }
.sidebar-foot {
    position: absolute; bottom: 0; left: 0; right: 0;
    padding: 14px 22px;
    font-size: 11px; color: #62758f;
    border-top: 1px solid rgba(255,255,255,.07);
    line-height: 1.7;
}

/* ---------- 主内容 ---------- */
.content {
    margin-left: 226px;
    flex: 1;
    padding: 22px 26px 40px;
    min-width: 0;
}
.page-head { margin-bottom: 18px; }
.page-title { font-size: 20px; font-weight: 600; margin: 0; }
.page-sub { color: var(--muted); font-size: 13px; margin-top: 4px; }

.card {
    border: 1px solid var(--border);
    border-radius: 10px;
    box-shadow: 0 1px 3px rgba(36, 52, 71, .05);
    margin-bottom: 18px;
}
.card-header {
    background: #fff;
    font-weight: 600;
    border-bottom: 1px solid var(--border);
    border-radius: 10px 10px 0 0 !important;
    padding: 13px 18px;
}
.card-body { padding: 18px; }

/* 指标卡 */
.stat-card { border: none; border-radius: 12px; overflow: hidden; }
.stat-card .stat-icon {
    width: 52px; height: 52px; border-radius: 12px;
    display: flex; align-items: center; justify-content: center;
    font-size: 24px;
}
.stat-num { font-size: 26px; font-weight: 700; line-height: 1.1; }
.stat-label { color: var(--muted); font-size: 13px; }
.bg-soft-blue { background: #e8f1fe; color: var(--brand); }
.bg-soft-teal { background: #e0f5f2; color: var(--accent); }
.bg-soft-orange { background: #fff0e0; color: #d97706; }
.bg-soft-purple { background: #f0eafe; color: #7c3aed; }

/* 表格 */
.table thead th {
    background: #f7f9fc;
    color: #536176;
    font-weight: 600;
    font-size: 13px;
    white-space: nowrap;
    border-bottom: 1px solid var(--border);
}
.table td, .table th { vertical-align: middle; }
.table-hover tbody tr:hover { background: #f6f9ff; }

/* 工具条 */
.toolbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 14px; }
.toolbar .form-control, .toolbar .form-select { width: auto; min-width: 150px; }
.toolbar .spacer { margin-left: auto; }

/* 登录页 */
.login-wrap {
    min-height: 100vh;
    display: flex; align-items: center; justify-content: center;
    background: linear-gradient(135deg, #0f4896 0%, #165dba 45%, #0d9488 100%);
    padding: 20px;
}
.login-card {
    width: 900px; max-width: 100%;
    background: #fff;
    border-radius: 16px;
    overflow: hidden;
    display: flex;
    box-shadow: 0 20px 60px rgba(0,0,0,.3);
}
.login-banner {
    flex: 0 0 44%;
    background: linear-gradient(160deg, #165dba, #0d9488);
    color: #fff; padding: 46px 38px;
    display: flex; flex-direction: column; justify-content: center;
}
.login-banner h2 { font-size: 25px; font-weight: 700; line-height: 1.4; }
.login-banner ul { padding-left: 18px; line-height: 2.1; font-size: 14px; opacity: .92; }
.login-form { flex: 1; padding: 46px 44px; }
.login-form h3 { font-size: 22px; font-weight: 700; margin-bottom: 6px; }
.login-tip { font-size: 12px; background: #f2f7ff; border: 1px dashed #b9d4f5; color: #40638f;
    border-radius: 8px; padding: 8px 12px; margin-top: 14px; line-height: 1.8; }

.btn-brand { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn-brand:hover { background: var(--brand-dark); border-color: var(--brand-dark); color: #fff; }

/* 进度条与标签 */
.score-ring { display: inline-flex; align-items: center; gap: 8px; }
.tag {
    display: inline-block; padding: 2px 9px; border-radius: 10px;
    font-size: 12px; background: #eef2f8; color: #536176;
}

/* 成绩录入格 */
.score-input { width: 74px; min-width: 74px; text-align: center; padding: 4px 6px; }
.score-input::-webkit-outer-spin-button,
.score-input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.score-input { -moz-appearance: textfield; appearance: textfield; }

/* 雷达/图表容器 */
.chart-box { width: 100%; }
.chart-box svg { width: 100%; height: auto; }

/* 描述列表 */
.desc-row { display: flex; padding: 9px 0; border-bottom: 1px dashed var(--border); }
.desc-row .label { width: 130px; color: var(--muted); flex: 0 0 130px; }

/* 打印：报表页 */
@media print {
    .topbar, .sidebar, .toolbar, .no-print, .page-head .btn { display: none !important; }
    .layout { display: block; padding-top: 0; }
    .content { margin: 0; padding: 0; }
    .card { box-shadow: none; border: none; }
    body { background: #fff; }
}

@media (max-width: 900px) {
    .sidebar { transform: translateX(-100%); z-index: 1025; }
    .sidebar.show { transform: translateX(0); }
    .content { margin-left: 0; }
    .login-card { flex-direction: column; }
    .login-banner { display: none; }
}

/* ---------- 截图/快照模式（?shot=1）：固定布局转静态，保证整页截图完整 ---------- */
.shot-mode .topbar { position: static; }
.shot-mode .layout { display: block; width: 100%; padding-top: 0; }
.shot-mode .sidebar {
    position: static !important;
    top: auto !important; bottom: auto !important; left: auto !important;
    min-height: auto;
    float: left;
    width: 226px;
    display: block;
    overflow: visible !important;
}
.shot-mode .sidebar-foot { position: static; }
.shot-mode .content {
    margin-left: 0;
    float: left;
    width: 1214px;
    display: block;
}
.shot-mode .layout::after { content: ""; display: block; clear: both; }
.shot-mode .sidebar .collapse { display: block !important; }

/* 截图模式：强制覆盖窄屏媒体查询，防止侧栏被移出视口 */
.shot-mode .sidebar { transform: none !important; z-index: auto !important; }
.shot-mode .content { margin-left: 0 !important; }

/* 截图模式：Bootstrap 栅格 table 化，避免老内核 flex 错位/重叠 */
.shot-mode .row { display: table !important; width: 100% !important; table-layout: fixed; }
.shot-mode .row > [class*="col-"] { display: table-cell !important; float: none !important; vertical-align: top; padding: 0 8px; }
.shot-mode .d-flex { display: block !important; }
.shot-mode .row > .col-lg-3 { width: 24%; }
.shot-mode .row > .col-lg-4 { width: 33%; }
.shot-mode .row > .col-lg-5 { width: 43%; }
.shot-mode .row > .col-lg-6 { width: 50%; }
.shot-mode .row > .col-lg-7 { width: 58%; }
.shot-mode .row > .col-lg-8 { width: 66%; }
.shot-mode .row > .col-lg-12, .shot-mode .row > .col-12 { width: 100%; }
.shot-mode .tab-content > .tab-pane { display: block !important; opacity: 1 !important; }
