/* ============================================================
   NULLHUB — 低刺激深色主题 v2
   深灰蓝底 + 低饱和绿点缀，去掉网格/扫描线/发光
   ============================================================ */

:root {
  --bg: #0b0f12;
  --bg-soft: #0f1419;
  --panel: #121920;
  --panel-2: #151e26;
  --line: #1f2a33;
  --line-strong: #2c3a45;
  --accent: #4ade80;
  --accent-soft: #a7f3c0;
  --accent-dim: #2f7a4f;
  --cyan: #67e8f9;
  --text: #e3e9ef;
  --muted: #93a1ad;
  --danger: #f87171;
  --radius: 8px;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", "PingFang SC", "Hiragino Sans GB", sans-serif;
  --mono: "JetBrains Mono", "Cascadia Mono", Consolas, "Courier New", monospace;
}

* { box-sizing: border-box; }
html, body { height: 100%; }

body {
  margin: 0;
  font-family: var(--sans);
  font-size: 14.5px;
  color: var(--text);
  background-color: var(--bg);
  background-image:
    radial-gradient(900px 420px at 50% -12%, rgba(74, 222, 128, 0.06), transparent 70%);
  background-attachment: fixed;
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
}

.scanlines { display: none; }

a { color: var(--accent); text-decoration: none; transition: color .15s ease; }
a:hover { color: var(--accent-soft); }

::selection { background: rgba(74, 222, 128, 0.22); color: #f1fff5; }

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

.wrap { width: min(1120px, 92vw); margin: 0 auto; }

.nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(11, 15, 18, 0.92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}

.nav-inner { display: flex; align-items: center; gap: 28px; height: 60px; }

.logo {
  font-family: var(--mono);
  font-weight: 600;
  font-size: 17px;
  letter-spacing: .5px;
  color: var(--text);
}
.logo span { color: var(--accent); }

.nav-links { display: flex; gap: 20px; font-size: 14px; }
.nav-links a { color: var(--muted); }
.nav-links a:hover, .nav-links a.active { color: var(--text); }

.nav-actions { margin-left: auto; display: flex; align-items: center; gap: 10px; font-size: 13px; }

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

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: 6px;
  border: 1px solid rgba(74, 222, 128, 0.35);
  background: rgba(74, 222, 128, 0.10);
  color: var(--accent-soft);
  font-family: inherit;
  font-size: 13.5px;
  cursor: pointer;
  transition: background .15s ease, border-color .15s ease, color .15s ease;
  white-space: nowrap;
}
.btn:hover { background: rgba(74, 222, 128, 0.17); border-color: rgba(74, 222, 128, 0.55); color: #eafff0; }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .45; cursor: not-allowed; }

.btn-ghost { background: transparent; border-color: var(--line-strong); color: var(--muted); }
.btn-ghost:hover { background: var(--panel-2); border-color: #3b4a56; color: var(--text); }

.btn-danger { background: rgba(248, 113, 113, 0.10); border-color: rgba(248, 113, 113, 0.35); color: #fca5a5; }
.btn-danger:hover { background: rgba(248, 113, 113, 0.16); border-color: rgba(248, 113, 113, 0.55); color: #fecaca; }

.btn-block { width: 100%; }

/* ---------- 首屏 ---------- */

.hero { padding: 60px 0 22px; }

.eyebrow {
  margin: 0 0 12px;
  font-family: var(--mono);
  font-size: 11.5px;
  letter-spacing: 1.6px;
  color: var(--accent-dim);
}

.hero h1 {
  margin: 0;
  font-size: clamp(28px, 4.4vw, 44px);
  line-height: 1.2;
  letter-spacing: -0.5px;
  color: #f2f7fb;
  font-weight: 600;
}
.hero h1 .accent { color: var(--accent); }
.cursor { color: var(--accent); opacity: .7; animation: blink 1.2s steps(2, start) infinite; }
@keyframes blink { to { opacity: 0; } }

.hero .sub { margin: 12px 0 24px; color: var(--muted); font-size: 14px; max-width: 620px; }

/* ---------- 搜索 ---------- */

.searchbar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: var(--panel);
  transition: border-color .15s ease;
}
.searchbar:focus-within { border-color: rgba(74, 222, 128, 0.45); }
.searchbar .prompt { font-family: var(--mono); color: var(--accent-dim); font-size: 12.5px; white-space: nowrap; }
.searchbar input {
  flex: 1;
  min-width: 0;
  background: transparent;
  border: none;
  outline: none;
  color: var(--text);
  font-family: inherit;
  font-size: 14.5px;
  caret-color: var(--accent);
}
.searchbar input::placeholder { color: #6b7883; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.chip {
  padding: 5px 13px;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  color: var(--muted);
  font-size: 12.5px;
  cursor: pointer;
  user-select: none;
  transition: all .15s ease;
}
.chip:hover { color: var(--text); border-color: #3b4a56; background: var(--panel-2); }
.chip.active {
  color: var(--accent-soft);
  border-color: rgba(74, 222, 128, 0.5);
  background: rgba(74, 222, 128, 0.12);
  font-weight: 500;
}
.chip .n { opacity: .55; margin-left: 4px; font-size: 11px; }

/* ---------- 统计 ---------- */

.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin: 30px 0 36px; }
.stat {
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
}
.stat .k { font-family: var(--mono); font-size: 10.5px; letter-spacing: 1.2px; color: var(--muted); }
.stat .v { font-size: 22px; font-weight: 600; color: var(--text); margin-top: 2px; }

/* ---------- 区块标题 ---------- */

.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 10px;
}
.section-head h2 { margin: 0; font-size: 15.5px; font-weight: 600; color: #eef4f9; }
.muted { color: var(--muted); font-size: 12.5px; }

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

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; }

.card {
  display: flex;
  flex-direction: column;
  padding: 16px 17px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  transition: border-color .15s ease, background .15s ease, transform .15s ease;
}
.card:hover { border-color: var(--line-strong); background: var(--panel-2); transform: translateY(-1px); }

.card .badge {
  align-self: flex-start;
  font-size: 11px;
  padding: 2px 9px;
  border-radius: 4px;
  border: 1px solid rgba(103, 232, 249, 0.28);
  color: #8fd9e6;
  background: rgba(103, 232, 249, 0.07);
  margin-bottom: 9px;
}
.card h3 { margin: 0 0 7px; font-size: 15.5px; line-height: 1.5; font-weight: 600; }
.card h3 a { color: #eef4f9; }
.card h3 a:hover { color: var(--accent); }
.card p.desc { margin: 0 0 12px; font-size: 13px; color: var(--muted); line-height: 1.7; }

.card .meta {
  margin-top: auto;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 11.5px;
  color: #71808c;
  border-top: 1px solid var(--line);
  padding-top: 9px;
}

.empty {
  padding: 52px 20px;
  text-align: center;
  color: var(--muted);
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
  font-size: 13.5px;
  background: var(--bg-soft);
}

/* ---------- 分页 ---------- */

.pager { display: flex; justify-content: center; gap: 6px; margin: 30px 0 56px; flex-wrap: wrap; }
.pager button {
  min-width: 36px;
  padding: 6px 11px;
  border-radius: 6px;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--muted);
  font-family: inherit;
  font-size: 12.5px;
  cursor: pointer;
}
.pager button:hover:not(:disabled) { border-color: var(--line-strong); color: var(--text); }
.pager button.active { background: rgba(74, 222, 128, 0.13); border-color: rgba(74, 222, 128, 0.45); color: var(--accent-soft); }
.pager button:disabled { opacity: .35; cursor: default; }

/* ---------- 详情 ---------- */

.detail-wrap { padding: 40px 0 64px; }
.crumb { font-size: 12.5px; color: var(--muted); margin-bottom: 18px; }
.crumb a { color: var(--muted); }
.crumb a:hover { color: var(--text); }

.article {
  padding: 26px 28px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
}
.article h1 { margin: 0 0 12px; font-size: clamp(21px, 3.2vw, 29px); line-height: 1.4; font-weight: 600; color: #f2f7fb; }
.article .meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  font-size: 12.5px;
  color: var(--muted);
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 20px;
}
.article .summary {
  padding: 11px 15px;
  border-left: 3px solid rgba(74, 222, 128, 0.55);
  background: rgba(74, 222, 128, 0.06);
  color: #cfe9d8;
  font-size: 13.5px;
  margin-bottom: 22px;
  border-radius: 0 6px 6px 0;
}
.article .content { white-space: pre-wrap; word-break: break-word; font-size: 14.5px; line-height: 1.95; color: #d3dde6; }
.tag-list { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 22px; }
.tag {
  font-family: var(--mono);
  font-size: 11.5px;
  padding: 3px 9px;
  border-radius: 4px;
  background: var(--panel-2);
  border: 1px solid var(--line);
  color: var(--muted);
}
.detail-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 24px; }

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

.auth-wrap { min-height: calc(100vh - 60px); display: flex; align-items: center; justify-content: center; padding: 48px 20px; }

.panel {
  width: 100%;
  max-width: 400px;
  padding: 28px 26px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
}
.panel.wide { max-width: 720px; }
.panel h1 { margin: 0 0 6px; font-size: 20px; font-weight: 600; color: #f2f7fb; }
.panel .hint { margin: 0 0 22px; font-size: 12.5px; color: var(--muted); }

.field { margin-bottom: 15px; }
.field label { display: block; font-size: 12.5px; color: var(--muted); margin-bottom: 6px; }
.field label .req { color: var(--danger); }

.input, .select, .textarea {
  width: 100%;
  padding: 9px 12px;
  background: var(--bg-soft);
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  color: var(--text);
  font-family: inherit;
  font-size: 14px;
  outline: none;
  transition: border-color .15s ease, background .15s ease;
}
.input:focus, .select:focus, .textarea:focus { border-color: rgba(74, 222, 128, 0.55); background: #101820; }
.input::placeholder, .textarea::placeholder { color: #66737e; }
.textarea { resize: vertical; min-height: 150px; line-height: 1.8; }
.select { appearance: none; }
.select option { background: var(--panel); color: var(--text); }

.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

.form-error {
  display: none;
  margin: 0 0 14px;
  padding: 8px 12px;
  border: 1px solid rgba(248, 113, 113, 0.35);
  background: rgba(248, 113, 113, 0.08);
  color: #fca5a5;
  font-size: 12.5px;
  border-radius: 6px;
}
.form-error.show { display: block; }

.form-foot { margin-top: 16px; text-align: center; font-size: 12.5px; color: var(--muted); }

/* ---------- 提示 ---------- */

.toast-host { position: fixed; right: 18px; bottom: 18px; z-index: 10000; display: flex; flex-direction: column; gap: 8px; }
.toast {
  padding: 10px 15px;
  border: 1px solid var(--line-strong);
  border-left: 3px solid var(--accent);
  border-radius: 6px;
  background: #131b22;
  color: var(--text);
  font-size: 13px;
  max-width: 320px;
  box-shadow: 0 10px 28px rgba(0, 0, 0, .45);
  animation: toastIn .2s ease;
}
.toast.err { border-left-color: var(--danger); border-color: rgba(248, 113, 113, 0.35); }
@keyframes toastIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* ---------- 页脚 ---------- */

.footer { border-top: 1px solid var(--line); padding: 22px 0 30px; color: #71808c; font-size: 12px; }
.footer .row { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px; }

/* ---------- 响应式 ---------- */

@media (max-width: 760px) {
  .nav-inner { gap: 14px; height: 56px; }
  .nav-links { display: none; }
  .hero { padding: 40px 0 16px; }
  .stats { grid-template-columns: 1fr; margin: 24px 0 28px; }
  .form-row { grid-template-columns: 1fr; }
  .article { padding: 20px 18px; }
  .searchbar { flex-wrap: wrap; }
  .searchbar .prompt { width: 100%; }
}

/* ============================================================
   发布 / 积分 / 后台 增补样式
   ============================================================ */

/* 正文字号（富文本 <font size> 映射） */
font[size="1"] { font-size: 10px; }
font[size="2"] { font-size: 12px; }
font[size="3"] { font-size: 15px; }
font[size="4"] { font-size: 18px; }
font[size="5"] { font-size: 22px; }
font[size="6"] { font-size: 28px; }
font[size="7"] { font-size: 36px; }

/* 导航积分 */
.points-pill {
  padding: 4px 11px;
  border-radius: 999px;
  border: 1px solid rgba(74, 222, 128, 0.35);
  background: rgba(74, 222, 128, 0.10);
  color: var(--accent-soft);
  font-family: var(--mono);
  font-size: 12px;
  white-space: nowrap;
}
.points-pill:hover { color: #eafff0; border-color: rgba(74, 222, 128, 0.55); }

.btn-sm { padding: 4px 10px; font-size: 12.5px; }
.field-tip { margin: 7px 0 0; font-size: 11.5px; color: #71808c; }

/* 封面选择 */
.cover-picker { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.cover-box {
  width: 170px;
  height: 104px;
  padding: 0;
  border: 1px dashed var(--line-strong);
  border-radius: 6px;
  background: var(--bg-soft);
  color: var(--muted);
  font-family: inherit;
  font-size: 12.5px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  transition: border-color .15s ease, color .15s ease;
}
.cover-box:hover { border-color: rgba(74, 222, 128, 0.45); color: var(--text); }
.cover-box img { width: 100%; height: 100%; object-fit: cover; }

/* 富文本编辑器 */
.editor {
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  overflow: hidden;
  background: var(--bg-soft);
}
.editor-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  padding: 8px 10px;
  border-bottom: 1px solid var(--line);
  background: var(--panel-2);
}
.editor-toolbar button {
  padding: 4px 10px;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 4px;
  color: var(--muted);
  font-family: inherit;
  font-size: 13px;
  cursor: pointer;
  line-height: 1.3;
}
.editor-toolbar button:hover { background: var(--bg-soft); border-color: var(--line-strong); color: var(--text); }
.editor-toolbar .tb-sep { width: 1px; height: 18px; background: var(--line-strong); margin: 0 4px; }
.editor-toolbar select {
  background: var(--bg-soft);
  color: var(--text);
  border: 1px solid var(--line-strong);
  border-radius: 4px;
  padding: 3px 6px;
  font-family: inherit;
  font-size: 12.5px;
  outline: none;
}
.editor-toolbar input[type="color"] {
  width: 32px;
  height: 27px;
  padding: 0;
  border: 1px solid var(--line-strong);
  border-radius: 4px;
  background: var(--bg-soft);
  cursor: pointer;
}
.editor-body {
  min-height: 220px;
  padding: 12px 14px;
  outline: none;
  line-height: 1.9;
  font-size: 14.5px;
  color: var(--text);
  word-break: break-word;
}
.editor-body:empty:before { content: attr(data-placeholder); color: #66737e; }

/* 富文本渲染 */
.article .content.rich-content { white-space: normal; }
.rich-content p { margin: 0 0 12px; }
.rich-content p:last-child { margin-bottom: 0; }
.rich-content h1, .rich-content h2, .rich-content h3, .rich-content h4 {
  margin: 22px 0 10px;
  line-height: 1.4;
  color: #f2f7fb;
}
.rich-content h2 { font-size: 19px; }
.rich-content h3 { font-size: 17px; }
.rich-content blockquote {
  margin: 14px 0;
  padding: 9px 14px;
  border-left: 3px solid rgba(74, 222, 128, 0.45);
  background: rgba(74, 222, 128, 0.05);
  border-radius: 0 6px 6px 0;
  color: #c6d6ce;
}
.rich-content ul, .rich-content ol { margin: 10px 0; padding-left: 24px; }
.rich-content li { margin: 4px 0; }
.rich-content pre {
  margin: 14px 0;
  padding: 12px 14px;
  background: #0a0f13;
  border: 1px solid var(--line);
  border-radius: 6px;
  overflow: auto;
  font-family: var(--mono);
  font-size: 12.5px;
  white-space: pre;
}
.rich-content code {
  font-family: var(--mono);
  font-size: 12.5px;
  background: rgba(255, 255, 255, 0.06);
  padding: 1px 5px;
  border-radius: 4px;
}
.rich-content pre code { background: none; padding: 0; }
.rich-content img {
  max-width: 100%;
  height: auto;
  border-radius: 6px;
  margin: 12px 0;
  display: block;
}
.rich-content a { text-decoration: underline; }

/* 详情封面与价格 */
.article .cover {
  width: 100%;
  max-height: 340px;
  object-fit: cover;
  border-radius: 6px;
  margin-bottom: 20px;
  display: block;
  border: 1px solid var(--line);
}
.price-row { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 18px; }
.price-chip {
  font-size: 12px;
  padding: 3px 10px;
  border-radius: 4px;
  border: 1px solid rgba(103, 232, 249, 0.28);
  background: rgba(103, 232, 249, 0.07);
  color: #8fd9e6;
}

/* 观看锁罩 */
.paywall {
  margin: 18px 0;
  padding: 36px 20px;
  text-align: center;
  border: 1px dashed var(--line-strong);
  border-radius: 8px;
  background: var(--bg-soft);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}
.paywall h3 { margin: 0; font-size: 17px; color: #eef4f9; }
.paywall p { margin: 0; }
.lock-mark {
  font-family: var(--mono);
  letter-spacing: 4px;
  font-size: 11px;
  color: var(--accent-dim);
}

/* 个人中心 */
.account-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
  padding: 24px 26px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
}
.points-box { text-align: right; }
.points-box .k { font-family: var(--mono); font-size: 10.5px; letter-spacing: 1.2px; color: var(--muted); }
.points-box .v { font-size: 30px; font-weight: 600; color: var(--accent); line-height: 1.15; }
.account-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 16px; }

/* 表格 */
.table-wrap {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: auto;
  background: var(--panel);
}
.data-table { width: 100%; border-collapse: collapse; font-size: 13px; min-width: 640px; }
.data-table th {
  text-align: left;
  font-weight: 500;
  color: var(--muted);
  font-size: 11.5px;
  letter-spacing: .5px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  background: var(--panel-2);
  white-space: nowrap;
}
.data-table td { padding: 10px 12px; border-bottom: 1px solid var(--line); color: #d3dde6; vertical-align: middle; }
.data-table tr:last-child td { border-bottom: none; }
.data-table .ta-r { text-align: right; }
.delta-up { color: var(--accent); font-weight: 600; }
.delta-down { color: var(--danger); font-weight: 600; }

/* 后台 */
.settings-panel { max-width: none; }
.settings-panel .form-row { grid-template-columns: repeat(4, 1fr); }
.adjust-cell { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.input.mini { width: 86px; padding: 5px 8px; font-size: 12.5px; }
.pill-admin {
  font-size: 11px;
  padding: 1px 8px;
  border-radius: 4px;
  background: rgba(74, 222, 128, 0.12);
  border: 1px solid rgba(74, 222, 128, 0.4);
  color: var(--accent-soft);
}

/* 首页卡片封面与价格 */
.card-cover {
  width: 100%;
  height: 150px;
  object-fit: cover;
  border-radius: 6px;
  margin-bottom: 10px;
  border: 1px solid var(--line);
  display: block;
}
.meta-price { color: var(--accent-dim); }

@media (max-width: 760px) {
  .nav-actions { gap: 6px; }
  .nav-actions .btn { padding: 6px 10px; font-size: 12.5px; }
  .points-pill { display: none; }
  .settings-panel .form-row { grid-template-columns: 1fr 1fr; }
  .account-head { flex-direction: column; align-items: flex-start; }
  .points-box { text-align: left; }
}
