:root {
  /* 主色系 — 深海蓝，沉稳高级 */
  --primary: #1B5E9F;
  --primary-light: #E8F1FA;
  --primary-dark: #0D3F6E;
  --primary-grad: linear-gradient(135deg, #1B5E9F 0%, #0D3F6E 100%);

  /* 语义色 */
  --success: #2D7D4F;
  --success-light: #E8F5EE;
  --warn: #B8731A;
  --warn-light: #FBF0DD;
  --danger: #B3322E;
  --danger-light: #FBEAEA;

  /* 文字 */
  --text: #1E2329;
  --text2: #525860;
  --text3: #8A9099;
  --text-inv: #FFFFFF;
  --text-inv-soft: rgba(255,255,255,.7);

  /* 背景与边框 */
  --bg: #EEF1F5;
  --bg-soft: #F5F7FA;
  --card: #FFFFFF;
  --border: #DDE2E8;
  --border-soft: #EBEFF3;

  /* 阴影体系 — 分层投影营造质感 */
  --shadow-xs: 0 1px 2px rgba(15,42,76,.04);
  --shadow-sm: 0 2px 6px rgba(15,42,76,.06), 0 1px 2px rgba(15,42,76,.04);
  --shadow: 0 4px 14px rgba(15,42,76,.07), 0 1px 3px rgba(15,42,76,.05);
  --shadow-lg: 0 10px 34px rgba(15,42,76,.10), 0 3px 8px rgba(15,42,76,.06);
  --shadow-xl: 0 20px 60px rgba(15,42,76,.14), 0 6px 16px rgba(15,42,76,.08);
}

* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: "Microsoft YaHei", "PingFang SC", "Helvetica Neue", sans-serif; background: var(--bg); color: var(--text); font-size: 14px; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }
button { font-family: inherit; }
input, select, textarea { font-family: inherit; font-size: 14px; }

/* ---------- 登录 ---------- */
.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: linear-gradient(145deg, #0A2E52 0%, #123B68 30%, #1B5E9F 70%, #2878BD 100%); position: relative; overflow: hidden; }
.login-wrap::before { content: ''; position: absolute; top: -30%; right: -15%; width: 600px; height: 600px; background: radial-gradient(circle, rgba(55,138,221,.18) 0%, transparent 65%); pointer-events: none; }
.login-wrap::after { content: ''; position: absolute; bottom: -20%; left: -10%; width: 500px; height: 500px; background: radial-gradient(circle, rgba(27,94,159,.12) 0%, transparent 65%); pointer-events: none; }
.login-box { background: rgba(255,255,255,.98); border-radius: 18px; padding: 42px 44px 30px; width: 380px; box-shadow: 0 24px 64px rgba(0,0,0,.22), 0 8px 20px rgba(0,0,0,.10); position: relative; z-index: 1; backdrop-filter: blur(20px); border: 1px solid rgba(255,255,255,.2); }
.login-logo { font-size: 30px; font-weight: 800; background: var(--primary-grad); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; text-align: center; letter-spacing: 3px; }
.login-title { text-align: center; font-size: 16px; color: var(--text2); margin-top: 6px; font-weight: 500; letter-spacing: 1px; }
.login-sub { text-align: center; font-size: 12px; color: var(--text3); margin: 4px 0 28px; letter-spacing: 2px; }
.login-form input { width: 100%; height: 46px; border: 1.5px solid var(--border); border-radius: 10px; padding: 0 16px; margin-bottom: 14px; outline: none; transition: all .2s; background: var(--bg-soft); }
.login-form input:focus { border-color: var(--primary); box-shadow: 0 0 0 4px var(--primary-light); background: #fff; }
.login-err { color: var(--danger); font-size: 12px; min-height: 18px; margin-bottom: 6px; text-align: center; }
.login-worker-link { display: block; text-align: center; margin-top: 16px; font-size: 13px; color: var(--primary); text-decoration: none; padding: 8px; border-radius: 8px; transition: background .15s; }
.login-worker-link:hover { background: var(--primary-light); }
.login-tip { margin-top: 20px; text-align: center; font-size: 11px; color: var(--text3); border-top: 1px solid var(--border-soft); padding-top: 14px; }

/* ---------- 布局 ---------- */
#app { display: flex; min-height: 100vh; }
.sidebar { width: 220px; background: linear-gradient(180deg, #0F2E4F 0%, #0D3F6E 40%, #123B68 100%); display: flex; flex-direction: column; position: fixed; top: 0; bottom: 0; left: 0; z-index: 10; box-shadow: 4px 0 20px rgba(15,42,76,.08); }
.brand { padding: 24px 20px 18px; border-bottom: 1px solid rgba(255,255,255,.08); }
.brand-name { font-size: 20px; font-weight: 800; color: #fff; letter-spacing: 2px; text-shadow: 0 2px 8px rgba(0,0,0,.15); }
.brand-sub { font-size: 11px; color: rgba(255,255,255,.5); margin-top: 3px; letter-spacing: 1px; }
.nav { flex: 1; padding: 14px 10px; overflow-y: auto; }
.nav-item { display: flex; align-items: center; gap: 10px; padding: 11px 14px; margin: 2px 0; border-radius: 10px; color: rgba(255,255,255,.6); text-decoration: none; font-size: 14px; transition: all .2s; position: relative; }
.nav-item:hover { background: rgba(255,255,255,.06); color: rgba(255,255,255,.9); }
.nav-item.active { background: rgba(255,255,255,.12); color: #fff; font-weight: 600; }
.nav-item.active::before { content: ''; position: absolute; left: 0; top: 50%; transform: translateY(-50%); width: 3px; height: 20px; background: #3D8BDA; border-radius: 0 3px 3px 0; }
.nav-ico { width: 20px; text-align: center; font-size: 15px; opacity: .85; }
.sidebar-foot { padding: 16px; border-top: 1px solid rgba(255,255,255,.08); }
.user-info { font-size: 13px; margin-bottom: 10px; color: rgba(255,255,255,.7); }
.role-tag { display: inline-block; margin-left: 6px; font-size: 11px; padding: 1px 8px; border-radius: 10px; background: rgba(61,139,218,.2); color: #6FB0F0; }
.role-tag.viewer { background: rgba(45,125,79,.2); color: #5BBA7E; }
.sidebar-foot .btn-ghost { color: rgba(255,255,255,.6); border-color: rgba(255,255,255,.15); width: 100%; }
.sidebar-foot .btn-ghost:hover { background: rgba(255,255,255,.08); color: #fff; }

.main { flex: 1; margin-left: 220px; display: flex; flex-direction: column; min-height: 100vh; }
.topbar { background: rgba(255,255,255,.92); backdrop-filter: blur(12px); border-bottom: 1px solid var(--border-soft); padding: 16px 28px; display: flex; align-items: center; justify-content: space-between; position: sticky; top: 0; z-index: 9; }
.topbar h1 { font-size: 18px; font-weight: 700; color: var(--text); letter-spacing: .5px; }
.top-actions { display: flex; gap: 8px; }
.top-logout { display: none; margin-left: auto; }
.content { padding: 24px 28px 44px; flex: 1; }

/* ---------- 按钮 ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: 1px solid transparent; border-radius: 9px; padding: 8px 16px; font-size: 14px; cursor: pointer; transition: all .2s; white-space: nowrap; font-weight: 500; }
.btn-primary { background: var(--primary-grad); color: #fff; box-shadow: 0 2px 8px rgba(27,94,159,.25); }
.btn-primary:hover { box-shadow: 0 4px 14px rgba(27,94,159,.35); transform: translateY(-1px); }
.btn-primary:active { transform: translateY(0); }
.btn-outline { background: #fff; border-color: var(--primary); color: var(--primary); }
.btn-outline:hover { background: var(--primary-light); border-color: var(--primary-dark); }
.btn-ghost { background: transparent; border-color: var(--border); color: var(--text2); }
.btn-ghost:hover { background: var(--bg-soft); border-color: var(--text3); }
.btn-danger { background: var(--danger-light); color: var(--danger); border-color: transparent; }
.btn-danger:hover { background: var(--danger); color: #fff; }
.btn-success { background: var(--success-light); color: var(--success); border-color: transparent; }
.btn-success:hover { background: var(--success); color: #fff; }
.btn-sm { padding: 5px 11px; font-size: 12px; border-radius: 7px; }
.btn-block { width: 100%; height: 46px; font-size: 15px; border-radius: 10px; }

/* ---------- 卡片 ---------- */
.card { background: var(--card); border: 1px solid var(--border-soft); border-radius: 14px; padding: 20px 22px; box-shadow: var(--shadow-sm); transition: box-shadow .2s; }
.card:hover { box-shadow: var(--shadow); }
.card + .card { margin-top: 16px; }
.card-title { font-size: 15px; font-weight: 700; margin-bottom: 14px; display: flex; justify-content: space-between; align-items: center; color: var(--text); padding-left: 12px; border-left: 3px solid var(--primary); border-radius: 0; }

/* KPI */
.kpi-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 18px; }
.kpi { background: #fff; border: 1px solid var(--border-soft); border-radius: 14px; padding: 18px 20px; box-shadow: var(--shadow-sm); position: relative; overflow: hidden; transition: all .2s; }
.kpi:hover { box-shadow: var(--shadow); transform: translateY(-2px); }
.kpi::after { content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px; background: var(--primary-grad); opacity: .8; }
.kpi .k-label { font-size: 12px; color: var(--text3); font-weight: 500; letter-spacing: .5px; }
.kpi .k-num { font-size: 26px; font-weight: 800; margin-top: 6px; color: var(--primary-dark); letter-spacing: -.5px; }
.kpi .k-num.green { color: var(--success); }
.kpi .k-num.red { color: var(--danger); }
.kpi .k-num.warn { color: var(--warn); }
.kpi .k-sub { font-size: 12px; color: var(--text3); margin-top: 4px; }
/* 财务 KPI 卡片可点击查看明细 */
.kpi.clickable { cursor: pointer; }
.kpi.clickable:hover { border-color: var(--primary); box-shadow: 0 8px 24px rgba(24, 95, 165, .16); transform: translateY(-3px); }
.kpi .k-more { position: absolute; top: 14px; right: 16px; font-size: 12px; color: var(--primary); opacity: .65; transition: opacity .15s; letter-spacing: .5px; }
.kpi.clickable:hover .k-more { opacity: 1; }

/* 表格 */
.tbl-wrap { overflow-x: auto; }
table.tbl { width: 100%; border-collapse: collapse; font-size: 13px; }
table.tbl th { text-align: left; padding: 11px 12px; background: var(--bg-soft); color: var(--text2); font-weight: 600; border-bottom: 2px solid var(--border); white-space: nowrap; letter-spacing: .3px; }
table.tbl td { padding: 11px 12px; border-bottom: 1px solid var(--border-soft); white-space: nowrap; }
table.tbl tr { transition: background .12s; }
table.tbl tr:hover td { background: #F8FAFC; }
table.tbl tr:last-child td { border-bottom: none; }
.tbl-empty { text-align: center; color: var(--text3); padding: 44px 0; }

/* 标签 */
.tag { display: inline-block; padding: 2px 10px; border-radius: 10px; font-size: 12px; font-weight: 500; letter-spacing: .3px; }
.tag-blue { background: var(--primary-light); color: var(--primary); }
.tag-green { background: var(--success-light); color: var(--success); }
.tag-amber { background: var(--warn-light); color: var(--warn); }
.tag-red { background: var(--danger-light); color: var(--danger); }
.tag-gray { background: #F1F2F4; color: var(--text2); }
.tag-purple { background: #F0EDF7; color: #6B5BB3; }
.tag-teal { background: #E3F4F2; color: #1F8A7C; }

/* 派工总览 */
.prov-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; }
.prov-card { border: 1px solid var(--border-soft); border-radius: 12px; padding: 14px; background: #fff; box-shadow: var(--shadow-xs); transition: all .2s; }
.prov-card:hover { box-shadow: var(--shadow-sm); border-color: var(--border); }
.prov-card-h { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 10px; font-size: 14px; font-weight: 600; }
.prov-card-h .btn { margin-left: auto; }
.prov-ord { padding: 9px 10px; border-radius: 9px; background: var(--bg-soft); margin-bottom: 6px; cursor: pointer; font-size: 13px; transition: all .15s; border: 1px solid transparent; }
.prov-ord:hover { background: var(--primary-light); border-color: var(--primary-light); }
.prov-ord-st { float: right; font-size: 12px; }

/* 状态标签 */
.st-pending { background: var(--warn-light); color: var(--warn); }
.st-done { background: var(--success-light); color: var(--success); }
.st-active { background: var(--primary-light); color: var(--primary); }
.st-overdue { background: var(--danger-light); color: var(--danger); }

/* 工具条 */
.toolbar { display: flex; gap: 10px; align-items: center; margin-bottom: 16px; flex-wrap: wrap; }
.toolbar input, .toolbar select { height: 38px; border: 1.5px solid var(--border); border-radius: 9px; padding: 0 12px; outline: none; background: #fff; transition: border-color .2s; }
.toolbar input:focus, .toolbar select:focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-light); }
.toolbar .spacer { flex: 1; }

/* 弹窗 */
.modal-wrap { position: fixed; inset: 0; z-index: 100; display: flex; align-items: center; justify-content: center; }
.modal-mask { position: absolute; inset: 0; background: rgba(10,30,55,.48); backdrop-filter: blur(4px); }
.modal { position: relative; background: #fff; border-radius: 16px; width: 720px; max-width: 94vw; max-height: 88vh; display: flex; flex-direction: column; box-shadow: var(--shadow-xl); animation: modalIn .25s ease; }
@keyframes modalIn { from { opacity: 0; transform: translateY(16px) scale(.97); } to { opacity: 1; transform: translateY(0) scale(1); } }
.modal-head { padding: 18px 24px; border-bottom: 1px solid var(--border-soft); display: flex; justify-content: space-between; align-items: center; font-size: 16px; font-weight: 700; color: var(--text); }
.modal-x { border: none; background: none; font-size: 24px; color: var(--text3); cursor: pointer; line-height: 1; padding: 4px; border-radius: 8px; transition: all .15s; }
.modal-x:hover { color: var(--danger); background: var(--danger-light); }
.modal-body { padding: 22px 24px; overflow-y: auto; }

/* 表单 */
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 16px; }
.form-grid .full, .form-grid-3 .full { grid-column: 1 / -1; }
.f-item label { display: block; font-size: 12px; color: var(--text2); margin-bottom: 6px; font-weight: 600; letter-spacing: .3px; }
.f-item input, .f-item select, .f-item textarea { width: 100%; border: 1.5px solid var(--border); border-radius: 9px; padding: 11px 12px; outline: none; transition: all .2s; background: var(--bg-soft); min-height: 42px; }
.f-item input:focus, .f-item select:focus, .f-item textarea:focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-light); background: #fff; }
.f-item input[type="number"], .f-item input[type="date"] { font-size: 15px; font-weight: 600; }
.f-item textarea { resize: vertical; min-height: 60px; }
.form-foot { margin-top: 20px; display: flex; justify-content: flex-end; gap: 10px; }

/* 明细编辑 */
.items-editor { border: 1px solid var(--border); border-radius: 10px; overflow: hidden; }
.items-editor table { width: 100%; border-collapse: collapse; font-size: 13px; }
.items-editor th { background: var(--bg-soft); padding: 8px 6px; font-weight: 600; color: var(--text2); text-align: left; }
.items-editor td { padding: 6px; border-top: 1px solid var(--border-soft); }
.items-editor input, .items-editor select { width: 100%; border: 1px solid transparent; border-radius: 7px; padding: 6px 7px; outline: none; background: var(--bg-soft); transition: all .15s; }
.items-editor input:focus, .items-editor select:focus { border-color: var(--primary); background: #fff; box-shadow: 0 0 0 2px var(--primary-light); }
.items-editor .del-row { color: var(--danger); background: none; border: none; cursor: pointer; font-size: 16px; padding: 4px; border-radius: 6px; transition: background .15s; }
.items-editor .del-row:hover { background: var(--danger-light); }

/* 摘要条 */
.summary-bar { display: flex; gap: 24px; padding: 14px 16px; background: linear-gradient(135deg, var(--primary-light) 0%, #F0F6FC 100%); border-radius: 10px; margin-top: 14px; font-size: 14px; color: var(--primary-dark); border: 1px solid rgba(27,94,159,.08); }
.summary-bar b { font-size: 16px; font-weight: 800; }

/* 列表组 */
.list-group { display: flex; flex-direction: column; }
.list-group .lg-item { display: flex; justify-content: space-between; align-items: center; padding: 11px 4px; border-bottom: 1px solid var(--border-soft); font-size: 13px; transition: background .12s; }
.list-group .lg-item:hover { background: var(--bg-soft); padding-left: 8px; padding-right: 8px; }
.list-group .lg-item:last-child { border-bottom: none; }
.lg-left b { font-size: 13px; font-weight: 600; }
.lg-left .lg-sub { color: var(--text3); font-size: 12px; margin-top: 2px; }
.lg-right { text-align: right; }
.lg-right .amt { font-weight: 700; color: var(--danger); }
.lg-right .date { font-size: 12px; color: var(--text3); }

/* 双栏 */
.split { display: grid; grid-template-columns: 2fr 1fr; gap: 18px; }
.split2 { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
@media (max-width: 1200px) { .split, .split2 { grid-template-columns: 1fr; } .kpi-grid { grid-template-columns: repeat(2, 1fr); } }

/* 统计迷你图 */
.mini-bars { display: flex; align-items: flex-end; gap: 6px; height: 90px; padding-top: 8px; }
.mini-bar { flex: 1; background: var(--primary-grad); border-radius: 4px 4px 0 0; min-height: 2px; opacity: .85; position: relative; transition: opacity .15s; }
.mini-bar:hover { opacity: 1; }
.mini-bar .mb-v { position: absolute; top: -18px; left: 50%; transform: translateX(-50%); font-size: 11px; color: var(--text2); display: none; }
.mini-bar:hover .mb-v { display: block; }
.mini-x { display: flex; justify-content: space-between; font-size: 11px; color: var(--text3); margin-top: 6px; }
.legend { display: flex; gap: 16px; font-size: 12px; color: var(--text2); margin-top: 8px; flex-wrap: wrap; }
.legend .dot { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 4px; vertical-align: -1px; }

/* 进度 */
.prog { background: var(--bg-soft); border-radius: 6px; height: 8px; overflow: hidden; }
.prog > div { background: var(--primary-grad); height: 100%; border-radius: 6px; transition: width .3s; }

/* 徽标 */
.badge { display: inline-block; min-width: 18px; height: 18px; line-height: 18px; text-align: center; border-radius: 9px; font-size: 11px; background: var(--danger); color: #fff; padding: 0 5px; font-weight: 600; }

/* Toast */
.toast { position: fixed; top: 70px; left: 50%; transform: translateX(-50%); background: rgba(15,30,50,.94); color: #fff; padding: 12px 24px; border-radius: 10px; font-size: 14px; z-index: 999; opacity: 0; transition: opacity .25s, transform .25s; pointer-events: none; box-shadow: 0 8px 24px rgba(0,0,0,.16); }
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* 打印按钮组 */
.print-group { display: flex; gap: 6px; }

/* 只读提示 */
.readonly-banner { background: var(--success-light); color: var(--success); font-size: 12px; padding: 9px 16px; border-radius: 9px; margin-bottom: 12px; display: none; font-weight: 500; }
body.viewer .readonly-banner { display: block; }
body.viewer .hide-for-viewer { display: none !important; }

/* 打印样式 */
@media print {
  body { background: #fff; }
  .no-print { display: none !important; }
  #app { display: block !important; margin: 0 !important; }
  .sidebar, .topbar { display: none !important; }
  .main { margin: 0 !important; padding: 0 !important; }
  .content { padding: 0 !important; }
  .card { border: none; box-shadow: none; padding: 0; }
  @page { margin: 15mm; }
}

/* ================= 手机端适配 ================= */
@media (max-width: 820px) {
  body { font-size: 13px; }

  /* 登录页 */
  .login-box { width: 92vw; max-width: 380px; padding: 30px 24px 22px; border-radius: 14px; }

  /* 布局：侧边栏变顶部导航 */
  #app { flex-direction: column; min-height: 100vh; }
  .sidebar { position: static; width: 100%; height: auto; flex-direction: column; border-right: none; border-bottom: 1px solid var(--border-soft); background: linear-gradient(135deg, #0F2E4F 0%, #0D3F6E 100%); box-shadow: 0 2px 10px rgba(15,42,76,.08); }
  .brand { display: none; }
  .nav { display: flex; flex-wrap: nowrap; overflow-x: auto; padding: 8px; gap: 6px; -webkit-overflow-scrolling: touch; }
  .nav-item { flex: 0 0 auto; padding: 8px 12px; font-size: 13px; gap: 4px; }
  .nav-item.active::before { display: none; }
  .nav-ico { display: none; }
  .sidebar-foot { display: none; }
  .top-logout { display: inline-flex; }

  .main { margin-left: 0; min-height: 0; }
  .topbar { padding: 12px 14px; position: static; flex-wrap: wrap; gap: 8px; }
  .topbar h1 { font-size: 16px; }
  .content { padding: 14px 14px 30px; }

  /* 卡片与 KPI */
  .card { padding: 14px; border-radius: 12px; }
  .kpi-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .kpi { padding: 12px; }
  .kpi .k-num { font-size: 20px; }

  /* 表格：保持宽度，横向滑动 */
  table.tbl { min-width: 640px; }
  .tbl-wrap { margin: 0 -4px; padding: 0 4px; }

  /* 工具条 */
  .toolbar { gap: 6px; }
  .toolbar input, .toolbar select { flex: 1 1 auto; min-width: 0; }

  /* 表单单列 */
  .form-grid { grid-template-columns: 1fr; gap: 12px; }
  .form-grid .full { grid-column: 1; }
  .form-grid-3 { grid-template-columns: 1fr; gap: 12px; }
  .form-grid-3 .full { grid-column: 1; }

  /* 明细编辑器 */
  .items-editor { overflow-x: auto; }
  .items-editor table { min-width: 560px; }

  /* 弹窗接近全屏 */
  .modal { width: 100vw; max-width: 100vw; max-height: 100vh; border-radius: 0; }
  .modal-body { padding: 16px; }

  /* 摘要条 */
  .summary-bar { flex-wrap: wrap; gap: 10px 20px; font-size: 13px; }

  /* 双栏 */
  .split, .split2 { grid-template-columns: 1fr; gap: 12px; }

  /* 按钮组换行 */
  .print-group, .top-actions { flex-wrap: wrap; }

  /* toast 位置 */
  .toast { top: 60px; width: 86vw; text-align: center; }
}

/* ============ 市场行情 ============ */
.news-list { display: flex; flex-direction: column; gap: 12px; padding: 4px 0; }
.news-item { border: 1px solid var(--border, #e6e9ef); border-radius: 10px; padding: 14px 16px; background: #fff; }
.news-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.news-title { font-size: 15px; color: var(--text, #1f2733); }
.news-date { color: var(--text3, #9aa0aa); font-size: 12px; }
.news-head .news-date:last-child { margin-left: auto; }
.news-src { color: var(--text3, #9aa0aa); font-size: 12px; margin-left: 8px; }
.news-title { text-decoration: none; }
.news-title:hover { text-decoration: underline; color: var(--primary); }
.news-price { margin-top: 8px; color: #B45309; font-weight: 600; font-size: 13px; background: #FEF3E2; display: inline-block; padding: 3px 10px; border-radius: 6px; }
.news-content { margin-top: 8px; color: #4b5563; font-size: 13px; line-height: 1.75; white-space: pre-wrap; word-break: break-word; }
.news-ops { margin-top: 10px; display: flex; gap: 8px; }

/* ---- 行业资讯：图文卡片流 ---- */
.news-chips { display: flex; gap: 8px; flex-wrap: wrap; margin: 10px 0 12px; }
.chip { border: 1px solid var(--border); background: var(--card); color: var(--text2); border-radius: 16px; padding: 4px 14px; font-size: 13px; cursor: pointer; transition: all .15s; }
.chip:hover { border-color: var(--primary); color: var(--primary); }
.chip-on { background: var(--primary-grad); color: #fff; border-color: transparent; box-shadow: 0 2px 6px rgba(27,94,159,.3); }
.news-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 14px; }
.news-card { background: var(--card); border: 1px solid var(--border-soft); border-radius: 12px; overflow: hidden; display: flex; flex-direction: column; box-shadow: var(--shadow-sm); transition: box-shadow .2s, transform .2s; }
.news-card:hover { box-shadow: 0 6px 18px rgba(30,35,41,.12); transform: translateY(-2px); }
.news-card.featured { grid-column: 1 / -1; flex-direction: row; }
.news-card.featured .news-cover { width: 42%; min-height: 220px; flex: none; }
.news-card.featured .news-title { font-size: 17px; }
.news-cover { position: relative; height: 150px; background: var(--bg-soft); flex: none; }
.news-cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.news-cover-src { position: absolute; right: 8px; bottom: 8px; background: rgba(0,0,0,.45); color: #fff; font-size: 11px; padding: 2px 8px; border-radius: 4px; }
.news-body { padding: 12px 14px 10px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.news-tags { display: flex; gap: 6px; flex-wrap: wrap; }
.news-card .news-title { font-size: 15px; font-weight: 600; line-height: 1.5; color: var(--text); text-decoration: none; display: block; }
.news-card .news-title:hover { color: var(--primary); text-decoration: underline; }
.news-card .news-content { margin-top: 0; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; white-space: normal; flex: 1; }
.news-foot { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; border-top: 1px dashed var(--border-soft); padding-top: 8px; margin-top: 2px; }
.news-meta { color: var(--text3); font-size: 12px; }
.news-link { font-size: 12px; color: var(--primary); text-decoration: none; margin-left: auto; }
.news-link:hover { text-decoration: underline; }
.news-foot .news-ops { margin-top: 0; margin-left: 8px; }
@media (max-width: 720px) {
  .news-grid { grid-template-columns: 1fr; }
  .news-card.featured { flex-direction: column; }
  .news-card.featured .news-cover { width: 100%; height: 160px; min-height: 0; }
}

/* ===== 库存类目折叠卡：大标题=类目，点开展开该类目物料 ===== */
.inv-cat { padding: 0; overflow: hidden; }
.inv-cat + .inv-cat { margin-top: 14px; }
.inv-cat-head { display: flex; align-items: center; gap: 10px; padding: 14px 18px; cursor: pointer; user-select: none; }
.inv-cat-head:hover { background: var(--bg2); }
.inv-cat.open .inv-cat-head { border-bottom: 1px dashed var(--border); background: linear-gradient(180deg, var(--bg2), transparent); }
.inv-arrow { color: var(--primary); font-size: 13px; width: 14px; flex: none; transition: transform .15s; }
.inv-cat-name { font-size: 16px; font-weight: 800; color: var(--text); }
.inv-cat-meta { font-size: 13px; color: var(--text3); }
.inv-cat-match { margin-left: auto; font-size: 12px; color: var(--primary); background: var(--primary-light, rgba(27,94,159,.08)); padding: 3px 10px; border-radius: 10px; }
.inv-cat-body { display: none; padding: 10px 12px 12px; }
.inv-cat.open .inv-cat-body { display: block; }
/* ===== 子组：类目内按物料名称前缀分组（如"纱配件"）===== */
.inv-sub-head td { background: var(--bg2); cursor: pointer; user-select: none; padding: 8px 12px; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.inv-sub-head:hover td { filter: brightness(0.96); }
.inv-sub-name { font-weight: 700; color: var(--text); font-size: 13.5px; }
.inv-sub-meta { margin-left: 8px; font-size: 12px; color: var(--text3); font-weight: 400; }
.inv-sub-arrow { color: var(--primary); font-size: 12px; width: 14px; display: inline-block; }
/* ===== 生产管理：大区内订单/阶段折叠卡 ===== */
.prod-stage { border: 1px solid var(--border); border-radius: 8px; margin: 10px 12px; overflow: hidden; }
.prod-stage-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 10px 14px; cursor: pointer; user-select: none; background: var(--bg2); }
.prod-stage-head:hover { filter: brightness(0.97); }
.prod-stage-name { font-weight: 700; font-size: 14px; color: var(--text); }
.prod-stage-meta { font-size: 12.5px; color: var(--text3); }
.prod-stage-body { display: none; }
.prod-stage.open .prod-stage-body { display: block; }
@media (max-width: 720px) {
  .inv-sub-head td { padding: 7px 10px; }
  .inv-sub-name { font-size: 13px; }
}
@media (max-width: 720px) {
  .inv-cat-head { padding: 12px 14px; }
  .inv-cat-name { font-size: 15px; }
  .inv-cat-meta { font-size: 12px; }
}

/* 月度明细 类别折叠头（沿用 inv-arrow 三角样式） */
.cat-head { transition: background .15s; }
.cat-head:hover { background: #E8EEF5 !important; }
.cat-head td { user-select: none; }
