/* Dev Workbench - 暗色主题 */
:root {
  --bg: #0d1017;
  --bg-side: #121622;
  --bg-card: #181d2a;
  --bg-card-2: #1e2433;
  --bg-hover: #232a3a;
  --border: #2a3142;
  --border-light: #353e52;
  --text: #e7ebf3;
  --text-dim: #98a2b8;
  --text-mute: #6b758c;
  --accent: #5b9dff;
  --accent-soft: rgba(91,157,255,.14);
  --green: #34d399;
  --green-soft: rgba(52,211,153,.13);
  --orange: #fbbf24;
  --orange-soft: rgba(251,191,36,.13);
  --red: #f87171;
  --red-soft: rgba(248,113,113,.13);
  --purple: #a78bfa;
  --cyan: #22d3ee;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 12px 36px rgba(0,0,0,.35);
}

* { box-sizing: border-box; }
html, body { margin:0; padding:0; height:100%; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", "PingFang SC", sans-serif;
  font-size: 14px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
.hidden { display: none !important; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font-family: inherit; font-size: inherit; }
::-webkit-scrollbar { width:9px; height:9px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #333c50; border-radius: 6px; border: 2px solid var(--bg); }
::-webkit-scrollbar-thumb:hover { background: #45516b; }

/* ---------- 登录 ---------- */
.login-wrap {
  min-height:100vh; display:flex; align-items:center; justify-content:center;
  background: radial-gradient(1000px 600px at 20% 10%, rgba(91,157,255,.13), transparent 60%),
              radial-gradient(800px 500px at 85% 85%, rgba(167,139,250,.10), transparent 60%), var(--bg);
}
.login-card {
  width: 400px; max-width: calc(100vw - 32px);
  background: var(--bg-card); border:1px solid var(--border);
  border-radius: 18px; padding: 36px 34px 30px; box-shadow: var(--shadow);
}
.login-logo {
  width:52px; height:52px; border-radius:14px; display:flex; align-items:center; justify-content:center;
  background: linear-gradient(135deg, var(--accent), #7c5cff); color:#fff; font-weight:800; font-size:19px;
  margin-bottom:18px; letter-spacing:.5px;
}
.login-card h1 { margin:0; font-size:24px; letter-spacing:.3px; }
.login-sub { margin:4px 0 26px; color:var(--text-dim); font-size:13px; }
.login-card label { display:block; color:var(--text-dim); font-size:12px; margin:14px 0 6px; }
.login-card input { width:100%; }
.login-hint { margin-top:18px; text-align:center; color:var(--text-mute); font-size:12px; }
.form-error { color:var(--red); font-size:12px; min-height:18px; margin-top:8px; }

/* ---------- 布局 ---------- */
.app { display:flex; min-height:100vh; }
.sidebar {
  width: 228px; flex:0 0 228px; background:var(--bg-side); border-right:1px solid var(--border);
  display:flex; flex-direction:column; padding:18px 12px 14px; position:sticky; top:0; height:100vh;
}
.brand { display:flex; align-items:center; gap:10px; padding:4px 10px 22px; }
.brand-mark {
  width:32px; height:32px; border-radius:9px; display:flex; align-items:center; justify-content:center;
  background:linear-gradient(135deg,var(--accent),#7c5cff); color:#fff; font-weight:800; font-size:12px;
}
.brand-text { font-weight:700; font-size:15px; letter-spacing:.3px; }
.nav-group { font-size:11px; color:var(--text-mute); text-transform:uppercase; letter-spacing:1.2px; padding:12px 12px 6px; }
.nav { display:flex; flex-direction:column; gap:3px; }
.nav-item {
  display:flex; align-items:center; gap:11px; padding:9px 12px; border-radius:var(--radius-sm);
  color:var(--text-dim); font-size:13.5px; transition:.15s; cursor:pointer;
}
.nav-item:hover { background:var(--bg-hover); color:var(--text); }
.nav-item.active { background:var(--accent-soft); color:var(--accent); font-weight:600; }
.nav-ico { width:18px; text-align:center; font-size:15px; opacity:.9; }
.sidebar-foot { margin-top:auto; padding:12px 8px 0; border-top:1px solid var(--border); }
.user-chip { display:flex; align-items:center; gap:9px; margin-bottom:10px; padding:0 4px; }
.user-chip .avatar { width:30px; height:30px; font-size:12px; }
.user-meta { min-width:0; }
.user-meta strong { display:block; font-size:12.5px; font-weight:600; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.user-meta span { display:block; font-size:11px; color:var(--text-mute); }

.main { flex:1; min-width:0; display:flex; flex-direction:column; }
.topbar {
  height:60px; flex:0 0 60px; border-bottom:1px solid var(--border); background:rgba(13,16,23,.85);
  backdrop-filter:blur(10px); display:flex; align-items:center; justify-content:space-between;
  padding:0 26px; position:sticky; top:0; z-index:20;
}
.topbar-left { display:flex; align-items:center; gap:14px; }
.topbar h2 { margin:0; font-size:16px; font-weight:650; }
.topbar-right { display:flex; align-items:center; gap:14px; }
.topbar-date { color:var(--text-mute); font-size:12px; }
.avatar {
  width:32px; height:32px; border-radius:50%; display:inline-flex; align-items:center; justify-content:center;
  background:var(--accent); color:#fff; font-weight:700; font-size:13px; flex:0 0 auto;
}
.icon-btn {
  background:transparent; border:1px solid var(--border); color:var(--text-dim); border-radius:7px;
  width:30px; height:30px; cursor:pointer; display:none; align-items:center; justify-content:center;
}
.content { padding:24px 26px 50px; max-width:1500px; width:100%; }

/* ---------- 通用组件 ---------- */
.page-head { display:flex; align-items:flex-start; justify-content:space-between; gap:16px; margin-bottom:20px; flex-wrap:wrap; }
.page-head h3 { margin:0 0 4px; font-size:19px; font-weight:700; }
.page-head p { margin:0; color:var(--text-dim); font-size:12.5px; }
.page-actions { display:flex; gap:8px; flex-wrap:wrap; }

.btn {
  display:inline-flex; align-items:center; justify-content:center; gap:6px;
  padding:8px 14px; border-radius:var(--radius-sm); border:1px solid var(--border);
  background:var(--bg-card-2); color:var(--text); cursor:pointer; font-size:13px; font-weight:500;
  transition:.15s; white-space:nowrap;
}
.btn:hover { background:var(--bg-hover); border-color:var(--border-light); }
.btn:disabled { opacity:.5; cursor:not-allowed; }
.btn-sm { padding:5px 10px; font-size:12px; }
.btn-block { width:100%; }
.btn-primary { background:var(--accent); border-color:var(--accent); color:#fff; }
.btn-primary:hover { background:#4a8ce8; border-color:#4a8ce8; }
.btn-danger { background:var(--red-soft); border-color:rgba(248,113,113,.35); color:var(--red); }
.btn-danger:hover { background:rgba(248,113,113,.22); }
.btn-ghost { background:transparent; border-color:transparent; color:var(--text-dim); }
.btn-ghost:hover { background:var(--bg-hover); color:var(--text); }

input[type=text], input[type=password], input[type=email], input[type=date], select, textarea {
  background:var(--bg); border:1px solid var(--border); color:var(--text);
  padding:9px 11px; border-radius:var(--radius-sm); outline:none; transition:.15s; width:100%;
}
input:focus, select:focus, textarea:focus { border-color:var(--accent); box-shadow:0 0 0 3px var(--accent-soft); }
textarea { resize:vertical; min-height:88px; }
select { cursor:pointer; }

.card { background:var(--bg-card); border:1px solid var(--border); border-radius:var(--radius); padding:18px; }
.card-title { font-size:13px; font-weight:650; margin:0 0 14px; display:flex; align-items:center; justify-content:space-between; }
.card-title span.sub { font-size:11px; color:var(--text-mute); font-weight:400; }

.grid { display:grid; gap:14px; }
.grid-4 { grid-template-columns:repeat(4,1fr); }
.grid-3 { grid-template-columns:repeat(3,1fr); }
.grid-2 { grid-template-columns:repeat(2,1fr); }
.mb16 { margin-bottom:16px; }
.mt16 { margin-top:16px; }

/* 统计卡 */
.stat { background:var(--bg-card); border:1px solid var(--border); border-radius:var(--radius); padding:16px 18px; position:relative; overflow:hidden; }
.stat::after { content:''; position:absolute; right:-18px; top:-18px; width:80px; height:80px; border-radius:50%; background:var(--accent-soft); }
.stat-label { font-size:12px; color:var(--text-dim); margin-bottom:8px; }
.stat-value { font-size:28px; font-weight:750; line-height:1; letter-spacing:-.5px; }
.stat-foot { font-size:11px; color:var(--text-mute); margin-top:9px; }
.stat.c-green::after { background:var(--green-soft); }
.stat.c-orange::after { background:var(--orange-soft); }
.stat.c-purple::after { background:rgba(167,139,250,.14); }
.stat.c-cyan::after { background:rgba(34,211,238,.12); }

/* 标签 */
.tag { display:inline-flex; align-items:center; gap:4px; padding:2px 8px; border-radius:20px; font-size:11px; font-weight:600; line-height:1.6; }
.tag-blue { background:var(--accent-soft); color:var(--accent); }
.tag-green { background:var(--green-soft); color:var(--green); }
.tag-orange { background:var(--orange-soft); color:var(--orange); }
.tag-red { background:var(--red-soft); color:var(--red); }
.tag-purple { background:rgba(167,139,250,.14); color:var(--purple); }
.tag-gray { background:rgba(152,162,184,.12); color:var(--text-dim); }
.dot { width:7px; height:7px; border-radius:50%; display:inline-block; flex:0 0 auto; }

/* 项目卡片 */
.project-card { background:var(--bg-card); border:1px solid var(--border); border-radius:var(--radius); padding:17px; transition:.18s; }
.project-card:hover { border-color:var(--border-light); transform:translateY(-2px); box-shadow:0 8px 24px rgba(0,0,0,.2); }
.pc-head { display:flex; align-items:flex-start; gap:10px; margin-bottom:12px; }
.pc-icon { width:36px; height:36px; border-radius:9px; display:flex; align-items:center; justify-content:center; font-weight:800; color:#fff; font-size:15px; flex:0 0 auto; }
.pc-name { font-weight:700; font-size:15px; margin:0; line-height:1.3; }
.pc-platform { font-size:11px; color:var(--text-mute); margin-top:2px; }
.pc-desc { color:var(--text-dim); font-size:12px; min-height:34px; margin:0 0 12px; }
.pc-meta { display:flex; gap:14px; font-size:11.5px; color:var(--text-mute); padding-top:11px; border-top:1px solid var(--border); }
.pc-meta b { color:var(--text); font-weight:600; }
.pc-actions { display:flex; gap:6px; flex-wrap:wrap; margin-top:12px; }
.pc-repo { font-size:11px; color:var(--text-mute); background:var(--bg); padding:5px 8px; border-radius:6px; margin-bottom:10px; word-break:break-all; font-family:Consolas,Monaco,monospace; }

/* 表格 */
.table-wrap { overflow-x:auto; border:1px solid var(--border); border-radius:var(--radius); background:var(--bg-card); }
table { width:100%; border-collapse:collapse; font-size:13px; }
th { text-align:left; padding:11px 14px; font-size:11.5px; color:var(--text-mute); text-transform:uppercase; letter-spacing:.5px; background:var(--bg-card-2); border-bottom:1px solid var(--border); white-space:nowrap; }
td { padding:11px 14px; border-bottom:1px solid var(--border); vertical-align:middle; }
tr:last-child td { border-bottom:none; }
tbody tr:hover { background:rgba(255,255,255,.015); }
.mono { font-family:Consolas,Monaco,"Courier New",monospace; font-size:12px; }
.cell-strong { font-weight:600; }
.row-actions { display:flex; gap:5px; }

/* 列表条目 */
.list-item { display:flex; align-items:center; gap:12px; padding:11px 0; border-bottom:1px solid var(--border); }
.list-item:last-child { border-bottom:none; }
.li-main { flex:1; min-width:0; }
.li-title { font-size:13px; font-weight:550; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.li-sub { font-size:11px; color:var(--text-mute); margin-top:2px; }
.li-time { font-size:11px; color:var(--text-mute); white-space:nowrap; }

/* 平台分布条 */
.bar-row { display:flex; align-items:center; gap:10px; margin:10px 0; font-size:12px; }
.bar-label { width:80px; color:var(--text-dim); flex:0 0 auto; }
.bar-track { flex:1; height:8px; background:var(--bg); border-radius:10px; overflow:hidden; }
.bar-fill { height:100%; border-radius:10px; transition:width .4s; }
.bar-num { width:26px; text-align:right; color:var(--text-dim); font-weight:600; }

/* 看板 */
.board { display:grid; grid-template-columns:repeat(3,1fr); gap:14px; align-items:start; }
.board-col { background:var(--bg-card); border:1px solid var(--border); border-radius:var(--radius); padding:14px; min-height:180px; }
.board-head { display:flex; align-items:center; justify-content:space-between; margin-bottom:12px; font-size:13px; font-weight:650; }
.board-head .cnt { font-size:11px; color:var(--text-mute); background:var(--bg); padding:1px 7px; border-radius:10px; }
.task-card { background:var(--bg-card-2); border:1px solid var(--border); border-radius:9px; padding:12px; margin-bottom:9px; }
.task-title { font-size:13px; font-weight:550; margin-bottom:6px; }
.task-meta { display:flex; align-items:center; gap:8px; flex-wrap:wrap; font-size:11px; color:var(--text-mute); }
.task-actions { display:flex; gap:5px; margin-top:10px; }

/* 筛选栏 */
.filters { display:flex; gap:9px; flex-wrap:wrap; align-items:center; margin-bottom:16px; }
.filters select, .filters input { width:auto; min-width:140px; }
.chip { padding:6px 13px; border-radius:20px; border:1px solid var(--border); background:var(--bg-card); color:var(--text-dim); font-size:12px; cursor:pointer; transition:.15s; }
.chip:hover { border-color:var(--border-light); color:var(--text); }
.chip.active { background:var(--accent-soft); border-color:rgba(91,157,255,.4); color:var(--accent); font-weight:600; }

/* 弹窗 */
.modal-mask { position:fixed; inset:0; background:rgba(5,8,14,.72); backdrop-filter:blur(3px); display:flex; align-items:center; justify-content:center; z-index:100; padding:20px; }
.modal { background:var(--bg-card); border:1px solid var(--border); border-radius:14px; width:540px; max-width:100%; max-height:90vh; display:flex; flex-direction:column; box-shadow:var(--shadow); }
.modal.wide { width:720px; }
.modal-head { padding:18px 20px; border-bottom:1px solid var(--border); display:flex; align-items:center; justify-content:space-between; }
.modal-head h3 { margin:0; font-size:16px; font-weight:700; }
.modal-body { padding:20px; overflow-y:auto; }
.modal-foot { padding:14px 20px; border-top:1px solid var(--border); display:flex; justify-content:flex-end; gap:8px; }
.x-btn { background:transparent; border:none; color:var(--text-mute); font-size:22px; cursor:pointer; line-height:1; padding:0 4px; }
.x-btn:hover { color:var(--text); }
.form-row { margin-bottom:14px; }
.form-row label { display:block; font-size:12px; color:var(--text-dim); margin-bottom:6px; }
.form-row-2 { display:grid; grid-template-columns:1fr 1fr; gap:12px; }
.form-help { font-size:11px; color:var(--text-mute); margin-top:5px; }

/* Toast */
#toast-root { position:fixed; right:20px; bottom:20px; z-index:200; display:flex; flex-direction:column; gap:8px; }
.toast { background:var(--bg-card-2); border:1px solid var(--border); border-left:3px solid var(--accent); padding:11px 16px; border-radius:8px; font-size:13px; box-shadow:var(--shadow); min-width:220px; animation:slidein .2s ease; }
.toast.ok { border-left-color:var(--green); }
.toast.err { border-left-color:var(--red); }
@keyframes slidein { from { opacity:0; transform:translateY(10px); } to { opacity:1; transform:translateY(0); } }

/* 其他 */
.empty { text-align:center; padding:44px 20px; color:var(--text-mute); font-size:13px; }
.empty-ico { font-size:32px; margin-bottom:10px; opacity:.4; }
.loading { text-align:center; padding:60px; color:var(--text-mute); }
.timeline { position:relative; padding-left:18px; }
.timeline::before { content:''; position:absolute; left:4px; top:4px; bottom:4px; width:1px; background:var(--border); }
.tl-item { position:relative; padding:0 0 16px 0; }
.tl-item::before { content:''; position:absolute; left:-18px; top:7px; width:9px; height:9px; border-radius:50%; background:var(--accent); border:2px solid var(--bg-card); }
.tl-title { font-size:12.5px; }
.tl-sub { font-size:11px; color:var(--text-mute); margin-top:2px; }
.file-list { max-height:230px; overflow-y:auto; border:1px solid var(--border); border-radius:8px; padding:6px; }
.file-item { display:flex; align-items:center; gap:9px; padding:6px 8px; border-radius:6px; font-size:12px; cursor:pointer; }
.file-item:hover { background:var(--bg-hover); }
.file-code { font-family:Consolas,monospace; font-size:11px; color:var(--orange); width:22px; }
.file-name { flex:1; word-break:break-all; }
.code-inline { background:var(--bg); border:1px solid var(--border); padding:1px 5px; border-radius:4px; font-size:11px; }

@media (max-width:1100px) {
  .grid-4 { grid-template-columns:repeat(2,1fr); }
  .grid-3 { grid-template-columns:repeat(2,1fr); }
}
@media (max-width:820px) {
  .sidebar { width:64px; flex-basis:64px; padding:14px 8px; }
  .brand-text, .nav-group, .nav-item span:not(.nav-ico), .user-meta, .sidebar-foot .btn { display:none; }
  .nav-item { justify-content:center; padding:11px 0; }
  .brand { justify-content:center; padding:4px 0 20px; }
  .user-chip { justify-content:center; }
  .grid-4, .grid-3, .grid-2, .board { grid-template-columns:1fr; }
  .content { padding:18px 14px 40px; }
  .topbar { padding:0 14px; }
  .topbar-date { display:none; }
  .icon-btn { display:flex; }
  .sidebar.mobile-open { width:228px; flex-basis:228px; position:fixed; z-index:60; box-shadow:var(--shadow); }
  .sidebar.mobile-open .brand-text,
  .sidebar.mobile-open .nav-group,
  .sidebar.mobile-open .nav-item span:not(.nav-ico),
  .sidebar.mobile-open .user-meta,
  .sidebar.mobile-open .sidebar-foot .btn { display:block; }
  .sidebar.mobile-open .nav-item { justify-content:flex-start; padding:9px 12px; }
  .sidebar.mobile-open .brand { justify-content:flex-start; padding:4px 10px 22px; }
  .sidebar.mobile-open .user-chip { justify-content:flex-start; }
}
