/* ═══════════════════════════════════════
   透明舱 - 样式
   ═══════════════════════════════════════ */

:root {
    --primary: #6366f1;
    --primary-dark: #4f46e5;
    --secondary: #ec4899;
    --bg: #f8fafc;
    --card-bg: #ffffff;
    --card: #ffffff;
    --text: #1e293b;
    --text-light: #64748b;
    --border: #e2e8f0;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --radius: 12px;
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.06), 0 1px 2px rgba(0, 0, 0, 0.04);
    --shadow-lg: 0 4px 12px rgba(0, 0, 0, 0.08);
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, "PingFang SC",
        "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", sans-serif;
    background: var(--bg);
    color: var(--text);
    font-size: 15px;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

/* ─── 登录页渐变背景 ─── */
#login-page {
    background: linear-gradient(135deg, #eef2ff 0%, #fdf2f8 50%, #f0fdfa 100%);
}

/* ─── 页面切换 ─── */
.page {
    display: none;
    min-height: 100vh;
}

.page.active {
    display: block;
}

/* ═══════════ 登录页 ═══════════ */
.login-container {
    max-width: 380px;
    margin: 8vh auto;
    padding: 40px 32px;
    background: var(--card-bg);
    border-radius: 20px;
    box-shadow: var(--shadow-lg);
    text-align: center;
}

.login-logo .logo-icon {
    font-size: 48px;
    margin-bottom: 8px;
}

.login-logo h1 {
    font-size: 28px;
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 4px;
}

.login-subtitle {
    color: var(--text-light);
    margin-bottom: 32px;
    font-size: 14px;
}

.login-form {
    text-align: left;
}

.login-note {
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid var(--border);
    color: var(--text-light);
    font-size: 12px;
}

/* ─── 表单 ─── */
.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-light);
    margin-bottom: 6px;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 10px 14px;
    border: 1.5px solid var(--border);
    border-radius: 10px;
    font-size: 15px;
    font-family: inherit;
    transition: border-color 0.2s;
    background: var(--card-bg);
    color: var(--text);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary);
}

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

.form-row .form-group {
    flex: 1;
}

/* ─── 按钮 ─── */
.btn {
    display: inline-block;
    padding: 10px 20px;
    border: none;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white;
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.3);
}

.btn-primary:hover {
    background: linear-gradient(135deg, var(--primary-dark), #4338ca);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.4);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-outline {
    background: transparent;
    color: var(--primary);
    border: 1.5px solid var(--primary);
}

.btn-outline:hover {
    background: #eef2ff;
}

.btn-danger {
    background: linear-gradient(135deg, #f43f5e, #e11d48);
    color: white;
    box-shadow: 0 2px 8px rgba(244, 63, 94, 0.3);
}

.btn-danger:hover {
    transform: translateY(-1px);
}

.btn-primary:disabled {
    background: var(--border);
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.btn-block {
    width: 100%;
    display: block;
}

.btn-icon {
    background: none;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 6px 10px;
    cursor: pointer;
    font-size: 14px;
    color: var(--text-light);
    transition: all 0.2s;
}

.btn-icon:hover {
    background: var(--bg);
    color: var(--text);
}

/* ═══════════ 主应用布局 ═══════════ */
.app-header {
    background: var(--card-bg);
    padding: 14px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: var(--shadow);
}

.header-logo {
    font-size: 18px;
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: 0.5px;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.user-badge {
    padding: 4px 12px;
    background: var(--bg);
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
}

/* ─── 标签导航 ─── */
.tab-nav {
    display: flex;
    background: var(--card-bg);
    border-bottom: 1px solid var(--border);
    overflow-x: auto;
    position: sticky;
    top: 53px;
    z-index: 99;
}

.tab-btn {
    flex: 1;
    min-width: 72px;
    padding: 12px 8px;
    background: none;
    border: none;
    border-bottom: 2.5px solid transparent;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-light);
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
    position: relative;
}

.tab-btn.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
    font-weight: 600;
}

.app-content {
    max-width: 720px;
    margin: 0 auto;
    padding: 20px 16px 40px;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

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

/* ─── 卡片 ─── */
.card {
    background: var(--card-bg);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    margin-bottom: 16px;
    overflow: hidden;
    border: 1px solid rgba(226, 232, 240, 0.6);
    transition: box-shadow 0.25s ease;
}

.card:hover {
    box-shadow: var(--shadow-lg);
}

.card-header {
    padding: 16px 20px 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}

.card-header h3 {
    font-size: 16px;
    font-weight: 700;
}

.card-body {
    padding: 16px 20px 20px;
}

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

.header-controls input[type="date"] {
    padding: 6px 10px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 13px;
    font-family: inherit;
}

/* ─── 总览 ─── */
.date-picker-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-bottom: 16px;
}

.date-picker-row input[type="date"] {
    padding: 8px 14px;
    border: 1.5px solid var(--border);
    border-radius: 10px;
    font-size: 14px;
    font-family: inherit;
    background: var(--card-bg);
}

.dashboard-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 16px;
    margin-bottom: 16px;
}

/* 总览四宫格：桌面 2×2，手机 1 列 */
.dashboard-grid4 {
    grid-template-columns: repeat(2, 1fr);
    align-items: stretch;
}
.dashboard-grid4 .card {
    display: flex;
    flex-direction: column;
}
.dashboard-grid4 .card-body {
    flex: 1;
    overflow: hidden;
}
.dashboard-grid4 .partner-row {
    padding: 7px 8px;
    gap: 8px;
}

.summary-card .card-body {
    min-height: 80px;
}

.placeholder-text {
    color: var(--text-light);
    font-size: 14px;
    text-align: center;
    padding: 20px 0;
}

/* ─── 花销 ─── */
.expense-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid var(--border);
}

.expense-item:last-child {
    border-bottom: none;
}

.expense-item-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.expense-user-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.expense-info {
    display: flex;
    flex-direction: column;
}

.expense-desc {
    font-size: 14px;
    font-weight: 500;
}

.expense-meta {
    font-size: 12px;
    color: var(--text-light);
}

.expense-amount {
    font-size: 16px;
    font-weight: 700;
    color: var(--text);
}

.expense-total-bar {
    margin-top: 12px;
    padding: 12px 16px;
    background: var(--bg);
    border-radius: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.expense-total-label {
    font-size: 13px;
    color: var(--text-light);
}

.expense-total-amount {
    font-size: 20px;
    font-weight: 700;
    color: var(--primary);
}

/* ─── 行踪 ─── */
.checkin-buttons {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.checkin-buttons .btn {
    flex: 1;
    min-width: 140px;
}

.tracking-status {
    margin-top: 12px;
    font-size: 13px;
    color: var(--text-light);
    display: none;
}

.tracking-status.active {
    display: block;
    color: var(--success);
    font-weight: 500;
    animation: pulse 2.5s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.55; }
}

.map-container {
    width: 100%;
    height: 300px;
    border-radius: 10px;
    margin-bottom: 16px;
    background: var(--bg);
    border: 1px solid var(--border);
    overflow: hidden;
}

/* ═══ 双方位置地图卡片（我们的位置） ═══ */
.both-map-container {
    width: 100%;
    height: 330px;
    border-radius: 10px;
    margin-bottom: 12px;
    background: #f8fafc;
    border: 1px solid var(--border);
    overflow: hidden;
    position: relative;
}
.bmap-svg {
    width: 100%;
    height: 100%;
    display: block;
}
.both-distance-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 10px 12px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 10px;
    margin-bottom: 8px;
}
.bmap-chip {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
    flex: 1;
}
.bmap-avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 14px;
    flex-shrink: 0;
}
.bmap-chip-info {
    display: flex;
    flex-direction: column;
    min-width: 0;
    line-height: 1.35;
}
.bmap-chip-info b { font-size: 13px; color: var(--text); }
.bmap-place {
    font-size: 12px;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 130px;
}
.bmap-time { font-size: 10px; color: var(--text-soft, #94a3b8); }
.bmap-dist {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 4px 10px;
    background: linear-gradient(135deg, #eef2ff, #e0e7ff);
    border-radius: 10px;
    flex-shrink: 0;
}
.bmap-dist-num { font-size: 14px; font-weight: 700; color: #4338ca; white-space: nowrap; }
.bmap-dist-sub { font-size: 10px; color: #6366f1; }
@media (max-width: 520px) {
    .both-map-container { height: 280px; }
    .bmap-place { max-width: 90px; }
    .bmap-dist-num { font-size: 12px; }
}

.checkin-result {
    margin-top: 12px;
    padding: 12px 16px;
    border-radius: 10px;
    font-size: 14px;
    display: none;
}

.checkin-result.success {
    display: block;
    background: #ecfdf5;
    color: #065f46;
    border: 1px solid #a7f3d0;
}

.checkin-result.error {
    display: block;
    background: #fef2f2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

.location-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px 0;
    border-bottom: 1px solid var(--border);
}

.location-item:last-child {
    border-bottom: none;
}

.location-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 14px;
    font-weight: 600;
    flex-shrink: 0;
}

.location-content {
    flex: 1;
}

.location-address {
    font-size: 14px;
    font-weight: 500;
}

.location-meta {
    font-size: 12px;
    color: var(--text-light);
}

.section-hint {
    font-size: 13px;
    color: var(--text-light);
    margin-bottom: 16px;
    line-height: 1.5;
}

/* ─── 聊天分析 ─── */
#chat-input {
    resize: vertical;
    font-family: inherit;
    min-height: 140px;
}

.risk-badge {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

.risk-badge.normal {
    background: #ecfdf5;
    color: #065f46;
}

.risk-badge.low {
    background: #eff6ff;
    color: #1e40af;
}

.risk-badge.medium {
    background: #fffbeb;
    color: #92400e;
}

.risk-badge.high {
    background: #fef2f2;
    color: #991b1b;
}

.analysis-stats {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 16px;
}

.stat-chip {
    padding: 8px 16px;
    background: var(--bg);
    border-radius: 10px;
    text-align: center;
    min-width: 90px;
}

.stat-value {
    font-size: 20px;
    font-weight: 700;
    display: block;
}

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

.flagged-message {
    padding: 14px;
    border-radius: 10px;
    margin-bottom: 12px;
    border: 1px solid var(--border);
    background: var(--bg);
}

.flagged-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
    flex-wrap: wrap;
    gap: 6px;
}

.flagged-sender {
    font-size: 13px;
    font-weight: 600;
}

.flagged-time {
    font-size: 12px;
    color: var(--text-light);
}

.flagged-content {
    font-size: 14px;
    padding: 10px 12px;
    background: var(--card-bg);
    border-radius: 8px;
    margin-bottom: 10px;
    border-left: 3px solid var(--warning);
    white-space: pre-wrap;
    word-break: break-all;
}

.flagged-content.severity-high {
    border-left-color: var(--danger);
}

.flagged-content.severity-medium {
    border-left-color: var(--warning);
}

.flagged-content.severity-low {
    border-left-color: #3b82f6;
}

.issue-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.issue-tag {
    font-size: 11px;
    padding: 3px 10px;
    border-radius: 12px;
    font-weight: 500;
}

.issue-tag.high {
    background: #fef2f2;
    color: #991b1b;
}

.issue-tag.medium {
    background: #fffbeb;
    color: #92400e;
}

.issue-tag.low {
    background: #eff6ff;
    color: #1e40af;
}

/* ─── 设置 ─── */
.user-info-box {
    padding: 16px;
    background: var(--bg);
    border-radius: 10px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.section-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
    margin: 20px 0 12px;
}

.result-text {
    margin-top: 12px;
    font-size: 13px;
    display: none;
    padding: 10px 14px;
    border-radius: 8px;
}

.result-text.success {
    display: block;
    background: #ecfdf5;
    color: #065f46;
}

.result-text.error {
    display: block;
    background: #fef2f2;
    color: #991b1b;
}

/* ─── Toast ─── */
.toast {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%) translateY(80px);
    background: var(--text);
    color: white;
    padding: 12px 24px;
    border-radius: 10px;
    font-size: 14px;
    box-shadow: var(--shadow-lg);
    transition: transform 0.3s ease;
    z-index: 1000;
    max-width: 90vw;
}

.toast.show {
    transform: translateX(-50%) translateY(0);
}

/* ─── 错误文本 ─── */
.error-text {
    color: var(--danger);
    font-size: 13px;
    margin-top: 12px;
    text-align: center;
    display: none;
}

.error-text.show {
    display: block;
}

/* ─── 响应式 ─── */
@media (max-width: 640px) {
    .form-row {
        flex-direction: column;
        gap: 0;
    }

    .app-content {
        padding: 16px 12px calc(76px + env(safe-area-inset-bottom, 0px));
    }

    .dashboard-cards {
        grid-template-columns: 1fr;
    }

    /* 手机端：顶部标签栏变底部大导航 */
    .tab-nav {
        position: fixed;
        top: auto;
        bottom: 0;
        left: 0;
        right: 0;
        border-bottom: none;
        border-top: 1px solid var(--border);
        padding-bottom: env(safe-area-inset-bottom, 0px);
        box-shadow: 0 -4px 16px rgba(0, 0, 0, 0.06);
        background: var(--card-bg);
    }

    .tab-btn {
        font-size: 11px;
        min-width: 0;
        padding: 9px 2px 7px;
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 2px;
        border-bottom: none;
        border-top: 2.5px solid transparent;
    }

    .tab-btn.active {
        border-top-color: var(--primary);
        border-bottom-color: transparent;
    }

    .login-container {
        margin: 4vh 16px;
        padding: 32px 24px;
    }
}

/* ═══════════ 今日待办 ═══════════ */
.todo-card .card-header h3 {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.todo-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 10px;
    border-radius: 10px;
    margin-bottom: 6px;
    transition: background 0.15s;
}

.todo-item:not(.done):hover {
    background: var(--bg);
}

.todo-item.done {
    opacity: 0.55;
}

.todo-item.urgent {
    background: rgba(239, 68, 68, 0.07);
    border: 1px solid rgba(239, 68, 68, 0.25);
}

.todo-mark {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    flex-shrink: 0;
    background: var(--bg);
    color: var(--text-light);
}

.todo-item.done .todo-mark {
    background: var(--primary);
    color: white;
}

.todo-item.urgent .todo-mark {
    background: var(--danger, #ef4444);
    color: white;
    animation: todoPulse 1.6s infinite;
}

@keyframes todoPulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.35); }
    50% { box-shadow: 0 0 0 6px rgba(239, 68, 68, 0); }
}

.todo-icon {
    font-size: 16px;
    flex-shrink: 0;
}

.todo-text {
    flex: 1;
    font-size: 14px;
    line-height: 1.45;
}

.todo-item.urgent .todo-text {
    font-weight: 600;
    color: var(--danger, #dc2626);
}

.todo-go {
    font-size: 12px;
    color: var(--primary);
    font-weight: 600;
    flex-shrink: 0;
}

.todo-all-done {
    text-align: center;
    padding: 10px 0 4px;
    font-size: 14px;
    color: var(--text-light);
}

/* Tab 红点 */
.tab-badge {
    display: none;
    align-items: center;
    justify-content: center;
    min-width: 17px;
    height: 17px;
    padding: 0 4px;
    border-radius: 9px;
    background: #ef4444;
    color: white;
    font-size: 10px;
    font-weight: 700;
    line-height: 1;
    position: absolute;
    top: 6px;
    right: 10px;
    animation: todoPulse 1.6s infinite;
}

/* ═══════════ 花销区间速报 ═══════════ */
.range-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin-bottom: 16px;
}

.range-btn {
    padding: 14px 8px;
    border: 2px solid var(--border);
    border-radius: var(--radius);
    background: var(--card-bg);
    color: var(--text);
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s ease;
}

.range-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.range-btn.selected {
    border-color: var(--primary);
    background: var(--primary);
    color: #fff;
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.35);
}

.photo-preview {
    display: block;
    max-width: 100%;
    max-height: 200px;
    border-radius: 8px;
    margin-top: 8px;
    object-fit: cover;
}

.expense-photo-thumb {
    width: 44px;
    height: 44px;
    border-radius: 8px;
    object-fit: cover;
    margin-left: 8px;
    border: 1px solid var(--border);
}

/* ═══════════ 行踪记录状态 ═══════════ */
.track-pill {
    font-size: 12px;
    font-weight: 600;
    padding: 3px 10px;
    border-radius: 999px;
}

.track-pill.on {
    background: #d1fae5;
    color: #047857;
}

.track-pill.off {
    background: #fee2e2;
    color: #b91c1c;
}

.warn-text {
    color: var(--danger);
}

/* ═══════════ 聊天抽查 ═══════════ */
.quick-range-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 14px;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 13px;
}

.count-badge {
    background: var(--danger);
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    min-width: 22px;
    height: 22px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 6px;
}

.request-item {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 14px;
    margin-bottom: 14px;
    background: #fffbeb;
}

.request-item textarea {
    width: 100%;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 10px;
    font-size: 13px;
    font-family: inherit;
    resize: vertical;
    margin-bottom: 10px;
}

.request-meta {
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 8px;
}

.request-range {
    font-weight: 600;
    font-size: 14px;
}

.request-deadline {
    font-size: 12px;
    color: var(--danger);
}

.request-note {
    font-size: 13px;
    color: var(--text-light);
    font-style: italic;
    margin-bottom: 8px;
}

.status-pill {
    font-size: 12px;
    font-weight: 600;
    padding: 3px 10px;
    border-radius: 999px;
    white-space: nowrap;
}

.status-pill.warn {
    background: #fef3c7;
    color: #b45309;
}

.status-pill.ok {
    background: #d1fae5;
    color: #047857;
}

.status-pill.bad {
    background: #fee2e2;
    color: #b91c1c;
}

.expense-item.clickable {
    cursor: pointer;
    transition: background 0.15s ease;
}

.expense-item.clickable:hover {
    background: #f1f5f9;
    border-radius: 8px;
}

.contact-row {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 12px 14px;
    margin-bottom: 10px;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.contact-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 4px;
}

.contact-name {
    font-weight: 700;
    font-size: 15px;
}

/* ═══════════ 联系人快照 ═══════════ */
.snapshot-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 12px;
    margin-top: 12px;
}

.snapshot-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.snapshot-item img {
    width: 100%;
    height: 180px;
    object-fit: cover;
    border-radius: 10px;
    border: 1px solid var(--border);
    cursor: zoom-in;
    transition: transform 0.15s ease;
}

.snapshot-item img:hover {
    transform: scale(1.02);
}

.snapshot-meta {
    font-size: 12px;
    color: var(--text-light);
}

/* ═══════════ AI 自主筛查 ═══════════ */
.btn-lg {
    padding: 14px 20px;
    font-size: 16px;
    font-weight: 700;
    letter-spacing: 1px;
}

.screening-card {
    border: 1px solid color-mix(in srgb, var(--primary) 25%, transparent);
    background: linear-gradient(135deg,
        color-mix(in srgb, var(--primary) 5%, var(--card-bg)),
        var(--card-bg) 60%);
}

.verdict-banner {
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 14px;
    text-align: center;
}

.verdict-banner .verdict-label {
    font-size: 18px;
    font-weight: 800;
    margin-bottom: 6px;
}

.verdict-banner .verdict-text {
    font-size: 13px;
    line-height: 1.7;
    opacity: 0.9;
}

.verdict-banner .verdict-meta {
    font-size: 11px;
    margin-top: 8px;
    opacity: 0.6;
}

.verdict-clean {
    background: color-mix(in srgb, #10b981 14%, var(--card-bg));
    border: 1px solid #10b981;
    color: #047857;
}

.verdict-watch {
    background: color-mix(in srgb, #f59e0b 14%, var(--card-bg));
    border: 1px solid #f59e0b;
    color: #b45309;
}

.verdict-alert {
    background: color-mix(in srgb, #ef4444 12%, var(--card-bg));
    border: 1px solid #ef4444;
    color: #b91c1c;
}

.signal-row {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    padding: 8px 10px;
    border-radius: 8px;
    background: var(--bg);
    margin-bottom: 6px;
    font-size: 13px;
    line-height: 1.6;
}

.signal-row .risk-badge {
    flex-shrink: 0;
}

.signal-source {
    flex-shrink: 0;
    font-size: 11px;
    color: var(--text-light);
    padding-top: 3px;
    min-width: 52px;
}

.signal-text {
    flex: 1;
}

.screening-stat-row {
    display: flex;
    gap: 10px;
    margin: 10px 0;
}

.screening-stat-row .stat-chip {
    flex: 1;
}

.disclaimer {
    margin-top: 14px;
    padding-top: 10px;
    border-top: 1px dashed var(--border);
    font-size: 12px !important;
}

/* ═══════════ TA 的今日动态 ═══════════ */
.partner-card {
    border: 1px solid color-mix(in srgb, #ec4899 22%, transparent);
    background: linear-gradient(135deg,
        color-mix(in srgb, #ec4899 5%, var(--card-bg)),
        var(--card-bg) 60%);
}

.partner-row {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 10px;
    background: var(--bg);
    margin-bottom: 7px;
}

.partner-row.warn {
    background: color-mix(in srgb, #f59e0b 10%, var(--bg));
}

.partner-icon {
    font-size: 18px;
    flex-shrink: 0;
    padding-top: 1px;
}

.partner-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.partner-main {
    font-size: 14px;
    font-weight: 600;
    line-height: 1.5;
}

.partner-row.warn .partner-main {
    color: #b45309;
}

.partner-sub {
    font-size: 12px;
    color: var(--text-light);
    line-height: 1.5;
}

/* ═══════════ 原始聊天记录（可折叠） ═══════════ */
.raw-record {
    margin-top: 8px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--bg);
}

.raw-record summary {
    cursor: pointer;
    padding: 10px 12px;
    font-size: 13px;
    font-weight: 600;
    color: var(--primary);
    user-select: none;
}

.raw-record pre {
    margin: 0;
    padding: 4px 12px 12px;
    white-space: pre-wrap;
    word-break: break-all;
    font-size: 13px;
    line-height: 1.8;
    color: var(--text);
    max-height: 420px;
    overflow-y: auto;
    border-top: 1px dashed var(--border);
}

/* ═══════════ 健身塑形 ═══════════ */
.fitness-today-row {
    padding: 12px;
    border-radius: 12px;
    background: var(--bg);
    margin-bottom: 10px;
}

.fitness-today-head {
    display: flex;
    align-items: center;
    gap: 10px;
}

.fitness-today-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
    flex: 1;
    min-width: 0;
}

.fitness-today-title {
    font-size: 15px;
    font-weight: 600;
}

.fitness-moves {
    margin: 8px 0 0;
    font-size: 13px;
    line-height: 1.7;
    color: var(--text-light);
}

.fitness-week-user {
    margin-bottom: 14px;
}

.fitness-week-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 8px;
}

.fitness-week-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 6px;
}

.fit-day {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 8px 2px;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: var(--card-bg);
    text-align: center;
    min-width: 0;
}

.fit-day .fit-day-mark {
    font-size: 13px;
    font-weight: 700;
    color: var(--text-light);
}

.fit-day .fit-day-label {
    font-size: 11px;
    color: var(--text-light);
    line-height: 1.3;
    word-break: break-all;
}

.fit-day.rest {
    background: var(--bg);
    border-style: dashed;
}

.fit-day.done {
    background: color-mix(in srgb, #10b981 14%, var(--card-bg));
    border-color: #10b981;
}

.fit-day.done .fit-day-mark,
.fit-day.done .fit-day-label {
    color: #047857;
}

.fit-day.today {
    border-width: 2px;
    border-color: var(--primary);
}

/* 饮食统计卡 */
.diet-stat-card {
    padding: 12px;
    border-radius: 12px;
    background: var(--bg);
    margin-bottom: 10px;
}

.diet-stat-card.mine {
    border: 1px solid color-mix(in srgb, var(--primary) 30%, transparent);
}

.diet-stat-head {
    display: flex;
    align-items: center;
    gap: 10px;
}

.diet-kcal {
    font-size: 18px;
    font-weight: 800;
    margin-left: auto;
    white-space: nowrap;
}

.diet-kcal small {
    font-size: 11px;
    font-weight: 400;
    color: var(--text-light);
}

.diet-kcal.good { color: #059669; }
.diet-kcal.over { color: #dc2626; }

.macro-bar {
    height: 6px;
    border-radius: 3px;
    background: var(--border);
    margin: 10px 0 8px;
    overflow: hidden;
}

.macro-fill {
    height: 100%;
    border-radius: 3px;
    background: var(--primary);
    transition: width .3s;
}

.macro-fill.good { background: #10b981; }
.macro-fill.over { background: #ef4444; }

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

.macro-chip {
    font-size: 12px;
    padding: 3px 8px;
    border-radius: 6px;
    background: var(--card-bg);
    border: 1px solid var(--border);
}

.macro-chip small {
    color: var(--text-light);
}

/* 饮食明细 */
.diet-meal-block {
    margin-bottom: 10px;
}

.diet-meal-label {
    display: inline-block;
    font-size: 12px;
    font-weight: 600;
    color: var(--primary);
    padding: 2px 8px;
    border-radius: 6px;
    background: color-mix(in srgb, var(--primary) 10%, transparent);
    margin-bottom: 6px;
}

.diet-del {
    color: var(--text-light);
    padding: 2px 6px;
}

.fp-metabolism {
    margin-top: 12px;
    padding: 10px 12px;
    border-radius: 10px;
    background: var(--bg);
    font-size: 13px;
    line-height: 1.7;
}

@media (max-width: 640px) {
    .fitness-week-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* ─── 食物网格选择器 ─── */
.food-picker-btn {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    width: 100%;
    padding: 10px 12px;
    border: 1.5px solid var(--border);
    border-radius: 10px;
    background: var(--card);
    cursor: pointer;
    font-size: 14px;
    color: var(--text);
    transition: border-color .15s;
}

.food-picker-btn:hover {
    border-color: var(--primary);
}

.food-picker-arrow {
    color: var(--text-light);
    font-size: 12px;
    flex-shrink: 0;
}

.food-picker {
    margin-top: 8px;
    padding: 12px;
    border: 1.5px solid var(--border);
    border-radius: 12px;
    background: var(--card);
}

.food-picker input {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 13px;
    margin-bottom: 10px;
    background: var(--bg);
    color: var(--text);
}

.food-cats {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 10px;
}

.food-cat-chip {
    padding: 4px 12px;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: transparent;
    font-size: 12px;
    color: var(--text-light);
    cursor: pointer;
    transition: all .15s;
}

.food-cat-chip.active {
    background: color-mix(in srgb, var(--primary) 12%, transparent);
    border-color: var(--primary);
    color: var(--primary);
    font-weight: 600;
}

.food-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    max-height: 280px;
    overflow-y: auto;
}

.food-card {
    display: flex;
    flex-direction: column;
    gap: 3px;
    padding: 8px 10px;
    border: 1.5px solid var(--border);
    border-radius: 10px;
    background: var(--bg);
    cursor: pointer;
    text-align: left;
    transition: all .15s;
}

.food-card:hover {
    border-color: var(--primary);
}

.food-card.selected {
    border-color: var(--primary);
    background: color-mix(in srgb, var(--primary) 10%, transparent);
}

.food-card-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
    line-height: 1.3;
}

.food-card-meta {
    font-size: 11px;
    color: var(--text-light);
}

.food-card.custom .food-card-name {
    color: var(--primary);
}

@media (max-width: 640px) {
    .food-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}


/* ─── 动作演示动画 v2 ─── */
.ex-s   { stroke: var(--text-light); fill: none; stroke-linecap: round; stroke-linejoin: round; }
.ex-sh  { stroke: var(--primary); fill: none; stroke-linecap: round; stroke-linejoin: round; opacity: .95; }
.ex-t   { fill: color-mix(in srgb, var(--text-light) 16%, transparent); stroke: var(--text-light); stroke-width: 2; }
.ex-hd   { fill: color-mix(in srgb, var(--text-light) 22%, transparent); stroke: var(--text-light); stroke-width: 2; }
.ex-j   { fill: var(--text-light); }
.ex-jh  { fill: var(--primary); }
.ex-eq  { stroke: #f59e0b; fill: none; stroke-linecap: round; }
.ex-eqf { fill: #f59e0b; }
.ex-mat { fill: color-mix(in srgb, var(--border) 55%, transparent); }
.ex-shad{ fill: color-mix(in srgb, var(--text-light) 15%, transparent); }
.ex-glow  { fill: var(--primary); filter: blur(7px); opacity: .35; animation: exPulse 1.7s ease-in-out infinite; }
.ex-glowc { fill: var(--primary); opacity: .6; animation: exPulseC 1.7s ease-in-out infinite; }
.ex-arc     { stroke: var(--primary); fill: none; stroke-width: 1.8; stroke-dasharray: 5 5; opacity: .5; }
.ex-arc-head{ fill: var(--primary); stroke: none; }
.ex-svg { width: 100%; height: auto; display: block; }

@keyframes exPulse  { 0%,100% { opacity: .18; } 50% { opacity: .45; } }
@keyframes exPulseC { 0%,100% { opacity: .4; }  50% { opacity: .85; } }

/* 旋转/位移关键帧（角度从 0 起，Push 从 -95 起） */
@keyframes exr5    { from { transform: rotate(0deg); } to { transform: rotate(5deg); } }
@keyframes exr9    { from { transform: rotate(0deg); } to { transform: rotate(9deg); } }
@keyframes exr12   { from { transform: rotate(0deg); } to { transform: rotate(12deg); } }
@keyframes exr18   { from { transform: rotate(0deg); } to { transform: rotate(18deg); } }
@keyframes exr20   { from { transform: rotate(0deg); } to { transform: rotate(20deg); } }
@keyframes exr22   { from { transform: rotate(0deg); } to { transform: rotate(22deg); } }
@keyframes exr24   { from { transform: rotate(0deg); } to { transform: rotate(24deg); } }
@keyframes exr34   { from { transform: rotate(0deg); } to { transform: rotate(34deg); } }
@keyframes exr55   { from { transform: rotate(0deg); } to { transform: rotate(55deg); } }
@keyframes exr72   { from { transform: rotate(0deg); } to { transform: rotate(72deg); } }
@keyframes exr75   { from { transform: rotate(0deg); } to { transform: rotate(75deg); } }
@keyframes exr80   { from { transform: rotate(0deg); } to { transform: rotate(80deg); } }
@keyframes exrN3   { from { transform: rotate(0deg); } to { transform: rotate(-3deg); } }
@keyframes exrN9   { from { transform: rotate(0deg); } to { transform: rotate(-9deg); } }
@keyframes exrN13  { from { transform: rotate(0deg); } to { transform: rotate(-13deg); } }
@keyframes exrN14  { from { transform: rotate(0deg); } to { transform: rotate(-14deg); } }
@keyframes exrN18  { from { transform: rotate(0deg); } to { transform: rotate(-18deg); } }
@keyframes exrN22  { from { transform: rotate(0deg); } to { transform: rotate(-22deg); } }
@keyframes exrN25  { from { transform: rotate(0deg); } to { transform: rotate(-25deg); } }
@keyframes exrN26  { from { transform: rotate(0deg); } to { transform: rotate(-26deg); } }
@keyframes exrN28  { from { transform: rotate(0deg); } to { transform: rotate(-28deg); } }
@keyframes exrN32  { from { transform: rotate(0deg); } to { transform: rotate(-32deg); } }
@keyframes exrN55  { from { transform: rotate(0deg); } to { transform: rotate(-55deg); } }
@keyframes exrN60  { from { transform: rotate(0deg); } to { transform: rotate(-60deg); } }
@keyframes exrN62  { from { transform: rotate(0deg); } to { transform: rotate(-62deg); } }
@keyframes exrN65  { from { transform: rotate(0deg); } to { transform: rotate(-65deg); } }
@keyframes exrN70  { from { transform: rotate(0deg); } to { transform: rotate(-70deg); } }
@keyframes exrN75  { from { transform: rotate(0deg); } to { transform: rotate(-75deg); } }
@keyframes exrN80  { from { transform: rotate(0deg); } to { transform: rotate(-80deg); } }
@keyframes exrN115 { from { transform: rotate(0deg); } to { transform: rotate(-115deg); } }
@keyframes exrN125 { from { transform: rotate(0deg); } to { transform: rotate(-125deg); } }
@keyframes exrPush { from { transform: rotate(-95deg); } to { transform: rotate(0deg); } }
@keyframes exSway  { from { transform: rotate(-1.6deg); } to { transform: rotate(1.6deg); } }
@keyframes exTwist { from { transform: rotate(-13deg); } to { transform: rotate(13deg); } }
@keyframes exty11  { from { transform: translateY(0); } to { transform: translateY(11px); } }
@keyframes exty12  { from { transform: translateY(0); } to { transform: translateY(12px); } }
@keyframes exty15  { from { transform: translateY(0); } to { transform: translateY(15px); } }
@keyframes exty16  { from { transform: translateY(0); } to { transform: translateY(16px); } }
@keyframes exty22  { from { transform: translateY(0); } to { transform: translateY(22px); } }
@keyframes exty24  { from { transform: translateY(0); } to { transform: translateY(24px); } }

/* 动画基类：缓动 + 循环 + 反向；名称与时长由 ar*/aty*、d* 类叠加 */
.anim {
    animation-timing-function: cubic-bezier(.45, .05, .55, .95);
    animation-iteration-count: infinite;
    animation-direction: alternate;
    animation-duration: 1.6s;
}
.d13 { animation-duration: 1.3s; }
.d14 { animation-duration: 1.4s; }
.d15 { animation-duration: 1.5s; }
.d16 { animation-duration: 1.6s; }
.d17 { animation-duration: 1.7s; }
.d18 { animation-duration: 1.8s; }
.d20 { animation-duration: 2s; }
.ar5    { animation-name: exr5; }
.ar9    { animation-name: exr9; }
.ar12   { animation-name: exr12; }
.ar18   { animation-name: exr18; }
.ar20   { animation-name: exr20; }
.ar22   { animation-name: exr22; }
.ar24   { animation-name: exr24; }
.ar34   { animation-name: exr34; }
.ar55   { animation-name: exr55; }
.ar72   { animation-name: exr72; }
.ar75   { animation-name: exr75; }
.ar80   { animation-name: exr80; }
.arN3   { animation-name: exrN3; }
.arN9   { animation-name: exrN9; }
.arN13  { animation-name: exrN13; }
.arN14  { animation-name: exrN14; }
.arN18  { animation-name: exrN18; }
.arN22  { animation-name: exrN22; }
.arN25  { animation-name: exrN25; }
.arN26  { animation-name: exrN26; }
.arN28  { animation-name: exrN28; }
.arN32  { animation-name: exrN32; }
.arN55  { animation-name: exrN55; }
.arN60  { animation-name: exrN60; }
.arN62  { animation-name: exrN62; }
.arN65  { animation-name: exrN65; }
.arN70  { animation-name: exrN70; }
.arN75  { animation-name: exrN75; }
.arN80  { animation-name: exrN80; }
.arN115 { animation-name: exrN115; }
.arN125 { animation-name: exrN125; }
.arPush { animation-name: exrPush; }
.aSway  { animation-name: exSway; }
.aTwist { animation-name: exTwist; }
.aty11  { animation-name: exty11; }
.aty12  { animation-name: exty12; }
.aty15  { animation-name: exty15; }
.aty16  { animation-name: exty16; }
.aty22  { animation-name: exty22; }
.aty24  { animation-name: exty24; }

/* 动作 chips */
.move-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.move-chip {
    padding: 5px 11px;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: var(--bg);
    font-size: 12.5px;
    color: var(--text);
    cursor: pointer;
    transition: all .15s;
}
.move-chip:hover { border-color: var(--primary); color: var(--primary); }
.move-chip .mc-spec { color: var(--text-light); font-size: 11px; margin-left: 3px; }
.move-chip.no-demo { cursor: default; opacity: .75; }
.move-chip.no-demo:hover { border-color: var(--border); color: var(--text); }

/* 真人演示图 */
.ex-view { border-radius: 12px; overflow: hidden; }
.ex-view-full { padding: 0; background: #e5e7eb; }
.ex-demo-img {
    display: block;
    width: 100%;
    height: auto;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    object-position: center 88%;  /* 裁掉底部水印 */
    background: #d1d5db;
}

/* 演示弹窗 */
.ex-modal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 1000;
    align-items: center;
    justify-content: center;
    padding: 16px;
}
.ex-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, .5);
}
.ex-modal-panel {
    position: relative;
    width: 100%;
    max-width: 540px;
    max-height: 88vh;
    overflow-y: auto;
    background: var(--card);
    border-radius: 16px;
    padding: 18px;
    box-shadow: 0 20px 60px rgba(15, 23, 42, .25);
}
.ex-modal-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 12px;
}
.ex-modal-title { font-size: 17px; font-weight: 700; color: var(--text); }
.ex-modal-sub { font-size: 12.5px; color: var(--text-light); margin-top: 2px; }
.ex-demo-views {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 10px;
}
.ex-view {
    border: 1.5px solid var(--border);
    border-radius: 12px;
    padding: 8px;
    background: var(--bg);
}
.ex-view-label {
    font-size: 11.5px;
    color: var(--text-light);
    text-align: center;
    margin-bottom: 4px;
    font-weight: 600;
}
.ex-demo-muscles { margin-top: 12px; display: flex; flex-wrap: wrap; gap: 6px; }

/* 要点 / 注意事项 */
.ex-demo-cues { margin-top: 10px; }
.ex-sec-title { font-size: 13px; font-weight: 700; margin: 10px 0 4px; color: #1e293b; }
.ex-sec-title.warn { color: #e8590c; }
.ex-cue-list { list-style: none; padding: 0; margin: 0; }
.ex-cue-list li {
    position: relative;
    padding-left: 20px;
    font-size: 12.5px;
    color: #334155;
    line-height: 1.7;
}
.ex-cue-list li::before {
    content: "✓";
    position: absolute;
    left: 2px;
    top: 0;
    color: #6366f1;
    font-weight: 700;
}
.ex-cue-list.warn li::before {
    content: "⚠";
    color: #e8590c;
}
.ex-cue-box {
    padding: 10px 12px;
    border-radius: 10px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    margin-bottom: 8px;
}
.ex-cue-box.warn {
    background: #fff7ed;
    border-color: #fed7aa;
}

/* ════════════════════════════════════════
   动作动画演示（关键帧火柴人：一眼看懂）
   ════════════════════════════════════════ */
.ex-stick-stage {
    position: relative;
    width: 100%;
    aspect-ratio: 1 / 1;
    border-radius: 12px;
    overflow: hidden;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
}
.ex-stick-svg {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}
/* 地面 */
.sk-floor { stroke: #cbd5e1; stroke-width: 1.2; stroke-linecap: round; }
/* 器械固定物（单杠/凳/龙门架） */
.sk-fixture { stroke: #94a3b8; stroke-width: 1.6; fill: none; stroke-linecap: round; }
/* 轨迹虚线 */
.sk-trail {
    fill: none;
    stroke: #06b6d4;
    stroke-width: 1.1;
    stroke-dasharray: 2 1.6;
    stroke-linecap: round;
    opacity: .8;
}
/* 方向箭头 */
.sk-arrow {
    fill: none;
    stroke: #f59e0b;
    stroke-width: 1.2;
    stroke-linecap: round;
    stroke-linejoin: round;
}
/* 人偶 */
.sk-torso { stroke: #1e293b; stroke-width: 4.6; stroke-linecap: round; fill: none; }
.sk-bone { stroke: #334155; stroke-width: 3.4; stroke-linecap: round; }
.sk-head { fill: #1e293b; }
.sk-joint { fill: #06b6d4; }
/* 器械（跟随手） */
.sk-equip { stroke: #6366f1; stroke-linecap: round; }
.sk-equip-dot { fill: #6366f1; }
.sk-ball { fill: #6366f1; opacity: .9; }
.sk-cable { stroke: #94a3b8; stroke-width: 1; stroke-dasharray: 1.6 1.2; }
/* 器械圆盘：哑铃片（小圆）/ 杠铃片（大圆）/ 杠铃杆轴心（小点） */
.sk-plate { fill: #eef2ff; stroke: #6366f1; stroke-width: 1.4; }
.sk-plate-lg { fill: #818cf8; stroke: #4f46e5; stroke-width: 1.6; opacity: .92; }
.sk-plate-sm { fill: #4f46e5; }

/* 阶段文字徽章（左上角大字） */
.ex-phase-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    background: rgba(30, 41, 59, .92);
    border-radius: 10px;
    padding: 7px 12px;
    display: flex;
    flex-direction: column;
    gap: 2px;
    z-index: 3;
    min-width: 74px;
}
.ex-phase-badge b {
    color: #fff;
    font-size: 15px;
    font-weight: 700;
    letter-spacing: 1px;
}
.ex-phase-badge span {
    color: #7dd3fc;
    font-size: 11px;
    font-weight: 600;
}
/* 视角标签 */
.ex-view-tag {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(99, 102, 241, .12);
    color: #4f46e5;
    font-size: 10.5px;
    font-weight: 600;
    padding: 3px 9px;
    border-radius: 8px;
    border: 1px solid rgba(99, 102, 241, .25);
    z-index: 3;
}
/* 参考图缩略图（右下角） */
.ex-ref-img {
    position: absolute;
    right: 10px;
    bottom: 10px;
    width: 27%;
    max-width: 130px;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    object-position: center 88%;
    border-radius: 10px;
    border: 2px solid #fff;
    box-shadow: 0 3px 10px rgba(15, 23, 42, .25);
    z-index: 3;
}
.ex-ref-tag {
    position: absolute;
    right: 10px;
    bottom: calc(10px + 27% - 18px);
    background: rgba(15, 23, 42, .7);
    color: #fff;
    font-size: 9px;
    padding: 2px 7px;
    border-radius: 6px;
    z-index: 4;
}
/* 暂停遮罩 */
.ex-stick-stage.paused::after {
    content: "⏸ 已暂停";
    position: absolute;
    bottom: 10px;
    left: 10px;
    padding: 3px 10px;
    background: rgba(0, 0, 0, .65);
    color: #fff;
    font-size: 11px;
    border-radius: 6px;
    z-index: 5;
    pointer-events: none;
}

/* 播放控制条 */
.ex-anim-bar {
    display: flex;
    gap: 6px;
    align-items: center;
    margin-top: 8px;
}
.ex-ctrl-btn {
    padding: 8px 10px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 12px;
    font-weight: 600;
    color: var(--text);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    transition: all .12s ease;
}
.ex-ctrl-btn:hover { background: #eef2ff; border-color: var(--primary); }
.ex-ctrl-btn:active { transform: scale(.97); }
.ex-ctrl-btn.primary {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: #fff;
    border-color: var(--primary-dark);
}
.ex-ctrl-btn.primary:hover { filter: brightness(1.1); }
.ex-ctrl-btn .ic { font-size: 14px; }
/* 速度按钮组 */
.ex-speed-group {
    display: flex;
    gap: 0;
    margin-left: auto;
    border: 1px solid var(--border);
    border-radius: 8px;
    overflow: hidden;
}
.ex-speed-btn {
    padding: 8px 10px;
    background: var(--bg);
    border: none;
    font-size: 11.5px;
    font-weight: 600;
    color: var(--text-light);
    cursor: pointer;
}
.ex-speed-btn + .ex-speed-btn { border-left: 1px solid var(--border); }
.ex-speed-btn.active {
    background: #eef2ff;
    color: var(--primary);
}
@media (max-width: 520px) {
    .ex-speed-btn { padding: 7px 8px; font-size: 11px; }
    .ex-ctrl-btn { padding: 7px 8px; font-size: 11.5px; }
    .ex-phase-badge b { font-size: 13px; }
}

/* ─── AI 体态分析 ────────────────────────────────── */
.posture-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 16px; }
.posture-upload { background: var(--bg); border: 1.5px dashed var(--border); border-radius: 10px; padding: 12px; }
.posture-label { display: block; font-weight: 600; font-size: 13px; color: var(--text); margin-bottom: 8px; }
.posture-tabs { display: flex; gap: 4px; margin-bottom: 10px; }
.posture-tab { padding: 5px 12px; font-size: 12px; background: var(--card-bg); color: var(--text); border: 1px solid var(--border); border-radius: 6px; cursor: pointer; }
.posture-tab.active { background: var(--primary); color: #fff; border-color: var(--primary); }
.posture-input-wrap input[type=file] { display: block; width: 100%; padding: 6px; border: 1px solid var(--border); border-radius: 6px; font-size: 12px; }
.posture-input-wrap video { width: 100%; max-height: 280px; background: #000; border-radius: 8px; margin-top: 8px; }
.posture-input-wrap .btn { margin-top: 8px; }
.posture-tip { font-size: 11px; color: var(--text-light); margin: 6px 0 4px; line-height: 1.4; }
.posture-preview { margin-top: 8px; }
.posture-preview img { width: 100%; max-height: 240px; object-fit: contain; background: #f0f0f0; border-radius: 6px; }
.posture-foot { font-size: 11px; color: var(--text-light); margin-top: 10px; text-align: center; }
.posture-loading { text-align: center; padding: 40px 0; }
.posture-spinner { width: 48px; height: 48px; border: 4px solid var(--border); border-top-color: var(--primary); border-radius: 50%; margin: 0 auto 16px; animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.posture-result-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-bottom: 18px; }
.posture-result-view { background: var(--bg); border: 1px solid var(--border); border-radius: 8px; padding: 8px; }
.posture-result-view h4 { font-size: 13px; font-weight: 600; color: var(--text); margin: 0 0 6px; text-align: center; }
.posture-canvas { width: 100%; border-radius: 6px; background: #f5f5f5; }
.posture-metrics { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; margin-top: 6px; font-size: 11px; }
.posture-metric { background: var(--card-bg); padding: 4px 6px; border-radius: 4px; display: flex; justify-content: space-between; }
.posture-metric b { color: var(--primary); }
.posture-section-title { font-size: 14px; font-weight: 700; color: var(--text); margin: 18px 0 10px; }
.posture-issue { padding: 10px 12px; border-radius: 8px; margin-bottom: 8px; }
.posture-issue-mid { background: #fff7ed; border-left: 3px solid #f59e0b; }
.posture-issue-high { background: #fef2f2; border-left: 3px solid #ef4444; }
.posture-issue-low { background: #f0f9ff; border-left: 3px solid #0ea5e9; }
.posture-issue-ok { background: #f0fdf4; border-left: 3px solid #22c55e; padding: 12px; border-radius: 8px; text-align: center; }
.posture-issue-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.posture-issue-head b { font-size: 13px; color: var(--text); }
.posture-badge { padding: 2px 8px; border-radius: 10px; font-size: 10px; font-weight: 600; }
.posture-issue-mid .posture-badge { background: #f59e0b; color: #fff; }
.posture-issue-high .posture-badge { background: #ef4444; color: #fff; }
.posture-issue-low .posture-badge { background: #0ea5e9; color: #fff; }
.posture-value { font-size: 11px; color: var(--text-light); }
.posture-correction { background: var(--bg); border: 1px solid var(--border); border-radius: 8px; padding: 10px 12px; margin-bottom: 10px; }
.posture-correction h4 { font-size: 13px; color: var(--text); margin: 0 0 4px; display: flex; justify-content: space-between; }
.posture-correction-freq { font-size: 10.5px; background: var(--primary); color: #fff; padding: 2px 8px; border-radius: 10px; font-weight: 500; }
.posture-correction-desc { font-size: 11.5px; color: var(--text-light); margin: 0 0 6px; }
.posture-correction-moves { margin: 0; padding-left: 18px; font-size: 12px; color: var(--text); }
.posture-correction-moves li { margin-bottom: 3px; }
.posture-summary-box { background: linear-gradient(135deg, #6366f1, #8b5cf6); color: #fff; padding: 10px 12px; border-radius: 8px; margin-bottom: 10px; }
.posture-summary-head { display: flex; justify-content: space-between; font-size: 12px; margin-bottom: 6px; }
.posture-summary-head b { font-weight: 700; }
.posture-summary-issues { display: flex; flex-wrap: wrap; gap: 4px; }
.posture-tag { background: rgba(255,255,255,0.25); color: #fff; padding: 2px 8px; border-radius: 10px; font-size: 11px; }

/* 训练方案切换器 */
.plan-switch {
    margin-top: 8px;
    padding: 8px 10px;
    background: #eef2ff;
    border: 1px solid #c7d2fe;
    border-radius: 10px;
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}
.plan-switch-label { font-size: 11px; font-weight: 700; color: #4338ca; white-space: nowrap; }
.plan-switch-cur { font-size: 12px; font-weight: 600; color: #4338ca; }
.plan-switch-btns { display: flex; gap: 6px; flex-wrap: wrap; }
.plan-switch-btn {
    padding: 5px 12px;
    font-size: 12px;
    font-weight: 600;
    border-radius: 8px;
    border: 1.5px solid #c7d2fe;
    background: #fff;
    color: #4338ca;
    cursor: pointer;
    transition: all .15s ease;
}
.plan-switch-btn:hover { border-color: #6366f1; background: #e0e7ff; }
.plan-switch-btn.active {
    background: linear-gradient(135deg, #6366f1, #4f46e5);
    color: #fff;
    border-color: #4f46e5;
    box-shadow: 0 2px 8px rgba(99, 102, 241, .35);
}

/* 动画视角切换按钮组 */
.ex-view-group { display: flex; gap: 4px; }
.ex-view-btn {
    padding: 6px 10px;
    font-size: 12px;
    font-weight: 600;
    border-radius: 8px;
    border: 1.5px solid var(--border);
    background: var(--bg);
    color: var(--text-light);
    cursor: pointer;
    transition: all .15s ease;
}
.ex-view-btn:hover { border-color: var(--primary); color: var(--primary); }
.ex-view-btn.active {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: #fff;
    border-color: var(--primary-dark);
}
/* 预览页每个格子的视角切换 */
.cell-view-group {
    display: flex; gap: 4px; margin: 6px 0;
}
.cell-view-group .ex-view-btn { padding: 4px 9px; font-size: 11px; }


/* 矫正热身（今日训练卡内的小区块，与主动作区分） */
.posture-warmup {
    margin-top: 8px;
    padding: 8px 10px;
    background: #f0fdf4;
    border: 1px dashed #86efac;
    border-radius: 10px;
}
.posture-warmup-label {
    display: block;
    font-size: 11px;
    font-weight: 700;
    color: #15803d;
    margin-bottom: 6px;
}
.move-chip.warmup {
    background: #dcfce7;
    border-color: #86efac;
    color: #166534;
}
.move-chip.warmup .mc-spec { background: rgba(21, 128, 61, .1); color: #15803d; }

/* 体态分析历史记录 */
.posture-history-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.posture-history-head h3 { font-size: 14px; font-weight: 700; color: var(--text); margin: 0; }
.posture-history-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 10px;
    margin-bottom: 8px;
    flex-wrap: wrap;
}
.posture-history-date { font-size: 12px; font-weight: 700; color: var(--text); min-width: 130px; }
.posture-history-issues { display: flex; flex-wrap: wrap; gap: 4px; flex: 1; }
.posture-history-tag { background: #fef2f2; color: #b91c1c; padding: 2px 8px; border-radius: 10px; font-size: 10.5px; }
.posture-history-tag.ok { background: #f0fdf4; color: #15803d; }
.posture-history-actions { display: flex; gap: 6px; }
.posture-history-actions .btn { padding: 5px 12px; font-size: 11.5px; }

/* 延时拍照倒计时 */
.posture-countdown {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: rgba(15, 23, 42, .55);
    z-index: 5;
    border-radius: 8px;
}
.posture-countdown-num {
    font-size: 64px;
    font-weight: 800;
    color: #fff;
    text-shadow: 0 2px 16px rgba(0, 0, 0, .5);
    line-height: 1;
}
.posture-countdown-tip { color: #e2e8f0; font-size: 12px; margin-top: 8px; }
.posture-cam-wrap { position: relative; }
.posture-cam-btns { display: flex; gap: 6px; margin-top: 8px; }
.posture-cam-btns .btn { flex: 1; padding: 7px 4px; font-size: 12px; }
@media (max-width: 640px) {
    .posture-grid, .posture-result-grid { grid-template-columns: 1fr; }
}

/* ═══ 皮肤分析 ═══ */
.skin-result-top { display: flex; gap: 16px; align-items: center; margin-bottom: 4px; flex-wrap: wrap; }
.skin-score-wrap { text-align: center; flex: 1; min-width: 160px; }
.skin-score-num { font-size: 46px; font-weight: 800; line-height: 1.1; }
.skin-score-num.good { color: #10b981; }
.skin-score-num.mid { color: #f59e0b; }
.skin-score-num.low { color: #ef4444; }
.skin-score-label { font-size: 13px; color: #64748b; }
.skin-score-sub { font-size: 12px; color: #94a3b8; margin-top: 4px; }
.skin-metric { display: flex; align-items: center; gap: 10px; padding: 6px 0; }
.skin-metric-label { width: 76px; font-size: 13px; color: #475569; flex-shrink: 0; }
.skin-metric-val { font-size: 13px; width: 64px; text-align: right; flex-shrink: 0; }
.skin-bar { flex: 1; height: 8px; border-radius: 4px; background: #e2e8f0; overflow: hidden; }
.skin-bar-fill { height: 100%; border-radius: 4px; transition: width .5s; }
.skin-bar-fill.ok { background: linear-gradient(90deg, #34d399, #10b981); }
.skin-bar-fill.warn { background: linear-gradient(90deg, #fbbf24, #f59e0b); }
.skin-finding-desc { margin: 4px 0 0; font-size: 12.5px; color: #64748b; }

/* ═══ 肌肉形态分析 ═══ */
.muscle-group { padding: 8px 0; border-bottom: 1px dashed #e2e8f0; }
.muscle-group:last-child { border-bottom: none; }
.muscle-group-head { display: flex; align-items: center; gap: 8px; font-size: 14px; margin-bottom: 6px; }
.muscle-group-head b { margin-left: auto; font-size: 15px; }
.muscle-badge { font-size: 11px; padding: 2px 8px; border-radius: 10px; color: #fff; }
.muscle-badge.weak { background: #ef4444; }
.muscle-badge.ok { background: #10b981; }
.muscle-badge.strong { background: #6366f1; }
.muscle-why { font-size: 13px; color: #475569; padding: 6px 10px; background: #f8fafc; border-radius: 8px; margin-bottom: 6px; }
.muscle-sub-title { font-size: 14px; margin: 14px 0 8px; color: #334155; }

/* ═══ 皮肤分析：部位选择 / 用药参考 / 历史标签 ═══ */
.skin-part-chips { display: flex; gap: 8px; flex-wrap: wrap; margin: 8px 0 14px; }
.skin-part-chip { padding: 7px 16px; border-radius: 18px; border: 1.5px solid #e2e8f0; background: #fff; color: #475569; font-size: 14px; cursor: pointer; transition: all .15s; }
.skin-part-chip.active { border-color: #6366f1; background: #eef2ff; color: #4f46e5; font-weight: 600; }
.posture-correction.skin-med { border: 1.5px dashed #fca5a5; background: #fef2f2; }
.posture-correction.skin-med h4 { color: #b91c1c; }
.skin-part-tag { font-size: 12px; padding: 2px 10px; border-radius: 10px; background: #eef2ff; color: #4f46e5; margin-left: 6px; }
.skin-score-tag { font-size: 12px; font-weight: 700; color: #059669; margin-left: 6px; }
.skin-trend { font-size: 12px; font-weight: 700; margin-left: 6px; }
.skin-trend.up { color: #dc2626; }
.skin-trend.down { color: #059669; }

/* ─── 身体成分指标（体态分析扩展） ─── */
.bm-hero { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; background: linear-gradient(135deg, #eef2ff, #f0fdf4); border-radius: 12px; padding: 14px 18px; margin-bottom: 10px; }
.bm-hero-main { display: flex; align-items: baseline; gap: 10px; }
.bm-big { font-size: 42px; font-weight: 800; color: #4f46e5; line-height: 1; }
.bm-big small { font-size: 18px; font-weight: 700; }
.bm-hero-label { font-size: 13px; color: var(--text); font-weight: 600; }
.bm-hero-side { display: flex; gap: 6px; flex-wrap: wrap; }
.bm-pill { font-size: 12px; background: #fff; border: 1px solid #e0e7ff; color: #3730a3; padding: 3px 10px; border-radius: 12px; font-weight: 600; }
.bm-trend { font-size: 12px; font-weight: 700; margin-left: 8px; color: #6b7280; }
.bm-trend.good { color: #059669; }
.bm-trend.bad { color: #dc2626; }
.bm-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; margin-bottom: 10px; }
.bm-card { background: var(--card-bg); border: 1px solid #e5e7eb; border-radius: 10px; padding: 10px 12px; display: flex; flex-direction: column; gap: 2px; }
.bm-card span { font-size: 11px; color: #6b7280; }
.bm-card b { font-size: 15px; color: var(--text); }
.bm-circ { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12px; color: #6b7280; background: #f9fafb; border-radius: 8px; padding: 8px 12px; margin-bottom: 10px; }
.bm-circ b { color: var(--text); }
.bm-advice { margin: 0 0 10px; padding-left: 18px; }
.bm-advice li { font-size: 13px; color: var(--text); margin-bottom: 6px; line-height: 1.5; }
.bm-note { font-size: 11px; color: #9ca3af; line-height: 1.5; margin: 0; }
.posture-history-tag.bf { background: #eef2ff; color: #4f46e5; font-weight: 700; }
.posture-history-tag.bf .bm-trend { margin-left: 4px; }
.posture-summary-bf { font-size: 12px; color: #4f46e5; font-weight: 600; margin: 4px 0; }
.posture-summary-bf b { font-size: 14px; }

/* ─── 体重记录（双人分栏折线） ─── */
.weight-cols { display: flex; gap: 14px; flex-wrap: wrap; }
.weight-col { flex: 1; min-width: 300px; border: 1px solid #e5e7eb; border-radius: 12px; padding: 12px 14px; background: var(--card-bg); border-top: 3px solid var(--wc, #6366f1); }
.weight-col-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 6px; }
.weight-name { font-weight: 700; font-size: 14px; color: var(--text); display: flex; align-items: center; gap: 6px; }
.weight-dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; }
.weight-latest { font-size: 13px; color: #6b7280; display: flex; align-items: baseline; gap: 7px; }
.weight-latest b { font-size: 20px; color: var(--text); }
.weight-latest.none { font-size: 12px; }
.weight-delta { font-size: 12px; font-weight: 700; }
.weight-delta.up { color: #dc2626; }
.weight-delta.down { color: #059669; }
.weight-delta.flat { color: #9ca3af; }
.weight-chart { width: 100%; height: auto; display: block; }
.weight-empty { padding: 40px 0; text-align: center; font-size: 13px; color: #9ca3af; }
.weight-input-row { display: flex; gap: 6px; margin-top: 10px; }
.weight-input-row input[type="date"] { flex: 0 0 132px; }
.weight-input-row input[type="number"] { flex: 1; min-width: 0; }
.weight-undo { display: inline-block; margin-top: 8px; font-size: 12px; color: #9ca3af; text-decoration: underline dotted; }
.weight-undo:hover { color: #dc2626; }
.weight-hint { font-size: 11px; color: #9ca3af; margin: 6px 0 0; line-height: 1.5; }
