/* ============================================================
   翼家?· Nothing-inspired 白紫干净?   基于 person_dashboard Design Token 系统
   点缀色只有紫?(#7C3AED)，白为主，点阵母?+ 技术标?   ============================================================ */

/* ===== Design Tokens ===== */
:root {
    color-scheme: light;

    /* 基础?*/
    --paper: #fafafa;
    --surface: #ffffff;
    --surface-sunken: #f4f4f5;
    --ink: #0a0a0a;
    --ink-soft: #52525b;
    --ink-faint: #a1a1aa;
    --line: #ececee;
    --line-strong: #dcdce0;

    /* 点缀?- 紫色 */
    --accent: #7c3aed;
    --accent-strong: #6d28d9;
    --accent-soft: #a78bfa;
    --accent-wash: #f3effe;
    --accent-glow: rgba(124, 58, 237, 0.16);

    /* 语义?*/
    --ok: #16a34a;
    --ok-wash: #f0fdf4;
    --warn: #d97706;
    --warn-wash: #fffbeb;
    --danger: #dc2626;
    --danger-wash: #fef2f2;

    /* 字体 */
    --font-display: "Space Grotesk", "Noto Serif SC", system-ui, sans-serif;
    --font-body: "Noto Sans SC", system-ui, -apple-system, sans-serif;
    --font-mono: "JetBrains Mono", ui-monospace, "SFMono-Regular", monospace;

    /* 圆角 */
    --r-sm: 8px;
    --r-md: 14px;
    --r-lg: 22px;
    --r-pill: 999px;

    /* 阴影 */
    --shadow-sm: 0 1px 2px rgba(10, 10, 10, 0.04);
    --shadow-md: 0 8px 30px rgba(10, 10, 10, 0.06);
    --shadow-lg: 0 24px 60px rgba(10, 10, 10, 0.09);
    --shadow-accent: 0 12px 34px var(--accent-glow);

    /* 布局 */
    --sidebar-w: 244px;
    --ease: cubic-bezier(0.22, 1, 0.36, 1);

    /* 兼容旧变量名 */
    --primary: var(--accent);
    --primary-light: var(--accent);
    --primary-dark: var(--accent-strong);
    --bg: var(--paper);
    --card-bg: var(--surface);
    --text: var(--ink);
    --text-light: var(--ink-soft);
    --border: var(--line);
    --shadow: var(--shadow-sm);
    --shadow-hover: var(--shadow-md);
    --radius: var(--r-md);
}

/* ===== Reset ===== */
* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: var(--font-body);
    background: var(--paper);
    color: var(--ink);
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
    overflow-x: hidden;
}

/* dotted-matrix backdrop, extremely subtle */
body::before {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    background-image: radial-gradient(var(--line-strong) 1px, transparent 1px);
    background-size: 26px 26px;
    opacity: 0.35;
    mask-image: radial-gradient(circle at 70% 10%, #000 0%, transparent 60%);
    -webkit-mask-image: radial-gradient(circle at 70% 10%, #000 0%, transparent 60%);
}

a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }

:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
    border-radius: 4px;
}

::selection {
    background: var(--accent-soft);
    color: #fff;
}

h1, h2, h3 {
    font-family: var(--font-display);
    font-weight: 700;
    letter-spacing: -0.02em;
    margin: 0;
}

/* Utility classes */
.eyebrow {
    font-family: var(--font-mono);
    font-size: 11px;
    font-weight: 500;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: var(--accent);
    display: inline-flex;
    align-items: center;
    gap: 8px;
}
.eyebrow::before {
    content: "//";
    color: var(--accent-soft);
}
.mono {
    font-family: var(--font-mono);
    font-variant-numeric: tabular-nums;
}

/* ===== 登录?===== */
.login-wrapper {
    position: relative;
    z-index: 1;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--paper);
    padding: 40px 20px;
    flex-direction: column;
}
.login-form-inner {
    width: 100%;
    max-width: 360px;
}
.login-brand-name {
    font-size: 32px;
    font-weight: 700;
    color: var(--ink);
    letter-spacing: -0.02em;
    margin-bottom: 6px;
}
.login-brand-tagline {
    font-size: 14px;
    color: var(--ink-faint);
    margin-bottom: 0;
}
.login-brand-sep {
    width: 24px;
    height: 2px;
    background: var(--accent);
    border-radius: 1px;
    margin: 28px 0;
}
.login-form-header h2 {
    font-size: 20px;
    font-weight: 600;
    color: var(--ink);
    margin-bottom: 4px;
}
.login-form-header p {
    font-size: 14px;
    color: var(--ink-faint);
    margin-bottom: 32px;
}
/* 浮动标签输入?*/
.form-field {
    position: relative;
    margin-bottom: 28px;
}
.form-field input {
    width: 100%;
    padding: 20px 0 8px;
    border: none;
    border-bottom: 1px solid var(--line-strong);
    font-size: 15px;
    font-family: inherit;
    color: var(--ink);
    background: transparent;
    transition: border-color 0.2s var(--ease);
    outline: none;
    box-sizing: border-box;
}
.form-field input:focus {
    border-bottom-color: var(--accent);
}
.form-field label {
    position: absolute;
    left: 0;
    top: 20px;
    font-size: 14px;
    color: var(--ink-faint);
    transition: all 0.2s var(--ease);
    pointer-events: none;
}
.form-field input:focus + label,
.form-field input:not(:placeholder-shown) + label {
    top: 2px;
    font-size: 11px;
    color: var(--accent);
    letter-spacing: 0.02em;
}
.form-error {
    color: var(--danger);
    font-size: 13px;
    margin-bottom: 16px;
}
.login-form-inner .btn-primary {
    width: 100%;
    padding: 14px;
    background: var(--accent);
    color: #fff;
    border: none;
    border-radius: var(--r-sm);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s var(--ease);
    font-family: inherit;
    letter-spacing: 0.02em;
}
.login-form-inner .btn-primary:hover { background: var(--accent-strong); }
.login-footer {
    text-align: center;
    margin-top: 24px;
    font-size: 13px;
    color: var(--ink-faint);
}
.login-footer a {
    color: var(--ink);
    cursor: pointer;
    font-weight: 600;
    text-decoration: none;
}
.login-footer a:hover { color: var(--accent); }
.login-demo {
    margin-top: 20px;
    font-size: 12px;
    color: var(--ink-faint);
    text-align: center;
}
.login-demo code {
    background: var(--surface-sunken);
    padding: 2px 6px;
    border-radius: 4px;
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--ink-soft);
}
.login-back {
    text-align: center;
    margin-top: 32px;
}
.login-back a {
    font-size: 13px;
    color: var(--ink-faint);
    cursor: pointer;
    text-decoration: none;
}
.login-back a:hover { color: var(--ink-soft); }
.login-page-footer {
    position: absolute;
    bottom: 24px;
    font-size: 11px;
    color: var(--ink-faint);
    letter-spacing: 0.04em;
}
/* 登录页响应式 */
@media (max-width: 860px) {
    .login-form-inner { max-width: 100%; }
}

/* ===== 主布局 ===== */
.app-layout { display: flex; min-height: 100vh; position: relative; z-index: 1; }

/* ===== 侧边?===== */
.sidebar {
    width: var(--sidebar-w);
    background: var(--surface);
    border-right: 1px solid var(--line);
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
    z-index: 100;
    padding: 26px 18px 22px;
    justify-content: space-between;
}
.sidebar-logo {
    padding: 0 8px 4px;
    display: flex;
    align-items: center;
    gap: 10px;
}
.sidebar-logo .icon {
    width: 36px; height: 36px;
    background: var(--accent-wash);
    border: 1px solid var(--accent-soft);
    border-radius: var(--r-sm);
    display: flex; align-items: center; justify-content: center;
    font-size: 18px;
}
.sidebar-logo h2 {
    font-size: 17px;
    font-weight: 700;
    color: var(--ink);
    letter-spacing: -0.025em;
}
.sidebar-nav {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
    margin-top: 12px;
    overflow-y: auto;
    min-height: 0;
}
.nav-group {
    margin-bottom: 8px;
}
.nav-group-label {
    font-size: 11px;
    font-weight: 600;
    color: #a1a1aa;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 8px 12px 4px;
}
.sidebar-nav .nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: var(--r-md);
    color: var(--ink-soft);
    cursor: pointer;
    transition: background 0.16s var(--ease), color 0.16s var(--ease);
    font-size: 14px;
    font-weight: 500;
    position: relative;
}
.sidebar-nav .nav-item:hover {
    background: var(--surface-sunken);
    color: var(--ink);
}
.sidebar-nav .nav-item.active {
    background: var(--accent-wash);
    color: var(--accent-strong);
}
.sidebar-nav .nav-item.active::before {
    content: "";
    position: absolute;
    left: -18px;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 20px;
    border-radius: 0 3px 3px 0;
    background: var(--accent);
}
.sidebar-nav .nav-item .nav-icon { font-size: 18px; width: 20px; text-align: center; }

/* 子菜单项 */
.nav-sub-items {
    margin-left: 12px;
    border-left: 2px solid var(--line-soft);
    padding-left: 0;
}
.sidebar-nav .nav-sub-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 7px 12px 7px 16px;
    border-radius: 0 var(--r-md) var(--r-md) 0;
    color: var(--ink-faint);
    cursor: pointer;
    transition: all 0.16s var(--ease);
    font-size: 13px;
    font-weight: 500;
    position: relative;
}
.sidebar-nav .nav-sub-item:hover {
    background: var(--surface-sunken);
    color: var(--ink-soft);
}
.sidebar-nav .nav-sub-item.active {
    background: var(--accent-wash);
    color: var(--accent-strong);
    font-weight: 600;
}
.sidebar-nav .nav-sub-item.active::before {
    content: "";
    position: absolute;
    left: -2px;
    top: 50%;
    transform: translateY(-50%);
    width: 2px;
    height: 16px;
    background: var(--accent);
}
.sidebar-nav .nav-sub-item .nav-icon { font-size: 15px; width: 18px; text-align: center; }
.sidebar-footer {
    border-top: 1px solid var(--line);
    padding-top: 14px;
    font-size: 13px;
    color: var(--ink-soft);
}
.sidebar-footer a {
    color: var(--ink-soft);
    cursor: pointer;
    transition: color 0.15s var(--ease);
    font-weight: 500;
}
.sidebar-footer a:hover { color: var(--danger); }

/* ===== 主内容区 ===== */
.main-content {
    flex: 1;
    margin-left: var(--sidebar-w);
    width: calc(100vw - var(--sidebar-w));
    padding: 40px clamp(24px, 4vw, 56px) 96px;
    min-height: 100vh;
    box-sizing: border-box;
}
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 24px;
    max-width: 100%;
    overflow-x: auto;
    margin-bottom: 34px;
}
.page-header h1 {
    font-size: clamp(28px, 3.5vw, 36px);
    font-weight: 700;
    color: var(--ink);
    letter-spacing: -0.03em;
}
.page-header .header-actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }

/* ===== 卡片/面板 ===== */
.card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--r-lg);
    padding: 24px;
    box-shadow: var(--shadow-sm);
    margin-bottom: 20px;
    transition: border-color 0.2s var(--ease), box-shadow 0.2s var(--ease);
    max-width: 100%;
    overflow-x: auto;
    box-sizing: border-box;
}
.card:hover {
    border-color: var(--line-strong);
}
.card-title {
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* ===== 统计卡片 ===== */
.stat-grid-7 {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 0;
}
.stat-grid-7 .stat-card {
    min-width: 0;
}
.stat-card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--r-md);
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 14px;
    box-shadow: var(--shadow-sm);
    transition: transform 0.2s var(--ease), box-shadow 0.2s var(--ease), border-color 0.2s var(--ease);
}
.stat-card.clickable { cursor: pointer; }
.stat-card.clickable:hover {
    transform: translateY(-3px);
    border-color: var(--accent-soft);
    box-shadow: var(--shadow-accent);
}
.stat-card:hover { border-color: var(--accent-soft); box-shadow: var(--shadow-md); }
.stat-card .stat-icon {
    width: 44px; height: 44px;
    border-radius: var(--r-sm);
    display: flex; align-items: center; justify-content: center;
    font-size: 22px;
    flex-shrink: 0;
}
.stat-card .stat-info { overflow: hidden; min-width: 0; }
.stat-card .stat-info h3 {
    font-family: var(--font-display);
    font-size: 28px;
    font-weight: 700;
    color: var(--ink);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-variant-numeric: tabular-nums;
    letter-spacing: -0.03em;
}
.stat-card .stat-info p {
    font-size: 13px;
    color: var(--ink-soft);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ===== 证件到期时间?===== */
.timeline-scroll {
    overflow-x: auto;
    padding: 20px 0 8px;
}
.timeline-track {
    display: flex;
    gap: 0;
    min-width: max-content;
    padding-bottom: 10px;
}
.timeline-node {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    cursor: pointer;
    padding: 0 8px;
    width: 150px;
    min-width: 150px;
    flex-shrink: 0;
}
.timeline-dot {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: var(--accent);
    border: 3px solid var(--surface);
    box-shadow: 0 0 0 2px var(--accent);
    z-index: 2;
    transition: transform 0.2s var(--ease);
}
.timeline-node:hover .timeline-dot {
    transform: scale(1.3);
}
.timeline-line {
    position: absolute;
    top: 7px;
    left: calc(50% + 7px);
    right: calc(-50% + 7px);
    height: 2px;
    background: var(--line-strong);
    z-index: 1;
}
.timeline-card-mini {
    margin-top: 16px;
    padding: 12px 14px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--r-md);
    text-align: center;
    transition: all 0.25s var(--ease);
    width: 100%;
    box-sizing: border-box;
}
.timeline-node:hover .timeline-card-mini {
    border-color: var(--accent-soft);
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}
.timeline-icon {
    font-size: 22px;
    margin-bottom: 6px;
}
.timeline-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--ink);
    line-height: 1.4;
    margin-bottom: 4px;
    word-break: break-word;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}
.timeline-date {
    font-size: 12px;
    color: var(--ink-soft);
    font-family: var(--font-mono);
    margin-bottom: 6px;
}
.timeline-days {
    font-size: 11px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: var(--r-pill);
}
.timeline-days-normal { background: var(--accent-wash); color: var(--accent); }
.timeline-days-warn { background: var(--warn-wash); color: var(--warn); }
.timeline-days-urgent { background: var(--danger-wash); color: var(--danger); }
.timeline-days-overdue { background: var(--danger); color: #fff; }

/* 时间轴节点状态色 */
.timeline-overdue .timeline-dot {
    background: var(--danger);
    box-shadow: 0 0 0 2px var(--danger);
}
.timeline-urgent .timeline-dot {
    background: var(--danger);
    box-shadow: 0 0 0 2px var(--danger);
    animation: pulse-dot 2s ease-in-out infinite;
}
.timeline-warn .timeline-dot {
    background: var(--warn);
    box-shadow: 0 0 0 2px var(--warn);
}
@keyframes pulse-dot {
    0%, 100% { box-shadow: 0 0 0 2px var(--danger); }
    50% { box-shadow: 0 0 0 5px rgba(220, 38, 38, 0.2); }
}

/* ===== 家庭事务热力?===== */
.heatmap-wrap {
    overflow-x: auto;
    padding: 8px 0;
}
.heatmap-months {
    display: grid;
    grid-template-columns: repeat(12, 15px);
    gap: 3px;
    margin-left: 24px;
    margin-bottom: 4px;
    height: 16px;
}
.heatmap-month-label {
    font-size: 10px;
    color: var(--ink-faint);
    font-family: var(--font-mono);
    white-space: nowrap;
}
.heatmap-body {
    display: flex;
    gap: 4px;
}
.heatmap-week-labels {
    display: flex;
    flex-direction: column;
    gap: 3px;
    justify-content: flex-start;
}
.heatmap-wl {
    height: 11px;
    line-height: 11px;
    font-size: 9px;
    color: var(--ink-faint);
    font-family: var(--font-mono);
    text-align: right;
    width: 20px;
}
.heatmap-grid {
    display: flex;
    gap: 3px;
}
.heatmap-week {
    display: flex;
    flex-direction: column;
    gap: 3px;
}
.heatmap-cell {
    width: 11px;
    height: 11px;
    border-radius: 2px;
    transition: transform 0.15s var(--ease);
}
.heatmap-cell:hover {
    transform: scale(1.5);
    z-index: 10;
    position: relative;
}
.heat-level-0 { background: var(--surface-sunken); border: 1px solid var(--line); }
.heat-level-1 { background: #d8c9f8; }
.heat-level-2 { background: #b79ce8; }
.heat-level-3 { background: #8b5fd6; }
.heat-level-4 { background: var(--accent); }
.heatmap-legend {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-top: 8px;
    margin-left: 24px;
}

/* ===== AI能力总览卡片 ===== */
.ai-overview-card {
    border: 2px solid var(--accent) !important;
    background: linear-gradient(135deg, var(--surface) 0%, var(--accent-wash) 100%);
}
.ai-overview-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 20px;
}
.ai-stat-block {
    text-align: center;
    padding: 16px 8px;
    background: var(--surface);
    border-radius: var(--r-md);
    border: 1px solid var(--line);
}
.ai-stat-num {
    font-family: var(--font-display);
    font-size: 28px;
    font-weight: 700;
    color: var(--accent-strong);
    font-variant-numeric: tabular-nums;
    letter-spacing: -0.02em;
    line-height: 1.2;
}
.ai-stat-label {
    font-size: 12px;
    color: var(--ink-soft);
    margin-top: 4px;
}
.ai-capability-bars {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 16px;
}
.ai-cap-row {
    display: flex;
    align-items: center;
    gap: 10px;
}
.ai-cap-label {
    font-size: 13px;
    color: var(--ink-soft);
    white-space: nowrap;
    min-width: 90px;
    text-align: right;
}
.ai-cap-bar-bg {
    flex: 1;
    height: 8px;
    background: var(--surface-sunken);
    border-radius: var(--r-pill);
    overflow: hidden;
}
.ai-cap-bar-fill {
    height: 100%;
    border-radius: var(--r-pill);
    transition: width 0.5s var(--ease);
}
.ai-cap-num {
    font-size: 12px;
    font-family: var(--font-mono);
    color: var(--ink-soft);
    min-width: 60px;
    text-align: right;
    font-variant-numeric: tabular-nums;
}
.ai-powered-by {
    text-align: center;
    padding-top: 12px;
    border-top: 1px dashed var(--line);
}
.ai-powered-tag {
    font-size: 11px;
    color: var(--ink-faint);
    font-family: var(--font-mono);
    margin-right: 4px;
}
.ai-powered-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--accent);
}
.ai-powered-sep {
    margin: 0 6px;
    color: var(--ink-faint);
}

/* ===== 家庭健康档案 ===== */
.health-member-section {
    padding: 16px 0;
    border-bottom: 1px solid var(--line);
}
.health-member-section:last-child { border-bottom: none; }
.health-member-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
}
.health-member-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--ok);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 15px;
}
.health-timeline {
    padding-left: 16px;
    border-left: 2px solid var(--ok-wash);
}
.health-report-item {
    position: relative;
    margin-bottom: 12px;
}
.health-report-dot {
    position: absolute;
    left: -22px;
    top: 14px;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--ok);
    border: 2px solid var(--surface);
}
.health-report-card {
    background: var(--surface-sunken);
    border: 1px solid var(--line);
    border-radius: var(--r-md);
    padding: 12px 14px;
    cursor: pointer;
    transition: all 0.2s var(--ease);
}
.health-report-card:hover {
    border-color: var(--ok);
    background: var(--ok-wash);
}
.health-report-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
}
.health-report-date {
    font-size: 12px;
    color: var(--ink-faint);
    font-family: var(--font-mono);
}
.health-report-fields {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 12px;
}
.health-field {
    font-size: 12px;
}
.health-field-label {
    color: var(--ink-faint);
    margin-right: 4px;
}
.health-field-value {
    color: var(--ink);
    font-weight: 500;
}

/* ===== 事务页快捷上传引?===== */
.affair-upload-card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--r-md);
    padding: 16px 20px;
    box-shadow: var(--shadow-sm);
    display: flex;
    align-items: center;
    gap: 14px;
    cursor: pointer;
    transition: transform 0.2s var(--ease), border-color 0.2s var(--ease), box-shadow 0.2s var(--ease);
    margin-bottom: 16px;
}
.affair-upload-card:hover {
    transform: translateY(-2px);
    border-color: var(--accent-soft);
    box-shadow: var(--shadow-accent);
}
.affair-upload-icon { font-size: 28px; flex-shrink: 0; }
.affair-upload-info { flex: 1; }
.affair-upload-title { font-size: 15px; font-weight: 600; color: var(--ink); }
.affair-upload-sub { font-size: 13px; color: var(--ink-soft); margin-top: 2px; }
.affair-upload-arrow { font-size: 24px; color: var(--ink-faint); margin-left: 8px; }

/* ===== 事务列表 ===== */
.affair-list { display: flex; flex-direction: column; gap: 10px; }
.affair-item {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--r-md);
    padding: 14px 18px;
    box-shadow: var(--shadow-sm);
    display: flex;
    align-items: center;
    gap: 14px;
    cursor: pointer;
    transition: transform 0.2s var(--ease), border-color 0.2s var(--ease), box-shadow 0.2s var(--ease);
    border-left: 4px solid transparent;
}
.affair-item:hover {
    transform: translateY(-1px);
    border-color: var(--accent-soft);
    box-shadow: var(--shadow-md);
}
.affair-item.priority-overdue {
    /* 见下?@keyframes overduePulse */
}
.affair-item.priority-urgent { border-left-color: var(--warn); }
.affair-item.priority-high { border-left-color: var(--warn); }
.affair-item.priority-medium { border-left-color: var(--accent); }
.affair-item.priority-low { border-left-color: var(--ok); }
.affair-item.completed { opacity: 0.5; }
.affair-item .affair-icon {
    width: 40px; height: 40px;
    border-radius: var(--r-sm);
    display: flex; align-items: center; justify-content: center;
    font-size: 20px;
    flex-shrink: 0;
    background: var(--accent-wash);
}
.affair-item .affair-main { flex: 1; min-width: 0; }
.affair-item .affair-main h4 { font-size: 15px; font-weight: 600; margin-bottom: 4px; color: var(--ink); }
.affair-item .affair-main .meta {
    font-size: 13px;
    color: var(--ink-soft);
    display: flex;
    gap: 16px;
    font-family: var(--font-mono);
    font-size: 11.5px;
}
.affair-item .affair-actions { display: flex; gap: 8px; flex-shrink: 0; }

/* ===== 标签/徽章 ===== */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-family: var(--font-mono);
    font-size: 10.5px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--ink-soft);
    border: 1px solid var(--line);
    border-radius: var(--r-pill);
    padding: 3px 10px;
    background: var(--surface);
    white-space: nowrap;
    font-weight: 500;
}
.badge-overdue {
    color: var(--danger);
    border-color: transparent;
    background: var(--danger-wash);
}
.badge-urgent {
    color: var(--warn);
    border-color: transparent;
    background: var(--warn-wash);
}
.badge-high {
    color: var(--warn);
    border-color: transparent;
    background: var(--warn-wash);
}
.badge-medium {
    color: var(--accent-strong);
    border-color: transparent;
    background: var(--accent-wash);
}
.badge-low {
    color: var(--ok);
    border-color: transparent;
    background: var(--ok-wash);
}
.badge-completed {
    color: var(--ok);
    border-color: transparent;
    background: var(--ok-wash);
}
.badge-pending {
    color: var(--ink-soft);
    border-color: var(--line);
    background: var(--surface-sunken);
}

/* ===== 按钮 ===== */
.btn {
    padding: 8px 16px;
    border: 1px solid var(--line-strong);
    border-radius: var(--r-sm);
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s var(--ease);
    font-family: inherit;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: var(--surface);
    color: var(--ink);
    font-weight: 500;
}
.btn-primary {
    background: var(--accent);
    color: #fff;
    border-color: var(--accent);
}
.btn-primary:hover {
    background: var(--accent-strong);
    border-color: var(--accent-strong);
}
.btn-success {
    background: var(--ok);
    color: #fff;
    border-color: var(--ok);
}
.btn-success:hover { opacity: 0.9; }
.btn-warning {
    background: var(--warn);
    color: #fff;
    border-color: var(--warn);
}
.btn-warning:hover { opacity: 0.9; }
.btn-danger {
    background: var(--danger);
    color: #fff;
    border-color: var(--danger);
}
.btn-danger:hover { opacity: 0.9; }
.btn-outline {
    background: var(--surface);
    border: 1px solid var(--line-strong);
    color: var(--ink-soft);
}
.btn-outline:hover {
    border-color: var(--accent-soft);
    color: var(--accent);
}
.btn-sm { padding: 5px 10px; font-size: 13px; }

/* ===== 上传区筛选框 ===== */
.upload-filters {
    display: flex;
    gap: 12px;
    margin-bottom: 12px;
    align-items: center;
    flex-wrap: wrap;
}
.upload-select {
    padding: 8px 12px;
    border: 1px solid var(--line-strong);
    border-radius: var(--r-sm);
    font-size: 14px;
    font-family: inherit;
    background: var(--surface);
    color: var(--ink);
    cursor: pointer;
    line-height: 1.4;
    height: 36px;
    appearance: auto;
    transition: border-color 0.16s var(--ease);
}
.upload-select:hover {
    border-color: var(--accent-soft);
}

/* ===== 日历 ===== */
.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 1px;
    background: var(--line);
    border-radius: var(--r-md);
    overflow: hidden;
    border: 1px solid var(--line);
}
.calendar-header {
    background: var(--surface-sunken);
    color: var(--ink-soft);
    padding: 10px;
    text-align: center;
    font-weight: 600;
    font-size: 13px;
    font-family: var(--font-mono);
    letter-spacing: 0.1em;
    text-transform: uppercase;
}
.calendar-cell {
    background: var(--surface);
    min-height: 100px;
    padding: 8px;
    font-size: 13px;
    position: relative;
    transition: background 0.15s var(--ease);
}
.calendar-cell:hover { background: var(--surface-sunken); }
.calendar-cell.other { color: var(--ink-faint); opacity: 0.4; }
.calendar-cell.today {
    background: var(--accent-wash);
}
.calendar-cell.today .day-num {
    color: var(--accent-strong);
    font-weight: 700;
}
.calendar-cell .day-num {
    font-weight: 600;
    margin-bottom: 4px;
    font-family: var(--font-mono);
    font-size: 12px;
}
.calendar-cell .day-event {
    background: var(--accent);
    color: #fff;
    border-radius: var(--r-sm);
    padding: 2px 6px;
    font-size: 11px;
    margin-bottom: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    cursor: pointer;
    transition: opacity 0.15s var(--ease);
}
.calendar-cell .day-event:hover { opacity: 0.85; }
.calendar-cell .day-event.urgent { background: var(--warn); }
.calendar-cell .day-event.overdue { background: var(--danger); }
.calendar-cell .day-event.event-completed {
    background: var(--surface-sunken);
    color: var(--ink-faint);
    text-decoration: line-through;
    opacity: 0.6;
}
.calendar-cell .day-event.event-archived {
    background: var(--surface-sunken);
    color: var(--ink-faint);
    opacity: 0.5;
    font-style: italic;
}

/* ===== 上传?===== */
.upload-area {
    border: 2px dashed var(--line-strong);
    border-radius: var(--r-lg);
    padding: 48px 24px;
    text-align: center;
    cursor: pointer;
    transition: border-color 0.2s var(--ease), background 0.2s var(--ease);
    background: var(--paper);
}
.upload-area:hover {
    border-color: var(--accent-soft);
    background: var(--accent-wash);
}
.upload-area .upload-icon { font-size: 48px; margin-bottom: 16px; }
.upload-area h3 { font-size: 18px; margin-bottom: 8px; color: var(--ink); }
.upload-area p { color: var(--ink-soft); font-size: 14px; }
.upload-area.recognizing { pointer-events: none; }
.recognizing-spinner {
    display: inline-block;
    width: 40px; height: 40px;
    border: 3px solid var(--line);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 16px auto;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ===== 文档列表 ===== */
.doc-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
}
.doc-card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--r-md);
    padding: 16px;
    box-shadow: var(--shadow-sm);
    transition: transform 0.2s var(--ease), border-color 0.2s var(--ease), box-shadow 0.2s var(--ease);
}
.doc-card:hover {
    border-color: var(--accent-soft);
    box-shadow: var(--shadow-accent);
    transform: translateY(-2px);
}
.doc-card .doc-header { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.doc-card .doc-icon {
    width: 40px; height: 40px;
    border-radius: var(--r-sm);
    display: flex; align-items: center; justify-content: center;
    font-size: 20px;
    flex-shrink: 0;
}
.doc-card h4 { font-size: 15px; flex: 1; color: var(--ink); }
.doc-card .doc-fields { font-size: 13px; color: var(--ink-soft); line-height: 1.6; }
.doc-card .doc-fields .field { display: flex; gap: 4px; }
.doc-card .doc-fields .field-label {
    color: var(--ink-faint);
    min-width: 70px;
    font-family: var(--font-mono);
    font-size: 11px;
}
.doc-card .doc-fields .field-value { color: var(--ink); font-weight: 500; }

/* ===== 弹窗/Modal ===== */
.modal-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(10, 10, 10, 0.5);
    z-index: 200;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    backdrop-filter: blur(4px);
}
.modal {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--r-lg);
    max-width: 600px;
    width: 100%;
    max-height: 85vh;
    overflow-y: auto;
    box-shadow: var(--shadow-lg);
}
.modal-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--line);
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.modal-header h3 { font-size: 18px; color: var(--ink); }
.modal-header .close-btn {
    font-size: 24px;
    cursor: pointer;
    color: var(--ink-faint);
    line-height: 1;
    transition: color 0.15s var(--ease);
}
.modal-header .close-btn:hover { color: var(--ink); }
.modal-body { padding: 24px; }
.modal-footer {
    padding: 16px 24px;
    border-top: 1px solid var(--line);
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    flex-wrap: wrap;
}
.modal-guide {
    background: var(--warn-wash);
    border-radius: var(--r-sm);
    padding: 16px;
    margin: 16px 0;
    font-size: 14px;
    line-height: 1.8;
    white-space: pre-wrap;
    color: var(--ink-soft);
    border-left: 3px solid var(--warn);
}
.modal-info-row { display: flex; margin-bottom: 12px; font-size: 14px; }
.modal-info-row .label {
    width: 100px;
    color: var(--ink-faint);
    flex-shrink: 0;
    font-family: var(--font-mono);
    font-size: 12px;
    letter-spacing: 0.05em;
}
.modal-info-row .value { font-weight: 500; color: var(--ink); }

/* ===== 提醒模拟弹窗 ===== */
.remind-preview {
    background: var(--accent-wash);
    border-radius: var(--r-sm);
    padding: 16px;
    margin: 16px 0;
    border-left: 3px solid var(--accent);
}
.remind-preview .phone-mock {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--r-sm);
    padding: 12px 16px;
    font-size: 14px;
    margin-top: 8px;
    line-height: 1.6;
    color: var(--ink);
}
.remind-preview .phone-mock .from {
    font-size: 12px;
    color: var(--ink-faint);
    margin-bottom: 4px;
    font-family: var(--font-mono);
}

/* ===== Token统计 ===== */
.token-bar {
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.token-table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}
.token-item { }
.token-item .token-header {
    display: flex;
    justify-content: space-between;
    font-size: 14px;
    margin-bottom: 4px;
    color: var(--ink);
}
.token-bar-bg {
    height: 8px;
    background: var(--surface-sunken);
    border-radius: var(--r-pill);
    overflow: hidden;
}
.token-bar-fill {
    height: 100%;
    border-radius: var(--r-pill);
    transition: width 0.5s var(--ease);
}

/* ===== 家庭成员 ===== */
.member-list { display: flex; flex-wrap: wrap; gap: 16px; }
.member-card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--r-md);
    padding: 20px;
    text-align: center;
    box-shadow: var(--shadow-sm);
    min-width: 140px;
    position: relative;
    transition: transform 0.2s var(--ease), border-color 0.2s var(--ease), box-shadow 0.2s var(--ease);
}
.member-card:hover {
    border-color: var(--accent-soft);
    box-shadow: var(--shadow-accent);
    transform: translateY(-2px);
}
.member-card .avatar {
    width: 56px; height: 56px;
    border-radius: 50%;
    background: var(--accent);
    color: #fff;
    display: flex; align-items: center; justify-content: center;
    font-size: 24px;
    font-weight: 700;
    margin: 0 auto 12px;
    font-family: var(--font-display);
}
.member-card h4 { font-size: 16px; margin-bottom: 4px; color: var(--ink); }
.member-card p { font-size: 13px; color: var(--ink-soft); }
.member-card .delete-btn { position: absolute; top: 8px; right: 8px; }

/* ===== Toast ===== */
.toast-container {
    position: fixed;
    top: 20px; right: 20px;
    z-index: 300;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.toast {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--r-md);
    padding: 12px 20px;
    box-shadow: var(--shadow-md);
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 10px;
    animation: slideIn 0.3s var(--ease);
    border-left: 4px solid var(--ok);
    color: var(--ink);
}
.toast.error { border-left-color: var(--danger); }
.toast.info { border-left-color: var(--accent); }
@keyframes slideIn { from { transform: translateX(100%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }

/* ===== 空状?===== */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--ink-faint);
}
.empty-state .empty-icon { font-size: 64px; margin-bottom: 16px; }
.empty-state p { font-size: 15px; }

/* ===== 时间?===== */
.timeline { position: relative; padding-left: 28px; }
.timeline::before {
    content: '';
    position: absolute;
    left: 8px; top: 4px; bottom: 4px;
    width: 2px;
    background: var(--line);
}
.timeline-item {
    position: relative;
    margin-bottom: 20px;
    padding-left: 8px;
}
.timeline-item::before {
    content: '';
    position: absolute;
    left: -24px; top: 4px;
    width: 12px; height: 12px;
    border-radius: 50%;
    background: var(--accent);
    border: 2px solid var(--surface);
}
.timeline-item .timeline-date {
    font-size: 12px;
    color: var(--ink-faint);
    margin-bottom: 4px;
    font-family: var(--font-mono);
}
.timeline-item .timeline-content { font-size: 14px; color: var(--ink); }

/* ===== 移动端顶?===== */
.mobile-header {
    display: none;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: var(--surface);
    border-bottom: 1px solid var(--line);
    color: var(--ink);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 200;
    height: 56px;
}
.mobile-header h2 { font-size: 17px; white-space: nowrap; margin: 0; font-weight: 700; }
.mobile-header .hamburger {
    font-size: 24px;
    cursor: pointer;
    line-height: 1;
    padding: 4px;
}

/* ===== 响应?===== */
@media (max-width: 768px) {
    .sidebar { transform: translateX(-100%); transition: transform 0.3s var(--ease); }
    .sidebar.open { transform: translateX(0); }
    .main-content { margin-left: 0; width: 100vw; padding: 16px; padding-top: 72px; }
    .calendar-cell { min-height: 60px; }
    .stat-grid { grid-template-columns: repeat(2, 1fr) !important; }
    .stat-grid-7 { grid-template-columns: repeat(2, 1fr) !important; }
    .page-header { flex-wrap: wrap; gap: 12px; margin-bottom: 24px; }
    .page-header .header-actions { flex-wrap: wrap; }
    .doc-grid { grid-template-columns: 1fr; }
    .member-list { justify-content: center; }
    .modal { max-width: 95vw; }
    .modal-footer { flex-wrap: wrap; }
    .agent-chat-card { height: calc(100vh - 140px); }
    .mobile-header { display: flex !important; }
    .stat-card { min-width: 0; padding: 16px; }
    .stat-card .stat-icon { width: 40px; height: 40px; font-size: 20px; }
    .stat-card .stat-info h3 { font-size: 22px; }
    .stat-card .stat-info p { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
    .memo-input-row { flex-wrap: wrap; }
    .memo-input-row input { flex: 1 1 100%; }
    .memo-input-row button { flex: 1 1 auto; }
}
@media (min-width: 769px) {
    .mobile-header { display: none !important; }
}

/* ===== AI管家Agent聊天界面 ===== */
.agent-page { display: flex; flex-direction: column; height: 100%; }
.agent-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}
.agent-header-left {
    display: flex;
    align-items: center;
    gap: 12px;
}
.agent-header h1 {
    font-size: 24px;
    font-weight: 700;
    margin: 0;
    color: var(--ink);
}
.agent-conv-toggle {
    position: relative;
    width: 40px; height: 40px;
    border: 1px solid var(--line);
    border-radius: var(--r-md);
    background: var(--surface);
    cursor: pointer;
    font-size: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.16s var(--ease);
    color: var(--ink-soft);
}
.agent-conv-toggle:hover {
    background: var(--accent-wash);
    border-color: var(--accent-soft);
    color: var(--accent);
}
.agent-conv-badge {
    position: absolute;
    top: -4px; right: -4px;
    background: var(--accent);
    color: #fff;
    font-size: 10px;
    min-width: 16px; height: 16px;
    border-radius: var(--r-pill);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
    font-family: var(--font-mono);
}
.agent-new-conv-btn {
    padding: 8px 16px;
    background: var(--accent);
    color: #fff;
    border: 1px solid var(--accent);
    border-radius: var(--r-md);
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s var(--ease);
    white-space: nowrap;
    font-weight: 600;
}
.agent-new-conv-btn:hover {
    background: var(--accent-strong);
    border-color: var(--accent-strong);
    transform: translateY(-1px);
}

/* 聊天区域wrapper */
.agent-chat-wrapper {
    position: relative;
    flex: 1;
    display: flex;
    overflow: hidden;
}

/* 会话列表面板 */
.agent-conv-panel {
    position: absolute;
    left: 0; top: 0; bottom: 0;
    width: 280px;
    background: var(--paper);
    border-right: 1px solid var(--line);
    z-index: 10;
    transform: translateX(-100%);
    transition: transform 0.25s var(--ease);
    display: flex;
    flex-direction: column;
    box-shadow: 4px 0 12px rgba(0,0,0,0);
}
.agent-conv-panel-open {
    transform: translateX(0);
    box-shadow: var(--shadow-md);
}
.agent-conv-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px;
    border-bottom: 1px solid var(--line);
    font-weight: 600;
    font-size: 15px;
    color: var(--ink);
}
.agent-conv-close {
    background: none;
    border: none;
    font-size: 16px;
    cursor: pointer;
    color: var(--ink-faint);
    padding: 4px 8px;
    border-radius: var(--r-sm);
    transition: all 0.15s var(--ease);
}
.agent-conv-close:hover { background: var(--surface-sunken); color: var(--ink); }
.agent-conv-empty {
    padding: 24px;
    text-align: center;
    color: var(--ink-faint);
    font-size: 14px;
}
.agent-conv-item {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    cursor: pointer;
    border-bottom: 1px solid var(--line);
    transition: background 0.15s var(--ease);
}
.agent-conv-item:hover { background: var(--surface-sunken); }
.agent-conv-active {
    background: var(--accent-wash);
    border-left: 3px solid var(--accent);
}
.agent-conv-info { flex: 1; min-width: 0; }
.agent-conv-title {
    font-size: 14px;
    color: var(--ink);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.agent-conv-time {
    font-size: 12px;
    color: var(--ink-faint);
    margin-top: 2px;
    font-family: var(--font-mono);
}
.agent-conv-del {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 14px;
    padding: 4px 6px;
    border-radius: var(--r-sm);
    opacity: 0;
    transition: opacity 0.15s var(--ease);
}
.agent-conv-item:hover .agent-conv-del { opacity: 1; }
.agent-conv-del:hover { background: var(--danger-wash); }

.agent-chat-card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--r-lg);
    box-shadow: var(--shadow-sm);
    display: flex;
    flex-direction: column;
    height: calc(100vh - 180px);
    min-height: 500px;
    overflow: hidden;
    flex: 1;
}
.agent-chat-body {
    flex: 1;
    overflow-y: auto;
    padding: 24px;
    scroll-behavior: smooth;
}

/* 欢迎?*/
.agent-welcome {
    text-align: center;
    padding: 40px 20px;
}
.agent-welcome-icon {
    font-size: 56px;
    margin-bottom: 16px;
}
.agent-welcome h3 {
    font-size: 20px;
    margin-bottom: 8px;
    color: var(--ink);
}
.agent-welcome p {
    font-size: 14px;
    color: var(--ink-soft);
    margin-bottom: 20px;
}
.agent-welcome-suggestions {
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-width: 480px;
    margin: 0 auto;
}
.agent-suggestion-chip {
    padding: 12px 20px;
    background: var(--accent-wash);
    border: 1px solid var(--accent-soft);
    border-radius: var(--r-md);
    cursor: pointer;
    font-size: 14px;
    color: var(--accent-strong);
    transition: all 0.2s var(--ease);
    text-align: center;
}
.agent-suggestion-chip:hover {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
    transform: translateY(-1px);
}

/* 消息气泡 */
.agent-msg {
    display: flex;
    gap: 12px;
    margin-bottom: 20px;
    max-width: 85%;
}
.agent-msg-user {
    flex-direction: row-reverse;
    margin-left: auto;
}
.agent-msg-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    font-weight: 600;
    flex-shrink: 0;
}
.agent-msg-user .agent-msg-avatar {
    background: var(--accent);
    color: #fff;
}
.agent-msg-assistant .agent-msg-avatar {
    background: var(--accent-wash);
    border: 1px solid var(--accent-soft);
}
.agent-msg-body {
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.agent-msg-text {
    padding: 12px 16px;
    border-radius: var(--r-md);
    font-size: 14px;
    line-height: 1.7;
    word-break: break-word;
}
.agent-msg-user .agent-msg-text {
    background: var(--accent);
    color: #fff;
    border-bottom-right-radius: 4px;
    white-space: pre-wrap;
}
.agent-msg-assistant .agent-msg-text {
    background: var(--paper);
    color: var(--ink);
    border: 1px solid var(--line);
    border-bottom-left-radius: 4px;
}

/* 推理?*/
.agent-tool-trace {
    background: #f8f5ff;
    border: 1px solid #ddd6fe;
    border-radius: var(--r-sm);
    padding: 8px 12px;
    font-size: 12px;
    line-height: 1.6;
}
.agent-tool-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 6px 0;
    border-bottom: 1px solid #ede9fe;
}
.agent-tool-item:last-child {
    border-bottom: none;
}
.agent-tool-header {
    display: flex;
    align-items: center;
    gap: 6px;
}
.agent-tool-step {
    font-size: 10px;
    background: var(--accent);
    color: #fff;
    padding: 1px 6px;
    border-radius: 4px;
    font-family: var(--font-mono);
    font-weight: 600;
}
.agent-tool-name {
    font-weight: 600;
    color: var(--accent);
}
.agent-tool-thought {
    color: #6b7280;
    font-size: 12px;
    line-height: 1.5;
    padding-left: 4px;
    border-left: 2px solid #c4b5fd;
    padding: 2px 0 2px 8px;
}
.agent-thought-icon {
    font-size: 11px;
}
.agent-tool-footer {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}
.agent-tool-args {
    color: var(--ink-faint);
    font-size: 11px;
    font-family: var(--font-mono);
}
.agent-tool-result {
    color: var(--ok);
    font-size: 11px;
}

.agent-msg-meta {
    display: flex;
    gap: 10px;
    font-size: 11px;
    color: var(--ink-faint);
    font-family: var(--font-mono);
}
.agent-msg-meta span {
    color: var(--accent);
}

/* 打字动画 */
.agent-typing {
    display: flex;
    gap: 4px;
    padding: 14px 16px;
    background: var(--paper);
    border: 1px solid var(--line);
    border-radius: var(--r-md);
    border-bottom-left-radius: 4px;
}
.agent-typing span {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--accent-soft);
    animation: agentBounce 1.4s infinite ease-in-out both;
}
.agent-typing span:nth-child(1) { animation-delay: -0.32s; }
.agent-typing span:nth-child(2) { animation-delay: -0.16s; }
@keyframes agentBounce {
    0%, 80%, 100% { transform: scale(0.6); opacity: 0.5; }
    40% { transform: scale(1); opacity: 1; }
}

/* 输入?*/
.agent-chat-input-area {
    border-top: 1px solid var(--line);
    padding: 12px 20px;
    background: var(--paper);
}
.agent-suggestions-row {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 10px;
}
.agent-suggestion-chip-sm {
    font-size: 12px;
    padding: 4px 12px;
    background: var(--accent-wash);
    border: 1px solid var(--accent-soft);
    border-radius: var(--r-pill);
    cursor: pointer;
    color: var(--accent-strong);
    transition: all 0.2s var(--ease);
    white-space: nowrap;
}
.agent-suggestion-chip-sm:hover {
    background: var(--accent);
    color: #fff;
    border-color: var(--accent);
}
.agent-chat-input-row {
    display: flex;
    gap: 10px;
}
.agent-chat-input {
    flex: 1;
    padding: 12px 18px;
    border: 1px solid var(--line-strong);
    border-radius: var(--r-md);
    font-size: 15px;
    outline: none;
    transition: border-color 0.2s var(--ease);
    background: var(--surface);
    color: var(--ink);
    font-family: inherit;
}
.agent-chat-input:focus {
    border-color: var(--accent);
}
.agent-send-btn {
    white-space: nowrap;
}
.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(10, 10, 10, 0.4);
    z-index: 99;
    backdrop-filter: blur(2px);
}
@media (max-width: 768px) {
    .sidebar-overlay.open { display: block; }
}

/* ===== 空看板引导卡?===== */
.empty-guide-card {
    background: linear-gradient(135deg, var(--accent-wash), var(--paper));
    border: 1px solid var(--accent-soft);
    border-radius: var(--r-lg);
    padding: 40px 32px;
    text-align: center;
    margin-bottom: 20px;
    box-shadow: var(--shadow-accent);
    position: relative;
    overflow: hidden;
}
.empty-guide-card::after {
    content: "";
    position: absolute;
    inset: auto -10% -50% auto;
    width: 200px;
    height: 200px;
    border-radius: 50%;
    background-image: radial-gradient(var(--accent-soft) 1.5px, transparent 1.5px);
    background-size: 9px 9px;
    opacity: 0.3;
}
.empty-guide-icon {
    font-size: 56px;
    margin-bottom: 16px;
}
.empty-guide-card h2 {
    font-size: 24px;
    color: var(--accent-strong);
    margin-bottom: 8px;
    letter-spacing: -0.025em;
}
.empty-guide-card > p {
    font-size: 14px;
    color: var(--ink-soft);
    margin-bottom: 28px;
}
.empty-guide-steps {
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-width: 500px;
    margin: 0 auto;
    position: relative;
    z-index: 1;
}
.guide-step {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px 20px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--r-md);
    cursor: pointer;
    transition: transform 0.2s var(--ease), border-color 0.2s var(--ease), box-shadow 0.2s var(--ease);
    text-align: left;
    box-shadow: var(--shadow-sm);
}
.guide-step:hover {
    transform: translateY(-2px);
    border-color: var(--accent-soft);
    box-shadow: var(--shadow-accent);
}
.guide-step-num {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--accent);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 16px;
    flex-shrink: 0;
    font-family: var(--font-display);
}
.guide-step-body { flex: 1; }
.guide-step-title { font-weight: 600; font-size: 15px; color: var(--ink); }
.guide-step-desc { font-size: 13px; color: var(--ink-soft); margin-top: 2px; }
.guide-step-arrow { font-size: 20px; color: var(--accent-soft); }

/* ===== 事务搜索?===== */
.search-box-inline input {
    border: 1px solid var(--line-strong);
    border-radius: var(--r-sm);
    font-size: 13px;
    transition: border-color 0.2s var(--ease);
    outline: none;
    background: var(--surface);
    color: var(--ink);
}
.search-box-inline input:focus {
    border-color: var(--accent);
}

/* ===== Loading骨架?===== */
.loading-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.skeleton-affair-item {
    height: 72px;
    border-radius: var(--r-md);
    background: linear-gradient(90deg, var(--surface-sunken) 25%, var(--line) 50%, var(--surface-sunken) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
}
.skeleton-doc-card {
    height: 200px;
    border-radius: var(--r-md);
    background: linear-gradient(90deg, var(--surface-sunken) 25%, var(--line) 50%, var(--surface-sunken) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
}
@keyframes shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}
.loading-text {
    padding: 40px;
    text-align: center;
    color: var(--ink-faint);
}

/* ===== Token汇总卡?===== */
.token-summary-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 20px;
}
.token-summary-card {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 20px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--r-md);
    box-shadow: var(--shadow-sm);
    transition: transform 0.2s var(--ease), border-color 0.2s var(--ease);
}
.token-summary-card:hover {
    border-color: var(--accent-soft);
    transform: translateY(-2px);
}
.token-summary-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--r-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    flex-shrink: 0;
}
.token-summary-card h3 {
    font-family: var(--font-display);
    font-size: 24px;
    font-weight: 700;
    color: var(--ink);
    line-height: 1.2;
    font-variant-numeric: tabular-nums;
    letter-spacing: -0.03em;
}
.token-summary-card p {
    font-size: 13px;
    color: var(--ink-soft);
    margin-top: 2px;
}
@media (max-width: 768px) {
    .token-summary-grid { grid-template-columns: repeat(2, 1fr); }
}

/* ===== 成员编辑按钮 ===== */
.member-card-actions {
    position: absolute;
    top: 8px;
    right: 8px;
    display: flex;
    gap: 4px;
}
.member-edit-btn {
    padding: 2px 8px !important;
    font-size: 12px;
    min-width: auto !important;
}

/* ===== 过期事务高亮 ===== */
.affair-item.priority-overdue {
    border-left: 4px solid var(--danger);
    background: linear-gradient(90deg, var(--danger-wash), var(--surface) 40%);
    animation: overduePulse 4s ease-in-out infinite;
}
@keyframes overduePulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(220, 38, 38, 0); }
    50% { box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.15); }
}

/* ===== Token表格滚动（样式见1294行） ===== */

/* ===== Toast成功特殊样式 ===== */
.toast.success {
    animation: toastSlideIn 0.3s var(--ease), toastFadeOut 0.3s ease 2.5s;
}

/* ===== 自定义确认弹?===== */
.confirm-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(10, 10, 10, 0.5);
    z-index: 250;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    backdrop-filter: blur(4px);
}
.confirm-dialog {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--r-lg);
    padding: 32px 28px 24px;
    max-width: 380px;
    width: 100%;
    text-align: center;
    box-shadow: var(--shadow-lg);
}
.confirm-icon {
    font-size: 40px;
    margin-bottom: 16px;
}
.confirm-text {
    font-size: 15px;
    color: var(--ink);
    margin-bottom: 24px;
    line-height: 1.6;
}
.confirm-btns {
    display: flex;
    justify-content: center;
    gap: 10px;
}

/* ===== 骨架屏（看板用） ===== */
.skeleton-wrap {
    display: flex;
    flex-direction: column;
    gap: 20px;
}
.skeleton-cards {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
}
.skeleton-card {
    height: 80px;
    border-radius: var(--r-md);
    background: linear-gradient(90deg, var(--surface-sunken) 25%, var(--line) 50%, var(--surface-sunken) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
}
.skeleton-line {
    height: 32px;
    border-radius: var(--r-sm);
    background: linear-gradient(90deg, var(--surface-sunken) 25%, var(--line) 50%, var(--surface-sunken) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
}
.skeleton-line.h48 { height: 48px; }
.skeleton-line.w80 { width: 80%; }
.skeleton-line.w60 { width: 60%; }
.skeleton-line.w40 { width: 40%; }
@media (max-width: 768px) {
    .skeleton-cards { grid-template-columns: repeat(2, 1fr); }
}

/* ===== 表格样式（Token明细表格?===== */
table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}
table thead tr {
    border-bottom: 2px solid var(--line-strong);
}
table th {
    text-align: left;
    padding: 10px;
    color: var(--ink-soft);
    font-weight: 600;
    font-size: 12px;
    font-family: var(--font-mono);
    letter-spacing: 0.05em;
    text-transform: uppercase;
}
table td {
    padding: 10px;
    color: var(--ink);
    border-bottom: 1px solid var(--line);
}
table tbody tr {
    transition: background 0.15s var(--ease);
    border-bottom: 1px solid var(--line);
}
table tbody tr:hover {
    background: var(--surface-sunken);
}

/* ===== 表单输入框通用样式 ===== */
input[type="text"],
input[type="password"],
input[type="date"],
input[type="tel"],
input[type="search"],
textarea,
select {
    font-family: inherit;
}
input:focus,
textarea:focus,
select:focus {
    outline: none;
}

/* ============================================================
   落地?/ Landing Page
   ============================================================ */

/* ----- 导航?----- */
.landing-nav-btn {
    white-space: nowrap;
}

/* ----- 落地页全局 ----- */
.landing-wrapper {
    min-height: 100vh;
    background: var(--paper);
    color: var(--ink);
    font-family: var(--font-body);
}

/* ----- 导航?----- */
.landing-nav {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px 48px;
    background: var(--surface);
    border-bottom: 1px solid var(--line);
    position: sticky;
    top: 0;
    z-index: 100;
}
.landing-nav-logo {
    display: flex;
    align-items: center;
    gap: 8px;
}
.landing-nav-logo .logo-icon {
    font-size: 28px;
}
.landing-nav-logo .logo-text {
    font-family: var(--font-display);
    font-size: 22px;
    font-weight: 700;
    letter-spacing: -0.02em;
}
.landing-nav-tag {
    font-family: var(--font-mono);
    font-size: 12px;
    color: var(--ink-faint);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    padding: 4px 12px;
    background: var(--surface-sunken);
    border-radius: var(--r-pill);
}
.landing-nav-btn {
    margin-left: auto;
}

/* ----- Hero ?----- */
.landing-hero {
    position: relative;
    padding: 80px 48px 100px;
    overflow: hidden;
    text-align: center;
}
.hero-dot-bg {
    position: absolute;
    inset: 0;
    background-image: radial-gradient(var(--line-strong) 1px, transparent 1px);
    background-size: 24px 24px;
    opacity: 0.5;
    z-index: 0;
}
.hero-content {
    position: relative;
    z-index: 1;
    max-width: 760px;
    margin: 0 auto;
}
.hero-pill {
    display: inline-block;
    padding: 6px 16px;
    background: var(--accent-wash);
    color: var(--accent-strong);
    border-radius: var(--r-pill);
    font-size: 13px;
    font-family: var(--font-mono);
    margin-bottom: 24px;
}
.hero-title {
    font-family: var(--font-display);
    font-size: 42px;
    font-weight: 700;
    line-height: 1.25;
    letter-spacing: -0.02em;
    margin-bottom: 20px;
    color: var(--ink);
}
.hero-subtitle {
    font-size: 17px;
    line-height: 1.7;
    color: var(--ink-soft);
    margin-bottom: 36px;
}
.hero-actions {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}
.hero-demo-hint {
    font-size: 13px;
    color: var(--ink-faint);
    font-family: var(--font-mono);
}

/* ----- 大按?----- */
.btn-lg {
    padding: 14px 36px;
    font-size: 16px;
    font-weight: 600;
    border-radius: var(--r-md);
    box-shadow: var(--shadow-accent);
}

/* ----- 通用 section ----- */
.landing-section {
    padding: 64px 48px;
    max-width: 1200px;
    margin: 0 auto;
}
.landing-section-alt {
    background: var(--surface);
    max-width: none;
    border-top: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
}
.landing-section-alt > * {
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
}
.section-title {
    font-family: var(--font-display);
    font-size: 30px;
    font-weight: 700;
    text-align: center;
    margin-bottom: 48px;
    letter-spacing: -0.01em;
}

/* ----- 痛点卡片 ----- */
.pain-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
}
.pain-card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--r-lg);
    padding: 32px 28px;
    text-align: center;
    transition: all 0.3s var(--ease);
}
.pain-card:hover {
    border-color: var(--accent-soft);
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}
.pain-icon {
    font-size: 40px;
    margin-bottom: 16px;
}
.pain-card h3 {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 10px;
    color: var(--ink);
}
.pain-card p {
    font-size: 14px;
    line-height: 1.6;
    color: var(--ink-soft);
}

/* ----- 步骤?----- */
.step-flow {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    flex-wrap: wrap;
}
.step-card {
    background: var(--surface-sunken);
    border: 1px solid var(--line);
    border-radius: var(--r-lg);
    padding: 32px 24px;
    text-align: center;
    width: 260px;
    position: relative;
    transition: all 0.3s var(--ease);
}
.step-card:hover {
    border-color: var(--accent-soft);
    background: var(--accent-wash);
}
.step-num {
    position: absolute;
    top: -14px;
    left: 50%;
    transform: translateX(-50%);
    width: 32px;
    height: 32px;
    background: var(--accent);
    color: #fff;
    border-radius: 50%;
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.step-icon {
    font-size: 36px;
    margin-bottom: 14px;
}
.step-card h3 {
    font-size: 17px;
    font-weight: 600;
    margin-bottom: 8px;
}
.step-card p {
    font-size: 13px;
    line-height: 1.6;
    color: var(--ink-soft);
}
.step-arrow {
    font-size: 24px;
    color: var(--accent-soft);
    font-weight: 300;
}

/* ----- 电信绑定卡片 ----- */
.telecom-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
}
.telecom-card {
    background: var(--surface);
    border: 2px solid var(--accent);
    border-radius: var(--r-lg);
    padding: 36px 28px;
    text-align: center;
    position: relative;
    transition: all 0.3s var(--ease);
}
.telecom-card:hover {
    box-shadow: var(--shadow-accent);
    transform: translateY(-4px);
}
.telecom-badge {
    position: absolute;
    top: -12px;
    left: 50%;
    transform: translateX(-50%);
    padding: 4px 14px;
    background: var(--accent);
    color: #fff;
    border-radius: var(--r-pill);
    font-family: var(--font-mono);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}
.telecom-icon {
    font-size: 40px;
    margin-bottom: 16px;
    margin-top: 8px;
}
.telecom-card h3 {
    font-size: 19px;
    font-weight: 700;
    margin-bottom: 10px;
    color: var(--accent-strong);
}
.telecom-card p {
    font-size: 14px;
    line-height: 1.7;
    color: var(--ink-soft);
}

/* ----- 数据统计?----- */
.stats-row {
    display: flex;
    justify-content: center;
    gap: 64px;
    flex-wrap: wrap;
}
.stat-item {
    text-align: center;
}
.stat-num {
    font-family: var(--font-display);
    font-size: 56px;
    font-weight: 700;
    color: var(--accent);
    line-height: 1;
    font-variant-numeric: tabular-nums;
}
.stat-label {
    font-size: 14px;
    color: var(--ink-soft);
    margin-top: 8px;
}

/* ----- CTA ----- */
.landing-cta {
    text-align: center;
    padding: 80px 48px;
    background: var(--accent-wash);
    border-top: 1px solid var(--line);
}
.landing-cta h2 {
    font-family: var(--font-display);
    font-size: 36px;
    font-weight: 700;
    margin-bottom: 12px;
    color: var(--accent-strong);
}
.landing-cta p {
    font-size: 16px;
    color: var(--ink-soft);
    margin-bottom: 28px;
}

/* ----- Footer ----- */
.landing-footer {
    text-align: center;
    padding: 32px 48px;
    background: var(--ink);
    color: var(--ink-faint);
}
.landing-footer p {
    font-size: 13px;
    margin-bottom: 4px;
}
.landing-footer .footer-sub {
    font-family: var(--font-mono);
    font-size: 11px;
    letter-spacing: 0.05em;
}

/* ----- 响应?----- */
@media (max-width: 768px) {
    .landing-nav { padding: 12px 16px; }
    .landing-hero { padding: 48px 16px 64px; }
    .hero-title { font-size: 28px; }
    .hero-subtitle { font-size: 15px; }
    .landing-section { padding: 48px 16px; }
    .section-title { font-size: 22px; margin-bottom: 32px; }
    .pain-grid, .telecom-grid { grid-template-columns: 1fr; }
    .step-card { width: 100%; }
    .step-arrow { display: none; }
    .stat-num { font-size: 36px; }
    .stats-row { gap: 32px; }
    .landing-cta { padding: 48px 16px; }
    .landing-cta h2 { font-size: 26px; }
}

/* ==================== 疫苗日程管理 ==================== */
.vaccine-child-selector {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}
.vaccine-child-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 18px;
    border: 2px solid var(--line);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s;
    background: var(--surface);
}
.vaccine-child-card:hover {
    border-color: var(--primary);
    background: #f9f5ff;
}
.vaccine-child-card.active {
    border-color: var(--primary);
    background: #f3effe;
}
.vaccine-child-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--primary);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    font-weight: 600;
}
.vaccine-child-card h4 {
    margin: 0;
    font-size: 15px;
    color: var(--ink);
}
.vaccine-child-card p {
    margin: 0;
    font-size: 12px;
    color: var(--ink-soft);
}

.vaccine-stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    margin-top: 16px;
}
.vaccine-stat-card {
    background: var(--surface);
    padding: 16px;
    border-radius: 10px;
    text-align: center;
}
.vaccine-stat-num {
    font-size: 32px;
    font-weight: 700;
    font-family: var(--font-mono);
}
.vaccine-stat-label {
    font-size: 13px;
    color: var(--ink-soft);
    margin-top: 4px;
}
@media (max-width: 768px) {
    .vaccine-stats-grid { grid-template-columns: repeat(2, 1fr); }
}

.vaccine-timeline {
    position: relative;
    padding-left: 8px;
}
.vaccine-timeline-item {
    display: flex;
    gap: 16px;
    padding-bottom: 24px;
    position: relative;
}
.vaccine-timeline-item:not(:last-child)::before {
    content: '';
    position: absolute;
    left: 19px;
    top: 44px;
    bottom: 0;
    width: 2px;
    background: var(--line);
}
.vaccine-timeline-dot {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    flex-shrink: 0;
    color: #fff;
    z-index: 1;
}
.vaccine-timeline-content {
    flex: 1;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 14px 16px;
}
.vaccine-timeline-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}
.vaccine-age-badge {
    display: inline-block;
    font-size: 12px;
    padding: 2px 8px;
    background: #f3effe;
    color: var(--primary);
    border-radius: 6px;
    margin-right: 8px;
    font-weight: 500;
}
.vaccine-name {
    font-size: 15px;
    font-weight: 600;
    color: var(--ink);
}
.vaccine-dose {
    font-size: 13px;
    color: var(--ink-soft);
    margin-left: 6px;
}
.vaccine-status-tag {
    font-size: 12px;
    padding: 2px 10px;
    border: 1px solid;
    border-radius: 12px;
    font-weight: 500;
}
.vaccine-timeline-body {
    font-size: 14px;
}
.vaccine-desc {
    color: var(--ink-soft);
    font-size: 13px;
    margin: 0 0 8px 0;
}
.vaccine-meta {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
    font-size: 13px;
    color: var(--ink-faint);
}
.vaccine-actions {
    margin-top: 10px;
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.parenting-topics {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}
.parenting-topic-chip {
    font-size: 13px;
    padding: 6px 14px;
    background: #f3effe;
    border-radius: 20px;
    cursor: pointer;
    color: var(--primary);
    transition: all 0.2s;
    font-weight: 500;
}
.parenting-topic-chip:hover {
    background: var(--primary);
    color: #fff;
}

/* ===== AI文档解读 ===== */
.doc-interpretation {
    margin-top: 14px;
    border-top: 1px solid var(--line);
    padding-top: 14px;
}
.interp-section {
    margin-bottom: 14px;
}
.interp-section:last-of-type {
    margin-bottom: 8px;
}
.interp-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--primary);
    margin-bottom: 6px;
}
.interp-body {
    font-size: 13px;
    line-height: 1.7;
    color: var(--ink-soft, #52525b);
    background: #faf8ff;
    border-radius: 8px;
    padding: 12px 14px;
}
.interp-footer {
    font-size: 11px;
    color: #a1a1aa;
    text-align: right;
    margin-top: 4px;
}

/* ===== 到期风险预警 ===== */
.risk-card {
    border-radius: 14px;
    padding: 20px;
}
.risk-high { border-left: 4px solid #dc2626; background: #fef2f2; }
.risk-medium { border-left: 4px solid #f59e0b; background: #fffbeb; }
.risk-low { border-left: 4px solid #3b82f6; background: #eff6ff; }

.risk-header { margin-bottom: 14px; }
.risk-title-row {
    display: flex;
    align-items: center;
    gap: 8px;
}
.risk-icon { font-size: 22px; }
.risk-title-row h3 {
    font-size: 17px;
    font-weight: 700;
    margin: 0;
    color: #1a1a2e;
}
.risk-level-badge {
    font-size: 12px;
    font-weight: 600;
    padding: 2px 10px;
    border-radius: 12px;
    margin-left: auto;
}
.risk-badge-high { background: #dc2626; color: #fff; }
.risk-badge-medium { background: #f59e0b; color: #fff; }
.risk-badge-low { background: #3b82f6; color: #fff; }

.risk-summary {
    font-size: 14px;
    color: #52525b;
    margin: 8px 0 0 0;
    line-height: 1.5;
}

.risk-items {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.risk-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(255,255,255,0.7);
    border-radius: 10px;
    padding: 12px 14px;
    gap: 12px;
}
.risk-item-left {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
    min-width: 0;
}
.risk-item-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}
.dot-danger { background: #dc2626; }
.dot-urgent { background: #f59e0b; }
.dot-warning { background: #3b82f6; }

.risk-item-info { min-width: 0; }
.risk-item-title {
    font-size: 14px;
    font-weight: 600;
    color: #1a1a2e;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.risk-item-meta {
    font-size: 12px;
    color: #71717a;
    margin-top: 2px;
    display: flex;
    gap: 12px;
}

.risk-item-right {
    text-align: right;
    flex-shrink: 0;
}
.risk-item-days {
    font-size: 14px;
    font-weight: 700;
}
.days-danger { color: #dc2626; }
.days-urgent { color: #f59e0b; }
.days-warning { color: #3b82f6; }
.risk-item-suggestion {
    font-size: 11px;
    color: #71717a;
    margin-top: 2px;
    max-width: 180px;
}

@media (max-width: 768px) {
    .risk-item {
        flex-direction: column;
        align-items: flex-start;
    }
    .risk-item-right {
        text-align: left;
    }
    .risk-item-suggestion {
        max-width: 100%;
    }
}

/* ===== 打印样式 ===== */
@media print {
    /* 隐藏所有标记为 no-print 的元?*/
    .no-print { display: none !important; }
    /* 隐藏非内容区?*/
    .sidebar, .page-header, .modal-overlay, .toast-container,
    .landing-wrapper, .login-wrapper, footer, nav,
    .mobile-header, .sidebar-overlay { display: none !important; }
    /* 隐藏未选中的应急卡 */
    .emg-print-card.print-excluded { display: none !important; }
    /* 主体占满 */
    .main-content { margin-left: 0 !important; padding: 0 !important; width: 100% !important; }
    .app-layout { display: block !important; }
    body { background: #fff !important; }
    /* 消除浏览器默认页眉页脚（日期、URL、标题） */
    @page { margin: 0; }
    body { margin: 0 !important; }
    .main-content { padding: 1cm !important; }

    /* 打印专用标题显示 */
    .print-only-title { display: block !important; }
    .print-main-title {
        text-align: center !important;
        font-size: 36px !important;
        font-weight: 800 !important;
        margin: 0 0 8px !important;
        color: #1a1a2e !important;
        letter-spacing: 4px !important;
    }
    .print-sub-title {
        text-align: center !important;
        font-size: 18px !important;
        color: #666 !important;
        margin: 0 0 24px !important;
    }

    /* 卡片纵向排列，每张卡占满宽度 */
    .doc-grid { display: block !important; grid-template-columns: none !important; gap: 0 !important; }
    .emg-print-card {
        width: 100% !important;
        max-width: 100% !important;
        break-inside: avoid;
        margin-bottom: 16px !important;
        border: 2px solid #dc2626 !important;
        border-radius: 8px !important;
    }
    /* 放大字号 */
    .emg-card-header { padding: 16px 20px !important; }
    .emg-card-body { padding: 16px 20px !important; }
    .emg-name { font-size: 22px !important; }
    .emg-relation { font-size: 16px !important; }
    .emg-blood { font-size: 18px !important; padding: 4px 14px !important; }
    .emg-field { margin-bottom: 14px !important; }
    .emg-field > span:first-child { font-size: 15px !important; }
    .emg-value { font-size: 18px !important; }
    .emg-med { font-size: 16px !important; padding: 6px 12px !important; margin-bottom: 6px !important; }
    .emg-ins { font-size: 16px !important; }
}

/* ===== 看板子页?===== */
.dash-section { margin-bottom: 0; }
.dash-section-body {
    display: flex;
    flex-direction: column;
    gap: 20px;
}
.dash-section-body > * {
    width: 100%;
    margin-bottom: 0;
}

/* ===== AI看板卡片 ===== */
.dash-card-ai {
    border: 1px solid var(--line);
    border-left: 3px solid var(--accent);
    padding: 22px 24px;
    transition: box-shadow 0.25s var(--ease), border-color 0.25s var(--ease);
}
.dash-card-ai:hover {
    box-shadow: var(--shadow-md);
    border-color: var(--line-strong);
    border-left-color: var(--accent);
}

/* 卡片标题?*/
.dash-card-header {
    margin-bottom: 18px;
    gap: 8px;
    flex-wrap: wrap;
}
.dash-card-icon {
    width: 32px;
    height: 32px;
    border-radius: var(--r-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    flex-shrink: 0;
}
.dash-icon-purple {
    background: var(--accent-wash);
}
.dash-card-sub {
    font-size: 12px;
    color: var(--ink-faint);
    font-weight: normal;
    flex: 1;
    min-width: 0;
}
.dash-card-toggle {
    font-size: 12px;
    color: var(--ink-faint);
    cursor: pointer;
    margin-left: auto;
}
.dash-refresh-btn {
    font-size: 12px !important;
    padding: 4px 12px !important;
    margin-left: auto;
}
.dash-patrol-header {
    justify-content: space-between;
}
.dash-patrol-btn {
    font-size: 13px !important;
    padding: 6px 16px !important;
}

/* ===== AI备忘?===== */
.memo-input-row {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}
.memo-input {
    flex: 1;
    min-width: 200px;
    padding: 12px 16px;
    border: 1px solid var(--line-strong);
    border-radius: var(--r-sm);
    font-size: 15px;
    font-family: var(--font-body);
    transition: border-color 0.2s var(--ease), box-shadow 0.2s var(--ease);
    background: var(--surface);
    color: var(--ink);
}
.memo-input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-glow);
}
.memo-voice-active {
    background: var(--danger) !important;
    color: #fff !important;
    white-space: nowrap;
}
.memo-examples {
    margin-top: 10px;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}
.memo-example-chip {
    font-size: 12px;
    padding: 4px 12px;
    background: var(--accent-wash);
    border-radius: var(--r-pill);
    cursor: pointer;
    color: var(--accent);
    transition: background 0.2s var(--ease);
}
.memo-example-chip:hover {
    background: var(--accent-glow);
}
.memo-error {
    color: var(--danger);
    font-size: 13px;
    margin-top: 8px;
}
.memo-preview {
    margin-top: 14px;
    padding: 18px;
    background: var(--accent-wash);
    border-radius: var(--r-md);
    border: 1px solid rgba(124, 58, 237, 0.12);
}
.memo-preview-title {
    margin-bottom: 12px;
    font-size: 14px;
    font-weight: 600;
    color: var(--accent-strong);
}
.memo-preview-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px 16px;
    font-size: 14px;
}
.memo-preview-label {
    color: var(--ink-soft);
}
.memo-preview-desc {
    margin-top: 10px;
    font-size: 13px;
    color: var(--ink-soft);
}
.memo-preview-actions {
    margin-top: 14px;
    display: flex;
    gap: 8px;
}

/* ===== Agent执行追踪 - 统计?===== */
.tracking-stat-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-bottom: 18px;
}
.tracking-stat-card {
    border-radius: var(--r-md);
    padding: 16px 14px;
    text-align: center;
    transition: transform 0.2s var(--ease);
    border: 1px solid transparent;
}
.tracking-stat-card:hover {
    transform: translateY(-2px);
}
.tracking-stat-purple {
    background: var(--accent-wash);
    border-color: rgba(124, 58, 237, 0.1);
}
.tracking-stat-green {
    background: var(--ok-wash);
    border-color: rgba(22, 163, 74, 0.1);
}
.tracking-stat-amber {
    background: var(--warn-wash);
    border-color: rgba(217, 119, 6, 0.1);
}
.tracking-stat-num {
    font-family: var(--font-display);
    font-size: 28px;
    font-weight: 700;
    line-height: 1.1;
    letter-spacing: -0.03em;
}
.tracking-stat-purple .tracking-stat-num { color: var(--accent); }
.tracking-stat-green .tracking-stat-num { color: var(--ok); }
.tracking-stat-amber .tracking-stat-num { color: var(--warn); }
.tracking-stat-label {
    font-size: 13px;
    color: var(--ink-soft);
    margin-top: 4px;
}
.tracking-stat-sub {
    font-size: 11px;
    color: var(--ink-faint);
    margin-top: 6px;
}

/* ===== 下次执行时间 ===== */
.tracking-next-grid {
    display: flex;
    gap: 12px;
    margin-bottom: 18px;
    flex-wrap: wrap;
}
.tracking-next-item {
    flex: 1;
    min-width: 200px;
    background: var(--surface-sunken);
    border-radius: var(--r-md);
    padding: 12px 16px;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: background 0.2s var(--ease);
}
.tracking-next-item:hover {
    background: var(--accent-wash);
}
.tracking-next-icon {
    font-size: 18px;
    flex-shrink: 0;
}
.tracking-next-label {
    font-size: 12px;
    color: var(--ink-soft);
}
.tracking-next-time {
    font-size: 14px;
    font-weight: 600;
    color: var(--ink);
    margin-top: 2px;
}

/* ===== 服药提醒 ===== */
.med-track-card {
    margin-bottom: 18px;
    padding: 14px 16px;
    background: #eff6ff;
    border-radius: var(--r-md);
    border: 1px solid #bfdbfe;
}
.med-track-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}
.med-track-title {
    font-size: 13px;
    font-weight: 600;
    color: #1e40af;
}
.med-track-count {
    font-size: 12px;
    color: #1e40af;
}
.med-track-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.med-track-item {
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--surface);
    border-radius: var(--r-sm);
    padding: 10px 14px;
    transition: box-shadow 0.2s var(--ease);
}
.med-track-item:hover {
    box-shadow: var(--shadow-sm);
}
.med-track-info {
    flex: 1;
    min-width: 0;
}
.med-track-name {
    font-size: 13px;
    font-weight: 500;
    color: #1e3a5f;
}
.med-track-meta {
    font-size: 11px;
    color: #64748b;
    margin-top: 2px;
}
.med-track-times {
    display: flex;
    gap: 4px;
    flex-shrink: 0;
    flex-wrap: wrap;
    justify-content: flex-end;
}
.med-track-time {
    font-size: 11px;
    padding: 3px 10px;
    border-radius: var(--r-sm);
    background: #f1f5f9;
    color: #64748b;
    transition: all 0.2s var(--ease);
}
.med-track-time-done {
    background: var(--ok-wash);
    color: var(--ok);
    font-weight: 500;
}
.med-track-empty {
    font-size: 12px;
    color: #64748b;
    padding: 6px 0;
}

/* ===== 巡检历史 ===== */
.patrol-history {
    margin-bottom: 18px;
}
.patrol-history-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--ink-soft);
    margin-bottom: 10px;
}
.patrol-history-tags {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}
.patrol-history-tag {
    background: var(--surface-sunken);
    border-radius: var(--r-sm);
    padding: 6px 14px;
    font-size: 12px;
    border: 1px solid var(--line);
    display: flex;
    align-items: center;
    gap: 6px;
    transition: border-color 0.2s var(--ease);
}
.patrol-history-tag:hover {
    border-color: var(--line-strong);
}
.patrol-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}
.patrol-dot-auto {
    background: var(--ok);
}
.patrol-dot-manual {
    background: var(--accent);
}
.patrol-history-time {
    color: var(--ink-soft);
}
.patrol-history-tokens {
    color: var(--ink-faint);
    font-family: var(--font-mono);
}

/* ===== 提醒渠道分布 ===== */
.channel-dist {
    margin-bottom: 18px;
}
.channel-dist-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--ink-soft);
    margin-bottom: 10px;
}
.channel-dist-tags {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}
.channel-dist-tag {
    background: var(--surface-sunken);
    border-radius: var(--r-sm);
    padding: 8px 16px;
    font-size: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}
.channel-wx { color: var(--ok); font-weight: 500; }
.channel-sms { color: #2563eb; font-weight: 500; }
.channel-other { color: var(--accent); font-weight: 500; }
.channel-dist-count {
    color: var(--ink-faint);
}

/* ===== 事务提醒进度 ===== */
.affair-track-list {
    /* container */
}
.affair-track-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--ink-soft);
    margin-bottom: 10px;
}
.affair-track-item {
    background: var(--surface-sunken);
    border-radius: var(--r-md);
    padding: 12px 16px;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 14px;
    transition: background 0.2s var(--ease);
}
.affair-track-item:hover {
    background: var(--accent-wash);
}
.affair-track-info {
    flex: 1;
    min-width: 0;
}
.affair-track-name {
    font-size: 13px;
    font-weight: 500;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: var(--ink);
}
.affair-track-meta {
    font-size: 11px;
    color: var(--ink-faint);
    margin-top: 3px;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}
.affair-track-days {
    font-weight: 500;
}
.days-overdue { color: var(--danger); }
.days-urgent { color: var(--warn); }
.days-normal { color: var(--ink-soft); }
.affair-track-last {
    color: var(--accent) !important;
}
.affair-track-progress {
    width: 120px;
    flex-shrink: 0;
}
.affair-track-bar {
    background: var(--line);
    border-radius: var(--r-pill);
    height: 8px;
    overflow: hidden;
}
.affair-track-bar-fill {
    height: 100%;
    border-radius: var(--r-pill);
    transition: width 0.3s var(--ease);
}
.fill-complete { background: var(--ok); }
.fill-active { background: var(--accent); }
.fill-idle { background: var(--line-strong); }
.affair-track-status {
    width: 60px;
    flex-shrink: 0;
    text-align: right;
}
.track-status-done {
    font-size: 11px;
    padding: 3px 10px;
    border-radius: var(--r-sm);
    background: var(--ok-wash);
    color: var(--ok);
}
.track-status-active {
    font-size: 11px;
    padding: 3px 10px;
    border-radius: var(--r-sm);
    background: var(--accent-wash);
    color: var(--accent);
}
.track-status-idle {
    font-size: 11px;
    padding: 3px 10px;
    border-radius: var(--r-sm);
    background: var(--surface-sunken);
    color: var(--ink-faint);
}

/* ===== Agent巡检报告 ===== */
.patrol-loading {
    text-align: center;
    padding: 30px 20px;
    color: var(--accent);
}
.patrol-loading-icon {
    font-size: 28px;
    animation: spin 1s linear infinite;
}
.patrol-loading p {
    margin-top: 10px;
}
.patrol-report {
    padding: 4px 0;
}
.patrol-badge {
    display: inline-block;
    font-size: 11px;
    padding: 3px 10px;
    border-radius: var(--r-sm);
    margin-bottom: 12px;
    font-weight: 500;
}
.patrol-badge-auto {
    background: var(--ok-wash);
    color: var(--ok);
}
.patrol-badge-manual {
    background: var(--accent-wash);
    color: var(--accent);
}
.patrol-report-body {
    background: var(--accent-wash);
    border-radius: var(--r-md);
    padding: 20px;
    font-size: 14px;
    line-height: 1.7;
    overflow-x: auto;
    border: 1px solid rgba(124, 58, 237, 0.08);
}
.patrol-report-meta {
    margin-top: 12px;
    font-size: 12px;
    color: var(--ink-faint);
}
.patrol-empty {
    text-align: center;
    padding: 30px 20px;
    color: var(--ink-faint);
}

/* ===== 响应?===== */
@media (max-width: 768px) {
    .tracking-stat-grid {
        grid-template-columns: 1fr !important;
    }
    .tracking-next-grid {
        flex-direction: column;
    }
    .affair-track-progress {
        display: none;
    }
    .memo-preview-grid {
        grid-template-columns: 1fr !important;
    }
}

/* ============================================================
    v2 通用优化?- 追加于style.css尾部
    ============================================================ */

/* -- 间距辅助 -- */
.card-mb { margin-bottom: 20px; }
.card-mt { margin-top: 20px; }
.btn-mt { margin-top: 12px; }
.card-para { margin-bottom: 12px; }
.skeleton-pt { padding: 12px 0; }
.text-soft { color: var(--ink-soft); }
.text-danger { color: #dc2626; }

/* -- 统计卡片色条 + 数字颜色 -- */
.stat-card-green { border-left: solid #16a34a; }
.stat-card-green { border-left: solid #16a34a; }
.stat-card-green { border-left: solid #16a34a; }
.stat-card-green { border-left: 4px solid #16a34a; }
.stat-card-amber { border-left: 4px solid #d97706; }
.stat-card-red { border-left: 4px solid #dc2626; }
.stat-card-purple { border-left: 4px solid #7c3aed; }
.stat-color-green { color: #16a34a; }
.stat-color-amber { color: #d97706; }
.stat-color-red { color: #dc2626; }
.stat-color-purple { color: #7c3aed; }

/* -- 卡片标题次要文字 -- */
.card-title-sub { font-size: 12px; color: var(--ink-faint); font-weight: normal; margin-left: 8px; }

/* -- 蓝色边框卡片 -- */
.card-blue-border { margin-top: 20px; border: 2px solid var(--accent); border-radius: var(--r-md); }

/* -- 骨架屏变?-- */
.skeleton-line-tall { height: 48px; }

/* -- 空状态提?-- */
.empty-hint { font-size: 12px; color: var(--ink-faint); }

/* ===== 知识?===== */
.kb-stats-label { font-size: 13px; color: var(--ink-faint); }
.card-accent-border { margin-bottom: 20px; border: 866px; border: 2px solid var(--accent); }
.kb-quick-suggest { display: flex; flex-wrap: wrap; gap: 6px; }
.kb-chip { font-size: 12px; padding: 3px 10px; background: var(--accent-wash); border-radius: 12px; cursor: pointer; color: var(--accent); transition: all; }
.kb-chip { font-size: 12px; padding: 3px 10px; background: var(--accent-wash); border-radius: 12px; cursor: pointer; color: var(--accent); transition: all; }
.kb-chip { font-size: 12px; padding: 3px; }
.kb-chip { }
.kb-chip { font-size: 12px; padding: 3px 10px; background: var(--accent-wash); border-radius: 12px; cursor: pointer; color: var(--accent); transition: all 0.2s var(--ease); }
.kb-chip:hover { background: var(--accent); color: #fff; }
.kb-answer-box { margin-top: 16px; padding: 16px; background: #f9f5ff; border-radius: 10px; }
.kb-answer-title { margin-bottom: 10px; color: var(--accent); font-size: 15px; }
.kb-answer-body { font-size: 14px; line-height: 1.914; }
.kb-answer-body { font-size: 14px; line-height: 1.8; overflow-x: auto; }
.kb-answer-sources { margin-top: 12px; padding-top: 10px; border-top: 1px dashed var(--line-strong); }
.kb-source-label { font-size: 12px; color: var(--ink-faint); }
.kb-source-item { }
.kb-source-item { font-size: 12px; color: var(--accent); margin-left: 6px; }
.kb-token-hint { margin-top: 6px; font-size: 11px; color: var(--ink-faint); }
.kb-filter-bar { display: flex; gap: 8px; margin-bottom: 16px; flex-wrap: wrap; }
.kb-empty { text-align: center; }
.kb-empty { text-align: center; }
.kb-empty { text-align: center; }
.kb-empty { text-align: center; padding: 40px; color: var(--ink-faint); }
.kb-entry-list { display: flex; flex-direction: column; gap: 12px; }
.kb-entry-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.kb-entry-title { font-size: 15px; color: var(--ink); }
.kb-entry-cat { }
.kb-entry-cat { }
.kb-entry-cat { }
.kb-entry-cat { }
.kb-entry-cat { font-size: 11px; padding: 866px; }
.kb-entry-cat { font-size: 11px; }
.kb-entry-cat { font-size: 11px; }
.kb-entry-cat { font-size: 11px; }
.kb-entry-cat { font-size: 11px; }
.kb-entry-cat { font-size: 11px; padding: 2px 8px; background: var(--accent-wash); color: var(--accent); border-radius: 8px; }
.kb-entry-content { }
.kb-entry-content { font-size: 13px; color: var(--ink-soft); line-height: 1.8; white-space: pre-wrap; max-height: 120px; overflow: hidden; text-overflow: ellipsis; }
.kb-entry-meta { margin-top: 8px; font-size: 11px; color: var(--ink-faint); }