/* 智排班 · 样式表 */

:root {
  --bg: #F4F5F9;
  --surface: #FFFFFF;
  --surface-2: #FAFBFD;
  --border: #E7E9F1;
  --border-strong: #D6DAE6;
  --text: #1D2333;
  --text-2: #565E76;
  --text-3: #8B92A8;
  --primary: #5B5BD6;
  --primary-dark: #4A4AC4;
  --primary-soft: #EFEFFE;
  --danger: #E5484D;
  --warn: #F59E0B;
  --good: #10B981;
  --radius: 10px;
  --shadow-sm: 0 1px 2px rgba(20, 24, 40, .06);
  --shadow-md: 0 8px 24px rgba(20, 24, 40, .10);
  --shadow-lg: 0 20px 50px rgba(20, 24, 40, .18);
}

* { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "PingFang SC", "Microsoft YaHei", "Hiragino Sans GB", "Segoe UI", system-ui, -apple-system, sans-serif;
  font-size: 13.5px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, p { margin: 0; }
button { font-family: inherit; }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: #D3D7E3; border-radius: 8px; border: 2px solid transparent; background-clip: content-box; }
::-webkit-scrollbar-thumb:hover { background: #BFC4D4; background-clip: content-box; }
::-webkit-scrollbar-track { background: transparent; }

/* ---------------------------------------------------------------- 布局 */

.app-shell { display: flex; height: 100vh; overflow: hidden; }

.sidebar {
  width: 218px;
  flex: 0 0 218px;
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  padding: 14px 12px;
  gap: 14px;
}

.brand { display: flex; align-items: center; gap: 10px; padding: 4px 6px 10px; }
.brand-mark {
  width: 34px; height: 34px; border-radius: 10px;
  background: linear-gradient(135deg, #6D6DF0, #8B5CF6);
  color: #fff; display: grid; place-items: center;
  box-shadow: 0 6px 14px rgba(91, 91, 214, .32);
}
.brand-text { display: flex; flex-direction: column; }
.brand-name { font-weight: 650; font-size: 15px; letter-spacing: .5px; }
.brand-sub { font-size: 11px; color: var(--text-3); }

.nav { display: flex; flex-direction: column; gap: 2px; }
.nav-item {
  display: flex; align-items: center; gap: 10px;
  border: 0; background: transparent; color: var(--text-2);
  padding: 9px 10px; border-radius: 9px; cursor: pointer;
  font-size: 13.5px; text-align: left; transition: background .14s, color .14s;
}
.nav-item:hover { background: var(--surface-2); color: var(--text); }
.nav-item.on { background: var(--primary-soft); color: var(--primary); font-weight: 600; }
.nav-item .svg-icon { display: grid; place-items: center; }
.nav-sep { height: 1px; background: var(--border); margin: 6px 0; }

.sidebar-bottom { margin-top: auto; display: flex; flex-direction: column; gap: 6px; }
.sidebar-bottom .btn { justify-content: center; }
.sidebar-foot { font-size: 11.5px; color: var(--text-3); text-align: center; padding-top: 4px; }
.app-version { font-size: 11px; color: var(--text-3); opacity: .8; letter-spacing: .3px; }

.main { flex: 1; overflow: auto; padding: 22px 26px 70px; }
.view { max-width: 1560px; margin: 0 auto; display: flex; flex-direction: column; gap: 16px; }

.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.page-title { font-size: 20px; font-weight: 650; letter-spacing: .2px; }
.page-sub { color: var(--text-3); font-size: 12.5px; margin-top: 3px; }
.page-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* ---------------------------------------------------------------- 按钮 */

.btn {
  display: inline-flex; align-items: center; gap: 6px;
  border: 1px solid var(--border-strong); background: var(--surface); color: var(--text);
  padding: 7px 13px; border-radius: 9px; cursor: pointer;
  font-size: 13px; font-weight: 500; transition: background .14s, border-color .14s, box-shadow .14s, transform .08s;
  white-space: nowrap;
}
.btn:hover { background: var(--surface-2); border-color: #C6CBDA; }
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--primary); border-color: var(--primary); color: #fff; box-shadow: 0 4px 12px rgba(91, 91, 214, .24); }
.btn.primary:hover { background: var(--primary-dark); border-color: var(--primary-dark); }
.btn.danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn.ghost { background: var(--surface); }
.btn.btn-sm { padding: 5px 10px; font-size: 12px; border-radius: 8px; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.btn .svg-icon { display: grid; place-items: center; }

.icon-btn {
  border: 1px solid transparent; background: transparent; color: var(--text-3);
  width: 28px; height: 28px; border-radius: 8px; display: inline-grid; place-items: center;
  cursor: pointer; transition: background .14s, color .14s;
}
.icon-btn:hover { background: var(--surface-2); color: var(--text); }

.link-btn { border: 0; background: none; color: var(--primary); cursor: pointer; font-size: 12.5px; padding: 2px 4px; }
.link-btn.danger { color: var(--danger); }
.pkg-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 7px 2px; font-size: 12.5px; border-bottom: 1px dashed var(--border-strong); }
.pkg-row:last-child { border-bottom: 0; }
.pkg-row-ops { display: flex; align-items: center; gap: 4px; flex-shrink: 0; }
.pkg-tools { display: flex; align-items: center; gap: 14px; margin-top: 7px; flex-wrap: wrap; }
.pkg-error { color: var(--danger); font-size: 12px; line-height: 1.7; margin-top: 4px; word-break: break-all; }
.pkg-ref { max-height: 250px; overflow-y: auto; margin-top: 8px; border: 1px solid var(--border-strong); border-radius: 10px; padding: 0 12px; }
.pkg-ref-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 0; border-bottom: 1px dashed var(--border-strong); }
.pkg-ref-row:last-child { border-bottom: 0; }
.pkg-ref-info { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.pkg-ref-label { font-size: 12.5px; color: var(--text); }
.pkg-ref-key { font-size: 11px; color: var(--text-3); }

/* ---------------------------------------------------------------- 表单 */

.input {
  width: 100%; border: 1px solid var(--border-strong); border-radius: 9px;
  padding: 7px 10px; font-size: 13px; font-family: inherit; color: var(--text);
  background: var(--surface); transition: border-color .14s, box-shadow .14s;
}
.input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(91, 91, 214, .12); }
.select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, #8B92A8 50%), linear-gradient(135deg, #8B92A8 50%, transparent 50%); background-position: calc(100% - 15px) 50%, calc(100% - 10px) 50%; background-size: 5px 5px, 5px 5px; background-repeat: no-repeat; padding-right: 28px; }
.textarea { resize: vertical; line-height: 1.6; }
.color-input { width: 46px; height: 30px; padding: 2px; border: 1px solid var(--border-strong); border-radius: 8px; background: #fff; cursor: pointer; }

.field { display: flex; flex-direction: column; gap: 5px; }
.field-label { font-size: 12.5px; color: var(--text-2); font-weight: 500; }
.field-hint { font-size: 11.5px; color: var(--text-3); }

/* 时间段编辑器（班次弹窗）：多段「开始–结束」+ 跨天徽标 + 行内错误 */
.seg-editor { display: flex; flex-direction: column; gap: 8px; }
.seg-item { display: flex; flex-direction: column; gap: 4px; }
.seg-line { display: flex; align-items: center; gap: 8px; }
.seg-time { width: 108px; }
.seg-dash { color: var(--text-3); }
.seg-nextday { display: none; font-size: 11px; color: #92400E; background: #FEF3C7; border: 1px solid #FDE68A; border-radius: 999px; padding: 0 8px; line-height: 18px; }
.seg-line.invalid .seg-time { border-color: var(--danger); }
.seg-error { display: none; font-size: 11.5px; color: var(--danger); }
.seg-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.seg-summary { font-size: 12px; color: var(--text-2); }
.shift-time-note { color: var(--text-3); font-size: 11.5px; margin-left: 2px; }

/* 文本批量添加（人员 / 班次共用弹窗） */
.bulk-head { margin-bottom: 8px; }
.bulk-title { font-size: 13px; color: var(--text-2); font-weight: 500; margin: 0 0 4px; }
.bulk-hint { font-size: 12px; color: var(--text-3); margin: 0; }
.bulk-textarea { width: 100%; font-size: 13px; line-height: 1.8; resize: vertical; }
.bulk-preview { margin-top: 12px; background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius); padding: 10px 12px; display: flex; flex-direction: column; gap: 8px; min-height: 58px; }
.bulk-empty { color: var(--text-3); font-size: 12.5px; padding: 8px 0; text-align: center; }
.bulk-row { display: flex; align-items: flex-start; gap: 8px; flex-wrap: wrap; }
.bulk-dot { width: 8px; height: 8px; border-radius: 50%; margin-top: 6px; flex: 0 0 auto; }
.bulk-label { font-size: 12.5px; font-weight: 500; color: var(--text); line-height: 20px; }
.bulk-items { display: flex; gap: 6px; flex-wrap: wrap; flex: 1; min-width: 0; }
.bulk-chip { display: inline-block; padding: 1px 8px; border-radius: 6px; font-size: 11.5px; line-height: 18px; background: var(--surface); border: 1px solid var(--border-strong); color: var(--text-2); }
.bulk-chip.skip { background: #FEF3C7; border-color: #FDE68A; color: #92400E; }
.bulk-chip.invalid { background: #FCEBEB; border-color: #F7C1C1; color: #A32D2D; }
.bulk-note { font-size: 11.5px; color: var(--text-3); margin-left: 16px; }
.bulk-overflow { font-size: 12px; color: var(--danger); font-weight: 500; }
.bulk-default-note { margin: 10px 0 0; font-size: 11.5px; color: var(--text-3); }

/* position: relative 不能去掉：里面那个隐藏的 input 是绝对定位，缺少定位上下文时会以整个文档为包含块，
   把文档撑高，滚动规则管理页时侧边栏会跟着一起滚动 */
.switch { position: relative; display: inline-flex; align-items: center; gap: 8px; cursor: pointer; user-select: none; }
.switch input { position: absolute; opacity: 0; pointer-events: none; }
.switch-track { width: 36px; height: 20px; border-radius: 999px; background: #D8DCE8; position: relative; transition: background .16s; flex: 0 0 auto; }
.switch-thumb { position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: var(--shadow-sm); transition: transform .16s; }
.switch input:checked + .switch-track { background: var(--primary); }
.switch input:checked + .switch-track .switch-thumb { transform: translateX(16px); }
.switch-label { font-size: 12.5px; color: var(--text-2); }
.switch.small .switch-track { width: 32px; height: 18px; }
.switch.small .switch-thumb { width: 14px; height: 14px; }
.switch.small input:checked + .switch-track .switch-thumb { transform: translateX(14px); }

.checkbox-line { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text-2); cursor: pointer; }
.checkbox-line input { width: 15px; height: 15px; accent-color: var(--primary); }

.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 18px; }
.form-full { grid-column: 1 / -1; }

/* ---------------------------------------------------------------- 卡片 */

.card { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; box-shadow: var(--shadow-sm); overflow: hidden; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 18px; border-bottom: 1px solid var(--border); }
.card-title { font-size: 14.5px; font-weight: 600; }
.card-extra { display: flex; gap: 8px; }
.card-body { padding: 16px 18px; }
.card.flush .card-body { padding: 0; }

.tags { display: flex; gap: 6px; flex-wrap: wrap; }
.tag { display: inline-block; padding: 1px 8px; border-radius: 999px; font-size: 11.5px; background: #EFF1F6; color: var(--text-2); white-space: nowrap; }

.chip {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 1px 7px; border-radius: 6px; font-size: 11.5px; font-weight: 600;
  border: 1px solid var(--border-strong); background: #F3F4F9; color: var(--text-2); white-space: nowrap;
}
.chip-sm { font-size: 11px; padding: 0 5px; }
.chip-rest { background: #EEF1F6; color: #7C8698; border-color: #DFE3EC; }
.chip-empty { background: #F8F9FC; color: #A9B0C2; }

.empty { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 46px 20px; color: var(--text-3); text-align: center; }
.empty-hint { font-size: 12px; }

/* ---------------------------------------------------------------- 工具条 */

.toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.toolbar-spacer { flex: 1; }
.toolbar-hint { font-size: 12px; color: var(--text-3); }
.month-nav { display: inline-flex; align-items: center; gap: 2px; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 3px; }
.month-label { border: 0; background: transparent; font-size: 13.5px; font-weight: 600; padding: 4px 10px; border-radius: 8px; cursor: pointer; color: var(--text); }
.month-label:hover { background: var(--surface-2); }
.today-hint { font-size: 11.5px; color: var(--primary); background: var(--primary-soft); padding: 2px 8px; border-radius: 999px; }

.brush-bar {
  display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
  background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 9px 12px;
}
.brush-label { font-size: 12px; color: var(--text-3); margin-right: 2px; }
.brush-sep { width: 1px; height: 18px; background: var(--border); margin: 0 4px; }
.brush-chip {
  display: inline-flex; align-items: center; gap: 5px;
  border: 1px solid var(--border-strong); background: var(--surface); border-radius: 8px;
  padding: 3px 8px; cursor: pointer; font-size: 12px; color: var(--text-2);
  transition: border-color .14s, background .14s, color .14s;
}
.brush-chip:hover { border-color: var(--primary); color: var(--primary); }
.brush-chip.on {
  background: var(--primary-soft); border-color: var(--primary); color: var(--primary); font-weight: 600;
  box-shadow: 0 0 0 1px var(--primary) inset;
}
.brush-dot { width: 8px; height: 8px; border-radius: 50%; background: #C9CFDE; }
.brush-name { font-weight: 500; }
.brush-count { font-size: 11px; color: var(--text-3); background: #F1F3F8; border-radius: 5px; padding: 0 4px; }
.brush-chip.on .brush-count { background: #fff; color: var(--primary); }

/* ---------------------------------------------------------------- 排班表 */

.sched-wrap { overflow: auto; max-height: calc(100vh - 300px); border: 1px solid var(--border); border-radius: 14px; background: var(--surface); box-shadow: var(--shadow-sm); }
.sched-table { border-collapse: separate; border-spacing: 0; font-size: 12px; width: max-content; min-width: 100%; }
.sched-table th, .sched-table td { border-right: 1px solid var(--border); border-bottom: 1px solid var(--border); text-align: center; padding: 0; }
.sched-table thead th { position: sticky; top: 0; z-index: 3; background: var(--surface-2); height: 46px; font-weight: 500; }
.sched-table thead th.day-col { min-width: 44px; }
.sched-table thead th.weekend { background: #FBF3F4; color: #B45A66; }
.sched-table thead th.today { box-shadow: inset 0 0 0 2px var(--primary); }
.day-num { display: block; font-size: 12.5px; font-weight: 600; line-height: 1.2; }
.day-week { display: block; font-size: 10.5px; color: var(--text-3); }
thead th.weekend .day-week { color: #C0707C; }

.sticky-left { position: sticky; left: 0; z-index: 2; background: var(--surface); text-align: left !important; padding: 6px 10px !important; min-width: 136px; box-shadow: 1px 0 0 var(--border); }
thead .sticky-left { z-index: 6; background: var(--surface-2); }
tfoot .sticky-left { z-index: 5; }

.staff-line { display: flex; align-items: center; gap: 6px; }
.staff-dot { width: 8px; height: 8px; border-radius: 50%; flex: 0 0 auto; }
.staff-cell-name { font-weight: 600; font-size: 12.5px; }
.staff-cell-group { font-size: 10.5px; color: var(--text-3); margin-left: auto; }

.sched-cell { cursor: pointer; height: 38px; position: relative; transition: background .12s; }
.sched-cell.weekend { background: #FCF8F8; }
.sched-cell.today { background: rgba(91, 91, 214, .05); }
.sched-cell:hover { background: var(--primary-soft); }
.cell-inner { display: flex; align-items: center; justify-content: center; gap: 2px; height: 100%; padding: 0 2px; }
.cell-chip { display: inline-block; padding: 1px 6px; border-radius: 6px; font-size: 11px; font-weight: 600; border: 1px solid transparent; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cell-rest { color: #8B92A8; font-size: 11.5px; }
.cell-blank { color: #C7CCDA; }
.cell-lock { position: absolute; top: 2px; right: 2px; color: var(--text-3); }
.sched-cell.locked { background: #FCFCFE; box-shadow: inset 0 0 0 1px #E3E6F0; }
.sched-cell.has-violation { box-shadow: inset 0 0 0 2px rgba(229, 72, 77, .55); }
.sched-cell.has-violation::after { content: ''; position: absolute; top: 2px; left: 2px; width: 5px; height: 5px; border-radius: 50%; background: var(--danger); }
.sched-cell.flash { animation: flash 1.6s ease; }
@keyframes flash { 0%, 100% { background: transparent; } 30% { background: #FFE9C7; } 60% { background: #FFF6E5; } }

.sum-col { min-width: 46px; font-size: 12px; color: var(--text-2); background: var(--surface-2); }
.op-col { min-width: 40px; background: var(--surface-2); }

tfoot .sched-foot td { background: var(--surface-2); height: 34px; font-size: 12px; }
.foot-label { font-size: 12px; color: var(--text-2); font-weight: 600; }
.foot-cell { position: relative; }
.foot-cell.low { color: var(--danger); font-weight: 600; }
.foot-cell.high { color: var(--warn); font-weight: 600; }
.foot-need { font-size: 10px; color: var(--text-3); }

/* ---------------------------------------------------------------- 违规 / 结果 */

.follow-card { border-radius: 14px; }
.violation-list { display: flex; flex-direction: column; gap: 6px; max-height: 260px; overflow: auto; }
.violation-list.compact { max-height: 200px; margin-top: 12px; }
.violation-item { display: flex; align-items: center; gap: 8px; padding: 7px 10px; border-radius: 9px; font-size: 12.5px; background: var(--surface-2); cursor: pointer; }
.violation-item:hover { background: #F1F3F9; }
.violation-item.hard { background: #FEF1F1; color: #B4323A; }
.violation-item.soft { background: #FFF8EC; color: #9A6212; }
.violation-group { border-bottom: 1px dashed var(--border); padding: 10px 0; }
.violation-group:last-child { border-bottom: 0; }
.violation-group-head { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; margin-bottom: 6px; }
.violation-count { color: var(--text-3); font-size: 12px; font-weight: 400; margin-left: auto; }

.metric-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; }
.metric-card { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 14px 16px; display: flex; flex-direction: column; gap: 3px; box-shadow: var(--shadow-sm); }
.metric-label { font-size: 12px; color: var(--text-3); }
.metric-value { font-size: 23px; font-weight: 650; letter-spacing: .4px; }
.metric-hint { font-size: 11.5px; color: var(--text-3); }
.metric-card.good .metric-value { color: var(--good); }
.metric-card.warn .metric-value { color: var(--warn); }
.metric-card.bad .metric-value { color: var(--danger); }

.report-grid { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); gap: 16px; }
.chart-wrap { padding: 16px 18px; }
.day-chart { display: flex; align-items: flex-end; gap: 3px; height: 180px; }
.bar-wrap { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; gap: 4px; min-width: 8px; }
.bar { width: 100%; border-radius: 4px 4px 2px 2px; background: linear-gradient(180deg, #8E8EF0, #6C6CE0); }
.bar.weekend { background: linear-gradient(180deg, #F2B8BE, #E58E97); }
.bar.low { background: linear-gradient(180deg, #F0A9AD, #E5484D); }
.bar-label { font-size: 9.5px; color: var(--text-3); }
.result-ok { display: flex; align-items: center; gap: 8px; padding: 14px; border-radius: 10px; background: #ECFBF4; color: #0C7A55; font-size: 13px; }
.result-more { font-size: 12px; color: var(--text-3); margin-top: 8px; }

/* ---------------------------------------------------------------- 表格 */

.table-wrap { overflow: auto; }
.data-table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 13px; }
.data-table th, .data-table td { text-align: left; padding: 11px 14px; border-bottom: 1px solid var(--border); white-space: nowrap; }
.data-table thead th { background: var(--surface-2); font-weight: 600; font-size: 12.5px; color: var(--text-2); position: sticky; top: 0; z-index: 1; }
.data-table tbody tr:hover { background: var(--surface-2); }
.data-table .row-muted { opacity: .55; }
.data-table .strong { font-weight: 600; }
.data-table .muted { color: var(--text-3); }
.cell-tags { max-width: 320px; white-space: normal; }
.cell-tags .tag { margin: 1px 5px 1px 0; }
.cell-ops { white-space: nowrap; }
.cell-ops .icon-btn + .icon-btn { margin-left: 2px; }
/* 批量勾选删除：首列勾选框 + 选中行高亮 + 顶部工具条 */
.cell-select { width: 38px; padding-right: 2px; }
.cell-select input[type="checkbox"] { width: 15px; height: 15px; accent-color: var(--primary); cursor: pointer; vertical-align: middle; }
.data-table tbody tr.row-selected, .data-table tbody tr.row-selected:hover { background: var(--primary-soft); }
.bulk-bar { display: flex; align-items: center; gap: 8px; padding: 9px 14px; background: var(--primary-soft); border-bottom: 1px solid var(--border); }
.bulk-count { margin-right: auto; font-size: 12.5px; font-weight: 600; color: var(--primary); }
.dist-cell { white-space: normal; max-width: 340px; color: var(--text-2); font-size: 12px; }
.shift-swatch { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 8px; }

/* ---------------------------------------------------------------- 规则 */

.rule-groups { display: flex; flex-direction: column; gap: 18px; }
.rule-group { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 14px 16px; box-shadow: var(--shadow-sm); }
.rule-group-head { display: flex; gap: 10px; align-items: flex-start; margin-bottom: 10px; }
.rule-group-head h3 { font-size: 14px; font-weight: 600; }
.rule-group-head p { font-size: 12px; color: var(--text-3); }
.gen-dot { width: 9px; height: 9px; border-radius: 50%; margin-top: 6px; flex: 0 0 auto; }
.rule-list { display: flex; flex-direction: column; gap: 8px; }
.rule-empty { font-size: 12.5px; color: var(--text-3); padding: 8px 2px; }
.rule-card { display: flex; align-items: flex-start; gap: 12px; padding: 11px 13px; border: 1px solid var(--border); border-radius: 11px; background: var(--surface-2); }
.rule-card.off { opacity: .55; }
.rule-card.focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(91, 91, 214, .12); }
.rule-card-main { flex: 1; min-width: 0; }
.rule-card-line { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.rule-text { font-size: 13.5px; font-weight: 550; }
.rule-card-meta { display: flex; align-items: center; gap: 6px; margin-top: 5px; flex-wrap: wrap; }
.rule-raw { font-size: 11.5px; color: var(--text-3); }
.rule-card-ops { display: flex; align-items: center; gap: 4px; }
.group-badge { font-size: 11px; padding: 1px 7px; border-radius: 999px; }
.level-badge { font-size: 11px; padding: 1px 7px; border-radius: 999px; }
.level-badge.hard { background: #FEECEC; color: #C0392B; }
.level-badge.soft { background: #FFF6E6; color: #A8730F; }

.rule-preview { margin-top: 12px; padding: 10px 12px; border-radius: 10px; background: var(--primary-soft); color: var(--primary-dark); font-size: 13px; font-weight: 550; }
.rule-form { display: flex; flex-direction: column; gap: 12px; }
.rule-form .field { margin: 0; }

.chip-select { display: flex; flex-wrap: wrap; gap: 6px; }
.chip-option { border: 1px solid var(--border-strong); background: var(--surface); border-radius: 8px; padding: 4px 9px; font-size: 12.5px; cursor: pointer; color: var(--text-2); }
/* 悬停态必须是中性的：早期悬停也是紫色边框+紫色文字，与选中态几乎一模一样，
   用户根本无法判断某个 chip 是「被选中了」还是「鼠标刚好在上面」 */
.chip-option:hover { border-color: #C6CBDA; background: var(--surface-2); color: var(--text); }
.chip-option.on { border-color: var(--primary); background: var(--primary-soft); color: var(--primary); font-weight: 600; }

.day-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(34px, 1fr)); gap: 4px; }
.day-cell { border: 1px solid var(--border); background: var(--surface); border-radius: 7px; padding: 4px 0; font-size: 11.5px; cursor: pointer; color: var(--text-2); }
.day-cell:hover { border-color: var(--primary); color: var(--primary); }
.day-cell.on { background: var(--primary); border-color: var(--primary); color: #fff; font-weight: 600; }

/* 「按周几分档」：7 个紧凑数字输入（周一～周日），留空＝沿用基准人数 */
.weekday-counts { display: flex; flex-wrap: wrap; gap: 6px; }
.weekday-count-item { display: flex; flex-direction: column; align-items: center; gap: 3px; }
.weekday-count-label { font-size: 11px; color: var(--text-3); }
.weekday-counts .input { width: 48px; text-align: center; padding: 4px; }

/* ---------------------------------------------------------------- 生成排班 */

.drawer-backdrop { position: fixed; inset: 0; background: rgba(18, 22, 38, .38); display: flex; justify-content: flex-end; opacity: 0; transition: opacity .2s; z-index: 60; }
.drawer-backdrop.in { opacity: 1; }
.drawer-panel { background: var(--surface); height: 100%; width: min(1180px, 96vw); display: flex; flex-direction: column; box-shadow: var(--shadow-lg); transform: translateX(24px); transition: transform .22s; }
.drawer-backdrop.in .drawer-panel { transform: none; }
.drawer-full .drawer-panel, .drawer-panel.drawer-full { width: min(1320px, 98vw); }
.drawer-head { display: flex; align-items: center; gap: 12px; padding: 14px 18px; border-bottom: 1px solid var(--border); }
.drawer-title { display: flex; align-items: center; gap: 9px; color: var(--primary); }
.drawer-title h3 { font-size: 15px; font-weight: 650; color: var(--text); }
.drawer-actions { margin-left: auto; display: flex; gap: 8px; }
.drawer-body { flex: 1; overflow: hidden; display: flex; }

.gen-layout { display: flex; flex: 1; min-height: 0; }
.gen-aside { width: 330px; flex: 0 0 330px; border-right: 1px solid var(--border); display: flex; flex-direction: column; background: var(--surface-2); overflow: hidden; transition: width .18s, flex-basis .18s; }
.gen-layout.aside-collapsed .gen-aside { width: 0; flex-basis: 0; overflow: hidden; border-right: 0; }
.gen-aside-head { padding: 14px 16px 10px; }
.gen-aside-head h3 { font-size: 14px; font-weight: 650; }
.gen-aside-head p { font-size: 11.5px; color: var(--text-3); margin-top: 3px; line-height: 1.5; }
.gen-aside-scroll { flex: 1; overflow: auto; padding: 0 14px 24px; display: flex; flex-direction: column; gap: 16px; }
.gen-section { display: flex; flex-direction: column; gap: 8px; }
.gen-section-head { display: flex; gap: 8px; align-items: flex-start; }
.gen-section-head h4 { font-size: 13px; font-weight: 650; }
.gen-section-head p { font-size: 11px; color: var(--text-3); }
.template-list { display: flex; flex-direction: column; gap: 6px; }
.template-card { display: flex; align-items: center; gap: 8px; border: 1px solid var(--border); background: var(--surface); border-radius: 9px; padding: 7px 10px; font-size: 12.5px; cursor: pointer; text-align: left; color: var(--text); }
.template-card:hover { border-color: var(--primary); color: var(--primary); }
.template-card.big { flex-direction: column; align-items: flex-start; gap: 3px; padding: 12px 14px; }
.template-card-title { font-size: 13.5px; font-weight: 600; }
.template-card-desc { font-size: 12px; color: var(--text-3); }
.template-modal-list { display: flex; flex-direction: column; gap: 8px; }
.template-chip { display: flex; align-items: center; gap: 7px; border: 1px solid var(--border); background: var(--surface); border-radius: 8px; padding: 6px 9px; font-size: 12px; cursor: pointer; color: var(--text-2); text-align: left; }
.template-chip:hover { border-color: var(--chip-color, var(--primary)); color: var(--chip-color, var(--primary)); }
.template-dot { width: 7px; height: 7px; border-radius: 2px; flex: 0 0 auto; }

.gen-main { flex: 1; overflow: auto; padding: 18px 22px 40px; display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.steps { display: flex; align-items: center; gap: 26px; padding-bottom: 14px; border-bottom: 1px solid var(--border); }
.step { display: flex; align-items: center; gap: 8px; border: 0; background: none; color: var(--text-3); cursor: pointer; font-size: 13.5px; padding: 0; }
.step.on { color: var(--primary); font-weight: 600; }
.step.done { color: var(--good); }
.step-num { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; background: #E9EBF3; color: var(--text-2); font-size: 12px; font-weight: 600; }
.step.on .step-num { background: var(--primary); color: #fff; }
.step.done .step-num { background: var(--good); color: #fff; }

.step-body { display: flex; flex-direction: column; gap: 12px; }
.step-hint { font-size: 12.5px; color: var(--text-3); line-height: 1.7; }
.nl-wrap { position: relative; }
.nl-area { width: 100%; min-height: 240px; border: 1px solid var(--border-strong); border-radius: 12px; padding: 13px 14px; font-size: 13.5px; line-height: 1.9; font-family: inherit; resize: vertical; background: var(--surface); color: var(--text); }
.nl-area:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(91, 91, 214, .12); }
.nl-ghost { position: absolute; top: 13px; left: 15px; right: 15px; color: #AAB1C4; font-size: 13.5px; line-height: 1.9; pointer-events: none; white-space: pre-wrap; }
.step-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 4px; }

.parse-list { display: flex; flex-direction: column; gap: 10px; }
.parse-card { display: flex; gap: 12px; padding: 12px 14px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface-2); }
.parse-card.warn { border-color: #F3D6A5; background: #FFFBF3; }
.parse-check { padding-top: 2px; }
.parse-check input { width: 15px; height: 15px; accent-color: var(--primary); }
.parse-main { flex: 1; min-width: 0; }
.parse-line { display: flex; align-items: center; gap: 7px; font-size: 12.5px; color: var(--text-3); }
.parse-raw { color: var(--text-2); }
.parse-card .rule-form { margin-top: 10px; }
.parse-card.collapsed .rule-form, .parse-card.collapsed .rule-preview { display: none; }
.parse-warn { margin-top: 6px; font-size: 12px; color: #A8730F; }
.parse-ops { display: flex; flex-direction: column; gap: 4px; align-items: flex-end; }
.parse-note { font-size: 12px; color: var(--text-3); margin-top: 4px; }

.unknown-box { border: 1px solid #F3D6A5; background: #FFFBF3; border-radius: 12px; padding: 12px 14px; }
.unknown-head { display: flex; align-items: center; gap: 7px; font-size: 12.5px; color: #9A6212; margin-bottom: 6px; }
.unknown-line { font-size: 12.5px; color: #8A6A2A; padding-left: 4px; line-height: 1.9; }

.gen-options { display: flex; gap: 16px; }
.gen-result { display: flex; flex-direction: column; }
.result-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 10px; }
.metric { background: var(--surface-2); border: 1px solid var(--border); border-radius: 11px; padding: 10px 12px; display: flex; flex-direction: column; gap: 2px; }
.metric-label { font-size: 11.5px; color: var(--text-3); }
.metric-value { font-size: 20px; font-weight: 650; }
.metric-unit { font-size: 11.5px; color: var(--text-3); margin-left: 3px; font-weight: 400; }
.metric.bad .metric-value { color: var(--danger); }
.metric.good .metric-value { color: var(--good); }
.metric.warn .metric-value { color: var(--warn); }

/* ---------------------------------------------------------------- 弹层 */

.modal-backdrop { position: fixed; inset: 0; background: rgba(18, 22, 38, .38); display: grid; place-items: center; opacity: 0; transition: opacity .18s; z-index: 70; padding: 24px; }
.modal-backdrop.in { opacity: 1; }
.modal-panel { background: var(--surface); border-radius: 16px; width: min(560px, 100%); max-height: 88vh; display: flex; flex-direction: column; box-shadow: var(--shadow-lg); }
.modal-wide { width: min(920px, 100%); }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 15px 18px; border-bottom: 1px solid var(--border); }
.modal-title { font-size: 15px; font-weight: 650; }
.modal-body { padding: 18px; overflow: auto; }
.modal-footer { display: flex; justify-content: flex-end; gap: 8px; padding: 13px 18px; border-top: 1px solid var(--border); }
.confirm-text { font-size: 13.5px; color: var(--text-2); line-height: 1.8; white-space: pre-line; }

/* 导入确认框：并列展示「文件内容」与「将被覆盖的当前数据」 */
.import-confirm { display: flex; flex-direction: column; gap: 10px; }
.import-block { border: 1px solid var(--border); border-radius: 10px; padding: 9px 11px; background: var(--surface-2); }
.import-block.danger { border-color: #F7C6C6; background: #FEF4F4; }
.import-block-title { font-size: 12px; font-weight: 600; color: var(--text-2); margin-bottom: 3px; }
.import-block.danger .import-block-title { color: #C0392B; }
.import-block-body { font-size: 12.5px; color: var(--text-2); line-height: 1.7; }

.popover { position: fixed; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--shadow-md); z-index: 80; opacity: 0; transform: translateY(-4px); transition: opacity .14s, transform .14s; }
.popover.in { opacity: 1; transform: none; }
.popover-inner { display: flex; flex-direction: column; min-width: 210px; max-height: 420px; }
.popover-menu { padding: 6px; }
.popover-head { padding: 10px 12px; font-size: 12.5px; font-weight: 600; border-bottom: 1px solid var(--border); }
.popover-search { margin: 8px 10px; width: calc(100% - 20px); }
.popover-list { overflow: auto; padding: 4px 6px 6px; display: flex; flex-direction: column; gap: 2px; }
.popover-item { display: flex; align-items: center; gap: 8px; border: 0; background: none; padding: 7px 9px; border-radius: 8px; cursor: pointer; font-size: 13px; text-align: left; color: var(--text); width: 100%; }
.popover-item:hover { background: var(--surface-2); }
.popover-item.on { background: var(--primary-soft); color: var(--primary); font-weight: 600; }
.popover-time { font-size: 11.5px; color: var(--text-3); margin-left: auto; }
.popover-tag { font-size: 11px; color: var(--text-3); }
.popover-foot { border-top: 1px solid var(--border); padding: 5px 6px; display: flex; flex-direction: column; }
.popover-action { display: flex; align-items: center; gap: 7px; border: 0; background: none; padding: 7px 9px; border-radius: 8px; cursor: pointer; font-size: 12.5px; color: var(--text-2); text-align: left; }
.popover-action:hover { background: var(--surface-2); color: var(--text); }
.popover-sep { height: 1px; background: var(--border); margin: 5px 8px; }
.popover-empty { padding: 14px; text-align: center; color: var(--text-3); font-size: 12.5px; }
.popover-note { padding: 6px 9px 2px; font-size: 11.5px; color: var(--text-3); }
.popover-toggle { padding: 5px 9px; }

.toast-root { position: fixed; top: 18px; left: 50%; transform: translateX(-50%); z-index: 99; display: flex; flex-direction: column; gap: 8px; pointer-events: none; }
.toast { display: flex; align-items: center; gap: 8px; background: #22283A; color: #fff; padding: 9px 15px; border-radius: 10px; font-size: 13px; box-shadow: var(--shadow-md); opacity: 0; transform: translateY(-8px); transition: opacity .2s, transform .2s; }
.toast.in { opacity: 1; transform: none; }
.toast-success { background: #10643F; }
.toast-error { background: #8C2B2F; }
/* 容器是 pointer-events: none，可点击的提示必须自己打开 */
.toast-action { pointer-events: auto; cursor: pointer; }
.toast-action:hover .toast-text { text-decoration: underline; }
.svg-icon { display: inline-flex; vertical-align: middle; }

@media (max-width: 1180px) {
  .report-grid { grid-template-columns: 1fr; }
  .gen-aside { width: 260px; flex-basis: 260px; }
}
@media (max-width: 900px) {
  .sidebar { width: 62px; flex-basis: 62px; }
  .brand-text, .nav-item span, .sidebar-bottom .btn span, .sidebar-foot { display: none; }
  .nav-item { justify-content: center; }
  .sidebar-bottom .btn { padding: 7px; }
  .main { padding: 14px; }
  .gen-aside { display: none; }
  .form-grid { grid-template-columns: 1fr; }
}

@media print {
  .sidebar, .page-actions, .toolbar, .brush-bar, .follow-card, .toast-root, .drawer-backdrop, .modal-backdrop { display: none !important; }
  .app-shell { height: auto; overflow: visible; }
  .main { overflow: visible; padding: 0; }
  .sched-wrap { max-height: none; overflow: visible; border: 0; box-shadow: none; }
  .sched-table { font-size: 10px; }
  .sched-table th, .sched-table td { border-color: #ccc; }
  .day-col, .sched-cell { min-width: 30px; }
}
/* 单元格内多个班次 / 简称 / 假期统计 */
.cell-inner.multi { flex-wrap: wrap; gap: 2px; padding: 2px 1px; }
.cell-inner.multi .cell-chip { font-size: 10px; padding: 0 4px; }
.staff-short {
  display: inline-grid; place-items: center; min-width: 18px; height: 18px; padding: 0 4px;
  border-radius: 5px; background: #EEF0F7; color: #4B5468; font-size: 11px; font-weight: 650;
}
.sum-col.accent { color: var(--primary); font-weight: 600; }
.holiday-box { display: flex; flex-direction: column; gap: 10px; padding: 14px 18px; }
.holiday-hint { font-size: 12.5px; color: var(--text-3); }
/* 右侧统计列吸附，避免横向滚动时看不见 */
.sched-table th.sum-col, .sched-table td.sum-col,
.sched-table th.op-col, .sched-table td.op-col { position: sticky; z-index: 2; background: var(--surface-2); }
/* 表头 / 表体 / 页脚都要用同一组 right 偏移，否则横向滚动时表头不会吸附 */
.sched-table :is(th, td).op-col { box-shadow: -1px 0 0 var(--border); }
.sched-table :is(th, td).op-col:nth-last-child(1) { right: 0; }
.sched-table :is(th, td).sum-col:nth-last-child(2) { right: 40px; }
.sched-table :is(th, td).sum-col:nth-last-child(3) { right: 86px; }
.sched-table :is(th, td).sum-col:nth-last-child(4) { right: 132px; }
.sched-table thead th.op-col { z-index: 4; }
.sched-table thead th.sum-col { z-index: 4; }
/* 页脚（在岗人数）吸附底部：表格高度受限时也保持可见 */
.sched-table tfoot .sched-foot td { position: sticky; bottom: 0; z-index: 3; background: var(--surface-2); box-shadow: 0 -1px 0 var(--border); }
.sched-table tfoot td.op-col, .sched-table tfoot td.sum-col { z-index: 4; }

/* ---------------------------------------------------------------- 工具条 / 图例 / 画笔 */
.toolbar-group { display: flex; align-items: center; gap: 2px; }
.icon-btn[disabled] { opacity: .38; cursor: not-allowed; }
.icon-btn[disabled]:hover { background: transparent; color: var(--text-3); }
.sched-wrap.painting-mode .sched-cell { cursor: crosshair; touch-action: none; }

.legend { min-width: 300px; max-width: 400px; max-height: min(72vh, 620px); overflow: auto; }
.legend-section { padding: 10px 12px; border-bottom: 1px solid var(--border); flex: 0 0 auto; }
.legend-title { font-size: 12px; font-weight: 600; color: var(--text-2); margin-bottom: 7px; }
.legend-items { display: flex; flex-direction: column; gap: 6px; }
.legend-item { display: flex; align-items: center; gap: 8px; font-size: 12.5px; }
.legend-sample { width: 24px; flex: 0 0 24px; display: inline-flex; align-items: center; justify-content: center; }
.legend-dot { width: 10px; height: 10px; border-radius: 3px; }
.legend-chips { display: inline-flex; gap: 2px; }
.legend-chips .cell-chip { font-size: 9px; padding: 0 3px; }
.legend-violation { width: 14px; height: 14px; border-radius: 4px; box-shadow: inset 0 0 0 2px rgba(229, 72, 77, .55); }
.legend-desc { color: var(--text-2); }
.legend-note { padding: 10px 12px; font-size: 12px; color: var(--text-3); background: var(--surface-2); line-height: 1.6; }

/* ---------------------------------------------------------------- 移动端（窄屏） */
@media (max-width: 760px) {
  .app-shell { flex-direction: column; }
  .main { order: 1; padding: 12px 12px 16px; }
  .sidebar {
    order: 2;
    width: auto;
    flex: 0 0 auto;
    flex-direction: row;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    border-right: 0;
    border-top: 1px solid var(--border);
    box-shadow: 0 -2px 10px rgba(20, 24, 40, .04);
  }
  .brand { display: none; }
  .nav { flex-direction: row; gap: 2px; flex: 1; min-width: 0; }
  .nav-item { flex-direction: column; gap: 1px; padding: 6px 8px; font-size: 10px; justify-content: center; }
  .nav-item span { display: block; font-size: 10px; }
  .sidebar-bottom { flex-direction: row; margin-top: 0; align-items: center; gap: 4px; }
  .sidebar-bottom .btn, .sidebar-bottom .nav-sep, .sidebar-foot { display: none; }
  .sidebar-bottom .nav-item span { display: none; }

  .view { gap: 12px; }
  .page-title { font-size: 17px; }
  .page-head { flex-direction: column; align-items: stretch; gap: 10px; }
  .page-actions { width: 100%; }
  .page-actions .btn { flex: 1 1 auto; justify-content: center; }
  .toolbar { gap: 8px; }
  .toolbar-hint { display: none; }
  .brush-bar { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 6px; -webkit-overflow-scrolling: touch; }
  .brush-label { width: auto; white-space: nowrap; flex: 0 0 auto; }
  .brush-chip { padding: 3px 7px; flex: 0 0 auto; }
  .brush-sep { flex: 0 0 auto; }

  .sched-wrap { max-height: calc(100vh - 330px); }
  .sticky-left { min-width: 92px; }
  .staff-short { min-width: 16px; height: 16px; font-size: 10px; }
  .staff-cell-name, .staff-cell-group { display: none; }
  .sched-table { font-size: 11.5px; }
  .sched-cell { height: 34px; }
  .cell-chip { font-size: 10px; padding: 0 4px; }

  .data-table th, .data-table td { padding: 8px 10px; font-size: 12.5px; }
  .metric-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .result-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .rule-card { flex-direction: column; gap: 8px; }
  .rule-card-ops { align-self: flex-end; }

  .modal-backdrop { padding: 0; align-items: flex-end; }
  .modal-panel { width: 100%; max-height: 92vh; border-radius: 16px 16px 0 0; }
  .drawer-panel, .drawer-full .drawer-panel { width: 100%; }
  .gen-layout { flex-direction: column; overflow: auto; }
  .gen-aside {
    display: flex;
    width: auto;
    flex-basis: auto;
    max-height: 38vh;
    border-right: 0;
    border-bottom: 1px solid var(--border);
  }
  .gen-layout.aside-collapsed .gen-aside { width: auto; flex-basis: auto; max-height: 0; }
  .gen-main { padding: 14px 14px 40px; }
  .steps { gap: 16px; overflow-x: auto; padding-bottom: 10px; }
  .step span:not(.step-num) { white-space: nowrap; }
  .nl-area { min-height: 160px; }
  .form-grid { grid-template-columns: 1fr; }

  .popover-inner { min-width: 0; max-width: calc(100vw - 24px); }
  .legend { min-width: 0; width: calc(100vw - 32px); max-width: none; max-height: 68vh; }
  .toast-root { top: auto; bottom: 82px; left: 12px; right: 12px; transform: none; width: auto; }
  .toast { justify-content: center; }
}

/* ---------------- 程序内更新（桌面版） ---------------- */
.app-version-row { display: flex; align-items: center; gap: 8px; }
.update-link { border: 0; background: none; color: var(--primary); font-size: 11px; cursor: pointer; padding: 0; display: inline-flex; align-items: center; gap: 4px; }
.update-link:hover { text-decoration: underline; }
.update-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--danger); display: none; }
.update-modal { display: flex; flex-direction: column; gap: 10px; font-size: 13px; }
.update-head { font-size: 14px; font-weight: 600; color: var(--text); }
.update-detail { color: var(--text-2); }
.update-notes { white-space: pre-wrap; line-height: 1.7; color: var(--text-2); background: var(--surface-2); border: 1px solid var(--border); border-radius: 8px; padding: 10px 12px; max-height: 180px; overflow: auto; }
.update-progress { height: 6px; background: var(--border); border-radius: 3px; overflow: hidden; }
.update-bar { height: 100%; width: 0; background: var(--primary); transition: width .2s; }

/* ---------------- 云同步（账号登录 + 上传下载） ---------------- */
.cloud-modal { display: flex; flex-direction: column; gap: 12px; }
.cloud-fields { display: flex; flex-direction: column; gap: 8px; }
.cloud-row { display: flex; gap: 8px; flex-wrap: wrap; }
.cloud-row button { flex: 1; min-width: 140px; }

/* ---------------- 侧边栏云同步状态区（方案 2 常驻） ---------------- */
.cloud-status { display: flex; flex-direction: column; gap: 2px; align-items: flex-start; width: 100%;
  border: 0.5px solid var(--border); background: var(--surface-2); border-radius: 10px;
  padding: 8px 12px; cursor: pointer; text-align: left; }
.cloud-status:hover { border-color: var(--primary); }
.cloud-status-head { font-size: 12.5px; font-weight: 600; color: var(--text); }
.cloud-status-line { font-size: 11px; color: var(--text-3); }
.cloud-status.logged .cloud-status-head { color: var(--primary); }

/* ---------------- 意见反馈弹窗 ---------------- */
.feedback-body { display: flex; flex-direction: column; gap: 16px; }
.feedback-field { display: flex; flex-direction: column; gap: 8px; }
.feedback-label { font-size: 12.5px; font-weight: 600; color: var(--text-2); }
.feedback-types { display: flex; gap: 8px; flex-wrap: wrap; }
.feedback-type {
  display: flex; flex-direction: column; gap: 2px; align-items: flex-start;
  border: 1px solid var(--border); background: var(--surface-2); border-radius: 10px;
  padding: 8px 12px; cursor: pointer; text-align: left; transition: border-color .15s, background .15s;
}
.feedback-type:hover { border-color: var(--border-2); }
.feedback-type.active { border-color: var(--primary); background: var(--primary-soft, #E6F1FB); }
.feedback-type-label { font-size: 13px; color: var(--text); }
.feedback-type.active .feedback-type-label { color: var(--primary); font-weight: 600; }
.feedback-type-hint { font-size: 11px; color: var(--text-3); }
.feedback-text {
  width: 100%; min-height: 120px; padding: 10px 12px; font-size: 13px; line-height: 1.6;
  border: 1px solid var(--border); border-radius: 10px; background: var(--surface-2);
  color: var(--text); resize: vertical; outline: none; font-family: inherit;
}
.feedback-text:focus { border-color: var(--primary); background: var(--surface); }
.feedback-counter { font-size: 11px; color: var(--text-3); text-align: right; }
.feedback-shots { display: flex; gap: 10px; flex-wrap: wrap; }
.feedback-shot { position: relative; }
.feedback-shot img { width: 110px; height: 74px; object-fit: cover; border-radius: 8px; border: 1px solid var(--border); display: block; }
.feedback-shot-del {
  position: absolute; top: -6px; right: -6px; width: 20px; height: 20px; border-radius: 50%;
  border: 1px solid var(--border-2); background: var(--surface); color: var(--text-2);
  font-size: 13px; line-height: 1; cursor: pointer; padding: 0;
}
.feedback-shot-add {
  width: 110px; height: 74px; border: 1px dashed var(--border-2); border-radius: 8px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px;
  cursor: pointer; background: var(--surface-2); color: var(--text-2); font-size: 12px;
}
.feedback-shot-add:hover { border-color: var(--primary); color: var(--primary); }
.feedback-shot-tip { font-size: 10.5px; color: var(--text-3); }
.feedback-diag { border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; background: var(--surface-2); }
.feedback-diag summary { font-size: 12px; color: var(--text-2); cursor: pointer; }
.feedback-diag-grid { display: grid; grid-template-columns: auto 1fr; gap: 4px 12px; margin-top: 10px; font-size: 12px; }
.feedback-diag-row { display: contents; }
.feedback-diag-row .k { color: var(--text-3); }
.feedback-diag-row .v { color: var(--text-2); }
.feedback-actions { display: flex; align-items: center; gap: 14px; padding-top: 4px; }
.feedback-actions .btn-link { background: none; border: 0; color: var(--primary); font-size: 12.5px; cursor: pointer; padding: 0; }
.feedback-actions .btn-link:hover { text-decoration: underline; }
.feedback-loading, .feedback-empty { padding: 28px 0; text-align: center; color: var(--text-3); font-size: 13px; }
.feedback-list-head { display: flex; align-items: center; justify-content: space-between; font-size: 12.5px; color: var(--text-2); font-weight: 600; }
.feedback-list-head .btn-link { background: none; border: 0; color: var(--primary); font-size: 12.5px; cursor: pointer; font-weight: 400; }
.feedback-items { display: flex; flex-direction: column; gap: 10px; }
.feedback-item { border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; background: var(--surface-2); }
.feedback-item-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
.feedback-item-time { font-size: 11.5px; color: var(--text-3); }
.feedback-item-text { font-size: 13px; color: var(--text); white-space: pre-wrap; word-break: break-word; }
.feedback-item-note { margin-top: 8px; font-size: 12px; color: var(--text-2); background: var(--surface); border-left: 2px solid var(--border-2); padding: 6px 10px; border-radius: 0 6px 6px 0; }
.feedback-status { font-size: 11px; padding: 1px 8px; border-radius: 999px; white-space: nowrap; }
.feedback-status.pending { background: #FAEEDA; color: #854F0B; }
.feedback-status.approved, .feedback-status.processing { background: #E6F1FB; color: #185FA5; }
.feedback-status.done, .feedback-status.released { background: #E1F5EE; color: #0F6E56; }
.feedback-status.rejected { background: #FCEBEB; color: #A32D2D; }
.feedback-status.duplicate { background: #F1EFE8; color: #5F5E5A; }
.feedback-status.need-info { background: #FAEEDA; color: #854F0B; }
