:root {
    /* 浅绿氧气感现代化配色 (Light Mint & Emerald Clean Theme) */
    --primary: #10B981;
    --primary-dark: #047857;
    --primary-deep: #064E3B;
    --primary-light: #34D399;
    --primary-soft: #ECFDF5;
    --primary-border: #A7F3D0;
    
    --accent: #F59E0B;
    --accent-soft: #FFFBEB;
    
    --danger: #EF4444;
    --danger-dark: #B91C1C;
    --danger-soft: #FEF2F2;
    --danger-border: #FECACA;
    
    --info: #3B82F6;
    --info-soft: #EFF6FF;
    
    --bg: #F8FAFC;
    --card: #FFFFFF;
    
    --text-main: #0F172A;
    --text-muted: #475569;
    --text-light: #94A3B8;
    
    --border: #E2E8F0;
    --border-light: #F1F5F9;
    
    --radius-sm: 8px;
    --radius-md: 14px;
    --radius-lg: 20px;
    --radius-full: 9999px;
    
    --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.04);
    --shadow-sm: 0 2px 6px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 14px rgba(16, 185, 129, 0.08);
    --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.08);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
    user-select: none;
}

body {
    background-color: var(--bg);
    color: var(--text-main);
    line-height: 1.5;
    overflow-x: hidden;
    padding-bottom: 78px;
}

/* ================= 顶部浅绿高颜值清新状态栏 ================= */
.app-header {
    background: #FFFFFF;
    padding: 12px 16px 14px;
    position: sticky;
    top: 0;
    z-index: 100;
    border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow-xs);
}

.header-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

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

.brand-icon,
.brand-mark {
    display: block;
    flex: 0 0 auto;
    width: 34px;
    height: 34px;
    object-fit: cover;
    border-radius: 10px;
    background: #000;
}

.brand-icon {
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.18);
}

/* 下载弹窗头部是绿色渐变，黑底 logo 要一圈白边才不显得陷进去 */
.brand-mark {
    border: 2px solid rgba(255, 255, 255, 0.9);
    box-shadow: 0 2px 8px rgba(6, 78, 59, 0.3);
}

.public-brand {
    display: inline-block;
    vertical-align: middle;
    width: 40px;
    height: 40px;
    margin-right: 10px;
    object-fit: cover;
    border-radius: 11px;
    background: #000;
}

.brand-text h1 {
    font-size: 17px;
    font-weight: 800;
    color: var(--text-main);
    letter-spacing: -0.3px;
    line-height: 1.2;
}

.brand-text p {
    font-size: 11px;
    color: var(--text-muted);
}

/* 定制档案快捷胶囊按钮 */
.profile-pill-btn {
    display: flex;
    align-items: center;
    gap: 5px;
    background: var(--primary-soft);
    border: 1px solid var(--primary-border);
    color: var(--primary-dark);
    padding: 6px 12px;
    border-radius: var(--radius-full);
    font-size: 11.5px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 1px 3px rgba(16, 185, 129, 0.1);
}

.profile-pill-btn:active {
    transform: scale(0.96);
    background: #D1FAE5;
}

.profile-pill-btn .gear-icon {
    font-size: 12px;
    opacity: 0.8;
}

/* 现代化 iOS / Tailwind 分段切换器 (Segmented Control) */
.header-mode-bar {
    display: flex;
    background: #F1F5F9;
    border-radius: var(--radius-full);
    padding: 3px;
    gap: 4px;
    border: 1px solid #E2E8F0;
}

.mode-btn {
    flex: 1;
    text-align: center;
    padding: 8px 12px;
    font-size: 12px;
    font-weight: 600;
    border-radius: var(--radius-full);
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    border: none;
    background: transparent;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
}

.mode-btn.active {
    background: #FFFFFF;
    color: var(--primary-dark);
    font-weight: 700;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
}

/* ================= 页面主体容器 ================= */
.view-panel {
    display: none;
    padding: 14px 16px;
    animation: fadeIn 0.2s ease-out;
}

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

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

/* ================= 现代化卡片 UI ================= */
.card {
    background: var(--card);
    border-radius: var(--radius-md);
    padding: 16px;
    margin-bottom: 12px;
    border: 1px solid var(--border);
    box-shadow: var(--shadow-xs);
}

.card-title {
    font-size: 15px;
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.card-title .title-left {
    display: flex;
    align-items: center;
    gap: 6px;
}

/* 4格 KPI 数据看板 (清新浅绿高质感) */
.kpi-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    margin-bottom: 12px;
}

.kpi-card {
    background: #FFFFFF;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 12px;
    position: relative;
    box-shadow: var(--shadow-xs);
    transition: transform 0.15s;
}

.kpi-card:active {
    transform: scale(0.98);
}

.kpi-card-header {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 11px;
    color: var(--text-muted);
    font-weight: 500;
}

.kpi-value {
    font-size: 18px;
    font-weight: 800;
    color: var(--text-main);
    margin: 4px 0 2px;
    letter-spacing: -0.3px;
}

.kpi-sub {
    font-size: 9.5px;
    color: var(--text-light);
    line-height: 1.3;
}

.kpi-card.calorie {
    background: linear-gradient(135deg, #F0FDF4 0%, #FFFFFF 100%);
    border-color: #BBF7D0;
}
.kpi-card.calorie .kpi-value {
    color: var(--primary-dark);
}

.kpi-card.protein {
    background: linear-gradient(135deg, #EFF6FF 0%, #FFFFFF 100%);
    border-color: #BFDBFE;
}
.kpi-card.protein .kpi-value {
    color: #1D4ED8;
}

.kpi-card.carbs {
    background: linear-gradient(135deg, #FFFBEB 0%, #FFFFFF 100%);
    border-color: #FDE68A;
}
.kpi-card.carbs .kpi-value {
    color: #B45309;
}

.kpi-card.fat {
    background: linear-gradient(135deg, #FEF2F2 0%, #FFFFFF 100%);
    border-color: #FECACA;
}
.kpi-card.fat .kpi-value {
    color: #B91C1C;
}

/* 动态热量表盘卡片 */
.calorie-gauge-card {
    background: #FFFFFF;
    text-align: center;
    padding: 18px 16px;
}

.gauge-container {
    position: relative;
    width: 160px;
    height: 160px;
    margin: 0 auto 10px;
}

.gauge-svg {
    transform: rotate(-90deg);
}

.gauge-bg {
    fill: none;
    stroke: #F1F5F9;
    stroke-width: 11;
}

.gauge-progress {
    fill: none;
    stroke: var(--primary);
    stroke-width: 11;
    stroke-linecap: round;
    transition: stroke-dashoffset 0.8s ease, stroke 0.3s ease;
}

.gauge-center-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
}

.gauge-num {
    font-size: 28px;
    font-weight: 800;
    color: var(--text-main);
    letter-spacing: -0.5px;
    line-height: 1;
}

.gauge-unit {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 4px;
}

.macros-progress-box {
    display: flex;
    justify-content: space-around;
    padding-top: 12px;
    border-top: 1px dashed var(--border);
}

.macro-item {
    text-align: center;
}

.macro-name {
    font-size: 11px;
    color: var(--text-muted);
}

.macro-val {
    font-size: 13.5px;
    font-weight: 700;
    color: var(--text-main);
    margin-top: 2px;
}

/* 提示通知条 (Callout) */
.callout {
    background-color: var(--primary-soft);
    border: 1px solid var(--primary-border);
    border-left: 4px solid var(--primary);
    padding: 10px 12px;
    border-radius: var(--radius-sm);
    font-size: 11.5px;
    margin-bottom: 12px;
    line-height: 1.5;
    color: var(--primary-deep);
}

/* 按钮样式体系 */
.btn-primary {
    min-height: 44px;
    background: linear-gradient(135deg, #10B981 0%, #059669 100%);
    color: #FFFFFF;
    border: none;
    border-radius: var(--radius-md);
    padding: 11px 16px;
    font-size: 13.5px;
    font-weight: 700;
    width: 100%;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.25);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    transition: all 0.15s;
}

.btn-primary:active {
    transform: scale(0.98);
    opacity: 0.92;
}

.btn-outline {
    background: #FFFFFF;
    color: var(--primary-dark);
    border: 1.5px solid var(--primary-border);
    border-radius: var(--radius-md);
    padding: 10px 16px;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.15s;
}

.btn-outline:active {
    background: var(--primary-soft);
}

/* ================= 外卖严审模块 ================= */
.interceptor-hero {
    background: linear-gradient(135deg, #FEF2F2 0%, #FFF5F5 100%);
    border: 1px solid #FECACA;
    border-radius: var(--radius-md);
    padding: 14px;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.interceptor-hero-icon {
    width: 44px;
    height: 44px;
    background: #EF4444;
    color: #FFFFFF;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    flex-shrink: 0;
    box-shadow: 0 3px 8px rgba(239, 68, 68, 0.25);
}

.interceptor-hero-content h3 {
    font-size: 14.5px;
    color: #991B1B;
    font-weight: 700;
    margin-bottom: 2px;
}

.interceptor-hero-content p {
    font-size: 11px;
    color: #B91C1C;
    line-height: 1.4;
}

.takeout-input-box textarea {
    width: 100%;
    height: 72px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 10px;
    font-size: 13px;
    resize: none;
    outline: none;
    background: #F8FAFC;
    color: var(--text-main);
    user-select: text;
    transition: border 0.2s;
}

.takeout-input-box textarea:focus {
    border-color: var(--primary);
    background: #FFFFFF;
}

.preset-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    margin: 10px 0;
}

.chip {
    background: #F8FAFC;
    border: 1px solid var(--border);
    padding: 6px 11px;
    border-radius: var(--radius-full);
    font-size: 12px;
    color: var(--text-main);
    cursor: pointer;
    transition: all 0.15s;
    display: flex;
    align-items: center;
    gap: 4px;
}

.chip:active, .chip.selected {
    border-color: var(--primary);
    background: var(--primary-soft);
    color: var(--primary-dark);
    font-weight: 600;
}

/* ================= 4套食谱 Tabs ================= */
.plan-tabs {
    display: flex;
    overflow-x: auto;
    gap: 8px;
    padding-bottom: 6px;
    margin-bottom: 12px;
    scrollbar-width: none;
}

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

.plan-tab-btn {
    white-space: nowrap;
    padding: 8px 14px;
    border-radius: var(--radius-full);
    border: 1px solid var(--border);
    background: #FFFFFF;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.2s;
}

.plan-tab-btn.active {
    background: var(--primary);
    color: #FFFFFF;
    border-color: var(--primary);
    box-shadow: 0 2px 6px rgba(16, 185, 129, 0.25);
}

.meal-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 11px 0;
    border-bottom: 1px solid #F1F5F9;
}

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

.meal-badge {
    font-size: 11px;
    font-weight: 700;
    color: var(--primary-dark);
    background: var(--primary-soft);
    padding: 3px 7px;
    border-radius: 5px;
    display: inline-block;
    margin-bottom: 4px;
}

.meal-content {
    font-size: 12.5px;
    color: var(--text-main);
    line-height: 1.5;
}

.meal-cal-num {
    font-size: 15px;
    font-weight: 800;
    color: var(--primary-dark);
}

.btn-log-meal {
    background: #FFFFFF;
    border: 1px solid var(--primary-border);
    color: var(--primary-dark);
    border-radius: var(--radius-full);
    font-size: 11px;
    font-weight: 600;
    padding: 4px 10px;
    cursor: pointer;
    margin-top: 5px;
    transition: all 0.15s;
}

.btn-log-meal:active {
    background: var(--primary-soft);
}

/* ================= 训练计时与动作 ================= */
.exercise-card {
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 12px;
    margin-bottom: 10px;
    background: #FFFFFF;
}

.exercise-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 5px;
}

.exercise-name {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-main);
}

.exercise-reps {
    font-size: 12px;
    color: var(--primary-dark);
    background: var(--primary-soft);
    padding: 2px 8px;
    border-radius: var(--radius-full);
    font-weight: 700;
}

.exercise-tip {
    font-size: 11.5px;
    color: var(--text-muted);
    line-height: 1.4;
}

.timer-box {
    background: linear-gradient(135deg, #10B981 0%, #059669 100%);
    color: #FFFFFF;
    border-radius: var(--radius-md);
    padding: 18px;
    text-align: center;
    margin-bottom: 12px;
    box-shadow: 0 4px 14px rgba(16, 185, 129, 0.25);
}

.timer-digits {
    font-size: 44px;
    font-weight: 800;
    letter-spacing: 2px;
    font-family: monospace;
    margin: 6px 0;
}

.timer-controls {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 8px;
}

.timer-btn {
    padding: 8px 18px;
    border-radius: var(--radius-full);
    border: none;
    font-weight: 700;
    font-size: 12.5px;
    cursor: pointer;
    transition: all 0.15s;
}

.timer-btn.start {
    background: #FFFFFF;
    color: var(--primary-dark);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.timer-btn.reset {
    background: rgba(255, 255, 255, 0.2);
    color: #FFFFFF;
}

/* ================= 图表区域 ================= */
.chart-container {
    width: 100%;
    height: 180px;
    position: relative;
    margin-top: 8px;
}

/* ================= 底部固定导航栏 ================= */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 64px;
    background: #FFFFFF;
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: space-around;
    align-items: center;
    z-index: 100;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.04);
}

.nav-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--text-light);
    font-size: 11.5px;
    cursor: pointer;
    padding: 6px 0;
    transition: all 0.2s ease;
}

.nav-item .nav-icon {
    font-size: 20px;
    margin-bottom: 2px;
    transition: transform 0.2s ease;
}

.nav-item.active {
    color: var(--primary-dark);
    font-weight: 700;
}

/* 选中态只变色不放大：以前给图标 scale(1.15)，五个导航项的图标盒高度不一致，
   下面那排标签就跟着一高一低（features.css r159 统一成 26px 等高的格子）。 */
.nav-item.active .nav-icon {
    transform: none;
}

.nav-item.highlight {
    color: var(--danger);
}

/* ================= 个性化身材定制弹窗 (Profile Modal) ================= */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(15, 23, 42, 0.55);
    z-index: 1000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: max(12px, env(safe-area-inset-top)) 12px max(12px, env(safe-area-inset-bottom));
    backdrop-filter: blur(4px);
}

.modal-overlay.show {
    display: flex;
}

.modal-card {
    background: #FFFFFF;
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 420px;
    max-height: 90vh;
    max-height: min(90dvh, 840px);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.15), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    animation: slideUp 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    border: 1px solid var(--border);
    overscroll-behavior: contain;
}

@keyframes slideUp {
    from { opacity: 0; transform: translateY(20px) scale(0.97); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.modal-header {
    padding: 16px 20px 14px;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    background: rgba(255, 255, 255, 0.97);
    backdrop-filter: blur(8px);
    z-index: 10;
}

.modal-header h2 {
    font-size: 16px;
    font-weight: 800;
    color: var(--text-main);
}

.modal-close-btn {
    background: #F1F5F9;
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    min-width: 40px;
    flex: 0 0 40px;
    font-size: 18px;
    color: var(--text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.modal-close-btn:hover {
    background: #E2E8F0;
    color: #0F172A;
}

.modal-body {
    padding: 18px 20px 24px;
    overflow-wrap: anywhere;
}

.form-group {
    margin-bottom: 14px;
}

.form-label {
    display: block;
    font-size: 12px;
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 6px;
}

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

.input-control {
    width: 100%;
    min-height: 44px;
    padding: 9px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 16px;
    color: var(--text-main);
    outline: none;
    background: #F8FAFC;
    transition: all 0.15s;
    user-select: text;
}

.input-control:focus {
    border-color: var(--primary);
    background: #FFFFFF;
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.15);
}

/* 目标类型选择卡片 */
.goal-option-card {
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 10px 12px;
    margin-bottom: 8px;
    cursor: pointer;
    transition: all 0.2s;
    background: #FFFFFF;
    display: flex;
    align-items: flex-start;
    gap: 10px;
}

.goal-option-card.selected {
    border-color: var(--primary);
    background: var(--primary-soft);
}

.goal-radio-circle {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    border: 2px solid #CBD5E1;
    margin-top: 2px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.goal-option-card.selected .goal-radio-circle {
    border-color: var(--primary);
    background: var(--primary);
}

.goal-option-card.selected .goal-radio-circle::after {
    content: "";
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #FFFFFF;
}

.goal-content h4 {
    font-size: 13px;
    font-weight: 700;
    color: var(--text-main);
}

.goal-content p {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 2px;
    line-height: 1.35;
}

/* 采购清单项 */
.checklist-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 9px 0;
    border-bottom: 1px solid #F1F5F9;
    font-size: 13px;
    cursor: pointer;
}

.checklist-item input[type="checkbox"] {
    width: 17px;
    height: 17px;
    accent-color: var(--primary);
    cursor: pointer;
}

.checklist-item.checked span {
    text-decoration: line-through;
    color: var(--text-light);
}

/* AI 对话面板 */
.chat-container {
    height: 380px;
    display: flex;
    flex-direction: column;
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 10px 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.chat-bubble {
    max-width: 85%;
    padding: 10px 14px;
    border-radius: 14px;
    font-size: 13px;
    line-height: 1.5;
    user-select: text;
}

.chat-bubble.assistant {
    background: #F8FAFC;
    color: var(--text-main);
    border: 1px solid var(--border);
    align-self: flex-start;
    border-bottom-left-radius: 2px;
}

.chat-bubble.user {
    background: var(--primary);
    color: #FFFFFF;
    align-self: flex-end;
    border-bottom-right-radius: 2px;
}

.chat-input-bar {
    display: flex;
    gap: 8px;
    padding-top: 10px;
    border-top: 1px solid var(--border);
}

.chat-input-bar input {
    flex: 1 1 0;
    /* 表单控件的自动最小宽度是它的固有宽度（约 324px），flex:1 单独压不住：
       320 视口下它把整页布局视口顶到 410，窄屏排版全部假通过。 */
    min-width: 0;
    padding: 8px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius-full);
    outline: none;
    font-size: 13px;
    user-select: text;
}

.chat-input-bar button {
    background: var(--primary);
    color: #FFFFFF;
    border: none;
    border-radius: var(--radius-full);
    padding: 8px 16px;
    font-size: 13px;
    cursor: pointer;
    font-weight: 700;
}

/* ================= 连续超标与脱离计划警报横幅 ================= */
.alert-banner-danger {
    background: linear-gradient(135deg, #FEF2F2 0%, #FEE2E2 100%);
    border: 1.5px solid #F87171;
    border-radius: var(--radius-md);
    padding: 12px 14px;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 10px;
    animation: pulseAlert 2s infinite ease-in-out;
}

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

.alert-banner-warning {
    background: linear-gradient(135deg, #FFFBEB 0%, #FEF3C7 100%);
    border: 1.5px solid #FCD34D;
    border-radius: var(--radius-md);
    padding: 12px 14px;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.alert-banner-icon {
    font-size: 24px;
    flex-shrink: 0;
}

.alert-banner-content h4 {
    font-size: 13.5px;
    font-weight: 800;
    color: #991B1B;
    margin-bottom: 2px;
}

.alert-banner-content p {
    font-size: 11px;
    color: #B91C1C;
    line-height: 1.4;
}

.alert-banner-warning .alert-banner-content h4 {
    color: #92400E;
}

.alert-banner-warning .alert-banner-content p {
    color: #B45309;
}

/* ================= 每日食物记录 & 记忆自适应食谱 ================= */
.meal-slot-chips {
    display: flex;
    gap: 6px;
    margin-bottom: 10px;
}

.meal-slot-chip {
    flex: 1;
    padding: 6px 4px;
    text-align: center;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 11.5px;
    font-weight: 600;
    color: var(--text-muted);
    background: #F8FAFC;
    cursor: pointer;
    transition: all 0.15s;
}

.meal-slot-chip.selected {
    background: var(--primary-soft);
    border-color: var(--primary);
    color: var(--primary-dark);
    font-weight: 700;
}

.diary-record-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 10px;
    background: #F8FAFC;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    margin-bottom: 6px;
    font-size: 12px;
}

.diary-record-item strong {
    color: var(--primary-dark);
}

.adaptive-recipe-callout {
    background: linear-gradient(135deg, #ECFDF5 0%, #F0FDF4 100%);
    border: 1px solid var(--primary-border);
    border-left: 4px solid var(--primary);
    padding: 10px 12px;
    border-radius: var(--radius-sm);
    font-size: 11.5px;
    margin: 10px 0;
    line-height: 1.5;
    color: var(--primary-deep);
}

/* ================= 每日喝水打卡 2000ml ================= */
.water-cups-grid {
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    gap: 6px;
    margin: 10px 0;
}

.water-cup-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 6px 2px;
    background: #F8FAFC;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.2s;
}

.water-cup-btn.filled {
    background: #EFF6FF;
    border-color: #93C5FD;
    color: #1D4ED8;
}

.water-cup-btn .cup-icon {
    font-size: 16px;
    transition: transform 0.2s;
}

.water-cup-btn.filled .cup-icon {
    transform: scale(1.15);
}

.water-cup-btn span {
    font-size: 8.5px;
    color: var(--text-light);
    margin-top: 2px;
}

.water-cup-btn.filled span {
    color: #2563EB;
    font-weight: bold;
}

/* ================= 实时动态燃脂计数器 ================= */
.live-burn-display {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    background: rgba(0, 0, 0, 0.15);
    border-radius: var(--radius-full);
    padding: 6px 14px;
    margin: 8px auto;
    width: fit-content;
    font-size: 12px;
    color: #FFFFFF;
}

.live-burn-val {
    font-size: 16px;
    font-weight: 800;
    color: #FEF08A;
}

/* 免费无外网标识 */
.tag-offline-free {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 10.5px;
    color: var(--primary-dark);
    background: var(--primary-soft);
    padding: 2px 8px;
    border-radius: var(--radius-full);
    border: 1px solid var(--primary-border);
    font-weight: 600;
}

/* ================= 外卖党 vs 自炊党 饮食模式切换器 ================= */
.dining-mode-bar {
    display: flex;
    background: #F1F5F9;
    border-radius: var(--radius-md);
    padding: 4px;
    gap: 6px;
    margin-bottom: 12px;
    border: 1px solid var(--border);
}

.dining-mode-btn {
    flex: 1;
    text-align: center;
    padding: 9px 8px;
    font-size: 12px;
    font-weight: 600;
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    cursor: pointer;
    border: none;
    background: transparent;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
}

.dining-mode-btn.active {
    background: #FFFFFF;
    color: var(--primary-dark);
    font-weight: 700;
    box-shadow: var(--shadow-sm);
}

.takeout-scene-card {
    background: #FFFFFF;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 14px;
    margin-bottom: 12px;
    box-shadow: var(--shadow-xs);
    position: relative;
    border-left: 4px solid var(--primary);
}

.takeout-scene-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.takeout-brand-badge {
    font-size: 11px;
    font-weight: 700;
    background: #EFF6FF;
    color: #1D4ED8;
    padding: 2px 8px;
    border-radius: var(--radius-full);
}

.takeout-combo-name {
    font-size: 14px;
    font-weight: 800;
    color: var(--text-main);
    margin-bottom: 4px;
}

.takeout-order-items {
    font-size: 12px;
    color: var(--text-muted);
    line-height: 1.6;
    margin-bottom: 8px;
    background: #F8FAFC;
    padding: 8px 10px;
    border-radius: var(--radius-sm);
}

.takeout-remark-box {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #FFFBEB;
    border: 1px dashed #FCD34D;
    padding: 6px 10px;
    border-radius: var(--radius-sm);
    font-size: 11px;
    color: #92400E;
    gap: 8px;
}

.btn-copy-remark {
    background: #F59E0B;
    color: #FFFFFF;
    border: none;
    border-radius: var(--radius-full);
    padding: 4px 10px;
    font-size: 10px;
    font-weight: 700;
    cursor: pointer;
    flex-shrink: 0;
}

/* ================= 视觉化身材形态多图挑选卡片 (用户自选身材) ================= */
.body-shape-selector-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    margin-bottom: 14px;
}

.body-shape-card {
    background: #FFFFFF;
    border: 2px solid var(--border);
    border-radius: var(--radius-md);
    padding: 12px 10px;
    text-align: center;
    cursor: pointer;
    position: relative;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: var(--shadow-xs);
}

.body-shape-card:active {
    transform: scale(0.97);
}

.body-shape-card.selected {
    border-color: var(--primary);
    background: linear-gradient(180deg, #F0FDF4 0%, #FFFFFF 100%);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.18);
}

.body-shape-selected-tag {
    display: none;
    position: absolute;
    top: 6px;
    right: 6px;
    background: var(--primary);
    color: #FFFFFF;
    font-size: 9px;
    font-weight: 800;
    padding: 2px 6px;
    border-radius: var(--radius-full);
}

.body-shape-card.selected .body-shape-selected-tag {
    display: block;
}

.body-shape-svg-box {
    width: 68px;
    height: 96px;
    margin: 0 auto 8px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.body-shape-svg-box svg {
    width: 100%;
    height: 100%;
}

.body-shape-title {
    font-size: 13px;
    font-weight: 800;
    color: var(--text-main);
    margin-bottom: 2px;
}

.body-shape-desc {
    font-size: 10px;
    color: var(--text-muted);
    line-height: 1.35;
}

.body-shape-specs {
    margin-top: 6px;
    padding-top: 6px;
    border-top: 1px dashed var(--border);
    font-size: 9.5px;
    color: var(--primary-dark);
    font-weight: 700;
}

/* 性别切换迷你胶囊 */
.gender-mini-tabs {
    display: flex;
    background: #F1F5F9;
    border-radius: var(--radius-full);
    padding: 2px;
    gap: 2px;
}

.gender-mini-btn {
    border: none;
    background: transparent;
    padding: 4px 10px;
    border-radius: var(--radius-full);
    font-size: 11px;
    font-weight: 700;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.2s ease;
}

.gender-mini-btn.active {
    background: #FFFFFF;
    color: var(--primary-deep);
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
}

/* ================= 周期身材照更新与形体蜕变相册 ================= */
.cycle-badge-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: linear-gradient(135deg, #ECFDF5 0%, #D1FAE5 100%);
    border: 1px solid var(--primary-border);
    padding: 10px 14px;
    border-radius: var(--radius-md);
    margin-bottom: 12px;
}

.cycle-step-indicator {
    font-size: 13px;
    font-weight: 800;
    color: var(--primary-deep);
}

.cycle-step-sub {
    font-size: 11px;
    color: var(--primary-dark);
}

.photo-compare-container {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    margin-bottom: 12px;
}

.photo-box {
    background: #F8FAFC;
    border: 1px dashed var(--border);
    border-radius: var(--radius-md);
    padding: 8px;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.photo-box-title {
    font-size: 11px;
    font-weight: 700;
    color: var(--text-muted);
    margin-bottom: 6px;
}

.photo-preview-wrap {
    width: 100%;
    height: 160px;
    background: #E2E8F0;
    border-radius: var(--radius-sm);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.photo-preview-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.photo-placeholder-icon {
    font-size: 32px;
    opacity: 0.6;
    margin-bottom: 4px;
}

.photo-meta-tag {
    position: absolute;
    bottom: 6px;
    left: 6px;
    right: 6px;
    background: rgba(0, 0, 0, 0.65);
    color: #FFFFFF;
    font-size: 9px;
    padding: 2px 4px;
    border-radius: 4px;
    backdrop-filter: blur(4px);
}

.btn-upload-photo {
    width: 100%;
    margin-top: 6px;
    padding: 6px;
    font-size: 11px;
    font-weight: 600;
    background: #FFFFFF;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-main);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
}

.btn-upload-photo:active {
    background: #F1F5F9;
}

.cycle-ai-report-card {
    background: linear-gradient(135deg, #F0FDF4 0%, #FFFFFF 100%);
    border: 1.5px solid var(--primary-border);
    border-radius: var(--radius-md);
    padding: 14px;
    margin-top: 12px;
    box-shadow: var(--shadow-sm);
}

.cycle-ai-report-title {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    font-weight: 800;
    color: var(--primary-deep);
    margin-bottom: 8px;
}

.cycle-diff-pill-bar {
    display: flex;
    gap: 8px;
    margin-bottom: 10px;
}

.cycle-diff-pill {
    flex: 1;
    background: #FFFFFF;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 6px 8px;
    text-align: center;
    font-size: 11px;
}

.cycle-diff-pill strong {
    font-size: 13px;
    color: var(--primary-dark);
    display: block;
}

/* ================= 专属公网监督大屏横幅 ================= */
.user-web-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: linear-gradient(135deg, #EFF6FF 0%, #FFFFFF 100%);
    border: 1px solid #BFDBFE;
    padding: 10px 14px;
    border-radius: var(--radius-md);
    margin-bottom: 12px;
    gap: 8px;
    box-shadow: var(--shadow-xs);
}

.user-web-banner .link-text {
    font-size: 11px;
    color: #1D4ED8;
    word-break: break-all;
    font-weight: 600;
    line-height: 1.4;
}

.user-web-actions {
    display: flex;
    gap: 6px;
    flex-shrink: 0;
}

.btn-web-action {
    background: #2563EB;
    color: #FFFFFF;
    border: none;
    padding: 5px 10px;
    border-radius: var(--radius-full);
    font-size: 10.5px;
    font-weight: 700;
    cursor: pointer;
    transition: opacity 0.2s;
}

.btn-web-action:active {
    opacity: 0.8;
}

/* 账号入口：一颗头像圆点 + 昵称。
   以前是"蓝色小人图标 + 蓝字 + 一圈描边"，机主实拍说丑；
   现在无边框、深色字，未登录时圆点显示品牌首字，不塞假人剪影。 */
.account-chip {
    display: flex;
    align-items: center;
    gap: 7px;
    /* 实测两头都翻车过：默认允许收缩时被长标题挤到只剩 padding 的 16px，
       "登录/注册"放不下；改成完全不许收缩（flex:0 0 auto）后反过来挤掉品牌行，
       393 手机上档案摘要被截成"170cm · 160斤 · …"。现在可收缩但带 92px 下限，
       昵称自己有 max-width 省略，圆点始终放得下。
       上限用 vw 而不是百分比：百分比的参照是工具组自身宽度，那是个 shrink-to-fit
       的循环量，各引擎算出来的结果不一样。 */
    flex: 0 1 auto;
    min-width: 92px;
    max-width: min(240px, 60vw);
    font-size: 12.5px;
    color: #0F172A;
    background: #F4F6F8;
    border: none;
    padding: 3px 11px 3px 3px;
    border-radius: var(--radius-full);
    cursor: pointer;
    font-weight: 700;
    transition: background 0.15s, transform 0.15s;
}

.account-chip:active {
    background: #E8EDF3;
    transform: scale(0.97);
}

.avatar-dot {
    flex: 0 0 26px;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: linear-gradient(135deg, #10B981 0%, #059669 100%);
    color: #FFFFFF;
    font-size: 12.5px;
    font-weight: 800;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.avatar-dot img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.account-name {
    flex: 0 1 auto;
    min-width: 0;
    max-width: 9em;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

/* ================= APK 下载弹窗与入口样式 ================= */
.header-download-btn {
    display: flex;
    align-items: center;
    gap: 4px;
    background: linear-gradient(135deg, #10B981 0%, #059669 100%);
    color: #FFFFFF;
    border: none;
    padding: 5px 11px;
    border-radius: var(--radius-full);
    font-size: 11px;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(16, 185, 129, 0.28);
    transition: transform 0.15s, opacity 0.15s;
    flex-shrink: 0;
}

.header-download-btn:active {
    transform: scale(0.95);
    opacity: 0.9;
}

/* 主看板中的下载横幅卡片 */
.web-download-card {
    background: linear-gradient(135deg, #ECFDF5 0%, #D1FAE5 100%);
    border: 1px solid var(--primary-border);
    border-radius: var(--radius-md);
    padding: 10px 14px;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    transition: transform 0.15s, box-shadow 0.15s;
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.1);
}

.web-download-card:hover {
    box-shadow: 0 4px 14px rgba(16, 185, 129, 0.18);
}

.web-download-card:active {
    transform: scale(0.98);
}

.download-card-icon {
    font-size: 24px;
    line-height: 1;
    background: #FFFFFF;
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
    flex-shrink: 0;
}

.btn-download-pill {
    background: #059669;
    color: #FFFFFF;
    border: none;
    padding: 6px 12px;
    border-radius: var(--radius-full);
    font-size: 11px;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(5, 150, 105, 0.25);
    transition: opacity 0.15s;
    flex-shrink: 0;
}

.btn-download-pill:active {
    opacity: 0.85;
}

/* 浮动下载按钮 (在移动端或大屏吸底悬浮展示) */
.floating-dl-btn {
    position: fixed;
    right: 14px;
    bottom: 84px;
    z-index: 99;
    background: linear-gradient(135deg, #10B981 0%, #059669 100%);
    color: #FFFFFF;
    padding: 8px 14px;
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    gap: 6px;
    box-shadow: 0 4px 16px rgba(16, 185, 129, 0.38);
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    user-select: none;
}

.floating-dl-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(16, 185, 129, 0.45);
}

.floating-dl-btn:active {
    transform: scale(0.95);
}

.floating-dl-text {
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.3px;
}

.floating-dl-pulse {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    border-radius: var(--radius-full);
    border: 2px solid #34D399;
    animation: dlPulse 2.4s infinite;
    pointer-events: none;
}

@keyframes dlPulse {
    0% { transform: scale(1); opacity: 0.8; }
    70% { transform: scale(1.15); opacity: 0; }
    100% { transform: scale(1.15); opacity: 0; }
}

/* 下载弹窗特定样式：支持触控平滑滚动，严防窄屏内容截断 */
.download-modal-card {
    max-width: 440px;
    border-radius: var(--radius-lg);
    max-height: 90vh;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.qr-container-card {
    background: #F8FAFC;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 14px 10px;
}

.qr-img-wrapper {
    display: inline-block;
    background: #FFFFFF;
    padding: 8px;
    border-radius: 12px;
    border: 1px solid var(--border);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.qr-img {
    width: 160px;
    height: 160px;
    display: block;
    margin: 0 auto;
}

.btn-direct-download {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    background: linear-gradient(135deg, #10B981 0%, #047857 100%);
    color: #FFFFFF;
    text-decoration: none;
    padding: 11px 16px;
    border-radius: var(--radius-sm);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
    transition: transform 0.15s, opacity 0.15s;
    cursor: pointer;
}

.btn-direct-download:hover {
    opacity: 0.95;
    transform: translateY(-1px);
}

.btn-direct-download:active {
    transform: scale(0.98);
}

.download-link-box {
    margin-top: 14px;
    background: #F1F5F9;
    border-radius: var(--radius-sm);
    padding: 8px 10px;
    text-align: center;
}

.download-url-code {
    font-family: monospace;
    font-size: 11.5px;
    color: #047857;
    font-weight: 700;
    word-break: break-all;
    user-select: all;
    background: #FFFFFF;
    padding: 4px 6px;
    border-radius: 4px;
    border: 1px dashed var(--primary-border);
    margin-bottom: 6px;
}

.btn-copy-url {
    background: #FFFFFF;
    border: 1px solid var(--border);
    color: var(--text-muted);
    font-size: 11px;
    padding: 4px 12px;
    border-radius: var(--radius-full);
    cursor: pointer;
    font-weight: 600;
    transition: all 0.15s;
}

.btn-copy-url:active {
    background: #E2E8F0;
}

.download-highlights {
    margin-top: 14px;
    text-align: left;
    background: #FFFBEB;
    border: 1px solid #FDE68A;
    border-radius: var(--radius-sm);
    padding: 8px 12px;
    font-size: 11px;
    color: #92400E;
    line-height: 1.6;
}

.dl-hl-item {
    margin-bottom: 2px;
}


/* ============================================================
   2026-10-16 遮挡与溢出修复（用户实拍：标题挤成四行、档案胶囊文字
   竖排溢出、悬浮下载按钮压住卡片文字、体重输入框 placeholder 被截断）
   统一在文件末尾追加覆盖规则，不改动原布局，便于整段回退。
   ============================================================ */

/* 顶栏：允许换行，品牌区可收缩，长文本走省略号而不是竖排 */
.app-header .header-top {
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
}

.app-header .app-brand,
.app-header .brand-text {
    flex: 1 1 auto;
    min-width: 0;
}

.brand-line {
    display: flex;
    align-items: baseline;
    gap: 7px;
    min-width: 0;
}
.brand-tag { margin: 0; font-size: 11px; color: var(--text-muted); }
/* 档案摘要挂在品牌下面第二行：整行可点，去掉胶囊底和描边，读起来像标题的补充 */
.brand-profile {
    display: flex;
    align-items: center;
    gap: 5px;
    margin: 1px 0 0;
    padding: 0;
    border: none;
    background: none;
    cursor: pointer;
    font-size: 11.5px;
    line-height: 1.4;
    color: #475569;
    font-weight: 600;
    text-align: left;
    min-width: 0;
    max-width: 100%;
}
.brand-profile #header-profile-summary {
    min-width: 0;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}
.brand-edit { flex: 0 0 auto; font-size: 10px; color: var(--primary-dark); }
.app-header .brand-text h1,
.app-header .brand-text p {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* 右侧按钮组：可收缩但不许被压成竖排。
   .account-chip 不在这一组里——它有自己的收缩契约（可收缩 + 92px 下限），
   混在这里会被下面的 min-width:0 覆盖掉，那个下限就白写了。 */
.profile-pill-btn,
.header-download-btn {
    flex: 0 1 auto;
    min-width: 0;
    max-width: 42vw;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.profile-pill-btn #header-profile-summary {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* 悬浮下载按钮：App 内由 JS 直接隐藏（已经装着 App 了，不该再引导下载一次）；
   网页版保留，但给主内容留出底部空间，避免它压住最后一张卡片 */
body.has-floating-dl #app-main { padding-bottom: 140px; }
.floating-dl-btn { max-width: calc(100vw - 28px); }

/* 体重输入行：输入框吃掉剩余宽度，placeholder 不再被截断 */
#input-weight { flex: 1 1 auto; min-width: 0; width: auto; }
#weight-unit { flex: 0 0 auto; }

/* 键盘可达性：自定义按钮与弹窗拿到焦点时必须看得见焦点框。 */
[role=button]:focus-visible, .modal-card:focus-visible, .modal-close-btn:focus-visible,
button:focus-visible, input:focus-visible, select:focus-visible {
    outline: 2px solid var(--primary-dark); outline-offset: 2px;
}
.chart-text-summary { font-size: 11.5px; color: var(--text-muted); margin-top: 6px; line-height: 1.5; }
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: 0.001ms !important;
        animation-iteration-count: 1 !important; transition-duration: 0.001ms !important;
        scroll-behavior: auto !important; }
}

/* 底部七个导航项：等宽收缩 + 文字缩一档，避免横向溢出 */
.bottom-nav { gap: 0; }
.nav-item { min-width: 0; flex: 1 1 0; padding-left: 2px; padding-right: 2px; }
.nav-item > span:not(.nav-icon) {
    font-size: 11px;
    max-width: 100%;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}


/* ============================================================
   2026-10-16 第三批：顶部新结构、每日状态条、动作卡展开、桌面排版
   ============================================================ */
.header-row-1 { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.header-tools { display: flex; align-items: center; gap: 6px; flex: 0 0 auto; }
.header-icon-btn {
    border: 1px solid var(--border); background: #FFFFFF; border-radius: var(--radius-full);
    width: 34px; height: 34px; font-size: 15px; line-height: 1; cursor: pointer;
    display: flex; align-items: center; justify-content: center; flex: 0 0 auto;
}
.header-icon-btn:active { transform: scale(0.94); }

.mode-diff-hint { margin-top: 6px; font-size: 10.5px; color: var(--text-muted); line-height: 1.5; }

.daily-strip {
    display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)) auto; gap: 8px;
    align-items: center; background: #FFFFFF; border: 1px solid var(--border);
    border-radius: var(--radius-md); padding: 10px 12px; margin-bottom: 10px;
}
.daily-cell { display: flex; flex-direction: column; min-width: 0; }
.dc-val { font-size: 13px; font-weight: 800; color: var(--text-main); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dc-lab { font-size: 10px; color: var(--text-light); }
.daily-export {
    flex: 0 0 auto; border: 1px solid var(--primary-border); background: var(--primary-soft);
    color: var(--primary-dark); border-radius: 99px; padding: 6px 12px; font-size: 11px; font-weight: 700; cursor: pointer;
}

.shoot-guide { background: #F8FAFC; border: 1px dashed var(--border); border-radius: 12px; padding: 8px 12px; margin: 8px 0; }
.sg-title { font-size: 12px; font-weight: 800; color: var(--primary-dark); margin-bottom: 4px; }
.shoot-guide ul { margin: 0; padding-left: 18px; font-size: 11.5px; color: var(--text-muted); line-height: 1.7; }

.ex-actions { display: flex; gap: 8px; margin-top: 8px; }
.ex-btn { flex: 1 1 0; min-width: 0; border: 1px solid var(--border); background: #FFFFFF; color: var(--text-muted); border-radius: 99px; padding: 5px 8px; font-size: 11px; font-weight: 700; cursor: pointer; }
.ex-btn.video { border-color: var(--primary-border); background: var(--primary-soft); color: var(--primary-dark); }
.ex-steps { display: none; margin: 8px 0 0; padding-left: 20px; font-size: 11.5px; color: var(--text-muted); line-height: 1.7; }
.ex-steps.open { display: block; }
.ex-wrong { margin-top: 6px; font-size: 11px; color: #B45309; background: #FFFBEB; border-radius: 8px; padding: 5px 8px; }

/* 电脑版排版：宽容器 + CSS 分栏双栏。分栏是"按内容高度配平"而不是最短列优先，
   所以 tall 卡片仍会在某一栏顶出一段空白（实测 1440 下监控大屏约 228px），
   这里不再声称已彻底消除空隙。 */
body.desktop-view #app-main { max-width: 900px; margin: 0 auto; padding-bottom: 96px; }
body.desktop-view main .view-panel {
    display: none;
    grid-template-columns: repeat(2, minmax(0, 1fr));
}
body.desktop-view main .view-panel.active {
    display: block;
}
body.desktop-view main .view-panel.active > * {
    margin-bottom: 14px;
    box-sizing: border-box;
}

/* 饮食计划子视图：烹饪方案与外卖方案桌面端双栏紧凑排列 */

body.desktop-view #dining-cook-view > *,
body.desktop-view #dining-takeout-view > * {
    margin-bottom: 14px;
    box-sizing: border-box;
}

/* 身材库选择卡片：桌面端 4 列横向展示，紧凑高级，消除竖直堆叠产生的空白 */
body.desktop-view #main-body-shapes-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
}


/* 电脑版各弹窗排版优化：适度放宽宽度，提供更开阔呼吸感，严防内容挤压 */
body.desktop-view .modal-card { max-width: 480px; }
body.desktop-view #profile-modal .modal-card { max-width: 520px; }
body.desktop-view .download-modal-card { max-width: 460px; }
body.desktop-view .ex-detail { max-width: 500px; }
body.desktop-view .app-header { max-width: 900px; margin: 0 auto; }

/* 电脑版顶部导航栏 */
.desktop-top-nav { display: none; }
body.desktop-view .desktop-top-nav {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 10px;
    padding: 6px 8px;
    background: #F1F5F9;
    border-radius: 12px;
    border: 1px solid #E2E8F0;
}
body.desktop-view .d-nav-item {
    background: transparent;
    border: none;
    font-size: 12px;
    font-weight: 700;
    color: #64748B;
    padding: 7px 14px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
}
body.desktop-view .d-nav-item:hover {
    color: #0F172A;
    background: #E2E8F0;
}
body.desktop-view .d-nav-item.active {
    background: #FFFFFF;
    color: #047857;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.06);
}

/* 电脑版只留顶栏那一排导航：底部再放一排 dock，同一组按钮出现两次，
   点下面那排还会把页面滚到顶（switchTab 里的 scrollTo），看着像"胡乱定位"。 */
body.desktop-view .bottom-nav {
    display: none;
    max-width: 820px;
    left: 50%;
    transform: translateX(-50%);
    bottom: 16px;
    border-radius: 20px;
    border: 1px solid #E2E8F0;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
    height: 62px;
    padding: 0 16px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

@media (max-width: 900px) {
    body.desktop-view #main-body-shapes-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
/* ============ 第五批：顶栏按钮竖排换行与提示语截断（实测定位） ============
   量法：把元素克隆进 360px 宽的容器，读 clientWidth/scrollHeight。
   #btn-view-toggle 当时是 32x32 的盒子、内容要 41px 高——省略号只管横向，
   治不了换行顶出，所以这里必须同时锁 white-space 和最小宽度。 */
/* 第五批追加：这颗按钮改成纯图标 32x32。实拍反馈"字都漏出来了好丑"——
   上一轮的 nowrap+自适应宽度只解决不溢出，真正干净的做法是图标化，文字进 title。 */
#btn-view-toggle {
    white-space: nowrap;
    width: 32px;
    height: 32px;
    min-width: 32px;
    padding: 0;
    line-height: 1;
    flex: 0 0 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 15px;
    overflow: hidden;
}

/* 顶栏里所有图标按钮一律不许换行；宽度交给内容 */
.header-icon-btn {
    white-space: nowrap;
    width: auto;
    flex: 0 0 auto;
}

/* 窄屏（<=380px）时顶栏文字只留图标+一个短词，避免把档案行挤没 */
@media (max-width: 380px) {
    #btn-view-toggle { padding: 0 7px; font-size: 11px; }
}

/* 输入框提示语必须落在框内：过长就在窄屏下省略，别硬截成半句 */
.input-control::placeholder, #chat-input::placeholder {
    opacity: 0.62;
}

#chat-input {
    text-overflow: ellipsis;
}

/* 遮挡判据配套：顶栏任何直接子项都不许出现内容溢出 */
header *, .header-tools, .header-row-1 {
    min-width: 0;
}
/* 第五批：通知提示条、页面内兜底提醒、外卖使用情况框 */
.notif-hint {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    padding: 9px 12px;
    margin-bottom: 10px;
    background: #FEF3C7;
    border: 1px solid #FCD34D;
    border-radius: 10px;
    font-size: 12px;
    color: #92400E;
}
.notif-hint button {
    margin-left: auto;
    padding: 5px 12px;
    border: none;
    border-radius: var(--radius-full);
    background: #F59E0B;
    color: #fff;
    font-size: 11.5px;
    font-weight: 700;
    white-space: nowrap;
    cursor: pointer;
}
.inpage-remind {
    display: none;
    position: fixed;
    left: 10px;
    right: 10px;
    bottom: 74px;
    z-index: 200;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    background: #1E293B;
    color: #F1F5F9;
    border-radius: 12px;
    box-shadow: 0 6px 20px rgba(15, 23, 42, 0.35);
    font-size: 12px;
}
.inpage-remind strong { color: #FCD34D; flex: 0 0 auto; }
.inpage-remind span { flex: 1 1 auto; min-width: 0; }
.inpage-remind button {
    flex: 0 0 auto;
    padding: 4px 10px;
    border: none;
    border-radius: var(--radius-full);
    background: #334155;
    color: #E2E8F0;
    font-size: 11px;
    white-space: nowrap;
    cursor: pointer;
}
/* 外卖真实记录与App使用监测 (现代化卡片排版，杜绝三列挤压) */
.takeout-record-card {
    padding: 16px;
    border-radius: var(--radius-md);
    background: #FFFFFF;
}

.takeout-badge-pill {
    font-size: 11px;
    color: var(--primary-dark);
    font-weight: 700;
    background: var(--primary-soft);
    padding: 3px 10px;
    border-radius: var(--radius-full);
    border: 1px solid var(--primary-border);
}

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

.takeout-quota-rule {
    font-size: 11.5px;
    color: var(--text-muted);
    line-height: 1.5;
    flex: 1 1 200px;
}

.takeout-tip-pill {
    font-size: 11px;
    color: #047857;
    background: #ECFDF5;
    padding: 2px 8px;
    border-radius: var(--radius-full);
    font-weight: 600;
    white-space: nowrap;
    border: 1px solid #A7F3D0;
}

.usage-box {
    margin-top: 6px;
    padding: 12px 14px;
    background: #F8FAFC;
    border: 1px solid #E2E8F0;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.02);
}

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

.usage-head-title-wrap {
    display: flex;
    align-items: center;
    gap: 6px;
}

.usage-icon {
    font-size: 15px;
}

.usage-title {
    font-size: 13px;
    font-weight: 800;
    color: #0F172A;
}

.usage-state {
    font-size: 11px;
    font-weight: 800;
    padding: 2px 8px;
    border-radius: var(--radius-full);
    background: #F1F5F9;
    color: #64748B;
    border: 1px solid #E2E8F0;
    white-space: nowrap;
}

.usage-state.bad {
    background: #FEF2F2;
    color: #DC2626;
    border-color: #FECACA;
}

.usage-state.good {
    background: #ECFDF5;
    color: #059669;
    border-color: #A7F3D0;
}

.usage-state.warn {
    background: #FFFBEB;
    color: #B45309;
    border-color: #FDE68A;
}

.usage-detail {
    margin-top: 6px;
    font-size: 12px;
    color: #334155;
    line-height: 1.6;
    background: #FFFFFF;
    padding: 8px 10px;
    border-radius: 8px;
    border: 1px solid #F1F5F9;
    overflow-wrap: anywhere;
}

.usage-grant-btn {
    margin-top: 8px;
    display: inline-block;
    padding: 6px 14px;
    font-size: 11.5px;
    font-weight: 700;
    border-radius: var(--radius-full);
    background: #059669;
    color: #FFFFFF;
    border: none;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(5, 150, 105, 0.2);
    transition: opacity 0.15s;
}

.usage-grant-btn:active {
    opacity: 0.85;
}

.usage-honest {
    margin-top: 8px;
    font-size: 10.5px;
    color: #94A3B8;
    line-height: 1.5;
}

.takeout-progress-wrap {
    margin-top: 12px;
}

.takeout-progress-track {
    background: #F1F5F9;
    border-radius: var(--radius-full);
    height: 7px;
    overflow: hidden;
}
/* 第五批后续：AI 引擎选择条。窄屏下必须能换行，否则那颗 select 会把整排挤没。 */
.ai-engine-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    margin-bottom: 6px;
    font-size: 11.5px;
    color: #475569;
}
.eng-lab { font-weight: 700; color: #0F172A; flex: 0 0 auto; }
.eng-sel {
    flex: 0 1 auto;
    min-width: 0;
    max-width: 100%;
    padding: 5px 8px;
    border: 1px solid #E2E8F0;
    border-radius: 8px;
    background: #fff;
    font-size: 11.5px;
    color: #0F172A;
}
.eng-test {
    flex: 0 0 auto;
    padding: 5px 10px;
    border: 1px solid #10B981;
    border-radius: var(--radius-full);
    background: #ECFDF5;
    color: #047857;
    font-size: 11.5px;
    font-weight: 700;
    white-space: nowrap;
    cursor: pointer;
}
.ai-engine-bar { flex: 1 1 120px; min-width: 0; display: flex; align-items: center; gap: 6px; }
.ai-engine-bar .eng-ok { color: #059669; font-weight: 800; white-space: nowrap; }
.ai-engine-bar .eng-no { color: #B45309; font-weight: 800; white-space: nowrap; }
.ai-engine-bar .eng-ms { color: #94A3B8; }
.ai-engine-bar .eng-why {
    color: #94A3B8;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.eng-line { color: #94A3B8; font-size: 10.5px; }
/* 第五批后续：公网大屏专属工具条 */
.pub-tools-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 8px; }
.pub-tools-title { font-size: 13px; font-weight: 800; color: #0F172A; }
.public-refresh-stamp {
    margin-left: auto;
    font-size: 11px;
    color: #059669;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
}
.public-refresh-stamp.bad { color: #DC2626; white-space: normal; }
.pub-tools-row { display: flex; flex-wrap: wrap; gap: 8px; }
.pub-tools-note { margin-top: 8px; font-size: 11px; color: #94A3B8; line-height: 1.5; }
/* ================= 动作详情（火柴人演示）与弹窗排版 ================= */
.ex-detail {
    max-width: 480px;
    padding: 20px 20px 28px;
    border-radius: var(--radius-lg);
    background: #FFFFFF;
    box-shadow: 0 25px 50px -12px rgba(15, 23, 42, 0.25);
}
.exd-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 12px;
}
.exd-head-info {
    flex: 1;
    min-width: 0;
}
.exd-title-row {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}
.exd-badge-demo {
    background: #F1F5F9;
    color: #475569;
    font-size: 10px;
    font-weight: 800;
    padding: 2px 7px;
    border-radius: 99px;
    letter-spacing: 0.5px;
    border: 1px solid #E2E8F0;
}
.exd-name {
    font-size: 17px;
    font-weight: 800;
    color: #0F172A;
    line-height: 1.3;
}
.exd-meta-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 4px;
    flex-wrap: wrap;
}
.exd-reps {
    font-size: 12px;
    color: #059669;
    font-weight: 700;
    background: #ECFDF5;
    padding: 2px 8px;
    border-radius: 6px;
    border: 1px solid #A7F3D0;
}
.exd-target-muscle {
    font-size: 11px;
    color: #0284C7;
    font-weight: 700;
    background: #F0F9FF;
    padding: 2px 8px;
    border-radius: 6px;
    border: 1px solid #BAE6FD;
}
.exd-close {
    width: 32px;
    height: 32px;
    border: none;
    border-radius: 50%;
    background: #F1F5F9;
    color: #64748B;
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    flex-shrink: 0;
}
.exd-close:hover {
    background: #E2E8F0;
    color: #0F172A;
}

/* 火柴人舞台：浅色卡片，跟设计系统同一套底色，不再有那块深色全息面板 */
.exd-stage {
    width: 100%;
    border-radius: 14px;
    overflow: hidden;
    background: #FFFFFF;
    border: 1px solid #E2E8F0;
    margin-bottom: 8px;
}
.exd-canvas {
    display: block;
    width: 100%;
    height: auto;
    aspect-ratio: 1 / 1;
    max-height: 340px;
}
/* 相位与说明写在画布下方的正常流里：画布上不再叠任何 absolute 浮层。
   以前左上角挂视角提示、下面挂相位徽标、右下角挂说明，手机上正好压在人形上。 */
.exd-strip {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px 10px;
    margin-bottom: 10px;
    padding: 2px 2px 0;
}
.exd-phase {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 11.5px;
    font-weight: 700;
    color: #047857;
    background: #ECFDF5;
    border: 1px solid #A7F3D0;
    border-radius: 99px;
    padding: 3px 10px;
}
.exd-phase.back {
    color: #0369A1;
    background: #F0F9FF;
    border-color: #BAE6FD;
}
.phase-dot {
    width: 6px;
    height: 6px;
    background: currentColor;
    border-radius: 50%;
    animation: pulseDot 1.4s infinite ease-in-out;
}
@keyframes pulseDot {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.4; transform: scale(0.8); }
}
.exd-caption {
    font-size: 11.5px;
    color: #64748B;
    line-height: 1.45;
}

/* 动作播放控制栏 */
.exd-ctl {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px 10px;
    margin-bottom: 12px;
    background: #F8FAFC;
    border: 1px solid #E2E8F0;
    border-radius: 12px;
    padding: 8px 12px;
}
.exd-ctl-btns {
    display: flex;
    gap: 6px;
    flex-shrink: 0;
}
.btn-exd-ctl {
    border: 1px solid #CBD5E1;
    background: #FFFFFF;
    color: #1E293B;
    border-radius: 99px;
    padding: 5px 12px;
    font-size: 11.5px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.15s;
    display: flex;
    align-items: center;
    gap: 4px;
}
.btn-exd-ctl:hover {
    background: #F1F5F9;
    border-color: #94A3B8;
}
/* 说明给一个 200px 的基准宽：320 档放不下就整句换到按钮下面。
   以前 flex:1 在窄屏被两颗按钮挤成四个字一列，一句话排了十行。 */
.exd-note {
    font-size: 11px;
    color: #64748B;
    line-height: 1.5;
    flex: 1 1 200px;
    min-width: 0;
}

/* 分解步骤 */
.exd-section-title {
    font-size: 13px;
    font-weight: 800;
    color: #1E293B;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 6px;
}
.exd-steps {
    list-style: none;
    margin: 0 0 12px 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.exd-steps li {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    background: #F8FAFC;
    border: 1px solid #E2E8F0;
    border-radius: 10px;
    padding: 8px 12px;
    font-size: 12.5px;
    color: #334155;
    line-height: 1.55;
}
.step-badge {
    flex: 0 0 22px;
    height: 22px;
    background: linear-gradient(135deg, #10B981 0%, #059669 100%);
    color: #FFFFFF;
    font-size: 11.5px;
    font-weight: 800;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: 1px;
    box-shadow: 0 2px 4px rgba(16, 185, 129, 0.2);
}
.step-text {
    flex: 1;
}

/* 常见错误重点避坑卡片 (绝不遮挡、不贴底) */
.ex-wrong-card {
    background: #FFFBEB;
    border: 1px solid #FDE68A;
    border-radius: 12px;
    padding: 10px 14px 12px;
    margin-top: 8px;
    margin-bottom: 8px;
}
.exw-header {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 4px;
}
.exw-icon {
    font-size: 15px;
}
.exw-title {
    font-size: 12px;
    font-weight: 800;
    color: #92400E;
}
.ex-wrong {
    font-size: 12px;
    color: #B45309;
    line-height: 1.6;
    margin-top: 0;
    background: transparent;
    border-radius: 0;
    padding: 0;
}
.ex-btn.ghost { background: #F1F5F9; color: #475569; }

/* 疑似旧默认身体数据的核对横幅 */
.body-suspect {
    border: 1px solid #FCD34D;
    background: #FFFBEB;
}
.bs-title { font-size: 13px; font-weight: 800; color: #92400E; margin-bottom: 4px; }
.bs-body { font-size: 11.5px; color: #A16207; line-height: 1.6; margin-bottom: 8px; }

/* 第六批补：排版实测修复（320/360/414 三档量出来的溢出）
   判法：把每个面板克隆进固定宽度容器，读 clientWidth/scrollWidth。
   隐藏态页面 viewport 是 [0,0]，所有宽度都是 0，直接量线上页得到的是假数。 */

/* 每日状态条：值单元格原来 43~74px 而文字要 65~78px，四个宽度全被裁 */
.daily-strip .dc-val {
    min-width: 0;
    font-size: 11.5px;
    white-space: normal;
    overflow-wrap: anywhere;
    line-height: 1.25;
}
.daily-strip .dc-cell { min-width: 0; flex: 1 1 0; }

/* 引擎状态行：原来一句 258px 的话塞进 117px 的槽，必须允许折行 */
.ai-engine-bar .eng-why {
    white-space: normal;
    overflow: visible;
    text-overflow: clip;
    line-height: 1.35;
    flex: 1 1 100%;
}

/* 字段小注：把长说明从 placeholder 搬出来，placeholder 只留放得下的短词 */
.field-hint {
    font-size: 10.5px;
    color: #94A3B8;
    line-height: 1.5;
    margin-top: 4px;
    overflow-wrap: anywhere;
}

/* 320px 一档实测只剩副标题被省略号截断（65<88）。品牌位现在是 logo 图，
   副标题在这个宽度没有信息量，直接隐藏比留半行字干净。 */
@media (max-width: 340px) {
    .header-subtitle,
    header p:not([id]) {
        display: none;
    }
}

/* 通用次级按钮规范 (Modern Secondary Button) */
.btn-secondary {
    background: #FFFFFF;
    color: var(--primary-dark);
    border: 1.5px solid var(--primary);
    padding: 7px 16px;
    font-size: 12px;
    font-weight: 700;
    border-radius: var(--radius-sm);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}
.btn-secondary:hover {
    background: var(--primary-soft);
    border-color: var(--primary-dark);
    transform: translateY(-1px);
    box-shadow: 0 4px 10px rgba(16, 185, 129, 0.15);
}
.btn-secondary:active {
    transform: scale(0.97);
}

/* 第七批：网页端独占工作台 (Apple/Keep 现代健康中台卡片质感) */
.web-wb {
    border: 1px solid #E2E8F0;
    background: #FFFFFF;
    border-radius: var(--radius-md);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.03);
    padding: 18px 20px;
    margin-top: 14px;
}
.wb-head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 12px;
    padding-bottom: 10px;
    border-bottom: 1.5px solid #F1F5F9;
}
.wb-title {
    font-size: 15px;
    font-weight: 800;
    color: #0F172A;
    display: flex;
    align-items: center;
    gap: 6px;
}
.wb-tag {
    font-size: 11px;
    color: #059669;
    background: #ECFDF5;
    border: 1px solid #A7F3D0;
    border-radius: var(--radius-full);
    padding: 3px 10px;
    font-weight: 600;
    white-space: nowrap;
}
.wb-block {
    margin-top: 12px;
    padding: 14px 16px;
    background: #F8FAFC;
    border: 1px solid #E2E8F0;
    border-radius: 12px;
    transition: border-color 0.2s ease;
}
.wb-block:hover {
    border-color: #CBD5E1;
}
.wb-h {
    font-size: 13px;
    font-weight: 800;
    color: #0F172A;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 6px;
}
.wb-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
}
.wb-row label {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    font-weight: 600;
    color: #475569;
}
.wb-row .input-control {
    height: 36px;
    border-radius: 8px;
    border: 1.5px solid #CBD5E1;
    background: #FFFFFF;
    font-size: 12px;
    color: #1E293B;
    padding: 0 10px;
    transition: all 0.2s ease;
}
.wb-row .input-control:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.15);
    outline: none;
}
.wb-chk {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: #475569;
    cursor: pointer;
    user-select: none;
}
.wb-chk input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: var(--primary);
    cursor: pointer;
}
.wb-out {
    margin-top: 10px;
    font-size: 12px;
    color: #334155;
    line-height: 1.6;
    background: #FFFFFF;
    border-radius: 8px;
    padding: 10px 12px;
    border: 1px solid #E2E8F0;
}
.wb-ok { color: #059669; font-weight: 800; }
.wb-warn { color: #B45309; font-weight: 700; }
.wb-bad { color: #DC2626; font-weight: 700; }
.wb-list { margin: 6px 0 0 18px; padding: 0; font-size: 11.5px; color: #475569; line-height: 1.8; }
.wb-note { margin-top: 6px; font-size: 10.5px; color: #94A3B8; line-height: 1.6; overflow-wrap: anywhere; }
.wb-count { font-size: 11px; color: #64748B; margin-bottom: 4px; }
.wb-scroll { max-height: 380px; overflow: auto; border: 1px solid #E2E8F0; border-radius: 8px; }
.wb-table { width: 100%; border-collapse: collapse; font-size: 11px; }
.wb-table th {
    position: sticky; top: 0; background: #F1F5F9; color: #334155;
    text-align: left; padding: 6px 8px; cursor: pointer; white-space: nowrap;
}
.wb-table td { padding: 5px 8px; border-top: 1px solid #F1F5F9; color: #475569; white-space: nowrap; }
.wb-report { margin-top: 8px; }
.rpt-head { border-bottom: 2px solid #10B981; padding-bottom: 6px; margin-bottom: 10px; }
.rpt-title { font-size: 17px; font-weight: 800; color: #0F172A; }
.rpt-sub { font-size: 11px; color: #94A3B8; }
.rpt-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 8px; margin-bottom: 10px; }
.rpt-grid div { background: #F8FAFC; border-radius: 8px; padding: 8px 10px; }
.rpt-grid i { display: block; font-size: 10.5px; color: #64748B; font-style: normal; }
.rpt-grid b { font-size: 15px; color: #0F172A; }
.rpt-table { width: 100%; border-collapse: collapse; font-size: 11.5px; }
.rpt-table th { text-align: left; padding: 5px 6px; border-bottom: 1px solid #E2E8F0; color: #334155; }
.rpt-table td { padding: 5px 6px; border-bottom: 1px solid #F1F5F9; color: #475569; }
.rpt-table .num { text-align: right; }
.rpt-table .pos { color: #059669; font-weight: 700; }
.rpt-table .neg { color: #94A3B8; }
.rpt-foot { margin-top: 10px; font-size: 10px; color: #94A3B8; line-height: 1.6; }

/* 打印：只留复盘那一页，屏幕上的导航与卡片全部隐掉 */
@media print {
    body.printing-report * { visibility: hidden !important; }
    body.printing-report #wb-report, body.printing-report #wb-report * { visibility: visible !important; }
    body.printing-report #wb-report {
        position: absolute; left: 0; top: 0; width: 100%; padding: 0;
    }
    body.printing-report .wb-row, body.printing-report .web-wb .wb-block:not(:last-child) { display: none !important; }
}

/* ④ 30天自律习惯热力矩阵 */
.wb-habit-grid {
    display: grid;
    grid-template-columns: repeat(10, minmax(16px, 26px));
    justify-content: start;
    gap: 5px;
    padding: 10px;
    background: #F8FAFC;
    border-radius: 8px;
    border: 1px solid #E2E8F0;
    margin-bottom: 8px;
}
.wb-habit-cell {
    aspect-ratio: 1;
    border-radius: 4px;
    background: #E2E8F0;
    transition: transform 0.15s ease, background 0.2s ease;
    cursor: pointer;
    position: relative;
}
.wb-habit-cell:hover {
    transform: scale(1.15);
    z-index: 2;
}
.wb-habit-cell.lvl-0 { background: #E2E8F0; }
.wb-habit-cell.lvl-1 { background: #A7F3D0; }
.wb-habit-cell.lvl-2 { background: #34D399; }
.wb-habit-cell.lvl-3 { background: #059669; }

.wb-habit-empty {
    display: block;
    font-size: 12px;
    line-height: 1.6;
    color: #B45309;
    background: #FFFBEB;
    border: 1px solid #FDE68A;
    border-radius: 8px;
    padding: 8px 10px;
    margin-bottom: 8px;
}
.wb-habit-legend {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 10.5px;
    color: var(--text-muted);
}
.legend-dot {
    width: 10px;
    height: 10px;
    border-radius: 2px;
    display: inline-block;
}
.legend-dot.lvl-0 { background: #E2E8F0; }
.legend-dot.lvl-1 { background: #A7F3D0; }
.legend-dot.lvl-2 { background: #34D399; }
.legend-dot.lvl-3 { background: #059669; }

/* 👏 访客打气角与徽章 */
.pub-cheer-btns {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.btn-cheer-chip {
    background: #F0FDF4;
    border: 1px solid #BBF7D0;
    color: #166534;
    font-size: 11.5px;
    font-weight: 600;
    padding: 6px 12px;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.2s ease;
}
.btn-cheer-chip:hover {
    background: #DCFCE7;
    transform: translateY(-1px);
    border-color: #86EFAC;
}
.btn-cheer-chip:active {
    transform: scale(0.96);
}
.pub-cheer-toast {
    margin-top: 8px;
    font-size: 11px;
    color: #059669;
    font-weight: 700;
    animation: fadeIn 0.3s ease;
}

/* 📺 全屏沉浸/极简投屏模式 (Kiosk Mode) */
body.kiosk-mode {
    background: #0B132B !important;
    color: #F8FAFC !important;
}
body.kiosk-mode .app-header,
body.kiosk-mode .card {
    background: #1C2541 !important;
    border-color: #2D3748 !important;
    color: #F8FAFC !important;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4) !important;
}
body.kiosk-mode .card-title,
body.kiosk-mode .gauge-num,
body.kiosk-mode .wb-title,
body.kiosk-mode .rpt-title {
    color: #6EE7B7 !important;
}
body.kiosk-mode .tab-bar,
body.kiosk-mode .pub-tools-note,
body.kiosk-mode .callout {
    display: none !important;
}

.day-complete-card .day-complete-hint { font-size: 11.5px; color: var(--text-muted); line-height: 1.6; margin-bottom: 8px; }
.day-complete-state { font-size: 11.5px; color: #D97706; font-weight: 700; }
.day-complete-state.done { color: var(--primary-dark); }


/* ── 强制更新门：整屏盖住，底下所有控件都不该再被点到 ── */
body.update-blocked { overflow: hidden; }
.update-wall {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    z-index: 9999;
    background: rgba(248, 250, 252, 0.97);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}
.uw-card {
    width: 100%;
    max-width: 420px;
    background: #FFFFFF;
    border: 1px solid var(--primary-border);
    border-radius: var(--radius-lg);
    box-shadow: 0 12px 32px rgba(6, 78, 59, 0.14);
    padding: 22px 20px;
}
.uw-badge {
    display: inline-block;
    background: var(--danger-soft);
    color: var(--danger-dark);
    border: 1px solid #FECACA;
    border-radius: 999px;
    padding: 3px 10px;
    font-size: 12px;
    font-weight: 700;
}
.uw-title { margin: 12px 0 6px; font-size: 18px; line-height: 1.4; color: var(--text-main); }
.uw-why { margin: 0 0 14px; font-size: 13px; line-height: 1.6; color: var(--text-light); }
.uw-facts {
    margin: 0 0 18px;
    padding: 12px 14px 12px 30px;
    background: var(--primary-soft);
    border-radius: var(--radius-md);
    font-size: 13px;
    line-height: 1.9;
    color: var(--text-main);
}
.uw-facts b { color: var(--primary-deep); }
.uw-btn { width: 100%; }
.uw-note { margin: 10px 0 0; font-size: 12px; line-height: 1.6; color: var(--text-light); }
.uw-alt {
    width: 100%;
    margin-top: 12px;
    min-height: 40px;
    background: none;
    border: 1px solid var(--border, #E2E8F0);
    border-radius: var(--radius-md);
    color: var(--text-light);
    font-size: 13px;
}

/* 行内小按钮：和弹窗里那套 td-mini 同一个形状与配色，全站只有一种小按钮 */
.btn-row, .btn-row-danger {
    min-height: 34px;
    padding: 0 12px;
    border: 1px solid #CBD5E1;
    border-radius: 10px;
    background: #FFFFFF;
    color: #065F46;
    font: inherit;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
}

.btn-row:active, .btn-row-danger:active { transform: scale(.98); }

.btn-row-danger {
    border-color: #FECACA;
    background: #FEF2F2;
    color: #B91C1C;
}

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

/* 顶栏头像与链接式按钮 */
.link-like{appearance:none;-webkit-appearance:none;border:0;background:none;padding:0;margin:0;font:inherit;color:var(--primary-dark,#059669);text-decoration:underline;cursor:pointer}
.link-like:focus-visible{outline:2px solid #10B981;outline-offset:2px}

/* 食谱忌口标注：只标不改，颜色用琥珀色而不是红色（红色在本应用里是"超标"） */
.meal-clash{margin-top:6px;font-size:11.5px;line-height:1.55;color:#92400E;background:#FFFBEB;border:1px solid #FDE68A;border-radius:8px;padding:5px 8px;overflow-wrap:anywhere}
.meal-clash-summary{margin:0 0 10px;font-size:12px;color:#475569;background:#F8FAFC;border:1px solid #E2E8F0;border-radius:8px;padding:6px 9px}

/* ============================================================
   r179 B10：统一弹窗内容封顶、底部操作条与减少动态效果
   ============================================================ */
/* 封顶的规矩（r178 更新弹窗"看着有滚动条却滑不动"就是这么来的）：
   max-height 必须落在真正会滚的那一层。上面 .modal-card 那条同时写了
   max-height: min(90dvh, 840px) 和 overflow-y: auto —— 卡片自己就是滚动容器，
   所以正文 .modal-body 一律不许再写 max-height，否则滚动条挂在滑不动的那层上。 */
.modal-body { max-height: none; }

/* 底部操作条：粘在滚动容器的下沿，长表单滚到哪儿都点得到保存。
   负 margin 把它摊到卡片左右边缘（.modal-body 自带 20px 内边距）。 */
.modal-foot {
    position: sticky;
    bottom: 0;
    z-index: 11;
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin: 14px -20px -24px;
    padding: 12px 20px calc(12px + env(safe-area-inset-bottom));
    background: rgba(255, 255, 255, 0.97);
    border-top: 1px solid var(--border);
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
}
.modal-foot > .btn-primary { margin-top: 0; }

/* 320px 窄屏 / 200% 字号：弹窗先保可视高度，再保左右留白，
   卡片本身按 dvh 封顶，正文继续在同一层滚，底部操作条不会被挤出屏幕。 */
@media (max-width: 320px) {
    .modal-overlay { padding: 8px 6px calc(8px + env(safe-area-inset-bottom)); }
    .modal-card { max-height: 94dvh; }
    .modal-header { padding: 12px 14px 10px; }
    .modal-header h2 { font-size: 15px; }
    .modal-body { padding: 14px 14px 20px; }
    .modal-foot { margin: 12px -14px -20px; padding: 10px 14px calc(10px + env(safe-area-inset-bottom)); }
}

/* 减少动态效果：通配符那条（见 @media prefers-reduced-motion）已经覆盖
   animation/transition，但组件里随时可能冒出带 !important 的写法，
   这里把弹层、抽屉、提示条点名再钉一遍，谁将来加浮层动画都逃不掉。 */
@media (prefers-reduced-motion: reduce) {
    .modal-overlay, .modal-card, .modal-header, .modal-foot,
    .tool-dialog, .tool-dialog > header, .td-body, .td-foot,
    .page-layer, .pl-head, .pl-foot, .pl-body,
    .exd-head, .exd-ctl, .bottom-nav, .floating-dl-btn,
    .pub-cheer-toast, #web-toast-container, .bubble-menu,
    .dm-hold-layer, .dm-call-layer, .dm-call-mini {
        animation: none !important;
        transition: none !important;
        scroll-behavior: auto !important;
    }
}

/* ===== 记录省步骤（B03）=====
   常用餐食与复制上一餐都在主区，按钮要够大、能换行，320 档不许横向溢出。 */
.meal-quick-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.meal-quick-btn { flex: 1 1 120px; min-height: 40px; padding: 8px 12px; font-size: 13px;
    font-family: inherit; line-height: 1.3; border: 1.5px solid var(--primary-border);
    border-radius: 999px; background: #F0FDF4; color: var(--primary-dark); cursor: pointer; }
.meal-quick-btn.quiet { background: #fff; border-color: #CBD5E1; color: var(--text-muted); }
.meal-quick-btn:active { transform: translateY(1px); }

.recent-meal-list { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.recent-meal-list .rm-lead { flex: 1 1 100%; font-size: 11.5px; color: var(--text-muted); }
.recent-meal-list .rm-empty { flex: 1 1 100%; font-size: 11.5px; color: var(--text-light);
    padding: 8px; background: #F8FAFC; border-radius: 10px; }
.rm-chip { flex: 1 1 150px; min-height: 44px; display: flex; flex-direction: column;
    align-items: flex-start; justify-content: center; gap: 2px; padding: 7px 10px;
    text-align: left; font-family: inherit; cursor: pointer;
    border: 1.5px solid #E2E8F0; border-radius: 12px; background: #fff; }
.rm-chip:active { background: #F0FDF4; }
.rm-name { font-size: 13px; font-weight: 700; color: var(--text-main); max-width: 100%;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rm-meta { font-size: 10.5px; color: var(--text-light); }

/* 修正/删除之后"影响了哪一天、那天现在算成什么"必须留在页面上，不只在一条一闪而过的提示里 */
.record-impact { margin-top: 10px; padding: 9px 11px; font-size: 12px; line-height: 1.6;
    color: #1D4ED8; background: #EFF6FF; border-left: 3px solid #2563EB; border-radius: 0 10px 10px 0;
    overflow-wrap: anywhere; }

/* ===== 档案拆分（B04）=====
   四组各自成块、各自保存；摘要条挂在底部操作条里，滚到哪儿都看得见。
   全部用 minmax(0,1fr)/flex-wrap，320px 与 200% 字号下不许撑出横向滚动。 */
.prof-split-note { margin: 0 0 14px; padding: 9px 11px; font-size: 12px; line-height: 1.65;
    color: var(--text-muted); background: #F8FAFC; border-radius: 10px; overflow-wrap: anywhere; }
.prof-group { margin: 0 0 16px; padding: 12px; border: 1px solid var(--border);
    border-radius: 14px; background: #fff; }
.prof-group-title { margin: 0 0 4px; font-size: 14px; font-weight: 800; color: var(--primary-dark); }
.prof-group-hint { margin: 0 0 10px; font-size: 11.5px; line-height: 1.6;
    color: var(--text-light); overflow-wrap: anywhere; }
.prof-group-foot { margin-top: 10px; }
.prof-save-btn { width: 100%; min-height: 44px; margin: 0; font-size: 13.5px; }
.prof-summary { margin: 0 0 8px; padding: 9px 11px; font-size: 12px; line-height: 1.65;
    text-align: left; color: #0F172A; background: #F1F5F9; border-left: 3px solid var(--primary);
    border-radius: 0 10px 10px 0; max-height: 34vh; overflow-y: auto; overflow-wrap: anywhere; }
.prof-summary[hidden] { display: none; }
.prof-summary-head { font-weight: 800; margin-bottom: 4px; }
.prof-summary-line { font-size: 12px; }
.prof-summary-arrow { color: var(--primary-dark); font-weight: 800; }
.prof-summary-scope { margin-top: 5px; font-size: 11px; color: var(--text-light); }
.prof-summary-acts { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 8px; }
.prof-summary-acts[hidden] { display: none; }
.prof-summary-acts > .btn-secondary, .prof-summary-acts > .btn-primary {
    flex: 1 1 130px; width: auto; min-height: 44px; margin: 0; font-size: 13.5px; }

.home-today{border-color:var(--primary-border)}
.home-hint{font-size:10.5px;color:var(--text-light)}
.home-acts{display:grid;gap:8px}
.home-act{display:flex;align-items:center;gap:10px;width:100%;min-height:48px;padding:8px 12px;border:1px solid var(--border);border-radius:12px;background:#FFF;text-align:left;cursor:pointer;font:inherit;color:var(--text-main)}
.home-act .ha-ico{font-size:20px;flex:0 0 auto}
.home-act .ha-body{flex:1 1 auto;min-width:0;display:flex;flex-direction:column;gap:2px}
.home-act b{font-size:13.5px}
.home-act .ha-state{font-size:11.5px;color:var(--text-muted);overflow-wrap:anywhere}
.home-act .ha-go{color:var(--primary-dark);font-weight:800;flex:0 0 auto}
.home-act.done{background:var(--primary-soft);border-color:var(--primary-border)}
.home-act.done .ha-state{color:var(--primary-dark);font-weight:700}
.home-sync{display:grid;gap:4px;padding:10px 14px}
.home-sync-row{display:flex;justify-content:space-between;gap:10px;font-size:12px;color:var(--text-muted)}
.home-sync-row b{color:var(--text-main);overflow-wrap:anywhere;text-align:right}
.home-next{border-left:4px solid var(--primary)}
.home-next-lab{font-size:10.5px;color:var(--text-light)}
.home-next-text{margin-top:3px;font-size:13.5px;font-weight:700;line-height:1.55;overflow-wrap:anywhere}
.home-fold{background:#FFF;border:1px solid var(--border);border-radius:var(--radius-md);padding:10px 14px;margin-bottom:10px}
.home-fold>summary{font-size:12.5px;font-weight:700;color:var(--text-muted);cursor:pointer;overflow-wrap:anywhere}
.home-fold[open]>summary{margin-bottom:8px}
.home-fold .callout,.home-fold .web-download-card{margin-bottom:0}
