:root {
  color-scheme: light;
  --blue: #2563eb; --blue-deep: #1d4ed8; --blue-soft: #eff5ff;
  --bg: #f7f9fc; --panel: #fff; --ink: #17243a; --muted: #52627a;
  --line: #e2e8f1; --strong-line: #cdd7e5; --radius: 12px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  --shadow: 0 1px 2px #15264408;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 1rem/1.55 var(--font); }
a { color: var(--blue-deep); text-decoration: none; }
a:hover { text-decoration: underline; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--blue); outline-offset: 3px; }
h1, h2, h3, p { margin: 0; }
button, a { -webkit-tap-highlight-color: transparent; }
.skiplink { position: fixed; top: -100px; left: 12px; z-index: 20; padding: 10px; background: white; }
.skiplink:focus { top: 10px; }
.icon { flex: 0 0 auto; width: 19px; height: 19px; vertical-align: middle; }
.shell { display: grid; grid-template-columns: 224px minmax(0, 1fr); min-height: 100dvh; }
.sidebar { background: var(--panel); border-right: 1px solid var(--line); display: flex; flex-direction: column; gap: 21px; padding: 23px 14px 16px; position: sticky; top: 0; height: 100dvh; }
.brand { display: flex; align-items: center; gap: 11px; padding: 0 6px; color: var(--ink); }
.brand:hover { text-decoration: none; }
.brand-mark { width: 39px; height: 39px; display: grid; place-items: center; border-radius: 11px; background: var(--blue); color: #fff; flex: 0 0 auto; }
.brand-mark .icon { width: 25px; height: 25px; }
.brand-name { display: block; font-size: 1.1rem; line-height: 1.3; font-weight: 750; letter-spacing: .025em; }
.brand-sub { display: block; color: var(--muted); font-size: .75rem; margin-top: 3px; }
.sidebar nav { display: grid; gap: 5px; }
.nav-section { color: var(--muted); font-size: .75rem; font-weight: 630; margin: 9px 10px 2px; }
.section-divider { height: 1px; background: var(--line); margin: 12px 8px 4px; }
.nav-link { display: flex; align-items: center; gap: 10px; padding: 10px 11px; min-height: 42px; border: 1px solid transparent; border-radius: 8px; color: var(--muted); font-size: .9rem; white-space: nowrap; }
.nav-link:hover { text-decoration: none; color: var(--ink); background: var(--bg); }
.nav-link[aria-current] { background: var(--blue-soft); color: var(--blue-deep); border-color: #d5e3ff; font-weight: 680; }
.sidebar-foot { margin-top: auto; border-top: 1px solid var(--line); padding: 13px 8px 1px; color: var(--muted); font-size: .75rem; display: flex; align-items: center; gap: 8px; }
.sidebar-foot .icon { width: 16px; height: 16px; }
.topbar { min-height: 64px; position: sticky; top: 0; z-index: 3; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 28px; background: var(--panel); border-bottom: 1px solid var(--line); }
.crumb { display: flex; align-items: center; gap: 8px; font-size: .875rem; color: var(--muted); white-space: nowrap; }
.crumb b { color: var(--ink); font-weight: 650; }
.crumb .icon { width: 14px; }
.profile { position: relative; }
.profile summary { display: flex; cursor: pointer; align-items: center; gap: 9px; list-style: none; font-size: .875rem; white-space: nowrap; }
.profile summary::-webkit-details-marker { display: none; }
.profile summary .icon { width: 15px; }
.profile-menu { position: absolute; right: 0; top: calc(100% + 12px); min-width: 152px; padding: 5px; background: var(--panel); border: 1px solid var(--line); border-radius: 9px; box-shadow: 0 12px 30px #15264418; }
.profile-menu button { width: 100%; justify-content: start; }
.avatar { display: inline-grid; place-items: center; flex: 0 0 auto; width: 29px; height: 29px; border-radius: 50%; background: #e8efff; color: #254b9b; font-weight: 650; font-size: .78rem; }
.avatar.violet { background: #f0eafa; color: #63449f; }
.avatar.green { background: #e5f4ef; color: #176957; }
.avatar.orange { background: #fff0df; color: #915020; }
.avatar.slate { background: #e8edf5; color: #475872; }
main { width: 100%; max-width: 1560px; margin: 0 auto; padding: 28px 28px 36px; min-width: 0; }
.pagehead { display: flex; align-items: end; justify-content: space-between; flex-wrap: wrap; gap: 16px; margin-bottom: 24px; }
.pagehead h1 { font-size: 1.8rem; line-height: 1.25; letter-spacing: -.025em; font-weight: 760; }
.pagehead p { color: var(--muted); margin-top: 7px; font-size: .875rem; }
.head-actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.date-label { font-size: .82rem; margin-right: 4px; color: var(--muted); white-space: nowrap; display: inline-flex; gap: 7px; align-items: center; }
.date-label .icon { width: 16px; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 40px; padding: 8px 13px; border: 1px solid var(--strong-line); border-radius: 8px; background: var(--panel); color: var(--ink); font-size: .875rem; font-weight: 630; white-space: nowrap; line-height: 1.3; }
.btn:hover { background: var(--bg); text-decoration: none; }
.btn.primary { background: var(--blue); border-color: var(--blue); color: #fff; }
.btn.primary:hover { background: var(--blue-deep); }
.btn.plain { background: transparent; border-color: transparent; }
.btn.plain:hover { background: var(--bg); }
.btn .icon { width: 17px; height: 17px; }
.icon-btn { min-width: 39px; padding: 6px; }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); min-width: 0; }
.metrics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 23px; }
.metric { text-align: left; padding: 15px 16px 14px; display: grid; grid-template-columns: 1fr auto; gap: 3px 10px; }
.metric:hover { border-color: #9bb9fb; }
.metric.active { border-color: #93b3fb; }
.metric span:first-child { font-size: .875rem; color: var(--muted); }
.metric strong { grid-column: 1; font-size: 1.85rem; line-height: 1.2; font-weight: 740; font-variant-numeric: tabular-nums; color: var(--ink); }
.metric-icon { width: 36px; height: 36px; display: grid; place-items: center; border-radius: 9px; background: #edf3ff; color: #285dc8; grid-column: 2; grid-row: 1 / 3; align-self: start; }
.metric-icon.amber { background: #fff3de; color: #8d5614; }
.metric-icon.red { background: #fcebec; color: #ae4348; }
.metric-icon.violet { background: #f0ebff; color: #684ac0; }
.workspace-grid { display: grid; grid-template-columns: minmax(0, 1fr) 292px; align-items: start; gap: 17px; }
.list-heading, .side-heading { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 16px 17px; }
.list-heading { padding-bottom: 8px; }
h2 { font-size: 1rem; font-weight: 730; }
.toolbar { display: flex; gap: 8px; align-items: center; padding: 9px 16px 14px; }
.search { position: relative; min-width: 100px; flex: 1; }
.search .icon { position: absolute; top: 11px; left: 10px; width: 17px; height: 17px; color: var(--muted); pointer-events: none; }
.search input { padding-left: 34px; }
input, select, textarea { width: 100%; border: 1px solid var(--strong-line); border-radius: 8px; background: white; padding: 8px 10px; min-height: 40px; color: var(--ink); font-size: .9rem; }
input::placeholder, textarea::placeholder { color: #66768c; }
select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, #53627a 50%), linear-gradient(135deg, #53627a 50%, transparent 50%); background-position: calc(100% - 14px) 50%, calc(100% - 10px) 50%; background-size: 4px 4px; background-repeat: no-repeat; padding-right: 25px; }
.toolbar select { width: auto; max-width: 140px; }
.tabs { display: flex; overflow: auto; gap: 16px; padding: 0 16px; border-bottom: 1px solid var(--line); }
.tab { flex: 0 0 auto; border: 0; background: transparent; color: var(--muted); min-height: 39px; font-size: .875rem; padding: 5px 1px 8px; border-bottom: 2px solid transparent; }
.tab[aria-pressed="true"] { color: var(--blue-deep); border-bottom-color: var(--blue); font-weight: 680; }
.tab:hover { color: var(--blue-deep); }
.table-wrap { overflow: auto; }
table { border-collapse: collapse; text-align: left; width: 100%; font-size: .875rem; }
.task-table { min-width: 590px; }
th, td { border-bottom: 1px solid var(--line); padding: 11px 12px; vertical-align: middle; }
th:first-child, td:first-child { padding-left: 16px; }
th:last-child, td:last-child { padding-right: 16px; }
th { background: #f7f9fd; color: var(--muted); font-size: .81rem; font-weight: 650; white-space: nowrap; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: #f8faff; }
.task-title { font-weight: 670; line-height: 1.45; color: var(--ink); }
.task-title:hover { color: var(--blue-deep); }
.meta { font-size: .76rem; color: var(--muted); line-height: 1.5; }
.task-meta { margin-top: 4px; display: flex; gap: 7px; align-items: baseline; flex-wrap: wrap; }
.nowrap { white-space: nowrap; }
.owner { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.badge { display: inline-block; white-space: nowrap; font-size: .78rem; padding: 2px 8px; border-radius: 20px; background: #edf1f6; color: #3b4b64; }
.badge.blue { color: #214fa6; background: #e9f1ff; }
.badge.rose { color: #9c3542; background: #fdecef; }
.badge.amber { color: #815013; background: #fff1d7; }
.badge.violet { color: #6540a2; background: #f1eafa; }
.badge.green { color: #176445; background: #e5f4eb; }
.overdue { color: #a23142; font-weight: 660; }
.today { color: #815013; font-weight: 650; }
.table-footer { padding: 10px 16px; border-top: 1px solid var(--line); color: var(--muted); font-size: .8rem; }
.empty { padding: 26px 14px; text-align: center; color: var(--muted); }
.aside-stack { display: grid; gap: 16px; }
.side-heading { border-bottom: 1px solid var(--line); }
.side-heading > .icon { color: var(--muted); }
.side-list { padding: 0 15px 4px; }
.attention, .activity { display: block; padding: 12px 0; border-bottom: 1px solid var(--line); }
.attention:last-child, .activity:last-child { border-bottom: 0; }
.attention strong { font-size: .875rem; color: var(--ink); font-weight: 650; display: block; margin: 4px 0 2px; }
.attention:hover strong { color: var(--blue-deep); }
.activity { display: flex; align-items: flex-start; gap: 8px; }
.activity .avatar { margin-top: 1px; }
.activity p { font-size: .825rem; line-height: 1.5; margin-bottom: 3px; overflow-wrap: anywhere; }
.activity a { font-weight: 630; }
.board { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.board-lane { padding: 13px; background: #edf2f8; border: 1px solid var(--line); border-radius: var(--radius); min-height: 200px; }
.lane-head { display: flex; justify-content: space-between; align-items: center; margin: 0 2px 10px; }
.board-card { display: block; margin-bottom: 9px; padding: 11px; }
.board-card:hover { text-decoration: none; border-color: #9bb9fb; }
.board-card p { margin: 6px 0 10px; }
.board-card footer { display: flex; gap: 5px; justify-content: space-between; flex-wrap: wrap; font-size: .79rem; color: var(--muted); }
dialog { border: 1px solid var(--line); background: var(--panel); color: var(--ink); padding: 0; border-radius: 14px; width: min(600px, calc(100vw - 28px)); max-height: calc(100dvh - 36px); }
dialog::backdrop { background: #15243f55; }
#detail { margin: 0 0 0 auto; width: min(550px, 100%); height: 100dvh; max-height: 100dvh; border-radius: 0; border-width: 0 0 0 1px; }
.dialog-head { position: sticky; top: 0; display: flex; justify-content: space-between; gap: 12px; align-items: start; padding: 16px 20px; background: var(--panel); border-bottom: 1px solid var(--line); z-index: 1; }
.dialog-head h2 { font-size: 1.12rem; line-height: 1.4; }
.detail-body, .dialog-body { padding: 18px 20px 22px; }
.detail-body { display: grid; gap: 18px; }
.detail-body h3 { font-size: .93rem; margin-bottom: 7px; }
.detail-body p { font-size: .9rem; white-space: pre-wrap; overflow-wrap: anywhere; }
.detail-summary { background: #f7f9fd; border: 1px solid var(--line); border-radius: 10px; padding: 12px 13px; }
.facts { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.facts small { display: block; color: var(--muted); font-size: .76rem; }
.facts span { font-size: .89rem; }
.detail-actions, .form-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.history { list-style: none; padding: 0; margin: 0; }
.history li { border-left: 2px solid #dce6fa; padding: 0 0 12px 12px; margin-left: 4px; overflow-wrap: anywhere; }
.history li:last-child { padding-bottom: 0; }
.history p { margin-top: 2px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.field { display: block; }
.field > span, .field > label { display: block; margin-bottom: 5px; font-size: .875rem; font-weight: 630; }
.field.full, .form-grid .full { grid-column: 1 / -1; }
textarea { min-height: 76px; resize: vertical; }
.form-actions { justify-content: end; margin-top: 16px; }
.toast { z-index: 10; position: fixed; bottom: 18px; right: 18px; max-width: calc(100vw - 36px); padding: 10px 14px; background: #213c62; color: #fff; border-radius: 8px; font-size: .9rem; box-shadow: 0 8px 20px #1526442c; }
.login-screen { display: grid; place-items: center; min-height: 100dvh; padding: 20px; }
.login-card { width: min(100%, 420px); padding: 27px; }
.login-card h1 { margin-top: 24px; font-size: 1.65rem; }
.login-card form { margin-top: 20px; display: grid; gap: 13px; }
.password-wrap { display: flex; gap: 7px; }
.login-note { margin-top: 15px; padding: 9px 11px; border: 1px solid #d7e4fb; border-radius: 8px; background: var(--blue-soft); font-size: .82rem; color: #254b86; }
.error { color: #a23142; font-size: .86rem; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; border: 0; clip-path: inset(50%); white-space: nowrap; overflow: hidden; }
@media (max-width: 1220px) { .workspace-grid { grid-template-columns: minmax(0, 1fr); } .aside-stack { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 950px) {
  .shell { grid-template-columns: 185px minmax(0, 1fr); }
  main, .topbar { padding-left: 18px; padding-right: 18px; }
  .board { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 720px) {
  .shell { display: block; }
  .sidebar { position: static; height: auto; border-right: 0; border-bottom: 1px solid var(--line); padding: 12px 12px 8px; gap: 10px; }
  .sidebar nav { display: flex; overflow-x: auto; padding-bottom: 4px; }
  .nav-section, .section-divider, .sidebar-foot { display: none; }
  .nav-link { flex: 0 0 auto; padding: 7px 8px; min-height: 40px; font-size: .825rem; gap: 5px; }
  .nav-link .icon { width: 16px; height: 16px; }
  .brand-mark { width: 34px; height: 34px; }
  .brand-name { font-size: 1rem; }
  .topbar { min-height: 48px; padding: 6px 12px; }
  main { padding: 17px 12px 28px; }
  .pagehead { gap: 10px; margin-bottom: 16px; }
  .pagehead h1 { font-size: 1.55rem; }
  .metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-bottom: 14px; }
  .metric { padding: 10px 12px; }
  .metric strong { font-size: 1.55rem; }
  .metric-icon { width: 30px; height: 30px; }
  .aside-stack { grid-template-columns: 1fr; }
  .tabs { gap: 12px; }
  .toolbar { flex-wrap: wrap; }
  .toolbar select { max-width: 117px; }
  .btn, input, select { min-height: 44px; }
  .search .icon { top: 13px; }
}
@media (max-width: 395px) {
  .form-grid { grid-template-columns: 1fr; }
  .head-actions .date-label { display: none; }
  .board { grid-template-columns: 1fr; }
}

.extra-heading { margin-top: 10px; }
