/* ==========================================================================
   尚益数据终端 · 报表门户
   品牌色取自 logo：#00486E
   ========================================================================== */

:root {
    --brand: #00486e;
    --brand-700: #003a5a;
    --brand-900: #002740;
    --brand-50: #eef4f8;
    --brand-100: #dae7ef;

    --ink: #101820;
    --ink-2: #3a4652;
    --ink-3: #79838f;
    --ink-4: #a6aeb8;

    --line: #e3e8ee;
    --line-2: #eef1f5;
    --bg: #f5f7f9;
    --surface: #ffffff;

    --ok: #1c7c54;
    --danger: #b3261e;

    --r-sm: 8px;
    --r-md: 12px;
    --r-lg: 16px;

    --sans: "Segoe UI", "PingFang SC", "Hiragino Sans GB",
            "Microsoft YaHei", "Source Han Sans SC", system-ui, sans-serif;
    --mono: "Cascadia Mono", "SF Mono", Consolas, "Courier New", monospace;
}

* { box-sizing: border-box; }

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

body {
    font-family: var(--sans);
    font-size: 15px;
    line-height: 1.6;
    color: var(--ink);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
}

/* 三个页面都按窗口高度铺满，页面本身不出现滚动条；
   内部空间不足时只在各自的内容区滚动，不带动整页。 */
body.app,
body.login-page,
body.admin-page {
    height: 100vh;
    overflow: hidden;
}

body.app { display: flex; flex-direction: column; }

/* 隐藏滚动条但保留可滚动能力，仅在内容确实塞不下时生效 */
.hide-scroll { scrollbar-width: none; -ms-overflow-style: none; }
.hide-scroll::-webkit-scrollbar { width: 0; height: 0; }

a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }
input, select, textarea { font-family: inherit; font-size: 14px; }

.eyebrow {
    margin: 0;
    font-size: 12px;
    font-weight: 500;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--ink-3);
}

/* ==========================================================================
   登录页
   ========================================================================== */

.login {
    display: grid;
    grid-template-columns: minmax(360px, 46%) 1fr;
    height: 100vh;
    overflow: hidden;
}

.login-brand {
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 64px 60px 48px;
    background: var(--brand);
    color: #fff;
    overflow: hidden;
}

.login-brand::after {
    content: "";
    position: absolute;
    right: -120px;
    bottom: -180px;
    width: 520px;
    height: 520px;
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 50%;
    pointer-events: none;
}

.login-brand::before {
    content: "";
    position: absolute;
    right: -40px;
    bottom: -100px;
    width: 340px;
    height: 340px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    pointer-events: none;
}

.login-brand img {
    height: 76px;
    width: auto;
    align-self: flex-start;
}

.brand-copy {
    position: relative;
    z-index: 1;
    max-width: 460px;
}

.brand-copy .eyebrow {
    color: rgba(255, 255, 255, 0.62);
}

.brand-copy h1 {
    margin: 18px 0 0;
    font-size: 46px;
    font-weight: 500;
    line-height: 1.1;
    letter-spacing: -0.01em;
}

.brand-copy p.lede {
    margin: 22px 0 0;
    font-size: 15px;
    line-height: 1.85;
    color: rgba(255, 255, 255, 0.78);
}

.login-foot {
    position: relative;
    z-index: 1;
    font-size: 12px;
    letter-spacing: 0.04em;
    color: rgba(255, 255, 255, 0.45);
}

.login-panel {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 48px 40px;
    background: var(--surface);
}

.login-form {
    width: 100%;
    max-width: 372px;
}

.login-form h2 {
    margin: 0;
    font-size: 28px;
    font-weight: 500;
    letter-spacing: -0.01em;
}

.login-form .sub {
    margin: 10px 0 40px;
    font-size: 14px;
    color: var(--ink-3);
}

.field { margin-bottom: 20px; }

.field label {
    display: block;
    margin-bottom: 8px;
    font-size: 13px;
    font-weight: 500;
    color: var(--ink-2);
}

.field input {
    width: 100%;
    height: 46px;
    padding: 0 14px;
    border: 1px solid var(--line);
    border-radius: var(--r-sm);
    background: var(--surface);
    color: var(--ink);
    transition: border-color 0.15s, box-shadow 0.15s;
}

.field input:focus {
    outline: none;
    border-color: var(--brand);
    box-shadow: 0 0 0 3px rgba(0, 72, 110, 0.1);
}

.btn-primary {
    width: 100%;
    height: 48px;
    margin-top: 8px;
    border: 0;
    border-radius: var(--r-sm);
    background: var(--brand);
    color: #fff;
    font-size: 15px;
    font-weight: 500;
    letter-spacing: 0.04em;
    transition: background 0.15s;
}

.btn-primary:hover { background: var(--brand-700); }
.btn-primary:disabled { opacity: 0.55; cursor: default; }

.form-msg {
    min-height: 22px;
    margin: 16px 0 0;
    font-size: 13px;
    color: var(--danger);
}

.login-meta {
    margin-top: 44px;
    padding-top: 20px;
    border-top: 1px solid var(--line-2);
    font-size: 12px;
    color: var(--ink-4);
}

/* ==========================================================================
   目录页
   ========================================================================== */

.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 76px;
    padding: 0 40px;
    background: var(--surface);
    border-bottom: 1px solid var(--line);
}

.topbar .brand {
    display: flex;
    align-items: center;
    gap: 18px;
}

.topbar .brand img { height: 40px; width: auto; }

.topbar .brand .divider {
    width: 1px;
    height: 20px;
    background: var(--line);
}

.topbar .brand .name {
    font-size: 15px;
    font-weight: 500;
    letter-spacing: 0.02em;
}

.topbar .account {
    display: flex;
    align-items: center;
    gap: 18px;
    font-size: 13px;
    color: var(--ink-3);
}

.topbar .account strong {
    font-weight: 500;
    color: var(--ink-2);
}

.btn-ghost {
    padding: 8px 16px;
    border: 1px solid var(--line);
    border-radius: var(--r-sm);
    background: transparent;
    font-size: 13px;
    color: var(--ink-2);
    transition: border-color 0.15s, color 0.15s;
}

.btn-ghost:hover { border-color: var(--brand); color: var(--brand); }

.stage {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
    width: 100%;
    max-width: min(1560px, 100%);
    margin: 0 auto;
    padding: clamp(18px, 3.4vh, 56px) clamp(20px, 2.4vw, 40px) clamp(12px, 2vh, 24px);
}

.stage-head {
    flex: 0 0 auto;
    margin-bottom: clamp(14px, 2.8vh, 44px);
}

.stage-head h1 {
    margin: clamp(6px, 1.2vh, 14px) 0 0;
    font-size: clamp(26px, 4.4vh, 38px);
    font-weight: 500;
    letter-spacing: -0.015em;
    line-height: 1.15;
}

.stage-head .summary {
    margin: clamp(6px, 1.1vh, 12px) 0 0;
    font-size: clamp(12px, 1.6vh, 14px);
    color: var(--ink-3);
}

#content {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    gap: clamp(10px, 1.8vh, 22px);
}

.group {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    margin: 0;
}

.group-title {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    gap: 14px;
    margin: 0 0 clamp(8px, 1.3vh, 16px);
    font-size: 13px;
    font-weight: 500;
    letter-spacing: 0.1em;
    color: var(--ink-3);
    text-transform: uppercase;
}

.group-title::after {
    content: "";
    flex: 1;
    height: 1px;
    background: var(--line);
}

.cards {
    flex: 1;
    min-height: 0;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(340px, 100%), 1fr));
    grid-auto-rows: minmax(0, 1fr);
    gap: clamp(10px, 1.6vh, 20px);
}

/* 卡片数量多到一屏塞不下时，改为固定行高并在内容区内部滚动 */
#content.scroll { overflow-y: auto; scrollbar-width: thin; scrollbar-color: var(--line) transparent; }
#content.scroll .cards { grid-auto-rows: minmax(150px, auto); }
#content.scroll .group { flex: 0 0 auto; }

/* 大屏上卡片封顶，多余高度留给行间距，避免卡内被拉开成大片空白 */
#content.capped .cards {
    grid-auto-rows: var(--card-h);
    align-content: center;
}

.card {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 0;
    overflow: hidden;
    padding: clamp(14px, 2.4vh, 26px) clamp(16px, 1.7vw, 30px) clamp(13px, 2.2vh, 24px);
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--r-md);
    transition: border-color 0.18s, box-shadow 0.18s, transform 0.18s;
}

.card:hover {
    border-color: var(--brand);
    box-shadow: 0 10px 28px rgba(0, 72, 110, 0.09);
    transform: translateY(-2px);
}

.card-top {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
}

.card-index {
    font-size: 12px;
    font-weight: 500;
    letter-spacing: 0.12em;
    color: var(--brand);
    opacity: 0.62;
}

.card-group {
    font-size: 12px;
    color: var(--ink-3);
    letter-spacing: 0.02em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.card h3 {
    margin: clamp(6px, 1.6vh, 14px) 0 0;
    font-size: clamp(15px, 2.5vh, 21px);
    font-weight: 500;
    line-height: 1.3;
    letter-spacing: -0.005em;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.card-go {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: clamp(6px, 1.8vh, 26px);
    font-size: 13px;
    font-weight: 500;
    color: var(--brand);
}

.card-go svg { transition: transform 0.18s; flex: 0 0 auto; }
.card:hover .card-go svg { transform: translateX(4px); }

/* 卡片被压得很矮时，隐藏次要信息，保住标题可读 */
@media (max-height: 760px) {
    .card-go { margin-top: 6px; font-size: 12px; }
    .card-group { display: none; }
}

/* 只有一张报表：整幅横条，垂直居中，不铺满整屏 */
.cards.solo {
    grid-template-columns: minmax(0, 1fr);
    grid-auto-rows: minmax(0, min(220px, 100%));
    align-content: center;
}

.cards.solo .card {
    flex-direction: row;
    align-items: center;
    justify-content: flex-start;
    gap: clamp(18px, 2.6vw, 34px);
    padding: clamp(24px, 4vh, 40px) clamp(24px, 3vw, 46px);
}

.cards.solo .card-top {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
    min-width: 64px;
}

.cards.solo .card-index { font-size: 14px; }

.cards.solo .card h3 {
    flex: 1;
    margin: 0;
    font-size: clamp(22px, 3.6vh, 32px);
    line-height: 1.25;
    letter-spacing: -0.01em;
    -webkit-line-clamp: 2;
}

.cards.solo .card-go { margin-top: 0; }

.empty {
    padding: 72px 40px;
    text-align: center;
    border: 1px dashed var(--line);
    border-radius: var(--r-md);
    color: var(--ink-3);
    font-size: 14px;
    line-height: 2;
}

.stage-foot {
    flex: 0 0 auto;
    margin-top: clamp(8px, 1.4vh, 20px);
    padding-top: clamp(8px, 1.4vh, 18px);
    border-top: 1px solid var(--line);
    font-size: 12px;
    color: var(--ink-4);
    display: flex;
    justify-content: space-between;
}

/* ==========================================================================
   通用小件
   ========================================================================== */

.skeleton {
    min-height: 120px;
    border-radius: var(--r-md);
    background: linear-gradient(90deg, #eef1f5 25%, #f6f8fa 50%, #eef1f5 75%);
    background-size: 200% 100%;
    animation: shimmer 1.4s infinite;
}

@keyframes shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

@media (max-width: 900px) {
    .login { grid-template-columns: 1fr; grid-template-rows: auto 1fr; }
    .login-brand { padding: 24px 26px; min-height: 0; }
    .login-brand img { height: 40px; }
    .brand-copy h1 { font-size: 28px; }
    .brand-copy p.lede { display: none; }
    .login-foot { display: none; }
    .login-panel { padding: 28px 24px; }
    .login-form .sub { margin-bottom: 24px; }
    .login-meta { margin-top: 24px; }
    .topbar { padding: 0 20px; height: 64px; }
    .stage-head h1 { font-size: 24px; }
    .cards { grid-template-columns: 1fr; }
    .cards.solo .card { flex-direction: column; align-items: flex-start; gap: 12px; }
    .cards.solo .card-go { margin-top: 4px; }
    .stage-foot { display: none; }
}

/* 窗口很矮时（例如笔记本分屏），收掉非必要装饰 */
@media (max-height: 620px) {
    .stage-head .summary { display: none; }
    .card-index { display: none; }
    .stage-foot { display: none; }
    .brand-copy p.lede { display: none; }
    .login-foot { display: none; }
}
