/* =========================================================================
   先知 PdM · 移动客户端样式
   智慧园区蓝图风格：深蓝底 + 青/天蓝描边 + 分层圆角面板
   ========================================================================= */

:root {
    --bg0: #050a14;
    --bg1: #071122;
    --bg2: #0b1a33;
    --panel: rgba(16, 38, 68, 0.62);
    --panel-2: rgba(10, 25, 46, 0.78);
    --panel-3: rgba(20, 46, 80, 0.55);
    --line: rgba(94, 180, 235, 0.14);
    --line-2: rgba(94, 180, 235, 0.28);
    --tx: #e8f2ff;
    --tx2: #a6c1dd;
    --tx3: #6f8db2;
    --cy: #22d3ee;
    --sky: #38bdf8;
    --ok: #22c55e;
    --warn: #fbbf24;
    --ser: #fb923c;
    --crit: #f87171;
    --info: #60a5fa;
    --r-lg: 22px;
    --r-md: 16px;
    --r-sm: 11px;
    --tab-h: 62px;
    --bar-h: 56px;
    --safe-t: env(safe-area-inset-top, 0px);
    --safe-b: env(safe-area-inset-bottom, 0px);
    --shadow: 0 10px 30px -18px rgba(0, 0, 0, 0.9);
    --ease: cubic-bezier(0.22, 0.9, 0.28, 1);
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
}

body {
    margin: 0;
    min-height: 100vh;
    min-height: 100dvh;
    background: var(--bg0);
    color: var(--tx);
    font: 15px/1.6 -apple-system, BlinkMacSystemFont, "PingFang SC", "HarmonyOS Sans SC",
        "Hiragino Sans GB", "Microsoft YaHei", system-ui, sans-serif;
    -webkit-font-smoothing: antialiased;
    overscroll-behavior-y: none;
    padding-top: var(--safe-t);
}

/* 蓝图网格背景 */
.bg-grid {
    position: fixed;
    inset: 0;
    z-index: -1;
    background:
        radial-gradient(120% 80% at 12% -10%, #123a63 0%, rgba(7, 17, 34, 0) 58%),
        radial-gradient(90% 60% at 100% 0%, #0d2a4d 0%, rgba(7, 17, 34, 0) 55%),
        linear-gradient(180deg, #071122 0%, #050a14 62%, #04080f 100%);
}

.bg-grid::after {
    content: "";
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(94, 180, 235, 0.055) 1px, transparent 1px),
        linear-gradient(90deg, rgba(94, 180, 235, 0.055) 1px, transparent 1px);
    background-size: 38px 38px;
    mask-image: radial-gradient(120% 70% at 50% 0%, #000 0%, transparent 72%);
    -webkit-mask-image: radial-gradient(120% 70% at 50% 0%, #000 0%, transparent 72%);
}

/* ============================ 基础排版 ============================ */

h1,
h2,
h3,
h4 {
    margin: 0;
    font-weight: 600;
    letter-spacing: 0.2px;
}

p {
    margin: 0;
}

a {
    color: var(--sky);
    text-decoration: none;
    -webkit-tap-highlight-color: transparent;
}

button {
    font: inherit;
    color: inherit;
}

.ic {
    display: block;
    flex: none;
}

.num {
    font-variant-numeric: tabular-nums;
    letter-spacing: -0.2px;
}

.muted {
    color: var(--tx2);
}

.dim {
    color: var(--tx3);
}

.tiny {
    font-size: 12px;
}

.strong {
    font-weight: 600;
}

.nowrap {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ============================ 外壳 ============================ */

.shell {
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    max-width: 640px;
    margin: 0 auto;
    position: relative;
}

.appbar {
    position: sticky;
    top: 0;
    z-index: 40;
    background: linear-gradient(180deg, rgba(7, 17, 34, 0.94) 0%, rgba(7, 17, 34, 0.82) 100%);
    backdrop-filter: blur(14px) saturate(1.2);
    -webkit-backdrop-filter: blur(14px) saturate(1.2);
    border-bottom: 1px solid var(--line);
}

.appbar-in {
    display: flex;
    align-items: center;
    gap: 10px;
    height: var(--bar-h);
    padding: 0 12px;
}

.brandmark {
    width: 30px;
    height: 30px;
    flex: none;
    border-radius: 10px;
    display: grid;
    place-items: center;
    background: linear-gradient(145deg, rgba(34, 211, 238, 0.22), rgba(56, 189, 248, 0.06));
    border: 1px solid rgba(56, 189, 248, 0.34);
    position: relative;
}

.brandmark-dot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: var(--cy);
    box-shadow: 0 0 14px 2px rgba(34, 211, 238, 0.7);
}

.appbar-t {
    flex: 1;
    min-width: 0;
}

.appbar-t h1 {
    font-size: 17px;
    line-height: 1.25;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.appbar-t p {
    font-size: 11.5px;
    color: var(--tx3);
    line-height: 1.4;
    font-variant-numeric: tabular-nums;
}

.appbar-r {
    display: flex;
    align-items: center;
    gap: 8px;
}

.iconbtn {
    width: 34px;
    height: 34px;
    flex: none;
    display: grid;
    place-items: center;
    border-radius: 11px;
    border: 1px solid var(--line);
    background: rgba(13, 32, 58, 0.7);
    color: var(--tx2);
    transition: transform 0.16s var(--ease), border-color 0.16s;
}

.iconbtn:active {
    transform: scale(0.93);
    border-color: var(--line-2);
}

.chip-pending {
    display: inline-grid;
    place-items: center;
    min-width: 21px;
    height: 21px;
    padding: 0 6px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 600;
    color: #0a1526;
    background: var(--warn);
}

/* ============================ 页面 ============================ */

.page {
    flex: 1;
    padding: 14px 12px 32px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    animation: rise 0.34s var(--ease) both;
}

.page.has-tabbar {
    padding-bottom: calc(var(--tab-h) + var(--safe-b) + 26px);
}

@keyframes rise {
    from {
        opacity: 0;
        transform: translateY(8px);
    }
    to {
        opacity: 1;
        transform: none;
    }
}

/* ============================ 卡片 ============================ */

.card {
    position: relative;
    border-radius: var(--r-lg);
    border: 1px solid var(--line);
    background: linear-gradient(158deg, var(--panel) 0%, var(--panel-2) 100%);
    box-shadow: var(--shadow);
    overflow: hidden;
}

.card::before {
    content: "";
    position: absolute;
    inset: 0 0 auto;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(56, 189, 248, 0.42), transparent);
}

.card-hd {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 14px 15px 0;
}

.card-hd h2 {
    font-size: 13.5px;
    font-weight: 600;
    color: var(--tx);
    letter-spacing: 0.3px;
}

.card-hd .hint {
    margin-left: auto;
    font-size: 11.5px;
    color: var(--tx3);
}

.card-bd {
    padding: 12px 15px 15px;
}

.card-bd.tight {
    padding: 4px 0 6px;
}

.section-title {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px 4px 0;
    font-size: 12.5px;
    color: var(--tx3);
    letter-spacing: 0.6px;
}

.section-title::after {
    content: "";
    flex: 1;
    height: 1px;
    background: linear-gradient(90deg, var(--line-2), transparent);
}

/* ============================ 提示条 ============================ */

.banner {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 10px 12px 0;
    padding: 9px 12px;
    border-radius: 13px;
    font-size: 12.5px;
    line-height: 1.45;
}

.banner-warn {
    color: #ffe2a8;
    background: rgba(251, 191, 36, 0.11);
    border: 1px solid rgba(251, 191, 36, 0.28);
}

.banner-err {
    color: #ffc9c9;
    background: rgba(248, 113, 113, 0.11);
    border: 1px solid rgba(248, 113, 113, 0.3);
}

.toast {
    position: fixed;
    left: 50%;
    top: calc(var(--safe-t) + 12px);
    transform: translateX(-50%);
    z-index: 90;
    display: flex;
    align-items: center;
    gap: 8px;
    max-width: calc(100% - 28px);
    padding: 10px 15px;
    border-radius: 14px;
    font-size: 13px;
    line-height: 1.4;
    background: rgba(12, 30, 54, 0.96);
    border: 1px solid var(--line-2);
    box-shadow: 0 16px 40px -16px #000;
    backdrop-filter: blur(12px);
    animation: drop 0.32s var(--ease) both;
}

.toast-ok {
    border-color: rgba(34, 197, 94, 0.4);
    color: #c6f6d5;
}

.toast-ok .ic {
    color: var(--ok);
}

.toast-err {
    border-color: rgba(248, 113, 113, 0.42);
    color: #fecaca;
}

.toast-err .ic {
    color: var(--crit);
}

.toast-warn {
    border-color: rgba(251, 191, 36, 0.42);
    color: #fde9b8;
}

.toast-warn .ic {
    color: var(--warn);
}

.toast.is-hidden {
    opacity: 0;
    transform: translate(-50%, -12px);
    transition: opacity 0.28s, transform 0.28s;
}

@keyframes drop {
    from {
        opacity: 0;
        transform: translate(-50%, -14px);
    }
}

/* ============================ KPI ============================ */

.kpi-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.kpi {
    position: relative;
    padding: 13px 14px 12px;
    border-radius: var(--r-md);
    border: 1px solid var(--line);
    background: linear-gradient(160deg, rgba(20, 45, 78, 0.6), rgba(9, 22, 42, 0.72));
    overflow: hidden;
}

.kpi-k {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 11.5px;
    color: var(--tx3);
    letter-spacing: 0.4px;
}

.kpi-v {
    display: flex;
    align-items: baseline;
    gap: 3px;
    margin-top: 6px;
    font-size: 26px;
    font-weight: 650;
    line-height: 1.1;
    font-variant-numeric: tabular-nums;
}

.kpi-v small {
    font-size: 12px;
    font-weight: 500;
    color: var(--tx3);
}

.kpi-sub {
    margin-top: 3px;
    font-size: 11.5px;
    color: var(--tx3);
}

.kpi::after {
    content: "";
    position: absolute;
    right: -22px;
    top: -22px;
    width: 70px;
    height: 70px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(56, 189, 248, 0.16), transparent 70%);
}

.kpi-grid.three {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.kpi.compact {
    padding: 11px 12px;
}

.kpi.compact .kpi-v {
    font-size: 20px;
}

/* ============================ 状态色 ============================ */

.tone-ok {
    color: var(--ok);
}
.tone-info {
    color: var(--info);
}
.tone-warning {
    color: var(--warn);
}
.tone-serious {
    color: var(--ser);
}
.tone-critical {
    color: var(--crit);
}
.tone-muted {
    color: var(--tx3);
}

.pill {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2.5px 8px;
    border-radius: 999px;
    font-size: 11.5px;
    line-height: 1.5;
    font-weight: 500;
    white-space: nowrap;
    border: 1px solid transparent;
}

.pill-ok {
    color: #8ce9b0;
    background: rgba(34, 197, 94, 0.13);
    border-color: rgba(34, 197, 94, 0.3);
}

.pill-info {
    color: #a8cdfb;
    background: rgba(96, 165, 250, 0.13);
    border-color: rgba(96, 165, 250, 0.3);
}

.pill-warning {
    color: #fde28f;
    background: rgba(251, 191, 36, 0.13);
    border-color: rgba(251, 191, 36, 0.32);
}

.pill-serious {
    color: #fdc9a3;
    background: rgba(251, 146, 60, 0.14);
    border-color: rgba(251, 146, 60, 0.32);
}

.pill-critical {
    color: #fca5a5;
    background: rgba(248, 113, 113, 0.14);
    border-color: rgba(248, 113, 113, 0.34);
}

.pill-muted {
    color: var(--tx2);
    background: rgba(111, 141, 178, 0.14);
    border-color: rgba(111, 141, 178, 0.28);
}

.pill-dot::before {
    content: "";
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: currentColor;
    box-shadow: 0 0 8px currentColor;
}

/* ============================ 分段/筛选 ============================ */

.segment {
    display: flex;
    gap: 6px;
    padding: 4px;
    border-radius: 14px;
    border: 1px solid var(--line);
    background: rgba(8, 20, 38, 0.7);
    overflow-x: auto;
    scrollbar-width: none;
}

.segment::-webkit-scrollbar {
    display: none;
}

.segment a {
    flex: 1 0 auto;
    text-align: center;
    padding: 7px 12px;
    border-radius: 10px;
    font-size: 12.5px;
    color: var(--tx2);
    white-space: nowrap;
    border: 1px solid transparent;
    transition: all 0.18s var(--ease);
}

.segment a.is-on {
    color: #04121f;
    font-weight: 600;
    background: linear-gradient(140deg, var(--cy), var(--sky));
    box-shadow: 0 6px 18px -10px rgba(34, 211, 238, 0.9);
}

.segment a:active {
    transform: scale(0.97);
}

/* ============================ 搜索框 ============================ */

.searchbar {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 0 12px;
    height: 42px;
    border-radius: 14px;
    border: 1px solid var(--line);
    background: rgba(8, 22, 41, 0.78);
    color: var(--tx3);
}

.searchbar input {
    flex: 1;
    min-width: 0;
    border: 0;
    background: transparent;
    color: var(--tx);
    font: inherit;
    font-size: 14px;
    outline: none;
}

.searchbar input::placeholder {
    color: var(--tx3);
}

.searchbar button {
    border: 0;
    background: transparent;
    color: var(--sky);
    font-size: 12.5px;
    padding: 4px 2px;
}

/* ============================ 列表行 ============================ */

.rows {
    display: flex;
    flex-direction: column;
}

.row {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 13px 15px;
    position: relative;
    color: var(--tx);
    transition: background 0.16s;
}

.row + .row::before {
    content: "";
    position: absolute;
    left: 15px;
    right: 15px;
    top: 0;
    height: 1px;
    background: var(--line);
}

.row:active {
    background: rgba(56, 189, 248, 0.06);
}

.row-main {
    flex: 1;
    min-width: 0;
}

.row-t {
    display: flex;
    align-items: center;
    gap: 7px;
    font-size: 14.5px;
    font-weight: 550;
    line-height: 1.35;
}

.row-t span {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.row-s {
    margin-top: 3px;
    font-size: 12px;
    color: var(--tx3);
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.row-r {
    flex: none;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 5px;
}

.row-chev {
    color: var(--tx3);
    flex: none;
    opacity: 0.75;
}

.row-flag {
    width: 3px;
    align-self: stretch;
    border-radius: 3px;
    flex: none;
    margin: -2px 0;
    background: var(--tx3);
}

.row-flag.tone-critical {
    background: var(--crit);
    box-shadow: 0 0 10px rgba(248, 113, 113, 0.6);
}
.row-flag.tone-warning {
    background: var(--warn);
}
.row-flag.tone-serious {
    background: var(--ser);
}
.row-flag.tone-info {
    background: var(--info);
}
.row-flag.tone-ok {
    background: var(--ok);
}

.code {
    font-size: 11px;
    letter-spacing: 0.4px;
    color: var(--tx3);
    font-variant-numeric: tabular-nums;
}

/* 健康条 */
.hbar {
    width: 54px;
    height: 5px;
    border-radius: 99px;
    background: rgba(111, 141, 178, 0.2);
    overflow: hidden;
}

.hbar i {
    display: block;
    height: 100%;
    border-radius: 99px;
    background: currentColor;
    box-shadow: 0 0 8px currentColor;
}

/* ============================ 空状态 ============================ */

.empty {
    padding: 40px 24px;
    text-align: center;
    color: var(--tx3);
}

.empty .ic {
    margin: 0 auto 12px;
    color: var(--tx3);
    opacity: 0.6;
}

.empty p {
    font-size: 13px;
    line-height: 1.7;
}

.empty-mini {
    padding: 14px;
    text-align: center;
    font-size: 12px;
    color: var(--tx3);
}

/* ============================ 按钮 ============================ */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    height: 42px;
    padding: 0 18px;
    border-radius: 13px;
    border: 1px solid var(--line-2);
    background: rgba(20, 45, 78, 0.7);
    color: var(--tx);
    font-size: 14px;
    font-weight: 550;
    cursor: pointer;
    transition: transform 0.14s var(--ease), filter 0.16s;
}

.btn:active {
    transform: scale(0.97);
}

.btn-primary {
    background: linear-gradient(140deg, var(--cy), var(--sky));
    border-color: transparent;
    color: #04121f;
    font-weight: 650;
    box-shadow: 0 10px 26px -14px rgba(34, 211, 238, 0.95);
}

.btn-ghost {
    background: transparent;
    color: var(--tx2);
}

.btn-danger {
    border-color: rgba(248, 113, 113, 0.38);
    background: rgba(248, 113, 113, 0.12);
    color: #fca5a5;
}

.btn-block {
    width: 100%;
}

.btn-sm {
    height: 34px;
    padding: 0 13px;
    font-size: 12.5px;
    border-radius: 11px;
}

.btn-row {
    display: flex;
    gap: 8px;
}

.btn-row .btn {
    flex: 1;
}

/* 底部固定操作条 */
.actionbar {
    position: sticky;
    bottom: calc(var(--safe-b) + 8px);
    display: flex;
    gap: 8px;
    padding: 10px;
    border-radius: 18px;
    background: rgba(8, 19, 36, 0.9);
    border: 1px solid var(--line-2);
    backdrop-filter: blur(12px);
    box-shadow: 0 -8px 30px -10px rgba(0, 0, 0, 0.8);
    z-index: 30;
}

.actionbar .btn {
    flex: 1;
}

/* ============================ 表单 ============================ */

.field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.field > label {
    font-size: 12.5px;
    color: var(--tx2);
    padding-left: 2px;
}

.input,
.select,
.textarea {
    width: 100%;
    padding: 11px 13px;
    border-radius: 13px;
    border: 1px solid var(--line-2);
    background: rgba(6, 16, 32, 0.85);
    color: var(--tx);
    font: inherit;
    font-size: 14.5px;
    outline: none;
    transition: border-color 0.18s, box-shadow 0.18s;
    -webkit-appearance: none;
    appearance: none;
}

.input:focus,
.select:focus,
.textarea:focus {
    border-color: rgba(34, 211, 238, 0.6);
    box-shadow: 0 0 0 3px rgba(34, 211, 238, 0.12);
}

.input::placeholder,
.textarea::placeholder {
    color: var(--tx3);
}

.select {
    background-image: linear-gradient(45deg, transparent 50%, var(--tx3) 50%),
        linear-gradient(135deg, var(--tx3) 50%, transparent 50%);
    background-position: calc(100% - 18px) 19px, calc(100% - 13px) 19px;
    background-size: 5px 5px, 5px 5px;
    background-repeat: no-repeat;
    padding-right: 34px;
}

.textarea {
    min-height: 74px;
    resize: vertical;
    line-height: 1.55;
}

.field-row {
    display: flex;
    gap: 10px;
}

.field-row > * {
    flex: 1;
    min-width: 0;
}

/* ============================ 详情排版 ============================ */

.detail-hd {
    display: flex;
    gap: 14px;
    align-items: center;
}

.ring .ring-v {
    font-size: 21px;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

.ring .ring-l {
    font-size: 8.5px;
    fill: var(--tx3);
    letter-spacing: 1px;
}

.kv {
    display: flex;
    flex-direction: column;
    gap: 9px;
}

.kv-row {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    font-size: 13.5px;
}

.kv-k {
    flex: none;
    width: 84px;
    color: var(--tx3);
    font-size: 12.5px;
    padding-top: 1px;
}

.kv-v {
    flex: 1;
    min-width: 0;
    color: var(--tx);
    word-break: break-word;
}

.prose {
    font-size: 14px;
    line-height: 1.78;
    color: #d3e4f7;
}

.prose h3,
.prose h4,
.prose h5 {
    margin: 18px 0 8px;
    color: #eaf4ff;
    font-size: 15px;
}

.prose h3:first-child,
.prose h4:first-child {
    margin-top: 0;
}

.prose p {
    margin: 0 0 10px;
}

.prose ul,
.prose ol {
    margin: 0 0 12px;
    padding-left: 20px;
}

.prose li {
    margin: 4px 0;
}

.prose code {
    padding: 1.5px 5px;
    border-radius: 5px;
    background: rgba(56, 189, 248, 0.12);
    color: #9fe3f7;
    font-size: 12.5px;
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}

.prose strong {
    color: #fff;
}

/* 指标网格 */
.metric-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
}

.metric {
    padding: 10px 12px;
    border-radius: 12px;
    border: 1px solid var(--line);
    background: rgba(9, 22, 42, 0.6);
}

.metric-k {
    font-size: 11.5px;
    color: var(--tx3);
    display: flex;
    justify-content: space-between;
    gap: 6px;
}

.metric-v {
    margin-top: 4px;
    font-size: 15px;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}

.metric-th {
    margin-top: 2px;
    font-size: 10.5px;
    color: var(--tx3);
    font-variant-numeric: tabular-nums;
}

/* 条形分布 */
.bar-row {
    display: flex;
    align-items: center;
    gap: 9px;
    font-size: 12px;
    padding: 3.5px 0;
}

.bar-k {
    width: 42px;
    color: var(--tx3);
    flex: none;
}

.bar-track {
    flex: 1;
    height: 6px;
    border-radius: 99px;
    background: rgba(111, 141, 178, 0.16);
    overflow: hidden;
}

.bar-fill {
    display: block;
    height: 100%;
    border-radius: 99px;
    background: currentColor;
}

.bar-fill.tone-ok {
    background: var(--ok);
}
.bar-fill.tone-info {
    background: var(--info);
}
.bar-fill.tone-warning {
    background: var(--warn);
}
.bar-fill.tone-critical {
    background: var(--crit);
}
.bar-fill.tone-serious {
    background: var(--ser);
}

.bar-v {
    width: 22px;
    text-align: right;
    color: var(--tx2);
    font-variant-numeric: tabular-nums;
}

/* 趋势图 */
.trend {
    width: 100%;
    height: 78px;
    display: block;
}

.legend {
    display: flex;
    gap: 12px;
    margin-top: 8px;
    font-size: 11px;
    color: var(--tx3);
}

.legend i {
    width: 7px;
    height: 7px;
    border-radius: 2px;
    display: inline-block;
    margin-right: 4px;
    vertical-align: 1px;
}

/* 时间线 */
.timeline {
    position: relative;
    padding-left: 18px;
}

.timeline::before {
    content: "";
    position: absolute;
    left: 4px;
    top: 6px;
    bottom: 6px;
    width: 1px;
    background: linear-gradient(180deg, rgba(56, 189, 248, 0.5), rgba(56, 189, 248, 0.05));
}

.tl-item {
    position: relative;
    padding: 0 0 14px;
}

.tl-item::before {
    content: "";
    position: absolute;
    left: -18px;
    top: 6px;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--bg1);
    border: 1.5px solid var(--sky);
}

.tl-t {
    font-size: 13.5px;
    font-weight: 550;
}

.tl-m {
    font-size: 11.5px;
    color: var(--tx3);
    margin-top: 2px;
    font-variant-numeric: tabular-nums;
}

.tl-n {
    font-size: 12.5px;
    color: var(--tx2);
    margin-top: 4px;
    line-height: 1.6;
}

/* ============================ 聊天 ============================ */

.chat-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.bubble {
    max-width: 88%;
    padding: 11px 14px;
    border-radius: 16px;
    font-size: 14px;
    line-height: 1.7;
}

.bubble-user {
    align-self: flex-end;
    background: linear-gradient(140deg, rgba(34, 211, 238, 0.9), rgba(56, 189, 248, 0.85));
    color: #04121f;
    border-bottom-right-radius: 6px;
    font-weight: 500;
}

.bubble-ai {
    align-self: flex-start;
    background: rgba(16, 40, 70, 0.85);
    border: 1px solid var(--line);
    border-bottom-left-radius: 6px;
    color: #dcecff;
}

.bubble-ai .prose {
    font-size: 13.8px;
    color: #dcecff;
}

.cites {
    margin-top: 10px;
    padding-top: 9px;
    border-top: 1px dashed var(--line-2);
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.cite {
    display: flex;
    gap: 7px;
    font-size: 11.5px;
    color: var(--tx2);
    line-height: 1.5;
}

.cite::before {
    content: "";
    width: 5px;
    height: 5px;
    margin-top: 6px;
    border-radius: 50%;
    background: var(--cy);
    flex: none;
}

.chat-input {
    position: sticky;
    bottom: calc(var(--safe-b) + 8px);
    display: flex;
    gap: 8px;
    padding: 8px;
    border-radius: 18px;
    background: rgba(8, 19, 36, 0.94);
    border: 1px solid var(--line-2);
    backdrop-filter: blur(12px);
    z-index: 30;
    align-items: flex-end;
}

.chat-input .textarea {
    min-height: 42px;
    max-height: 120px;
    padding: 10px 12px;
    border-radius: 13px;
    background: rgba(4, 12, 24, 0.9);
}

.chat-input .btn {
    width: 42px;
    height: 42px;
    padding: 0;
    flex: none;
    border-radius: 13px;
}

/* ============================ 底部导航 ============================ */

.tabbar {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 50;
    padding-bottom: var(--safe-b);
    background: linear-gradient(180deg, rgba(6, 15, 30, 0.72) 0%, rgba(5, 12, 24, 0.97) 55%);
    backdrop-filter: blur(16px) saturate(1.25);
    -webkit-backdrop-filter: blur(16px) saturate(1.25);
    border-top: 1px solid var(--line);
}

.tabbar-in {
    max-width: 640px;
    margin: 0 auto;
    height: var(--tab-h);
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    align-items: center;
    padding: 0 4px;
}

.tab {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    padding: 6px 0 4px;
    color: var(--tx3);
    border-radius: 13px;
    transition: color 0.18s;
    position: relative;
}

.tab-ic {
    position: relative;
    display: grid;
    place-items: center;
    height: 24px;
}

.tab-lb {
    font-size: 10.5px;
    letter-spacing: 0.3px;
}

.tab.is-active {
    color: var(--cy);
}

.tab.is-active .tab-ic::after {
    content: "";
    position: absolute;
    bottom: -7px;
    width: 16px;
    height: 2px;
    border-radius: 2px;
    background: var(--cy);
    box-shadow: 0 0 10px 1px rgba(34, 211, 238, 0.8);
}

.tab-badge {
    position: absolute;
    top: -5px;
    right: -9px;
    min-width: 16px;
    height: 16px;
    padding: 0 4px;
    border-radius: 999px;
    background: var(--crit);
    color: #fff;
    font-size: 9.5px;
    font-style: normal;
    font-weight: 700;
    line-height: 16px;
    text-align: center;
    box-shadow: 0 0 0 2px rgba(5, 12, 24, 0.95);
}

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

.login {
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 32px 22px calc(32px + var(--safe-b));
    max-width: 460px;
    margin: 0 auto;
    gap: 22px;
}

.login-brand {
    text-align: center;
    margin-bottom: 4px;
}

.login-logo {
    width: 62px;
    height: 62px;
    margin: 0 auto 16px;
    border-radius: 20px;
    display: grid;
    place-items: center;
    background: linear-gradient(150deg, rgba(34, 211, 238, 0.26), rgba(56, 189, 248, 0.05));
    border: 1px solid rgba(56, 189, 248, 0.4);
    box-shadow: 0 0 40px -8px rgba(34, 211, 238, 0.45), inset 0 0 22px rgba(34, 211, 238, 0.1);
}

.login-logo .ic {
    color: var(--cy);
}

.login-brand h1 {
    font-size: 23px;
    letter-spacing: 1px;
}

.login-brand p {
    margin-top: 6px;
    font-size: 12.5px;
    color: var(--tx3);
    letter-spacing: 0.6px;
}

.login-form {
    display: flex;
    flex-direction: column;
    gap: 14px;
    padding: 20px 18px;
    border-radius: var(--r-lg);
    border: 1px solid var(--line);
    background: linear-gradient(160deg, rgba(18, 42, 74, 0.75), rgba(8, 19, 36, 0.85));
    box-shadow: var(--shadow);
}

.login-form .btn {
    margin-top: 4px;
    height: 46px;
}

.login-foot {
    text-align: center;
    font-size: 11.5px;
    color: var(--tx3);
    line-height: 1.9;
}

.demo-row {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.demo-chip {
    padding: 5px 10px;
    border-radius: 999px;
    border: 1px solid var(--line-2);
    background: rgba(56, 189, 248, 0.08);
    color: var(--tx2);
    font-size: 11.5px;
}

.demo-chip:active {
    background: rgba(56, 189, 248, 0.2);
}

/* ============================ 底部弹层 ============================ */

.sheet-mask {
    position: fixed;
    inset: 0;
    z-index: 100;
    background: rgba(2, 6, 14, 0.68);
    backdrop-filter: blur(3px);
    display: flex;
    align-items: flex-end;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.24s;
}

.sheet-mask.is-open {
    opacity: 1;
    pointer-events: auto;
}

.sheet {
    width: 100%;
    max-width: 640px;
    margin: 0 auto;
    padding: 8px 16px calc(16px + var(--safe-b));
    background: linear-gradient(180deg, #0d2140, #081628);
    border-radius: 24px 24px 0 0;
    border-top: 1px solid var(--line-2);
    transform: translateY(100%);
    transition: transform 0.3s var(--ease);
}

.sheet-mask.is-open .sheet {
    transform: none;
}

.sheet-grab {
    width: 38px;
    height: 4px;
    border-radius: 99px;
    background: rgba(111, 141, 178, 0.5);
    margin: 4px auto 14px;
}

.sheet h3 {
    font-size: 15px;
    margin-bottom: 4px;
}

.sheet p.sub {
    font-size: 12.5px;
    color: var(--tx3);
    margin-bottom: 14px;
}

/* ============================ 加载 ============================ */

.pull {
    position: fixed;
    top: calc(var(--safe-t) + 6px);
    left: 50%;
    transform: translate(-50%, -48px);
    z-index: 60;
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 7px 14px;
    border-radius: 999px;
    font-size: 12px;
    color: var(--tx2);
    background: rgba(10, 26, 48, 0.96);
    border: 1px solid var(--line-2);
    transition: transform 0.24s var(--ease), opacity 0.2s;
    opacity: 0;
    pointer-events: none;
}

.pull.is-visible {
    transform: translate(-50%, 0);
    opacity: 1;
}

.pull .spin {
    animation: spin 0.9s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* 分页 */
.pager {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 4px 2px 0;
    font-size: 12.5px;
    color: var(--tx3);
}

.pager a {
    padding: 7px 14px;
    border-radius: 11px;
    border: 1px solid var(--line-2);
    color: var(--tx2);
    font-size: 12.5px;
}

.pager .disabled {
    opacity: 0.35;
    pointer-events: none;
}

/* ============================ 杂项 ============================ */

.hr {
    height: 1px;
    background: var(--line);
    margin: 2px 0;
}

.grid-2 {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.stack {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.inline {
    display: flex;
    align-items: center;
    gap: 8px;
}

.spread {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.mt-2 {
    margin-top: 8px;
}

.mt-3 {
    margin-top: 12px;
}

.profile {
    display: flex;
    align-items: center;
    gap: 14px;
}

.avatar {
    width: 54px;
    height: 54px;
    flex: none;
    border-radius: 18px;
    display: grid;
    place-items: center;
    font-size: 19px;
    font-weight: 650;
    color: #04121f;
    background: linear-gradient(145deg, var(--cy), var(--sky));
    box-shadow: 0 10px 26px -14px rgba(34, 211, 238, 0.9);
}

.profile-meta h2 {
    font-size: 17px;
}

.profile-meta p {
    font-size: 12.5px;
    color: var(--tx3);
    margin-top: 3px;
}

@media (min-width: 560px) {
    .kpi-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
    .kpi-grid.three {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.001ms !important;
        transition-duration: 0.001ms !important;
    }
}
