:root {
  font-family: Inter, "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  color: #183047;
  background: #f3f6f9;
  --primary: #0f5f8f;
  --primary-dark: #0b4568;
  --border: #dbe4ec;
  --muted: #64788a;
  --danger: #b83b35;
  --warn: #9a6500;
  --success: #287a4b;
}
* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; background: #f3f6f9; }
button, input, select, textarea { font: inherit; }
button { border: 1px solid #c7d4df; border-radius: 8px; padding: 9px 14px; background: white; cursor: pointer; }
button:hover { border-color: var(--primary); }
button.primary { background: var(--primary); border-color: var(--primary); color: white; }
button.primary:hover { background: var(--primary-dark); }
button.ghost { background: transparent; color: inherit; }
button.full { width: 100%; }
.hidden { display: none !important; }
.login-shell { min-height: 100vh; display: grid; place-items: center; padding: 24px; background: linear-gradient(135deg,#e5eef6,#f8fafc); }
.login-card { width: min(420px,100%); background: white; border: 1px solid var(--border); border-radius: 18px; box-shadow: 0 16px 50px rgba(20,54,84,.12); padding: 30px; }
.login-card h1 { margin: 12px 0 4px; }
.login-card p { margin: 0 0 24px; color: var(--muted); }
.brand-mark { width: 54px; height: 54px; display: grid; place-items: center; border-radius: 14px; background: var(--primary); color: white; font-size: 28px; font-weight: 700; }
label { display: grid; gap: 6px; font-size: 14px; color: #345; margin-bottom: 14px; }
input, select, textarea { width: 100%; min-height: 42px; border: 1px solid #cbd7e1; border-radius: 8px; padding: 9px 10px; background: white; color: #183047; }
input:focus, select:focus, textarea:focus { outline: 2px solid rgba(15,95,143,.18); border-color: var(--primary); }
.error-text { color: var(--danger); min-height: 20px; margin-top: 10px; }
.topbar { position: sticky; top: 0; z-index: 20; min-height: 64px; padding: 10px 22px; display: flex; align-items: center; justify-content: space-between; background: #123f5d; color: white; box-shadow: 0 3px 12px rgba(0,0,0,.12); }
.topbar strong { display: block; font-size: 18px; }
.topbar small { opacity: .8; }
.topbar-actions { display: flex; gap: 8px; }
.topbar .ghost { border-color: rgba(255,255,255,.32); color: white; }
.desktop-nav { position: sticky; top: 64px; z-index: 15; display: flex; gap: 6px; padding: 10px 22px; background: white; border-bottom: 1px solid var(--border); }
.desktop-nav button.active, .mobile-nav button.active { background: #e4f1f8; border-color: var(--primary); color: var(--primary-dark); font-weight: 600; }
.content { max-width: 1480px; margin: 0 auto; padding: 22px; }
.page-section { display: grid; gap: 16px; }
.section-head { display: flex; justify-content: space-between; align-items: end; gap: 16px; }
.section-head.small { align-items: center; }
h2,h3 { margin: 0; }
.section-head p { margin: 4px 0 0; color: var(--muted); }
.panel { background: white; border: 1px solid var(--border); border-radius: 12px; padding: 18px; box-shadow: 0 4px 16px rgba(30,60,85,.04); overflow-x: auto; }
.form-grid { display: grid; grid-template-columns: repeat(3,minmax(180px,1fr)); gap: 12px 16px; margin-top: 16px; }
.form-grid.compact { grid-template-columns: repeat(5,minmax(150px,1fr)); align-items: end; }
.span-2 { grid-column: span 2; }
.check-row { display: flex; flex-wrap: wrap; gap: 12px; margin: 6px 0 16px; }
.check-row label, .check-label { display: flex; align-items: center; gap: 7px; margin: 0; min-height: 42px; }
.check-row input, .check-label input { width: auto; min-height: auto; }
.inline-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.metric-grid { display: grid; grid-template-columns: repeat(6,minmax(130px,1fr)); gap: 12px; }
.metric-grid.small { grid-template-columns: repeat(5,minmax(140px,1fr)); margin-bottom: 14px; }
.metric { background: white; border: 1px solid var(--border); border-radius: 11px; padding: 14px; }
.metric .label { color: var(--muted); font-size: 13px; }
.metric .value { margin-top: 7px; font-size: 25px; font-weight: 700; color: #173c59; }
.metric .sub { margin-top: 5px; color: var(--muted); font-size: 12px; }
.metric.warn { border-color: #e4c375; background: #fffaf0; }
.metric.danger { border-color: #e4aaa5; background: #fff5f4; }
.metric.success { border-color: #9dcdb3; background: #f3fbf6; }
.product-card { display: grid; grid-template-columns: 1.2fr 2fr; gap: 16px; }
.product-main, .price-grid > div { background: white; border: 1px solid var(--border); border-radius: 12px; padding: 16px; }
.price-grid { display: grid; grid-template-columns: repeat(4,1fr); gap: 10px; }
.price-grid strong { display: block; margin-bottom: 8px; }
.price-grid .price { font-size: 18px; font-weight: 700; }
.price-grid small { display: block; color: var(--muted); margin-top: 5px; }
table { width: 100%; border-collapse: collapse; min-width: 760px; }
th, td { border-bottom: 1px solid #e4ebf1; padding: 10px 9px; text-align: left; white-space: nowrap; }
th { background: #f5f8fa; color: #41596c; position: sticky; top: 0; }
td input[type=number] { width: 95px; min-height: 34px; padding: 5px 7px; }
.status { display: inline-flex; align-items: center; padding: 3px 8px; border-radius: 999px; background: #edf2f5; font-size: 12px; }
.status.待审核 { background: #fff3d6; color: #7e5400; }
.status.需补充,.status.已驳回 { background: #ffe8e5; color: #9d322d; }
.status.已完成 { background: #e4f5eb; color: #246e45; }
.status.待ERP验证 { background: #e5effb; color: #285b8d; }
.task-list, .review-list { display: grid; gap: 12px; }
.task-card, .review-card { background: white; border: 1px solid var(--border); border-radius: 12px; padding: 15px; }
.task-card h3, .review-card h3 { font-size: 17px; }
.task-meta { display: grid; grid-template-columns: repeat(3,1fr); gap: 7px; margin: 10px 0; color: #4d6273; font-size: 13px; }
.task-actions { display: flex; gap: 8px; justify-content: flex-end; }
.review-images { display: grid; grid-template-columns: repeat(auto-fill,minmax(150px,1fr)); gap: 10px; margin: 12px 0; }
.review-images a { border: 1px solid var(--border); border-radius: 8px; padding: 10px; text-decoration: none; color: var(--primary); background: #f8fbfd; }
.task-dialog { width: min(760px,94vw); max-height: 92vh; border: 0; border-radius: 14px; padding: 18px; box-shadow: 0 20px 80px rgba(0,0,0,.25); }
.task-dialog::backdrop, dialog::backdrop { background: rgba(10,25,40,.55); }
.dialog-form { min-width: min(420px,80vw); }
.photo-upload-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.photo-box { border: 1px dashed #9fb5c6; border-radius: 10px; padding: 14px; background: #f7fafc; }
.photo-box input { padding: 6px; }
.evidence-list { display: flex; flex-wrap: wrap; gap: 7px; margin: 10px 0; }
.evidence-chip { border: 1px solid var(--border); border-radius: 999px; padding: 5px 9px; background: white; font-size: 12px; }
.toast { position: fixed; right: 18px; top: 78px; z-index: 100; max-width: 420px; padding: 12px 16px; border-radius: 9px; color: white; background: #263e50; box-shadow: 0 8px 30px rgba(0,0,0,.2); }
.mobile-nav { display: none; }
.notice { padding: 11px 13px; border-radius: 9px; background: #eef6fb; border: 1px solid #c9dfed; }
.warning { padding: 11px 13px; border-radius: 9px; background: #fff7e8; border: 1px solid #eed39a; color: #77500a; }
.danger-text { color: var(--danger); }
.muted { color: var(--muted); }

@media (max-width: 900px) {
  .desktop-nav { display: none; }
  .topbar { min-height: 58px; padding: 9px 13px; }
  .topbar-actions #changePasswordButton { display: none; }
  .content { padding: 13px 12px 84px; }
  .section-head { align-items: flex-start; flex-direction: column; }
  .form-grid, .form-grid.compact { grid-template-columns: 1fr; }
  .span-2 { grid-column: auto; }
  .metric-grid, .metric-grid.small, .metric-grid.mobile { grid-template-columns: repeat(2,1fr); }
  .product-card { grid-template-columns: 1fr; }
  .price-grid { grid-template-columns: 1fr 1fr; }
  .task-meta { grid-template-columns: 1fr 1fr; }
  .mobile-nav { position: fixed; bottom: 0; left: 0; right: 0; z-index: 40; display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; background: white; border-top: 1px solid var(--border); padding-bottom: env(safe-area-inset-bottom); box-shadow: 0 -4px 16px rgba(20,50,70,.1); }
  .mobile-nav button { border: 0; border-radius: 0; padding: 12px 6px; font-size: 13px; }
  .photo-upload-grid { grid-template-columns: 1fr; }
  table { font-size: 13px; }
}
button.danger { color: var(--danger); border-color: #dfb5b1; background: #fff8f7; }
.metric > span { display:block; color:var(--muted); font-size:13px; }
.metric > strong { display:block; margin-top:7px; font-size:25px; color:#173c59; }
.metric > small { display:block; margin-top:5px; color:var(--muted); }
.announcement-box { margin-top:16px; padding:16px; border:1px solid #bfd5e4; border-radius:12px; background:#f7fbfe; }
.announcement-box h4 { margin:0; }
.announcement-card { margin:12px 0; padding:14px; border:1px solid #bcd5e6; background:#f3f9fd; border-radius:12px; }
.announcement-card p { line-height:1.7; }
.product-card-grid { display:grid; grid-template-columns:repeat(auto-fit,minmax(280px,1fr)); gap:12px; margin:12px 0; }
.product-card { display:block; }
.product-card p { margin:8px 0; line-height:1.5; }
.mini-card { display:grid; gap:5px; padding:12px; border:1px solid var(--border); border-radius:10px; background:#fff; }
.mini-card span,.mini-card small { color:var(--muted); }
.table-wrap { width:100%; overflow-x:auto; }
.project-banner { display:flex; justify-content:space-between; align-items:center; gap:20px; }
.project-banner > div:last-child { text-align:right; }
.project-banner > div:last-child strong { display:block; font-size:32px; }
.project-banner > div:last-child small { color:var(--muted); }
.mobile-products { display:grid; gap:10px; margin:10px 0; }
.mobile-product { border:1px solid var(--border); border-radius:10px; padding:12px; background:#fff; }
.mobile-product small { display:block; color:var(--muted); margin:5px 0 8px; line-height:1.5; }
.mobile-product label { margin:0; }
.mini-products { display:flex; flex-wrap:wrap; gap:8px; margin:10px 0; }
.mini-products span { padding:6px 9px; border-radius:999px; background:#edf5fa; border:1px solid #d1e1ec; font-size:12px; }
.success-text { color:var(--success); font-weight:600; }
@media (max-width:900px){
  .inline-actions > input,.inline-actions > select { min-width:100%; }
  .project-banner { align-items:flex-start; }
  .project-card-grid { grid-template-columns:1fr; }
}
.project-card { border-left: 4px solid var(--primary); }
.rule-grid { display:grid; grid-template-columns:repeat(2,minmax(220px,1fr)); gap:12px; margin:14px 0; }
.rule-grid > div { border:1px solid var(--border); border-radius:10px; padding:12px; background:#fbfdff; }
.rule-grid p { margin:7px 0 0; line-height:1.6; color:var(--muted); }
.task-submit-actions { margin-top:12px; }
.task-submit-actions button { flex:1; }
.reward-row { display:grid; grid-template-columns:2fr 1fr 1fr 1fr; gap:8px; align-items:center; border-top:1px solid var(--border); padding:9px 0; }
.reward-row small { grid-column:1/-1; color:var(--danger); }
@media (max-width:900px){
  .rule-grid { grid-template-columns:1fr; }
  .reward-row { grid-template-columns:1.6fr 1fr; }
  .reward-row strong { text-align:right; }
}


/* V0.6.1.3 status navigation */
.metric.metric-link { cursor: pointer; transition: transform .12s ease, box-shadow .12s ease, border-color .12s ease; user-select: none; }
.metric.metric-link:hover { transform: translateY(-1px); box-shadow: 0 5px 14px rgba(15,61,99,.10); border-color: #87abc8; }
.metric.metric-link.active { outline: 2px solid #4c88b5; outline-offset: 1px; }
.metric.metric-link:focus { outline: 2px solid #4c88b5; outline-offset: 2px; }
.drilldown-head { display:flex; justify-content:space-between; align-items:center; gap:12px; margin-bottom:12px; }
.drilldown-list { display:grid; gap:8px; }
.drilldown-row { display:grid; grid-template-columns:minmax(220px,2fr) minmax(120px,1fr) minmax(120px,1fr) minmax(90px,.8fr); gap:10px; align-items:center; padding:10px 0; border-bottom:1px solid var(--border); }
.auto-upload-note { color:var(--muted); font-size:12px; margin-top:6px; }
.photo-box.uploading { opacity:.65; pointer-events:none; }
@media (max-width: 760px) {
  .drilldown-row { grid-template-columns:1fr; gap:4px; }
}

/* V0.6.1.4 supervisor dashboard progress + organization hierarchy */
.progress-col { min-width: 260px; }
.progress-cell { display:grid; grid-template-columns:minmax(150px,1fr) auto auto; align-items:center; gap:8px; }
.progress-cell > strong { min-width:52px; color:#173c59; }
.progress-cell > em { color:var(--danger); font-style:normal; font-size:12px; }
.progress-stack { display:flex; width:100%; height:12px; overflow:hidden; border-radius:999px; background:#e7edf2; box-shadow: inset 0 0 0 1px rgba(70,95,115,.08); }
.progress-stack .seg { display:block; height:100%; min-width:0; }
.progress-stack .seg.done { background:#4e9b6c; }
.progress-stack .seg.review { background:#e7ba55; }
.progress-stack .seg.supplement { background:#dc8b45; }
.progress-stack .seg.erp { background:#5e91c5; }
.progress-stack .seg.rejected { background:#c95f59; }
.progress-stack .seg.draft { background:#9faeba; }
.progress-stack .seg.pending { background:#d6dde3; }
.progress-stack .seg.other { background:#c6d0d8; }
.org-group-grid { display:grid; grid-template-columns:repeat(auto-fit,minmax(300px,1fr)); gap:12px; margin-top:16px; }
.org-group-card { display:flex; justify-content:space-between; gap:12px; align-items:flex-start; border:1px solid var(--border); border-radius:12px; padding:14px; background:#fbfdff; }
.org-group-card p { margin:6px 0; color:#52697a; }
.org-group-card small { color:var(--muted); line-height:1.5; }
.org-member-list { display:grid; grid-template-columns:repeat(2,minmax(220px,1fr)); gap:8px; max-height:56vh; overflow:auto; margin:12px 0; }
.org-member-list label { display:flex; align-items:center; gap:8px; border:1px solid var(--border); border-radius:8px; padding:9px 10px; margin:0; }
.org-member-list input { width:auto; min-height:auto; }
.org-member-list small { margin-left:auto; color:var(--muted); }
@media (max-width:900px){
  .progress-col { min-width:220px; }
  .progress-cell { grid-template-columns:minmax(120px,1fr) auto; }
  .progress-cell > em { grid-column:1/-1; }
  .org-member-list { grid-template-columns:1fr; }
}

/* V0.6.1.4.1 group lifecycle + department visibility */
.scope-toggle { display:flex; gap:8px; align-items:center; flex-wrap:wrap; }
.scope-toggle button.active { background:var(--primary); color:#fff; border-color:var(--primary); }
.managed-row td { background:#f3f9fd; }
.managed-badge { display:inline-block; margin-left:6px; padding:2px 7px; border-radius:999px; background:#dceef9; color:#16547d; font-size:11px; font-weight:600; vertical-align:middle; }
.org-group-card.inactive { opacity:.72; background:#f5f6f7; }
.org-actions { display:flex; flex-wrap:wrap; gap:7px; justify-content:flex-end; }
.status-tag { display:inline-block; margin-left:6px; padding:2px 7px; border-radius:999px; font-size:11px; font-weight:600; }
.status-tag.active { color:#226b45; background:#e5f5eb; }
.status-tag.inactive { color:#6f7780; background:#e8eaec; }
button.danger-outline { color:var(--danger); border-color:#dcb4b0; background:#fff8f7; }
@media (max-width:900px){
  .org-group-card { flex-direction:column; }
  .org-actions { justify-content:flex-start; }
  .scope-toggle { width:100%; }
  .scope-toggle button { flex:1; }
}


/* V0.6.1.4.2 project progress + task search */
.project-progress-col { min-width: 190px; }
.project-progress-cell { display:grid; grid-template-columns:minmax(90px,1fr) auto; gap:7px 9px; align-items:center; }
.project-progress-cell small { grid-column:1/-1; color:var(--muted); }
.project-progress-bar { height:11px; overflow:hidden; border-radius:999px; background:#e5ebef; box-shadow:inset 0 0 0 1px rgba(70,95,115,.08); }
.project-progress-bar > span { display:block; height:100%; background:#4e9b6c; border-radius:999px; transition:width .2s ease; }
.project-progress-cell > strong { min-width:48px; color:#173c59; }
.task-filter-bar { display:grid; grid-template-columns:minmax(220px,1fr) minmax(150px,220px) auto; gap:10px; align-items:end; margin:10px 0 14px; padding:12px; border:1px solid var(--border); border-radius:10px; background:#f8fbfd; }
.task-filter-bar label { margin:0; }
@media (max-width:760px){ .task-filter-bar { grid-template-columns:1fr; } .project-progress-col { min-width:160px; } }


/* V0.6.1.5-A mobile execution + watermark album upload */
.mobile-project-progress { display:grid; grid-template-columns:1fr auto; gap:9px; align-items:center; margin:10px 0 4px; }
.mobile-project-progress > div { height:10px; border-radius:999px; overflow:hidden; background:#e4eaef; }
.mobile-project-progress > div > span { display:block; height:100%; border-radius:999px; background:#4e9b6c; }
.mobile-project-progress > strong { min-width:52px; text-align:right; color:#173c59; }
.watermark-tip { margin:10px 0 12px; padding:11px 12px; border:1px solid #e6d29a; border-radius:10px; background:#fff9e8; color:#71530f; line-height:1.55; }
.photo-box { display:grid; gap:10px; }
.photo-box-head { display:flex; align-items:center; justify-content:space-between; gap:10px; }
.photo-box-head span { color:var(--muted); font-size:12px; }
.photo-source-actions { display:grid; grid-template-columns:1fr 1.45fr; gap:8px; }
.hidden-file-input { display:none !important; }
.photo-upload-progress { height:8px; border-radius:999px; overflow:hidden; background:#e4eaef; }
.photo-upload-progress > span { display:block; height:100%; width:0; background:#4e91bd; transition:width .15s ease; }
.photo-upload-status { min-height:18px; color:var(--muted); font-size:12px; line-height:1.4; }
.photo-thumb-grid { display:grid; grid-template-columns:repeat(auto-fill,minmax(118px,1fr)); gap:8px; }
.photo-thumb { display:grid; gap:5px; padding:7px; border:1px solid var(--border); border-radius:9px; background:#fff; }
.photo-thumb a { display:block; aspect-ratio:4/3; overflow:hidden; border-radius:7px; background:#eef2f5; }
.photo-thumb img { width:100%; height:100%; display:block; object-fit:cover; }
.photo-thumb small { white-space:nowrap; overflow:hidden; text-overflow:ellipsis; color:var(--muted); }
.photo-thumb button { padding:6px 8px; }
.photo-empty { padding:12px; border:1px dashed #cbd7e1; border-radius:8px; text-align:center; color:var(--muted); background:#fff; }
.network-notice { position:sticky; top:66px; z-index:14; padding:9px 12px; border-radius:9px; background:#fff1e9; border:1px solid #edc5ae; color:#804b27; }
.mobile-home-actions { align-items:center; }
@media (max-width:900px) {
  .mobile-home-head { gap:8px; }
  .mobile-home-actions { width:100%; display:grid; grid-template-columns:1fr 1fr; }
  .mobile-home-actions > * { min-width:0 !important; width:100%; }
  .task-dialog { width:100vw; max-width:100vw; height:100dvh; max-height:100dvh; margin:0; border-radius:0; padding:14px 12px calc(18px + env(safe-area-inset-bottom)); }
  .task-dialog #closeTaskDialog { position:sticky; bottom:0; z-index:5; background:#fff; }
  .photo-source-actions { grid-template-columns:1fr; }
  .photo-source-actions button { min-height:48px; font-weight:600; }
  .photo-thumb-grid { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .task-submit-actions { position:sticky; bottom:54px; z-index:5; padding:8px 0; background:linear-gradient(to bottom,rgba(255,255,255,.85),#fff 24%); }
  .task-submit-actions button { min-height:48px; }
  .mobile-product input[type=number] { min-height:48px; font-size:16px; }
}

/* V0.6.1.5-B quota store selection */
.quota-summary{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:10px;margin:14px 0}.quota-summary>div{border:1px solid #dfe8ee;border-radius:12px;padding:12px;background:#f8fbfd;display:flex;flex-direction:column;gap:4px}.quota-summary span{font-size:1.2rem;font-weight:700;color:#0b4f68}.quota-store-dialog{width:min(720px,96vw)}.quota-store-list{display:flex;flex-direction:column;gap:10px;margin-top:12px;max-height:62vh;overflow:auto}.quota-store-card{display:flex;justify-content:space-between;gap:12px;align-items:center;border:1px solid #dfe8ee;border-radius:12px;padding:12px;background:#fff}.quota-store-card>div{display:flex;flex-direction:column;gap:4px;min-width:0}.quota-store-card strong{overflow-wrap:anywhere}.quota-store-card small{color:#637781}.quota-store-card button{flex:0 0 auto}
@media(max-width:720px){.quota-summary{grid-template-columns:repeat(2,minmax(0,1fr))}.quota-store-card{align-items:stretch;flex-direction:column}.quota-store-card button{width:100%;min-height:44px}}
