* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  color: #2b2f36;
  background: #f4f6f9;
  font-size: 14px;
  line-height: 1.6;
}
a { color: #2f6fed; text-decoration: none; }
a:hover { text-decoration: underline; }
.wrap { max-width: 1160px; margin: 0 auto; padding: 0 20px; }

/* 顶栏 */
.topbar { background: #1f2733; color: #fff; }
.topbar-inner { display: flex; align-items: center; height: 56px; gap: 28px; }
.brand { color: #fff; font-size: 17px; font-weight: 600; letter-spacing: 1px; }
.brand:hover { text-decoration: none; color: #fff; }
.nav { display: flex; gap: 4px; flex: 1; }
.nav a { color: #b9c2cf; padding: 6px 14px; border-radius: 6px; }
.nav a:hover { color: #fff; text-decoration: none; background: rgba(255,255,255,.08); }
.nav a.active { color: #fff; background: #2f6fed; }
.topbar-user { display: flex; align-items: center; gap: 12px; color: #cfd6df; }
.uname { color: #fff; }
.logout { color: #9aa7b8; }
.logout:hover { color: #fff; }

.content { padding: 24px 20px 40px; min-height: calc(100vh - 130px); }
.footer { padding: 16px 20px; color: #9aa3ae; font-size: 12px; text-align: center; border-top: 1px solid #e6e9ee; }

/* 页头 */
.page-head { display: flex; align-items: center; justify-content: space-between; margin: 4px 0 18px; }
.page-head h2 { margin: 0; font-size: 20px; }
.detail-title { flex: 1; }
.page-actions { display: flex; gap: 8px; }

/* 按钮 */
.btn { display: inline-block; padding: 7px 16px; border: 1px solid #d4d9e0; background: #fff; color: #2b2f36; border-radius: 6px; cursor: pointer; font-size: 14px; }
.btn:hover { border-color: #b7bec9; text-decoration: none; }
.btn-primary { background: #2f6fed; border-color: #2f6fed; color: #fff; }
.btn-primary:hover { background: #2457c4; border-color: #2457c4; color: #fff; }
.btn-block { width: 100%; padding: 10px; font-size: 15px; }

/* 统计卡 */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 18px; }
.stat { background: #fff; border: 1px solid #e6e9ee; border-radius: 10px; padding: 18px 20px; }
.stat-num { font-size: 30px; font-weight: 700; line-height: 1.1; }
.stat-label { color: #8a94a1; margin-top: 6px; }
.stat-warn .stat-num { color: #e08b1f; }
.stat-ok .stat-num { color: #2fb344; }

/* 卡片 */
.card { background: #fff; border: 1px solid #e6e9ee; border-radius: 10px; margin-bottom: 18px; }
.card-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 18px; border-bottom: 1px solid #eef1f5; }
.card-head h3 { margin: 0; font-size: 15px; }
.card-head a { font-size: 13px; }

.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; align-items: start; }
.grid-detail { display: grid; grid-template-columns: 3fr 2fr; gap: 18px; align-items: start; }

/* 项目列表 */
.plist { display: flex; flex-direction: column; }
.pitem { display: flex; flex-direction: column; gap: 6px; padding: 12px 18px; border-bottom: 1px solid #f0f2f5; }
.pitem:hover { background: #f8fafc; text-decoration: none; }
.pname { font-weight: 600; color: #2b2f36; }
.pcode { color: #9aa3ae; font-size: 12px; }
.pmeter { height: 6px; background: #eef1f5; border-radius: 3px; overflow: hidden; }
.m-done { display: block; height: 100%; background: #2fb344; }
.pcnt, .mcnt { display: flex; gap: 14px; font-size: 12px; }
.c-open { color: #e08b1f; font-weight: 600; }
.c-done { color: #2fb344; font-weight: 600; }
.c-muted { color: #9aa3ae; font-weight: 400; }

.mlist { display: flex; flex-direction: column; }
.mitem { display: flex; align-items: center; justify-content: space-between; padding: 12px 18px; border-bottom: 1px solid #f0f2f5; }
.mitem:hover { background: #f8fafc; text-decoration: none; }
.mname { font-weight: 600; color: #2b2f36; }

/* 表格 */
.table { width: 100%; border-collapse: collapse; }
.table th, .table td { padding: 11px 14px; text-align: left; border-bottom: 1px solid #f0f2f5; vertical-align: top; }
.table th { background: #fafbfc; color: #6b7480; font-weight: 600; font-size: 13px; white-space: nowrap; }
.table tbody tr:hover { background: #f8fafc; }
.muted { color: #9aa3ae; }
.small { font-size: 12px; }
.link { color: #2f6fed; }
.ops { white-space: nowrap; }
.ops a { margin-right: 12px; }
.linkbtn { background: none; border: none; color: #2f6fed; cursor: pointer; padding: 0; font-size: 14px; }
.linkbtn.danger { color: #e5484d; }
.inline { display: inline; }

/* 徽章 */
.badge { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: 12px; white-space: nowrap; }
.st-pending { background: #fff3e0; color: #b26a00; }
.st-doing { background: #e8f0fe; color: #2457c4; }
.st-done { background: #e6f6e9; color: #1f8a34; }
.st-closed { background: #eef1f5; color: #6b7480; }
.tag { display: inline-block; padding: 2px 10px; border-radius: 6px; font-size: 12px; background: #f0f2f5; color: #4a5260; }
.prio { display: inline-block; font-size: 12px; padding: 2px 8px; border-radius: 6px; }
.p-low { color: #6b7480; background: #eef1f5; }
.p-mid { color: #2457c4; background: #e8f0fe; }
.p-high { color: #b26a00; background: #fff3e0; }
.p-urgent { color: #c22a2a; background: #fdeaea; }

/* 筛选 */
.filter { display: flex; flex-wrap: wrap; gap: 10px; padding: 14px 18px; align-items: center; }
.filter select, .filter input { padding: 7px 10px; border: 1px solid #d4d9e0; border-radius: 6px; font-size: 14px; background: #fff; }
.chip { display: inline-block; padding: 4px 12px; border: 1px solid #d4d9e0; border-radius: 999px; background: #fff; color: #4a5260; cursor: pointer; font-size: 13px; }
.chip:hover { border-color: #2f6fed; color: #2f6fed; text-decoration: none; }
.chip.on { background: #2f6fed; border-color: #2f6fed; color: #fff; }
.chip-ok.on { background: #2fb344; border-color: #2fb344; }

/* 表单 */
.form-card { padding: 22px 24px; max-width: 760px; }
.form-inner { padding: 4px 0; }
.field { margin-bottom: 16px; }
.field label { display: block; margin-bottom: 6px; color: #4a5260; font-weight: 500; }
.field em { color: #e5484d; font-style: normal; }
.field input, .field select, .field textarea, .follow-form textarea {
  width: 100%; padding: 9px 12px; border: 1px solid #d4d9e0; border-radius: 6px; font-size: 14px; font-family: inherit; background: #fff;
}
.field input:focus, .field select:focus, .field textarea:focus, .follow-form textarea:focus { outline: none; border-color: #2f6fed; }
.field-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.field-row .field { margin-bottom: 16px; }
.form-actions { margin-top: 6px; display: flex; gap: 10px; }

/* 详情 */
.detail-tags { display: flex; gap: 8px; padding: 16px 18px 0; flex-wrap: wrap; align-items: center; }
.kv { width: 100%; border-collapse: collapse; margin: 12px 0 0; }
.kv th, .kv td { padding: 7px 18px; text-align: left; border-bottom: 1px solid #f0f2f5; }
.kv th { color: #8a94a1; font-weight: 500; width: 100px; white-space: nowrap; }
.desc-block { padding: 16px 18px 6px; }
.desc-block h4 { margin: 0 0 8px; font-size: 14px; }
.desc-body { background: #fafbfc; border-radius: 8px; padding: 12px 14px; }
.status-switch { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 14px 18px 18px; }
.status-switch .label { color: #6b7480; }

/* 时间线 */
.timeline { padding: 16px 18px 4px; }
.tl-item { display: flex; gap: 12px; padding-bottom: 16px; position: relative; }
.tl-dot { width: 10px; height: 10px; border-radius: 50%; background: #2f6fed; margin-top: 6px; flex: none; }
.tl-body { flex: 1; background: #fafbfc; border-radius: 8px; padding: 10px 14px; }
.tl-meta { display: flex; gap: 12px; align-items: baseline; margin-bottom: 4px; }
.tl-content { color: #2b2f36; }
.follow-form { padding: 6px 18px 18px; }
.follow-form textarea { min-height: 72px; }

/* 分页 */
.pager { padding: 14px 18px; }
.pager ul { list-style: none; display: flex; gap: 6px; margin: 0; padding: 0; }
.pager li { display: inline; }
.pager li a, .pager li span { display: inline-block; padding: 5px 12px; border: 1px solid #d4d9e0; border-radius: 6px; color: #4a5260; }
.pager li.active span { background: #2f6fed; border-color: #2f6fed; color: #fff; }
.pager li.disabled span { color: #b7bec9; }

/* 登录 */
.login-body { display: flex; align-items: center; justify-content: center; min-height: 100vh; background: linear-gradient(135deg, #1f2733, #2f6fed); }
.login-box { width: 360px; background: #fff; border-radius: 12px; padding: 34px 34px 30px; box-shadow: 0 20px 50px rgba(0,0,0,.2); }
.login-box h1 { margin: 0; font-size: 22px; text-align: center; }
.login-sub { text-align: center; color: #8a94a1; margin: 8px 0 24px; }
.login-box .field label { font-weight: 500; }

.empty { color: #9aa3ae; text-align: center; padding: 26px 0; }

@media (max-width: 900px) {
  .grid2, .grid-detail { grid-template-columns: 1fr; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .field-row { grid-template-columns: 1fr; }
  .topbar-inner { gap: 14px; }
}
