:root {
  --bg: #f5f6f8;
  --panel: #ffffff;
  --border: #e3e6ea;
  --text: #1f2329;
  --muted: #6b7280;
  --primary: #0e8a6a;
  --primary-d: #0b7256;
  --accent: #d98324;
  --danger: #d24b4b;
  --blue: #2f6fed;
  --radius: 10px;
  --shadow: 0 1px 3px rgba(16,24,40,.08);
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  font-size: 14px;
  line-height: 1.55;
}
a { color: var(--primary); text-decoration: none; }
h2.ptitle { font-size: 18px; margin: 4px 0 14px; }

.layout { display: flex; min-height: 100vh; }
.sidebar {
  width: 210px; flex-shrink: 0; background: var(--panel);
  border-right: 1px solid var(--border); padding: 14px 10px; position: sticky; top: 0; height: 100vh; overflow-y: auto;
}
.brand { font-weight: 700; font-size: 15px; padding: 6px 8px 14px; color: var(--primary-d); }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav a { padding: 9px 10px; border-radius: 8px; color: var(--text); display: flex; gap: 8px; align-items: center; }
.nav a:hover { background: #eef2f5; }
.nav a.active { background: var(--primary); color: #fff; }

.content { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
  display: flex; align-items: center; gap: 10px; padding: 10px 16px;
  background: var(--panel); border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 20;
}
.menu-toggle { display: none; background: none; border: 1px solid var(--border); border-radius: 8px; padding: 4px 10px; font-size: 18px; cursor: pointer; }
.cmdbox { flex: 1; display: flex; gap: 8px; }
.cmdbox input { flex: 1; }
.topright { display: flex; align-items: center; gap: 12px; }
.sync { color: var(--muted); font-size: 12px; white-space: nowrap; }
.linkbtn { background: none; border: none; color: var(--danger); cursor: pointer; font-size: 13px; }

.view { padding: 18px 20px 60px; max-width: 1100px; width: 100%; }

input, textarea, select {
  width: 100%; padding: 8px 10px; border: 1px solid var(--border); border-radius: 8px;
  background: #fff; color: var(--text); font-size: 14px; font-family: inherit;
}
input:focus, textarea:focus, select:focus { outline: none; border-color: var(--primary); }
textarea { min-height: 90px; resize: vertical; }
label { display: block; font-size: 13px; color: var(--muted); margin: 10px 0 4px; }

button, .btn {
  background: var(--primary); color: #fff; border: none; border-radius: 8px;
  padding: 8px 14px; font-size: 14px; cursor: pointer; font-family: inherit;
}
button:hover, .btn:hover { background: var(--primary-d); }
button.ghost, .btn.ghost { background: #fff; color: var(--text); border: 1px solid var(--border); }
button.ghost:hover { background: #f0f2f4; }
button.blue { background: var(--blue); }
button.danger { background: var(--danger); }
button.sm { padding: 4px 10px; font-size: 13px; border-radius: 6px; }
button:disabled { opacity: .5; cursor: not-allowed; }

.card { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; margin-bottom: 16px; box-shadow: var(--shadow); }
.card h3 { margin: 0 0 10px; font-size: 15px; }
.row { display: flex; gap: 12px; flex-wrap: wrap; }
.row > * { flex: 1; min-width: 140px; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 12px; }
.stat { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px; }
.stat .num { font-size: 24px; font-weight: 700; color: var(--primary-d); }
.stat .lbl { color: var(--muted); font-size: 13px; }

table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--border); vertical-align: top; }
th { color: var(--muted); font-weight: 600; font-size: 13px; }
.tw { overflow-x: auto; }

.list-item { border: 1px solid var(--border); border-radius: 8px; padding: 12px 14px; margin-bottom: 10px; background: #fbfcfd; }
.list-item .head { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; }
.list-item .meta { color: var(--muted); font-size: 12px; }
.tag { display: inline-block; background: #eef3ff; color: var(--blue); border-radius: 20px; padding: 1px 10px; font-size: 12px; margin: 2px 4px 2px 0; }
.tag.green { background: #e7f6ef; color: var(--primary-d); }
.tag.orange { background: #fdf1e3; color: var(--accent); }
.badge { display: inline-block; padding: 1px 8px; border-radius: 6px; font-size: 12px; }
.badge.new { background: #eef3ff; color: var(--blue); }
.badge.following { background: #fdf1e3; color: var(--accent); }
.badge.won { background: #e7f6ef; color: var(--primary-d); }
.badge.lost { background: #f3f4f6; color: var(--muted); }

.progress { background: #eceff3; border-radius: 20px; height: 10px; overflow: hidden; }
.progress > div { height: 100%; background: var(--primary); }
.muted { color: var(--muted); }
.pre { white-space: pre-wrap; background: #f6f8fa; border: 1px solid var(--border); border-radius: 8px; padding: 10px 12px; }
.hint { background: #fff8ec; border: 1px solid #f3e0bd; color: #8a5a12; border-radius: 8px; padding: 10px 12px; margin-bottom: 12px; font-size: 13px; }
.okbox { background: #eefaf4; border: 1px solid #bfe8d4; color: #0b7256; border-radius: 8px; padding: 10px 12px; }
.seg { border-left: 3px solid var(--primary); padding: 4px 12px; margin: 8px 0; background: #fbfcfd; border-radius: 0 8px 8px 0; }
.seg .t { color: var(--muted); font-size: 12px; }
.flex { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.between { justify-content: space-between; }
.mt { margin-top: 12px; }
.mb { margin-bottom: 12px; }

.toast {
  position: fixed; left: 50%; bottom: 32px; transform: translateX(-50%) translateY(20px);
  background: #1f2329; color: #fff; padding: 10px 18px; border-radius: 8px; opacity: 0;
  transition: all .25s; z-index: 100; pointer-events: none; max-width: 80%;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* 登录页 */
.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 20px; }
.login-card { background: var(--panel); border: 1px solid var(--border); border-radius: 14px; padding: 28px; width: 360px; max-width: 100%; box-shadow: var(--shadow); }
.login-card h1 { font-size: 20px; margin: 0 0 4px; }
.login-card .sub { color: var(--muted); font-size: 13px; margin-bottom: 16px; }

@media (max-width: 860px) {
  .sidebar { position: fixed; left: -220px; top: 0; z-index: 40; transition: left .2s; height: 100vh; }
  body.nav-open .sidebar { left: 0; }
  .menu-toggle { display: inline-block; }
  .cmdbox input { font-size: 13px; }
  .view { padding: 14px; }
  .sync { display: none; }
}
