/* 财务自由 · 记账 PWA 样式（移动端优先，适配华为手机全面屏 safe-area） */
:root {
    --primary: #4a7cf6;
    --income: #f5a623;
    --expense: #e64340;
    --bg: #f5f6f7;
    --card: #ffffff;
    --text: #333333;
    --text-2: #999999;
    --text-3: #bbbbbb;
    --line: #eeeeee;
    --safe-top: env(safe-area-inset-top, 0px);
    --safe-bottom: env(safe-area-inset-bottom, 0px);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

html, body {
    height: 100%;
}

body {
    font-family: -apple-system, "HarmonyOS Sans SC", "MiSans", "PingFang SC",
        "Microsoft YaHei", sans-serif;
    background: var(--bg);
    color: var(--text);
    font-size: 15px;
    overflow: hidden;
    -webkit-font-smoothing: antialiased;
}

button {
    font-family: inherit;
    border: none;
    background: none;
    cursor: pointer;
}

/* ---------- 内容区 ---------- */
.content {
    position: absolute;
    top: var(--safe-top);
    bottom: calc(var(--safe-bottom) + 54px);
    left: 0;
    right: 0;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: 10px;
}

.empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 60px 0;
}

.empty-icon {
    font-size: 40px;
}

.empty-text {
    font-size: 14px;
    color: var(--text-2);
    margin-top: 10px;
    text-align: center;
    line-height: 22px;
}

/* 图标（统计页用） */
.bill-icon {
    font-size: 24px;
    margin-right: 12px;
    flex-shrink: 0;
}

/* 统计条目 */
.stat-item {
    background: var(--card);
    border-radius: 10px;
    padding: 14px;
    margin-bottom: 8px;
}

.stat-row {
    display: flex;
    align-items: center;
}

.stat-name {
    flex: 1;
    font-size: 15px;
    margin-left: 2px;
}

.stat-cnt {
    font-size: 12px;
    color: #888;
    margin-right: 10px;
}

.stat-total {
    font-size: 15px;
    font-weight: bold;
    color: var(--expense);
}

.stat-bar-bg {
    height: 6px;
    background: #f0f0f0;
    border-radius: 3px;
    margin-top: 10px;
    overflow: hidden;
}

.stat-bar {
    height: 100%;
    background: var(--primary);
    border-radius: 3px;
    transition: width 0.3s ease;
}

/* 我的页 */
.section-title {
    font-size: 13px;
    color: var(--text-2);
    padding: 14px 6px 8px;
}

.menu-item {
    display: flex;
    align-items: center;
    background: var(--card);
    border-radius: 10px;
    padding: 16px 14px;
    margin-bottom: 8px;
    cursor: pointer;
}

.menu-icon {
    font-size: 22px;
    margin-right: 12px;
}

.menu-info { flex: 1; }

.menu-name {
    font-size: 15px;
    color: var(--text);
}

.menu-desc {
    font-size: 12px;
    color: #888;
    margin-top: 2px;
}

.menu-arrow {
    font-size: 20px;
    color: #ccc;
}

.about {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 30px 0;
}

.about-text {
    font-size: 16px;
    font-weight: bold;
}

.about-desc {
    font-size: 12px;
    color: #888;
    margin-top: 6px;
}

/* ---------- 底部导航 ---------- */
.tabbar {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    height: calc(var(--safe-bottom) + 54px);
    padding-bottom: var(--safe-bottom);
    display: flex;
    background: var(--card);
    border-top: 1px solid var(--line);
    z-index: 10;
}

.tab-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #999;
}

.tab-item.active {
    color: var(--primary);
}

.tab-icon { font-size: 20px; }

.tab-label {
    font-size: 11px;
    margin-top: 2px;
}

/* Toast */
.toast {
    position: fixed;
    left: 50%;
    bottom: 120px;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.75);
    color: #fff;
    font-size: 14px;
    padding: 10px 18px;
    border-radius: 20px;
    z-index: 99;
    max-width: 80vw;
    text-align: center;
}

/* 桌面端：居中收窄（手机优先）；两栏布局在所有宽度下保持不变 */
@media (min-width: 600px) {
    body {
        max-width: 800px;
        margin: 0 auto;
        box-shadow: 0 0 24px rgba(0, 0, 0, 0.1);
    }
}

/* ---------- 财务报表（一比一还原现金流游戏版式） ---------- */

/* 棋盘式布局：手机双栏（左卡片/右面板），宽屏三栏 */
.board {
    position: relative;
    display: grid;
    grid-template-columns: 1.15fr 1fr;
    grid-template-areas:
        "left right"
        "mid right";
    align-items: start;
    column-gap: 40px; /* 右侧通道，与左侧 padding-left 对称匀称 */
    row-gap: 8px;
    background: #e8d5ab;
    border: 4px solid #6b5741;
    border-radius: 6px;
    padding: 8px 8px 8px 40px; /* 左侧预留资产箭头通道 */
    /* 米黄纸张质感 */
    background-image: repeating-linear-gradient(
        45deg,
        rgba(255, 255, 255, 0.06) 0 2px,
        transparent 2px 6px
    );
}

.board-left {
    grid-area: left;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.board-mid {
    grid-area: mid;
}

.board-right {
    grid-area: right;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* 宽屏：箭头通道加宽 + 图例钉底填满高度差（布局仍为两栏） */
@media (min-width: 720px) {
    .board {
        padding-left: 56px;
        column-gap: 56px;
    }
    .board-right .b-legend {
        margin-top: auto;
    }
}

/* 手机端（<720px）：保持双栏，但大幅收窄箭头通道，把空间还给文字 */
@media (max-width: 719px) {
    .board {
        padding: 8px 6px 8px 24px; /* 左侧通道 24px，右侧留 6px */
        column-gap: 16px;          /* 负债箭头右侧通道收窄 */
        row-gap: 6px;
    }
    .board-left {
        gap: 6px;
    }
    .board-right {
        gap: 8px;
    }
    /* 卡片内边距收窄，省出横向空间 */
    .b-card {
        padding: 0 4px 4px;
    }
    .b-title {
        margin: 0 -4px 3px;
    }
    /* 方案A：手机端资产/负债改上下叠放，各占满左栏宽度，项目名可完整显示 */
    .b-duo {
        flex-direction: column;
        gap: 6px;
    }
    .b-duo .b-card {
        flex: none;
        width: 100%;
    }
    /* 数据行更紧凑：字号略降，点线/间距收窄，让名称有更多空间 */
    .b-row {
        font-size: 12px;
        padding: 3px 0 1px;
        line-height: 15px;
    }
    /* 手机端名称不收缩，点线承担弹性，保证项目名完整显示 */
    .b-name {
        flex-shrink: 0;
        font-size: 11px;
    }
    .b-amt {
        font-size: 11px;
    }
    .b-dots {
        margin: 0 2px 2px;
        min-width: 0;
    }
    /* 月现金流标签：手机端缩成纯色圆点，释放空间给项目名（蓝=月入 红=月付，图例已说明） */
    .b-cf {
        width: 8px;
        height: 8px;
        padding: 0;
        margin-left: 3px;
        border-radius: 50%;
        font-size: 0;
        line-height: 0;
        align-self: center;
        flex-shrink: 0;
        overflow: hidden;
    }
    /* 删除/编辑按钮略缩小，热区保持可点 */
    .b-del {
        width: 15px;
        height: 15px;
        line-height: 13px;
    }
    .b-edit {
        width: 15px;
        height: 15px;
    }
}

/* 卡片（收入/支出/资产/负债） */
.b-card {
    background: #f2e6c9;
    border: 1px solid #c9b586;
    border-radius: 4px;
    padding: 0 6px 6px;
    box-shadow: 1px 1px 3px rgba(0, 0, 0, 0.25);
    min-width: 0;
}

/* 紫色标题栏（游戏样式：白描边） */
.b-title {
    background: #8b6f9e;
    color: #fff;
    font-size: 13px;
    font-weight: bold;
    letter-spacing: 5px;
    text-align: center;
    padding: 5px 0;
    margin: 0 -6px 4px;
    box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.55);
}

/* 数据行：名称 + 点线 + 金额 */
.b-rows {
    min-width: 0;
}

.b-row {
    display: flex;
    align-items: flex-end;
    padding: 4px 0 2px;
    font-size: 13px;
    line-height: 17px;
}

.b-name {
    color: #3d3425;
    flex-shrink: 0;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.b-dots {
    flex: 1;
    border-bottom: 2px dotted #a89367;
    margin: 0 4px 2px;
    min-width: 8px;
}

.b-amt {
    color: #2f2818;
    font-weight: bold;
    font-size: 12px;
    flex-shrink: 0;
    font-variant-numeric: tabular-nums;
}

/* 台账"月现金流"小标签：月入统一蓝色 */
.b-cf {
    flex-shrink: 0;
    font-size: 10px;
    line-height: 13px;
    padding: 0 3px;
    border-radius: 3px;
    margin-left: 3px;
    background: rgba(46, 111, 168, 0.12);
    color: #2e6fa8;
    white-space: nowrap;
}

/* 月付统一红色 */
.b-cf-out {
    background: rgba(160, 69, 69, 0.12);
    color: #a04545;
}

/* 现金流箭头图层：铺满报表板，不挡点击 */
#arrowLayer {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 5;
    overflow: visible;
}

/* 合计行 */
.b-sum {
    border-top: 2px solid #8b6f9e;
    margin-top: 4px;
    padding-top: 5px;
}

.b-sum .b-name {
    font-weight: bold;
    color: #6b5a8e;
}

.b-sum .b-amt {
    font-size: 13px;
}

/* 资产 / 负债并排（桌面横向；手机端 media query 里改纵向） */
.b-duo {
    display: flex;
    gap: 8px;
}

.b-duo .b-card {
    flex: 1 1 0;
    min-width: 0;
    width: 100%;
}

/* 台账行可点击 + 删除钮 */
.b-ledger {
    cursor: pointer;
}

.b-ledger:active {
    background: rgba(139, 111, 158, 0.12);
}

/* ✎/✕ 视觉 18px，热区扩到 34px 保证可点性 */
.b-del {
    position: relative;
    flex-shrink: 0;
    width: 18px;
    height: 18px;
    line-height: 16px;
    text-align: center;
    border-radius: 9px;
    background: transparent;
    color: #a04545;
    font-size: 11px;
    margin-left: 3px;
    padding: 0;
}

/* 科目改名按钮（✎） */
.b-edit {
    position: relative;
    flex-shrink: 0;
    width: 18px;
    height: 18px;
    line-height: 16px;
    text-align: center;
    border-radius: 9px;
    background: transparent;
    color: #6b7fa8;
    font-size: 11px;
    margin-left: 3px;
    padding: 0;
}

.b-del::after,
.b-edit::after {
    content: '';
    position: absolute;
    inset: -8px;
}

.b-add {
    display: block;
    width: 100%;
    margin-top: 4px;
    padding: 4px 0;
    border: 1px dashed #a89367;
    border-radius: 4px;
    background: transparent;
    color: #8b6f9e;
    font-size: 13px;
    line-height: 1;
}

.b-add:active {
    background: rgba(139, 111, 158, 0.12);
}

/* ---------- 右栏 ---------- */
.b-bar-note {
    font-size: 11px;
    color: #6b5741;
    margin-top: 4px;
    text-align: right;
}

.b-expense-box {
    background: #f2e6c9;
    border: 1px solid #c9b586;
    border-radius: 4px;
    padding: 8px 8px 10px;
    box-shadow: 1px 1px 3px rgba(0, 0, 0, 0.25);
}

.b-expense-label {
    font-size: 13px;
    font-weight: bold;
    color: #3d3425;
    margin-bottom: 6px;
    white-space: nowrap;
}

.b-bar {
    height: 16px;
    background: #fff;
    border: 1px solid #8b6f9e;
    border-radius: 2px;
    overflow: hidden;
}

.b-bar-fill {
    height: 100%;
    background: #8b6f9e;
    width: 0;
    transition: width 0.3s ease;
}

.b-passive {
    background: #f2e6c9;
    border: 1px solid #c9b586;
    border-radius: 4px;
    padding: 8px;
    display: flex;
    align-items: center;
    gap: 8px;
    box-shadow: 1px 1px 3px rgba(0, 0, 0, 0.25);
}

.b-passive-arrow {
    color: #8b6f9e;
    font-size: 18px;
    line-height: 1;
}

.b-passive-text {
    font-size: 12px;
    color: #3d3425;
    line-height: 16px;
}

.b-passive-text b {
    font-size: 15px;
}

/* 现金面板 */
.b-cashbox {
    background: #f2e6c9;
    border: 1px solid #c9b586;
    border-radius: 4px;
    padding: 10px 8px;
    box-shadow: 1px 1px 3px rgba(0, 0, 0, 0.25);
}

.b-cash-row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    padding: 3px 0;
    font-size: 13px;
    color: #3d3425;
}

.b-cash-row b {
    font-size: 14px;
    color: #2f2818;
    font-variant-numeric: tabular-nums;
}

.cash-big b {
    font-size: 20px;
}

/* ---------- 台账编辑弹窗（总额 + 月现金流 双输入） ---------- */
.modal-mask {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    z-index: 30;
}

.modal {
    position: fixed;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    width: min(320px, calc(100vw - 40px));
    background: #fdf6e3;
    border: 3px solid #6b5741;
    border-radius: 10px;
    padding: 16px 16px 14px;
    z-index: 31;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
}

.modal-title {
    text-align: center;
    font-size: 15px;
    font-weight: bold;
    color: #4a3a20;
    margin-bottom: 10px;
}

.modal-field {
    display: flex;
    align-items: center;
    height: 44px;
    border-bottom: 1px dashed #c9b98e;
}

.modal-label {
    width: 74px;
    flex-shrink: 0;
    font-size: 13px;
    color: #6b5741;
}

.modal-input {
    flex: 1;
    height: 100%;
    border: none;
    outline: none;
    background: transparent;
    font-size: 15px;
    font-family: inherit;
    color: #2f2818;
    min-width: 0;
}

/* 指向科目下拉框 */
select.modal-input {
    height: 32px;
    border: 1px solid #c9b98e;
    border-radius: 5px;
    background: #fdf6e3;
    font-size: 13px;
    padding: 0 4px;
}

.modal-hint {
    font-size: 11px;
    color: #8e7a5a;
    line-height: 15px;
    margin-top: 8px;
}

.modal-btns {
    display: flex;
    gap: 10px;
    margin-top: 12px;
}

.modal-cancel {
    flex: 1;
    height: 40px;
    border-radius: 20px;
    background: #e5d9bb;
    color: #6b5741;
    font-size: 14px;
}

.modal-ok {
    flex: 1;
    height: 40px;
    border-radius: 20px;
    background: #8e6ea8;
    color: #fff;
    font-size: 14px;
    font-weight: bold;
}

.modal-ok:active { opacity: 0.85; }

/* ---------- 比率迷你条（纯展示，宽度由 JS 读取已算好的百分比文本设置） ---------- */
.b-mini-bar {
    height: 5px;
    background: rgba(107, 87, 65, 0.15);
    border-radius: 3px;
    margin: 1px 0 5px;
    overflow: hidden;
}

.b-mini-bar i {
    display: block;
    height: 100%;
    width: 0;
    background: #8b6f9e;
    border-radius: 3px;
    transition: width 0.3s ease;
}

/* ---------- 图例卡（纯静态） ---------- */
.b-legend {
    background: #f2e6c9;
    border: 1px solid #c9b586;
    border-radius: 4px;
    padding: 9px 8px 10px;
    box-shadow: 1px 1px 3px rgba(0, 0, 0, 0.25);
}

.b-legend-title {
    font-size: 12px;
    font-weight: bold;
    color: #6b5a8e;
    letter-spacing: 4px;
    margin-bottom: 6px;
}

.b-legend-row {
    display: flex;
    align-items: center;
    font-size: 11px;
    color: #4a3a20;
    padding: 2px 0;
}

.lg-dot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    margin-right: 6px;
    flex-shrink: 0;
}

.b-legend-tip {
    font-size: 10px;
    color: #8a7550;
    margin-top: 5px;
    border-top: 1px dashed #c9b98e;
    padding-top: 5px;
}

/* ---------- 箭头 draw-in 动画 ---------- */
#arrowLayer path.arw {
    stroke-dasharray: 1;
    stroke-dashoffset: 1;
    animation: arwDraw 0.45s ease-out forwards;
}

#arrowLayer circle.arw-dot {
    opacity: 0;
    animation: arwFade 0.25s ease-out 0.2s forwards;
}

@keyframes arwDraw {
    to { stroke-dashoffset: 0; }
}

@keyframes arwFade {
    to { opacity: 1; }
}

/* ---------- 统计页：预算 + 支出明细（微信账单） ---------- */

.stats-toolbar {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px 2px 12px;
}

.st-month-btn {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: #fff;
    color: #6b5741;
    font-size: 18px;
    line-height: 1;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
}

.st-month-btn:active {
    background: #f2e6c9;
}

.st-month {
    flex: 1;
    text-align: center;
    font-size: 16px;
    font-weight: bold;
    color: #3d3425;
    font-variant-numeric: tabular-nums;
}

.st-import-btn {
    padding: 8px 14px;
    border-radius: 8px;
    background: #8b6f9e;
    color: #fff;
    font-size: 13px;
    font-weight: 500;
}

.st-import-btn:active {
    background: #6f5582;
}

.st-card {
    background: #f2e6c9;
    border: 1px solid #c9b586;
    border-radius: 8px;
    margin-bottom: 12px;
    padding: 10px 12px 12px;
    box-shadow: 1px 1px 3px rgba(0, 0, 0, 0.18);
}

.st-card-title {
    font-size: 14px;
    font-weight: bold;
    color: #6b5a8e;
    letter-spacing: 2px;
    padding-bottom: 8px;
    margin-bottom: 6px;
    border-bottom: 2px solid #8b6f9e;
    display: flex;
    align-items: baseline;
    justify-content: space-between;
}

.st-card-hint {
    font-size: 11px;
    font-weight: normal;
    color: #a89367;
    letter-spacing: 0;
}

/* 预算行 */
.st-brow {
    display: flex;
    align-items: center;
    padding: 7px 0;
    border-bottom: 1px dashed #d9c89e;
    cursor: pointer;
}

.st-brow:active {
    background: rgba(139, 111, 158, 0.10);
}

.st-brow.over {
    background: rgba(224, 75, 74, 0.06);
}

.st-bicon {
    flex-shrink: 0;
    font-size: 16px;
    margin-right: 8px;
}

.st-bname {
    flex-shrink: 0;
    font-size: 13px;
    color: #3d3425;
    min-width: 60px;
}

.st-bvals {
    flex: 1;
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    font-size: 12px;
    color: #6b5741;
    font-variant-numeric: tabular-nums;
}

.st-bv b {
    font-weight: bold;
    color: #2f2818;
}

.st-over {
    color: #e04b4a !important;
}

.st-over-note {
    color: #e04b4a;
    font-size: 11px;
}

.st-budget-total {
    margin-top: 8px;
    padding-top: 8px;
    border-top: 2px solid #8b6f9e;
    font-size: 13px;
    color: #3d3425;
    text-align: right;
    font-variant-numeric: tabular-nums;
}

.st-budget-total b {
    color: #6b5a8e;
}

/* 支出明细行 */
.st-erow {
    border-bottom: 1px dashed #d9c89e;
}

.st-ehead {
    display: flex;
    align-items: center;
    padding: 8px 0;
    cursor: pointer;
}

.st-ename {
    flex-shrink: 0;
    font-size: 13px;
    color: #3d3425;
    min-width: 60px;
}

.st-ecnt {
    flex: 1;
    font-size: 11px;
    color: #a89367;
    margin-left: 6px;
}

.st-etotal {
    font-size: 13px;
    font-weight: bold;
    color: #e04b4a;
    margin-right: 8px;
    font-variant-numeric: tabular-nums;
}

.st-expand {
    width: 26px;
    height: 26px;
    border-radius: 6px;
    color: #6b5741;
    font-size: 14px;
}

.st-edetail {
    padding: 2px 0 8px 24px;
}

.st-eitem {
    display: flex;
    align-items: center;
    padding: 4px 0;
    font-size: 12px;
    gap: 6px;
}

.st-eitem-date {
    flex-shrink: 0;
    color: #a89367;
    font-size: 11px;
    font-variant-numeric: tabular-nums;
}

.st-eitem-merchant {
    flex: 1;
    color: #3d3425;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    min-width: 0;
}

.st-eitem-amt {
    flex-shrink: 0;
    color: #2f2818;
    font-weight: bold;
    font-variant-numeric: tabular-nums;
}

.st-eitem-cat {
    flex-shrink: 0;
    max-width: 96px;
    font-size: 11px;
    padding: 2px 4px;
    border: 1px solid #c9b586;
    border-radius: 4px;
    background: #fff;
    color: #6b5741;
}

/* ================= 财务自由：进度卡 + 项目评估 ================= */

/* hidden 必须真正隐藏（作者样式的 display 会盖掉浏览器默认的 [hidden]） */
[hidden] { display: none !important; }

.fg-card {
    background: #f2e6c9;
    border: 1px solid #c9b586;
    border-radius: 8px;
    padding: 12px 14px 14px;
    margin-bottom: 12px;
    box-shadow: 1px 1px 3px rgba(0, 0, 0, 0.18);
}

.fg-top {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    color: #6b5a8e;
    letter-spacing: 1px;
}

.fg-mid {
    display: flex;
    align-items: baseline;
    gap: 8px;
    margin-top: 2px;
}

.fg-mid b {
    font-size: 28px;
    font-weight: bold;
    color: #2e6fa8;
    font-variant-numeric: tabular-nums;
    line-height: 1.1;
}

.fg-mid span {
    font-size: 11px;
    color: #8e7a5a;
}

.fg-bar {
    height: 7px;
    background: #e5d6b3;
    border-radius: 4px;
    overflow: hidden;
    margin-top: 8px;
}

.fg-bar i {
    display: block;
    height: 100%;
    background: #2e6fa8;
    border-radius: 4px;
    transition: width 0.35s ease;
}

.fg-card.done .fg-mid b { color: #2f6b3a; }
.fg-card.done .fg-bar i { background: #2f6b3a; }

.fg-foot {
    display: flex;
    justify-content: space-between;
    margin-top: 8px;
    font-size: 11px;
    color: #6b5741;
}

.fg-foot span:last-child { color: #2e6fa8; }

/* 项目列表 */
.pj-title {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 4px 2px 8px;
    font-size: 13px;
    color: #6b5741;
}

.pj-new {
    font-size: 12px;
    color: #6b5a8e;
    border: 1px solid #8b6f9e;
    border-radius: 14px;
    padding: 4px 10px;
    background: rgba(139, 111, 158, 0.08);
}

.pj-card {
    background: #f2e6c9;
    border: 1px solid #c9b586;
    border-radius: 8px;
    padding: 10px 12px;
    margin-bottom: 10px;
    box-shadow: 1px 1px 3px rgba(0, 0, 0, 0.18);
    cursor: pointer;
}

.pj-card:active { background: #ece0c2; }

.pj-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.pj-name {
    font-size: 14px;
    font-weight: bold;
    color: #2f2818;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.pj-badge {
    flex-shrink: 0;
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 10px;
    border: 1px solid transparent;
}

.pj-badge.good { background: #dff0e3; color: #2f6b3a; border-color: #a9cfb4; }
.pj-badge.warn { background: #fdf0d5; color: #8a6212; border-color: #e3c88a; }
.pj-badge.bad { background: #fae3e3; color: #a04545; border-color: #e0b4b4; }

.pj-sub {
    font-size: 11px;
    color: #8e7a5a;
    margin-top: 3px;
}

.pj-sub em {
    font-style: normal;
    color: #2f6b3a;
}

.pj-metrics {
    display: flex;
    gap: 12px;
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px dashed #d9c89e;
}

.pj-metrics > div {
    flex: 1;
    min-width: 0;
}

.pj-metrics span {
    display: block;
    font-size: 11px;
    color: #8e7a5a;
}

.pj-metrics b {
    display: block;
    font-size: 14px;
    color: #2f2818;
    font-variant-numeric: tabular-nums;
    margin-top: 1px;
}

.pj-metrics b.in { color: #2e6fa8; }
.pj-metrics b.out { color: #a04545; }

.pj-note {
    font-size: 11px;
    margin-top: 8px;
    padding: 4px 7px;
    border-radius: 5px;
    line-height: 15px;
}

.pj-note.good { background: #dff0e3; color: #2f6b3a; }
.pj-note.warn { background: #fdf0d5; color: #8a6212; }
.pj-note.bad { background: #fae3e3; color: #a04545; }

/* 项目评估弹层 */
.modal-lg {
    display: flex;
    flex-direction: column;
    width: min(362px, calc(100vw - 24px));
    max-height: 88vh;
    padding: 14px 16px 12px;
}

.modal-lg .pj-form {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    margin: 0 -4px;
    padding: 0 4px;
}

.pj-sec {
    font-size: 11px;
    color: #8b6f9e;
    letter-spacing: 1px;
    margin: 10px 0 2px;
}

.pj-form .modal-field { height: 40px; }
.pj-form .modal-label { width: 78px; font-size: 12px; }
.pj-form .modal-input { font-size: 14px; }

.pj-result {
    margin-top: 12px;
    background: #f2e6c9;
    border: 1px solid #c9b586;
    border-radius: 8px;
    padding: 10px;
}

.pjr-head {
    display: flex;
    align-items: center;
    gap: 8px;
}

.pjr-tip {
    font-size: 11px;
    color: #6b5741;
    line-height: 15px;
}

.pjr-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px 10px;
    margin-top: 10px;
}

.pjr-item span {
    display: block;
    font-size: 11px;
    color: #8e7a5a;
}

.pjr-item b {
    display: block;
    font-size: 14px;
    color: #2f2818;
    font-variant-numeric: tabular-nums;
}

.pjr-item b.in { color: #2e6fa8; }
.pjr-item b.out { color: #a04545; }

.pjr-notes {
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px dashed #d9c89e;
    font-size: 11px;
    color: #6b5741;
    line-height: 17px;
}

.pj-livebtns {
    display: flex;
    gap: 8px;
    margin-top: 10px;
}

.pj-apply,
.pj-revoke,
.pj-del {
    height: 38px;
    border-radius: 19px;
    font-size: 13px;
    min-width: 0;
}

.pj-apply {
    flex: 1.5;
    background: #8b6f9e;
    color: #fff;
    font-weight: bold;
}

.pj-revoke {
    flex: 1.5;
    background: #e5d9bb;
    color: #6b5741;
    font-weight: bold;
}

.pj-del {
    flex: 1;
    background: #fae3e3;
    color: #a04545;
    border: 1px solid #e0b4b4;
}

/* 数字输入去掉上下箭头（触屏无用且碍眼） */
.pj-form input[type="number"]::-webkit-outer-spin-button,
.pj-form input[type="number"]::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}
