:root {
  --bg: #0f172a;
  --card: #ffffff;
  --accent: #2563eb;
  --danger: #dc2626;
  --text: #1e293b;
  --muted: #64748b;
  --border: #e2e8f0;
  --code-bg: #0f172a;
  --code-fg: #e2e8f0;
}

* { 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; }

.secret {
  background: var(--code-bg);
  color: var(--code-fg);
  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: #1e2228;
  color: #e8eaed;
  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: #eef2ff; color: #3730a3; padding: 1px 5px; border-radius: 4px; font-size: 13px; }
.secret code { background: transparent; color: inherit; }

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; }
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: 880px; }
.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: #1e2228; color: #e8eaed; 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; }
.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: 420px; 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; }
.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); }
.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 { background: #f8fafc; border: 1px solid var(--border); border-radius: 12px; padding: 16px 18px; }
.server-card h3 { margin: 0 0 10px; font-size: 16px; color: var(--text); }
.server-meta { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.server-meta li { display: flex; align-items: baseline; gap: 8px; font-size: 13px; color: var(--text); }
.server-meta .meta-label { flex: 0 0 4em; color: var(--muted); }
.server-meta code { background: #eef2f7; border: 1px solid #e2e8f0; border-radius: 4px; padding: 1px 6px; font-size: 12px; color: #0f172a; }
@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; }
.server-meta .meta-label { text-align: justify; text-align-last: justify; }

/* 文字 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: rgba(255,255,255,0.14); color: #c9d1d9; 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: rgba(255,255,255,0.24); }
.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; }
