/* pm — 项目管理系统样式。
 *
 * 设计口径：与门户 / ai-gateway / ops-console / sso 共用同一套薄荷色板
 * （事实源在根仓 platform/ui/mint-tokens.css）。pm 是独立进程，运行时共享
 * 不了一份 CSS，所以 :root 里内嵌一份拷贝，由 scripts/harness/verify-ui-tokens.sh
 * 校验一致——只改某一仓会静默回退成旧配色，肉眼很难发现。
 *
 * 2026-11-03 这轮改动（用户要求「整体风格调整一下，统一成和其他的一致」）：
 *   1. 橙 #d97706 品牌色收敛到 --accent 薄荷绿（导航激活条 / 主按钮 / 登录卡标题）；
 *   2. GitHub 系蓝 #0969da 链接与 focus 收敛到 --accent-ink / --accent-dim；
 *   3. 底色、边线、表头、圆角、阴影全部换成 token（--bg / --line / --surface-2 /
 *      --r / --shadow），与门户卡片同质感；
 *   4. 状态徽章按语义映射：open→warn、fixing→accent2、pr→accent、failed→bad、
 *      closed→ok；品牌名前加薄荷圆点，和门户 .brand::before 同款。
 *
 * 类名一个都没动：五个页面模板不需要跟着改。
 */

/* === MINT TOKENS BEGIN (同步自 platform/ui/mint-tokens.css，勿手改) === */
:root {
  color-scheme: light;

  /* 底与面 */
  --bg: #f5f8f7;
  --bg-deep: #eef3f2;
  --surface: #ffffff;
  --surface-2: #f0f6f4;
  --line: #dde5e3;
  --line-soft: #eaf0ee;

  /* 文字 */
  --ink: #1b2b28;
  --ink-dim: #52645f;
  --ink-faint: #6f807b;

  /* 强调：薄荷绿 */
  --accent: #12a08c;
  --accent-ink: #0b7a6b;
  --accent-dim: #8ecfc5;
  --accent-tint: #e6f6f3;
  --accent-line: #b7e3db;

  /* 第二强调：雾蓝，只做次要标记 */
  --accent2: #5b8def;
  --accent2-tint: #e9f0fd;

  /* 语义色 */
  --ok: #2e9e6b;
  --ok-tint: #e7f6ee;
  --ok-line: #a9dfc3;

  --warn: #c47a13;
  --warn-tint: #fdf3e3;
  --warn-line: #f0d3a3;

  --bad: #cf3f45;
  --bad-tint: #fdeced;
  --bad-line: #f3bfc1;

  /* 层次与圆角 */
  --shadow: 0 1px 2px rgba(24, 51, 45, 0.04), 0 4px 14px rgba(24, 51, 45, 0.05);
  --shadow-lift: 0 2px 6px rgba(24, 51, 45, 0.07), 0 10px 24px rgba(24, 51, 45, 0.07);

  /* 字体与圆角 */
  --mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  --sans: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB",
    "Microsoft YaHei", "Source Han Sans SC", sans-serif;
  --r: 12px;
  --r-sm: 8px;
}
/* === MINT TOKENS END === */

* { box-sizing: border-box; }
/* 页面底色：两团极淡的光晕（与 mint-tokens.css 的 body 同款） */
body {
  margin: 0; font: 14px/1.55 var(--sans);
  background:
    radial-gradient(1100px 520px at 12% -8%, #e8f5f1 0%, transparent 62%),
    radial-gradient(800px 460px at 96% 0%, #eaf1fd 0%, transparent 58%),
    var(--bg);
  color: var(--ink);
}
main { max-width: 1100px; margin: 0 auto; padding: 16px 20px 48px; }
h1 { font-size: 20px; margin: 8px 0 12px; }
h2 { font-size: 15px; margin: 0 0 8px; }
a { color: var(--accent-ink); text-decoration: none; }
a:hover { text-decoration: underline; }

.nav {
  display: flex; align-items: center; gap: 14px;
  background: var(--surface); border-bottom: 1px solid var(--line); padding: 0 20px; height: 44px;
  position: sticky; top: 0; z-index: 5;
}
/* 薄荷圆点：与门户 .brand::before、网关 .brand .dot 同款 */
.nav .brand {
  font-weight: 700; color: var(--ink); padding-left: 17px; position: relative;
}
.nav .brand::before {
  content: ""; width: 9px; height: 9px; border-radius: 50%;
  background: var(--accent); box-shadow: 0 0 0 3px var(--accent-tint);
  position: absolute; left: 0; top: 50%; transform: translateY(-50%);
}
.nav a { color: var(--ink-dim); padding: 10px 2px; }
.nav a:hover { color: var(--accent-ink); text-decoration: none; }
.nav a.on { color: var(--ink); font-weight: 600; border-bottom: 2px solid var(--accent); }
.nav .muted-link { opacity: .7; }
.spacer { flex: 1; }

.row { display: flex; align-items: center; gap: 10px; }
.cols2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 860px) { .cols2 { grid-template-columns: 1fr; } }
.split { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 960px) { .split { grid-template-columns: 1fr; } }

.panel {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r);
  padding: 14px 16px; margin-bottom: 14px; box-shadow: var(--shadow);
}
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px 14px; }
@media (max-width: 860px) { .grid3 { grid-template-columns: 1fr; } }
label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--ink-dim); }
label.inline { flex-direction: row; align-items: center; gap: 6px; padding-top: 18px; }
input, select {
  font: inherit; padding: 6px 8px; border: 1px solid var(--line); border-radius: var(--r-sm);
  background: var(--surface); color: var(--ink);
}
input:focus, select:focus { outline: 2px solid var(--accent-dim); border-color: var(--accent); }

button, .button {
  font: inherit; padding: 6px 14px; border-radius: var(--r-sm); cursor: pointer;
  border: 1px solid var(--line); background: var(--surface); color: var(--ink);
  display: inline-block;
}
button:hover, .button:hover { background: var(--surface-2); text-decoration: none; }
button.primary, .button.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
button.primary:hover, .button.primary:hover { background: var(--accent-ink); border-color: var(--accent-ink); }
button.ghost { background: transparent; }
button.sm { padding: 2px 8px; font-size: 12px; }
button:disabled { opacity: .5; cursor: default; }

.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; }
.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 14px 16px;
  display: block; color: inherit; box-shadow: var(--shadow);
  transition: border-color .12s, box-shadow .12s;
}
.card:hover {
  border-color: var(--accent-dim); text-decoration: none; box-shadow: var(--shadow-lift);
}
.card h3 { margin: 0 0 6px; font-size: 15px; }
.card .sub { color: var(--ink-dim); font-size: 12px; word-break: break-all; }
.badges { margin-top: 8px; display: flex; gap: 6px; flex-wrap: wrap; }

.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip {
  background: var(--surface); border: 1px solid var(--line); border-radius: 999px;
  padding: 3px 12px; font-size: 12px;
}
.chip b { font-size: 13px; }

.badge {
  display: inline-block; padding: 1px 8px; border-radius: 999px; font-size: 11px;
  border: 1px solid transparent; white-space: nowrap;
}
/* 状态徽章 → 薄荷语义色：open=warn、fixing=accent2、pr=accent、failed=bad、closed=ok */
.b-open { background: var(--warn-tint); border-color: var(--warn-line); color: var(--warn); }
.b-fixing { background: var(--accent2-tint); border-color: var(--accent2-tint); color: var(--accent2); }
.b-pr { background: var(--accent-tint); border-color: var(--accent-line); color: var(--accent-ink); }
.b-failed { background: var(--bad-tint); border-color: var(--bad-line); color: var(--bad); }
.b-closed { background: var(--ok-tint); border-color: var(--ok-line); color: var(--ok); }
.b-draft { background: var(--surface-2); border-color: var(--line); color: var(--ink-dim); }
.b-done { background: var(--ok-tint); border-color: var(--ok-line); color: var(--ok); }
.b-cancelled { background: var(--surface-2); border-color: var(--line); color: var(--ink-faint); }
.b-P0, .b-P1 { background: var(--bad-tint); border-color: var(--bad-line); color: var(--bad); }
.b-P2 { background: var(--warn-tint); border-color: var(--warn-line); color: var(--warn); }
.b-P3 { background: var(--surface-2); border-color: var(--line); color: var(--ink-dim); }
.b-ok { background: var(--ok-tint); border-color: var(--ok-line); color: var(--ok); }
.b-bad { background: var(--bad-tint); border-color: var(--bad-line); color: var(--bad); }

.tbl { width: 100%; border-collapse: collapse; background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; }
.tbl th, .tbl td { padding: 8px 10px; border-bottom: 1px solid var(--line-soft); text-align: left; }
.tbl th { background: var(--surface-2); font-size: 12px; color: var(--ink-dim); font-weight: 600; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl tr:hover td { background: var(--surface-2); }
.tbl .empty, .empty { color: var(--ink-faint); text-align: center; padding: 18px 0; }
.tbl.compact th, .tbl.compact td { padding: 5px 8px; font-size: 12px; }
.tbl .title-link { cursor: pointer; }
.tbl .title-link:hover { color: var(--accent-ink); }

.list { list-style: none; margin: 0; padding: 0; }
.list li { padding: 7px 2px; border-bottom: 1px solid var(--line-soft); display: flex;
  gap: 8px; align-items: center; }
.list li:last-child { border-bottom: 0; }
.list .grow { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis;
  white-space: nowrap; }
.list a { color: inherit; }

.meta { color: var(--ink-dim); font-size: 12px; margin-bottom: 12px;
  display: flex; gap: 14px; flex-wrap: wrap; }
.meta code { background: var(--surface-2); padding: 1px 6px; border-radius: 4px; }

.prd-panel { min-height: 320px; }
.prd-head { font-weight: 600; margin-bottom: 8px; color: var(--ink-dim); font-size: 13px; }
.markdown { font-size: 13px; }
.markdown h1, .markdown h2, .markdown h3 { border-bottom: 1px solid var(--line-soft);
  padding-bottom: 4px; }
.markdown pre { background: var(--surface-2); padding: 10px; border-radius: 6px; overflow: auto; }
.markdown code { background: var(--surface-2); padding: 1px 5px; border-radius: 4px;
  font-size: 12px; }
.markdown pre code { background: none; padding: 0; }
.markdown table { border-collapse: collapse; }
.markdown th, .markdown td { border: 1px solid var(--line); padding: 4px 8px; }

.more { font-size: 12px; font-weight: 400; }
.err { background: var(--bad-tint); border: 1px solid var(--bad-line); color: var(--bad);
  padding: 8px 12px; border-radius: 6px; margin-bottom: 10px; }

.login-body { display: flex; align-items: center; justify-content: center;
  min-height: 100vh; }
.login-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r);
  padding: 28px 32px; width: 320px; box-shadow: var(--shadow-lift); }
.login-card h1 { margin: 0 0 16px; font-size: 18px; text-align: center;
  color: var(--accent-ink); }
.login-card form { display: flex; flex-direction: column; gap: 12px; }
.login-card button { padding: 8px; background: var(--accent); border-color: var(--accent);
  color: #fff; }
.login-card button:hover { background: var(--accent-ink); border-color: var(--accent-ink); }
