/* ==========================================================================
   金吉港综合工作台 · 全局样式
   设计取向：浅色商务风、信息密度高、表格为主、打印友好
   ========================================================================== */
:root {
  --primary: #1D6FD0;
  --primary-dark: #14539E;
  --primary-light: #E8F1FC;
  --accent: #F5822B;
  --sidebar-bg: #17233D;
  --sidebar-hover: #22335A;
  --sidebar-active: #1D6FD0;
  --sidebar-text: #B7C3D8;
  --sidebar-text-active: #FFFFFF;
  --bg: #F4F6FA;
  --card: #FFFFFF;
  --text: #1F2733;
  --text-sub: #5B6779;
  --text-mute: #93A0B4;
  --border: #E3E8F0;
  --border-strong: #CBD4E1;
  --up: #D93A3A;      /* 中国习惯：上涨/增长 = 红 */
  --down: #17A673;    /* 下跌/下降 = 绿 */
  --success: #17A673;
  --warn: #E8A22B;
  --danger: #D93A3A;
  --info: #2B7FD4;
  --radius: 6px;
  --radius-lg: 10px;
  --shadow-sm: 0 1px 2px rgba(23, 35, 61, .06);
  --shadow: 0 4px 14px rgba(23, 35, 61, .08);
  --shadow-lg: 0 12px 36px rgba(23, 35, 61, .16);
  --header-h: 56px;
  --sidebar-w: 218px;
  --font: "Microsoft YaHei", "PingFang SC", "Hiragino Sans GB", "Segoe UI", system-ui, -apple-system, sans-serif;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font-family: var(--font); font-size: 13px; line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--primary); text-decoration: none; }
h1, h2, h3, h4 { margin: 0; font-weight: 600; }
button { font-family: inherit; }

/* ---------------------------------------------------------------- 通用元件 */
.btn {
  display: inline-flex; align-items: center; gap: 5px; height: 30px; padding: 0 13px;
  border: 1px solid var(--border-strong); background: #fff; color: var(--text);
  border-radius: var(--radius); cursor: pointer; font-size: 13px; white-space: nowrap;
  transition: all .15s;
}
.btn:hover { border-color: var(--primary); color: var(--primary); }
.btn-primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); border-color: var(--primary-dark); color: #fff; }
.btn-danger { background: #fff; border-color: #E9B6B6; color: var(--danger); }
.btn-danger:hover { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn-ghost { border-color: transparent; background: transparent; }
.btn-ghost:hover { background: var(--primary-light); }
.btn-sm { height: 24px; padding: 0 9px; font-size: 12px; }
.btn-lg { height: 38px; padding: 0 22px; font-size: 14px; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }

.input, .select, .textarea {
  height: 30px; padding: 0 9px; border: 1px solid var(--border-strong);
  border-radius: var(--radius); font-size: 13px; font-family: inherit;
  background: #fff; color: var(--text); width: 100%; transition: border-color .15s;
}
.textarea { height: auto; padding: 6px 9px; min-height: 66px; resize: vertical; line-height: 1.6; }
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(29,111,208,.12); }
.select { appearance: none; background-image: url("data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%2393A0B4'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 9px center; padding-right: 26px; }

.card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); }
.card-hd { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 16px; border-bottom: 1px solid var(--border); }
.card-hd h3 { font-size: 14px; }
.card-bd { padding: 16px; }
.card-bd.tight { padding: 0; }

.tag { display: inline-block; padding: 1px 7px; border-radius: 10px; font-size: 11px; line-height: 17px; white-space: nowrap; }
.tag-blue { background: var(--primary-light); color: var(--primary-dark); }
.tag-green { background: #E4F7EF; color: #0E8259; }
.tag-red { background: #FCEAEA; color: #B32A2A; }
.tag-orange { background: #FDF0E3; color: #B5601A; }
.tag-gray { background: #F0F2F6; color: var(--text-sub); }
.tag-purple { background: #EFEBFB; color: #5B45B8; }

.muted { color: var(--text-mute); }
.sub { color: var(--text-sub); }
.mono { font-family: "Consolas", "Menlo", monospace; }
.nowrap { white-space: nowrap; }
.text-right { text-align: right; }
.text-center { text-align: center; }
.up { color: var(--up); }
.down { color: var(--down); }
.hidden { display: none !important; }
.mt0 { margin-top: 0 } .mt8 { margin-top: 8px } .mt12 { margin-top: 12px } .mt16 { margin-top: 16px }
.mb0 { margin-bottom: 0 } .mb8 { margin-bottom: 8px } .mb12 { margin-bottom: 12px } .mb16 { margin-bottom: 16px }
.flex { display: flex; align-items: center; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.flex-wrap { display: flex; flex-wrap: wrap; gap: 8px; }
.gap4 { gap: 4px } .gap8 { gap: 8px } .gap12 { gap: 12px } .gap16 { gap: 16px }
.grow { flex: 1; min-width: 0; }

/* ---------------------------------------------------------------- 布局 */
.app { display: flex; height: 100vh; overflow: hidden; }
.sidebar {
  width: var(--sidebar-w); flex: 0 0 var(--sidebar-w); background: var(--sidebar-bg);
  display: flex; flex-direction: column; overflow: hidden;
}
.brand { display: flex; align-items: center; gap: 9px; height: var(--header-h); padding: 0 16px; flex: 0 0 auto; border-bottom: 1px solid rgba(255,255,255,.07); }
.brand-logo {
  width: 28px; height: 28px; border-radius: 7px; background: linear-gradient(135deg, var(--primary), #4A9BF0);
  color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 14px; flex: 0 0 auto;
}
.brand-text { color: #fff; font-size: 14px; font-weight: 600; letter-spacing: .5px; }
.brand-text small { display: block; font-size: 10px; color: var(--sidebar-text); font-weight: 400; letter-spacing: 0; }
.nav { flex: 1; overflow-y: auto; padding: 8px 0 24px; }
.nav::-webkit-scrollbar { width: 6px; }
.nav::-webkit-scrollbar-thumb { background: rgba(255,255,255,.14); border-radius: 3px; }
.nav-group > .nav-group-title {
  padding: 10px 16px 5px; font-size: 11px; color: #6C7C99; letter-spacing: .6px; text-transform: uppercase;
}
.nav-item {
  display: flex; align-items: center; gap: 9px; padding: 8px 16px; color: var(--sidebar-text);
  cursor: pointer; font-size: 13px; border-left: 3px solid transparent; transition: all .12s;
}
.nav-item:hover { background: var(--sidebar-hover); color: #fff; }
.nav-item.active { background: var(--sidebar-hover); color: var(--sidebar-text-active); border-left-color: var(--sidebar-active); font-weight: 500; }
.nav-item .ico { width: 16px; text-align: center; opacity: .9; font-size: 13px; }
.nav-item .badge { margin-left: auto; background: var(--danger); color: #fff; font-size: 10px; border-radius: 8px; padding: 0 5px; line-height: 15px; }
/* 二级分组小标题 + 缩进项（全国城市分站 GEO 的八组分栏） */
.nav-sub {
  padding: 9px 16px 3px; font-size: 10.5px; color: #5C6B88; letter-spacing: .5px;
  border-top: 1px dashed rgba(255,255,255,.08); margin-top: 4px;
}
.nav-group .nav-item.indent { padding-left: 26px; font-size: 12.5px; }

.main { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.topbar {
  height: var(--header-h); flex: 0 0 auto; background: #fff; border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 12px; padding: 0 18px; box-shadow: var(--shadow-sm); z-index: 10;
}
.crumb { font-size: 13px; color: var(--text-sub); }
.crumb b { color: var(--text); font-weight: 600; }
.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 12px; }
.user-chip { display: flex; align-items: center; gap: 8px; cursor: pointer; padding: 4px 8px; border-radius: var(--radius); }
.user-chip:hover { background: var(--bg); }
.avatar { width: 26px; height: 26px; border-radius: 50%; background: var(--primary); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 12px; }
.content { flex: 1; overflow-y: auto; padding: 16px 18px 40px; }
.page-title { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.page-title h2 { font-size: 17px; }
.page-title .desc { color: var(--text-mute); font-size: 12px; margin-top: 2px; }

/* ---------------------------------------------------------------- 指标卡 */
.kpi-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px; }
.kpi { background: #fff; border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 13px 15px; box-shadow: var(--shadow-sm); position: relative; overflow: hidden; }
.kpi::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--primary); opacity: .85; }
.kpi.k-red::before { background: var(--up); } .kpi.k-green::before { background: var(--down); }
.kpi.k-orange::before { background: var(--accent); } .kpi.k-purple::before { background: #6B57D8; }
.kpi-label { font-size: 12px; color: var(--text-sub); display: flex; align-items: center; gap: 4px; }
.kpi-value { font-size: 23px; font-weight: 600; margin: 5px 0 2px; letter-spacing: -.4px; font-variant-numeric: tabular-nums; }
.kpi-value small { font-size: 12px; font-weight: 400; color: var(--text-mute); margin-left: 3px; }
.kpi-foot { font-size: 11px; color: var(--text-mute); display: flex; align-items: center; gap: 6px; }

/* ---------------------------------------------------------------- 表格 */
.table-wrap { overflow-x: auto; }
table.tbl { width: 100%; border-collapse: collapse; font-size: 13px; }
table.tbl th {
  background: #F7F9FC; color: var(--text-sub); font-weight: 600; text-align: left;
  padding: 9px 12px; border-bottom: 1px solid var(--border); white-space: nowrap;
  position: sticky; top: 0; z-index: 2; font-size: 12px;
}
table.tbl td { padding: 8px 12px; border-bottom: 1px solid #EEF1F6; vertical-align: middle; }
table.tbl tbody tr:hover { background: #F8FAFD; }
table.tbl tbody tr.clickable { cursor: pointer; }
table.tbl .num { text-align: right; font-variant-numeric: tabular-nums; }
table.tbl .ops { white-space: nowrap; text-align: right; }
td .clip { display: inline-block; max-width: 230px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; vertical-align: bottom; }
table.tbl .ops .btn { margin-left: 4px; }
.empty { padding: 44px 16px; text-align: center; color: var(--text-mute); }
.empty .big { font-size: 30px; opacity: .35; display: block; margin-bottom: 8px; }

/* ---------------------------------------------------------------- 工具条/分页 */
.toolbar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.toolbar .search { width: 220px; }
.toolbar .grow { flex: 1; }
.pager { display: flex; align-items: center; gap: 8px; justify-content: flex-end; padding: 11px 14px; border-top: 1px solid var(--border); font-size: 12px; color: var(--text-sub); }
.pager .btn { min-width: 26px; justify-content: center; }

/* ---------------------------------------------------------------- 表单 */
.form-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 13px; }
.form-grid .full { grid-column: 1 / -1; }
.field label { display: block; font-size: 12px; color: var(--text-sub); margin-bottom: 4px; }
.field label .req { color: var(--danger); margin-left: 2px; }
.field .hint { font-size: 11px; color: var(--text-mute); margin-top: 3px; }
.readonly-val { padding: 5px 0; color: var(--text-sub); font-size: 13px; }

/* ---------------------------------------------------------------- 弹窗 */
.mask { position: fixed; inset: 0; background: rgba(23,35,61,.42); display: flex; align-items: flex-start; justify-content: center; z-index: 100; padding: 5vh 16px; overflow-y: auto; }
.modal { background: #fff; border-radius: var(--radius-lg); width: 100%; max-width: 720px; box-shadow: var(--shadow-lg); animation: pop .16s ease-out; }
.modal.wide { max-width: 960px; }
.modal.narrow { max-width: 460px; }
@keyframes pop { from { transform: translateY(-8px); opacity: 0 } to { transform: none; opacity: 1 } }
.modal-hd { display: flex; align-items: center; justify-content: space-between; padding: 14px 18px; border-bottom: 1px solid var(--border); cursor: move; user-select: none; }
.modal-hd h3 { font-size: 15px; }
.modal-hd .x { cursor: pointer; color: var(--text-mute); font-size: 17px; line-height: 1; padding: 3px 6px; border-radius: 4px; }
.modal-hd .x:hover { background: var(--bg); color: var(--text); }
/* 拖动中：锁定正文选中、强化投影，明确「正在移动」 */
.modal.dragging { user-select: none; box-shadow: 0 22px 60px rgba(23,35,61,.32); }
.modal.dragging .modal-bd { pointer-events: none; }
.modal-bd { padding: 18px; max-height: 66vh; overflow-y: auto; }
.modal-ft { display: flex; justify-content: flex-end; gap: 9px; padding: 12px 18px; border-top: 1px solid var(--border); }

/* ---------------------------------------------------------------- 提示条 */
.toast-box { position: fixed; top: 16px; right: 16px; z-index: 200; display: flex; flex-direction: column; gap: 8px; }
.toast { background: #223354; color: #fff; padding: 9px 15px; border-radius: var(--radius); box-shadow: var(--shadow-lg); font-size: 13px; animation: slidein .18s ease-out; max-width: 380px; }
.toast.ok { background: #12805A; } .toast.err { background: #B62F2F; } .toast.warn { background: #B57416; }
@keyframes slidein { from { transform: translateX(18px); opacity: 0 } to { transform: none; opacity: 1 } }

/* ---------------------------------------------------------------- 图表 */
.chart-box { width: 100%; overflow: hidden; }
.chart-box svg { display: block; width: 100%; height: auto; }
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12px; color: var(--text-sub); margin-top: 8px; }
.legend i { display: inline-block; width: 9px; height: 9px; border-radius: 2px; margin-right: 5px; vertical-align: middle; }

/* 条形排行 */
.bar-list { display: flex; flex-direction: column; gap: 9px; }
.bar-row { display: grid; grid-template-columns: 128px 1fr 92px; gap: 9px; align-items: center; font-size: 12px; }
.bar-track { height: 16px; background: #F0F3F8; border-radius: 8px; overflow: hidden; }
.bar-fill { height: 100%; background: linear-gradient(90deg, var(--primary), #4E9BEC); border-radius: 8px; transition: width .4s; }
.bar-fill.alt { background: linear-gradient(90deg, var(--accent), #FBA65F); }
.bar-val { text-align: right; font-variant-numeric: tabular-nums; color: var(--text-sub); }

/* 预警列表 */
.alert-row { display: flex; gap: 11px; padding: 11px 0; border-bottom: 1px solid #EEF1F6; }
.alert-row:last-child { border-bottom: none; }
.alert-ico { width: 28px; height: 28px; border-radius: 7px; display: flex; align-items: center; justify-content: center; flex: 0 0 auto; font-size: 14px; }
.alert-ico.danger { background: #FCEAEA; color: var(--danger); }
.alert-ico.warn { background: #FDF3E3; color: #B57416; }
.alert-ico.info { background: var(--primary-light); color: var(--primary-dark); }

/* 分栏 */
.split { display: grid; gap: 14px; }
.split.c2 { grid-template-columns: 1fr 1fr; }
.split.c3 { grid-template-columns: repeat(3, 1fr); }
.split.c2-13 { grid-template-columns: 1fr 2fr; }
.split.c2-31 { grid-template-columns: 2fr 1fr; }
@media (max-width: 1080px) { .split.c2, .split.c3, .split.c2-13, .split.c2-31 { grid-template-columns: 1fr; } }

/* 敏感词检测 */
.check-result { border-radius: var(--radius); padding: 12px; margin-top: 12px; }
.check-result.pass { background: #E9F8F2; border: 1px solid #B6E5D2; }
.check-result.warn { background: #FDF6E8; border: 1px solid #F0DCA8; }
.check-result.bad { background: #FCEBEB; border: 1px solid #EFBFBF; }
.hl { background: #FFE0E0; color: #B32A2A; border-radius: 3px; padding: 0 2px; font-weight: 600; }

/* 分镜 */
.shot { display: grid; grid-template-columns: 46px 120px 1fr; gap: 10px; padding: 10px 0; border-bottom: 1px dashed var(--border); font-size: 12.5px; }
.shot:last-child { border-bottom: none; }
.shot-no { width: 24px; height: 24px; border-radius: 50%; background: var(--primary-light); color: var(--primary-dark); display: flex; align-items: center; justify-content: center; font-weight: 600; }

/* 进度条 */
.progress { height: 7px; background: #EEF1F6; border-radius: 4px; overflow: hidden; }
.progress > i { display: block; height: 100%; background: var(--primary); border-radius: 4px; }

/* 登录页 */
.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #17233D 0%, #23407A 55%, #1D6FD0 100%); padding: 20px; }
.login-card { width: 100%; max-width: 400px; background: #fff; border-radius: 14px; box-shadow: 0 22px 60px rgba(0,0,0,.3); padding: 34px 32px 28px; }
.login-logo { display: flex; align-items: center; gap: 11px; margin-bottom: 22px; }
.login-logo .brand-logo { width: 40px; height: 40px; font-size: 19px; }
.login-logo h1 { font-size: 18px; }
.login-logo p { font-size: 12px; color: var(--text-mute); margin: 2px 0 0; }
.login-form .field { margin-bottom: 14px; }
.login-form .input { height: 38px; }
.login-tip { font-size: 11.5px; color: var(--text-mute); margin-top: 16px; line-height: 1.9; padding-top: 14px; border-top: 1px dashed var(--border); }
.login-err { background: #FCEBEB; color: #B32A2A; border-radius: var(--radius); padding: 8px 11px; font-size: 12.5px; margin-bottom: 12px; }

/* ---------------------------------------------------------------- 顶栏：天气胶囊 / 主题按钮 */
.icon-btn { width: 30px; padding: 0; justify-content: center; font-size: 14px; }
.wx-chip {
  display: flex; align-items: center; gap: 6px; height: 28px; padding: 0 11px 0 9px;
  border: 1px solid var(--border); border-radius: 15px; background: linear-gradient(180deg, #FBFCFE, #F3F6FB);
  cursor: pointer; font-size: 12.5px; color: var(--text-sub); white-space: nowrap; transition: all .15s;
}
.wx-chip:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-light); }
.wx-chip .wx-ico { font-size: 14px; line-height: 1; }
.wx-chip .wx-city { font-weight: 600; color: var(--text); }
.wx-chip .wx-temp { font-variant-numeric: tabular-nums; font-weight: 600; color: var(--primary); }
.wx-chip.wx-off { opacity: .6; cursor: default; }
.wx-chip.wx-off:hover { border-color: var(--border); color: var(--text-sub); background: #F8FAFD; }

/* 天气详情弹窗 */
.wx-hero { display: flex; align-items: center; gap: 16px; padding: 6px 2px 14px; border-bottom: 1px dashed var(--border); }
.wx-hero .big-ico { font-size: 46px; line-height: 1; }
.wx-hero .temp { font-size: 34px; font-weight: 600; letter-spacing: -1px; font-variant-numeric: tabular-nums; }
.wx-hero .meta { color: var(--text-mute); font-size: 12px; margin-top: 2px; }
.wx-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 14px; }
.wx-grid .cell { background: #F7F9FC; border: 1px solid var(--border); border-radius: var(--radius); padding: 9px 11px; }
.wx-grid .cell .k { font-size: 11px; color: var(--text-mute); }
.wx-grid .cell .v { font-size: 14px; font-weight: 600; margin-top: 1px; font-variant-numeric: tabular-nums; }
.wx-fc { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 12px; }
.wx-fc .d { border: 1px solid var(--border); border-radius: var(--radius); padding: 10px; text-align: center; background: #fff; }
.wx-fc .d .dt { font-size: 11.5px; color: var(--text-mute); }
.wx-fc .d .ic { font-size: 22px; margin: 3px 0; }
.wx-fc .d .tp { font-size: 13px; font-weight: 600; font-variant-numeric: tabular-nums; }
.wx-fc .d .ds { font-size: 11px; color: var(--text-sub); margin-top: 2px; }

/* ---------------------------------------------------------------- 主题选择器 */
.theme-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 12px; }
.theme-card {
  border: 2px solid var(--border); border-radius: var(--radius-lg); padding: 11px; cursor: pointer;
  background: #fff; transition: all .15s; position: relative;
}
.theme-card:hover { border-color: var(--border-strong); box-shadow: var(--shadow-sm); }
.theme-card.active { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-light); }
.theme-card .sw { display: flex; gap: 5px; margin-bottom: 9px; }
.theme-card .sw i { width: 22px; height: 22px; border-radius: 5px; display: block; box-shadow: inset 0 0 0 1px rgba(0,0,0,.06); }
.theme-card .nm { font-size: 13px; font-weight: 600; display: flex; align-items: center; gap: 6px; }
.theme-card .ds { font-size: 11px; color: var(--text-mute); margin-top: 3px; line-height: 1.55; min-height: 34px; }
.theme-card .tick { position: absolute; top: 9px; right: 9px; color: var(--primary); font-size: 15px; font-weight: 700; }
.theme-preview { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.theme-preview .bar { height: 18px; border-radius: 4px; flex: 1; }
.color-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.color-row input[type="color"] {
  width: 44px; height: 30px; padding: 0; border: 1px solid var(--border-strong);
  border-radius: var(--radius); background: #fff; cursor: pointer;
}
.color-row .hex { width: 104px; }

/* ---------------------------------------------------------------- Logo 上传 */
.logo-uploader { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.logo-preview {
  width: 168px; height: 62px; border: 1px dashed var(--border-strong); border-radius: var(--radius);
  background: repeating-conic-gradient(#F2F5FA 0% 25%, #fff 0% 50%) 50% / 14px 14px;
  display: flex; align-items: center; justify-content: center; overflow: hidden; flex: 0 0 auto;
}
.logo-preview img { max-width: 100%; max-height: 100%; object-fit: contain; }
.logo-preview.side { background: var(--sidebar-bg); border-style: solid; border-color: var(--sidebar-bg); }
.logo-preview.side img { max-height: 34px; }
.logo-drop {
  border: 1px dashed var(--border-strong); border-radius: var(--radius); padding: 14px;
  text-align: center; color: var(--text-mute); font-size: 12.5px; cursor: pointer; background: #FBFCFE;
}
.logo-drop:hover, .logo-drop.over { border-color: var(--primary); background: var(--primary-light); color: var(--primary); }
.logo-drop b { color: var(--primary); }

/* 侧边栏 Logo 图片模式 */
.brand-logo.has-img { background: none; padding: 0; overflow: hidden; }
.brand-logo.has-img img { width: 100%; height: 100%; object-fit: contain; display: block; }

/* 偏好区块 */
.pref-block { padding: 16px; border-bottom: 1px solid var(--border); }
.pref-block:last-child { border-bottom: none; }
.pref-block h4 { font-size: 13.5px; margin-bottom: 3px; display: flex; align-items: center; gap: 7px; }
.pref-block .hint { font-size: 11.5px; color: var(--text-mute); margin-bottom: 12px; line-height: 1.7; }

/* 滚动条 */
.content::-webkit-scrollbar, .modal-bd::-webkit-scrollbar, .table-wrap::-webkit-scrollbar { width: 9px; height: 9px; }
.content::-webkit-scrollbar-thumb, .modal-bd::-webkit-scrollbar-thumb, .table-wrap::-webkit-scrollbar-thumb { background: #CDD6E3; border-radius: 5px; }
.content::-webkit-scrollbar-thumb:hover, .modal-bd::-webkit-scrollbar-thumb:hover, .table-wrap::-webkit-scrollbar-thumb:hover { background: #B0BCCE; }

/* 打印 */
@media print {
  .sidebar, .topbar, .toolbar, .pager, .btn { display: none !important; }
  .content { padding: 0; overflow: visible; }
  .app { height: auto; display: block; }
  .card { box-shadow: none; border-color: #ccc; break-inside: avoid; }
}

/* ==========================================================================
   新增模块样式（R48 增量）
   1) 列表交替背景色（斑马纹）  2) 科技感视觉  3) 强度 / 密度
   4) 数据条与环形进度  5) 页签  6) 文件预览 / 附件卡  7) 时间轴与审批流
   全部由 <html data-*> 开关控制，业务代码零改动即可生效。
   ========================================================================== */

/* ---------------------------------------------------------- 开关变量 */
:root {
  --tech-a: .55;          /* 科技装饰层透明度（强度） */
  --tech-glow: 0 0 0 rgba(0,0,0,0);
  --row-pad-y: 8px;       /* 表格行高（密度） */
  --row-pad-x: 12px;
  --head-pad-y: 9px;
}
html[data-intensity="low"]    { --tech-a: .25; }
html[data-intensity="high"]   { --tech-a: 1; }
html[data-density="compact"]  { --row-pad-y: 5px;  --row-pad-x: 10px; --head-pad-y: 6px; font-size: 12.5px; }
html[data-density="loose"]    { --row-pad-y: 12px; --row-pad-x: 15px; --head-pad-y: 11px; }

/* ---------------------------------------------------------- ② 列表交替背景色 */
html[data-zebra="1"] table.tbl tbody tr:nth-child(odd) { background: #F7FAFE; }
html[data-zebra="1"] table.tbl tbody tr:nth-child(odd):hover { background: #EFF5FC; }
html[data-zebra="1"] table.tbl tbody tr:nth-child(even):hover { background: #F8FAFD; }

/* 表格密度 */
table.tbl th { padding: var(--head-pad-y) var(--row-pad-x); }
table.tbl td { padding: var(--row-pad-y) var(--row-pad-x); }

/* ---------------------------------------------------------- ① 科技感视觉 */
html[data-tech="1"] body {
  background-image:
    radial-gradient(1200px 420px at 15% -8%, rgba(29,111,208,.06), transparent 60%),
    radial-gradient(900px 380px at 95% 0%, rgba(245,130,43,.05), transparent 62%);
  background-attachment: fixed;
}
/* 侧边栏：网格底纹 + 高亮扫描线 */
html[data-tech="1"] .sidebar { position: relative; overflow: hidden; }
html[data-tech="1"] .sidebar::before {
  content: ""; position: absolute; inset: 0; pointer-events: none; opacity: var(--tech-a);
  background-image:
    linear-gradient(rgba(120,170,255,.09) 1px, transparent 1px),
    linear-gradient(90deg, rgba(120,170,255,.07) 1px, transparent 1px);
  background-size: 26px 26px, 26px 26px;
  mask-image: linear-gradient(180deg, #000 0%, rgba(0,0,0,.25) 60%, transparent 100%);
}
html[data-tech="1"] .sidebar::after {
  content: ""; position: absolute; left: 0; right: 0; height: 120px; pointer-events: none;
  background: linear-gradient(180deg, transparent, rgba(90,150,255,.16), transparent);
  opacity: var(--tech-a);
}
html[data-motion="1"][data-tech="1"] .sidebar::after { animation: scanY 7s linear infinite; }
@keyframes scanY { from { top: -140px } to { top: 100% } }

html[data-tech="1"] .brand { position: relative; z-index: 1; }
html[data-tech="1"] .brand-logo { box-shadow: 0 0 0 1px rgba(255,255,255,.14), 0 6px 18px rgba(0,0,0,.35); }
html[data-tech="1"] .nav { position: relative; z-index: 1; }
html[data-tech="1"] .nav-item { position: relative; transition: background .16s, color .16s, transform .16s; }
html[data-tech="1"] .nav-item::before {
  content: ""; position: absolute; left: 0; top: 50%; transform: translateY(-50%);
  width: 2px; height: 0; background: linear-gradient(180deg, #7FC4FF, var(--primary));
  border-radius: 2px; transition: height .18s ease;
}
html[data-tech="1"] .nav-item:hover::before { height: 46%; }
html[data-tech="1"] .nav-item.active::before { height: 64%; box-shadow: 0 0 10px rgba(90,160,255,.9); }
html[data-tech="1"] .nav-item.active { background: linear-gradient(90deg, rgba(255,255,255,.09), transparent 70%); }

/* 顶栏：渐变细线 */
html[data-tech="1"] .topbar { position: relative; }
html[data-tech="1"] .topbar::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 1px; opacity: var(--tech-a);
  background: linear-gradient(90deg, transparent, var(--primary), var(--accent), transparent);
  background-size: 200% 100%;
}
html[data-motion="1"][data-tech="1"] .topbar::after { animation: lineFlow 9s linear infinite; }
@keyframes lineFlow { from { background-position: 0% 0 } to { background-position: 200% 0 } }

/* 卡片：悬浮渐变描边 + 顶部高光 */
html[data-tech="1"] .card { position: relative; overflow: hidden; transition: box-shadow .18s, transform .18s; }
html[data-tech="1"] .card::before {
  content: ""; position: absolute; top: 0; left: 0; right: 0; height: 2px; opacity: calc(var(--tech-a) * .9);
  background: linear-gradient(90deg, var(--primary), var(--accent), var(--primary));
}
html[data-motion="1"][data-tech="1"] .card:hover { box-shadow: var(--shadow); transform: translateY(-1px); }

/* KPI：角标 + 数值渐变 */
html[data-tech="1"] .kpi { position: relative; overflow: hidden; }
html[data-tech="1"] .kpi::after {
  content: ""; position: absolute; right: -30px; top: -30px; width: 74px; height: 74px; border-radius: 50%;
  background: radial-gradient(circle, rgba(29,111,208,.16), transparent 68%); opacity: var(--tech-a);
  pointer-events: none;
}
html[data-tech="1"] .kpi-value { letter-spacing: .3px; }

/* 页标题：左侧发光条 */
html[data-tech="1"] .page-title h2 { position: relative; padding-left: 12px; }
html[data-tech="1"] .page-title h2::before {
  content: ""; position: absolute; left: 0; top: 50%; transform: translateY(-50%);
  width: 3px; height: 17px; border-radius: 2px;
  background: linear-gradient(180deg, var(--primary), var(--accent));
  box-shadow: 0 0 10px rgba(29,111,208,.6);
}
/* 表头渐变 */
html[data-tech="1"] table.tbl th {
  background-image: linear-gradient(180deg, rgba(29,111,208,.07), rgba(29,111,208,.02));
}
/* 主按钮发光 */
html[data-tech="1"] .btn-primary { box-shadow: 0 2px 10px rgba(29,111,208,.28); }
html[data-tech="1"] .btn-primary:hover { box-shadow: 0 3px 14px rgba(29,111,208,.42); }
/* 弹窗顶部渐变 */
html[data-tech="1"] .modal { border-top: 2px solid transparent;
  background-image: linear-gradient(#fff, #fff), linear-gradient(90deg, var(--primary), var(--accent));
  background-origin: border-box; background-clip: padding-box, border-box; }
/* 品牌字标 */
html[data-tech="1"] .brand-text { letter-spacing: .6px; }

/* 关闭动效 */
html[data-motion="0"] *, html[data-motion="0"] *::before, html[data-motion="0"] *::after {
  animation: none !important; transition: none !important;
}

/* ---------------------------------------------------------- 数据条（进度百分比） */
.pbar { display: inline-flex; align-items: center; gap: 7px; min-width: 108px; }
.pbar-track {
  position: relative; flex: 1; height: 8px; min-width: 54px; border-radius: 999px;
  background: #EDF1F7; overflow: hidden; box-shadow: inset 0 0 0 1px rgba(23,35,61,.05);
}
.pbar-fill {
  display: block; height: 100%; border-radius: 999px; width: 0;
  background: linear-gradient(90deg, var(--primary), #5AA9F0);
  transition: width .45s cubic-bezier(.25,.8,.3,1);
}
.pbar.run .pbar-fill  { background: linear-gradient(90deg, var(--primary), #5AA9F0); }
.pbar.good .pbar-fill { background: linear-gradient(90deg, #12805A, #2FC08C); }
.pbar.done .pbar-fill { background: linear-gradient(90deg, #0E8259, #37C58F); }
.pbar.idle .pbar-fill { background: linear-gradient(90deg, #C6CFDC, #DDE4EE); }
.pbar .pbar-num { font-size: 11.5px; color: var(--text-sub); font-variant-numeric: tabular-nums; min-width: 34px; text-align: right; }
.pbar.compact { min-width: 84px; }
.pbar.compact .pbar-track { height: 6px; }
html[data-motion="1"][data-tech="1"] .pbar.run .pbar-fill {
  background-image: linear-gradient(90deg, var(--primary), #5AA9F0),
    repeating-linear-gradient(115deg, rgba(255,255,255,.28) 0 6px, transparent 6px 12px);
  background-size: 100% 100%, 24px 100%;
  animation: barFlow 1.1s linear infinite;
}
@keyframes barFlow { from { background-position: 0 0, 0 0 } to { background-position: 0 0, 24px 0 } }

/* 环形进度 */
.ring { position: relative; display: inline-block; }
.ring svg { width: 100%; height: 100%; display: block; }
.ring b {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  font-size: 13px; color: var(--text); font-variant-numeric: tabular-nums;
}

/* 进度点阵（工序列） */
.step-dots { display: inline-flex; gap: 3px; align-items: center; }
.step-dots i { width: 9px; height: 9px; border-radius: 50%; background: #E1E7F0; display: block; }
.step-dots i.on { background: var(--primary); box-shadow: 0 0 6px rgba(29,111,208,.5); }
.step-dots i.full { background: var(--success); }

/* ---------------------------------------------------------- 页签 */
.tabs {
  display: flex; gap: 2px; border-bottom: 1px solid var(--border);
  margin: -4px 0 14px; flex-wrap: wrap; position: sticky; top: 0; background: #fff; z-index: 3;
}
.tab {
  padding: 8px 14px; cursor: pointer; font-size: 13px; color: var(--text-sub);
  border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap;
  transition: color .15s, border-color .15s;
}
.tab:hover { color: var(--primary); }
.tab.active { color: var(--primary); border-bottom-color: var(--primary); font-weight: 600; }
html[data-tech="1"] .tab.active { box-shadow: 0 2px 8px -4px rgba(29,111,208,.7); }

/* ---------------------------------------------------------- 文件预览 / 附件 */
.file-view { text-align: center; background: #F4F6FA; border-radius: var(--radius); padding: 10px; }
.file-view img { max-width: 100%; max-height: 68vh; border-radius: var(--radius); background: #fff; }
.file-view iframe { width: 100%; height: 68vh; border: 0; border-radius: var(--radius); background: #fff; }

.file-list { display: grid; gap: 8px; }
.file-card {
  display: flex; align-items: center; gap: 10px; padding: 9px 11px;
  border: 1px solid var(--border); border-radius: var(--radius); background: #fff;
  transition: border-color .15s, box-shadow .15s;
}
.file-card:hover { border-color: var(--primary); box-shadow: var(--shadow-sm); }
.file-card .fi { font-size: 22px; line-height: 1; }
.file-card .fm { flex: 1; min-width: 0; }
.file-card .fm .nm { font-weight: 600; font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-card .fm .sub { font-size: 11px; color: var(--text-mute); }
.file-card .fa { display: flex; gap: 6px; }

.drop-zone {
  border: 1px dashed var(--border-strong); border-radius: var(--radius-lg); padding: 20px;
  text-align: center; color: var(--text-mute); font-size: 12.5px; cursor: pointer; background: #FBFCFE;
  transition: all .15s;
}
.drop-zone:hover, .drop-zone.over { border-color: var(--primary); background: var(--primary-light); color: var(--primary); }
.drop-zone b { color: var(--primary); }
.drop-zone .big { font-size: 26px; display: block; margin-bottom: 6px; opacity: .7; }

/* ---------------------------------------------------------- 时间轴（物流轨迹 / 审批流） */
.timeline { position: relative; padding-left: 20px; }
.timeline::before { content: ""; position: absolute; left: 5px; top: 4px; bottom: 4px; width: 2px; background: var(--border); }
.tl-item { position: relative; padding-bottom: 14px; }
.tl-item:last-child { padding-bottom: 0; }
.tl-item::before {
  content: ""; position: absolute; left: -19px; top: 4px; width: 10px; height: 10px; border-radius: 50%;
  background: #fff; border: 2px solid var(--border-strong);
}
.tl-item.done::before { border-color: var(--success); background: var(--success); }
.tl-item.cur::before { border-color: var(--primary); background: var(--primary); box-shadow: 0 0 0 4px rgba(29,111,208,.16); }
.tl-item .tl-t { font-size: 12.5px; font-weight: 600; }
.tl-item .tl-d { font-size: 11.5px; color: var(--text-mute); }

/* 审批流节点条 */
.flow-steps { display: flex; gap: 0; flex-wrap: wrap; align-items: stretch; }
.flow-step {
  flex: 1; min-width: 130px; border: 1px solid var(--border); border-radius: var(--radius);
  padding: 9px 11px; background: #FBFCFE; margin-right: 6px; position: relative;
}
.flow-step.done { background: #E9F8F2; border-color: #B6E5D2; }
.flow-step.cur { background: var(--primary-light); border-color: var(--primary); }
.flow-step .n { font-size: 11px; color: var(--text-mute); }
.flow-step .p { font-size: 12.5px; font-weight: 600; }

/* 小徽标 */
.chip {
  display: inline-flex; align-items: center; gap: 4px; padding: 1px 8px; border-radius: 999px;
  background: #F0F3F8; color: var(--text-sub); font-size: 11px; line-height: 18px;
}
.chip.blue { background: var(--primary-light); color: var(--primary-dark); }
.chip.green { background: #E4F7EF; color: #0E8259; }
.chip.orange { background: #FDF0E3; color: #B5601A; }
.chip.red { background: #FCEAEA; color: #B32A2A; }
.chip.purple { background: #EFEBFB; color: #5B45B8; }

/* 只读态字段（表单钩子用） */
.field .input[readonly], .field .select[disabled] { background: #F5F7FA; color: var(--text-sub); }

/* 四列网格（表单内小分组） */
.mini-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 10px; }

/* ==========================================================================
   列表页 · 行选择与批量操作
   ========================================================================== */
/* 复选框列 / 序号列 */
table.tbl th.c-sel, table.tbl td.c-sel {
  width: 40px; text-align: center; padding-left: 8px; padding-right: 8px;
}
table.tbl th.c-idx, table.tbl td.c-idx {
  width: 48px; text-align: center; color: var(--text-mute);
  font-variant-numeric: tabular-nums; font-size: 12px;
}
table.tbl .c-sel input { width: 14px; height: 14px; cursor: pointer; vertical-align: middle; }
table.tbl tbody tr.sel { background: #F2F8FF; }

/* 批量操作栏 */
.bulkbar {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  margin-bottom: 12px; padding: 8px 12px;
  background: var(--card); border: 1px solid var(--border); border-radius: 8px;
}
.bulkbar .selcount { font-size: 13px; color: var(--text-mute); }
.bulkbar .selcount.on { color: var(--primary); font-weight: 600; }
.bulkbar .btn[disabled] { opacity: .45; cursor: not-allowed; }
