/* 格物台 · 科技暗色基调：深空底 + 青蓝霓虹 + 网格背景 */

:root {
  --bg: #16202c;
  --bg-2: #1b2634;
  --panel: rgba(32, 44, 59, 0.72);
  --panel-solid: #223041;
  --ink: #e6eef7;
  --ink-soft: #a3b4c7;
  --accent: #4fd0f5;
  --accent-2: #7dedd2;
  --hot: #ff8a80;
  --line: rgba(130, 185, 235, 0.22);
  --line-strong: rgba(130, 185, 235, 0.42);
  --sans: "PingFang SC", "Microsoft YaHei", "Hiragino Sans GB", system-ui, sans-serif;
  --mono: "Cascadia Mono", Consolas, Menlo, monospace;
  --glow: 0 0 24px rgba(56, 200, 240, 0.12);
  --top-h: 56px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
}

/* 网格 + 顶部辉光 */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background:
    radial-gradient(ellipse 80% 40% at 50% -10%, rgba(56, 200, 240, 0.10), transparent 60%),
    linear-gradient(rgba(102, 161, 220, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(102, 161, 220, 0.04) 1px, transparent 1px);
  background-size: auto, 44px 44px, 44px 44px;
}

/* ---------- 页眉（顶部一小条标题） ---------- */
header.top {
  position: sticky;
  top: 0;
  z-index: 10;
  backdrop-filter: blur(10px);
  background: rgba(22, 32, 44, 0.85);
  border-bottom: 1px solid var(--line);
}

header.top .wrap {
  display: flex;
  align-items: center;
  gap: 18px;
  height: var(--top-h);
}

.wrap { padding: 0 24px; }

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: var(--ink);
}

.brand img { width: 30px; height: 30px; border-radius: 7px; }

.brand b {
  font-size: 17px;
  letter-spacing: 4px;
  font-weight: 600;
}

.brand small {
  display: block;
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: 2.4px;
  color: var(--accent);
  margin-top: -3px;
  opacity: 0.85;
}

nav.main {
  margin-left: auto;
  display: flex;
  gap: 22px;
  font-size: 14px;
}

nav.main a {
  color: var(--ink-soft);
  text-decoration: none;
  padding-bottom: 2px;
  border-bottom: 1px solid transparent;
  transition: color 0.15s ease, border-color 0.15s ease;
}

nav.main a:hover {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

/* ---------- 居中内容列 + 左侧紧贴的项目列表 ---------- */
.shell {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 280px minmax(0, 1080px);
  justify-content: center;
  gap: 28px;
  padding: 28px 24px 64px;
  align-items: start;
}

.side-tag {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 3px;
  color: var(--ink-soft);
  margin-bottom: 14px;
}

.side > .proj-list {
  position: sticky;
  top: calc(var(--top-h) + 28px);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.proj-item {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  text-align: left;
  padding: 11px 14px 11px 18px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel);
  color: var(--ink);
  font-family: inherit;
  font-size: 15px;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}

.proj-item::before {
  content: "";
  position: absolute;
  left: 0;
  top: 11px;
  bottom: 11px;
  width: 3px;
  border-radius: 3px;
  background: transparent;
  transition: background 0.15s ease, box-shadow 0.15s ease;
}

.proj-item:hover { border-color: var(--line-strong); }

.proj-item.active {
  border-color: rgba(56, 200, 240, 0.55);
  background: rgba(56, 200, 240, 0.08);
  box-shadow: var(--glow);
}

.proj-item.active::before {
  background: var(--accent);
  box-shadow: 0 0 10px rgba(56, 200, 240, 0.8);
}

.pi-name {
  font-weight: 600;
  letter-spacing: 1px;
  flex: 1;
}

.pi-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex: none;
}
.pi-dot.b-dev { background: var(--accent-2); box-shadow: 0 0 8px var(--accent-2); }
.pi-dot.b-wip { background: var(--hot); box-shadow: 0 0 8px var(--hot); }
.pi-dot.b-ok  { background: #58d68d; box-shadow: 0 0 8px #58d68d; }

/* ---------- 主内容区 ---------- */
.proj-detail {
  padding: 8px 0 0;
}

.pd-head {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 10px;
}

.pd-head h2 {
  margin: 0;
  font-size: 30px;
  letter-spacing: 2px;
  font-weight: 700;
}

.pd-brief {
  margin: 0 0 20px;
  font-size: 16px;
  color: var(--ink);
}

.pd-feats {
  list-style: none;
  margin: 0 0 22px;
  padding: 0;
}

.pd-feats li {
  position: relative;
  padding: 8px 0 8px 24px;
  font-size: 15px;
  color: var(--ink-soft);
  border-top: 1px dashed var(--line);
}

.pd-feats li:first-child { border-top: 0; }

.pd-feats li::before {
  content: "▸";
  position: absolute;
  left: 4px;
  top: 8px;
  color: var(--accent);
}

.pd-link {
  display: inline-block;
  font-family: var(--mono);
  font-size: 13px;
  letter-spacing: 1px;
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px dashed rgba(56, 200, 240, 0.5);
  padding-bottom: 1px;
}

.pd-link:hover { color: var(--accent-2); border-bottom-color: var(--accent-2); }

/* 详情内嵌更新日志 */
.pd-logs { margin-top: 36px; }

.pd-logs h4 {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 3px;
  color: var(--ink-soft);
  text-transform: uppercase;
  margin: 0 0 6px;
  font-weight: 400;
}

@media (max-width: 1200px) {
  .shell { grid-template-columns: 240px minmax(0, 1fr); gap: 20px; }
}

@media (max-width: 760px) {
  .shell { grid-template-columns: 1fr; padding: 14px 16px 48px; }
  .side { margin: 0 -16px; padding: 0 16px 12px; border-bottom: 1px solid var(--line); }
  .side > .proj-list {
    position: static;
    flex-direction: row;
    overflow-x: auto;
    padding-bottom: 6px;
  }
  .proj-item { min-width: 150px; flex: none; }
  .proj-detail { padding: 20px 0 0; }
}

/* ---------- 徽章（通用） ---------- */
.tag {
  font-family: var(--mono);
  font-size: 12px;
  padding: 2px 9px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--accent);
  background: rgba(56, 200, 240, 0.06);
}

.badge {
  display: inline-block;
  font-family: var(--mono);
  font-size: 11.5px;
  padding: 2px 10px;
  border-radius: 4px;
  letter-spacing: 1px;
}

.b-dev { background: rgba(110, 231, 200, 0.12); color: var(--accent-2); }
.b-wip { background: rgba(255, 122, 112, 0.12); color: var(--hot); }
.b-ok  { background: rgba(88, 214, 141, 0.12); color: #58d68d; }

/* ---------- 更新日志 ---------- */
.log { list-style: none; margin: 0; padding: 0; }

.log li {
  display: grid;
  grid-template-columns: 108px 1fr;
  gap: 18px;
  padding: 13px 0;
  border-top: 1px dashed var(--line);
}

.log li:last-child { border-bottom: 1px dashed var(--line); }

.log time {
  font-family: var(--mono);
  color: var(--accent);
  font-size: 13px;
  letter-spacing: 0.5px;
}

.log .what b { font-weight: 600; font-size: 14.5px; }
.log .what p { margin: 2px 0 0; font-size: 13.5px; color: var(--ink-soft); }

/* ---------- 文档页 ---------- */
.doc { max-width: 1080px; margin: 0 auto; padding: 44px 24px 20px; position: relative; z-index: 1; }

.crumb { font-size: 13px; color: var(--ink-soft); margin-bottom: 18px; }
.crumb a { color: var(--accent); text-decoration: none; }

.doc h1 {
  font-size: 32px;
  letter-spacing: 4px;
  margin: 0 0 6px;
  font-weight: 700;
}

.doc .meta {
  font-family: var(--mono);
  color: var(--accent);
  font-size: 13px;
  margin-bottom: 26px;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 22px 24px;
  margin-bottom: 18px;
}

.panel h2 {
  font-size: 19px;
  letter-spacing: 2px;
  margin: 0 0 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--line);
  font-weight: 600;
}

.panel ul { margin: 0; padding-left: 20px; }
.panel li { font-size: 14.5px; margin-bottom: 7px; color: var(--ink-soft); }
.panel li b { color: var(--ink); font-weight: 600; }
.panel p { font-size: 14.5px; color: var(--ink-soft); margin: 0 0 10px; }
.panel a { color: var(--accent); }

code, .mono {
  font-family: var(--mono);
  background: rgba(56, 200, 240, 0.1);
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 12.5px;
  color: var(--accent-2);
}

pre {
  background: rgba(9, 14, 20, 0.45);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px 16px;
  overflow-x: auto;
  font-size: 13px;
  line-height: 1.7;
  color: var(--ink);
}

table { border-collapse: collapse; width: 100%; font-size: 14px; }
th, td { border: 1px solid var(--line); padding: 8px 12px; text-align: left; }
th { background: rgba(56, 200, 240, 0.08); font-weight: 600; }

.note {
  border-left: 3px solid var(--hot);
  background: rgba(255, 122, 112, 0.07);
  padding: 12px 16px;
  border-radius: 0 8px 8px 0;
  font-size: 14px;
  color: var(--ink-soft);
}

/* ---------- 页脚 ---------- */
footer {
  position: relative;
  z-index: 1;
  padding: 18px 24px 26px;
  border-top: 1px solid var(--line);
  color: var(--ink-soft);
  font-size: 13px;
}

footer .wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
}
footer .spacer { margin-left: auto; }

@media (max-width: 640px) {
  nav.main { gap: 13px; font-size: 13.5px; }
  .log li { grid-template-columns: 1fr; gap: 3px; }
}

/* ---------- 登录弹窗 ---------- */
.modal-mask {
  position: fixed;
  inset: 0;
  z-index: 50;
  background: rgba(4, 7, 11, 0.66);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.modal-mask[hidden] { display: none; }

.modal {
  position: relative;
  width: 100%;
  max-width: 380px;
  background: var(--panel-solid);
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  padding: 26px 26px 22px;
  box-shadow: 0 18px 60px rgba(0, 0, 0, 0.55), var(--glow);
}

.modal-close {
  position: absolute;
  top: 10px;
  right: 14px;
  border: 0;
  background: none;
  font-size: 22px;
  color: var(--ink-soft);
  cursor: pointer;
}

.auth-tabs {
  display: flex;
  gap: 18px;
  margin-bottom: 18px;
}

.auth-tab {
  border: 0;
  background: none;
  font-size: 17px;
  letter-spacing: 2px;
  color: var(--ink-soft);
  cursor: pointer;
  padding: 0 2px 6px;
  border-bottom: 2px solid transparent;
}

.auth-tab.active { color: var(--ink); border-bottom-color: var(--accent); }

#auth-form label {
  display: block;
  font-size: 13px;
  color: var(--ink-soft);
  margin-bottom: 14px;
}

#auth-form input {
  display: block;
  width: 100%;
  margin-top: 5px;
  padding: 9px 12px;
  font-size: 15px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(9, 14, 20, 0.4);
  color: var(--ink);
}

#auth-form input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(56, 200, 240, 0.15);
}

.auth-err { color: var(--hot); font-size: 13px; min-height: 20px; margin-bottom: 8px; }

.auth-submit {
  width: 100%;
  padding: 10px;
  font-size: 15px;
  letter-spacing: 4px;
  border: 0;
  border-radius: 8px;
  background: var(--accent);
  color: #04222e;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s ease;
}

.auth-submit:hover { background: #5cd6f7; }
.auth-submit:disabled { opacity: 0.6; cursor: wait; }

.auth-note { font-size: 12.5px; color: var(--ink-soft); margin: 12px 0 0; }

/* ---------- 控制台 ---------- */
.con-grid {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 20px;
  align-items: start;
}
@media (max-width: 760px) { .con-grid { grid-template-columns: 1fr; } }

.con-side { display: flex; flex-direction: column; gap: 14px; }
.con-user { font-size: 14px; color: var(--ink-soft); }
.con-user b { color: var(--ink); }

.kv-list { list-style: none; margin: 0; padding: 0; }
.kv-list li {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 0;
  border-top: 1px dashed var(--line);
  font-size: 13.5px;
}
.kv-list li:first-child { border-top: 0; }
.kv-list .k { font-family: var(--mono); color: var(--accent); }
.kv-list .v { flex: 1; word-break: break-all; color: var(--ink-soft); }
.kv-list button {
  border: 1px solid var(--line);
  background: none;
  border-radius: 6px;
  padding: 2px 10px;
  font-size: 12px;
  color: var(--hot);
  cursor: pointer;
}
.kv-add { display: flex; flex-direction: column; gap: 8px; margin-top: 12px; }
.kv-add input, .kv-add textarea {
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 8px 10px;
  font-size: 13.5px;
  background: rgba(9, 14, 20, 0.4);
  color: var(--ink);
  font-family: inherit;
}
.kv-add textarea { font-family: var(--mono); min-height: 72px; resize: vertical; }
.kv-add button {
  align-self: flex-start;
  border: 0;
  border-radius: 7px;
  background: var(--accent);
  color: #04222e;
  font-weight: 600;
  padding: 8px 20px;
  font-size: 14px;
  cursor: pointer;
}
.con-empty { color: var(--ink-soft); font-size: 14px; }
