/* 综合素质评价汇总系统 —— 基于 mdui 设计令牌的全局样式 */

body { margin: 0; }

/* ---- 登录引导页 ---- */
.landing {
    min-height: 100vh;
    display: flex; align-items: center; justify-content: center;
    background: linear-gradient(135deg,
        rgb(var(--mdui-color-primary-container)) 0%,
        rgb(var(--mdui-color-surface)) 60%);
    padding: 24px; box-sizing: border-box;
}
.landing-card { max-width: 420px; width: 100%; border-radius: var(--mdui-shape-corner-extra-large); }
.landing-inner { padding: 40px 32px; display: flex; flex-direction: column; gap: 16px; align-items: center; text-align: center; }
.landing-logo {
    width: 72px; height: 72px; border-radius: var(--mdui-shape-corner-large);
    background: rgb(var(--mdui-color-primary)); color: rgb(var(--mdui-color-on-primary));
    display: flex; align-items: center; justify-content: center;
    font-size: 34px; font-weight: 600;
}
.landing-sub { color: rgb(var(--mdui-color-on-surface-variant)); margin: 0 0 8px; }
.landing-inner h1 { margin: 0; }

/* ---- 布局：控制台全高，主体内部滚动，侧边栏固定不随页面滚动 ---- */
html:has(body.app-shell), body.app-shell { height: 100%; }
body.app-shell { overflow: hidden; }

/* 侧边栏宽度减半（默认 360px → 180px），仅作用于内嵌模式 */
mdui-navigation-drawer[contained] { width: 180px !important; }

.main { padding: 24px; max-width: 1280px; margin: 0 auto; box-sizing: border-box; }
.avatar-btn { cursor: pointer; margin-right: 8px; background: rgb(var(--mdui-color-primary)); color: rgb(var(--mdui-color-on-primary)); }
.menu-user { padding: 12px 16px; font-weight: 500; color: rgb(var(--mdui-color-on-surface-variant)); }
.ico { font-style: normal; font-size: 20px; }

/* ---- 侧边栏菜单：紧凑显示，全部菜单项无需滚动即可完整展示 ---- */
#nav { padding-top: 4px; padding-bottom: 4px; }
#nav mdui-list-item {
    margin: 0 8px;
    height: 42px;
    min-height: 42px;
    font-size: 14px;
}
#nav mdui-divider { margin: 4px 0; }

/* ---- 页面通用 ---- */
.page-title { margin: 8px 0 20px; }
.grid { display: grid; gap: 16px; }
.grid.cols-2 { grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); }
.grid.cols-4 { grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }
.card-pad { padding: 20px; display: flex; flex-direction: column; gap: 14px; }
.stat-num { font-size: 32px; font-weight: 600; color: rgb(var(--mdui-color-primary)); }
.stat-label { color: rgb(var(--mdui-color-on-surface-variant)); }
.muted { color: rgb(var(--mdui-color-on-surface-variant)); }
.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.row.end { justify-content: flex-end; }
.grow { flex: 1; }

/* ---- 公告 ---- */
.announce h1, .announce h2, .announce h3 { margin: 12px 0 8px; }
.announce img { max-width: 100%; }
.announce pre { background: rgb(var(--mdui-color-surface-container-high)); padding: 12px; border-radius: var(--mdui-shape-corner-medium); overflow: auto; }
.announce code { font-family: monospace; }
.announce blockquote { border-left: 4px solid rgb(var(--mdui-color-primary)); margin: 8px 0; padding: 4px 12px; color: rgb(var(--mdui-color-on-surface-variant)); }
.announce a { color: rgb(var(--mdui-color-primary)); }

/* ---- 数据表格 ---- */
.table-wrap {
    overflow-x: auto;
    max-width: 100%; /* 关键：限制容器不撑宽页面，横向滚动只在容器内 */
    width: 100%;
    /* 横向拖动仅限表格内部，不带动整个页面 */
    overscroll-behavior: contain;
    border-radius: var(--mdui-shape-corner-medium);
    border: 1px solid rgb(var(--mdui-color-outline-variant));
}
table.dt { border-collapse: collapse; width: 100%; font-size: 13px; }
table.dt th, table.dt td {
    padding: 10px 12px; text-align: left; white-space: nowrap;
    border-bottom: 1px solid rgb(var(--mdui-color-outline-variant));
    max-width: 260px; overflow: hidden; text-overflow: ellipsis;
}
/* 操作列不截断、不出现省略号 */
table.dt td.ops { max-width: none; overflow: visible; text-overflow: clip; }
table.dt th { background: rgb(var(--mdui-color-surface-container-high)); font-weight: 600; position: sticky; top: 0; }
table.dt tr:hover td { background: rgb(var(--mdui-color-surface-container)); }

/* ---- 对话框 ---- */
.dlg-body { display: flex; flex-direction: column; gap: 12px; max-height: 60vh; overflow-y: auto; padding-top: 4px; min-width: min(480px, 80vw); }

/* ---- 上传区 ---- */
.upload-box {
    border: 2px dashed rgb(var(--mdui-color-outline));
    border-radius: var(--mdui-shape-corner-large);
    padding: 32px; text-align: center; display: flex; flex-direction: column; gap: 12px; align-items: center;
    transition: border-color .2s;
}
.upload-box.drag { border-color: rgb(var(--mdui-color-primary)); background: rgb(var(--mdui-color-surface-container)); }

/* ---- 下载中心 ---- */
.dl-btn-wrap { display: flex; flex-direction: column; gap: 6px; align-items: flex-start; }

/* ---- 内容完整性检测 ---- */
.check-mod { display: flex; flex-direction: column; gap: 6px; }
.check-issue {
    padding: 6px 10px;
    border-radius: var(--mdui-shape-corner-small);
    background: rgb(var(--mdui-color-surface-container-high));
    color: rgb(var(--mdui-color-on-surface-variant));
}

/* ---- 公告图标未读红点 ---- */
#annBtn { position: relative; }
.ann-dot {
    position: absolute; top: 8px; right: 8px;
    width: 8px; height: 8px; border-radius: 50%;
    background: rgb(var(--mdui-color-error));
    pointer-events: none;
}

/* ---- API 统计图表 ---- */
.chart-card svg { display: block; width: 100%; height: auto; }
.chart-title { margin-bottom: 8px; }

/* ---- 自定义侧边栏设置 ---- */
.sb-list { display: flex; flex-direction: column; }
.sb-row { padding: 4px 0; border-bottom: 1px dashed rgb(var(--mdui-color-outline-variant)); }
.sb-row:last-child { border-bottom: none; }
.sb-row .grow { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

mdui-chip { cursor: pointer; }

@media (max-width: 840px) {
    .main { padding: 16px; }
    table.dt th, table.dt td { max-width: 160px; }
}
