:root {
  --bg: #0f172a;
  --card: #ffffff;
  --accent: #2563eb;
  --danger: #dc2626;
  --text: #1e293b;
  --muted: #64748b;
  --border: #e2e8f0;
  /* 代码块配色（默认值 = GitHub 浅色，主题由 html[data-code-theme] 覆盖） */
  --code-bg: #f6f8fa;
  --code-fg: #24292f;
  --code-border: #d0d7de;
  --code-inline-bg: #eff1f3;
  --code-inline-fg: #24292f;
  --code-copy-bg: rgba(27, 31, 36, .1);
  --code-copy-fg: #57606a;
  --code-tok-comment: #6e7781;
  --code-tok-punct: #24292f;
  --code-tok-tag: #116329;
  --code-tok-fn: #8250df;
  --code-tok-num: #0550ae;
  --code-tok-class: #953800;
  --code-tok-kw: #cf222e;
  --code-tok-str: #0a3069;
  --code-tok-op: #0550ae;
  --code-tok-inserted: #1a7f37;
  --code-tok-deleted: #82071e;
}

/* ===== 代码块主题（后台「系统管理 → 代码块主题」选择） ===== */
html[data-code-theme="github"], .code-theme-github {
  --code-bg: #f6f8fa;
  --code-fg: #24292f;
  --code-border: #d0d7de;
  --code-inline-bg: #eff1f3;
  --code-inline-fg: #24292f;
  --code-copy-bg: rgba(27, 31, 36, .1);
  --code-copy-fg: #57606a;
  --code-tok-comment: #6e7781;
  --code-tok-punct: #24292f;
  --code-tok-tag: #116329;
  --code-tok-fn: #8250df;
  --code-tok-num: #0550ae;
  --code-tok-class: #953800;
  --code-tok-kw: #cf222e;
  --code-tok-str: #0a3069;
  --code-tok-op: #0550ae;
  --code-tok-inserted: #1a7f37;
  --code-tok-deleted: #82071e;
}
html[data-code-theme="github-dark"], .code-theme-github-dark {
  --code-bg: #0d1117;
  --code-fg: #c9d1d9;
  --code-border: #30363d;
  --code-inline-bg: #161b22;
  --code-inline-fg: #c9d1d9;
  --code-copy-bg: rgba(255, 255, 255, .14);
  --code-copy-fg: #c9d1d9;
  --code-tok-comment: #8b949e;
  --code-tok-punct: #c9d1d9;
  --code-tok-tag: #7ee787;
  --code-tok-fn: #d2a8ff;
  --code-tok-num: #79c0ff;
  --code-tok-class: #ffa657;
  --code-tok-kw: #ff7b72;
  --code-tok-str: #a5d6ff;
  --code-tok-op: #ff7b72;
  --code-tok-inserted: #55d187;
  --code-tok-deleted: #ffa198;
}
html[data-code-theme="tomorrow"], .code-theme-tomorrow {
  --code-bg: #2d2d2d;
  --code-fg: #cccccc;
  --code-border: #4a4a4a;
  --code-inline-bg: #3a3a3a;
  --code-inline-fg: #cccccc;
  --code-copy-bg: rgba(255, 255, 255, .14);
  --code-copy-fg: #cccccc;
  --code-tok-comment: #999999;
  --code-tok-punct: #cccccc;
  --code-tok-tag: #cc99cd;
  --code-tok-fn: #ffcc66;
  --code-tok-num: #f99157;
  --code-tok-class: #ffcc66;
  --code-tok-kw: #cc99cd;
  --code-tok-str: #99cc99;
  --code-tok-op: #67cdcc;
  --code-tok-inserted: #99cc99;
  --code-tok-deleted: #cc6666;
}
html[data-code-theme="plain"], .code-theme-plain {
  --code-bg: #f5f5f5;
  --code-fg: #1f2328;
  --code-border: #e2e2e2;
  --code-inline-bg: #ececec;
  --code-inline-fg: #1f2328;
  --code-copy-bg: rgba(27, 31, 36, .08);
  --code-copy-fg: #6a737d;
  --code-tok-comment: #8a8a8a;
  --code-tok-punct: #1f2328;
  --code-tok-tag: #4a4a4a;
  --code-tok-fn: #1f2328;
  --code-tok-num: #1f2328;
  --code-tok-class: #1f2328;
  --code-tok-kw: #1f2328;
  --code-tok-str: #1f2328;
  --code-tok-op: #1f2328;
  --code-tok-inserted: #1f2328;
  --code-tok-deleted: #1f2328;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: center;
  padding: 48px 16px;
  background: linear-gradient(135deg, #0f172a 0%, #1e3a8a 100%);
  font-family: "Microsoft YaHei", "PingFang SC", -apple-system, "Segoe UI", sans-serif;
  color: var(--text);
}

.card {
  background: var(--card);
  border-radius: 14px;
  box-shadow: 0 18px 50px rgba(2, 6, 23, .45);
  padding: 32px 36px;
  width: 100%;
  max-width: 420px;
}

.card.wide { max-width: 1040px; }

h1 { font-size: 20px; margin: 0 0 6px; color: var(--bg); }
h2 { font-size: 16px; margin: 28px 0 10px; color: var(--bg); border-bottom: 1px solid var(--border); padding-bottom: 8px; }

.muted { color: var(--muted); font-size: 13px; line-height: 1.6; }
.ok { color: #15803d; font-weight: 600; }
.error { background: #fef2f2; color: var(--danger); border: 1px solid #fecaca; border-radius: 8px; padding: 10px 12px; font-size: 14px; }

form { margin-top: 16px; }
label { display: block; font-size: 13px; font-weight: 600; margin: 14px 0 6px; color: var(--bg); }
input[type="text"], input[type="password"], input[type="email"], input[type="number"], input[type="date"], select, textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 14px;
  outline: none;
  box-sizing: border-box;
  font-family: inherit;
  background: #fff;
}
input[type="text"]:focus, input[type="password"]:focus, input[type="email"]:focus, input[type="number"]:focus, input[type="date"]:focus, select:focus, textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(37, 99, 235, .15); }

button, .btn {
  display: inline-block;
  margin-top: 16px;
  padding: 10px 18px;
  border: none;
  border-radius: 8px;
  background: var(--accent);
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.2;
  box-sizing: border-box;
  vertical-align: middle;
  cursor: pointer;
  text-decoration: none;
}
button:hover, .btn:hover { opacity: .9; }
/* 页面级操作按钮统一品牌色（列表/表格内的 .btn-sm 保持原样式不变） */
.btn-primary { margin-top: 20px; width: 100%; background: #FF7452; }
.btn-danger { background: var(--danger); }
.btn { background: #FF7452; }

.notice { background: #f0fdf4; border: 1px solid #bbf7d0; border-radius: 8px; padding: 14px 16px; margin-top: 16px; }

/* 可折叠区块（纳管页各步骤：点标题展开/收起） */
details.fold { border: 1px solid var(--border); border-radius: 10px; margin: 20px 0; background: var(--card); }
details.fold > summary { cursor: pointer; list-style: none; padding: 12px 16px; font-size: 16px; font-weight: 600; color: var(--bg); border-bottom: 1px solid transparent; }
details.fold > summary::-webkit-details-marker { display: none; }
details.fold > summary::before { content: "▸ "; color: var(--muted); font-weight: 400; }
details.fold[open] > summary { border-bottom-color: var(--border); }
details.fold[open] > summary::before { content: "▾ "; }
details.fold > .fold-body { padding: 16px 16px 4px; }
details.fold .fold-body > h3:first-child { margin-top: 0; }

.secret {
  background: var(--code-bg);
  color: var(--code-fg);
  border: 1px solid var(--code-border);
  padding: 12px 14px;
  border-radius: 8px;
  font-family: Consolas, "Courier New", monospace;
  font-size: 13px;
  word-break: break-all;
  white-space: pre-wrap;
}

.code {
  background: var(--code-bg);
  color: var(--code-fg);
  border: 1px solid var(--code-border);
  padding: 14px 16px;
  border-radius: 8px;
  font-family: Consolas, "Courier New", monospace;
  font-size: 12.5px;
  line-height: 1.55;
  overflow-x: auto;
  white-space: pre;
}

code { background: var(--code-inline-bg); color: var(--code-inline-fg); padding: 1px 5px; border-radius: 4px; font-size: 13px; }
.secret code { background: transparent; color: inherit; }

/* 后台「代码块主题」实时预览 */
.code-theme-preview { margin-top: 10px; }
.code-theme-preview-head { font-size: 12px; color: var(--muted); margin-bottom: 4px; }
.code-theme-preview .code { margin: 0; }
.code-theme-preview .code code { background: transparent; color: inherit; padding: 0; font-size: 12.5px; }
.task-log { max-height: 340px; overflow: auto; white-space: pre-wrap; word-break: break-all; line-height: 1.6; }

table.kv { width: 100%; border-collapse: collapse; margin: 10px 0 16px; }
table.kv th, table.kv td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--border); font-size: 14px; } table.kv th { white-space: nowrap; } table.kv td.nowrap { white-space: nowrap; }
table.kv th { width: 130px; color: var(--muted); font-weight: 600; }

.topbar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.topbar .btn { margin-top: 0; }
.topbar-actions { display: flex; gap: 8px; }
.topbar-actions .btn { margin-top: 0; }

/* 用户管理表格 */
.table-wrap { overflow-x: auto; }
table.users { width: 100%; border-collapse: collapse; margin: 12px 0; font-size: 13.5px; }
table.users th, table.users td { text-align: left; padding: 9px 10px; border-bottom: 1px solid var(--border); }
table.users th { color: var(--muted); font-weight: 600; white-space: nowrap; }
table.users td.actions { white-space: nowrap; max-width: none; }
/* 列表内容不换行：超长省略号截断（列宽由固定布局 th 百分比分配，见 admin.php 注入） */
table.users td, table.doc-list td, table.proxy-table td { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cell-ell { display:inline-block; max-width:150px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; vertical-align:middle; }
table.doc-list td.actions { max-width: none; }
table.proxy-table td.actions { max-width: none; }
form.inline { display: inline; }
.btn-sm {
  display: inline-block;
  margin: 0 3px 0 0;
  padding: 5px 10px;
  border: none;
  border-radius: 6px;
  background: var(--accent);
  color: #fff;
  text-decoration: none;
  font-size: 12.5px;
  cursor: pointer;
}
.btn-sm:hover { opacity: .88; }
.btn-sm.warn { background: #b45309; }
.btn-sm.danger { background: var(--danger); }
.badge { font-size: 11.5px; padding: 2px 8px; border-radius: 20px; margin-left: 4px; }
.badge.on { background: #dcfce7; color: #15803d; }
.badge.off { background: #fee2e2; color: #b91c1c; }
.badge:not(.on):not(.off) { background: #e0e7ff; color: #3730a3; }

ol.steps { padding-left: 20px; font-size: 14px; line-height: 1.9; color: var(--text); }
a { color: var(--accent); text-decoration: none; }

/* ===== 主页 ===== */
.card.home { max-width: 1040px; }
.hero { text-align: center; padding: 8px 0 2px; }
.hero h1 { font-size: 26px; margin-bottom: 8px; }
.hero .sub { color: var(--muted); font-size: 15px; margin: 0; line-height: 1.7; }
.features { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin: 24px 0 10px; }
.feature { background: #f8fafc; border: 1px solid var(--border); border-radius: 12px; padding: 16px 18px; }
.feature h3 { margin: 0 0 6px; font-size: 15px; color: var(--bg); }
.feature p { margin: 0; font-size: 13px; color: var(--muted); line-height: 1.65; }
.home-links { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin: 18px 0 4px; }
.home-links .btn { margin-top: 0; }
.btn-ghost { background: transparent; color: var(--accent); border: 1px solid var(--accent); }
.btn-ghost:hover { background: #eff6ff; opacity: 1; }
@media (max-width: 640px) {
  .features { grid-template-columns: 1fr; }
}

/* ===== 后台管理选择页 ===== */
.admin-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 10px; }
.admin-card { display: block; background: #f8fafc; border: 1px solid var(--border); border-radius: 12px; padding: 20px 22px; text-decoration: none; color: var(--text); }
.admin-card:hover { border-color: var(--accent); box-shadow: 0 6px 18px rgba(37, 99, 235, .12); }
.admin-card h3 { margin: 0 0 6px; color: var(--bg); font-size: 16px; }
.admin-card p { margin: 0; font-size: 13px; color: var(--muted); line-height: 1.6; }
@media (max-width: 640px) {
  .admin-cards { grid-template-columns: 1fr; }
}

/* ===== 文档系统 ===== */
table.doc-list { width: 100%; border-collapse: collapse; margin: 12px 0 8px; font-size: 14px; }
table.doc-list th, table.doc-list td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--border); }
table.doc-list th { color: var(--muted); font-weight: 600; white-space: nowrap; }
table.doc-list td.title-cell a { text-decoration: none; font-weight: 600; }

.md-content { line-height: 1.75; font-size: 14.5px; color: var(--text); word-wrap: break-word; margin-top: 6px; }
.md-content h1, .md-content h2, .md-content h3, .md-content h4 { color: var(--bg); margin: 26px 0 10px; }
.md-content h1 { font-size: 22px; border-bottom: 2px solid var(--border); padding-bottom: 8px; }
.md-content h2 { font-size: 18px; border-bottom: 1px solid var(--border); padding-bottom: 6px; }
.md-content h3 { font-size: 15.5px; }
.md-content p { margin: 10px 0; }
.md-content ul, .md-content ol { padding-left: 24px; margin: 10px 0; }
.md-content li { margin: 4px 0; }
.md-content pre { background: var(--code-bg); color: var(--code-fg); border: 1px solid var(--code-border); padding: 14px 16px; border-radius: 8px; overflow-x: auto; font-size: 12.5px; line-height: 1.55; }
.md-content pre code { background: transparent; color: inherit; padding: 0; font-size: 12.5px; }
.md-content table { border-collapse: collapse; margin: 12px 0; width: 100%; font-size: 13.5px; display: block; overflow-x: auto; }
.md-content th, .md-content td { border: 1px solid var(--border); padding: 8px 10px; text-align: left; }
.md-content th { background: #f8fafc; font-weight: 600; }
.md-content blockquote { margin: 12px 0; padding: 6px 14px; border-left: 4px solid var(--accent); background: #eff6ff; color: #1e40af; border-radius: 0 8px 8px 0; }
.md-content hr { border: none; border-top: 1px solid var(--border); margin: 18px 0; }
.md-content img { max-width: 100%; }

textarea.editor { width: 100%; min-height: 640px; padding: 12px 14px; border: 1px solid var(--border); border-radius: 8px; font-family: Consolas, "Courier New", monospace; font-size: 13px; line-height: 1.6; outline: none; resize: vertical; }
textarea.editor:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(37, 99, 235, .15); }

/* ===== 友情链接 ===== */
.friend-links { margin-top: 26px; padding-top: 18px; border-top: 1px solid var(--border); }
.friend-links h3 { font-size: 13px; color: var(--muted); font-weight: 600; margin: 0 0 10px; text-align: center; }
.links-row { display: flex; flex-wrap: wrap; gap: 8px 18px; justify-content: center; }
.links-row a { font-size: 13px; color: var(--muted); text-decoration: none; }
.links-row a:hover { color: var(--accent); }

/* ===== 邮箱 / 标签 ===== */
.tag-ok { display:inline-block; margin-left:6px; padding:1px 8px; border-radius:10px; font-size:12px; background:#dcfce7; color:#15803d; }
.tag-warn { display:inline-block; margin-left:6px; padding:1px 8px; border-radius:10px; font-size:12px; background:#fef3c7; color:#b45309; }
.badge.warn-b { background:#fef3c7; color:#b45309; }
.cols2 { display:grid; grid-template-columns:repeat(auto-fit,minmax(260px,1fr)); gap:16px; }
.cols2 h3 { font-size:14px; margin:0 0 8px; }
.form label { display:block; margin-bottom:10px; font-size:13px; color:var(--muted); }
.form input[type=text], .form input[type=email], .form input[type=password], .form input[type=number], .form input[type=date], .form select, .form textarea { width:100%; margin-top:4px; }
.inline-label { display:inline-block; margin-right:18px; font-size:14px; }
.btn-row { display:flex; gap:10px; margin-top:14px; align-items:center; flex-wrap:wrap; }
.btn-row .btn, .btn-row button { margin-top: 0; }
.btn-row form { margin-top: 0; }
/* 弹窗（dialog）内按钮：主按钮与取消按钮同一行、等宽等高 */
dialog.card .btn-row { flex-wrap: nowrap; }
dialog.card .btn-row .btn-primary, dialog.card .btn-row .btn, dialog.card .btn-row button { flex: 1 1 0; width: auto; min-width: 0; margin-top: 0; }
/* 页面内编辑表单按钮行（非弹窗）：主按钮与取消编辑同一行、等宽等高 */
.btn-row.eq { flex-wrap: nowrap; }
.btn-row.eq .btn-primary, .btn-row.eq .btn, .btn-row.eq button { flex: 1 1 0; width: auto; min-width: 0; margin-top: 0; }
.mono { font-family:Consolas,"Courier New",monospace; font-size:12.5px; line-height:1.6; }

/* ===== 资料库 ===== */
.file-list td.fname { max-width:220px; word-break:break-all; }
.file-list td.thumb { width:64px; text-align:center; }
.file-list td.thumb img { width:56px; height:56px; object-fit:cover; border-radius:6px; border:1px solid var(--border); }
/* 资料管理：链接 / Markdown 分行并排，点击输入框即复制 */
.file-list td.linkcell { max-width:none; min-width:340px; }
.file-list .linkrow { display:flex; align-items:center; gap:6px; margin:3px 0; white-space:nowrap; }
.file-list .linkrow .btn-sm { flex-shrink:0; margin:0; }
.file-list .copy-input { flex:1; min-width:0; font-size:12px; padding:4px 8px; border:1px solid var(--border); border-radius:4px; background:#fff; color:#333; text-overflow:ellipsis; overflow:hidden; cursor:pointer; }
.file-list .copy-input.copied { border-color:#22c55e; color:#16a34a; }
/* 资料管理：打开弹窗预览 */
.afrp-ov { position:fixed; inset:0; z-index:99990; display:none; align-items:center; justify-content:center; background:rgba(0,0,0,.45); padding:24px; }
.afrp-modal { width:min(920px, 96vw); height:min(86vh, 92vh); display:flex; flex-direction:column; background:#fff; border-radius:10px; box-shadow:0 8px 32px rgba(0,0,0,.3); overflow:hidden; }
.afrp-modal-head { display:flex; align-items:center; justify-content:space-between; gap:12px; padding:10px 16px; border-bottom:1px solid #eee; background:#fff; }
.afrp-modal-title { font-size:14px; font-weight:600; color:#333; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.afrp-modal-close { border:1px solid #ddd; background:#fff; color:#555; padding:4px 14px; border-radius:6px; cursor:pointer; font-size:13px; flex-shrink:0; }
.afrp-modal-close:hover { background:#f5f5f5; border-color:#ccc; }
.afrp-modal-body { flex:1; overflow:auto; padding:12px; display:flex; flex-direction:column; align-items:center; justify-content:center; gap:12px; background:#fafafa; }
.afrp-modal-iframe { width:100%; height:100%; border:0; background:#fff; border-radius:6px; }
.file-ico { display:inline-block; width:56px; height:56px; line-height:56px; border-radius:6px; background:#eff6ff; color:#1d4ed8; font-size:11px; font-weight:700; text-align:center; border:1px solid var(--border); }
.linkcell { max-width:360px; }
.copy-input { width:100%; margin:3px 0; font-family:Consolas,"Courier New",monospace; font-size:11.5px; padding:3px 6px; border:1px solid var(--border); border-radius:5px; background:#f8fafc; }
.scene-tabs { display:flex; flex-wrap:wrap; gap:8px; margin:12px 0; }
.scene-tabs .btn-sm.active { background:var(--accent); color:#fff; border-color:var(--accent); }

/* ===== 弹窗 ===== */
dialog.card { border:1px solid var(--border); border-radius:12px; padding:22px; width:min(480px,92vw); box-shadow:0 12px 40px rgba(15,23,42,.18); }
dialog.card::backdrop { background:rgba(15,23,42,.45); }
dialog.card h2 { margin-top:0; }
dialog.card textarea { width:100%; margin-top:4px; }
.plain-link { text-decoration: none; }

.server-section { margin-top: 26px; padding-top: 18px; border-top: 1px solid var(--border); }
.server-section h2 { text-align: center; margin-bottom: 14px; }
.server-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; }
.server-card { position: relative; background: #f8fafc; border: 1px solid var(--border); border-radius: 12px; padding: 16px 18px; }
.server-card h3 { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 0 0 14px; font-size: 16px; line-height: 1.5; color: var(--text); }
.server-card h3 .srv-title { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.server-card h3 .srv-flag { width: 20px; height: 15px; margin-right: 8px; border-radius: 2px; box-shadow: 0 0 0 1px rgba(15, 23, 42, .12); vertical-align: -2px; object-fit: cover; }
.server-card h3 .card-badge { flex: 0 0 auto; margin-left: 0; max-width: 55%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.server-meta { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.server-meta li { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; font-size: 13px; line-height: 1.7; color: var(--text); }
.server-meta .meta-label { flex: 0 0 auto; color: var(--muted); }
.server-meta li .srv-val, .server-meta li .muted, .server-meta li code { min-width: 0; text-align: right; overflow-wrap: anywhere; }
.server-meta code { background: var(--code-inline-bg); border: 1px solid var(--code-border); border-radius: 4px; padding: 1px 6px; font-size: 12px; color: var(--code-inline-fg); }
@media (max-width: 640px) { .server-grid { grid-template-columns: 1fr; } }

.topbar-logo { height: 30px; width: auto; vertical-align: middle; margin-right: 10px; }
.corner-logo { position: fixed; top: 16px; left: 24px; z-index: 50; }
.corner-logo .topbar-logo { height: 34px; }
.corner-logo h1.logo { font-size: 35px; }
.auth-logo { text-align: center; margin-bottom: 8px; }
.auth-logo h1.logo { font-size: 35px; margin: 0; line-height: 1.2; }
.auth-logo img.topbar-logo { height: 44px; }
.card > h1 { text-align: center; }
.hero-logo { text-align: center; margin-bottom: 12px; }
.hero-logo img { height: 52px; width: auto; }

/* 文字 Logo 字体 */
@font-face {
    font-family: "Comfortaa Bold V2";
    src: url("WebFonts/70f9644542515286487b2b268beffbf8.eot");
    src: url("WebFonts/70f9644542515286487b2b268beffbf8.eot?#iefix")format("embedded-opentype"),
        url("WebFonts/70f9644542515286487b2b268beffbf8.woff2")format("woff2"),
        url("WebFonts/70f9644542515286487b2b268beffbf8.woff")format("woff"),
        url("WebFonts/70f9644542515286487b2b268beffbf8.ttf")format("truetype"),
        url("WebFonts/70f9644542515286487b2b268beffbf8.svg#Comfortaa Bold V2")format("svg");
}
.stts {
    font-family: "Comfortaa Bold V2";
}
.sttts {
    font-family: "Comfortaa Bold V2";
    color: #FF7452;
}
.topbar h1.logo, .corner-logo h1, .hero-logo h1 { margin: 0; line-height: 1.2; }
.topbar h1.logo { font-size: 35px; margin-right: 10px; }
.hero-logo { text-align: center; margin-bottom: 10px; }

.logo-fieldset { border: 1px solid var(--border); border-radius: 10px; padding: 12px 14px; margin: 4px 0 14px; }
.logo-fieldset legend { font-size: 13px; color: var(--muted); padding: 0 6px; }
.radio-line { display: block; margin: 6px 0; }
.logo-text-fields { margin: 4px 0 10px 24px; }
.server-meta .srv-val { color: #1cc88a; font-weight: 600; }
.logo-link { text-decoration: none; color: inherit; display: inline-block; }
.doc-title { font-size: 1.9em; margin: 30px 0 20px; color: #333; line-height: 1.3; text-align: center; }
.md-content pre { position: relative; }
.site-footer { text-align:center; margin-top: 20px; margin-bottom: -22px; padding-top: 14px; padding-bottom: 0; border-top: 1px solid var(--border); color: var(--muted); font-size: 13px; }
.site-footer p { margin: 0; line-height: 1.8; }
.site-footer a { color: var(--muted); }
.copy-btn {
  position: absolute; top: 15px; right: 15px; z-index: 2;
  width: 30px; height: 30px; margin: 0; padding: 0; border: none; border-radius: 6px;
  background: var(--code-copy-bg); color: var(--code-copy-fg); cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
  box-shadow: 0 1px 3px rgba(0,0,0,0.18); opacity: 0.7; transition: opacity .15s, color .15s;
}
.copy-btn.single { top: calc(50% - 15px); }
.copy-btn:hover { opacity: 1; color: #FF7452; background: var(--code-copy-bg); }
.copy-btn.copied { color: #1cc88a; }
/* 文档分类标签：Markdown 中 <span class="cate">xxx</span> */
.cate {
  display: inline-block;
  padding: 1px 10px;
  margin: 0 4px;
  border-radius: 4px;
  background: #FF7452;
  color: #fff;
  font-size: 0.85em;
  font-weight: 600;
  line-height: 1.6;
  vertical-align: baseline;
}
.tag-err { display:inline-block; margin-left:6px; padding:1px 8px; border-radius:10px; font-size:12px; background:#fee2e2; color:#dc2626; }
table.kv .st-ok { color: #16a34a; font-weight: 600; }
table.kv .st-err { color: #dc2626; font-weight: 600; }

/* banner 滚动通知 */
.notice-banner{background:linear-gradient(90deg,#fff7ed,#fffbeb);border:1px solid #fed7aa;border-radius:8px;padding:8px 16px;margin:12px 0;overflow:hidden;}
.banner-scroll{white-space:nowrap;overflow:hidden;display:inline-block;animation:bannerScroll 30s linear infinite;}
.banner-item{display:inline-block;padding:0 32px;font-size:14px;color:#9a3412;}
@keyframes bannerScroll{0%{transform:translateX(100%);}100%{transform:translateX(-100%);}}

/* 消息图标 */
.user-info{display:inline-flex;align-items:center;gap:4px;}
.msg-icon{display:inline-block;width:28px;height:28px;line-height:28px;text-align:center;border-radius:50%;font-size:14px;text-decoration:none;}
.msg-icon.unread{background:#ff7452;color:#fff;}
.msg-icon.read{background:#e5e7eb;color:#999;}

/* ===== 小屏顶部导航（汉堡菜单，仅适配小分辨率设备，大屏不变） ===== */
.hamburger-btn {
  display: none;
  width: 40px; height: 40px; margin: 0; padding: 0;
  border: none; border-radius: 8px; cursor: pointer;
  background: transparent; color: #FF7452;
  align-items: center; justify-content: center; flex-shrink: 0;
  transform: translateY(-3px);
}
.hamburger-btn svg { width: 22px; height: 22px; }
.hamburger-btn:hover { background: rgba(255,116,82,.12); }
.mobile-menu {
  display: none;
  position: fixed; top: 0; right: 0; bottom: 0; left: 0;
  z-index: 1000;
  background: rgba(15,23,42,.45);
}
.mobile-menu.show { display: block; }
.mobile-menu .mm-panel {
  position: fixed;
  min-width: 200px;
  background: #fff; border-radius: 12px; padding: 8px;
  box-shadow: 0 12px 40px rgba(0,0,0,.25);
  display: flex; flex-direction: column; gap: 4px;
}
.mobile-menu .mm-panel a {
  display: block; padding: 11px 14px; border-radius: 8px;
  color: #1e293b; font-size: 14px; font-weight: 600; text-decoration: none;
}
.mobile-menu .mm-panel a:hover { background: #f1f5f9; }
@media (max-width: 640px) {
  .topbar h1.logo, .topbar .logo-link, .topbar .topbar-logo { display: none !important; }
  .topbar-actions, .topbar > a.btn, .topbar > div { display: none !important; }
  .hamburger-btn { display: inline-flex !important; }
  .topbar h1 { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 15px; }
}

/* ===== 后台管理：左侧树形菜单 + 右侧内容区（同一 card 内） ===== */
.admin-shell {
  max-width: 1290px; /* 内容(1040) + 菜单(215) + 分隔 */
  margin: 12px;
  padding: 20px 24px;
  display: flex;
  flex-direction: column;
}
.admin-shell { position: relative; }
.admin-shell .topbar { justify-content: flex-start; border-bottom: 1px solid var(--border); padding-bottom: 12px; margin-bottom: 12px; }
.admin-shell .topbar h1:not(.logo) {
  flex: 0 0 auto; text-align: left;
  margin: 0 0 0 2px; font-size: 19px; white-space: nowrap;
  overflow: hidden; text-overflow: ellipsis;
}
.admin-shell .admin-hamburger { margin-left: auto; }
.admin-title-base, .admin-title-sub { white-space: nowrap; }
.admin-title-sub::before { content: ' > '; }
.admin-body { flex: 1; display: flex; align-items: stretch; }
.admin-sidebar { width: 215px; flex-shrink: 0; padding: 0 16px 6px 0; border-right: 1px solid var(--border); }
.admin-menu { display: flex; flex-direction: column; }
.admin-menu-group + .admin-menu-group { margin-top: 8px; padding-top: 5px; border-top: 1px solid var(--border); }
.admin-menu-title {
  font-size: 14px; color: #111; padding: 3px 10px; margin: 2px 6px 6px;
  display: block; font-weight: 800; letter-spacing: .5px;
  background: rgba(255,116,82,.08); border-left: 3px solid #FF7452; border-radius: 6px;
}
.admin-menu-item {
  display: block; padding: 4px 10px; margin: 0 12px 2px;
  border-radius: 8px;
  color: var(--text); font-size: 12.5px; text-decoration: none;
  transition: background .15s;
}
.admin-menu-item:hover { background: #f1f5f9; color: #FF7452; }
.admin-menu-item.active {
  background: #FF7452; color: #fff; font-weight: 700;
  box-shadow: 0 1px 3px rgba(255,116,82,.35);
}
.admin-menu-item.active:hover { background: #e5643d; color: #fff; }
.admin-menu-sep { border-top: 1px solid var(--border); margin: 10px 6px; }
.admin-content { flex: 1; min-width: 0; padding-left: 18px; }
.admin-content iframe { width: 100%; border: none; border-radius: 0 0 8px 8px; background: #fff; display: block; }
.admin-shell .site-footer { margin: 18px 0 0; padding-top: 12px; }
.admin-hamburger {
  display: none;
  width: 40px; height: 40px; margin: 0; padding: 0;
  border: none; border-radius: 8px; cursor: pointer;
  background: transparent; color: #FF7452; flex-shrink: 0;
  align-items: center; justify-content: center;
}
.admin-hamburger svg { width: 22px; height: 22px; }
.admin-hamburger:hover { background: rgba(255,116,82,.12); }
/* 小屏弹出式菜单（右上角汉堡呼出，不挤占页面；随页面滚动保证全部可见） */
.admin-menu-popup {
  display: none;
  position: absolute; top: 112px; right: 14px;
  width: 240px;
  background: #fff; border-radius: 12px; padding: 10px;
  box-shadow: 0 16px 48px rgba(2,6,23,.28);
  z-index: 1000;
}
.admin-menu-popup.show { display: block; }
@media (max-width: 900px) {
  .admin-shell { margin: 8px; max-width: 1040px; padding: 14px; }
  .admin-hamburger { display: inline-flex !important; }
  .admin-sidebar { display: none; }
  .admin-content { padding-left: 0; }
  .admin-content iframe { min-height: 65vh; }
  .admin-shell .topbar h1:not(.logo) {
    flex: 1; min-width: 0; font-size: 14px; white-space: normal;
    display: flex; flex-direction: column; line-height: 1.3;
  }
  .admin-shell .topbar .admin-title-base { font-weight: 700; overflow: hidden; text-overflow: ellipsis; }
  .admin-shell .topbar .admin-title-sub { font-size: 13px; color: #666; font-weight: 500; overflow: hidden; text-overflow: ellipsis; }
  .admin-shell .topbar .admin-title-sub::before { content: ''; }
}
