/* =============================================================
   智影科技服装拍摄管理系统 —— 响应式样式
   手机端  < 768px ：底部 Tab 导航，单列卡片
   电脑端 >= 768px ：左侧固定侧边栏 + 顶栏 + 多列网格
   ============================================================= */
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

body {
    margin: 0;
    padding: 0;
    background: #eef0f4;
    font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Helvetica Neue", sans-serif;
    color: #1f2329;
    font-size: 14px;
}

#app { max-width: 640px; margin: 0 auto; background: #f2f3f5; min-height: 100vh; box-shadow: 0 0 24px rgba(0,0,0,.06); }
.app-root { min-height: 100vh; }
.app-root.has-tab { padding-bottom: 50px; }

.page { min-height: 100vh; background: #f2f3f5; padding-bottom: 16px; }
.nav-text { color: #ee0a24; font-size: 14px; }

/* ---------- 登录 ---------- */
.login-page { min-height: 100vh; background: linear-gradient(160deg, #2b6cb0 0%, #1a4a80 100%); padding-top: 12vh; }
.login-header { text-align: center; color: #fff; margin-bottom: 28px; }
.login-header .logo {
    width: 64px; height: 64px; margin: 0 auto 14px; border-radius: 16px;
    background: rgba(255,255,255,.18); border: 1px solid rgba(255,255,255,.35);
    display: flex; align-items: center; justify-content: center; font-size: 22px; font-weight: 600; letter-spacing: 2px;
}
.login-header h2 { margin: 0; font-size: 22px; font-weight: 600; }
.login-header p { margin: 6px 0 0; font-size: 13px; opacity: .8; letter-spacing: 3px; }
.login-tip { text-align: center; color: rgba(255,255,255,.75); font-size: 12px; margin: 12px 0 0; }
.login-link { text-align: center; color: #fff; font-size: 13px; opacity: .9; }
.login-link > span { cursor: pointer; }

/* ---------- 首页 ---------- */
.home-head { background: linear-gradient(135deg, #2b6cb0, #1a4a80); padding: 22px 16px 34px; color: #fff; }
.home-user { display: flex; align-items: center; gap: 12px; }
.home-avatar {
    width: 46px; height: 46px; border-radius: 50%; background: rgba(255,255,255,.22);
    display: flex; align-items: center; justify-content: center; font-size: 18px; font-weight: 600;
}
.home-avatar.big { width: 62px; height: 62px; font-size: 24px; margin: 0 auto 10px; }
.home-name { font-size: 17px; font-weight: 600; }
.home-role { font-size: 11px; background: rgba(255,255,255,.2); padding: 2px 7px; border-radius: 9px; margin-left: 6px; font-weight: 400; }
.home-sub { font-size: 12px; opacity: .8; margin-top: 4px; }

.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin: -22px 12px 12px; }
.stat-card { background: #fff; border-radius: 10px; padding: 12px 4px; text-align: center; box-shadow: 0 2px 8px rgba(0,0,0,.05); }
.stat-num { font-size: 17px; font-weight: 700; }
.stat-label { font-size: 11px; color: #8a9099; margin-top: 3px; }

/* 累计收入：主数值 + 已结算/待结算拆分 */
.income-card { background: linear-gradient(135deg, #2b6cb0, #1a4a80); color: #fff; }
.income-card .stat-num { color: #fff; }
.income-card .stat-label { color: rgba(255,255,255,.8); }
.income-split { display: flex; justify-content: center; gap: 10px; margin-top: 7px; font-size: 10px; }
.income-split span { background: rgba(255,255,255,.18); padding: 2px 7px; border-radius: 8px; white-space: nowrap; }

.section-card { background: #fff; border-radius: 10px; margin: 10px 12px; padding: 12px 14px; box-shadow: 0 1px 4px rgba(0,0,0,.04); }
.section-title { font-size: 15px; font-weight: 600; margin-bottom: 10px; display: flex; justify-content: space-between; align-items: center; }
.section-more { font-size: 12px; color: #8a9099; font-weight: 400; }
.section-more:hover { color: #2b6cb0; }

.progress-row { display: flex; align-items: center; gap: 8px; margin-bottom: 9px; }
.progress-name { width: 84px; font-size: 12px; color: #4a5058; }
.progress-bar { flex: 1; height: 8px; background: #f0f1f3; border-radius: 4px; overflow: hidden; }
.progress-inner { height: 100%; border-radius: 4px; transition: width .3s; }
.progress-num { width: 24px; text-align: right; font-size: 12px; color: #8a9099; }

.list-row { display: flex; align-items: center; padding: 9px 0; border-top: 1px solid #f4f5f7; }
.list-main { flex: 1; min-width: 0; }
.list-title { font-size: 14px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.list-sub { font-size: 11px; color: #8a9099; margin-top: 3px; }
.list-right { text-align: right; margin-left: 8px; }
.list-amount { font-size: 13px; color: #ee0a24; font-weight: 600; }
.list-amount.is-settle { color: #f0a020; }
.list-amount.amount-empty { color: #c0c4cc; font-weight: 400; }

.log-row { display: flex; gap: 8px; padding: 8px 0; border-top: 1px solid #f4f5f7; }
.log-dot { width: 8px; height: 8px; border-radius: 50%; margin-top: 5px; flex-shrink: 0; }
.log-title { font-size: 13px; }
.log-sub { font-size: 11px; color: #8a9099; margin-top: 2px; }
.log-time { margin-left: 6px; }

/* ---------- 通用卡片 ---------- */
.card-item { display: flex; align-items: center; background: #fff; margin: 0 12px 8px; border-radius: 10px; padding: 10px 12px; gap: 10px; }
.card-img { width: 58px; height: 70px; border-radius: 6px; overflow: hidden; background: #f2f3f5; flex-shrink: 0; }
.card-img img { width: 100%; height: 100%; object-fit: cover; }
.no-img { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; color: #b0b5bb; font-size: 12px; background: #f2f3f5; }
.card-body { flex: 1; min-width: 0; }
.card-title { font-size: 14px; font-weight: 600; display: flex; align-items: center; gap: 6px; }
.card-line { font-size: 11px; color: #8a9099; margin-top: 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card-arrow { color: #c8ccd0; }

.status-tag { display: inline-block; color: #fff; font-size: 10px; padding: 2px 7px; border-radius: 8px; line-height: 1.5; }
.status-tag.sm { font-size: 10px; padding: 1px 6px; }

/* ---------- 筛选 ---------- */
.filter-row { display: flex; gap: 6px; padding: 8px 12px; overflow-x: auto; background: #fff; border-bottom: 1px solid #f0f1f3; }
.filter-item { flex-shrink: 0; padding: 4px 12px; border-radius: 14px; background: #f2f3f5; color: #6a7078; font-size: 12px; cursor: pointer; }
.filter-item.active { background: #2b6cb0; color: #fff; }

/* ---------- 计划卡片 ---------- */
.plan-card { background: #fff; margin: 10px 12px; border-radius: 10px; padding: 12px 14px; box-shadow: 0 1px 4px rgba(0,0,0,.04); }
.plan-top { display: flex; justify-content: space-between; align-items: center; }
.plan-no { font-size: 12px; color: #8a9099; font-family: monospace; }
.plan-title { font-size: 15px; font-weight: 600; margin: 7px 0; }
.plan-info { display: flex; gap: 12px; font-size: 12px; color: #6a7078; }
.plan-bottom { display: flex; justify-content: space-between; align-items: center; margin-top: 9px; padding-top: 9px; border-top: 1px dashed #eceef0; }
/* 计划列表的服装金额合计（管理员视角），与模特端结算金额区分开 */
.plan-total { color: #2b6cb0; font-weight: 600; font-size: 13px; }
.plan-addr { font-size: 11px; color: #8a9099; }

/* ---------- 进度卡片 ---------- */
.progress-card { background: #fff; margin: 10px 12px; border-radius: 10px; padding: 12px 14px; }
.progress-top { display: flex; justify-content: space-between; align-items: center; }
.progress-title { font-size: 15px; font-weight: 600; margin: 7px 0; }
.progress-model { font-size: 13px; color: #4a5058; }
.progress-meta { display: flex; justify-content: space-between; font-size: 12px; color: #8a9099; margin-top: 6px; }
.progress-ops { display: flex; gap: 8px; margin-top: 10px; padding-top: 10px; border-top: 1px solid #f4f5f7; }

.status-pick { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0; }
.status-btn { padding: 7px 12px; border: 1px solid #dcdee0; border-radius: 16px; font-size: 12px; color: #4a5058; cursor: pointer; }
.status-btn.on { color: #fff; }

/* ---------- 模特卡片 ---------- */
.model-card { display: flex; align-items: center; background: #fff; margin: 0 12px 8px; border-radius: 10px; padding: 10px 12px; gap: 10px; }
.model-avatar { width: 48px; height: 48px; border-radius: 50%; overflow: hidden; flex-shrink: 0; }
.model-avatar img { width: 100%; height: 100%; object-fit: cover; }
.model-avatar .no-img { border-radius: 50%; font-size: 17px; color: #fff; background: #2b6cb0; }
.model-info { flex: 1; min-width: 0; }
.model-name { font-size: 14px; font-weight: 600; display: flex; align-items: center; gap: 6px; }
.model-type { font-size: 10px; background: #eef4fb; color: #2b6cb0; padding: 1px 6px; border-radius: 8px; font-weight: 400; }
.model-sub { font-size: 11px; color: #8a9099; margin-top: 3px; }
.model-status { display: flex; align-items: center; gap: 6px; color: #c8ccd0; }
.model-row { display: flex; justify-content: space-between; align-items: center; background: #fff; margin: 0 12px 6px; padding: 10px 12px; border-radius: 8px; }
.model-right { display: flex; align-items: center; gap: 10px; }
.del-icon { color: #c8ccd0; }

/* ---------- 表单块 ---------- */
.block-title { font-size: 14px; font-weight: 600; padding: 14px 16px 8px; display: flex; justify-content: space-between; align-items: center; }
.add-btn { font-size: 13px; color: #2b6cb0; font-weight: 400; }

.item-card { background: #fff; margin: 0 12px 8px; border-radius: 10px; padding: 10px 4px; }
.item-head { display: flex; justify-content: space-between; align-items: center; padding: 0 12px; }
.item-name { font-size: 14px; font-weight: 600; }
.item-sub { font-size: 11px; color: #8a9099; padding: 2px 12px 6px; }

.total-bar { display: flex; justify-content: space-between; align-items: center; background: #fff; margin: 10px 12px; padding: 14px; border-radius: 10px; font-size: 14px; }
.total-num { font-size: 20px; color: #ee0a24; font-weight: 700; }

.upload-block { background: #fff; margin: 10px 12px; padding: 12px 14px; border-radius: 10px; }
.field-label { font-size: 13px; color: #4a5058; margin-bottom: 10px; }

/* ---------- 弹层 ---------- */
.popup-box { padding: 18px 16px 24px; }
.popup-title { font-size: 16px; font-weight: 600; text-align: center; margin-bottom: 6px; }
.popup-sub { font-size: 12px; color: #8a9099; text-align: center; margin-bottom: 10px; }
.popup-ops { display: flex; gap: 10px; margin-top: 16px; }
.popup-page { padding: 12px; height: 100%; display: flex; flex-direction: column; }
.option-list { flex: 1; overflow-y: auto; margin: 10px 0; }
.option-row { padding: 11px 12px; border-bottom: 1px solid #f4f5f7; }
.option-name { font-size: 14px; font-weight: 500; }
.option-sub { font-size: 11px; color: #8a9099; margin-top: 3px; }

/* ---------- 时间线 ---------- */
.timeline { flex: 1; overflow-y: auto; margin: 12px 0; }
.tl-item { display: flex; gap: 10px; padding: 8px 0; }
.tl-dot { width: 9px; height: 9px; border-radius: 50%; margin-top: 5px; flex-shrink: 0; }
.tl-title { font-size: 13px; font-weight: 500; }
.tl-sub { font-size: 12px; color: #6a7078; margin-top: 2px; }
.tl-time { font-size: 11px; color: #a0a5ab; margin-top: 2px; }

/* ---------- 我的 ---------- */
.mine-head { background: linear-gradient(135deg, #2b6cb0, #1a4a80); padding: 26px 16px 32px; text-align: center; color: #fff; }
.mine-name { font-size: 17px; font-weight: 600; }
.mine-sub { font-size: 12px; opacity: .85; margin-top: 4px; }
.mine-foot { text-align: center; color: #a0a5ab; font-size: 12px; margin-top: 30px; }

/* ---------- 结算金额 ---------- */
.settle-tip { font-size: 11.5px; color: #8a9099; padding: 6px 16px 0; line-height: 1.5; }
.fill-btn { font-size: 12px; color: #1989fa; padding: 0 4px; white-space: nowrap; cursor: pointer; }
.fill-btn:active { opacity: .6; }
/* 金额为 0 / 未设置时弱化显示，避免误读为「金额就是零」 */
.amount-empty { color: #c0c4cc !important; font-style: normal; }

/* 模特行内金额（管理员在计划编辑页可点击设置） */
.model-amount { font-size: 11.5px; color: #f0a020; margin-top: 4px; display: inline-flex; align-items: center; gap: 3px; cursor: pointer; }
.model-amount.amount-empty { color: #c0c4cc; }
.model-amount:active { opacity: .6; }

/* ---------- 登录页连接自检 ---------- */
.login-link .diag-link { color: #8a9099; }
.diag-box { padding: 18px 18px 14px; }
.diag-title { font-size: 16px; font-weight: 600; text-align: center; margin-bottom: 14px; }
.diag-row { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px;
            font-size: 13px; padding: 7px 0; border-bottom: 1px solid #f2f3f5; word-break: break-all; }
.diag-row span { color: #8a9099; white-space: nowrap; }
.diag-row b { font-weight: 500; text-align: right; font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 12px; }
.diag-row b.ok { color: #07c160; font-family: inherit; }
.diag-row b.bad { color: #ee0a24; font-family: inherit; }
.diag-err { background: #fff1f0; border: 1px solid #ffccc7; border-radius: 6px; padding: 9px 11px;
            font-size: 12px; color: #cf1322; margin-top: 12px; white-space: pre-wrap; line-height: 1.55; }
.diag-tip { background: #f6ffed; border: 1px solid #b7eb8f; border-radius: 6px; padding: 9px 11px;
            font-size: 12px; color: #389e0d; margin-top: 12px; line-height: 1.55; }
.diag-tip code { background: rgba(0,0,0,.06); padding: 1px 4px; border-radius: 3px; font-size: 11px; }
.diag-btns { display: flex; gap: 10px; margin-top: 16px; }
.diag-btns .van-button { flex: 1; }

/* 列表网格容器（桌面端自动多列，移动端由各卡片自身 margin 控制） */
.card-grid { display: block; }


/* =============================================================
   电脑端（>= 768px）
   ============================================================= */
@media (min-width: 768px) {

    #app { max-width: none; box-shadow: none; }

    .app-root.is-desktop { display: flex; min-height: 100vh; background: #f2f3f5; }

    /* ---------- 左侧固定侧边栏 ---------- */
    .app-side {
        width: 220px; flex-shrink: 0; background: #fff;
        border-right: 1px solid #e8eaed;
        display: flex; flex-direction: column;
        position: fixed; top: 0; bottom: 0; left: 0; z-index: 100;
    }
    .side-logo { display: flex; align-items: center; gap: 10px; padding: 18px 16px; border-bottom: 1px solid #f0f1f3; }
    .side-mark {
        width: 34px; height: 34px; border-radius: 9px; flex-shrink: 0;
        background: linear-gradient(135deg, #2b6cb0, #1a4a80); color: #fff;
        display: flex; align-items: center; justify-content: center; font-size: 16px; font-weight: 600;
    }
    .side-brand { min-width: 0; }
    .side-title { font-size: 14px; font-weight: 600; color: #1f2329; }
    .side-subtitle { font-size: 11px; color: #8a9099; margin-top: 1px; }

    .side-nav { flex: 1; padding: 10px 8px; overflow-y: auto; }
    .side-item {
        display: flex; align-items: center; gap: 10px;
        padding: 9px 12px; border-radius: 8px; margin-bottom: 2px;
        font-size: 13.5px; color: #4a5058; cursor: pointer;
        border-left: 3px solid transparent; transition: background .15s;
    }
    .side-item:hover { background: #f5f7fa; }
    .side-item.on { background: #eaf2fc; color: #2b6cb0; font-weight: 600; border-left-color: #2b6cb0; }
    .side-item .van-icon { font-size: 16px; }

    .side-foot { padding: 12px; border-top: 1px solid #f0f1f3; }
    .side-user { display: flex; align-items: center; gap: 9px; margin-bottom: 10px; }
    .side-avatar {
        width: 32px; height: 32px; border-radius: 50%; flex-shrink: 0;
        background: #2b6cb0; color: #fff;
        display: flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 600;
    }
    .side-utext { min-width: 0; }
    .side-uname { font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
    .side-urole { font-size: 11px; color: #8a9099; margin-top: 1px; }
    .side-logout {
        display: flex; align-items: center; gap: 8px;
        padding: 7px 12px; border-radius: 7px; background: #f5f7fa;
        font-size: 12.5px; color: #6a7078; cursor: pointer;
    }
    .side-logout:hover { background: #fff1f0; color: #ee0a24; }

    /* ---------- 主区域 ---------- */
    .app-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
    .app-main.with-side { margin-left: 220px; }

    .app-top {
        height: 56px; flex-shrink: 0; background: #fff; border-bottom: 1px solid #e8eaed;
        display: flex; align-items: center; justify-content: space-between;
        padding: 0 24px; position: sticky; top: 0; z-index: 50;
    }
    .top-left { display: flex; align-items: baseline; gap: 12px; }
    .top-title { font-size: 17px; font-weight: 600; color: #1f2329; }
    .top-crumb { font-size: 12px; color: #8a9099; }
    .top-right { display: flex; align-items: center; gap: 14px; }
    .top-date { font-size: 12.5px; color: #6a7078; }

    .app-body { flex: 1; min-width: 0; padding: 4px 0 0; }

    /* 页面容器不再强制满屏，改由内容撑开；限制最大宽度避免大屏过度拉伸 */
    .page { min-height: auto; padding-bottom: 32px; max-width: 1180px; margin: 0 auto; width: 100%; }

    /* 表单/详情类页面：内容区再收窄一档，阅读更舒服 */
    .page > .van-cell-group,
    .page > .block-title,
    .page > .upload-block,
    .page > .total-bar { max-width: 820px; margin-left: auto; margin-right: auto; }
    .page > .van-nav-bar { max-width: 1180px; }

    /* ---------- 卡片网格化 ---------- */
    .section-card { margin: 12px 20px; padding: 16px 18px; border-radius: 12px; }
    .section-title { font-size: 15.5px; margin-bottom: 14px; }

    .stat-grid { grid-template-columns: repeat(4, 1fr); gap: 14px; margin: -22px 20px 16px; }
    .stat-card { padding: 18px 12px; border-radius: 12px; }
    .stat-num { font-size: 24px; }
    .stat-label { font-size: 12.5px; margin-top: 5px; }
    .income-split { gap: 14px; font-size: 11.5px; margin-top: 9px; }

    /* 首页：进度分布 + 最近计划 并排，动态整行 */
    .home-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 0; }
    .home-cols > .section-card { margin: 12px 0 12px 20px; }
    .home-cols > .section-card:last-child { margin-right: 20px; }
    .home-wide { margin: 0 20px 12px; }

    /* 列表卡片：自适应多列 */
    .card-grid {
        display: grid;
        grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
        gap: 12px; padding: 12px 20px;
    }
    .card-grid > .card-item,
    .card-grid > .plan-card,
    .card-grid > .progress-card,
    .card-grid > .model-card,
    .card-grid > .model-row,
    .card-grid > .item-card { margin: 0; }

    .plan-card, .progress-card { padding: 14px 16px; border-radius: 12px; }
    .card-item, .model-card, .model-row { padding: 12px 14px; border-radius: 12px; }

    .filter-row { padding: 10px 20px; gap: 8px; }
    .block-title { padding: 16px 20px 8px; font-size: 15px; }
    .total-bar { margin: 12px 20px; padding: 16px 20px; border-radius: 12px; }
    .upload-block { margin: 12px 20px; border-radius: 12px; }
    .item-card { margin: 0 0 10px; border-radius: 12px; }

    /* 顶部渐变头部在桌面留出更多呼吸感 */
    .home-head { padding: 28px 24px 44px; }
    .home-sub { font-size: 13px; }
    .mine-head { padding: 34px 24px 40px; }

    /* ---------- 弹层：桌面端由底部抽屉改为居中对话框 ---------- */
    .van-popup--bottom {
        left: 50% !important; top: 50% !important; bottom: auto !important;
        width: auto !important; min-width: 440px; max-width: 92vw;
        max-height: 86vh; overflow: auto;
        transform: translate(-50%, -50%) !important;
        border-radius: 14px !important;
    }
    .van-popup--bottom .popup-page { height: auto !important; max-height: 76vh; }
    .popup-box { padding: 22px 24px 26px; min-width: 420px; }
    .popup-page { min-width: 520px; padding: 20px 22px; }
    .van-popup--bottom .van-button { max-width: none; }

    /* ---------- 登录页：居中卡片 ---------- */
    .login-page {
        display: flex; align-items: center; justify-content: center;
        padding: 40px 20px; min-height: 100vh;
    }
    .login-box {
        width: 100%; max-width: 420px; background: #fff; border-radius: 16px;
        padding: 34px 30px 28px; box-shadow: 0 12px 40px rgba(0,0,0,.18);
    }
    .login-box .login-header { color: #1f2329; margin-bottom: 22px; }
    .login-box .login-header .logo {
        background: linear-gradient(135deg, #2b6cb0, #1a4a80); border: none; color: #fff;
    }
    .login-box .login-header p { color: #8a9099; opacity: 1; }
    .login-box .login-tip { color: #8a9099; opacity: 1; }
    .login-box .login-link { color: #2b6cb0; opacity: 1; }
    .login-box .login-link .diag-link { color: #8a9099; }
    .login-box .van-cell-group { background: transparent; }
}

/* 超宽屏：内容居中，避免拉伸过宽 */
@media (min-width: 1440px) {
    .app-body { max-width: 1400px; }
    .stat-grid { max-width: 1360px; }
}
