/* 一站式入口页（/login）：iOS 桌面式 App 图标宫格 + 抽屉式表单
   PC 与移动端共用一套样式，靠 (min-width:900px) and (pointer:fine) 区分。
   pointer:fine 用来排除触摸设备：平板横屏、手机开「桌面版网站」都能越过
   900px 宽度阈值，但它们并不适合桌面布局与昂贵的合成效果。 */

:root {
    --bg: #05070e;
    --fg: #f8fafc;
    --sheet: rgba(255, 255, 255, 0.88);
    --field: rgba(255, 255, 255, 0.78);
    --field-focus: rgba(255, 255, 255, 0.96);
    --border: rgba(148, 163, 184, 0.32);
    --border-strong: rgba(37, 99, 235, 0.42);
    --brand: #e8192c;
    --brand-glow: rgba(232, 25, 44, 0.22);
    --text: #0f172a;
    --muted: #475569;
    --label: #f8fafc;
    --label-muted: #e2e8f0;
    --label-shadow: 0 1px 8px rgba(0, 0, 0, 0.55), 0 0 1px rgba(0, 0, 0, 0.8);
    --focus-ring: #93c5fd;
    --r-xl: 28px;
    --r-md: 16px;
    --r-sm: 12px;
    --touch: 44px;
    --ease: cubic-bezier(0.16, 1, 0.3, 1);
    /* 无过冲：移动端 spring 过冲会叠加成「果冻」感 */
    --spring: cubic-bezier(0.22, 1, 0.36, 1);
    /* 启动器尺度：先定图标，再定间距，最后反推整组宽度 */
    --hub-cols: 3;
    --hub-icon: clamp(72px, 21.5vw, 88px);
    --hub-gap-x: clamp(20px, 6.8vw, 34px);
    --hub-gap-y: clamp(22px, 6vw, 36px);
    --hub-brand-gap: 28px;
    --hub-to-dock: 28px;
    --hub-cluster: calc(var(--hub-cols) * var(--hub-icon) + (var(--hub-cols) - 1) * var(--hub-gap-x));
    --dock-icon: clamp(50px, 14vw, 60px);
}

*, *::before, *::after {
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

html {
    height: 100%;
    overscroll-behavior-y: none;
    color-scheme: dark;
}

body {
    margin: 0;
    min-height: 100vh;
    min-height: 100dvh;
    background: var(--bg);
    color: var(--label);
    font-family: 'Inter', system-ui, -apple-system, 'PingFang SC', 'Microsoft YaHei', sans-serif;
    -webkit-font-smoothing: antialiased;
    overscroll-behavior-y: none;
    overflow-x: hidden;
}

.skip-link {
    position: absolute;
    left: 12px;
    top: 12px;
    z-index: 300;
    padding: 10px 14px;
    border-radius: 10px;
    background: #1d4ed8;
    color: #fff;
    font-size: 0.9rem;
    font-weight: 600;
    text-decoration: none;
    transform: translateY(-160%);
    transition: transform 0.2s var(--ease);
}
.skip-link:focus,
.skip-link:focus-visible {
    transform: translateY(0);
    outline: 2px solid var(--focus-ring);
    outline-offset: 3px;
}

/* 抽屉打开时锁住背景滚动；iOS Safari 只认 position:fixed，
   滚动位置由脚本写进 inline top 后再还原 */
body.sheet-open {
    position: fixed;
    left: 0;
    right: 0;
    width: 100%;
    overflow: hidden;
}

/* ===== 壁纸：锤子官方夜空，轻压暗保可读，不做成糊成一团 ===== */
.bg {
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    overflow: hidden;
    transform: translateZ(0);
    background-color: #05070e;
}

.bg::before {
    content: '';
    position: absolute;
    inset: -6%;
    background: url('../img/hub/hub-bg-sm.jpg') center / cover no-repeat;
    filter: blur(4px) saturate(96%) brightness(0.82);
    transform: scale(1.08);
}

.bg::after {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(120% 70% at 50% 8%, rgba(5, 8, 18, 0.22), transparent 52%),
        linear-gradient(180deg, rgba(4, 7, 14, 0.42) 0%, rgba(4, 7, 14, 0.16) 38%, rgba(3, 5, 12, 0.58) 100%);
    pointer-events: none;
}

@media (min-width: 900px) and (pointer: fine) {
    .bg::before {
        background-image: url('../img/hub/hub-bg.jpg');
        filter: blur(5px) saturate(94%) brightness(0.80);
    }
}

@media (prefers-reduced-transparency: reduce) {
    .bg::before {
        filter: saturate(80%) brightness(0.62);
    }
    .bg::after {
        backdrop-filter: none;
        -webkit-backdrop-filter: none;
        background: rgba(6, 10, 18, 0.48);
    }
    .app-dock,
    .sheet-head-icon {
        backdrop-filter: none;
        -webkit-backdrop-filter: none;
    }
    .app-dock {
        background: rgba(20, 26, 36, 0.88);
    }
}

.page {
    position: relative;
    z-index: 1;
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
}

.page-footer-slot {
    padding-bottom: env(safe-area-inset-bottom, 0px);
}

.page-footer-slot .site-footer,
.page-footer-slot .site-footer--dark {
    color: #cbd5e1;
    padding-top: 0.4rem;
    padding-bottom: 0.45rem;
}

/* ===== 状态头：时钟靠左，品牌居中带英文名 ===== */
.os-head {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
    align-items: start;
    padding: calc(env(safe-area-inset-top, 0px) + 2.35rem) 1.15rem 0.25rem;
    animation: fadeDown 0.55s var(--ease) both;
}

.os-clock {
    justify-self: start;
    text-align: left;
    padding-top: 0.28rem;
}

.os-time {
    margin: 0;
    font-size: clamp(0.92rem, 3.6vw, 1.08rem);
    font-weight: 300;
    letter-spacing: -0.04em;
    line-height: 0.95;
    color: #fff;
    font-variant-numeric: tabular-nums;
    text-shadow: 0 2px 14px rgba(0, 0, 0, 0.45);
}

.os-date {
    margin: 0.12rem 0 0;
    font-size: 0.56rem;
    font-weight: 500;
    letter-spacing: 0.03em;
    color: #f1f5f9;
    text-shadow: var(--label-shadow);
}

.os-brand {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    width: max-content;
    max-width: min(22rem, calc(100vw - 6.4rem));
    gap: 0.28rem;
    margin-top: 0.2rem;
}

.brand-row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 0.85em;
    margin: 0;
    font-size: inherit;
    font-weight: inherit;
}

.brand-name {
    font-size: 1.52rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    line-height: 1.15;
    color: var(--fg);
    text-shadow: var(--label-shadow);
}

.brand-en {
    font-size: 1.2rem;
    font-weight: 600;
    letter-spacing: 0.1em;
    line-height: 1.15;
    color: #fff;
    text-shadow: var(--label-shadow);
}

.brand-tag {
    margin: 0;
    width: 100%;
    font-size: 0.96rem;
    color: var(--label-muted);
    letter-spacing: 0;
    font-weight: 400;
    line-height: 1.35;
    text-align: justify;
    text-align-last: justify;
    text-shadow: var(--label-shadow);
}

/* ===== 宫格外壳 ===== */
.hub {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    width: 100%;
    max-width: calc(var(--hub-cluster) + 2.4rem);
    margin: 0 auto;
    padding: var(--hub-brand-gap) 1.15rem 0.35rem;
}

/* ===== App 图标宫格：列宽 = 图标边长，间距按比例写死，不靠 1fr 摊缝 ===== */
.app-grid {
    display: grid;
    grid-template-columns: repeat(3, var(--hub-icon));
    justify-content: center;
    column-gap: var(--hub-gap-x);
    row-gap: var(--hub-gap-y);
    width: var(--hub-cluster);
    margin: 0 auto;
}

.app-icon {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    width: var(--hub-icon);
    min-width: 0;
    padding: 0;
    border: 0;
    background: none;
    color: var(--text);
    font-family: inherit;
    text-decoration: none;
    cursor: pointer;
    touch-action: manipulation;
    animation: appIn 0.5s var(--spring) both;
    animation-delay: calc(var(--i, 0) * 50ms + 0.12s);
}

.app-icon:focus { outline: none; }
.app-icon:focus-visible {
    outline: 3px solid var(--focus-ring);
    outline-offset: 4px;
    border-radius: 16px;
}

/* 热区比色块大，不靠拉列宽凑点按面积 */
.app-icon::before {
    content: '';
    position: absolute;
    inset: -8px -10px;
}

/* 统一圆角方砖：所有图标同一外框、同一落影，避免形体不一造成「大小不齐」 */
.app-glyph {
    position: relative;
    isolation: isolate;
    z-index: 1;
    width: var(--hub-icon);
    max-width: none;
    aspect-ratio: 1 / 1;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 22.5%;
    overflow: hidden;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.10), rgba(255, 255, 255, 0.03)),
        rgba(8, 12, 20, 0.22);
    border: 1px solid rgba(255, 255, 255, 0.16);
    box-shadow:
        0 12px 22px rgba(0, 0, 0, 0.32),
        inset 0 1px 0 rgba(255, 255, 255, 0.20);
    transition: transform 0.22s var(--spring), box-shadow 0.22s ease;
}

.app-glyph-art {
    position: relative;
    z-index: 1;
    width: 86%;
    height: 86%;
    object-fit: contain;
    pointer-events: none;
    filter: none;
}

.app-icon:active .app-glyph { transform: scale(0.92); }

.app-name {
    position: relative;
    z-index: 1;
    font-size: 0.8125rem;
    font-weight: 600;
    letter-spacing: 0.01em;
    line-height: 1.25;
    white-space: nowrap;
    color: var(--label);
    text-shadow: var(--label-shadow);
}

/* ===== 底部 dock：内部专用入口，与客户功能分开又不失可发现性 ===== */
.app-dock {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    align-items: start;
    gap: 0.4rem 0;
    width: var(--hub-cluster);
    box-sizing: border-box;
    margin: auto auto 0.2rem;
    padding: 0.75rem 0.55rem 0.65rem;
    border-radius: 28px;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.16), rgba(255, 255, 255, 0.05)),
        rgba(18, 22, 32, 0.28);
    border: 1px solid rgba(255, 255, 255, 0.20);
    box-shadow:
        0 14px 36px rgba(0, 0, 0, 0.28),
        inset 0 1px 0 rgba(255, 255, 255, 0.22);
    backdrop-filter: blur(22px) saturate(160%);
    -webkit-backdrop-filter: blur(22px) saturate(160%);
    animation: appIn 0.5s var(--spring) 0.52s both;
}

.app-icon--dock { gap: 5px; width: auto; }
.app-icon--dock .app-glyph {
    width: var(--dock-icon);
    font-size: calc(var(--dock-icon) * 0.38);
    border-radius: 22.5%;
}

.app-icon--pc-only { display: none; }

.os-pager {
    display: flex;
    justify-content: center;
    padding: 0.55rem 0 0.15rem;
}

.os-dot {
    width: 6px;
    height: 6px;
    border-radius: 99px;
    background: rgba(255, 255, 255, 0.28);
}

.os-dot.is-on {
    background: #fff;
    box-shadow: 0 0 8px rgba(255, 255, 255, 0.45);
}
.app-icon--dock .app-name {
    font-size: 0.75rem;
    color: var(--label-muted);
}
.app-icon--dock::before { inset: -6px -4px; }

/* ===== 跳转过渡：被点图标放大，其余淡出，像 App 启动 ===== */
.hub.is-leaving { pointer-events: none; }

.hub.is-leaving .app-icon,
.hub.is-leaving .app-dock {
    animation: none;
    opacity: 0;
    transform: scale(0.94);
    transition: opacity 0.26s var(--ease), transform 0.26s var(--ease);
}

/* 被点的是 dock 内图标时，dock 自身不能跟着淡出 */
.hub.is-leaving .app-dock:has(.is-launching) { opacity: 1; transform: none; }

.hub.is-leaving .app-icon.is-launching {
    opacity: 1;
    transform: scale(1.22);
    transition: transform 0.32s var(--ease), opacity 0.32s var(--ease);
}
.hub.is-leaving .app-icon.is-launching .app-glyph-art {
    filter: drop-shadow(0 18px 28px rgba(0, 0, 0, 0.5));
}

/* ===== 抽屉 ===== */
.sheet-host {
    position: fixed;
    inset: 0;
    z-index: 120;
    display: none;
}
.sheet-host.is-active { display: block; }

.sheet-scrim {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.52);
    opacity: 0;
    transition: opacity 0.3s var(--ease);
}
.sheet-host.is-shown .sheet-scrim { opacity: 1; }

.sheet-wrap {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    padding: 0;
    overflow: hidden;
}

.sheet {
    display: none;
    position: relative;
    width: 100%;
    max-width: 560px;
    max-height: 92dvh;
    flex-direction: column;
    color-scheme: light;
    color: var(--text);
    background: var(--sheet);
    border: 1px solid rgba(255, 255, 255, 0.7);
    border-bottom: 0;
    border-radius: var(--r-xl) var(--r-xl) 0 0;
    box-shadow: 0 -18px 50px rgba(15, 23, 42, 0.14), inset 0 1px 0 rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(22px) saturate(160%);
    -webkit-backdrop-filter: blur(22px) saturate(160%);
    transform: translateY(100%);
    transition: transform 0.36s var(--spring);
}
.sheet.is-current { display: flex; }
.sheet-host.is-shown .sheet.is-current { transform: translateY(0); }

/* 抽屉互切：外壳已展开，transition 不会重放，用一次性动画接住 */
.sheet.is-swapping { animation: sheetSwap 0.32s var(--ease) both; }
@keyframes sheetSwap {
    from { opacity: 0; transform: translateY(14px); }
    to { opacity: 1; transform: translateY(0); }
}

.sheet-handle {
    width: 40px;
    height: 4px;
    margin: 10px auto 0;
    border-radius: 99px;
    background: rgba(148, 163, 184, 0.45);
    flex-shrink: 0;
}

.sheet-head {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0.95rem 1.15rem 0.85rem;
    flex-shrink: 0;
}

/* 与宫格图标同色，点进来能对上是哪个功能 */
.sheet-head-icon {
    width: 40px;
    height: 40px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    font-size: 1.05rem;
    border-radius: 22%;
    color: #fff;
    background: rgba(15, 23, 42, 0.06);
    border: 0;
    box-shadow: none;
}
.sheet-head-icon .app-glyph-art {
    width: 86%;
    height: 86%;
}

.sheet-head-text { min-width: 0; flex: 1; }
.sheet-title { margin: 0; font-size: 1.05rem; font-weight: 700; letter-spacing: 0.01em; }
.sheet-sub { margin: 2px 0 0; font-size: 0.76rem; color: var(--muted); line-height: 1.4; }

.sheet-close {
    width: var(--touch);
    height: var(--touch);
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--border);
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.7);
    color: var(--muted);
    font-size: 0.95rem;
    cursor: pointer;
    touch-action: manipulation;
    transition: color 0.2s var(--ease), border-color 0.2s var(--ease), background 0.2s var(--ease);
}
.sheet-close:hover, .sheet-close:active { color: var(--text); border-color: var(--border-strong); }
.sheet-close:focus { outline: none; }
.sheet-close:focus-visible {
    outline: 3px solid var(--focus-ring);
    outline-offset: 2px;
}

.sheet-body {
    padding: 0 1.15rem calc(1.4rem + env(safe-area-inset-bottom, 0px));
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
}

/* ===== 输入框（浮动标签） ===== */
.input-group { position: relative; margin-bottom: 0.7rem; }

.input-icon {
    position: absolute;
    left: 17px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--muted);
    pointer-events: none;
    z-index: 2;
    font-size: 1rem;
    transition: color 0.25s ease;
}

.form-input {
    width: 100%;
    height: 52px;
    background: var(--field);
    border: 1.5px solid var(--border);
    border-radius: var(--r-md);
    padding: 20px 16px 6px 46px;
    color: var(--text);
    font-size: 16px; /* ≥16px 防 iOS 聚焦缩放 */
    font-family: inherit;
    outline: none;
    transition: border-color 0.25s ease, box-shadow 0.25s ease, background 0.25s ease;
}

.form-label {
    position: absolute;
    left: 46px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--muted);
    font-size: 0.95rem;
    pointer-events: none;
    transition: all 0.25s var(--ease);
}

.form-input:focus,
.form-input:not(:placeholder-shown) {
    background: var(--field-focus);
    border-color: var(--border-strong);
}
/* 红 glow 仅聚焦时显示，避免已填未聚焦框被误读为错误状态 */
.form-input:focus {
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.18);
}

.form-input:focus ~ .form-label,
.form-input:not(:placeholder-shown) ~ .form-label {
    top: 15px;
    font-size: 0.72rem;
    font-weight: 600;
    color: #334155;
}

.form-input:focus ~ .input-icon { color: #2563eb; }

.pw-toggle {
    position: absolute;
    right: 6px;
    top: 50%;
    transform: translateY(-50%);
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    color: var(--muted);
    cursor: pointer;
    font-size: 1.05rem;
    z-index: 5;
    transition: color 0.25s;
    touch-action: manipulation;
}
.pw-toggle:active, .pw-toggle:hover { color: var(--text); }
.pw-toggle:focus { outline: none; }
.pw-toggle:focus-visible { color: var(--text); outline: 2px solid var(--focus-ring); outline-offset: 1px; border-radius: 8px; }

/* ===== 查询方式切换（手机号 / 序列号） ===== */
.mode-switch {
    display: flex;
    gap: 8px;
    margin-bottom: 0.9rem;
}

.mode-btn {
    flex: 1;
    min-width: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    min-height: 44px;
    padding: 0 10px;
    border-radius: var(--r-sm);
    border: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.55);
    color: var(--muted);
    font-family: inherit;
    font-size: 0.88rem;
    font-weight: 600;
    cursor: pointer;
    transition: color 0.25s ease, border-color 0.25s ease, background 0.25s ease;
    touch-action: manipulation;
}
.mode-btn:focus { outline: none; }
.mode-btn:focus-visible {
    outline: 3px solid var(--focus-ring);
    outline-offset: 2px;
}

.mode-btn i { font-size: 0.85em; }

.mode-btn.active {
    color: #1e3a8a;
    background: rgba(37, 99, 235, 0.10);
    border-color: var(--border-strong);
}

.mode-pane { display: none; }
.mode-pane.active { display: block; }

.sn-input { text-transform: uppercase; letter-spacing: 0.06em; }

.field-tip {
    display: flex;
    align-items: flex-start;
    gap: 7px;
    margin: -0.2rem 0 0.9rem;
    padding: 0 2px;
    font-size: 0.76rem;
    line-height: 1.5;
    color: var(--muted);
}
.field-tip i { margin-top: 2px; opacity: 0.85; }

/* 分机号是低频选填项，默认收起，由 inline-toggle 展开 */
.inline-toggle {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    /* 上间距收紧，让它明显归属上方的手机号字段而非下方的密码框 */
    margin: -0.45rem 0 0.75rem;
    padding: 5px 2px;
    border: 0;
    background: transparent;
    font-family: inherit;
    font-size: 0.78rem;
    font-weight: 500;
    color: #64748b;
    cursor: pointer;
    touch-action: manipulation;
    transition: color 0.25s ease;
}
.inline-toggle i { font-size: 0.9em; opacity: 0.8; }
.ext-box { display: none; }
.ext-box.open { display: block; }

/* ===== 验证码 ===== */
.captcha-container {
    display: flex;
    gap: 10px;
    margin-bottom: 0.9rem;
}
.captcha-container .input-group { flex: 1; margin-bottom: 0; }
/* 验证码为数字+大写字母，不能限制成数字键盘 */
.captcha-input { text-transform: uppercase; letter-spacing: 0.14em; }
/* 图片按 3:1 生成（240x80 的 2 倍图），容器宽度由高度按同比例推出，
   这样 object-fit: contain 既不裁两侧字符也不留白。 */
.captcha-img-wrapper {
    --captcha-h: 52px;
    --captcha-pad: 3px;
    display: block;
    height: var(--captcha-h);
    width: calc((var(--captcha-h) - var(--captcha-pad) * 2 - 2px) * 3 + var(--captcha-pad) * 2 + 2px);
    flex-shrink: 0;
    background: rgba(255, 255, 255, 0.75);
    border: 1px solid var(--border);
    border-radius: var(--r-md);
    padding: var(--captcha-pad);
    font: inherit;
    cursor: pointer;
    transition: border-color 0.25s ease;
    touch-action: manipulation;
}
.captcha-img-wrapper:hover,
.captcha-img-wrapper:active { border-color: var(--border-strong); }
.captcha-img {
    display: block;
    width: 100%;
    height: 100%;
    border-radius: var(--r-sm);
    object-fit: contain;
}

/* ===== 提交按钮 ===== */
.btn-submit {
    width: 100%;
    min-height: 56px;
    margin-top: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    border: none;
    border-radius: var(--r-md);
    font-family: inherit;
    font-size: 1.05rem;
    font-weight: 700;
    color: #fff;
    background: linear-gradient(180deg, #3b82f6 0%, #1d4ed8 100%);
    box-shadow: 0 12px 24px rgba(37, 99, 235, 0.28), inset 0 1px 0 rgba(255, 255, 255, 0.28);
    cursor: pointer;
    transition: transform 0.2s var(--ease), box-shadow 0.25s ease, opacity 0.2s;
    touch-action: manipulation;
}
.btn-submit:hover { box-shadow: 0 14px 28px rgba(37, 99, 235, 0.32), inset 0 1px 0 rgba(255, 255, 255, 0.32); }
.btn-submit:active { transform: scale(0.98); box-shadow: 0 6px 16px rgba(37, 99, 235, 0.22); }
.btn-submit:focus { outline: none; }
.btn-submit:focus-visible {
    outline: 3px solid var(--focus-ring);
    outline-offset: 3px;
}
.btn-submit[data-busy] { cursor: wait; opacity: 0.9; }

/* 抽屉内的次级文字按钮：忘记密码 / 返回查询 */
.sheet-link-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    margin-top: 0.85rem;
    padding: 10px;
    min-height: var(--touch);
    width: 100%;
    border: 0;
    background: transparent;
    font-size: 0.8rem;
    font-weight: 500;
    font-family: inherit;
    color: #475569;
    letter-spacing: 0.02em;
    cursor: pointer;
    touch-action: manipulation;
    transition: color 0.25s ease;
}
.sheet-link-btn:hover { color: var(--text); }
.sheet-link-btn:focus { outline: none; }
.sheet-link-btn:focus-visible {
    outline: 3px solid var(--focus-ring);
    outline-offset: 2px;
    border-radius: 10px;
}
.sheet-link-btn i { font-size: 0.85em; opacity: 0.8; }

.wecom-panel {
    text-align: center;
    padding: 0.25rem 0 0.5rem;
}
.wecom-qr {
    width: min(256px, 72vw);
    margin: 0 auto 1rem;
    padding: 14px;
    border-radius: 20px;
    background: #fff;
    box-shadow: 0 14px 36px rgba(15, 23, 42, 0.1), inset 0 1px 0 rgba(255, 255, 255, 0.8);
}
.wecom-qr img {
    display: block;
    width: 100%;
    height: auto;
    aspect-ratio: 1;
    object-fit: contain;
    image-rendering: -webkit-optimize-contrast;
}
.wecom-lead {
    margin: 0 0 0.55rem;
    font-size: 0.95rem;
    font-weight: 650;
    color: #0f172a;
}
.wecom-open {
    display: none;
    margin-top: 0.15rem;
    background: linear-gradient(180deg, #4ade80 0%, #15803d 100%);
    box-shadow: 0 12px 24px rgba(21, 128, 61, 0.28), inset 0 1px 0 rgba(255, 255, 255, 0.28);
}
body.is-wechat .wecom-open,
body.can-wechat-jump .wecom-open { display: flex; }
.wecom-open:active { box-shadow: 0 6px 16px rgba(21, 128, 61, 0.22); }
.wecom-empty {
    padding: 1.5rem 0.75rem 0.75rem;
    color: var(--muted);
}
.wecom-empty i {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 3.4rem;
    height: 3.4rem;
    margin-bottom: 0.75rem;
    border-radius: 18px;
    background: linear-gradient(165deg, #4ade80, #15803d);
    color: #fff;
    font-size: 1.5rem;
}
.wecom-empty p { margin: 0; font-size: 0.88rem; line-height: 1.5; }

.reset-hint {
    margin: 0 0 1rem;
    font-size: 0.82rem;
    line-height: 1.45;
    color: var(--muted);
}

/* ===== Flash 消息 ===== */
.flash-msg {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 14px 16px;
    margin-bottom: 1.15rem;
    border-radius: var(--r-sm);
    font-size: 0.92rem;
    font-weight: 500;
    animation: fadeDown 0.4s var(--ease);
}
.flash-error { background: rgba(254, 226, 226, 0.88); border: 1px solid rgba(239, 68, 68, 0.38); color: #b91c1c; }
.flash-success { background: rgba(209, 250, 229, 0.88); border: 1px solid rgba(16, 185, 129, 0.38); color: #047857; }

/* 抽屉内的 flash 副本：只在对应抽屉被自动打开时由脚本注入 */
.sheet-body .flash-msg { margin-bottom: 1rem; }

/* ===== 客户查询：正在加载工单信息 ===== */
.loading-overlay {
    position: fixed;
    inset: 0;
    z-index: 200;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1.6rem;
    background: rgba(16, 38, 52, 0.72);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.35s var(--ease), visibility 0.35s;
}
.loading-overlay.show { opacity: 1; visibility: visible; }

.lo-spinner { position: relative; width: 92px; height: 92px; }
.lo-spinner .lo-ring {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    border: 3px solid transparent;
}
.lo-spinner .lo-ring-1 {
    border-top-color: var(--brand);
    border-right-color: var(--brand);
    animation: loSpin 1.1s linear infinite;
    box-shadow: 0 0 24px var(--brand-glow);
}
.lo-spinner .lo-ring-2 {
    inset: 16px;
    border-bottom-color: #e6e9ee;
    border-left-color: #e6e9ee;
    animation: loSpin 1.4s linear infinite reverse;
}
.lo-spinner .lo-core {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--brand);
    font-size: 1.9rem;
    animation: loPulse 1.6s ease-in-out infinite;
}
.lo-text { text-align: center; padding: 0 1.5rem; }
.lo-title { margin: 0 0 0.5rem; font-size: 1.2rem; font-weight: 700; letter-spacing: 0.05em; color: #fff; }
.lo-sub { font-size: 0.88rem; color: rgba(255, 255, 255, 0.72); letter-spacing: 0.06em; }
.lo-sub .lo-dots::after { content: ''; animation: loDots 1.4s steps(4, end) infinite; }
.lo-bar {
    width: min(280px, 70vw);
    height: 4px;
    border-radius: 99px;
    background: rgba(37, 99, 235, 0.10);
    overflow: hidden;
}
.lo-bar::before {
    content: '';
    display: block;
    height: 100%;
    width: 40%;
    border-radius: 99px;
    background: linear-gradient(90deg, var(--brand), #ff8a94);
    box-shadow: 0 0 14px var(--brand-glow);
    animation: loSlide 1.3s var(--ease) infinite;
}

/* ===== 动画 ===== */
@keyframes fadeDown { from { opacity: 0; transform: translateY(-12px); } to { opacity: 1; transform: translateY(0); } }
@keyframes appIn { from { opacity: 0; transform: translateY(10px) scale(0.8); } to { opacity: 1; transform: none; } }
@keyframes loSpin { to { transform: rotate(360deg); } }
@keyframes loPulse { 0%, 100% { transform: scale(1); opacity: 1; } 50% { transform: scale(1.15); opacity: 0.75; } }
@keyframes loDots { 0% { content: ''; } 25% { content: '.'; } 50% { content: '..'; } 75% { content: '...'; } }
@keyframes loSlide { 0% { transform: translateX(-120%); } 100% { transform: translateX(320%); } }

/* ===== 桌面端（≥900px 且鼠标设备）：4 列大图标 ===== */
@media (min-width: 900px) and (pointer: fine) {
    .os-head { padding: 1.7rem 2.2rem 0.2rem; }
    .os-time { font-size: 2.85rem; }
    .os-date { font-size: 1.05rem; }
    .os-brand { max-width: none; gap: 0.32rem; }
    .brand-name { font-size: 2.15rem; letter-spacing: 0.06em; }
    .brand-en { font-size: 1.62rem; letter-spacing: 0.12em; }
    .brand-tag { font-size: 1.18rem; }

    :root {
        --hub-cols: 4;
        --hub-icon: 140px;
        --hub-gap-x: 48px;
        --hub-gap-y: 36px;
        --hub-brand-gap: 1.15rem;
        --hub-to-dock: 36px;
        --dock-icon: 68px;
    }

    .hub {
        flex: 1 1 auto;
        max-width: 48rem;
        padding: var(--hub-brand-gap) 1.25rem 2rem;
        justify-content: center;
    }
    .app-grid {
        grid-template-columns: repeat(4, var(--hub-icon));
    }
    .app-icon--pc-hide { display: none; }
    .app-icon--pc-only { display: flex; }
    .app-dock {
        grid-template-columns: repeat(5, minmax(0, 1fr));
    }
    .app-name { font-size: 0.9rem; }
    .wecom-open,
    body.is-wechat .wecom-open,
    body.can-wechat-jump .wecom-open { display: none; }

    .app-icon { transition: transform 0.22s var(--spring); }
    .app-icon:hover .app-glyph {
        transform: translateY(-6px) scale(1.03);
        box-shadow:
            0 18px 28px rgba(0, 0, 0, 0.38),
            inset 0 1px 0 rgba(255, 255, 255, 0.24);
    }
    .app-icon:hover .app-name { color: #fff; }

    .app-dock {
        margin: var(--hub-to-dock) auto 0;
        gap: 0.5rem 0;
        padding: 0.9rem 0.65rem 0.8rem;
        border-radius: 30px;
        backdrop-filter: blur(22px) saturate(160%);
        -webkit-backdrop-filter: blur(22px) saturate(160%);
    }
    .app-icon--dock .app-name { font-size: 0.8125rem; }

    /* 桌面端抽屉走居中 modal */
    .sheet-wrap { align-items: center; padding: 2rem 1rem; }
    .sheet {
        max-height: min(calc(100vh - 4rem), 780px);
        border: 1px solid var(--border);
        border-radius: var(--r-xl);
        box-shadow: 0 28px 64px rgba(15, 23, 42, 0.16), inset 0 1px 0 rgba(255, 255, 255, 0.9);
        transform: translateY(18px) scale(0.97);
        opacity: 0;
        transition: transform 0.32s var(--spring), opacity 0.28s var(--ease);
        backdrop-filter: blur(20px) saturate(150%);
        -webkit-backdrop-filter: blur(20px) saturate(150%);
    }
    .sheet-host.is-shown .sheet.is-current { transform: translateY(0) scale(1); opacity: 1; }
    .sheet-handle { display: none; }
    .sheet-head { padding: 1.3rem 1.5rem 1rem; }
    .sheet-body { padding: 0 1.5rem 1.6rem; }

    .loading-overlay {
        background: rgba(16, 38, 52, 0.58);
        backdrop-filter: blur(18px) saturate(140%);
        -webkit-backdrop-filter: blur(18px) saturate(140%);
    }
}

@media (min-width: 1280px) and (pointer: fine) {
    :root {
        --hub-icon: 148px;
        --hub-gap-x: 52px;
        --hub-gap-y: 38px;
        --dock-icon: 72px;
    }
}

/* 矮屏：收紧品牌与 Dock 间距，尽量同屏放下 3x3 + Dock */
@media (max-height: 700px) {
    :root {
        --hub-brand-gap: 16px;
        --hub-gap-y: clamp(16px, 3.2vh, 24px);
    }
    .os-head { padding-top: calc(env(safe-area-inset-top, 0px) + 1.55rem); }
}

/* ===== 减少动态偏好 ===== */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    .hub.is-leaving .app-icon,
    .hub.is-leaving .app-dock { opacity: 1; transform: none; }
    .app-icon.is-launching { transform: none; }
    .bg-particles { display: none; }
    .app-glyph { transition: none; }
}
