/**
 * assets/css/app.css
 * 村级综合服务平台在线版主题
 * 复刻旧版单机版视觉：酒红 + 金色 / 纸色底 / 拟物立体卡片 / 3D 按钮
 * 色值基准：旧版 css/common.css :root（部分前景色按 WCAG AA 做了最小加深，
 * 调整记录见 docs/specs/2026-11-14-style-parity/style-mapping.md 第 8 节）
 */

:root {
    /* 旧版令牌（保留原名，便于对照） */
    --wine-900: #8E0000;
    --wine-800: #B71C1C;
    --wine-700: #D32F2F;
    --wine-600: #E53935;
    --gold-600: #8D6E00;
    --gold-500: #FFC107;
    --gold-300: #FFD54F;
    --gold-100: #FFF8E1;
    --paper: #F5F5F5;
    --ink-900: #222222;
    --ink-700: #333333;
    --ink-600: #555555;
    --ink-400: #6E6E6E;
    --line-soft: #EEEEEE;

    /* 在线版变量名（保持兼容，值映射到旧版） */
    --brand: #B71C1C;
    --brand-700: #8E0000;
    --brand-500: #D32F2F;
    --brand-100: #FBE9E7;
    --brand-050: #FFF8E1;
    --accent: #FFC107;
    --accent-strong: #FFB300;
    --accent-deep: #8D6E00;
    --accent-050: #FFF8E1;
    --on-accent: #3D2A00;
    --bg: #F5F5F5;
    --surface: #FFFFFF;
    --surface-2: #FAFAFA;
    --line: #DDDDDD;
    --line-strong: #CCCCCC;
    --text: #333333;
    --text-2: #555555;
    --muted: #6E6E6E;
    --success: #2E7D32;
    --warning: #8D6E00;
    --danger: #C62828;
    --info: #1565C0;
    --radius: 12px;
    --radius-sm: 6px;
    --radius-lg: 16px;
    --shadow-sm: 0 2px 5px rgba(0, 0, 0, 0.08);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.12);
    --shadow-lg: 0 10px 26px rgba(0, 0, 0, 0.2);
    --shadow-3d: 0 6px 0 rgba(0, 0, 0, 0.15), 0 10px 15px rgba(0, 0, 0, 0.25), inset 2px 2px 5px #FFFFFF, inset -2px -2px 5px rgba(0, 0, 0, 0.1);
    --font: "SimHei", "Microsoft YaHei", "PingFang SC", "Helvetica Neue", Arial, sans-serif;
}

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

html {
    min-height: 100%;
    background: var(--bg);
    -webkit-text-size-adjust: 100%;
}

body {
    min-height: 100vh;
    color: var(--text);
    font-family: var(--font);
    font-size: 14px;
    line-height: 1.6;
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

a {
    color: inherit;
    text-decoration: none;
}

img {
    max-width: 100%;
    display: block;
}

button,
input,
select,
textarea {
    font-family: inherit;
    font-size: inherit;
    color: inherit;
}

button {
    cursor: pointer;
}
button:disabled {
    cursor: not-allowed;
    opacity: 0.55;
}

ul,
ol {
    list-style: none;
}

::selection {
    background: var(--brand-100);
}

/* 全局隐藏滚动条（上下滑动仍然可用） */
* {
    scrollbar-width: none;
    -ms-overflow-style: none;
}

*::-webkit-scrollbar {
    width: 0;
    height: 0;
    display: none;
}

/* ==================== 品牌标识 ==================== */
.brand-logo {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    background: linear-gradient(135deg, #FFD54F, #FFC107 55%, #FFB300);
    border: 1px solid rgba(255, 255, 255, 0.45);
    border-radius: 9px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.28), inset 0 1px 2px rgba(255, 255, 255, 0.7);
}

/* 金底上改用深棕线稿，保证图形可辨识（白线在 #FFC107 上对比度仅约 1.6:1） */
.brand-logo svg path {
    stroke: #4A2C00;
}

.user-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: #FFFFFF;
    text-decoration: none;
}

.member-dot {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    width: 30px;
    height: 30px;
    color: #8E0000;
    font-size: 13px;
    font-weight: 700;
    background: linear-gradient(135deg, #FFD54F, #FFC107);
    border: 1px solid rgba(255, 255, 255, 0.5);
    border-radius: 50%;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}

.chip-text {
    display: flex;
    flex-direction: column;
    line-height: 1.2;
    text-align: left;
}

.chip-name {
    font-size: 12.5px;
    font-weight: 600;
    max-width: 96px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.chip-role {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.7);
}

.back-link {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    padding: 3px 10px;
    color: #FFF8E1;
    font-size: 13px;
    background: rgba(255, 255, 255, 0.14);
    border: 1px solid rgba(255, 213, 79, 0.55);
    border-radius: 6px;
}

.back-link:hover {
    background: rgba(255, 255, 255, 0.24);
    color: #FFFFFF;
}

/* ==================== 布局 ==================== */
.page-wrap {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px 20px 60px;
}

.page-wrap-narrow {
    max-width: 860px;
}

.page-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 18px;
    flex-wrap: wrap;
}

.page-title {
    font-size: 21px;
    font-weight: 700;
    color: var(--wine-800);
    letter-spacing: 0.5px;
}

.page-desc {
    margin-top: 4px;
    color: var(--muted);
    font-size: 13px;
}

.page-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.card {
    background: #FFFFFF;
    border: 1px solid #DDDDDD;
    border-radius: 16px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.08);
}

/* 旧版 .card-3d：更重的拟物立体卡（登录、授权、首页统计等强调场景） */
.card-3d {
    padding: 20px;
    background: linear-gradient(135deg, #FFFFFF, #F0F0F0);
    border: none;
    border-radius: 12px;
    box-shadow:
        0 5px 10px rgba(0, 0, 0, 0.22),
        inset 0 1px 0 rgba(255, 255, 255, 0.9);
    transition: transform 0.08s ease;
}

.card-3d:active {
    transform: translateY(4px);
    box-shadow:
        0 2px 5px rgba(0, 0, 0, 0.18),
        inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

.card-pad {
    padding: 18px 20px;
}

.section-title {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 24px 0 14px;
    font-size: 16px;
    font-weight: 700;
    color: var(--wine-800);
}

.section-title::before {
    content: "";
    width: 3px;
    height: 16px;
    background: linear-gradient(180deg, var(--gold-500), var(--wine-700));
    border-radius: 2px;
}

/* ==================== 按钮（旧版 .btn-3d 三套渐变） ==================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 9px 18px;
    color: #FFFFFF;
    font-size: 15px;
    font-weight: bold;
    line-height: 1.4;
    letter-spacing: 0.5px;
    white-space: nowrap;
    background: linear-gradient(to bottom, #E53935, #C62828);
    border: none;
    border-radius: 6px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3), inset 0 2px 4px rgba(255, 255, 255, 0.4);
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
    transition: transform 0.08s ease;
}

.btn:active {
    transform: translateY(2px);
    box-shadow: 0 2px 3px rgba(0, 0, 0, 0.3), inset 0 2px 4px rgba(0, 0, 0, 0.2);
}

.btn:disabled,
.btn[disabled] {
    cursor: not-allowed;
    opacity: 0.55;
    filter: grayscale(30%);
}

.btn:disabled:active,
.btn[disabled]:active {
    transform: none;
}

/* 旧版次按钮：金色渐变 + 深褐文字（与 .btn-3d.secondary 完全一致） */
.btn-secondary {
    color: #4A2F00;
    background: linear-gradient(to bottom, #E9C258, #C79A1B);
    text-shadow: 0 1px 0 rgba(255, 255, 255, 0.35);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3), inset 0 2px 4px rgba(255, 255, 255, 0.45);
}

.btn-accent {
    color: #3D2A00;
    background: linear-gradient(180deg, #FFC107, #FFB300);
    text-shadow: none;
}

.btn-accent:hover {
    color: #3D2A00;
}

/* 旧版默认按钮：白→灰（无边框） */
.btn-light {
    color: #333333;
    background: linear-gradient(to bottom, #FFFFFF, #E0E0E0);
    text-shadow: none;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.22), inset 0 2px 4px rgba(255, 255, 255, 0.8);
}

.btn-light:hover {
    color: #8E0000;
}

.btn-ghost {
    color: #FFFFFF;
    background: rgba(255, 255, 255, 0.16);
    border-color: rgba(255, 213, 79, 0.5);
    text-shadow: none;
    box-shadow: none;
}

.btn-ghost:hover {
    background: rgba(255, 255, 255, 0.26);
}

.btn-outline {
    color: var(--wine-800);
    background: transparent;
    border-color: var(--wine-700);
    text-shadow: none;
    box-shadow: none;
}

.btn-outline:hover {
    background: var(--gold-100);
}

.btn-danger {
    background: linear-gradient(180deg, #C62828, #8E0000);
}

.btn-danger:hover {
    background: linear-gradient(180deg, #C62828, #8E0000);
}

.btn-sm {
    padding: 6px 14px;
    font-size: 13px;
    border-radius: 6px;
    box-shadow: 0 3px 4px rgba(0, 0, 0, 0.25), inset 0 1px 3px rgba(255, 255, 255, 0.4);
}

.btn-sm:active {
    transform: translateY(1px);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.3), inset 0 2px 3px rgba(0, 0, 0, 0.2);
}

.btn-block {
    width: 100%;
}

/* 兼容旧类名 .btn-3d */
.btn-3d {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 9px 18px;
    color: #FFFFFF;
    font-size: 15px;
    font-weight: bold;
    line-height: 1.4;
    letter-spacing: 0.5px;
    background: linear-gradient(to bottom, #E53935, #C62828);
    border: none;
    border-radius: 6px;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3), inset 0 2px 4px rgba(255, 255, 255, 0.4);
    transition: transform 0.08s ease;
}

.btn-3d.secondary {
    color: #4A2F00;
    background: linear-gradient(to bottom, #E9C258, #C79A1B);
    text-shadow: 0 1px 0 rgba(255, 255, 255, 0.35);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3), inset 0 2px 4px rgba(255, 255, 255, 0.45);
}

.btn-3d.default {
    color: #333333;
    background: linear-gradient(to bottom, #FFFFFF, #E0E0E0);
    border: none;
    text-shadow: none;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.22), inset 0 2px 4px rgba(255, 255, 255, 0.8);
}

/* ==================== 表单 ==================== */
.field {
    margin-bottom: 14px;
}

.field label {
    display: block;
    margin-bottom: 6px;
    color: var(--text);
    font-size: 13.5px;
    font-weight: 600;
}

.field .hint {
    margin-top: 5px;
    color: var(--muted);
    font-size: 12.5px;
}

/* 通用辅助说明：与字段提示保持同一字号，避免同类文字在不同页面出现 12/14px 混用 */
.hint {
    color: var(--muted);
    font-size: 12.5px;
    line-height: 1.7;
}

.input,
.select,
.textarea {
    width: 100%;
    padding: 11px 13px;
    color: var(--text);
    font-size: 15px;
    background: var(--surface);
    border: 1px solid #CCCCCC;
    border-radius: 6px;
    outline: none;
    transition: border-color 0.16s ease, box-shadow 0.16s ease;
}

.input:focus,
.select:focus,
.textarea:focus {
    border-color: var(--wine-700);
    box-shadow: 0 0 0 3px rgba(211, 47, 47, 0.07);
}

.input::placeholder,
.textarea::placeholder {
    color: #9A9A9A;
}

.textarea {
    min-height: 92px;
    resize: vertical;
}

.input-inline {
    display: flex;
    gap: 8px;
}

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

.row > .field {
    flex: 1 1 200px;
    min-width: 0;
    margin-bottom: 0;
}

/* 开关（旧版 56×31） */
.switch {
    position: relative;
    display: inline-block;
    flex: 0 0 auto;
    width: 56px;
    height: 31px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.switch-track {
    position: absolute;
    inset: 0;
    background: #CCCCCC;
    border-radius: 999px;
    transition: background 0.2s ease;
    cursor: pointer;
}

.switch-track::before {
    content: "";
    position: absolute;
    width: 23px;
    height: 23px;
    left: 4px;
    top: 4px;
    background: #FFFFFF;
    border-radius: 50%;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
    transition: transform 0.2s ease;
}

.switch input:checked + .switch-track {
    background: var(--wine-700);
}

.switch input:checked + .switch-track::before {
    transform: translateX(25px);
}

/* ==================== 首页 ==================== */
/* 旧版背景：桌面用 bg-fixed.webp 铺满首屏；≤768px 用独立固定层 bgmobil-fixed.webp
   两张图以 WebP 无损重编码，像素与原 PNG 完全一致，体积约为原来的 40% */
body.home-page {
    height: 100vh;
    height: 100dvh;
    overflow: hidden;
    background-color: var(--paper);
}

@media (min-width: 769px) {
    body.home-page {
        background-color: #FFFFFF;
        background-image: none;
    }

    /* 与旧版一致：顶部红绸层（图片上 64%）+ 底部红绸层（图片最后部分），中间为纯白滚动区 */
    body.home-page::before {
        content: "";
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        height: 29vw;
        max-height: 64vh;
        z-index: 0;
        background: url("../images/bg-fixed.webp") left top / 100% auto no-repeat;
        pointer-events: none;
    }

    body.home-page::after {
        content: "";
        position: fixed;
        left: 0;
        right: 0;
        bottom: 0;
        height: 20.4vw;
        max-height: 34vh;
        z-index: 0;
        background: url("../images/bg-fixed.webp") left bottom / 100% auto no-repeat;
        pointer-events: none;
        -webkit-mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0) 0, #000000 15%);
        mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0) 0, #000000 15%);
    }
}

@media (max-width: 768px) {
    body.home-page {
        background-image: none;
    }

    body.home-page::before {
        content: "";
        position: fixed;
        inset: 0;
        z-index: 0;
        /* 与旧版一致：竖版图按宽度等比铺满，窗口变窄时只补底部纯色 */
        background: url("../images/bgmobil-fixed.webp") center top / 100% auto no-repeat;
        background-color: #D90404;
        pointer-events: none;
    }

    body.home-page .page-wrap {
        position: relative;
        z-index: 1;
    }
}

.home-page .page-wrap {
    position: relative;
    /* 压在固定背景的顶部/底部红绸之上，避免底部红绸层盖住最后一行卡片 */
    z-index: 1;
    display: flex;
    flex-direction: column;
    height: 100%;
    min-height: 0;
    max-width: none;
    padding: 0 12vw 0;
}

.home-hero {
    position: relative;
    /* 与离线 .top-header 一致：顶部 5vh，标题区下方不留白（卡片区自己留 6vh） */
    padding: 5vh 0 0;
    margin-bottom: 0;
    color: #FFFFFF;
    background: transparent;
    border-radius: 0;
    overflow: visible;
}

.home-hero::after {
    content: none;
}

.home-hero-inner {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 18px;
    flex-wrap: wrap;
    max-width: 1400px;
    margin: 0 auto;
}

.home-title {
    margin: 0;
    padding-bottom: 10px;
    font-family: "PangMenZhengDao", "YouYuan", "STZhongsong", "SimHei", sans-serif;
    /* 旧内核不支持 clamp 时回退 64px，再由 clamp 覆盖（与离线一致） */
    font-size: 64px;
    font-size: clamp(22px, 4vw, 96px);
    font-weight: 900;
    letter-spacing: 6px;
    letter-spacing: clamp(2px, 0.52vw, 10px);
    line-height: 1;
    color: #D50000;
    overflow-wrap: anywhere;
    text-shadow:
        -2px -2px 0 #FFD54F,
        2px -2px 0 #FFD54F,
        -2px 2px 0 #FFD54F,
        2px 2px 0 #FFD54F,
        -3px 0 0 #FFD54F,
        3px 0 0 #FFD54F,
        0 -3px 0 #FFD54F,
        0 3px 0 #FFD54F,
        0 8px 0 #8E0000,
        0 10px 10px rgba(0, 0, 0, 0.6);
}

.home-subtitle {
    margin: 10px 0 0 0.5vw;
    color: #FFD54F;
    font-family: "STZhongsong", "SimHei", sans-serif;
    font-size: clamp(13px, 2vw, 44px);
    font-weight: bold;
    line-height: 1.25;
    letter-spacing: clamp(1px, 0.8vw, 15px);
    overflow-wrap: anywhere;
    text-shadow:
        -1px -1px 0 #D50000,
        1px -1px 0 #D50000,
        -1px 1px 0 #D50000,
        1px 1px 0 #D50000,
        0 4px 0 #B71C1C,
        0 6px 8px rgba(0, 0, 0, 0.6);
}

.stat-row {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 1.5vw;
    margin-bottom: 20px;
}

.stat-card {
    padding: 14px 16px;
    background: linear-gradient(135deg, #FFFFFF, #F2F2F2);
    border: none;
    border-radius: var(--radius);
    box-shadow: 0 4px 0 rgba(0, 0, 0, 0.12), 0 8px 14px rgba(0, 0, 0, 0.16), inset 1px 1px 0 #FFFFFF;
}

.stat-label {
    color: var(--muted);
    font-size: 12px;
}

.stat-value {
    margin-top: 2px;
    color: var(--wine-800);
    font-size: 24px;
    font-weight: 800;
    line-height: 1.3;
    text-shadow: 0 1px 0 #FFFFFF;
}

.stat-sub {
    color: var(--muted);
    font-size: 11.5px;
}

.home-grid {
    display: grid;
    grid-template-columns: repeat(var(--cards-per-row, 5), minmax(0, 1fr));
    gap: 1.5vw;
    row-gap: 3vh;
}

.home-grid-full {
    grid-column: 1 / -1;
}

.home-search,
.home-todo {
    padding: 12px 14px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface);
    box-shadow: var(--shadow-sm, 0 2px 6px rgba(0, 0, 0, 0.05));
}

.home-search-bar {
    display: flex;
    gap: 8px;
    align-items: center;
}

.home-search-bar .input { flex: 1; }

.home-search-result {
    margin-top: 10px;
    max-height: 320px;
    overflow-y: auto;
}

.home-search-total {
    margin-bottom: 8px;
    color: var(--muted);
    font-size: 12px;
}

.home-search-group { margin-bottom: 10px; }

.home-search-group-title {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 6px;
    color: var(--ink-700);
    font-size: 12.5px;
    font-weight: 600;
}

.home-search-group-title span {
    padding: 0 6px;
    border-radius: 999px;
    background: var(--brand-100);
    color: var(--brand);
    font-size: 11px;
    font-weight: 400;
}

.home-search-item {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 7px 9px;
    border-radius: 8px;
    color: var(--ink-700);
    text-decoration: none;
}

.home-search-item:hover { background: #FAF8F3; }

.home-search-item-title { font-size: 13px; }
.home-search-item-sub { color: var(--muted); font-size: 11.5px; }

.home-search-loading,
.home-search-empty {
    padding: 8px 0;
    color: var(--muted);
    font-size: 12.5px;
}

.home-todo-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 8px;
}

.home-todo-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
    max-height: 240px;
    overflow-y: auto;
}

.home-todo-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    border-radius: 8px;
    background: #FAF8F3;
    color: var(--ink-700);
    text-decoration: none;
}

.home-todo-item:hover { background: #F4EFE6; }

.home-todo-kind {
    flex: 0 0 auto;
    padding: 1px 8px;
    border-radius: 999px;
    background: var(--brand-100);
    color: var(--brand);
    font-size: 11px;
    white-space: nowrap;
}

.home-todo-main {
    display: flex;
    flex: 1;
    flex-direction: column;
    min-width: 0;
    gap: 1px;
}

.home-todo-title {
    overflow: hidden;
    font-size: 13px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.home-todo-sub {
    overflow: hidden;
    color: var(--muted);
    font-size: 11.5px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.home-todo-due {
    flex: 0 0 auto;
    color: var(--muted);
    font-size: 11.5px;
}

.home-todo-due.is-overdue { color: var(--danger); font-weight: 600; }

.home-todo-empty {
    padding: 8px 0;
    color: var(--muted);
    font-size: 12.5px;
}

/* 首页：标题固定，仅卡片区域上下滚动；卡片在顶部/底部边缘渐隐
   顶部曲线与离线 .container 完全一致（5vh → 11vh），底部镜像同样的曲线；
   滚动到底时由 app.js 加 .is-end 取消底部渐隐，保证最后一行完整显示 */
.home-page .home-hero {
    flex: 0 0 auto;
}

.home-page .home-grid {
    flex: 1 1 auto;
    min-height: 0;
    margin: 0 -6px;
    /* 离线 .container：上 6vh、左右 12vw、下 calc(40px + 11vw) */
    padding: 6vh 6px calc(40px + 11vw);
    overflow-y: auto;
    overscroll-behavior: contain;
    align-content: start;
    -webkit-mask-image: linear-gradient(to bottom,
        rgba(0, 0, 0, 0) 0,
        rgba(0, 0, 0, 0.55) 5vh,
        #000000 11vh,
        #000000 calc(100% - 11vh),
        rgba(0, 0, 0, 0.55) calc(100% - 5vh),
        rgba(0, 0, 0, 0) 100%);
    mask-image: linear-gradient(to bottom,
        rgba(0, 0, 0, 0) 0,
        rgba(0, 0, 0, 0.55) 5vh,
        #000000 11vh,
        #000000 calc(100% - 11vh),
        rgba(0, 0, 0, 0.55) calc(100% - 5vh),
        rgba(0, 0, 0, 0) 100%);
}

/* 滚到底：只保留顶部渐隐（与离线一致） */
.home-page .home-grid.is-end {
    -webkit-mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0) 0, rgba(0, 0, 0, 0.55) 5vh, #000000 11vh);
    mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0) 0, rgba(0, 0, 0, 0.55) 5vh, #000000 11vh);
}

/* 无卡片时的空态同样保持在标题下方 */
.home-page .page-wrap > .card.empty {
    margin-top: 3vh;
}

/* 旧版首页导航卡：整卡着色 + 白字 + 3D 硬阴影 */
.nav-card {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    overflow: hidden;
    justify-content: center;
    gap: 10px;
    min-height: clamp(118px, 18vh, 190px);
    padding: 16px 10px;
    color: #FFFFFF;
    text-align: center;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.18), rgba(0, 0, 0, 0.08)), var(--card-accent, var(--wine-700));
    border: none;
    border-radius: clamp(10px, 0.8vw, 12px);
    box-shadow: 0 6px 0 rgba(0, 0, 0, 0.18), 0 10px 15px rgba(0, 0, 0, 0.28);
    transition: transform 0.12s ease, box-shadow 0.12s ease;
}

/* 旧版没有顶部色条，整卡已是项目色 */
.nav-card::before {
    content: none;
}

.nav-card:hover {
    transform: scale(1.04);
    box-shadow: 0 8px 0 rgba(0, 0, 0, 0.18), 0 14px 20px rgba(0, 0, 0, 0.3);
}

.nav-card:active {
    transform: scale(0.98) translateY(3px);
    box-shadow: 0 2px 0 rgba(0, 0, 0, 0.18), 0 4px 8px rgba(0, 0, 0, 0.24);
}

.nav-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    color: #FFFFFF;
    font-size: clamp(30px, 3.2vw, 46px);
    line-height: 1;
    background: transparent;
    border-radius: 0;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.4));
}

.nav-title {
    max-width: 100%;
    color: #FFFFFF;
    font-size: clamp(14px, 1.15vw, 17px);
    font-weight: 700;
    line-height: 1.35;
    text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.45);
    overflow-wrap: anywhere;
}

.nav-card.is-locked {
    opacity: 0.55;
    filter: grayscale(40%);
}

.nav-card.is-locked .nav-icon {
    background: transparent;
}

/* ==================== 全局键盘焦点 ==================== */
a:focus-visible,
button:focus-visible,
.btn:focus-visible,
.input:focus-visible,
.select:focus-visible,
textarea:focus-visible,
[tabindex]:focus-visible {
    outline: 2px solid var(--accent-deep);
    outline-offset: 2px;
}

/* 系统入口 */
.system-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 10px;
}

.system-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    background: linear-gradient(135deg, #FFFFFF, #F3F3F3);
    border: 1px solid #E5E5E5;
    border-radius: 10px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.08);
    transition: border-color 0.16s ease, background 0.16s ease, box-shadow 0.16s ease;
}

.system-link:hover {
    background: var(--gold-100);
    border-color: var(--gold-500);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.12);
}

.system-link .dot {
    width: 8px;
    height: 8px;
    background: var(--wine-700);
    border-radius: 50%;
    box-shadow: 0 0 0 3px rgba(255, 193, 7, 0.35);
}

.system-link .label {
    color: var(--wine-800);
    font-size: 13.5px;
    font-weight: 700;
}

.system-link .desc {
    color: var(--muted);
    font-size: 11.5px;
}

@media (max-width: 768px) {
    /* 单机版手机首页：左右 12px，标题固定，仅卡片滚动 */
    .home-page .page-wrap {
        padding: 0 12px;
    }

    .home-page .home-grid {
        padding-bottom: 28px;
    }

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

/* ==================== 表格 ==================== */
/* 旧版 .table-container：16px 大圆角 + 纸色描边 + 轻投影 */
.table-wrap {
    width: 100%;
    overflow-x: auto;
    background: var(--surface);
    border: 1px solid #E0E0E0;
    border-radius: 16px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.08), inset 1px 1px 0 #FFFFFF;
    -webkit-overflow-scrolling: touch;
}

table.data-table {
    width: 100%;
    border-collapse: collapse;
    background: transparent;
    font-size: 14px;
}

table.data-table th,
table.data-table td {
    padding: 14px 18px;
    text-align: left;
    border-bottom: 1px solid #EEEEEE;
    white-space: nowrap;
}

/* 表头：浅纸灰底 + 小字号加重 + 字距（旧版 .data-table th） */
table.data-table th {
    color: var(--ink-600);
    font-size: 12.5px;
    font-weight: 700;
    letter-spacing: 1px;
    background: #FAFAFA;
    border-bottom: 1px solid #DDDDDD;
}

/* 与旧版一致：无斑马纹，悬停金底 */
table.data-table tbody tr {
    transition: background 0.16s ease;
}

table.data-table tbody tr:hover {
    background: #FFF8E1;
}

table.data-table tr:last-child td {
    border-bottom: none;
}

table.data-table td.wrap {
    white-space: normal;
    word-break: break-all;
}

/* ==================== 分页（旧版 AppPager：居中三段式） ==================== */
.pager {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    flex-wrap: wrap;
    margin: 18px 0 4px;
}

.pager-info {
    color: var(--muted);
    font-size: 14px;
    letter-spacing: 0.5px;
    text-align: center;
}

/* 旧版 AppPager 按钮：6px 16px / 14px */
.pager .btn-sm {
    padding: 6px 16px;
    font-size: 14px;
}

/* 当前页（编号式分页时使用） */
.pager-current {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 30px;
    height: 30px;
    padding: 0 9px;
    color: #FFFFFF;
    font-size: 13px;
    font-weight: 700;
    background: linear-gradient(180deg, var(--wine-700), var(--wine-800));
    border-radius: var(--radius-sm);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.25);
}

.empty {
    padding: 38px 16px;
    color: var(--muted);
    font-size: 13.5px;
    text-align: center;
}

/* 空态/错误态里的重新加载按钮 */
.empty-retry {
    display: inline-flex;
    margin-top: 10px;
}

/* ==================== 弹窗 ==================== */
/* 旧版遮罩：55% 黑 + 3px 背景模糊 */
.modal-mask {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: rgba(0, 0, 0, 0.55);
    -webkit-backdrop-filter: blur(3px);
    backdrop-filter: blur(3px);
}

.modal-box {
    width: 100%;
    max-width: 520px;
    max-height: calc(100vh - 48px);
    display: flex;
    flex-direction: column;
    background: var(--surface);
    border: 1px solid #E0E0E0;
    border-top: 5px solid var(--gold-500);
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3), 0 4px 10px rgba(0, 0, 0, 0.18);
    overflow: hidden;
}

.modal-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 16px 22px;
    background: var(--surface);
    border-bottom: 1px solid #EEEEEE;
}

.modal-title {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
    color: var(--wine-800);
    font-size: 18px;
    font-weight: 700;
    letter-spacing: 0.5px;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.modal-title::before {
    content: "";
    flex: 0 0 auto;
    width: 3px;
    height: 16px;
    background: linear-gradient(180deg, var(--gold-500), var(--wine-700));
    border-radius: 2px;
}

.modal-close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    width: 30px;
    height: 30px;
    color: var(--muted);
    font-size: 18px;
    background: transparent;
    border: none;
    border-radius: 50%;
}

.modal-close:hover {
    color: var(--wine-800);
    background: #FFEBEE;
}

.modal-body {
    padding: 20px 22px;
    overflow-y: auto;
}

.modal-foot {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 14px 22px calc(14px + env(safe-area-inset-bottom));
    background: #FAFAFA;
    border-top: 1px solid #EEEEEE;
}

/* 兼容旧弹窗 id 结构（ui.js 动态创建） */
#custom-dialog-overlay {
    position: fixed;
    inset: 0;
    z-index: 1200;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: rgba(0, 0, 0, 0.55);
    -webkit-backdrop-filter: blur(3px);
    backdrop-filter: blur(3px);
}

#custom-dialog-overlay.show {
    display: flex;
}

#custom-dialog-box {
    width: 100%;
    max-width: 420px;
    background: var(--surface);
    border: 1px solid #E0E0E0;
    border-top: 5px solid var(--gold-500);
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3), 0 4px 10px rgba(0, 0, 0, 0.18);
    overflow: hidden;
}

#custom-dialog-header {
    padding: 16px 20px 8px;
    color: var(--wine-800);
    font-size: 18px;
    font-weight: 700;
    letter-spacing: 0.5px;
}

#custom-dialog-content {
    padding: 8px 20px 16px;
    color: var(--text-2);
    font-size: 13.5px;
    line-height: 1.7;
    word-break: break-word;
}

#custom-dialog-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 12px 20px 16px;
    background: #FAFAFA;
    border-top: 1px solid #EEEEEE;
}

/* ==================== Toast ==================== */
.toast-wrap {
    position: fixed;
    top: 18px;
    left: 50%;
    z-index: 1500;
    display: flex;
    flex-direction: column;
    gap: 8px;
    transform: translateX(-50%);
    pointer-events: none;
}

.toast {
    max-width: min(92vw, 460px);
    padding: 10px 16px;
    color: var(--text);
    font-size: 13.5px;
    background: var(--surface);
    border: 1px solid #E0E0E0;
    border-left: 4px solid var(--gold-500);
    border-radius: 12px;
    box-shadow: 0 8px 22px rgba(0, 0, 0, 0.18);
    animation: toast-in 0.2s ease;
}

.toast.ok { border-left-color: #2E7D32; }
.toast.err { border-left-color: #C62828; }
.toast.warn { border-left-color: #8D6E00; }

@keyframes toast-in {
    from { opacity: 0; transform: translateY(-6px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ==================== 标签 / 徽标 ==================== */
/* 底色统一走旧版金系：默认金胶囊、成功绿、警示深金、失败红、强调金渐变 */
.tag {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 9px;
    color: var(--gold-600);
    font-size: 11.5px;
    font-weight: 600;
    line-height: 1.6;
    background: var(--gold-100);
    border: 1px solid #FFE082;
    border-radius: 999px;
}

.tag.ok { color: #2E7D32; background: #E7F4ED; border-color: #B7DFC6; }
.tag.warn { color: #8C6316; background: #FBF2DF; border-color: #EED9AE; }
.tag.err { color: #C62828; background: #FFEBEE; border-color: #FFCDD2; }
.tag.accent { color: #3D2A00; background: linear-gradient(180deg, #FFD54F, #FFC107); border-color: #FFB300; }

/* 与户主关系 / 关联记录等强调标签 */
.tag.rel-title { color: var(--wine-800); background: #FBE9E7; border-color: #FFCDD2; }

/* 计数气泡：看板列头、相册张数等（旧版 .column-header .badge） */
.count-bubble {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 22px;
    padding: 2px 8px;
    color: #FFFFFF;
    font-size: 11px;
    font-weight: 700;
    line-height: 1.5;
    background: linear-gradient(180deg, var(--wine-700), var(--wine-800));
    border-radius: 999px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
}

/* ==================== 上传进度 ==================== */
.upload-panel {
    position: fixed;
    left: 50%;
    bottom: 28px;
    z-index: 900;
    width: 360px;
    max-width: calc(100vw - 32px);
    padding: 14px 16px;
    background: linear-gradient(135deg, #FFFFFF, #FAFAFA);
    border: 1px solid #E0E0E0;
    border-top: 4px solid var(--gold-500);
    border-radius: 12px;
    box-shadow: 0 10px 26px rgba(0, 0, 0, 0.22);
    transform: translateX(-50%);
}

.upload-panel-title {
    color: var(--wine-800);
    font-size: 13px;
    font-weight: 700;
}

.upload-progress {
    height: 10px;
    margin: 10px 0 8px;
    overflow: hidden;
    border-radius: 999px;
    background: #F0E6CC;
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.12);
}

.upload-progress-fill {
    width: 0;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, #FFC107, #FFB300);
    box-shadow: inset 0 1px 2px rgba(255, 255, 255, 0.5);
    transition: width .2s ease;
}

.upload-progress-text {
    color: var(--muted);
    font-size: 12px;
}

@media (max-width: 768px) {
    .upload-panel { bottom: calc(16px + env(safe-area-inset-bottom)); }
}

/* ==================== 行内加载态 ==================== */
.loading-inline {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--muted);
    font-size: 13px;
}

.loading-inline::before {
    content: "";
    width: 14px;
    height: 14px;
    border: 2px solid var(--line-strong);
    border-top-color: var(--accent-deep);
    border-radius: 50%;
    animation: v-spin .8s linear infinite;
}

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

/* ==================== 校验提醒 ==================== */
.warn-box {
    padding: 10px 12px;
    margin-bottom: 12px;
    background: #FFF8E1;
    border: 1px solid #FFE082;
    border-left: 4px solid var(--gold-500);
    border-radius: 6px;
}

.warn-box-title {
    margin-bottom: 6px;
    color: #8C6316;
    font-weight: 700;
}

.warn-item {
    font-size: 13px;
    line-height: 1.6;
    word-break: break-word;
}

.warn-item + .warn-item {
    margin-top: 4px;
}

.btn-warnings {
    color: #8C6316;
    background: #FFF8E1;
    border: 1px solid #FFE082;
}

.btn-warnings:hover {
    background: #FFF3CD;
}

/* ==================== 权限中心 ==================== */
/* 对齐离线 .category-tabs：透明容器 + 独立胶囊标签 */
.tabs {
    display: flex;
    gap: 8px;
    padding: 2px;
    margin-bottom: 16px;
    background: transparent;
    border: none;
    border-radius: 0;
    overflow-x: auto;
    scrollbar-width: none;
}

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

.tab-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    flex: 0 0 auto;
    padding: 8px 18px;
    color: #555555;
    font-size: 13.5px;
    font-weight: 400;
    background: #FFFFFF;
    border: 1px solid #DDDDDD;
    border-radius: 999px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.08);
    white-space: nowrap;
    transition: color 0.2s ease, border-color 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
}

.tab-btn:hover {
    color: var(--wine-800);
    border-color: var(--gold-300);
    background: #FFF8E1;
}

.tab-btn.active {
    color: #FFFFFF;
    background: linear-gradient(135deg, #B71C1C 0%, #E53935 100%);
    border-color: transparent;
    box-shadow: 0 6px 16px rgba(211, 47, 47, 0.2);
}

.tab-panel {
    display: none;
}

.tab-panel.active {
    display: block;
}

.perm-group {
    margin-bottom: 14px;
    padding: 12px 14px;
    background: linear-gradient(135deg, #FFFFFF, #FAFAFA);
    border: 1px solid #E0E0E0;
    border-left: 4px solid var(--gold-500);
    border-radius: 10px;
}

.perm-group h4 {
    margin-bottom: 8px;
    color: var(--wine-800);
    font-size: 13px;
}

.perm-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
    gap: 6px;
}

.perm-item {
    display: flex;
    align-items: center;
    gap: 7px;
    color: var(--text-2);
    font-size: 12.5px;
}

.perm-item input {
    accent-color: var(--brand-500);
}

/* ==================== 工具类 ==================== */
.desktop-only { display: block; }
.mobile-only { display: none !important; }
.text-muted { color: var(--muted); }
.text-danger { color: var(--danger); }
.text-success { color: var(--success); }
.mt-8 { margin-top: 8px; }
.mt-12 { margin-top: 12px; }
.mt-16 { margin-top: 16px; }
.mb-12 { margin-bottom: 12px; }
.mb-16 { margin-bottom: 16px; }
.flex { display: flex; }
.flex-between { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.flex-center { display: flex; align-items: center; justify-content: center; }
.gap-8 { gap: 8px; }
.gap-12 { gap: 12px; }
.w-full { width: 100%; }
.nowrap { white-space: nowrap; }
.pre-wrap { white-space: pre-wrap; word-break: break-word; }
.divider { height: 1px; margin: 14px 0; background: var(--line); }

/* ==================== 文本文档 ==================== */
.doc-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 18px;
}

.doc-item {
    display: flex;
    justify-content: space-between;
    gap: 14px;
    padding: 24px 26px;
    background: #FFFFFF;
    border: 1px solid #DDDDDD;
    border-radius: 16px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.08);
    transition: transform 0.22s ease, box-shadow 0.22s ease, border-color 0.22s ease;
}

.doc-item:hover {
    transform: translateY(-3px);
    border-color: var(--gold-300);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
}

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

.doc-item-title {
    margin-bottom: 10px;
    color: #222222;
    font-family: var(--font);
    font-size: 18px;
    font-weight: 700;
    line-height: 1.45;
    letter-spacing: 0.02em;
    word-break: break-word;
}

.doc-item-excerpt {
    display: -webkit-box;
    margin-top: 6px;
    overflow: hidden;
    color: var(--ink-600);
    font-size: 13.5px;
    line-height: 1.8;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
}

.doc-item-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 10px;
    color: var(--muted);
    font-size: 11.5px;
}

.doc-pub {
    padding: 1px 8px;
    border-radius: 999px;
    font-size: 11px;
}

.doc-pub.is-live { background: #E7F3E7; color: #2E7D32; }
.doc-pub.is-expired { background: #F2F2F2; color: #8A8A8A; }

.doc-item-actions {
    display: flex;
    flex: 0 0 auto;
    flex-direction: column;
    gap: 6px;
}

/* ---------- 文章模式：博客式阅读排版 ---------- */
.doc-list.is-article {
    grid-template-columns: 1fr;
    gap: 16px;
}

.doc-item.is-article {
    flex-direction: column;
    gap: 8px;
    padding: 26px 32px 18px;
    background: #FFFDF8;
    border: 1px solid #F0E6D8;
    border-radius: 14px;
    box-shadow: 0 3px 14px rgba(120, 80, 40, .06);
}

.doc-item.is-article .doc-item-title {
    font-size: 22px;
    font-weight: 800;
    line-height: 1.4;
    color: #3A2A1A;
    letter-spacing: .5px;
}

.doc-item.is-article .doc-item-meta {
    order: 2;
    margin: 0 0 8px;
    font-size: 12.5px;
    color: #9A8B7A;
}

.doc-item.is-article .doc-article-body {
    order: 3;
    margin: 4px 0 2px;
    padding: 0;
    font-size: 15.5px;
    line-height: 2;
    color: #3B3B3B;
}

.doc-item.is-article .doc-item-actions {
    order: 4;
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: flex-start;
    gap: 8px;
    margin-top: 8px;
    padding-top: 10px;
    border-top: 1px dashed #EDE2D2;
}

.doc-article-body img {
    max-width: 100%;
    height: auto;
}

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

.doc-editor-box { max-width: 980px; }
.doc-view-box { max-width: 860px; }

.doc-title-input {
    padding: 10px 12px;
    font-size: 18px;
    font-weight: 700;
}

.doc-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    padding: 6px;
    background: #FAFAFA;
    border: 1px solid #E0E0E0;
    border-radius: 10px;
    box-shadow: inset 1px 1px 0 #FFFFFF;
}

.doc-tool {
    height: 28px;
    padding: 0 9px;
    color: var(--text-2);
    font-size: 12.5px;
    background: linear-gradient(180deg, #FFFFFF, #F2F2F2);
    border: 1px solid #DDDDDD;
    border-radius: 6px;
}

.doc-tool:hover {
    color: var(--wine-800);
    border-color: var(--wine-700);
    background: var(--gold-100);
}

.doc-tool.tb-bold { font-weight: 800; }
.doc-tool.tb-italic { font-style: italic; }
.doc-tool.tb-underline { text-decoration: underline; }
.doc-tool.tb-strike { text-decoration: line-through; }

.doc-tool-sep {
    width: 1px;
    margin: 3px 2px;
    background: var(--line);
}

.doc-editor-area {
    min-height: 52vh;
    max-height: 62vh;
    padding: 18px 20px;
    overflow-y: auto;
    font-size: 14px;
    line-height: 1.8;
    background: #FFFFFF;
    border: 1px solid #CCCCCC;
    border-radius: 6px;
    outline: none;
}

.doc-editor-area:focus {
    border-color: var(--wine-700);
    box-shadow: 0 0 0 3px rgba(211, 47, 47, 0.12);
}

.doc-editor-area h2 { margin: 12px 0 8px; font-size: 20px; }
.doc-editor-area h3 { margin: 10px 0 6px; font-size: 17px; }
.doc-editor-area p { margin: 6px 0; }
.doc-editor-area img { max-width: 100%; height: auto; margin: 6px 0; }
.doc-editor-area table { width: 100%; border-collapse: collapse; }
.doc-editor-area td,
.doc-editor-area th { padding: 6px 8px; border: 1px solid #DDDDDD; }
.doc-editor-area ul { padding-left: 22px; list-style: disc; }
.doc-editor-area ol { padding-left: 22px; list-style: decimal; }

.doc-editor-foot {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    flex-wrap: wrap;
    font-size: 11.5px;
}

.doc-tool-group {
    display: inline-flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px;
}

.doc-tool.is-active {
    color: #FFFFFF;
    background: linear-gradient(180deg, #E53935, #C62828);
    border-color: #B71C1C;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.25);
}

.doc-tool.is-open {
    color: var(--wine-800);
    background: var(--gold-100);
    border-color: var(--gold-500);
}

.doc-tool-select {
    height: 28px;
    padding: 0 6px;
    color: var(--text-2);
    font-size: 12.5px;
    background: #FFFFFF;
    border: 1px solid #DDDDDD;
    border-radius: 6px;
}

.doc-tool-select:focus {
    outline: none;
    border-color: var(--wine-700);
    box-shadow: 0 0 0 2px rgba(211, 47, 47, 0.12);
}

.doc-panel {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 10px 12px;
    background: #FFFDF5;
    border: 1px dashed #FFE082;
    border-radius: 10px;
}

.doc-panel[hidden] {
    display: none;
}

.doc-panel-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}

.doc-panel-row[hidden] {
    display: none;
}

.doc-panel-label {
    color: var(--muted);
    font-size: 11.5px;
    white-space: nowrap;
}

.doc-panel-input {
    flex: 1 1 200px;
    height: 34px;
    padding: 0 10px;
    font-size: 13px;
}

.doc-num {
    width: 64px;
    height: 30px;
    padding: 0 8px;
    font-size: 13px;
}

.doc-swatches {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.doc-swatch {
    width: 24px;
    height: 24px;
    padding: 0;
    border: 1px solid rgba(0, 0, 0, 0.16);
    border-radius: 5px;
    transition: transform 0.1s ease, box-shadow 0.1s ease;
}

.doc-swatch:hover {
    transform: scale(1.08);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.18);
}

.doc-swatch-none {
    width: auto;
    padding: 0 8px;
    color: var(--text-2);
    font-size: 11.5px;
    background: #FFFFFF;
}

.doc-draft-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    color: #6B4A00;
    font-size: 12.5px;
    background: #FFF8E1;
    border: 1px solid #FFE082;
    border-radius: 8px;
}

.doc-draft-bar[hidden] {
    display: none;
}

/* 全屏编辑 */
.modal-box.doc-fs {
    position: fixed;
    inset: 0;
    width: auto;
    max-width: none;
    max-height: none;
    border-radius: 0;
    border-top-width: 0;
}

.modal-box.doc-fs .modal-body {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    min-height: 0;
    padding: 12px 16px;
    overflow: hidden;
}

.modal-box.doc-fs .doc-editor {
    flex: 1 1 auto;
    min-height: 0;
}

.modal-box.doc-fs .doc-toolbar,
.modal-box.doc-fs .doc-panel,
.modal-box.doc-fs .doc-draft-bar,
.modal-box.doc-fs .doc-editor-foot,
.modal-box.doc-fs .doc-title-input {
    flex: 0 0 auto;
}

.modal-box.doc-fs .doc-editor-area {
    flex: 1 1 auto;
    min-height: 0;
    max-height: none;
}

.doc-view-body {
    padding: 4px 2px;
    font-size: 14px;
    line-height: 1.9;
    word-break: break-word;
    max-width: 100%;
    overflow-x: hidden;
}

.doc-view-body h1,
.doc-view-body h2 { margin: 16px 0 10px; font-size: 21px; color: var(--wine-800); }
.doc-view-body h3 { margin: 14px 0 8px; font-size: 18px; color: var(--wine-800); }
.doc-view-body p { margin: 8px 0; }
.doc-view-body img { max-width: 100%; height: auto; margin: 8px 0; }
.doc-view-body table { width: 100%; border-collapse: collapse; }
.doc-view-body td,
.doc-view-body th { padding: 6px 8px; border: 1px solid #DDDDDD; }
.doc-view-body ul { padding-left: 22px; list-style: disc; }
.doc-view-body ol { padding-left: 22px; list-style: decimal; }

/* ---------- 文章格式（文档卡片设置） ---------- */
.doc-editor-area.doc-fmt-general,
.doc-view-body.doc-fmt-general { font-size: 14.5px; line-height: 1.9; }

.doc-editor-area.doc-fmt-official,
.doc-view-body.doc-fmt-official {
    font-family: "SimSun", "Songti SC", "STSong", serif;
    font-size: 16px;
    line-height: 1.95;
}

.doc-editor-area.doc-fmt-notice,
.doc-view-body.doc-fmt-notice { font-size: 15.5px; line-height: 1.9; }

.doc-editor-area.doc-fmt-summary,
.doc-view-body.doc-fmt-summary { font-size: 15px; line-height: 1.85; }

.doc-editor-area.doc-fmt-news,
.doc-view-body.doc-fmt-news { font-size: 15px; line-height: 1.8; }

.doc-fmt-general p,
.doc-fmt-official p,
.doc-fmt-notice p,
.doc-fmt-summary p,
.doc-fmt-news p { margin: 0 0 8px; }

.doc-fmt-general p,
.doc-fmt-official p,
.doc-fmt-notice p,
.doc-fmt-summary p { text-indent: 2em; }

.doc-fmt-news p { text-indent: 0; }

.doc-fmt-official h1,
.doc-fmt-notice h1,
.doc-fmt-summary h1 { margin: 0 0 18px; font-size: 24px; text-align: center; }

.doc-fmt-news h1 { margin: 0 0 16px; font-size: 22px; text-align: center; }

.doc-fmt-official h2,
.doc-fmt-notice h2,
.doc-fmt-summary h2,
.doc-fmt-news h2 { margin: 16px 0 10px; font-size: 18px; }

.doc-fmt-official h3,
.doc-fmt-notice h3,
.doc-fmt-summary h3,
.doc-fmt-news h3,
.doc-fmt-general h3 { margin: 12px 0 8px; font-size: 16px; }

/* ==================== 响应式 ==================== */
@media (max-width: 1180px) {
    .home-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

@media (max-width: 900px) {
    .home-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .stat-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 768px) {
    body { font-size: 14px; padding-bottom: 0; }

    .brand-logo { width: 28px !important; height: 28px !important; }

    .chip-text { display: none; }

    /* 手机端已移除底部菜单，只保留安全区 */
    .page-wrap { padding: 14px 12px calc(20px + env(safe-area-inset-bottom)); }

    /* 窄屏表格保持可读列宽，由 .table-wrap 横向滚动 */
    table.data-table { min-width: 760px; }

    /* 手机端可读性与触控：输入框 16px 防止 iOS 聚焦缩放，按钮加大触控区 */
    .input,
    .select,
    .textarea { font-size: 16px; }
    .btn { height: 40px; padding: 0 16px; font-size: 14.5px; }
    .btn-sm { height: 34px; padding: 0 12px; font-size: 13px; }

    /* 手机端首页标题居中，字号与旧版一致（登录页复用同一套标题） */
    .home-hero { padding: 24px 12px 12px; text-align: center; }
    .home-hero-inner { justify-content: center; text-align: center; }
    .home-title { font-size: 28px; letter-spacing: 6px; line-height: 1.25; }
    .home-subtitle { margin-top: 8px; margin-left: 0; font-size: 15px; letter-spacing: 3px; }

    .stat-row { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
    .stat-card { padding: 11px 13px; }
    .stat-value { font-size: 19px; }

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

    /* 离线移动端 .container：上 40px、下 24px */
    .home-page .home-grid {
        padding: 40px 6px 24px;
        margin: 0 -6px;
    }

    /* 手机端卡片对齐单机版：最小高度 110、图标 30、标题 15、圆角 12 */
    .nav-card {
        min-height: 110px;
        padding: 14px 8px;
        gap: 8px;
        border-radius: 12px;
    }

    .nav-icon { width: auto; height: auto; font-size: 30px; }
    .nav-title { font-size: 15px; }

    .page-head { margin-bottom: 14px; }
    .page-title { font-size: 18px; }

    .card-pad { padding: 14px 14px; }

    .row > .field { flex: 1 1 100%; }

    .table-wrap { border-radius: 12px; }
    table.data-table th,
    table.data-table td { padding: 10px 12px; font-size: 13.5px; }

    /* 分页在窄屏改为等宽按钮 + 居中信息 */
    .pager { gap: 8px; margin: 14px 0 2px; }
    .pager .btn { flex: 1 1 0; min-width: 96px; }
    .pager-info { flex: 1 1 100%; order: -1; font-size: 12.5px; }

    .desktop-only { display: none !important; }

    .modal-mask { padding: 0; align-items: flex-end; }
    .modal-box {
        max-width: none;
        max-height: 88vh;
        border-radius: 16px 16px 0 0;
        box-shadow: 0 -10px 30px rgba(0, 0, 0, 0.3);
    }
    .modal-body { padding: 16px; }
    .modal-foot { padding: 12px 16px calc(12px + env(safe-area-inset-bottom)); }
    .modal-foot .btn { flex: 1; }

    #custom-dialog-overlay { align-items: flex-end; padding: 0; }
    #custom-dialog-box {
        max-width: none;
        border-radius: 16px 16px 0 0;
        padding-bottom: env(safe-area-inset-bottom);
        box-shadow: 0 -10px 30px rgba(0, 0, 0, 0.3);
    }
    #custom-dialog-footer .btn { flex: 1; }

    .doc-list { grid-template-columns: 1fr; gap: 10px; }
    .doc-item { flex-direction: column; gap: 10px; padding: 14px; }
    .doc-item.is-article { padding: 18px 16px 14px; border-radius: 12px; }
    .doc-item.is-article .doc-item-title { font-size: 19px; }
    .doc-item.is-article .doc-article-body { font-size: 15px; line-height: 1.95; }
    .doc-article-body { font-size: 14.5px; }
    .doc-view-body { overflow-wrap: anywhere; }
    .doc-view-body table { max-width: 100%; }
    .doc-view-body pre { white-space: pre-wrap; overflow-wrap: anywhere; }
    .doc-item-actions { flex-direction: row; flex-wrap: wrap; }
    .doc-editor-area { min-height: 42vh; max-height: 56vh; padding: 12px; }
    .doc-toolbar { max-height: 92px; overflow-y: auto; }
    .doc-editor-foot { flex-direction: column; gap: 4px; }

    .toast-wrap { top: 10px; }
    .perm-list { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 360px) {
    .home-grid { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
    .stat-row { grid-template-columns: 1fr 1fr; }
    .perm-list { grid-template-columns: 1fr; }
}

/* ==================== 图片相册 ==================== */
[hidden] { display: none !important; }
body.no-scroll { overflow: hidden; }

.album-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 18px;
}

.album-card {
    position: relative;
    overflow: visible;
    padding: 10px;
    text-align: center;
    cursor: pointer;
    background: var(--surface);
    border: 1px solid #DDDDDD;
    border-radius: 16px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.08);
    transition: box-shadow .22s ease, transform .22s ease, border-color .22s ease;
}

.album-card:hover {
    transform: translateY(-4px);
    border-color: var(--gold-300);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
}

.album-cover {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    aspect-ratio: 4 / 3;
    margin-bottom: 12px;
    overflow: hidden;
    color: var(--gold-600);
    background: linear-gradient(135deg, #FFF8E1, #F0E6CC);
    border-radius: 11px;
}

.album-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.album-cover-empty { display: inline-flex; }

.album-card-tools {
    position: absolute;
    top: -10px;
    right: -10px;
    display: flex;
    gap: 6px;
    opacity: 0;
    transition: opacity .2s ease;
}

.album-card:hover .album-card-tools { opacity: 1; }

/* 键盘聚焦时同样显示操作按钮 */
.album-card:focus-within .album-card-tools { opacity: 1; }

/* 触屏设备（平板/大屏手机）没有 hover，工具按钮常显 */
@media (hover: none) {
    .album-card-tools { opacity: 1; }
}

.album-tool {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border: 2px solid var(--surface);
    border-radius: 50%;
    background: var(--wine-700);
    box-shadow: 0 4px 10px rgba(211, 47, 47, 0.3);
    color: #FFFFFF;
    font-size: 16px;
    line-height: 1;
    cursor: pointer;
    transition: transform .2s ease, background .2s ease;
}

.album-tool.album-rename {
    background: var(--gold-500);
    color: #4A2F00;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.18);
    font-size: 14px;
}

.album-tool:hover { transform: scale(1.08); background: var(--wine-600); }
.album-tool.album-rename:hover { background: var(--gold-300); }
.album-tool.album-del:hover { background: var(--wine-600); }

.album-count {
    position: absolute;
    left: 8px;
    bottom: 8px;
    padding: 2px 9px;
    color: #FFFFFF;
    font-size: 11px;
    font-weight: 600;
    background: rgba(142, 0, 0, 0.86);
    border-radius: 999px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
}

.album-info { padding: 0 4px 4px; }

.album-title {
    overflow: hidden;
    margin-bottom: 6px;
    color: #222222;
    font-family: var(--font);
    font-size: 15px;
    font-weight: 700;
    line-height: 1.5;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.album-meta {
    margin-top: 2px;
    color: var(--ink-400);
    font-size: 12px;
}

.photo-head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
}

.photo-head-info { flex: 1; min-width: 160px; }

.photo-album-title {
    color: var(--wine-800);
    font-size: 15px;
    font-weight: 700;
}

.photo-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 18px;
}

.photo-grid .empty { grid-column: 1 / -1; }

.photo-item {
    position: relative;
    aspect-ratio: 1 / 1;
    overflow: hidden;
    border: 1px solid #E0E0E0;
    border-radius: 10px;
    background: #FAFAFA;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.08);
    cursor: zoom-in;
}

.photo-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .25s ease;
}

.photo-item:hover img { transform: scale(1.04); }

.photo-cover-tag {
    position: absolute;
    top: 6px;
    left: 6px;
    padding: 1px 8px;
    border-radius: 999px;
    background: linear-gradient(180deg, #FFD54F, #FFC107);
    color: var(--on-accent);
    font-size: 11px;
    font-weight: 600;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
}

.photo-lightbox {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: rgba(30, 8, 8, .94);
}

.lb-stage {
    position: relative;
    display: flex;
    flex: 1;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 0;
    padding: 24px 64px 8px;
}

.lb-image {
    max-width: 100%;
    max-height: 100%;
    border-radius: 6px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, .4);
    object-fit: contain;
}

.lb-nav {
    position: absolute;
    top: 50%;
    width: 40px;
    height: 64px;
    border: 0;
    border-radius: 10px;
    background: rgba(255, 255, 255, .13);
    color: #FFFFFF;
    font-size: 28px;
    line-height: 1;
    cursor: pointer;
    transform: translateY(-50%);
}

.lb-nav:hover { background: rgba(255, 213, 79, .28); }
.lb-nav:disabled { opacity: .25; cursor: default; }
.lb-prev { left: 12px; }
.lb-next { right: 12px; }

.lb-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    width: 100%;
    padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
    color: #FFFFFF;
}

.lb-title {
    font-size: 12.5px;
    opacity: .85;
    word-break: break-all;
}

.lb-actions { display: flex; gap: 8px; }
.lb-del { color: #FFCDD2; }

@media (max-width: 768px) {
    .album-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
    .photo-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
    .album-card-tools { opacity: 1; }
    .photo-head { gap: 8px; }
    .photo-head-info { order: -1; flex-basis: 100%; }
    .lb-stage { padding: 16px 8px 0; }
    .lb-nav { width: 32px; height: 48px; font-size: 22px; }
    .lb-prev { left: 6px; }
    .lb-next { right: 6px; }
    .lb-bar { padding: 10px 12px calc(10px + env(safe-area-inset-bottom)); }
    .lb-actions { width: 100%; flex-wrap: wrap; justify-content: flex-end; }
    .lb-actions .btn { padding: 6px 10px; font-size: 12.5px; }
}

@media (max-width: 360px) {
    .photo-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

.tag-format {
    color: var(--gold-600);
    background: var(--gold-100);
    border: 1px solid #FFE082;
}

/* ==================== 文件目录 ==================== */
.files-page .file-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}

.file-crumbs {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-wrap: wrap;
    font-size: 13.5px;
}

.file-crumb {
    padding: 2px 6px;
    color: var(--wine-800);
    font-size: 13.5px;
    background: transparent;
    border: 0;
    border-radius: 6px;
    cursor: pointer;
}

.file-crumb:hover { background: var(--gold-100); }

.file-crumb-sep { color: var(--muted); }

.file-crumb-q { color: var(--muted); font-size: 13px; }

.file-sort {
    display: flex;
    align-items: center;
    gap: 6px;
}

.file-sort .select {
    width: 108px;
}

.file-search {
    display: flex;
    flex: 0 1 320px;
    gap: 8px;
    justify-content: flex-end;
}

.file-panel { padding: 6px 12px; }

.file-list { display: flex; flex-direction: column; }

.file-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 6px;
    border-bottom: 1px solid #EEEEEE;
    transition: background .15s ease;
}

.file-row:last-child { border-bottom: none; }

.file-row:hover { background: #FFF8E1; }

.file-icon {
    display: flex;
    flex: 0 0 34px;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    font-size: 20px;
    background: #FAFAFA;
    border: 1px solid #EEEEEE;
    border-radius: 10px;
}

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

.file-name {
    color: #222222;
    font-size: 14px;
    font-weight: 600;
    word-break: break-all;
}

.file-lock {
    display: inline-block;
    margin-left: 6px;
    font-size: 12px;
    vertical-align: 1px;
}

/* ---------- 文件预览 ---------- */
.file-preview-box {
    max-width: 980px;
}

.file-preview-body {
    max-height: 72vh;
    overflow: auto;
}

.file-preview-media img {
    display: block;
    max-width: 100%;
    max-height: 68vh;
    margin: 0 auto;
    border-radius: 8px;
}

.file-preview-video {
    display: block;
    width: 100%;
    max-height: 68vh;
    background: #000000;
    border-radius: 8px;
}

.file-preview-audio {
    padding: 24px 8px;
}

.file-preview-audio audio {
    width: 100%;
}

.file-preview-frame {
    width: 100%;
    height: 70vh;
    border: 1px solid #EEEEEE;
    border-radius: 8px;
    background: #FFFFFF;
}

.file-preview-table {
    overflow: auto;
    max-height: 66vh;
}

.file-preview-table table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.file-preview-table th,
.file-preview-table td {
    padding: 6px 10px;
    border: 1px solid #E6E6E6;
    text-align: left;
    white-space: nowrap;
    vertical-align: top;
}

.file-preview-table thead th {
    position: sticky;
    top: 0;
    z-index: 1;
    background: #FDF6E3;
    font-weight: 600;
}

/* ---------- 多工作表标签 ---------- */
.file-sheet-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 10px;
    padding-bottom: 8px;
    border-bottom: 1px solid #EEEEEE;
}

.file-sheet-tab {
    padding: 5px 12px;
    color: #555555;
    font-size: 12.5px;
    background: #FAFAFA;
    border: 1px solid #E6E6E6;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.file-sheet-tab:hover {
    border-color: var(--gold-300);
    background: var(--gold-100);
}

.file-sheet-tab.is-active {
    color: #FFFFFF;
    background: #B71C1C;
    border-color: #B71C1C;
}

.file-meta {
    margin-top: 2px;
    color: var(--muted);
    font-size: 12px;
}

.file-actions {
    display: flex;
    flex: 0 0 auto;
    gap: 6px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.file-actions .btn {
    padding: 5px 12px;
    font-size: 12.5px;
}

.file-del { color: #C62828; }

.file-status { margin-top: 10px; font-size: 12.5px; }

.file-pager { margin: 14px 0 4px; }

/* ---------- 批量选择 ---------- */
.file-check {
    display: inline-flex;
    flex: 0 0 auto;
    align-items: center;
    cursor: pointer;
}

.file-check input {
    width: 16px;
    height: 16px;
    accent-color: var(--wine-700);
    cursor: pointer;
}

.file-batch {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
    padding: 10px 14px;
    color: var(--ink-600);
    font-size: 13px;
    background: #FFF8E1;
    border: 1px solid var(--gold-300);
    border-radius: 12px;
}

.file-batch-spacer { flex: 1 1 auto; }

.file-row.is-selected { background: #FFF8E1; }

.file-panel.is-drop {
    border-color: var(--gold-500);
    background: #FFF8E1;
    box-shadow: inset 0 0 0 2px rgba(255, 193, 7, 0.35);
}

@media (max-width: 768px) {
    .files-page .file-toolbar { padding: 12px 14px; }

    .file-search { flex: 1 1 100%; }

    .file-sort { flex: 1 1 100%; justify-content: flex-end; }

    .file-search .input { flex: 1 1 auto; min-width: 0; }

    .file-panel { padding: 2px 8px; }

    .file-row {
        align-items: flex-start;
        flex-wrap: wrap;
        gap: 10px;
        padding: 11px 4px;
    }

    .file-icon { flex-basis: 30px; width: 30px; height: 30px; font-size: 18px; }

    .file-actions { width: 100%; justify-content: flex-end; }

    .file-actions .btn { padding: 7px 12px; font-size: 13px; }

    .file-preview-body { max-height: 62vh; }
    .file-preview-frame { height: 60vh; }
    .file-preview-table { max-height: 58vh; }

    .file-status { font-size: 12px; }
}

/* ==================== 任务看板 ==================== */
.kanban-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.kanban-save-status {
    color: var(--muted);
    font-size: 12px;
}

.kanban-save-status.is-err { color: var(--danger); }

.kanban-board {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    overflow-x: auto;
    padding-bottom: 14px;
    -webkit-overflow-scrolling: touch;
}

.kanban-empty { flex: 1 0 100%; }

.kanban-column {
    display: flex;
    flex: 0 0 300px;
    flex-direction: column;
    max-width: 300px;
    min-height: 240px;
    overflow: hidden;
    border: 1px solid #DDDDDD;
    border-radius: 15px;
    background: #FAFAFA;
}

.kanban-column.drag-over {
    border-color: var(--gold-500);
    background: var(--gold-100);
}

.kanban-col-head {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 15px 16px;
    color: #222222;
    font-size: 14.5px;
    font-weight: 700;
    background: transparent;
    border-bottom: 1px solid #DDDDDD;
}

.kanban-col-title {
    flex: 1;
    overflow: hidden;
    color: #222222;
    font-size: 14.5px;
    font-weight: 700;
    white-space: nowrap;
    text-overflow: ellipsis;
    cursor: pointer;
}

.kanban-col-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 22px;
    padding: 2px 8px;
    color: #FFFFFF;
    font-size: 11px;
    font-weight: 600;
    line-height: 1.5;
    background: var(--wine-700);
    border-radius: 11px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.kanban-col-del {
    padding: 0 2px;
    border: 0;
    background: transparent;
    color: var(--muted);
    font-size: 16px;
    line-height: 1;
    cursor: pointer;
}

.kanban-col-del:hover { color: var(--danger); }

.kanban-list {
    display: flex;
    flex: 1;
    flex-direction: column;
    gap: 8px;
    min-height: 44px;
    padding: 10px;
}

.kanban-list-empty {
    padding: 14px 0;
    color: var(--muted);
    font-size: 12px;
    text-align: center;
}

.kanban-card {
    padding: 14px;
    border: 1px solid #DDDDDD;
    border-left: 3px solid var(--wine-700);
    border-radius: 10px;
    background: var(--surface);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.08);
    cursor: grab;
    transition: box-shadow 0.16s ease, border-color 0.16s ease;
}

.kanban-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
    border-color: var(--gold-300);
}
.kanban-card.dragging { opacity: .45; }

.kanban-card-content {
    color: var(--ink-700);
    font-size: 13.5px;
    line-height: 1.6;
    word-break: break-word;
}

.kanban-card-foot {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
    margin-top: 8px;
    color: var(--muted);
    font-size: 11.5px;
}

.kanban-assignee {
    padding: 0 8px;
    border-radius: 999px;
    background: var(--brand-100);
    color: var(--brand);
}

.kanban-date.is-overdue { color: var(--danger); }

.kanban-card.is-overdue { border-color: #E7A3A3; }

.kanban-card-link {
    margin-top: 7px;
    padding: 4px 8px;
    border-radius: 6px;
    background: var(--brand-100);
    color: var(--brand);
    font-size: 11.5px;
    word-break: break-all;
}

.kanban-card-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    margin-top: 7px;
}

.kanban-badge {
    padding: 1px 7px;
    border-radius: 999px;
    background: #F0EDE6;
    color: var(--muted);
    font-size: 11px;
}

.kanban-badge.is-overdue { background: #FDECEC; color: var(--danger); }
.kanban-badge.is-link { background: #EAF4EA; color: #2E7D32; }

.kanban-toolbar-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-left: auto;
}

.kanban-comments {
    margin-top: 14px;
    padding-top: 12px;
    border-top: 1px dashed var(--line-strong);
}

.kanban-comments-head {
    margin-bottom: 8px;
    color: var(--ink-700);
    font-size: 13px;
    font-weight: 600;
}

.kanban-comment-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 220px;
    overflow-y: auto;
}

.kanban-comment {
    padding: 8px 10px;
    border-radius: 8px;
    background: #FAF8F3;
}

.kanban-comment-meta {
    display: flex;
    justify-content: space-between;
    gap: 8px;
    color: var(--ink-700);
    font-size: 12px;
    font-weight: 600;
}

.kanban-comment-meta span {
    color: var(--muted);
    font-weight: 400;
}

.kanban-comment-text {
    margin-top: 3px;
    color: var(--ink-700);
    font-size: 12.5px;
    line-height: 1.55;
    word-break: break-word;
}

.kanban-comment-empty {
    color: var(--muted);
    font-size: 12px;
}

.kanban-comment-form {
    display: flex;
    gap: 8px;
    margin-top: 10px;
}

.kanban-comment-form .input { flex: 1; }

.kanban-add-card {
    margin: 0 10px 10px;
    padding: 7px;
    border: 1px dashed var(--line-strong);
    border-radius: 8px;
    background: transparent;
    color: var(--muted);
    font-size: 12.5px;
    cursor: pointer;
}

.kanban-add-card:hover {
    border-color: var(--brand-500);
    background: var(--surface);
    color: var(--brand);
}

.kanban-card-textarea {
    min-height: 96px;
    resize: vertical;
}

.kanban-color-input {
    width: 100%;
    height: 38px;
    padding: 3px;
    cursor: pointer;
}

@media (max-width: 768px) {
    .kanban-board {
        gap: 10px;
        scroll-snap-type: x proximity;
    }
    .kanban-column {
        flex: 0 0 84%;
        max-width: 84%;
        min-height: 200px;
        scroll-snap-align: start;
    }
    .kanban-card { padding: 11px 12px; }
    .kanban-card-textarea { min-height: 120px; }
}

/* ==================== 思维导图 ==================== */
.mind-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.mind-hint { font-size: 12px; }

.mind-toolbar-right {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
}

.mind-save-status {
    margin-right: 4px;
    color: var(--muted);
    font-size: 12px;
}

.mind-save-status.is-err { color: var(--danger); }

.mind-zoom-btn {
    min-width: 32px;
    height: 30px;
    padding: 0 8px;
    border: 1px solid #DDDDDD;
    border-radius: 6px;
    background: linear-gradient(180deg, #FFFFFF, #F0F0F0);
    color: var(--text-2);
    font-size: 13px;
    line-height: 1;
    cursor: pointer;
    box-shadow: 0 2px 3px rgba(0, 0, 0, 0.14), inset 0 1px 2px #FFFFFF;
}

.mind-zoom-btn:hover {
    border-color: var(--wine-700);
    color: var(--wine-800);
    background: var(--gold-100);
}

.mind-zoom-value { min-width: 56px; font-size: 12px; }

.mind-stage {
    display: flex;
    align-items: stretch;
    gap: 12px;
}

.mind-viewport {
    position: relative;
    flex: 1;
    height: 62vh;
    min-height: 380px;
    max-height: 640px;
    overflow: hidden;
    border: none;
    border-radius: 12px;
    background:
        radial-gradient(760px 440px at 14% 0%, rgba(255, 193, 7, 0.10), transparent 65%),
        radial-gradient(600px 400px at 88% 10%, rgba(211, 47, 47, 0.035), transparent 65%),
        var(--paper);
    cursor: grab;
    touch-action: none;
}

.mind-viewport:active { cursor: grabbing; }

.mind-canvas {
    position: absolute;
    top: 0;
    left: 0;
    transform-origin: 0 0;
    will-change: transform;
}

.mind-zoom-badge {
    position: absolute;
    right: 10px;
    bottom: 10px;
    padding: 2px 9px;
    border: 1px solid #FFE082;
    border-radius: 999px;
    background: rgba(255, 248, 225, .94);
    color: var(--gold-600);
    font-size: 11px;
    pointer-events: none;
}

.mind-tree {
    display: inline-block;
    padding: 28px;
    text-align: center;
    user-select: none;
}

.mind-tree > ul {
    display: flex;
    justify-content: center;
    margin: 0;
    padding: 0;
    position: relative;
}

.mind-tree ul {
    display: flex;
    justify-content: center;
    margin: 0;
    padding: 22px 0 0;
    position: relative;
}

.mind-tree li {
    position: relative;
    padding: 22px 8px 0;
    list-style: none;
    text-align: center;
}

.mind-tree li::before,
.mind-tree li::after {
    content: '';
    position: absolute;
    top: 0;
    right: 50%;
    width: 50%;
    height: 22px;
    border-top: 1.5px solid var(--gold-300);
}

.mind-tree li::after {
    right: auto;
    left: 50%;
    border-left: 1.5px solid var(--gold-300);
}

.mind-tree li:only-child::after,
.mind-tree li:only-child::before { display: none; }
.mind-tree li:only-child { padding-top: 0; }
.mind-tree li:first-child::before,
.mind-tree li:last-child::after { border: 0 none; }
.mind-tree li:first-child::after { border-radius: 5px 0 0 0; }
.mind-tree li:last-child::before {
    border-right: 1.5px solid var(--gold-300);
    border-radius: 0 5px 0 0;
}

.mind-tree ul ul::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    width: 0;
    height: 22px;
    margin-left: -1px;
    border-left: 1.5px solid var(--gold-300);
}

.mind-node {
    display: inline-block;
    min-width: 80px;
    max-width: 200px;
    padding: 10px 15px;
    border: 1px solid var(--gold-300);
    border-radius: 10px;
    background: var(--surface);
    color: #222222;
    font-size: 13.5px;
    line-height: 1.45;
    word-wrap: break-word;
    overflow-wrap: break-word;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.08);
    cursor: default;
    user-select: none;
    transition: box-shadow .2s ease, border-color .2s ease, transform .2s ease;
}

.mind-node.is-selectable { cursor: pointer; }

.mind-node.is-selectable:hover {
    z-index: 10;
    border-color: var(--gold-500);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
    transform: translateY(-2px);
}

.mind-node.is-selected {
    z-index: 20;
    border-color: var(--gold-500) !important;
    box-shadow: 0 0 0 4px rgba(255, 193, 7, .24), 0 4px 12px rgba(0, 0, 0, 0.12) !important;
    transform: scale(1.03);
}

.mind-tree > ul > li > .mind-node.is-root {
    padding: 15px 26px;
    border-radius: 12px;
    border: 1px solid rgba(255, 193, 7, 0.45);
    background:
        radial-gradient(160px 80px at 80% 0%, rgba(255, 193, 7, 0.3), transparent 70%),
        linear-gradient(135deg, #B71C1C, #8E0000);
    color: #FFFFFF;
    font-size: 16px;
    font-weight: 700;
    letter-spacing: .04em;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.35);
    box-shadow: 0 8px 20px rgba(142, 0, 0, 0.22);
}

.mind-stage .mind-panel {
    display: flex;
    flex: 0 0 340px;
    flex-direction: column;
    width: 340px;
    overflow: hidden;
    border: 1px solid #DDDDDD;
    border-radius: 12px;
    background: var(--surface);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.08);
}

.mind-panel-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 22px;
    border-bottom: 1px solid #DDDDDD;
    background: #FAFAFA;
    color: var(--wine-800);
    font-family: var(--font);
    font-size: 17px;
    font-weight: 700;
    letter-spacing: 0.5px;
}

.mind-panel-close {
    padding: 0 3px;
    border: 0;
    background: transparent;
    color: var(--muted);
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
}

.mind-panel-close:hover { color: var(--danger); }

.mind-panel-body {
    flex: 1;
    padding: 14px;
    overflow-y: auto;
}

.mind-node-card {
    margin-bottom: 16px;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: var(--surface-2);
}

.mind-node-label {
    margin-bottom: 4px;
    color: var(--muted);
    font-size: 11.5px;
}

.mind-node-name {
    color: var(--text);
    font-size: 14px;
    font-weight: 700;
    line-height: 1.5;
    word-break: break-word;
}

.mind-group { margin-bottom: 18px; }

.mind-group h4 {
    margin: 0 0 9px;
    padding-bottom: 6px;
    border-bottom: 1px solid var(--line);
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
}

.mind-block-btn {
    display: flex;
    width: 100%;
    justify-content: center;
    margin-bottom: 6px;
}

.mind-color-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 6px 0;
    color: var(--text-2);
    font-size: 12.5px;
}

.mind-color-row input[type="color"] {
    width: 48px;
    height: 30px;
    padding: 2px;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: var(--surface);
    cursor: pointer;
}

.mind-reset-style {
    margin-top: 6px;
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--muted);
    font-size: 12px;
    text-decoration: underline;
    cursor: pointer;
}

.mind-reset-style:hover { color: var(--brand); }
.mind-group-danger { margin-top: 26px; }

@media (max-width: 768px) {
    .mind-hint { display: none; }
    .mind-stage { display: block; }
    .mind-viewport {
        height: 56vh;
        min-height: 320px;
        max-height: none;
    }
    .mind-tree { padding: 18px; }
    .mind-tree ul { padding-top: 18px; }
    .mind-tree li { padding: 18px 6px 0; }
    .mind-tree li::before,
    .mind-tree li::after { height: 18px; }
    .mind-tree ul ul::before { height: 18px; }
    .mind-node {
        max-width: 150px;
        padding: 9px 12px;
        font-size: 12.5px;
    }
    .mind-tree > ul > li > .mind-node.is-root {
        padding: 12px 18px;
        font-size: 14px;
    }
    .mind-panel {
        position: fixed;
        top: auto;
        right: 0;
        bottom: 0;
        left: 0;
        z-index: 950;
        width: auto;
        max-height: 62vh;
        border-right: 0;
        border-bottom: 0;
        border-left: 0;
        border-radius: 16px 16px 0 0;
        background: var(--surface);
        box-shadow: 0 -10px 30px rgba(0, 0, 0, .18);
    }
    .mind-panel-body { padding-bottom: calc(18px + env(safe-area-inset-bottom)); }
    .mind-toolbar-right { width: 100%; justify-content: flex-end; }
    .mind-toolbar .text-muted { display: none; }
}

@media print {
    .mind-toolbar,
    .mind-panel,
    .mind-zoom-badge,
    .page-actions { display: none !important; }
    .mind-viewport {
        height: auto;
        min-height: 0;
        max-height: none;
        overflow: visible;
        border: 0;
        background: #FFFFFF;
    }
    .mind-canvas {
        position: static !important;
        transform: none !important;
    }
    .mind-tree { padding: 0; }
}

/* ==================== 打印 ==================== */
@media print {
    .page-actions,
    .btn,
    .no-print { display: none !important; }
    body { background: #FFFFFF; }
    .page-wrap { padding: 0; max-width: none; }
}

/* 台账打印：隐藏筛选与操作列，表格按纸张宽度铺开 */
@media print {
    .form-page .tabs,
    .form-page .col-check,
    .form-page .col-actions { display: none !important; }
    .form-page .table-wrap {
        max-height: none;
        overflow: visible;
        border: 0;
    }
    .form-page table.data-table {
        width: 100%;
        min-width: 0;
        font-size: 11px;
    }
    .form-page table.data-table th,
    .form-page table.data-table td {
        padding: 5px 6px;
        border-color: #CCCCCC;
        word-break: break-word;
    }
    .form-page table.data-table thead th {
        background: #F2F2F2 !important;
        color: #000000;
    }
    .form-page .card {
        margin: 0;
        box-shadow: none;
    }
}

/* ==================== 值班排班 ==================== */
.calendar-page .cal-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}

.cal-nav {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.cal-month {
    min-width: 104px;
    color: var(--wine-800);
    font-family: var(--font);
    font-size: 22px;
    font-weight: 700;
    letter-spacing: .06em;
    text-align: center;
}

.cal-status { margin-left: 4px; color: var(--muted); font-size: 12px; }
.cal-status.is-err { color: var(--danger); }
.cal-hint { font-size: 12px; }

.cal-board { padding: 0; overflow: hidden; }
.cal-weekdays {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    border-bottom: 2px solid var(--gold-500);
    background: #FAFAFA;
}

.cal-weekdays span {
    padding: 12px 4px;
    color: var(--ink-600);
    font-size: 12.5px;
    font-weight: 700;
    letter-spacing: .08em;
    text-align: center;
}

.cal-weekdays span.is-weekend { color: var(--wine-700); }

.cal-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 1px;
    background: #DDDDDD;
}

.cal-cell {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 5px;
    min-height: 118px;
    padding: 10px;
    overflow: hidden;
    border: 0;
    background: var(--surface);
    font-family: inherit;
    text-align: left;
    cursor: pointer;
    transition: background .15s ease;
}

.cal-cell:hover { background: var(--gold-100); }
.cal-cell.is-out { background: #FAFAFA; }
.cal-cell.is-out:hover { background: var(--gold-100); }
.cal-cell.has-duty { background-image: none; }
.cal-cell.is-today { box-shadow: inset 0 0 0 2px var(--gold-500); }

.cal-day {
    display: inline-block;
    margin-bottom: 8px;
    color: var(--ink-600);
    font-size: 15px;
    font-weight: 700;
}

.cal-cell.is-out .cal-day { color: #999999; }
.cal-cell.is-today .cal-day { background: transparent; box-shadow: none; color: var(--wine-800); }

.cal-markers { display: none; align-items: center; gap: 4px; }
.cal-dot { display: inline-block; width: 6px; height: 6px; border-radius: 50%; }
.cal-dot--duty { background: var(--brand); }
.cal-dot--event { background: var(--accent); }

.cal-tags { display: flex; flex-direction: column; gap: 4px; min-width: 0; }

.cal-tag {
    display: block;
    padding: 4px 7px;
    color: #8D6E00;
    font-size: 11.5px;
    line-height: 1.45;
    background: var(--gold-100);
    border-left: 2px solid var(--gold-500);
    border-radius: 0 5px 5px 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.cal-tag--leader { color: #8D6E00; background: var(--gold-100); border-left-color: var(--gold-500); font-weight: 600; }
.cal-tag--member { color: var(--text-2); background: #FAFAFA; border-left-color: #DDDDDD; }
.cal-tag--event { color: var(--wine-800); background: #FFEBEE; border-left-color: var(--wine-700); font-weight: 600; }

.cal-error {
    grid-column: 1 / -1;
    padding: 48px 20px;
    background: var(--surface);
    color: var(--muted);
    font-size: 13px;
    text-align: center;
}

.cal-modal-date {
    margin-bottom: 14px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--line);
    color: var(--text);
    font-size: 14px;
    font-weight: 700;
}

.cal-today-badge {
    display: inline-block;
    margin-left: 6px;
    padding: 1px 7px;
    border-radius: 999px;
    background: linear-gradient(180deg, var(--wine-700), var(--wine-800));
    color: #FFFFFF;
    font-size: 11px;
    font-weight: 600;
    vertical-align: 2px;
}

.cal-modal-tip { margin-top: -4px; color: var(--muted); font-size: 11.5px; }

.cal-detail {
    display: flex;
    flex-direction: column;
    gap: 1px;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--line);
}

.cal-detail-row { display: flex; gap: 12px; padding: 11px 12px; background: var(--surface); }
.cal-detail-row span { flex: 0 0 74px; color: var(--muted); font-size: 12.5px; }
.cal-detail-row strong { flex: 1 1 auto; color: var(--text); font-size: 13px; font-weight: 600; word-break: break-word; }

@media (max-width: 768px) {
    .cal-hint { display: none; }
    .cal-month { min-width: 88px; font-size: 15px; }
    .cal-toolbar { gap: 8px; }
    .cal-nav { width: 100%; justify-content: space-between; }
    .cal-status { width: 100%; margin-left: 0; text-align: right; }
    .cal-cell { min-height: 62px; padding: 5px; gap: 3px; }
    /* 与桌面端一致：日号不再使用圆形底，只保留字号 */
    .cal-day { width: auto; height: auto; margin-bottom: 4px; font-size: 12.5px; }
    /* 移动端保留值班人标签，其余标签隐藏，空间不足时省略号截断 */
    .cal-tags { display: block; }
    .cal-tag { display: none; }
    .cal-tag--member { display: block; font-size: 10px; line-height: 1.3; padding: 0 3px; border-radius: 3px; }
    .cal-markers { display: flex; }
    .cal-weekdays span { padding: 8px 2px; font-size: 11px; }
}

@media (max-width: 360px) {
    .cal-cell { min-height: 54px; padding: 4px; }
    .cal-day { width: auto; height: auto; font-size: 12px; }
    .cal-toolbar .btn-sm { padding-left: 8px; padding-right: 8px; }
}

@media print {
    .cal-toolbar { display: none !important; }
    .cal-board { border: 1px solid #CCCCCC; }
    .cal-cell { min-height: 84px; }
    .cal-cell.is-today { box-shadow: none; }
    .cal-cell.is-today .cal-day { background: transparent; color: var(--text); }
}

/* ==================== 村史大事记 ==================== */
.timeline-page .tl-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}

.tl-meta { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.tl-summary { color: var(--text); font-size: 13px; font-weight: 700; }
.tl-status { color: var(--muted); font-size: 12px; }
.tl-status.is-err { color: var(--danger); }
.tl-hint { font-size: 12px; }

/* 旧版时间轴：左右交错 + 中央金红渐变主线 */
.tl-list {
    position: relative;
    padding: 10px 0 4px;
}

.tl-list::before {
    content: '';
    position: absolute;
    left: 50%;
    top: 0;
    bottom: 0;
    width: 2px;
    margin-left: -1px;
    border-radius: 2px;
    background: linear-gradient(180deg, var(--gold-300), var(--gold-500) 50%, var(--gold-300));
}

.tl-list.is-empty::before { display: none; }

.tl-item {
    position: relative;
    width: 50%;
    margin-bottom: 18px;
    padding: 10px 40px;
}

.tl-item:last-child { margin-bottom: 0; }

.tl-item:nth-child(even) {
    margin-left: 50%;
    padding: 10px 40px;
}

.tl-item::before {
    content: '';
    position: absolute;
    right: -8px;
    top: 24px;
    z-index: 2;
    width: 16px;
    height: 16px;
    border: 3px solid var(--wine-700);
    border-radius: 50%;
    background: var(--surface);
    box-shadow: 0 0 0 4px var(--gold-100);
}

.tl-item:nth-child(even)::before {
    right: auto;
    left: -8px;
}

.tl-card {
    position: relative;
    padding: 20px 22px;
    border: 1px solid #DDDDDD;
    border-radius: 14px;
    background: #FFFFFF;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.08);
    transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}

.tl-item.is-clickable { cursor: pointer; }
.tl-item.is-clickable:hover .tl-card {
    transform: translateY(-3px);
    border-color: var(--gold-300);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
}

.tl-item.is-clickable:focus { outline: none; }
.tl-item.is-clickable:focus-visible .tl-card {
    border-color: var(--wine-700);
    box-shadow: 0 0 0 3px rgba(211, 47, 47, 0.18);
}

.tl-date {
    margin-bottom: 8px;
    color: var(--gold-600);
    font-size: 12.5px;
    font-weight: 700;
    letter-spacing: .08em;
}

.tl-title {
    margin: 0 0 8px;
    color: #222222;
    font-family: var(--font);
    font-size: 17px;
    font-weight: 700;
    line-height: 1.45;
    word-break: break-word;
}

.tl-desc {
    margin: 0;
    color: var(--ink-600);
    font-size: 13.5px;
    line-height: 1.8;
    white-space: pre-wrap;
    word-break: break-word;
}

.tl-required { color: var(--danger); }
.tl-modal-tip { margin-top: -4px; color: var(--muted); font-size: 11.5px; }

@media (max-width: 768px) {
    .tl-hint { display: none; }
    /* 窄屏回落为单侧时间轴 */
    .tl-list { padding-left: 26px; }
    .tl-list::before { left: 9px; margin-left: 0; }
    .tl-item,
    .tl-item:nth-child(even) {
        width: auto;
        margin-left: 0;
        margin-bottom: 12px;
        padding: 0;
    }
    .tl-item::before,
    .tl-item:nth-child(even)::before {
        left: -24px;
        right: auto;
        top: 18px;
        width: 10px;
        height: 10px;
        border-width: 2.5px;
        box-shadow: 0 0 0 2px var(--gold-100);
    }
    .tl-card { padding: 13px 14px; }
    .tl-title { font-size: 15px; }
    .tl-desc { font-size: 12.5px; }
}

@media print {
    .tl-toolbar { display: none !important; }
    .tl-list { padding-left: 24px; }
    .tl-list::before { left: 6px; margin-left: 0; background: #CCCCCC; }
    .tl-item,
    .tl-item:nth-child(even) {
        width: auto;
        margin-left: 0;
        padding: 0;
    }
    .tl-item::before,
    .tl-item:nth-child(even)::before { left: -22px; right: auto; }
    .tl-item { break-inside: avoid; }
    .tl-card { border: 1px solid #CCCCCC; box-shadow: none; }
}

/* ==================== 网格化管理 ==================== */
.gridmap-page .grid-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}

.gridmap-page .grid-toolbar-left,
.gridmap-page .grid-toolbar-right {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.gridmap-page .grid-summary { color: var(--wine-800); font-size: 13px; font-weight: 700; }
.gridmap-page .grid-status { color: var(--muted); font-size: 12px; }
.gridmap-page .grid-status.is-err { color: var(--danger); }
.gridmap-page .grid-hint { font-size: 12px; }

.gridmap-page .grid-zoom-btn {
    min-width: 30px;
    height: 30px;
    padding: 0 8px;
    border: 1px solid #DDDDDD;
    border-radius: 6px;
    background: linear-gradient(180deg, #FFFFFF, #F0F0F0);
    color: var(--text-2);
    font-family: inherit;
    font-size: 13px;
    line-height: 1;
    cursor: pointer;
    box-shadow: 0 2px 3px rgba(0, 0, 0, 0.14), inset 0 1px 2px #FFFFFF;
    transition: background .15s ease, border-color .15s ease, color .15s ease;
}

.gridmap-page .grid-zoom-btn:hover { border-color: var(--wine-700); color: var(--wine-800); background: var(--gold-100); }
.gridmap-page .grid-zoom-value { min-width: 52px; font-weight: 600; }
.gridmap-page .grid-zoom-fit { min-width: 46px; }

.gridmap-page .grid-stage {
    position: relative;
    height: 62vh;
    min-height: 380px;
    max-height: 720px;
    overflow: hidden;
    border: 1px solid #E0E0E0;
    border-radius: 12px;
    background: #FAFAFA;
    box-shadow: inset 1px 1px 0 #FFFFFF;
}

.gridmap-page .grid-viewport {
    position: absolute;
    inset: 0;
    overflow: hidden;
    cursor: grab;
    touch-action: none;
    background:
        radial-gradient(700px 420px at 12% 0%, rgba(255, 193, 7, 0.10), transparent 65%),
        var(--paper);
}

.gridmap-page .grid-viewport.is-panning { cursor: grabbing; }

.gridmap-page .grid-canvas {
    position: absolute;
    left: 50%;
    top: 50%;
    width: 2000px;
    height: 2000px;
    margin-left: -1000px;
    margin-top: -1000px;
    border: 1px dashed var(--gold-300);
    background-color: #FFFFFF;
    background-image:
        linear-gradient(rgba(211, 47, 47, 0.045) 1px, transparent 1px),
        linear-gradient(90deg, rgba(211, 47, 47, 0.045) 1px, transparent 1px);
    background-size: 50px 50px;
    transform-origin: center center;
    will-change: transform;
}

.gridmap-page .grid-block {
    position: absolute;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    min-width: 100px;
    max-width: 220px;
    padding: 15px;
    border: 2px solid var(--wine-700);
    border-radius: 12px;
    background: var(--surface);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.1);
    text-align: center;
    user-select: none;
    cursor: pointer;
    transition: box-shadow .2s ease, transform .2s ease;
}

.gridmap-page .grid-block:hover { z-index: 5; box-shadow: 0 10px 24px rgba(211, 47, 47, 0.16); transform: translateY(-2px); }
.gridmap-page .grid-block:focus { outline: none; }
.gridmap-page .grid-block:focus-visible { box-shadow: 0 0 0 3px rgba(211, 47, 47, .22), 0 10px 24px rgba(0, 0, 0, 0.14); }
.gridmap-page .grid-block.is-dragging { z-index: 30; box-shadow: 0 10px 24px rgba(0, 0, 0, 0.22); transition: none; }

.gridmap-page .grid-drag {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 18px;
    border-bottom: 1px solid #E0E0E0;
    border-radius: 9px 9px 0 0;
    background: linear-gradient(180deg, #FFF8E1, #FFF3CD);
    cursor: move;
    display: none;
    touch-action: none;
}

.gridmap-page .grid-drag::after {
    content: '';
    position: absolute;
    left: 50%;
    top: 7px;
    width: 28px;
    height: 4px;
    margin-left: -14px;
    border-radius: 2px;
    background: #D8C08A;
}

.gridmap-page [data-can-edit="1"] .grid-drag { display: block; }
.gridmap-page [data-can-edit="1"] .grid-block { padding-top: 26px; }

.gridmap-page .grid-block-title {
    margin-bottom: 5px;
    color: #222222;
    font-family: var(--font);
    font-size: 15px;
    font-weight: 700;
    line-height: 1.45;
    word-break: break-word;
}

.gridmap-page .grid-block-owner {
    color: var(--ink-400);
    font-size: 12px;
    line-height: 1.5;
    word-break: break-word;
}

.gridmap-page .grid-block-phone { color: var(--muted); font-size: 11.5px; line-height: 1.5; }

.gridmap-page .grid-empty {
    position: absolute;
    left: 50%;
    top: 50%;
    z-index: 20;
    min-width: 240px;
    transform: translate(-50%, -50%);
    text-align: center;
}

.gridmap-page .grid-detail {
    display: flex;
    flex-direction: column;
    gap: 1px;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--line);
}

.gridmap-page .grid-detail-row { display: flex; gap: 12px; padding: 11px 12px; background: var(--surface); }
.gridmap-page .grid-detail-row span { flex: 0 0 74px; color: var(--muted); font-size: 12.5px; }
.gridmap-page .grid-detail-row strong { flex: 1 1 auto; color: var(--text); font-size: 13px; font-weight: 600; word-break: break-word; }

.gridmap-page .grid-required { color: var(--danger); }
.gridmap-page .grid-modal-tip { margin-top: -4px; color: var(--muted); font-size: 11.5px; }

.gridmap-page .grid-color-input {
    width: 100%;
    height: 40px;
    padding: 3px;
    border: 1px solid var(--line);
    border-radius: 9px;
    background: var(--surface);
    cursor: pointer;
}

@media (max-width: 768px) {
    .gridmap-page .grid-hint { display: none; }
    .gridmap-page .grid-toolbar-left,
    .gridmap-page .grid-toolbar-right { width: 100%; }
    .gridmap-page .grid-toolbar-right { justify-content: space-between; }
    .gridmap-page .grid-stage { height: 56vh; min-height: 320px; }
    .gridmap-page .grid-block { min-width: 112px; max-width: 170px; padding: 10px 12px; }
    .gridmap-page [data-can-edit="1"] .grid-block { padding-top: 30px; }
    .gridmap-page .grid-drag { height: 22px; }
    .gridmap-page .grid-drag::after { top: 9px; }
}

@media print {
    .gridmap-page .grid-toolbar { display: none !important; }
    .gridmap-page .grid-stage {
        height: auto;
        min-height: 0;
        max-height: none;
        overflow: visible;
        border: 0;
        background: #FFFFFF;
    }
    .gridmap-page .grid-viewport {
        position: relative;
        height: 720px;
        overflow: visible;
        background: #FFFFFF;
    }
    .gridmap-page .grid-canvas { border: 0; background-image: none; }
    .gridmap-page .grid-block { box-shadow: none; }
    .gridmap-page .grid-drag { display: none !important; }
}

/* ==================== 数据大屏 ==================== */
.dashboard-page .dash-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}

.dashboard-page .dash-toolbar-left {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    min-width: 0;
}

.dashboard-page .dash-summary { color: var(--text); font-size: 13px; font-weight: 700; }
.dashboard-page .dash-status { color: var(--muted); font-size: 12px; }
.dashboard-page .dash-status.is-err { color: var(--danger); }
.dashboard-page .dash-hint { font-size: 12px; }

.dashboard-page .dash-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 20px;
}

.dashboard-page .dash-card {
    display: flex;
    flex-direction: column;
    gap: 14px;
    padding: 22px 24px;
    background: var(--surface);
    border: 1px solid #DDDDDD;
    border-radius: 16px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.08);
    transition: box-shadow .2s ease, transform .2s ease, border-color .2s ease;
}

.dashboard-page .dash-card.is-clickable { cursor: pointer; }

.dashboard-page .dash-card.is-clickable:hover {
    border-color: var(--gold-300);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
    transform: translateY(-3px);
}

.dashboard-page .dash-card:focus { outline: none; }

.dashboard-page .dash-card:focus-visible {
    border-color: var(--wine-700);
    box-shadow: 0 0 0 3px rgba(211, 47, 47, .18), 0 4px 12px rgba(0, 0, 0, 0.12);
}

.dashboard-page .dash-card-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
    padding-bottom: 12px;
    border-bottom: 1px solid #EEEEEE;
}

.dashboard-page .dash-head-tools {
    display: flex;
    align-items: center;
    gap: 6px;
    flex: 0 0 auto;
}

.dashboard-page .dash-move {
    display: inline-flex;
    gap: 2px;
}

.dashboard-page .dash-move button {
    width: 24px;
    height: 24px;
    padding: 0;
    border: 1px solid #E6E2DA;
    border-radius: 6px;
    background: #FFFFFF;
    color: #6D6259;
    font-size: 13px;
    line-height: 1;
    cursor: pointer;
}

.dashboard-page .dash-move button:hover:not(:disabled) {
    background: #FFF8E1;
    border-color: #FFC107;
}

.dashboard-page .dash-move button:disabled {
    opacity: .35;
    cursor: default;
}

.dashboard-page .dash-card-title {
    min-width: 0;
    color: #222222;
    font-family: var(--font);
    font-size: 17px;
    font-weight: 700;
    line-height: 1.45;
    word-break: break-word;
}

.dashboard-page .dash-type-tag {
    flex: 0 0 auto;
    padding: 1px 8px;
    color: var(--gold-600);
    font-size: 11.5px;
    font-weight: 600;
    line-height: 1.7;
    white-space: nowrap;
    background: var(--gold-100);
    border: 1px solid #FFE082;
    border-radius: 999px;
}

.dashboard-page .dash-no-data {
    padding: 42px 0;
    color: var(--muted);
    font-size: 13px;
    text-align: center;
}

/* 数字卡片 */
.dashboard-page .dash-card--stat {
    border-color: rgba(183, 28, 28, .22);
}

.dashboard-page .dash-stat {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 200px;
    padding: 18px 14px;
    color: #FFFFFF;
    background:
        radial-gradient(280px 160px at 80% 0%, rgba(255, 193, 7, 0.28), transparent 70%),
        linear-gradient(145deg, #B71C1C 0%, #8E0000 100%);
    border: 1px solid rgba(255, 193, 7, 0.35);
    border-radius: 16px;
    box-shadow: 0 12px 28px rgba(142, 0, 0, 0.22);
}

.dashboard-page .dash-stat-value {
    font-size: 46px;
    font-weight: 700;
    line-height: 1.15;
    letter-spacing: .02em;
    word-break: break-all;
    text-align: center;
}

.dashboard-page .dash-stat-sub {
    color: rgba(255, 255, 255, .82);
    font-size: 14.5px;
    letter-spacing: .08em;
    text-align: center;
    word-break: break-word;
}

/* 柱状图 */
.dashboard-page .dash-bar-chart {
    display: flex;
    align-items: flex-end;
    gap: 10px;
    height: 196px;
    padding-top: 20px;
}

.dashboard-page .dash-bar-item {
    display: flex;
    flex: 1 1 0;
    flex-direction: column;
    justify-content: flex-end;
    align-items: center;
    min-width: 0;
    height: 100%;
}

.dashboard-page .dash-bar-track {
    position: relative;
    display: flex;
    flex: 1 1 auto;
    align-items: flex-end;
    justify-content: center;
    width: 100%;
    min-height: 0;
}

.dashboard-page .dash-bar {
    position: relative;
    width: 100%;
    max-width: 36px;
    min-height: 2px;
    border-radius: 6px 6px 2px 2px;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .28);
    transition: height .45s ease;
}

.dashboard-page .dash-bar-value {
    position: absolute;
    top: -19px;
    left: 50%;
    color: var(--text-2);
    font-size: 11.5px;
    font-weight: 600;
    line-height: 1;
    white-space: nowrap;
    transform: translateX(-50%);
}

.dashboard-page .dash-bar-label {
    flex: 0 0 auto;
    max-width: 100%;
    margin-top: 8px;
    color: var(--text-2);
    font-size: 11.5px;
    line-height: 1.4;
    text-align: center;
    word-break: break-word;
}

/* 饼图 */
.dashboard-page .dash-pie-wrap {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 22px;
    min-height: 196px;
    padding: 10px 0;
    flex-wrap: wrap;
}

.dashboard-page .dash-pie {
    position: relative;
    flex: 0 0 auto;
    width: 148px;
    height: 148px;
    border-radius: 50%;
    box-shadow: 0 4px 14px rgba(0, 0, 0, .12);
}

.dashboard-page .dash-pie--empty { background: var(--line); }

.dashboard-page .dash-pie-hole {
    position: absolute;
    left: 50%;
    top: 50%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 84px;
    height: 84px;
    color: var(--text);
    background: var(--surface);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    box-shadow: 0 0 0 1px var(--line);
}

.dashboard-page .dash-pie-hole strong {
    color: var(--muted);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: .06em;
}

.dashboard-page .dash-pie-hole span {
    font-size: 19px;
    font-weight: 700;
    line-height: 1.3;
}

.dashboard-page .dash-legend {
    display: flex;
    flex: 1 1 150px;
    flex-direction: column;
    gap: 8px;
    min-width: 0;
}

.dashboard-page .dash-legend-item {
    display: flex;
    align-items: flex-start;
    gap: 7px;
}

.dashboard-page .dash-legend-dot {
    flex: 0 0 auto;
    width: 9px;
    height: 9px;
    margin-top: 4px;
    border-radius: 3px;
}

.dashboard-page .dash-legend-text {
    color: var(--text-2);
    font-size: 12px;
    line-height: 1.5;
    word-break: break-word;
}

/* 编辑弹窗数据项 */
.dashboard-page .dash-data-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 260px;
    overflow-y: auto;
}

.dashboard-page .dash-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.dashboard-page .dash-row .dash-label { flex: 1 1 auto; min-width: 0; }
.dashboard-page .dash-row .dash-value { flex: 0 0 116px; width: 116px; }

.dashboard-page .dash-row-del {
    flex: 0 0 auto;
    width: 30px;
    height: 30px;
    color: var(--danger);
    font-family: inherit;
    font-size: 17px;
    line-height: 1;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 7px;
    cursor: pointer;
    transition: background .15s ease, border-color .15s ease;
}

.dashboard-page .dash-row-del:hover { background: #FBEEEC; border-color: #EBC5C1; }

.dashboard-page .dash-add-row { width: 100%; }

.dashboard-page .dash-required { color: var(--danger); }
.dashboard-page .dash-modal-tip { margin-top: 2px; color: var(--muted); font-size: 11.5px; }

.dashboard-page .dash-empty .card { padding: 36px 16px; }

@media (max-width: 768px) {
    .dashboard-page .dash-hint { display: none; }
    .dashboard-page .dash-grid { grid-template-columns: 1fr; gap: 12px; }
    .dashboard-page .dash-card { padding: 14px 15px 16px; gap: 12px; }
    .dashboard-page .dash-stat-value { font-size: 36px; }
    .dashboard-page .dash-bar-chart { height: 168px; gap: 7px; }
    .dashboard-page .dash-bar { max-width: 28px; }
    .dashboard-page .dash-pie-wrap { gap: 16px; }
    .dashboard-page .dash-pie { width: 128px; height: 128px; }
    .dashboard-page .dash-pie-hole { width: 72px; height: 72px; }
    .dashboard-page .dash-legend { flex: 1 1 130px; }
    .dashboard-page .dash-row .dash-value { flex: 0 0 96px; width: 96px; }
}

@media print {
    .dashboard-page .page-actions,
    .dashboard-page .dash-toolbar { display: none !important; }
    .dashboard-page .page-wrap { padding: 0; max-width: none; }
    .dashboard-page .dash-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
    .dashboard-page .dash-card {
        break-inside: avoid;
        box-shadow: none;
        transform: none;
    }
}

/* ==================== 使用说明（对齐离线 manual.html） ==================== */
.manual-wrap {
    max-width: 900px;
    margin: 34px auto 0;
    padding: 34px 40px 40px;
    background: var(--surface);
    border: 1px solid #DDDDDD;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
}

.manual-section {
    margin-bottom: 30px;
    padding-bottom: 24px;
    border-bottom: 1px solid #EEEEEE;
}

.manual-section:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.manual-section h2 {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 16px;
    color: var(--wine-800);
    font-family: var(--font);
    font-size: 20px;
    font-weight: 700;
    letter-spacing: 1px;
}

.manual-section h3 {
    margin: 18px 0 10px;
    padding-left: 12px;
    color: var(--ink-900);
    font-size: 15.5px;
    font-weight: 700;
    border-left: 3px solid var(--gold-500);
}

.manual-section p,
.manual-section li {
    margin-bottom: 10px;
    color: var(--ink-600);
    font-size: 14.5px;
    line-height: 1.85;
}

.manual-section p:last-child,
.manual-section li:last-child { margin-bottom: 0; }

.manual-section ul { padding-left: 22px; list-style: disc; }
.manual-section ol { padding-left: 22px; list-style: decimal; }
.manual-section strong { color: var(--ink-900); }
.manual-section .system-grid { margin-top: 4px; }

@media (max-width: 768px) {
    .manual-wrap {
        margin: 14px 14px 0;
        padding: 20px 16px;
        border-radius: 16px;
    }

    .manual-section h2 { font-size: 17px; }
    .manual-section h3 { font-size: 15px; }
    .manual-section p,
    .manual-section li { font-size: 14px; }
}

/* ==================== 备份与迁移 ==================== */
.backup-page .backup-card { margin-bottom: 20px; padding: 26px 28px; }

.backup-page .backup-card-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 14px;
    flex-wrap: wrap;
    margin-bottom: 12px;
}

.backup-page .backup-card-title {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
    color: var(--wine-800);
    font-family: var(--font);
    font-size: 18px;
    font-weight: 700;
    letter-spacing: 0.5px;
}

.backup-page .backup-card-title::before {
    content: "";
    flex: 0 0 auto;
    width: 3px;
    height: 16px;
    border-radius: 2px;
    background: linear-gradient(180deg, var(--gold-500), var(--wine-700));
}

.backup-page .backup-card-desc {
    max-width: 720px;
    color: var(--ink-600);
    font-size: 13.5px;
    line-height: 1.85;
}

.backup-page .backup-head-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    flex: 0 0 auto;
    padding-top: 2px;
}

.backup-page .backup-check {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--text-2);
    font-size: 12.5px;
    cursor: pointer;
    user-select: none;
}

.backup-page .backup-check input {
    width: 15px;
    height: 15px;
    accent-color: var(--brand);
}

.backup-page .backup-check.is-disabled { opacity: .5; cursor: not-allowed; }

.backup-page .backup-tip {
    margin-bottom: 12px;
    padding: 8px 11px;
    color: var(--warning);
    font-size: 12.5px;
    background: #FFF8E9;
    border: 1px solid #F1E2BE;
    border-radius: var(--radius-sm);
}

.backup-page .backup-status {
    margin-bottom: 10px;
    color: var(--muted);
    font-size: 12px;
    min-height: 18px;
}

.backup-page .backup-status.is-err { color: var(--danger); }

.backup-page .backup-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.backup-page .backup-loading,
.backup-page .backup-empty {
    padding: 26px 12px;
    color: var(--muted);
    font-size: 13px;
    text-align: center;
    background: var(--surface-2);
    border: 1px dashed var(--line);
    border-radius: var(--radius-sm);
}

.backup-page .backup-empty.is-err { color: var(--danger); }

.backup-page .backup-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 11px 14px;
    background: var(--surface-2);
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
}

.backup-page .backup-item-main { min-width: 0; flex: 1 1 auto; }

.backup-page .backup-item-name {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text);
    font-size: 13px;
    font-weight: 600;
    word-break: break-all;
}

.backup-page .backup-scope {
    flex: 0 0 auto;
    padding: 2px 9px;
    font-size: 11.5px;
    font-weight: 600;
    line-height: 1.6;
    border-radius: 999px;
}

.backup-page .backup-scope--manual { color: var(--brand); background: var(--brand-050); border: 1px solid var(--brand-100); }
.backup-page .backup-scope--auto { color: var(--warning); background: #FFF6E6; border: 1px solid #F1E2BE; }

.backup-page .backup-item-meta {
    margin-top: 3px;
    color: var(--muted);
    font-size: 11.5px;
    line-height: 1.6;
    word-break: break-word;
}

.backup-page .backup-item-actions {
    display: flex;
    align-items: center;
    gap: 6px;
    flex: 0 0 auto;
}

.backup-page .backup-missing { color: var(--danger); font-size: 11.5px; }

.backup-page .backup-form {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 14px;
}

.backup-page .backup-file {
    flex: 1 1 260px;
    min-width: 0;
    padding: 7px 9px;
    color: var(--text-2);
    font-size: 12.5px;
    background: var(--surface);
    border: 1px solid var(--line-strong);
    border-radius: var(--radius-sm);
}

.backup-page .backup-file::file-selector-button {
    margin-right: 10px;
    padding: 5px 11px;
    color: var(--brand);
    font-family: inherit;
    font-size: 12.5px;
    font-weight: 600;
    background: var(--brand-050);
    border: 1px solid var(--brand-100);
    border-radius: 6px;
    cursor: pointer;
}

.backup-page .backup-mode {
    flex: 0 0 220px;
    width: 220px;
    height: 38px;
}

.backup-page .backup-panel {
    margin-top: 14px;
    padding: 14px 16px;
    background: var(--surface-2);
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
}

.backup-page .backup-panel-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 18px;
    margin-bottom: 12px;
    color: var(--text-2);
    font-size: 12.5px;
    line-height: 1.7;
}

.backup-page .backup-panel-meta strong { color: var(--text); font-weight: 600; }

.backup-page .backup-counts {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(132px, 1fr));
    gap: 8px;
}

.backup-page .backup-count {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 8px 10px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 7px;
}

.backup-page .backup-count span { color: var(--muted); font-size: 11.5px; }

.backup-page .backup-count strong {
    color: var(--text);
    font-size: 17px;
    font-weight: 700;
    line-height: 1.3;
}

.backup-page .backup-count strong small {
    color: var(--muted);
    font-size: 11px;
    font-weight: 500;
}

.backup-page .backup-warn {
    margin-top: 12px;
    padding: 9px 11px;
    color: var(--warning);
    font-size: 12px;
    line-height: 1.7;
    background: #FFF8E9;
    border: 1px solid #F1E2BE;
    border-radius: 7px;
}

.backup-page .backup-warn-line + .backup-warn-line { margin-top: 4px; }

.backup-page .backup-panel-actions { margin-top: 14px; }

.backup-page .backup-note {
    margin-top: 6px;
    color: var(--muted);
    font-size: 11.5px;
    line-height: 1.8;
}

@media (max-width: 768px) {
    .backup-page .backup-card { padding: 16px 14px; }
    .backup-page .backup-head-actions { width: 100%; justify-content: space-between; }
    .backup-page .backup-item { flex-wrap: wrap; }
    .backup-page .backup-item-actions { width: 100%; justify-content: flex-end; }
    .backup-page .backup-form .backup-file { flex: 1 1 100%; }
    .backup-page .backup-mode { flex: 1 1 100%; width: 100%; }
    .backup-page .backup-form .btn { width: 100%; }
    .backup-page .backup-counts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .backup-page .backup-panel-actions .btn { width: 100%; }
}

/* ==================== 视觉统一（第三轮） ==================== */
:root {
    --dur-fast: 0.12s;
    --dur: 0.18s;
    --dur-slow: 0.26s;
    --ease: cubic-bezier(0.2, 0.7, 0.3, 1);
    --control-hover: #E0C98F;
}

/* ---------- 间距节奏与标题梯度 ---------- */
.page-head { margin-bottom: 20px; }
.page-title { font-size: 21px; line-height: 1.35; letter-spacing: -0.01em; }
.page-desc { margin-top: 6px; line-height: 1.65; }
.card-pad { padding: 20px; }
.section-title { font-size: 16px; }
.section-title::before { height: 16px; }

/* ---------- 表单控件三态 ---------- */
.input,
.select,
.textarea {
    transition: border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease), background var(--dur) var(--ease);
}

.input:hover:not(:disabled):not(:focus),
.select:hover:not(:disabled):not(:focus),
.textarea:hover:not(:disabled):not(:focus) {
    border-color: var(--control-hover);
}

.input:disabled,
.select:disabled,
.textarea:disabled {
    color: var(--muted);
    background: var(--surface-2);
    border-color: var(--line);
    cursor: not-allowed;
}

.input[readonly],
.textarea[readonly] {
    background: var(--surface-2);
}

/* ---------- 表格 hover / active ---------- */
table.data-table tbody tr {
    transition: background var(--dur-fast) ease;
}

table.data-table tbody tr:hover td {
    background: var(--brand-050);
}

table.data-table tbody tr:active td {
    background: var(--brand-100);
}

.table-wrap {
    -webkit-overflow-scrolling: touch;
}

/* ---------- 弹窗 / Toast 动效与阴影统一 ---------- */
.modal-mask,
#custom-dialog-overlay.show {
    animation: mask-in var(--dur) ease both;
}

.modal-box,
#custom-dialog-box {
    animation: modal-in var(--dur-slow) var(--ease) both;
}

.toast {
    border-radius: 12px;
    box-shadow: 0 8px 22px rgba(0, 0, 0, 0.18);
    animation: toast-in var(--dur-slow) var(--ease) both;
}

@keyframes mask-in {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes modal-in {
    from { opacity: 0; transform: translateY(10px) scale(0.985); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

/* ---------- 空态 / 错误态图标与文案 ---------- */
.empty {
    padding: 36px 16px;
    line-height: 1.75;
}

.empty::before {
    content: "";
    display: block;
    width: 42px;
    height: 42px;
    margin: 0 auto 10px;
    background: currentColor;
    opacity: 0.3;
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 13.5V6a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2v7.5'/%3E%3Cpath d='M3 13.5h4.2l1.3 2.6h7l1.3-2.6H21V17a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z'/%3E%3C/svg%3E") center / contain no-repeat;
    mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 13.5V6a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2v7.5'/%3E%3Cpath d='M3 13.5h4.2l1.3 2.6h7l1.3-2.6H21V17a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z'/%3E%3C/svg%3E") center / contain no-repeat;
}

.empty.is-err {
    color: var(--danger);
}

/* 加载占位不显示空态插图，只保留 spinner */
.empty.is-loading::before {
    display: none;
}

.empty.is-err::before {
    background: var(--danger);
    opacity: 0.55;
}

/* 表格内的空态保持紧凑，不显示大图标 */
td.empty {
    padding: 26px 16px;
}

td.empty::before {
    display: none;
}

/* 文档查看弹窗内的空正文不需要插图 */
.doc-view-body .empty {
    padding: 22px 0;
}

.doc-view-body .empty::before {
    display: none;
}

.empty-retry {
    margin-top: 6px;
}

/* ---------- 打印观感 ---------- */
@media print {
    @page {
        margin: 12mm;
    }

    html,
    body {
        background: #FFFFFF;
    }

    body {
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }

    .card {
        border-color: #CCCCCC;
        box-shadow: none;
    }

    table.data-table thead {
        display: table-header-group;
    }

    table.data-table tr {
        page-break-inside: avoid;
        break-inside: avoid;
    }

    table.data-table th,
    table.data-table td {
        white-space: normal;
    }

    .empty::before {
        display: none;
    }
}

/* ---------- 模块工具栏：对齐离线 .toolbar（固定悬浮胶囊） ---------- */
.kanban-toolbar,
.mind-toolbar,
.calendar-page .cal-toolbar,
.timeline-page .tl-toolbar,
.gridmap-page .grid-toolbar {
    position: fixed;
    top: calc(var(--banner-h, 88px) + 6px);
    left: 50%;
    z-index: 1000;
    width: max-content;
    max-width: calc(100vw - 32px);
    padding: 8px;
    gap: 8px;
    background: rgba(255, 255, 255, 0.96);
    border: 1px solid var(--line);
    border-radius: 14px;
    box-shadow: var(--shadow-md);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    transform: translateX(-50%);
}

/* ---------- 表单台账：工具栏胶囊 / 筛选区 / 批量条 / 展开行 ---------- */
.form-page .page-actions {
    padding: 6px 10px;
    background: linear-gradient(180deg, #FFFFFF, #FAFAFA);
    border: 1px solid #E0E0E0;
    border-radius: 999px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, .07), inset 1px 1px 0 #FFF;
}

.form-page #batchBar {
    background: linear-gradient(135deg, #FFF8E1, #FFF3CD);
    border: 1px solid #FFE082;
    border-left: 4px solid var(--gold-500);
}

.form-page .expand-row > td {
    padding: 12px 16px 16px;
    background: #FFF8E1;
    border-bottom: 1px solid #FFE082;
}

.form-page .member-link {
    color: var(--wine-800);
    background: linear-gradient(180deg, #FFFFFF, #F0F0F0);
}

.form-page .member-link:hover {
    border-color: var(--wine-700);
    background: #FFFFFF;
}

.form-page .rel-results {
    border-top: 3px solid var(--gold-500);
}

/* 旧版搜索框 9px 圆角 */
.form-page #recordSearch {
    border-radius: 9px;
}

/* ---------- 移动端：表单台账表格改为卡片（对齐离线 form-module） ---------- */
@media (max-width: 768px) {
    body.form-page .table-wrap {
        background: transparent;
        border: none;
        box-shadow: none;
        overflow: visible;
    }

    body.form-page table.data-table { display: block; width: 100%; min-width: 0; }
    body.form-page table.data-table thead { display: none; }
    body.form-page table.data-table tbody { display: block; width: 100%; }

    body.form-page table.data-table tr {
        position: relative;
        display: block;
        width: 100%;
        margin-bottom: 12px;
        padding: 15px 14px 8px;
        background: #FFFFFF;
        border: 1px solid #DDDDDD;
        border-radius: 14px;
        box-shadow: 0 2px 5px rgba(0, 0, 0, 0.08);
    }

    body.form-page table.data-table tbody tr:hover { background: #FFFFFF; }

    /* 卡片模式下不再整行铺金底，悬停/按下只保留按钮反馈 */
    body.form-page table.data-table tbody tr:hover td,
    body.form-page table.data-table tbody tr:active td { background: transparent; }

    body.form-page table.data-table td {
        display: flex;
        justify-content: space-between;
        gap: 12px;
        width: 100%;
        min-width: 0;
        padding: 7px 0;
        font-size: 14px;
        text-align: right;
        white-space: normal;
        border-bottom: 1px solid #EEEEEE;
        word-break: break-word;
        overflow-wrap: anywhere;
    }

    body.form-page table.data-table td::before {
        content: attr(data-label);
        flex-shrink: 0;
        max-width: 45%;
        color: var(--ink-400);
        font-weight: 400;
        text-align: left;
        overflow-wrap: anywhere;
    }

    /* 勾选框固定在卡片右上角 */
    body.form-page table.data-table td.col-check {
        position: absolute;
        top: 12px;
        right: 12px;
        width: auto;
        padding: 0;
        border: none;
    }

    body.form-page table.data-table td.col-check::before { content: ''; }

    /* 第一个业务字段作为卡片标题 */
    body.form-page table.data-table td:first-child.wrap,
    body.form-page table.data-table td.col-check + td.wrap {
        padding: 0 30px 10px 0;
        color: var(--ink-900);
        font-size: 16px;
        font-weight: 700;
        text-align: left;
        border-bottom: 1px solid #EEEEEE;
    }

    body.form-page table.data-table td:first-child.wrap::before,
    body.form-page table.data-table td.col-check + td.wrap::before { display: none; }

    body.form-page table.data-table td.col-actions {
        justify-content: flex-end;
        gap: 8px;
        margin-top: 6px;
        padding-top: 10px;
        border-bottom: none;
        border-top: 1px dashed #DDDDDD;
    }

    body.form-page table.data-table td.col-actions::before { content: ''; }

    body.form-page table.data-table td.col-actions .btn {
        flex: 1;
        padding: 9px 8px;
        font-size: 13.5px;
    }

    /* 空态/加载态 */
    body.form-page table.data-table td.empty {
        display: block;
        padding: 24px 8px;
        text-align: center;
        border-bottom: none;
    }

    body.form-page table.data-table td.empty::before { display: none; }

    /* 展开的成员行 */
    body.form-page table.data-table tr.expand-row {
        margin-top: -6px;
        padding: 0;
        background: transparent;
        border: none;
        box-shadow: none;
    }

    body.form-page table.data-table tr.expand-row > td {
        display: block;
        padding: 12px 16px 16px;
        text-align: left;
        background: #FFF8E1;
        border: none;
        border-radius: 0 0 14px 14px;
    }
}

/* ---------- 移动端：项目管理表格改为卡片（对齐离线 project-manage 列表） ---------- */
@media (max-width: 768px) {
    .project-page .table-wrap {
        background: transparent;
        border: none;
        box-shadow: none;
        overflow: visible;
    }

    .project-page table.data-table { display: block; width: 100%; min-width: 0; }
    .project-page table.data-table thead { display: none; }
    .project-page table.data-table tbody { display: block; width: 100%; }

    .project-page table.data-table tr {
        position: relative;
        display: block;
        width: 100%;
        margin-bottom: 12px;
        padding: 14px 14px 10px 44px;
        background: #FFFFFF;
        border: 1px solid #DDDDDD;
        border-radius: 14px;
        box-shadow: 0 2px 5px rgba(0, 0, 0, 0.08);
    }

    .project-page table.data-table tbody tr:hover td { background: transparent; }

    .project-page table.data-table td {
        display: flex;
        justify-content: space-between;
        gap: 12px;
        width: 100%;
        min-width: 0;
        padding: 7px 0;
        font-size: 14px;
        text-align: right;
        white-space: normal;
        border-bottom: 1px solid #EEEEEE;
        word-break: break-word;
        overflow-wrap: anywhere;
    }

    .project-page table.data-table td::before {
        content: attr(data-label);
        flex-shrink: 0;
        color: var(--ink-400);
        font-weight: 400;
        text-align: left;
    }

    .project-page table.data-table td.drag-cell {
        position: absolute;
        top: 12px;
        left: 8px;
        width: auto;
        padding: 0;
        border: none;
    }

    .project-page table.data-table td.drag-cell::before { content: ''; }

    /* 卡片名称作为卡片标题 */
    .project-page table.data-table td:nth-child(3) {
        padding: 0 0 10px;
        color: var(--ink-900);
        font-size: 16px;
        font-weight: 700;
        text-align: left;
    }

    .project-page table.data-table td:nth-child(3)::before { display: none; }

    .project-page table.data-table td:last-child {
        justify-content: flex-end;
        gap: 8px;
        margin-top: 4px;
        padding-top: 10px;
        border-bottom: none;
        border-top: 1px dashed #DDDDDD;
    }

    .project-page table.data-table td:last-child::before { content: ''; }

    .project-page table.data-table td:nth-child(5) .btn,
    .project-page table.data-table td:last-child .btn {
        flex: 1;
        padding: 8px 6px;
        font-size: 13.5px;
    }
}

/* ---------- 移动端触控与间距 ---------- */
@media (max-width: 768px) {
    .page-title { font-size: 18px; }
    .card-pad { padding: 16px 14px; }
    .section-title { margin: 20px 0 12px; }
    .btn { height: 40px; }
    .btn-sm { height: 34px; padding: 0 12px; }
    .modal-close { width: 36px; height: 36px; }
    .empty { padding: 32px 14px; }
    td.empty { padding: 24px 14px; }
    .kanban-toolbar,
    .mind-toolbar,
    .calendar-page .cal-toolbar,
    .timeline-page .tl-toolbar,
    .gridmap-page .grid-toolbar,
    .form-page .page-actions { border-radius: 14px; padding: 10px 12px; }
    .form-page .tabs { border-radius: 14px; }
}

/* ---------- 降低动态效果偏好 ---------- */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.001ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.001ms !important;
    }
}

/* ==================== 页面横幅（对齐离线 .header-banner） ==================== */
.page-banner {
    position: relative;
    padding: 20px;
    color: #FFFFFF;
    text-align: center;
    font-family: var(--font);
    font-size: 32px;
    font-weight: bold;
    letter-spacing: 4px;
    line-height: 1.35;
    overflow-wrap: anywhere;
    background: linear-gradient(to bottom, #D32F2F, #B71C1C);
    border-bottom: 5px solid #FFC107;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

/* 顶栏移除后：左侧首页入口、右侧返回入口 */
.page-home {
    position: absolute;
    top: 50%;
    left: 18px;
    right: auto;
    transform: translateY(-50%);
    min-height: 42px;
    padding: 9px 18px;
    font-size: 15px;
    gap: 5px;
    border-radius: 8px;
}

.page-home svg {
    width: 20px;
    height: 20px;
}

.page-home:active {
    background: rgba(255, 255, 255, 0.32);
}

/* 顶栏移除后，返回入口收进页面横幅右侧 */
.page-back {
    position: absolute;
    top: 50%;
    right: 18px;
    left: auto;
    transform: translateY(-50%);
    min-height: 42px;
    padding: 9px 18px;
    font-size: 15px;
    gap: 5px;
    border-radius: 8px;
}

.page-back svg {
    width: 20px;
    height: 20px;
}

.page-back:active {
    background: rgba(255, 255, 255, 0.32);
}

.page-banner-title {
    display: block;
    max-width: 100%;
    padding: 0 108px;
}

@media (max-width: 768px) {
    .page-banner {
        padding: 12px 10px;
        font-size: 22px;
        letter-spacing: 2px;
    }

    .page-back {
        right: 10px;
        left: auto;
        min-height: 44px;
        padding: 10px 14px;
        font-size: 14px;
        border-radius: 10px;
    }

    .page-home {
        left: 10px;
        right: auto;
        min-height: 44px;
        padding: 10px 14px;
        font-size: 14px;
        border-radius: 10px;
    }

    .page-home svg {
        display: inline-block;
        width: 18px;
        height: 18px;
    }

    .page-back svg {
        display: inline-block;
        width: 18px;
        height: 18px;
    }

    .page-banner-title {
        padding: 0 78px;
    }
}

@media (max-width: 380px) {
    .page-banner {
        font-size: 19px;
        letter-spacing: 1px;
    }

    .page-back {
        right: 8px;
        padding: 9px 11px;
        font-size: 13px;
    }

    .page-home {
        left: 8px;
        padding: 9px 11px;
        font-size: 13px;
    }

    .page-banner-title {
        padding: 0 70px;
    }
}

/* ==================== 系统中心入口网格（对齐离线 .config-grid） ==================== */
.config-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 16px;
}

.config-card {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    height: 160px;
    padding: 20px;
    overflow: hidden;
    color: #FFFFFF;
    font-family: var(--font);
    font-size: 22px;
    font-weight: bold;
    letter-spacing: 1px;
    background: linear-gradient(145deg, var(--accent, #D32F2F), var(--accent, #D32F2F));
    border: none;
    border-radius: 12px;
    box-shadow: 0 6px 0 rgba(0, 0, 0, 0.15), 0 10px 15px rgba(0, 0, 0, 0.25);
    text-shadow: 1px 2px 4px rgba(0, 0, 0, 0.5);
    cursor: pointer;
    transition: transform 0.08s ease, box-shadow 0.08s ease;
}

.config-card::after {
    content: "→";
    position: absolute;
    right: 18px;
    bottom: 14px;
    color: #FFFFFF;
    font-size: 15px;
    opacity: 0.7;
}

.config-card:hover {
    transform: scale(1.04);
    box-shadow: 0 7px 0 rgba(0, 0, 0, 0.15), 0 12px 18px rgba(0, 0, 0, 0.28);
}

.config-card:active {
    transform: scale(0.98) translateY(3px);
    box-shadow: 0 3px 0 rgba(0, 0, 0, 0.15), 0 5px 9px rgba(0, 0, 0, 0.22);
}

.config-card .icon {
    font-size: 48px;
    line-height: 1;
    filter: drop-shadow(2px 2px 4px rgba(0, 0, 0, 0.3));
}

.config-card .card-label {
    position: relative;
    z-index: 1;
    text-align: center;
}

@media (max-width: 1100px) {
    .config-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 768px) {
    .config-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 11px; }
    .config-card { height: 120px; padding: 14px; gap: 8px; font-size: 18px; border-radius: 12px; }
    .config-card .icon { font-size: 36px; }
    .config-card::after { right: 12px; bottom: 10px; font-size: 13px; }
}

/* ==================== 数据维护与拖拽排序 ==================== */
.backup-list-title {
    margin: 10px 0 6px;
    color: var(--ink-600);
    font-size: 12px;
    font-weight: bold;
}

.orphan-files {
    max-height: 220px;
    margin: 0;
    padding: 10px 12px;
    overflow: auto;
    color: var(--ink-700);
    font-size: 12px;
    background: var(--gold-100);
    border: 1px solid var(--line);
    border-radius: 8px;
    list-style: none;
}

.orphan-files li {
    padding: 3px 0;
    overflow-wrap: anywhere;
}

.drag-cell {
    width: 30px;
    color: var(--ink-400);
    text-align: center;
}

.drag-handle {
    display: inline-block;
    color: var(--ink-400);
    font-size: 16px;
    letter-spacing: -2px;
    cursor: grab;
    user-select: none;
}

.drag-handle:active {
    cursor: grabbing;
}

#projectTable tbody tr[draggable="true"] {
    cursor: grab;
}

#projectTable tbody tr.dragging {
    opacity: 0.45;
    background: var(--gold-100);
}

.kanban-col-head[draggable="true"] {
    cursor: grab;
}

.kanban-column.col-dragging {
    opacity: 0.5;
}

/* ==================== 模块页全屏工作区（对齐离线模块页布局） ==================== */
body.document-page,
body.form-page,
body.picture-page,
body.mindmap-page,
body.dashboard-page,
body.kanban-page,
body.timeline-page,
body.gridmap-page,
body.calendar-page {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

body.document-page .page-wrap,
body.form-page .page-wrap,
body.picture-page .page-wrap,
body.mindmap-page .page-wrap,
body.dashboard-page .page-wrap,
body.kanban-page .page-wrap,
body.timeline-page .page-wrap,
body.gridmap-page .page-wrap,
body.calendar-page .page-wrap {
    flex: 1 1 auto;
    width: 100%;
    max-width: none;
    min-width: 0;
    margin: 0;
    /* 与系统中心等页面统一：顶部 20px、左右 32px、底部 32px */
    padding: 20px 32px 32px;
    display: flex;
    flex-direction: column;
}

/* 固定悬浮工具条脱离文档流，为页头预留高度 */
body.kanban-page .page-wrap,
body.mindmap-page .page-wrap,
body.calendar-page .page-wrap,
body.timeline-page .page-wrap,
body.gridmap-page .page-wrap {
    padding-top: 72px;
}

/* 页头工具栏：滚动时固定在视口顶部（顶栏已移除） */
body.document-page .page-head,
body.form-page .page-head,
body.picture-page .page-head,
body.mindmap-page .page-head,
body.dashboard-page .page-head,
body.kanban-page .page-head,
body.timeline-page .page-head,
body.gridmap-page .page-head,
body.calendar-page .page-head {
    position: sticky;
    top: 0;
    z-index: 150;
    align-items: center;
    margin: 0 0 12px;
    padding: 10px 16px;
    background: rgba(255, 255, 255, 0.96);
    border: 1px solid var(--line);
    border-radius: 14px;
    box-shadow: var(--shadow-md);
    backdrop-filter: blur(3px);
}

/* 有固定悬浮工具条的模块：页头不再吸顶，避免与工具条重叠 */
body.kanban-page .page-head,
body.mindmap-page .page-head,
body.calendar-page .page-head,
body.timeline-page .page-head,
body.gridmap-page .page-head {
    position: static;
}

body.document-page .page-title,
body.form-page .page-title,
body.picture-page .page-title,
body.mindmap-page .page-title,
body.dashboard-page .page-title,
body.kanban-page .page-title,
body.timeline-page .page-title,
body.gridmap-page .page-title,
body.calendar-page .page-title {
    font-size: 18px;
}

/* 内容区占满剩余视口，长内容在区域内部滚动 */
body.form-page .table-wrap {
    flex: 1 1 auto;
    min-height: 240px;
    overflow: auto;
}

body.form-page .pager {
    flex: 0 0 auto;
    margin: 12px 0 0;
}

body.picture-page #albumView,
body.picture-page #photoView {
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
}

body.picture-page #albumView[hidden],
body.picture-page #photoView[hidden] {
    display: none;
}

body.picture-page .album-grid,
body.picture-page .photo-grid {
    flex: 1 1 auto;
    min-height: 0;
    overflow: auto;
    align-content: start;
}

body.document-page .doc-list {
    flex: 0 0 auto;
}

body.document-page .doc-editor {
    flex: 1 1 auto;
    min-height: 0;
}

body.document-page .doc-editor-box,
body.document-page .doc-view-box {
    max-width: none;
}

body.dashboard-page .dash-grid {
    flex: 1 1 auto;
    min-height: 0;
    overflow: auto;
    align-content: start;
}

body.kanban-page .kanban-board {
    flex: 1 1 auto;
    min-height: 0;
    overflow: auto;
}

body.mindmap-page .mind-stage {
    flex: 1 1 auto;
    min-height: 0;
}

body.mindmap-page .mind-viewport {
    height: auto;
    min-height: 320px;
    max-height: none;
}

body.gridmap-page .grid-stage {
    flex: 1 1 auto;
    height: auto;
    min-height: 320px;
    max-height: none;
}

body.timeline-page .tl-list {
    flex: 1 1 auto;
    min-height: 0;
    overflow: auto;
}

body.calendar-page .cal-board {
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
}

body.calendar-page .cal-grid {
    flex: 1 1 auto;
    grid-auto-rows: minmax(96px, 1fr);
}

@media (max-width: 768px) {
    body.document-page .page-wrap,
    body.form-page .page-wrap,
    body.picture-page .page-wrap,
    body.mindmap-page .page-wrap,
    body.dashboard-page .page-wrap,
    body.kanban-page .page-wrap,
    body.timeline-page .page-wrap,
    body.gridmap-page .page-wrap,
    body.calendar-page .page-wrap {
        padding: 14px 12px calc(20px + env(safe-area-inset-bottom));
    }

    body.document-page .page-head,
    body.form-page .page-head,
    body.picture-page .page-head,
    body.mindmap-page .page-head,
    body.dashboard-page .page-head,
    body.kanban-page .page-head,
    body.timeline-page .page-head,
    body.gridmap-page .page-head,
    body.calendar-page .page-head {
        position: static;
        padding: 10px 12px;
    }
}

/* 移动端：模块工具条回到吸顶全宽（对齐离线 .toolbar 移动端） */
@media (max-width: 768px) {
    .kanban-toolbar,
    .mind-toolbar,
    .calendar-page .cal-toolbar,
    .timeline-page .tl-toolbar,
    .gridmap-page .grid-toolbar {
        position: sticky;
        top: 0;
        left: auto;
        width: 100%;
        max-width: none;
        padding: 7px 10px;
        gap: 6px;
        border-radius: 0 0 12px 12px;
        transform: none;
    }
}

/* 手机端小字号统一为 12px（放在文件末尾，覆盖各模块的 11/11.5px） */
@media (max-width: 768px) {
    .tag,
    .doc-item-meta,
    .kanban-card-foot,
    .kanban-col-count,
    .album-count,
    .photo-cover-tag,
    .dashboard-page .dash-type-tag,
    .cal-weekdays span,
    .mind-zoom-badge,
    .backup-page .backup-scope,
    .backup-page .backup-item-meta,
    .backup-page .backup-note,
    .backup-page .backup-missing,
    .backup-page .backup-count span,
    .calendar-page .cal-modal-tip,
    .timeline-page .tl-modal-tip,
    .gridmap-page .grid-modal-tip,
    .gridmap-page .grid-block-phone,
    .dashboard-page .dash-modal-tip,
    .auth-page .text-muted,
    .system-link .desc,
    .mind-node-label {
        font-size: 12px;
    }
}

/* 手机端通用卡片表格：成员、日志、账号等宽表改为竖排卡片，避免横向滚动 */
@media (max-width: 768px) {
    .card-wrap {
        overflow: visible;
        border: 0;
        background: transparent;
        box-shadow: none;
        padding: 0;
        border-radius: 0;
    }

    table.card-table {
        display: block;
        width: 100%;
        min-width: 0;
        border: 0;
        background: transparent;
        border-collapse: separate;
    }

    table.card-table thead {
        display: none;
    }

    table.card-table tbody {
        display: block;
        width: 100%;
    }

    table.card-table tbody tr {
        display: block;
        margin: 0 0 10px;
        padding: 6px 12px;
        background: #FFFFFF;
        border: 1px solid var(--line, #E6E2DA);
        border-radius: 12px;
        box-shadow: 0 2px 6px rgba(0, 0, 0, .05);
    }

    table.card-table tbody tr:hover,
    table.card-table tbody tr:active {
        background: #FFFFFF;
        transform: none;
    }

    table.card-table td {
        display: flex;
        align-items: flex-start;
        justify-content: space-between;
        gap: 10px;
        width: auto;
        max-width: none !important;
        padding: 7px 0;
        border: 0;
        border-bottom: 1px dashed #F0ECE4;
        text-align: right;
        white-space: normal;
        word-break: break-word;
        font-size: 13.5px;
        line-height: 1.6;
    }

    table.card-table tr td:last-child {
        border-bottom: 0;
    }

    table.card-table td::before {
        content: attr(data-label);
        flex: 0 0 auto;
        max-width: 42%;
        color: #7A7268;
        font-weight: 600;
        text-align: left;
        white-space: nowrap;
    }

    table.card-table td:not([data-label])::before {
        content: '';
        display: none;
    }

    table.card-table td.nowrap {
        white-space: normal;
    }

    table.card-table td[data-label="操作"] {
        justify-content: flex-end;
        flex-wrap: wrap;
        gap: 8px;
        padding-top: 9px;
    }

    table.card-table td[data-label="操作"]::before {
        margin-right: auto;
    }

    table.card-table td.empty {
        display: block;
        border-bottom: 0;
        text-align: center;
        color: #8A8178;
        padding: 18px 0;
    }

    table.card-table td.empty::before {
        display: none;
    }
}


/* ==================== 网格事件 ==================== */
.grid-event-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.grid-event-row {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    padding: 12px 14px;
    background: #FFFFFF;
    border: 1px solid #EEEEEE;
    border-left: 4px solid #B71C1C;
    border-radius: 10px;
}

.grid-event-main {
    flex: 1 1 auto;
    min-width: 0;
}

.grid-event-title {
    font-size: 14px;
    font-weight: 700;
    color: #333333;
    line-height: 1.5;
    word-break: break-word;
}

.grid-event-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 4px 14px;
    margin-top: 5px;
    color: #6E6E6E;
    font-size: 12px;
}

.grid-event-note {
    margin-top: 6px;
    color: #555555;
    font-size: 12.5px;
    line-height: 1.6;
    word-break: break-word;
}

.grid-event-side {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 8px;
    flex: 0 0 auto;
}

.grid-event-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    justify-content: flex-end;
}

@media (max-width: 640px) {
    .grid-event-row {
        flex-direction: column;
    }

    .grid-event-side {
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
        width: 100%;
    }

    .grid-event-actions {
        justify-content: flex-end;
    }
}

.fv-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 9px 10px;
    border-bottom: 1px solid var(--line);
}

.fv-row:last-child { border-bottom: 0; }

.fv-main { flex: 1; min-width: 0; }
.fv-name { color: var(--ink-700); font-size: 13px; }
.fv-meta { color: var(--muted); font-size: 11.5px; }

.fv-actions {
    display: flex;
    flex: 0 0 auto;
    gap: 6px;
}

.fv-upload {
    margin-top: 14px;
    padding-top: 12px;
    border-top: 1px dashed var(--line-strong);
}

@media (max-width: 640px) {
    .fv-row {
        align-items: flex-start;
        flex-wrap: wrap;
    }

    .fv-actions {
        width: 100%;
        justify-content: flex-end;
    }

    .home-search-bar {
        flex-wrap: wrap;
    }

    .home-search-bar .input {
        flex: 1 1 100%;
    }

    .home-todo-item {
        align-items: flex-start;
        flex-wrap: wrap;
    }

    .home-todo-main {
        flex: 1 1 calc(100% - 70px);
    }

    .home-todo-due {
        width: 100%;
        padding-left: 2px;
    }
}
