/* 研发助手 门户样式 */
* { box-sizing: border-box; margin: 0; padding: 0; }
:root {
  --accent: #3b6cff;
  --accent-dark: #2f55d6;
  --bg: #f4f6fb;
  --card: #ffffff;
  --text: #1f2430;
  --muted: #7a8194;
  --line: #e6e9f2;
  --err: #e5484d;
  --warn: #f5a524;
  --ok: #2ca66b;
}
html, body { height: 100%; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Segoe UI", sans-serif;
  background: var(--bg); color: var(--text); display: flex; min-height: 100vh;
}

/* ---------- 左侧导航 ---------- */
.sidebar {
  width: 232px; flex-shrink: 0; background: var(--card);
  border-right: 1px solid var(--line);
  display: flex; flex-direction: column;
  position: sticky; top: 0; height: 100vh;
}
.brand {
  display: flex; align-items: center; gap: 10px;
  padding: 18px 16px 14px; text-decoration: none; color: var(--text);
  border-bottom: 1px solid var(--line);
}
.brand-icon {
  width: 38px; height: 38px; border-radius: 10px;
  background: linear-gradient(135deg, #3b6cff, #7a5cff);
  display: flex; align-items: center; justify-content: center; font-size: 20px;
}
.brand-name { font-size: 16px; font-weight: 700; }
.brand-sub { font-size: 11px; color: var(--muted); margin-top: 1px; }
.nav { flex: 1; overflow-y: auto; padding: 10px 10px; }
.nav-group {
  font-size: 11px; color: var(--muted); padding: 14px 10px 6px; letter-spacing: 1px;
}
.nav-item {
  display: flex; align-items: center; gap: 8px;
  padding: 9px 10px; border-radius: 8px; text-decoration: none;
  color: var(--text); font-size: 14px; margin-bottom: 2px;
}
.nav-item .ni { width: 20px; text-align: center; }
.nav-item:hover { background: #f0f3ff; }
.nav-item.active { background: #eaf0ff; color: var(--accent-dark); font-weight: 600; }
.nav-item.soon { color: var(--muted); }
.tag {
  margin-left: auto; font-size: 10px; color: var(--muted);
  border: 1px solid var(--line); border-radius: 4px; padding: 1px 5px; flex-shrink: 0;
}
.sidebar-footer {
  padding: 12px 16px; font-size: 11px; color: var(--muted); border-top: 1px solid var(--line);
}

/* ---------- 右侧主区 ---------- */
.main { flex: 1; min-width: 0; }
.page { max-width: 880px; margin: 0 auto; padding: 32px 32px 64px; }
.hero { margin-bottom: 26px; }
.hero h1 { font-size: 24px; margin-bottom: 8px; }
.hero p { color: var(--muted); font-size: 14px; line-height: 1.7; }
.section-title { font-size: 15px; margin: 26px 0 12px; color: var(--text); }

.cards { display: grid; grid-template-columns: 1fr; gap: 12px; }
.card {
  display: flex; align-items: center; gap: 14px; text-decoration: none;
  background: var(--card); border: 1px solid var(--line); border-radius: 14px;
  padding: 16px 18px; transition: box-shadow .15s, transform .15s;
}
a.card:hover { box-shadow: 0 6px 20px rgba(59,108,255,.10); transform: translateY(-1px); }
.card.disabled { opacity: .62; }
.card-icon {
  width: 44px; height: 44px; border-radius: 12px; background: #f0f3ff;
  display: flex; align-items: center; justify-content: center; font-size: 22px; flex-shrink: 0;
}
.card-body { flex: 1; min-width: 0; }
.card-name { font-size: 15px; font-weight: 600; margin-bottom: 3px; }
.card-desc { font-size: 12.5px; color: var(--muted); }
.card-arrow { color: #c3c8d6; font-size: 22px; }
.chip {
  font-size: 10.5px; padding: 2px 8px; border-radius: 999px;
  background: #eef1f6; color: var(--muted); margin-left: 6px; font-weight: 400;
}
.chip.on { background: #e3f6ec; color: var(--ok); }

/* ---------- 工具页 ---------- */
.tool-head { display: flex; gap: 14px; align-items: flex-start; margin-bottom: 22px; }
.tool-head-icon {
  width: 52px; height: 52px; border-radius: 14px; background: #eaf0ff;
  display: flex; align-items: center; justify-content: center; font-size: 28px; flex-shrink: 0;
}
.tool-head h1 { font-size: 21px; margin-bottom: 6px; }
.tool-desc { color: var(--muted); font-size: 13.5px; line-height: 1.7; }
.tool-desc b { color: var(--text); }

.panel {
  background: var(--card); border: 1px solid var(--line); border-radius: 14px;
  padding: 22px; margin-bottom: 18px;
}
.steps { display: grid; gap: 9px; margin-bottom: 18px; }
.step { display: flex; gap: 10px; font-size: 13.5px; line-height: 1.6; align-items: baseline; }
.step-no {
  width: 20px; height: 20px; border-radius: 50%; background: var(--accent); color: #fff;
  font-size: 12px; display: inline-flex; align-items: center; justify-content: center;
  flex-shrink: 0; transform: translateY(3px);
}

.drop {
  border: 2px dashed #c9d3ea; border-radius: 12px; padding: 30px 16px;
  text-align: center; cursor: pointer; transition: border-color .15s, background .15s;
}
.drop:hover, .drop.over { border-color: var(--accent); background: #f6f9ff; }
.drop-icon { font-size: 30px; margin-bottom: 8px; }
.drop-main { font-size: 14.5px; }
.drop-main.hasfile { color: var(--accent-dark); font-weight: 600; }
.drop-sub { font-size: 12px; color: var(--muted); margin-top: 5px; }

.actions { margin-top: 16px; display: flex; gap: 10px; }
.btn {
  border: none; border-radius: 10px; padding: 10px 22px; font-size: 14px;
  cursor: pointer; text-decoration: none; display: inline-block; text-align: center;
}
.btn.primary { background: var(--accent); color: #fff; }
.btn.primary:hover { background: var(--accent-dark); }
.btn.primary:disabled { background: #b9c6ee; cursor: not-allowed; }
.btn.ghost { background: transparent; border: 1px solid var(--line); color: var(--text); }
.status {
  margin-top: 14px; padding: 10px 14px; border-radius: 10px; font-size: 13.5px;
  background: #f0f3ff; color: var(--accent-dark);
}
.status.error { background: #fdebec; color: var(--err); }

.metrics { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 16px; }
.metric {
  background: #f8f9fd; border-radius: 12px; padding: 14px; text-align: center;
}
.metric-v { font-size: 19px; font-weight: 700; }
.metric-v.bad { color: var(--err); }
.metric-k { font-size: 12px; color: var(--muted); margin-top: 4px; }

.filter { display: flex; gap: 8px; margin-bottom: 12px; }
.fbtn {
  border: 1px solid var(--line); background: #fff; border-radius: 999px;
  padding: 4px 14px; font-size: 12.5px; cursor: pointer; color: var(--text);
}
.fbtn.active { background: var(--accent); border-color: var(--accent); color: #fff; }

.itable { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.itable th {
  text-align: left; padding: 8px 10px; background: #f8f9fd; color: var(--muted);
  font-weight: 600; border-bottom: 1px solid var(--line);
}
.itable td { padding: 8px 10px; border-bottom: 1px solid var(--line); }
.lv { font-size: 11px; padding: 2px 8px; border-radius: 4px; }
.lv.错误 { background: #fdebec; color: var(--err); }
.lv.警告 { background: #fdf4e3; color: #b97d10; }
.ok-line { padding: 14px; background: #e9f8f0; color: var(--ok); border-radius: 10px; font-size: 13.5px; }
.hint { margin-top: 14px; font-size: 12.5px; color: var(--muted); }

.rules { margin-top: 4px; }
.rules summary { cursor: pointer; font-size: 13.5px; color: var(--accent-dark); }
.rules ul { margin: 12px 0 4px 18px; display: grid; gap: 8px; font-size: 13px; line-height: 1.7; color: var(--text); }

/* 接口说明页 */
.panel h3 { font-size: 15px; margin-bottom: 10px; }
.panel p { font-size: 13.5px; line-height: 1.7; margin-bottom: 8px; }
.panel p.muted { color: var(--muted); }
.code {
  background: #0f172a; color: #dbe7ff; border-radius: 10px; padding: 14px 16px;
  font-size: 12.5px; line-height: 1.7; overflow-x: auto; font-family: "SF Mono", Menlo, Consolas, monospace;
  white-space: pre; margin: 8px 0;
}
.plain { margin: 4px 0 0 18px; display: grid; gap: 8px; font-size: 13.5px; line-height: 1.6; }
.plain code { background: #eef1f6; padding: 1px 6px; border-radius: 4px; font-size: 12.5px; }

/* 建设中 / 404 */
.soon-panel { text-align: center; padding: 56px 24px; }
.soon-icon { font-size: 44px; margin-bottom: 14px; }
.soon-panel h1 { font-size: 20px; margin-bottom: 10px; }
.soon-panel p { color: var(--muted); font-size: 13.5px; margin-bottom: 6px; }
.soon-panel .btn { margin-top: 14px; }

@media (max-width: 720px) {
  body { flex-direction: column; }
  .sidebar { width: 100%; height: auto; position: static; }
  .metrics { grid-template-columns: repeat(2, 1fr); }
  .page { padding: 20px 16px 48px; }
}

/* ---------- 开发工作台 ---------- */
.muted { color: #7a8194; font-size: 12.5px; }
.dev-topbar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 18px; flex-wrap: wrap; gap: 10px; }
.dev-topbar h1 { font-size: 20px; display: flex; align-items: center; gap: 8px; }
.dev-topbar > div { display: flex; gap: 8px; }
.chip.draft { background: #fdf4e3; color: #b97d10; }
.chip.pub { background: #e3f6ec; color: var(--ok); }
.btn.danger { background: #fdebec; color: var(--err); }
.btn.danger:hover { background: #f9d3d5; }
.btn.sm { padding: 4px 10px; font-size: 12px; border-radius: 7px; }

.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 18px; }
.fitem label { display: block; font-size: 12.5px; color: var(--muted); margin-bottom: 6px; }
.input, .ptable input, .ptable select {
  width: 100%; border: 1px solid var(--line); border-radius: 9px;
  padding: 9px 12px; font-size: 13.5px; background: #fff; color: var(--text);
}
.input:focus { outline: none; border-color: var(--accent); }
.switch { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text); }
.req-star { color: var(--err); }

.code-editor {
  width: 100%; min-height: 420px; border: 1px solid var(--line); border-radius: 10px;
  padding: 14px; font-family: "SF Mono", Menlo, Consolas, monospace; font-size: 13px;
  line-height: 1.65; background: #fafbfe; color: #24292f; resize: vertical; white-space: pre;
}
.code-editor.small { min-height: 140px; }
.code-editor:focus { outline: none; border-color: var(--accent); }

.ptable { width: 100%; border-collapse: collapse; margin-bottom: 10px; }
.ptable th { text-align: left; font-size: 12px; color: var(--muted); padding: 6px 8px; border-bottom: 1px solid var(--line); }
.ptable td { padding: 6px 8px; border-bottom: 1px solid var(--line); }
.view-toggle { display: flex; gap: 8px; margin-bottom: 12px; }

.ver-row { display: flex; align-items: center; gap: 12px; padding: 8px 0; border-bottom: 1px dashed var(--line); font-size: 13.5px; }
.danger-zone { border-color: #f2c6c8; }
.danger-zone h3 { color: var(--err); margin-bottom: 10px; }
.fn-card .card-desc { max-width: 560px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- 登录页 ---------- */
.login-body { display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #eef2ff, #f6f9ff); }
.login-card { background: #fff; border-radius: 18px; box-shadow: 0 12px 40px rgba(59,108,255,.12);
  padding: 40px 44px; width: 360px; text-align: center; }
.login-icon { font-size: 40px; margin-bottom: 10px; }
.login-card h1 { font-size: 20px; margin-bottom: 4px; }
.login-card .muted { margin-bottom: 22px; }
.login-input { width: 100%; padding: 11px 14px; border: 1px solid var(--line); border-radius: 10px;
  font-size: 14px; margin-bottom: 12px; }
.login-input:focus { outline: none; border-color: var(--accent); }
.login-btn { width: 100%; }
.login-msg { color: var(--err); font-size: 13px; margin-bottom: 10px; }
