/* ===== 徽山喜 · 多任务工作台 ===== */
:root {
  --bg: #f5f6f8;
  --panel: #ffffff;
  --panel-2: #fbfcfd;
  --line: #e3e7ed;
  --line-2: #eef1f5;
  --text: #1c2530;
  --text-2: #5a6875;
  --text-3: #8b97a5;
  --brand: #0f766e;
  --brand-2: #14b8a6;
  --brand-soft: #e6f5f3;
  --accent: #d97706;
  --accent-soft: #fdf3e3;
  --up: #d92d20;
  --up-soft: #fdeceb;
  --down: #0f9d58;
  --down-soft: #e8f6ee;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .06), 0 8px 24px -12px rgba(16, 24, 40, .14);
  --mono: "JetBrains Mono", "Cascadia Mono", Consolas, "Courier New", monospace;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html, body {
  height: 100%;
  font-family: "PingFang SC", "Microsoft YaHei", "Segoe UI", system-ui, sans-serif;
  font-size: 14px;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

button, input, select, textarea { font-family: inherit; font-size: inherit; color: inherit; }
a { color: var(--brand); }
::-webkit-scrollbar { width: 9px; height: 9px; }
::-webkit-scrollbar-thumb { background: #ccd3dc; border-radius: 5px; }
::-webkit-scrollbar-thumb:hover { background: #b3bcc8; }
::-webkit-scrollbar-track { background: transparent; }

/* ---------- 外壳 ---------- */
#app { display: flex; flex-direction: column; height: 100vh; }

.topbar {
  display: flex; align-items: center; gap: 18px;
  padding: 0 20px; height: 56px; flex: none;
  background: var(--panel); border-bottom: 1px solid var(--line);
  box-shadow: 0 1px 3px rgba(16, 24, 40, .04); z-index: 20;
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 16px; letter-spacing: .4px; white-space: nowrap; }
.brand .logo {
  width: 28px; height: 28px; border-radius: 8px; flex: none;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  color: #fff; display: flex; align-items: center; justify-content: center; font-size: 15px;
}
.brand small { font-weight: 400; color: var(--text-3); font-size: 12px; letter-spacing: 0; margin-left: 2px; }

.tabs { display: flex; gap: 2px; background: var(--bg); padding: 3px; border-radius: 10px; }
.tabs button {
  border: 0; background: transparent; padding: 7px 15px; border-radius: 8px;
  cursor: pointer; color: var(--text-2); font-size: 13.5px; transition: .16s; white-space: nowrap;
}
.tabs button:hover { color: var(--text); }
.tabs button.on { background: var(--panel); color: var(--brand); font-weight: 600; box-shadow: 0 1px 3px rgba(16, 24, 40, .1); }

.topbar .right { margin-left: auto; display: flex; align-items: center; gap: 10px; font-size: 12.5px; color: var(--text-3); }

main { flex: 1; overflow: auto; position: relative; }
.view { display: none; }
.view.on { display: block; }

/* ---------- 通用控件 ---------- */
.btn {
  border: 1px solid var(--line); background: var(--panel); color: var(--text);
  padding: 7px 14px; border-radius: 8px; cursor: pointer; font-size: 13px; transition: .16s;
  display: inline-flex; align-items: center; gap: 6px; white-space: nowrap;
}
.btn:hover { border-color: #c9d1da; background: var(--panel-2); }
.btn.primary { background: var(--brand); border-color: var(--brand); color: #fff; font-weight: 600; }
.btn.primary:hover { background: #0c655e; }
.btn.ghost { border-color: transparent; background: transparent; color: var(--text-2); }
.btn.ghost:hover { background: var(--bg); }
.btn.danger { color: var(--up); border-color: #f5cdc9; }
.btn.danger:hover { background: var(--up-soft); }
.btn.sm { padding: 4px 9px; font-size: 12px; border-radius: 6px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

input[type=text], input[type=number], input[type=date], input[type=password], select, textarea {
  border: 1px solid var(--line); background: var(--panel); border-radius: 8px;
  padding: 7px 10px; outline: none; transition: .16s; width: 100%;
}
input:focus, select:focus, textarea:focus { border-color: var(--brand-2); box-shadow: 0 0 0 3px var(--brand-soft); }
textarea { resize: vertical; line-height: 1.6; }
label.fld { display: block; }
label.fld > span { display: block; font-size: 12.5px; color: var(--text-2); margin-bottom: 5px; }
label.fld > span i { color: var(--up); font-style: normal; }

.tag { display: inline-block; padding: 1px 7px; border-radius: 5px; font-size: 11.5px; line-height: 18px; background: var(--bg); color: var(--text-2); }
.tag.new { background: var(--accent-soft); color: var(--accent); }
.tag.rep { background: var(--brand-soft); color: var(--brand); }
.tag.edit { background: #eef2ff; color: #4f46e5; }
.tag.ai { background: #fdf2f8; color: #be185d; }
.tag.self { background: #f1f5f9; color: #64748b; }

.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.pad { padding: 16px 18px; }
.muted { color: var(--text-3); }
.num { font-family: var(--mono); font-variant-numeric: tabular-nums; }

/* ---------- 大屏 ---------- */
#view-dash { background: #0a1220; min-height: 100%; padding: 16px 20px 24px; }
#view-dash::before {
  content: ""; position: fixed; inset: 0; pointer-events: none;
  background: radial-gradient(1100px 520px at 50% -8%, #12305a 0%, transparent 60%);
}
.dash-head { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; position: relative; }
.dash-head h1 { font-size: 21px; letter-spacing: 2.5px; color: #fff; text-shadow: 0 0 18px rgba(47, 216, 255, .5); font-weight: 700; }
.dash-head .sub { font-size: 12.5px; color: #7fa8d9; }
.dash-head .sub b { color: #2fd8ff; }
.dash-ctl { margin-left: auto; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.dash-ctl input[type=date] {
  background: rgba(20, 40, 70, .75); border: 1px solid rgba(64, 160, 255, .3); color: #dceaff;
  padding: 6px 9px; width: 138px; border-radius: 8px; font-size: 12.5px;
}
.dash-ctl input[type=date]::-webkit-calendar-picker-indicator { filter: invert(.7); }
.dbtn {
  border: 1px solid rgba(64, 160, 255, .35); background: rgba(20, 40, 70, .6); color: #9cc4f0;
  padding: 6px 12px; border-radius: 8px; cursor: pointer; font-size: 12.5px; transition: .16s;
}
.dbtn:hover { color: #2fd8ff; border-color: #2fd8ff; }
.dbtn.on { background: linear-gradient(90deg, #1c62d9, #2fd8ff); color: #04101f; font-weight: 700; border-color: transparent; }

.dash-kpis { display: grid; grid-template-columns: repeat(8, 1fr); gap: 11px; margin-top: 13px; position: relative; }
.dk {
  background: rgba(20, 40, 70, .45); border: 1px solid rgba(64, 160, 255, .25);
  border-radius: 11px; padding: 11px 13px; position: relative; overflow: hidden; backdrop-filter: blur(4px);
}
.dk::before { content: ""; position: absolute; left: 0; top: 0; width: 100%; height: 2px; background: linear-gradient(90deg, transparent, #2fd8ff, transparent); }
.dk .l { font-size: 11.5px; color: #8fb3e0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dk .v { font-size: 24px; font-weight: 700; margin-top: 5px; font-family: var(--mono); color: #2fd8ff; line-height: 1.12; }
.dk .v small { font-size: 11.5px; color: #7fa8d9; margin-left: 3px; font-weight: 400; }
.dk.g .v { color: #ffc53d; }
.dk.b .v { color: #4f8bff; }
.dk.n .v { color: #36d399; }
.dk.r .v { color: #ff8f6b; }
.dk .note { font-size: 10.5px; color: #5f83b3; margin-top: 3px; }

.dash-grid { display: grid; grid-template-columns: repeat(12, 1fr); gap: 11px; margin-top: 11px; position: relative; }
.dcard {
  background: rgba(20, 40, 70, .45); border: 1px solid rgba(64, 160, 255, .25);
  border-radius: 11px; padding: 11px 13px; backdrop-filter: blur(4px);
}
.dcard h3 { font-size: 13.5px; color: #bcd6f5; font-weight: 600; margin-bottom: 6px; }
.dcard h3 small { color: #5f83b3; font-weight: 400; margin-left: 7px; font-size: 11px; }
.dcard .chart { width: 100%; height: 268px; }
.span12 { grid-column: span 12; } .span7 { grid-column: span 7; } .span5 { grid-column: span 5; }
.span4 { grid-column: span 4; } .span3 { grid-column: span 3; } .span6 { grid-column: span 6; }

.dtable { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.dtable th { color: #7fa8d9; font-weight: 500; text-align: left; padding: 6px 8px; border-bottom: 1px solid rgba(64, 160, 255, .2); font-size: 11.5px; }
.dtable td { color: #cfe3fb; padding: 6px 8px; border-bottom: 1px solid rgba(64, 160, 255, .09); }
.dtable tr:hover td { background: rgba(47, 216, 255, .07); }
.dtable td.n { font-family: var(--mono); text-align: right; }
.dtable th.n { text-align: right; }
.dtable .rank { color: #ffc53d; font-weight: 700; }

.dash-foot { margin-top: 12px; font-size: 11px; color: #4f6f9e; text-align: center; line-height: 1.9; position: relative; }

/* ---------- 录入 ---------- */
.wrap { max-width: 1280px; margin: 0 auto; padding: 20px; }
.page-head { display: flex; align-items: baseline; gap: 10px; margin-bottom: 16px; }
.page-head h2 { font-size: 18px; font-weight: 700; }
.page-head p { color: var(--text-3); font-size: 13px; }

.cols { display: grid; grid-template-columns: minmax(0, 400px) minmax(0, 1fr); gap: 16px; align-items: start; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form-grid .full { grid-column: 1 / -1; }
.hint { font-size: 11.5px; color: var(--text-3); margin-top: 4px; line-height: 1.6; }

.preview { margin-top: 14px; padding: 12px 14px; background: var(--panel-2); border: 1px dashed var(--line); border-radius: 10px; }
.preview h4 { font-size: 12px; color: var(--text-2); font-weight: 500; margin-bottom: 9px; }
.pv-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 9px; }
.pv-grid div { font-size: 12px; color: var(--text-3); }
.pv-grid div b { display: block; color: var(--text); font-size: 14px; font-family: var(--mono); margin-top: 2px; font-weight: 600; }

.ac-wrap { position: relative; }
.ac-list {
  position: absolute; top: calc(100% + 4px); left: 0; right: 0; z-index: 30;
  background: var(--panel); border: 1px solid var(--line); border-radius: 9px;
  box-shadow: 0 12px 32px -8px rgba(16, 24, 40, .22); max-height: 240px; overflow: auto; display: none;
}
.ac-list.on { display: block; }
.ac-list div { padding: 8px 11px; cursor: pointer; font-size: 13px; display: flex; justify-content: space-between; gap: 10px; }
.ac-list div:hover, .ac-list div.hl { background: var(--brand-soft); }
.ac-list div span { color: var(--text-3); font-size: 11.5px; white-space: nowrap; }
.ac-list div em { font-style: normal; color: var(--accent); }

.quick-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 14px; }
.qs { background: var(--panel-2); border: 1px solid var(--line-2); border-radius: 10px; padding: 10px 12px; }
.qs .l { font-size: 11.5px; color: var(--text-3); }
.qs .v { font-size: 19px; font-weight: 700; font-family: var(--mono); margin-top: 2px; }
.qs .v small { font-size: 11px; color: var(--text-3); font-weight: 400; margin-left: 2px; }

.tbl-wrap { overflow: auto; max-height: 640px; }
table.grid { width: 100%; border-collapse: collapse; font-size: 12.8px; }
table.grid th {
  background: var(--panel-2); color: var(--text-2); font-weight: 500; text-align: left;
  padding: 8px 10px; border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 2; font-size: 12px; white-space: nowrap;
}
table.grid td { padding: 7px 10px; border-bottom: 1px solid var(--line-2); white-space: nowrap; }
table.grid tbody tr:hover td { background: var(--panel-2); }
table.grid td.n { font-family: var(--mono); text-align: right; }
table.grid th.n { text-align: right; }
table.grid tr.mine td:first-child { border-left: 3px solid var(--brand-2); }

.pager { display: flex; align-items: center; gap: 8px; padding: 11px 2px 2px; font-size: 12.5px; color: var(--text-3); }
.pager .btn { margin-left: auto; }

/* ---------- 图片工坊 ---------- */
.studio { display: grid; grid-template-columns: 232px minmax(0, 1fr) 268px; gap: 14px; height: calc(100vh - 56px - 40px); }
.studio .side { display: flex; flex-direction: column; overflow: hidden; }
.studio .side > .hd { padding: 11px 13px; border-bottom: 1px solid var(--line); font-size: 13px; font-weight: 600; display: flex; align-items: center; gap: 8px; }
.studio .side > .bd { flex: 1; overflow: auto; padding: 12px 13px; }

.lib { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.lib .it { border: 2px solid transparent; border-radius: 8px; overflow: hidden; cursor: pointer; position: relative; background: var(--bg); }
.lib .it:hover { border-color: #b6e3dd; }
.lib .it.on { border-color: var(--brand-2); }
.lib .it img { width: 100%; aspect-ratio: 1; object-fit: cover; display: block; }
.lib .it .nm { font-size: 10.5px; color: var(--text-3); padding: 3px 5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.drop {
  border: 1.5px dashed #c3ccd6; border-radius: 10px; padding: 16px 10px; text-align: center;
  color: var(--text-3); font-size: 12.5px; cursor: pointer; transition: .16s; margin-bottom: 12px; line-height: 1.8;
}
.drop:hover, .drop.on { border-color: var(--brand-2); background: var(--brand-soft); color: var(--brand); }

.stage { display: flex; flex-direction: column; overflow: hidden; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.stage .hd { padding: 9px 13px; border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.stage .cv { flex: 1; overflow: auto; display: flex; align-items: center; justify-content: center; background:
  linear-gradient(45deg, #f0f2f5 25%, transparent 25%, transparent 75%, #f0f2f5 75%),
  linear-gradient(45deg, #f0f2f5 25%, #fff 25%, #fff 75%, #f0f2f5 75%);
  background-size: 20px 20px; background-position: 0 0, 10px 10px; padding: 18px; }
.stage .cv canvas { box-shadow: 0 4px 24px -6px rgba(16, 24, 40, .3); max-width: 100%; }
.stage .ft { padding: 9px 13px; border-top: 1px solid var(--line); display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

.tool-sec { border-bottom: 1px solid var(--line-2); padding: 11px 0; }
.tool-sec:last-child { border-bottom: 0; }
.tool-sec > h4 { font-size: 12.5px; color: var(--text-2); font-weight: 600; margin-bottom: 9px; display: flex; align-items: center; gap: 6px; }
.tool-row { display: flex; gap: 6px; flex-wrap: wrap; }
.tool-row .btn { flex: 1; justify-content: center; min-width: 56px; }
.slider { margin-bottom: 10px; }
.slider .hd2 { display: flex; justify-content: space-between; font-size: 12px; color: var(--text-2); margin-bottom: 4px; }
.slider .hd2 b { font-family: var(--mono); color: var(--brand); font-weight: 600; }
input[type=range] { width: 100%; -webkit-appearance: none; height: 4px; background: var(--line); border-radius: 2px; outline: none; }
input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; width: 14px; height: 14px; border-radius: 50%; background: var(--brand-2); cursor: pointer; border: 2px solid #fff; box-shadow: 0 1px 4px rgba(0, 0, 0, .2); }

.presets { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 6px; }
.presets button { padding: 7px 4px; border-radius: 7px; border: 1px solid var(--line); background: var(--panel); cursor: pointer; font-size: 11.5px; transition: .16s; }
.presets button:hover { border-color: var(--brand-2); color: var(--brand); }
.prompt-lib { display: flex; flex-direction: column; gap: 6px; }
.prompt-lib button {
  text-align: left; padding: 8px 10px; border-radius: 8px; border: 1px solid var(--line);
  background: var(--panel); cursor: pointer; font-size: 12px; line-height: 1.5; transition: .16s;
}
.prompt-lib button:hover { border-color: var(--brand-2); background: var(--brand-soft); }
.prompt-lib button b { display: block; color: var(--text); margin-bottom: 2px; font-size: 12px; }
.prompt-lib button span { color: var(--text-3); font-size: 11.5px; display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- 设置 ---------- */
.set-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; align-items: start; }
.set-row { display: flex; gap: 8px; align-items: flex-end; }
.set-row > * { flex: 1; }
.set-row > .btn { flex: none; }
.kv { display: flex; justify-content: space-between; gap: 12px; padding: 7px 0; border-bottom: 1px dashed var(--line-2); font-size: 12.5px; }
.kv:last-child { border-bottom: 0; }
.kv span { color: var(--text-3); }
.kv b { font-weight: 500; word-break: break-all; text-align: right; }
.cand { display: flex; align-items: center; gap: 8px; padding: 7px 9px; border-radius: 8px; border: 1px solid var(--line-2); margin-bottom: 6px; font-size: 12.5px; }
.cand b { flex: 1; font-weight: 500; word-break: break-all; }
.cand.on { border-color: var(--brand-2); background: var(--brand-soft); }

/* ---------- toast / 弹层 ---------- */
#toast { position: fixed; right: 20px; bottom: 20px; z-index: 200; display: flex; flex-direction: column; gap: 8px; align-items: flex-end; }
.toast {
  background: #1c2530; color: #fff; padding: 10px 15px; border-radius: 9px; font-size: 13px;
  box-shadow: 0 10px 30px -8px rgba(0, 0, 0, .4); animation: tin .22s ease; max-width: 380px; line-height: 1.5;
}
.toast.ok { background: #0f766e; }
.toast.err { background: #b42318; }
@keyframes tin { from { opacity: 0; transform: translateY(8px); } }

.modal { position: fixed; inset: 0; background: rgba(16, 24, 40, .5); z-index: 150; display: none; align-items: center; justify-content: center; padding: 24px; }
.modal.on { display: flex; }
.modal .box { background: var(--panel); border-radius: 14px; max-width: 720px; width: 100%; max-height: 84vh; overflow: auto; box-shadow: 0 24px 60px -12px rgba(0, 0, 0, .4); }
.modal .box .hd { padding: 15px 20px; border-bottom: 1px solid var(--line); font-weight: 600; display: flex; align-items: center; gap: 10px; }
.modal .box .bd { padding: 18px 20px; }
.modal .box .ft { padding: 13px 20px; border-top: 1px solid var(--line); display: flex; gap: 9px; justify-content: flex-end; }

/* ---------- 页内对话框（自绘，替代浏览器原生 alert/confirm） ---------- */
.uidlg { position: fixed; inset: 0; z-index: 600; display: flex; align-items: center; justify-content: center; padding: 24px; }
.uidlg-bg { position: absolute; inset: 0; background: rgba(16, 24, 40, .5); }
.uidlg-box {
  position: relative; background: var(--panel); border-radius: 14px; width: 100%; max-width: 430px;
  max-height: 84vh; overflow: auto; box-shadow: 0 24px 60px -12px rgba(0, 0, 0, .4);
  animation: uin .18s ease;
}
@keyframes uin { from { opacity: 0; transform: translateY(10px) scale(.98); } }
.uidlg-h { padding: 15px 20px; border-bottom: 1px solid var(--line); font-weight: 600; }
.uidlg-msg { padding: 18px 20px; font-size: 13.5px; line-height: 1.8; color: var(--text); word-break: break-word; }
.uidlg-ft { padding: 13px 20px; border-top: 1px solid var(--line); display: flex; gap: 9px; justify-content: flex-end; }
.uidlg-btn { padding: 7px 16px; border-radius: 9px; border: 1px solid var(--line); background: var(--panel); font-size: 13.5px; cursor: pointer; }
.uidlg-btn:hover { border-color: var(--text-3); }
.uidlg-btn.primary { background: var(--brand); border-color: var(--brand); color: #fff; font-weight: 600; }
.uidlg-btn.primary:hover { background: #0c655e; border-color: #0c655e; }
.uidlg-box.ok .uidlg-h { color: var(--brand); }
.uidlg-box.err .uidlg-h { color: #b42318; }
.uidlg-input {
  display: block; width: 100%; margin-top: 12px; padding: 9px 11px;
  border: 1px solid var(--line); border-radius: 9px; background: var(--panel-2);
  font-size: 13.5px; color: var(--text); box-sizing: border-box;
}
.uidlg-input:focus { outline: none; border-color: var(--brand-2); }
.build-tag { font-size: 11.5px; color: var(--text-3); letter-spacing: .2px; }

.empty { text-align: center; color: var(--text-3); padding: 36px 10px; font-size: 13px; line-height: 1.9; }

/* ---------- 用户与权限管理 ---------- */
.userrow { display: flex; align-items: center; gap: 8px; padding: 8px 10px; background: var(--panel-2, rgba(255,255,255,.03)); border: 1px solid var(--line); border-radius: 10px; }
.userrow .uname { font-size: 13.5px; min-width: 72px; }
.userrow .upw { padding: 5px 8px; font-size: 12.5px; }

/* 改密成功后的反馈：整行闪烁 + 按钮变「已改 ✓」（配合 dashboard.js 的 flashRow） */
.userrow.flash { animation: rowFlash 2.6s ease-out; }
@keyframes rowFlash {
  0%   { background: rgba(20, 184, 166, .30); border-color: var(--brand-2); box-shadow: 0 0 0 2px rgba(20, 184, 166, .40); }
  60%  { background: rgba(20, 184, 166, .18); border-color: var(--brand-2); box-shadow: 0 0 0 2px rgba(20, 184, 166, .24); }
  100% { background: var(--panel-2);           border-color: var(--line);    box-shadow: none; }
}
.btn.done, .btn.done:hover, .btn.done:disabled {
  background: var(--brand) !important; border-color: var(--brand) !important;
  color: #fff !important; opacity: 1 !important; cursor: default;
}
.spin { display: inline-block; width: 13px; height: 13px; border: 2px solid rgba(255, 255, 255, .4); border-top-color: #fff; border-radius: 50%; animation: sp .7s linear infinite; }
@keyframes sp { to { transform: rotate(360deg); } }

/* ---------- 手机版入口 ---------- */
.btn.mob { background: var(--brand-soft); border-color: #b7e2dd; color: var(--brand); font-weight: 600; }
.btn.mob:hover { background: #d8efec; border-color: var(--brand-2); }
.qrcard {
  display: flex; gap: 16px; align-items: center; padding: 14px;
  border: 1px solid var(--line); border-radius: 12px; margin-bottom: 10px; background: var(--panel-2);
}
.qrcard.best { border-color: var(--brand-2); background: var(--brand-soft); }
.qrimg { flex: none; width: 148px; height: 148px; background: #fff; border-radius: 8px; padding: 4px; display: flex; align-items: center; justify-content: center; }
.qrimg img, .qrimg canvas { width: 100%; height: 100%; display: block; }
.qrinfo { min-width: 0; flex: 1; }
.qrip { font-family: var(--mono); font-size: 18px; font-weight: 700; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.qrurl { font-family: var(--mono); font-size: 12.5px; color: var(--brand); word-break: break-all; margin: 7px 0 10px; }
.qractions { display: flex; gap: 8px; }
.note-box { border-left: 3px solid var(--brand-2); background: var(--panel-2); padding: 10px 13px; border-radius: 0 9px 9px 0; font-size: 12.5px; color: var(--text-2); line-height: 1.9; margin-top: 10px; }
.note-box b { display: block; color: var(--text); margin-bottom: 3px; }
.note-box.warn { border-left-color: var(--accent); }

@media (max-width: 1400px) {
  .dash-kpis { grid-template-columns: repeat(4, 1fr); }
  .span7, .span5, .span4, .span3, .span6 { grid-column: span 6; }
  .studio { grid-template-columns: 210px minmax(0, 1fr) 240px; }
}
@media (max-width: 1080px) {
  .cols, .set-grid { grid-template-columns: 1fr; }
  .studio { grid-template-columns: 1fr; height: auto; }
  .studio .side { max-height: 320px; }
}

/* ================= 发布中心 ================= */
.p-imgs { display: grid; grid-template-columns: repeat(auto-fill, minmax(86px, 1fr)); gap: 8px; max-height: 170px; overflow: auto; margin-top: 8px; }
.p-imgs .pim { position: relative; border-radius: 8px; overflow: hidden; cursor: pointer; border: 2px solid transparent; transition: .16s; }
.p-imgs .pim:hover { border-color: #9fd8d0; }
.p-imgs .pim.on { border-color: var(--brand-2); }
.p-imgs .pim img { width: 100%; height: 64px; object-fit: cover; display: block; }
.p-imgs .pim .mk { position: absolute; right: 3px; top: 3px; width: 16px; height: 16px; border-radius: 50%; background: rgba(0,0,0,.5); color: #fff; font-size: 11px; line-height: 16px; text-align: center; }
.p-imgs .pim.on .mk { background: var(--brand-2); }
.p-chip { cursor: pointer; font-size: 12px; padding: 3px 10px; border-radius: 999px; background: var(--brand-soft); color: var(--brand); border: 1px solid rgba(15,118,110,.22); transition: .16s; }
.p-chip:hover { background: #d5efeb; }
.p-item { border: 1px solid var(--line); background: var(--panel); border-radius: 10px; padding: 10px 12px; transition: .16s; }
.p-item:hover { border-color: #cfd8e2; background: var(--panel-2); }
.p-item .t { font-weight: 600; font-size: 13px; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.p-item .m { font-size: 11.5px; color: var(--text-3); margin-top: 4px; display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.p-item .ops { margin-left: auto; display: flex; gap: 6px; }
.p-preview { white-space: pre-wrap; font-size: 13.5px; line-height: 1.7; color: var(--text); background: var(--panel-2); border: 1px solid var(--line-2); border-radius: 10px; padding: 11px 13px; max-height: 220px; overflow: auto; }
.tag.pub-ok { background: rgba(16,152,105,.14); color: #067a52; }
.tag.pub-draft { background: rgba(90,104,117,.12); color: var(--text-2); }

/* ================= 视频文案生成 ================= */
.vc-card { margin-top: 18px; }
.vc-card.dropping { border-color: var(--brand-2); box-shadow: 0 0 0 3px var(--brand-soft); }
.vc-head { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.vc-head h3 { font-size: 15px; font-weight: 600; }
.vc-head h3 small { color: var(--text-3); font-weight: 400; font-size: 12px; margin-left: 6px; }
.vc-head .hint { margin: 0 0 0 auto; text-align: right; }

.vc-cols { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr); gap: 20px; align-items: start; }
.vc-l { min-width: 0; }
.vc-drop {
  margin-top: 10px; border: 1.5px dashed #c3ccd6; border-radius: 12px; padding: 16px 14px; text-align: center;
  background: var(--panel-2); color: var(--text-2); font-size: 13px; line-height: 1.7; transition: .16s;
}
.vc-drop span { display: block; font-size: 11.5px; color: var(--text-3); margin-top: 2px; }
.vc-card.dropping .vc-drop { border-color: var(--brand-2); background: var(--brand-soft); color: var(--brand); }

#vcCard .p-imgs { grid-template-columns: repeat(auto-fill, minmax(126px, 1fr)); gap: 10px; max-height: 300px; margin-top: 12px; }
#vcCard .p-imgs:empty::after { content: '选择视频后，这里会显示自动截取的 5 张关键帧'; font-size: 12.5px; color: var(--text-3); grid-column: 1 / -1; padding: 6px 0; }
#vcCard .p-imgs .pim img { height: 96px; }
#vcCard .p-imgs .pim .mk { width: 19px; height: 19px; line-height: 19px; font-size: 12px; }
#vcCard .tool-row .btn { flex: none; }

.vc-out { display: grid; grid-template-columns: 1fr; gap: 14px; align-content: start; }
@media (min-width: 1380px) { .vc-out { grid-template-columns: 1fr 1fr; } }
.vc-placeholder {
  border: 1px dashed var(--line); border-radius: 12px; padding: 26px 22px;
  background: var(--panel-2); color: var(--text-3); font-size: 12.5px; line-height: 1.95;
}
.vc-res { background: var(--panel-2); border: 1px solid var(--line); border-radius: 12px; padding: 16px 18px; }
.vc-res h4 { font-size: 14.5px; margin: 0 0 11px; color: var(--text); display: flex; align-items: baseline; gap: 8px; }
.vc-res h4 small { color: var(--text-3); font-size: 11.5px; font-weight: 400; }
.vc-line { display: flex; gap: 10px; margin-bottom: 9px; font-size: 13.5px; }
.vc-line span { flex: none; width: 32px; color: var(--text-3); font-weight: 500; padding-top: 1px; }
.vc-line b { font-weight: 500; color: #1c2530; word-break: break-word; line-height: 1.6; }
.vc-line b.pre { font-weight: 400; color: #33404f; white-space: pre-wrap; line-height: 1.78; }
.vc-err { color: var(--up); margin-top: 8px; min-height: 17px; }

/* ================= 全局细节打磨 ================= */
.btn:active { transform: translateY(1px); }
.btn:focus-visible, .dbtn:focus-visible, .tabs button:focus-visible { outline: 2px solid var(--brand-2); outline-offset: 2px; }
.card { transition: box-shadow .18s ease; }
.page-head { flex-wrap: wrap; }
.page-head h2 { font-size: 19px; letter-spacing: .3px; }
.tag { font-weight: 500; }
table.grid tbody tr { transition: background .14s ease; }
input::placeholder, textarea::placeholder { color: #a7b1bd; }
main { scroll-behavior: smooth; }
.btn.vc-regen { border-style: dashed; background: transparent; color: var(--text-2); }
.btn.vc-regen:hover { background: var(--panel-2); border-color: var(--brand); color: var(--brand); }

/* ================= 数据查询页 ================= */
.qbar { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.qbar .full { grid-column: 1 / -1; }
@media (max-width: 900px) { .qbar { grid-template-columns: 1fr 1fr; } }
.qsum { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 10px; margin-top: 14px; }
@media (max-width: 900px) { .qsum { grid-template-columns: repeat(2, 1fr); } }

/* ================= 小屏笔记本适配（125%/150% 缩放、≤1280 视口） ================= */
@media (max-width: 1280px) {
  .topbar { gap: 10px; padding: 0 14px; }
  .brand { font-size: 15px; }
  .brand small { display: none; }
  .tabs button { padding: 7px 11px; font-size: 13px; }
  #clock { display: none; }
}

@media (max-width: 1120px) {
  /* 顶栏允许换行：第一行 品牌+右侧按钮组，第二行 标签页（可横滑） */
  .topbar { flex-wrap: wrap; height: auto; min-height: 56px; padding: 7px 14px; row-gap: 6px; }
  .tabs { order: 3; flex: 1 1 100%; overflow-x: auto; scrollbar-width: thin; }
  .tabs button { flex: none; }
  .topbar .right { margin-left: auto; }
  .studio { height: auto; }
  .stage .cv { min-height: 420px; }
}

@media (max-width: 1080px) {
  /* 大屏图表卡：窄屏一律整行铺满，避免半宽挤压 */
  .span7, .span5, .span4, .span3, .span6 { grid-column: span 12; }
  .dash-grid .dcard .chart { height: 240px; }
  .vc-cols { grid-template-columns: 1fr; }
}

@media (max-width: 860px) {
  .dash-kpis { grid-template-columns: repeat(2, 1fr); }
  .qbar { grid-template-columns: 1fr; }
  .form-grid { grid-template-columns: 1fr; }
  .quick-stats { grid-template-columns: 1fr 1fr; }
  .pv-grid { grid-template-columns: repeat(2, 1fr); }
}

/* ================= 发布中心：分开复制 / 配图下载 工具条 ================= */
.p-part-tools { margin-top: 12px; padding: 11px 13px; border: 1px dashed var(--line); border-radius: 10px; background: var(--panel-2); transition: border-color .35s, box-shadow .35s; }
.p-part-tools.lit { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(15, 118, 110, .14); }
.p-part-tools .pt-h { font-size: 12.5px; color: var(--text-2); font-weight: 600; margin-bottom: 9px; }
.p-part-tools .pt-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.p-part-tools .pt-row + .pt-row { margin-top: 8px; }
.p-part-tools .pt-note { font-size: 11.5px; color: var(--text-3); }
.pt-btn { padding: 7px 14px; border-radius: 9px; border: 1px solid transparent; background: linear-gradient(135deg, var(--brand), var(--brand-2)); color: #fff; font-size: 13px; font-weight: 600; cursor: pointer; transition: filter .15s, transform .1s; }
.pt-btn:hover { filter: brightness(1.06); }
.pt-btn:active { transform: translateY(1px); }
.pt-btn.ghost { background: var(--panel); border-color: var(--line); color: var(--text-2); }
.pt-btn.ghost:hover { border-color: var(--brand); color: var(--brand); filter: none; }
.pt-btn.done { background: #0f9d58; color: #fff; border-color: transparent; }
.p-part-tools .pt-tip { margin-top: 10px; padding: 10px 12px; border-radius: 8px; background: var(--brand-soft); border-left: 3px solid var(--brand); font-size: 12.5px; line-height: 1.75; color: var(--text-2); }
.p-part-tools .pt-tip b { color: var(--text); }

/* ---------- ⚡ 真·一键填充面板（发布中心） ---------- */
.p-auto { margin-top: 12px; padding: 13px 14px; border: 1px solid var(--brand); border-radius: 12px; background: var(--brand-soft); }
.p-auto .pa-h { display: flex; gap: 8px; flex-wrap: wrap; align-items: baseline; font-size: 13.5px; font-weight: 700; color: var(--text); margin-bottom: 10px; }
.p-auto .pa-h small { font-weight: 400; font-size: 11.5px; color: var(--text-2); }
.p-auto .pa-h small b { color: var(--brand); }
.p-auto .pa-row { display: flex; gap: 8px; flex-wrap: wrap; }
.p-auto .pa-row + .pa-row { margin-top: 8px; }
.pa-btn { padding: 9px 16px; border-radius: 10px; border: 1px solid var(--line); background: var(--panel); color: var(--text-2); font-size: 13px; font-weight: 600; cursor: pointer; transition: filter .15s, transform .1s, border-color .15s; }
.pa-btn:hover { border-color: var(--brand); color: var(--brand); }
.pa-btn:active { transform: translateY(1px); }
.pa-btn.main { border-color: transparent; background: linear-gradient(135deg, var(--brand), var(--brand-2)); color: #fff; box-shadow: 0 2px 10px rgba(15, 118, 110, .25); }
.pa-btn.main:hover { filter: brightness(1.07); color: #fff; }
.pa-steps { margin-top: 10px; max-height: 190px; overflow: auto; padding: 9px 11px; border: 1px solid var(--line); border-radius: 9px; background: var(--panel); }
.pas-item { font-size: 12.5px; line-height: 1.7; color: var(--text-2); }
.pas-item.ok { color: #0f9d58; }
.pas-item.warn { color: #b7791f; }
.pas-item.err { color: #d64545; }
.pas-live { font-style: italic; }
.p-auto .pa-note { margin-top: 10px; font-size: 11.5px; line-height: 1.75; color: var(--text-3); }
.p-auto .pa-note b { color: var(--text-2); }
/* 一键填充不可用（服务器版：未装浏览器自动化组件） */
.pa-btn:disabled, .pa-btn.off:disabled { opacity: .45; cursor: not-allowed; filter: grayscale(.35); }
.pa-btn:disabled:hover { border-color: var(--line); color: var(--text-2); }
.pa-btn.main:disabled:hover { filter: grayscale(.35); }
.p-auto .pa-note.pa-na { background: rgba(180, 35, 24, .07); border: 1px solid rgba(180, 35, 24, .22); border-radius: 9px; padding: 9px 12px; color: #b42318; margin-bottom: 10px; }
.p-auto .pa-note.pa-na b { color: #b42318; }
.pa-warn { color: #b7791f; }
