/* PPT 智能生成平台 · 管理后台样式
   设计语言：深色侧栏 + 浅色内容区，与安华职道中台保持一致
   （深色 #0f172a 系 + 金色 #f59e0b 强调色）。 */

:root {
  --side-bg: #0f172a;
  --side-bg-2: #16233c;
  --side-fg: #cbd5e1;
  --side-fg-dim: #7c8ba1;
  --brand: #1e3a8a;
  --brand-2: #2563eb;
  --accent: #f59e0b;
  --bg: #f4f6fa;
  --card: #ffffff;
  --line: #e4e8ef;
  --text: #1f2937;
  --text-2: #6b7280;
  --ok: #10b981;
  --warn: #f59e0b;
  --danger: #ef4444;
  --info: #3b82f6;
  --radius: 10px;
  --shadow: 0 1px 3px rgba(16, 24, 40, .06), 0 1px 2px rgba(16, 24, 40, .04);
  --shadow-lg: 0 10px 30px rgba(16, 24, 40, .12);
}

* { box-sizing: border-box; }

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

a { color: var(--brand-2); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ---------------------------------------------------------------- 布局 */
.layout { display: flex; min-height: 100vh; }

.side {
  width: 220px; flex: 0 0 220px; background: var(--side-bg);
  color: var(--side-fg); display: flex; flex-direction: column;
  position: sticky; top: 0; height: 100vh;
}
.side-logo {
  padding: 22px 20px 18px; border-bottom: 1px solid rgba(255,255,255,.07);
}
.side-logo .mark {
  display: flex; align-items: center; gap: 10px;
  font-size: 16px; font-weight: 700; color: #fff; letter-spacing: .3px;
}
.side-logo .mark .dot {
  width: 26px; height: 26px; border-radius: 7px; flex: 0 0 26px;
  background: linear-gradient(135deg, var(--accent), #ea580c);
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; color: #fff; font-weight: 800;
}
.side-logo .sub {
  margin-top: 6px; font-size: 11px; color: var(--side-fg-dim);
  letter-spacing: .5px;
}

.side-nav { flex: 1; overflow-y: auto; padding: 12px 0; }
.side-nav .group {
  padding: 14px 20px 6px; font-size: 11px; color: var(--side-fg-dim);
  letter-spacing: 1px; text-transform: uppercase;
}
.side-nav a {
  display: flex; align-items: center; gap: 9px;
  padding: 9px 20px; color: var(--side-fg); font-size: 13.5px;
  border-left: 3px solid transparent; cursor: pointer;
  text-decoration: none; transition: background .15s, color .15s;
}
.side-nav a:hover { background: var(--side-bg-2); color: #fff; text-decoration: none; }
.side-nav a.on {
  background: var(--side-bg-2); color: #fff;
  border-left-color: var(--accent); font-weight: 600;
}
.side-nav a .ic { width: 16px; text-align: center; opacity: .9; }
.side-nav a .badge {
  margin-left: auto; background: var(--danger); color: #fff;
  font-size: 10px; padding: 1px 6px; border-radius: 8px; font-weight: 700;
}

.side-foot {
  padding: 14px 20px; border-top: 1px solid rgba(255,255,255,.07);
  font-size: 12px; color: var(--side-fg-dim);
}
.side-foot .who { color: #fff; font-weight: 600; }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }

.top {
  height: 58px; background: #fff; border-bottom: 1px solid var(--line);
  display: flex; align-items: center; padding: 0 24px; gap: 14px;
  position: sticky; top: 0; z-index: 20;
}
.top h1 { font-size: 16px; margin: 0; font-weight: 600; }
.top .spacer { flex: 1; }
.top .pill {
  font-size: 12px; padding: 4px 10px; border-radius: 20px;
  background: #eef2ff; color: var(--brand); font-weight: 600;
}
.top .pill.ok { background: #ecfdf5; color: #047857; }
.top .pill.bad { background: #fef2f2; color: #b91c1c; }

.body { padding: 20px 24px 40px; flex: 1; }

/* ---------------------------------------------------------------- 卡片 */
.card {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow);
  margin-bottom: 16px; overflow: hidden;
}
.card > h3 {
  margin: 0; padding: 14px 18px; font-size: 14px; font-weight: 600;
  border-bottom: 1px solid var(--line); display: flex;
  align-items: center; gap: 10px;
}
.card > h3 .spacer { flex: 1; }
.card > h3 small { font-weight: 400; color: var(--text-2); font-size: 12px; }
.card .pad { padding: 16px 18px; }
.card .pad.tight { padding: 10px 18px; }

/* ---------------------------------------------------------------- 表格 */
table.tbl { width: 100%; border-collapse: collapse; font-size: 13px; }
table.tbl th {
  text-align: left; padding: 10px 12px; background: #f8fafc;
  color: var(--text-2); font-weight: 600; font-size: 12px;
  border-bottom: 1px solid var(--line); white-space: nowrap;
}
table.tbl td {
  padding: 10px 12px; border-bottom: 1px solid #f1f5f9; vertical-align: middle;
}
table.tbl tbody tr:hover { background: #fafbfd; }
table.tbl td.num { font-variant-numeric: tabular-nums; }
table.tbl .empty {
  text-align: center; color: var(--text-2); padding: 34px 0; font-size: 13px;
}

/* ---------------------------------------------------------------- 表单 */
label.f { display: block; margin-bottom: 12px; }
label.f > span {
  display: block; font-size: 12.5px; color: var(--text-2);
  margin-bottom: 5px; font-weight: 500;
}
label.f > span .req { color: var(--danger); }
label.f .help { font-size: 11.5px; color: var(--text-2); margin-top: 4px; }

input[type=text], input[type=password], input[type=number], select, textarea {
  width: 100%; padding: 8px 11px; border: 1px solid var(--line);
  border-radius: 7px; font-size: 13.5px; font-family: inherit;
  color: var(--text); background: #fff; outline: none;
  transition: border-color .15s, box-shadow .15s;
}
input:focus, select:focus, textarea:focus {
  border-color: var(--brand-2); box-shadow: 0 0 0 3px rgba(37,99,235,.1);
}
textarea { resize: vertical; min-height: 90px; line-height: 1.6; }
textarea.mono, input.mono {
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
  font-size: 12.5px;
}
select { cursor: pointer; }

.row { display: flex; gap: 14px; flex-wrap: wrap; }
.row > * { flex: 1; min-width: 180px; }
.row.tight { gap: 10px; }

/* ---------------------------------------------------------------- 按钮 */
.btn {
  display: inline-flex; align-items: center; gap: 6px; justify-content: center;
  padding: 8px 15px; border-radius: 7px; border: 1px solid var(--line);
  background: #fff; color: var(--text); font-size: 13px; font-family: inherit;
  cursor: pointer; font-weight: 500; transition: all .15s; white-space: nowrap;
}
.btn:hover:not(:disabled) { border-color: #cbd5e1; background: #f8fafc; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.pri {
  background: var(--brand-2); border-color: var(--brand-2); color: #fff;
}
.btn.pri:hover:not(:disabled) { background: var(--brand); border-color: var(--brand); }
.btn.acc { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.acc:hover:not(:disabled) { background: #d97706; border-color: #d97706; }
.btn.dgr { color: var(--danger); border-color: #fecaca; background: #fff; }
.btn.dgr:hover:not(:disabled) { background: #fef2f2; border-color: var(--danger); }
.btn.sm { padding: 4px 10px; font-size: 12px; border-radius: 6px; }
.btn.link {
  border: none; background: none; color: var(--brand-2); padding: 2px 4px;
}
.btn.link:hover { background: none; text-decoration: underline; }

.btnbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.btnbar .spacer { flex: 1; }

/* ---------------------------------------------------------------- 标记 */
.tag {
  display: inline-block; padding: 2px 8px; border-radius: 5px;
  font-size: 11.5px; font-weight: 600; line-height: 18px; white-space: nowrap;
}
.tag.g { background: #ecfdf5; color: #047857; }
.tag.b { background: #eff6ff; color: #1d4ed8; }
.tag.a { background: #fffbeb; color: #b45309; }
.tag.r { background: #fef2f2; color: #b91c1c; }
.tag.s { background: #f1f5f9; color: #475569; }
.tag.v { background: #f5f3ff; color: #6d28d9; }

.kpis { display: flex; gap: 14px; flex-wrap: wrap; }
.kpi {
  flex: 1; min-width: 150px; background: #fff; border: 1px solid var(--line);
  border-radius: var(--radius); padding: 14px 16px; box-shadow: var(--shadow);
}
.kpi .v {
  font-size: 24px; font-weight: 700; font-variant-numeric: tabular-nums;
  line-height: 1.2;
}
.kpi .l { font-size: 12.5px; color: var(--text-2); margin-top: 4px; }
.kpi .n { font-size: 11.5px; color: var(--text-2); margin-top: 3px; }
.kpi.b .v { color: var(--brand-2); }
.kpi.g .v { color: var(--ok); }
.kpi.a .v { color: var(--warn); }
.kpi.r .v { color: var(--danger); }
.kpi.v .v { color: #7c3aed; }
.kpi.s .v { color: #475569; }

/* ---------------------------------------------------------------- 进度 */
.bar {
  height: 7px; background: #eef2f7; border-radius: 4px; overflow: hidden;
}
.bar > i {
  display: block; height: 100%; background: var(--brand-2);
  border-radius: 4px; transition: width .4s ease;
}
.bar.g > i { background: var(--ok); }
.bar.r > i { background: var(--danger); }
.bar.a > i { background: var(--warn); }

/* ---------------------------------------------------------------- 弹窗 */
.mask {
  position: fixed; inset: 0; background: rgba(15,23,42,.45);
  display: flex; align-items: flex-start; justify-content: center;
  padding: 40px 16px; z-index: 100; overflow-y: auto;
  backdrop-filter: blur(2px);
}
.modal {
  background: #fff; border-radius: 12px; width: 100%; max-width: 720px;
  box-shadow: var(--shadow-lg); animation: pop .18s ease;
}
.modal.wide { max-width: 940px; }
.modal.narrow { max-width: 460px; }
@keyframes pop {
  from { opacity: 0; transform: translateY(-8px) scale(.99); }
  to { opacity: 1; transform: none; }
}
.modal > header {
  padding: 16px 20px; border-bottom: 1px solid var(--line);
  display: flex; align-items: center; gap: 10px;
  font-size: 15px; font-weight: 600;
}
.modal > header .spacer { flex: 1; }
.modal > header .x {
  cursor: pointer; color: var(--text-2); font-size: 20px; line-height: 1;
  padding: 2px 6px; border-radius: 5px;
}
.modal > header .x:hover { background: #f1f5f9; color: var(--text); }
.modal > .content { padding: 18px 20px; max-height: 66vh; overflow-y: auto; }
.modal > footer {
  padding: 14px 20px; border-top: 1px solid var(--line);
  display: flex; gap: 10px; justify-content: flex-end;
}
.modal > footer .spacer { flex: 1; }

/* ---------------------------------------------------------------- 提示 */
.toasts {
  position: fixed; top: 16px; right: 16px; z-index: 200;
  display: flex; flex-direction: column; gap: 8px;
}
.toast {
  background: #fff; border-left: 4px solid var(--info);
  border-radius: 8px; padding: 11px 15px; min-width: 250px; max-width: 420px;
  box-shadow: var(--shadow-lg); font-size: 13px; animation: slide .2s ease;
  display: flex; gap: 10px; align-items: flex-start;
}
.toast.ok { border-left-color: var(--ok); }
.toast.err { border-left-color: var(--danger); }
.toast.warn { border-left-color: var(--warn); }
.toast .m { flex: 1; word-break: break-word; line-height: 1.5; }
@keyframes slide { from { opacity: 0; transform: translateX(20px); } to { opacity: 1; } }

/* ---------------------------------------------------------------- 登录 */
.login-wrap {
  min-height: 100vh; display: flex; align-items: center;
  justify-content: center; padding: 20px;
  background: linear-gradient(135deg, #0f172a 0%, #1e3a8a 100%);
}
.login-box {
  width: 100%; max-width: 380px; background: #fff;
  border-radius: 14px; padding: 32px 28px; box-shadow: var(--shadow-lg);
}
.login-box .brand {
  text-align: center; margin-bottom: 24px;
}
.login-box .brand .ic {
  width: 50px; height: 50px; border-radius: 13px; margin: 0 auto 12px;
  background: linear-gradient(135deg, var(--accent), #ea580c);
  display: flex; align-items: center; justify-content: center;
  font-size: 22px; color: #fff; font-weight: 800;
}
.login-box .brand h2 { margin: 0; font-size: 19px; }
.login-box .brand p {
  margin: 5px 0 0; color: var(--text-2); font-size: 12.5px;
}

/* ---------------------------------------------------------------- 代码 */
pre.code {
  background: #0f172a; color: #e2e8f0; padding: 13px 15px;
  border-radius: 8px; overflow-x: auto; font-size: 12.5px;
  font-family: "SFMono-Regular", Consolas, Menlo, monospace;
  line-height: 1.65; margin: 0; white-space: pre-wrap; word-break: break-word;
}
pre.code .k { color: #7dd3fc; }
code.inl {
  background: #f1f5f9; padding: 1px 5px; border-radius: 4px;
  font-family: Consolas, Menlo, monospace; font-size: 12.5px;
  color: #b91c1c;
}

/* ---------------------------------------------------------------- 其它 */
.muted { color: var(--text-2); }
.small { font-size: 12px; }
.mono { font-family: Consolas, Menlo, monospace; }
.nowrap { white-space: nowrap; }
.mt0 { margin-top: 0; }
.mb0 { margin-bottom: 0; }
.mb12 { margin-bottom: 12px; }
.mt12 { margin-top: 12px; }
.tar { text-align: right; }
.tac { text-align: center; }
.flex { display: flex; align-items: center; gap: 8px; }
.flex-wrap { flex-wrap: wrap; }
.gap4 { gap: 4px; }
.gap14 { gap: 14px; }

.empty-state {
  text-align: center; padding: 44px 20px; color: var(--text-2);
}
.empty-state .ic { font-size: 34px; opacity: .35; margin-bottom: 10px; }

.note {
  background: #fffbeb; border: 1px solid #fde68a; border-radius: 8px;
  padding: 10px 13px; font-size: 12.5px; color: #92400e; line-height: 1.6;
}
.note.b { background: #eff6ff; border-color: #bfdbfe; color: #1e40af; }
.note.a { background: #fffbeb; border-color: #fde68a; color: #92400e; }
.note.r { background: #fef2f2; border-color: #fecaca; color: #991b1b; }
.note.g { background: #ecfdf5; border-color: #a7f3d0; color: #065f46; }

.split { display: flex; gap: 16px; align-items: flex-start; }
.split > .l { flex: 0 0 300px; }
.split > .r { flex: 1; min-width: 0; }

.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); }
.tabs button, .tabs a {
  padding: 9px 15px; border: none; background: none; cursor: pointer;
  font-size: 13.5px; color: var(--text-2); font-family: inherit;
  border-bottom: 2px solid transparent; font-weight: 500;
  text-decoration: none; display: inline-flex; align-items: center; gap: 6px;
}
.tabs button:hover, .tabs a:hover { color: var(--text); }
.tabs button.on, .tabs a.on {
  color: var(--brand-2); border-bottom-color: var(--brand-2); font-weight: 600;
}
.tabs .badge {
  background: var(--dgr, #dc2626); color: #fff; border-radius: 9px;
  font-size: 11px; padding: 1px 6px; font-weight: 700; line-height: 1.5;
}

.pager { display: flex; align-items: center; gap: 10px; padding: 12px 18px; }
.pager .spacer { flex: 1; }

.log-line {
  font-family: Consolas, Menlo, monospace; font-size: 12px;
  padding: 5px 0; border-bottom: 1px dashed #eef2f7; display: flex; gap: 9px;
}
.log-line .t { color: var(--text-2); flex: 0 0 auto; }
.log-line .s {
  flex: 0 0 44px; color: var(--brand-2); font-weight: 600;
}
.log-line.warn .m { color: #b45309; }
.log-line.error .m { color: #b91c1c; }
.log-line .m { flex: 1; word-break: break-word; }

.swatches { display: flex; gap: 6px; flex-wrap: wrap; }
.swatches i {
  width: 26px; height: 26px; border-radius: 6px; display: inline-block;
  border: 1px solid rgba(0,0,0,.1);
}

/* ---------------------------------------------------------------- 补充工具类
 * 这些是 设置 / 运维 / 账号 三页引入的，前面几版没有。
 * 保持与既有变量体系一致，不引入新的颜色字面量。
 */

/* 两列栅格：表单密集型页面用，窄屏自动塌成一列 */
.grid2 {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px 18px;
}
@media (max-width: 780px) { .grid2 { grid-template-columns: 1fr; } }

/* 行内操作区：a 标签当按钮用，中间留竖分隔线 */
.row-ops { display: flex; align-items: center; gap: 4px; }
.row-ops > a {
  color: var(--brand-2); text-decoration: none; font-size: 13px;
  padding: 3px 7px; border-radius: 5px; cursor: pointer;
}
.row-ops > a:hover { background: #eff6ff; }
.row-ops > a + a { border-left: 1px solid var(--line); border-radius: 0 5px 5px 0; }
.row-ops > a.disabled {
  color: #b9c2cf; cursor: not-allowed; pointer-events: none;
}

/* 页面工具条：左标签页 / 右动作 */
.toolbar {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
}

/* 键值对列表（设置页自检、生效值） */
.kv {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 7px 0; border-bottom: 1px dashed #eef2f7; font-size: 13px;
}
.kv:last-child { border-bottom: none; }
.kv .k { flex: 0 0 148px; color: var(--text-2); }
.kv .v { flex: 1; min-width: 0; word-break: break-word; }
.kv-list .kv .v { text-align: right; }

/* 通用禁用态（用于 a 标签） */
.disabled { opacity: .5; pointer-events: none; }

@media (max-width: 900px) {
  .layout { flex-direction: column; }
  .side { width: 100%; flex: none; height: auto; position: static; }
  .side-nav { display: flex; overflow-x: auto; padding: 6px 0; }
  .side-nav .group { display: none; }
  .side-nav a { white-space: nowrap; border-left: none; border-bottom: 3px solid transparent; }
  .side-nav a.on { border-left: none; border-bottom-color: var(--accent); }
  .split { flex-direction: column; }
  .split > .l { flex: none; width: 100%; }
  .body { padding: 14px; }
}
