:root {
  color: #182b35;
  background: #f4f7f8;
  font-family: "Microsoft YaHei UI", "PingFang SC", "Noto Sans CJK SC", system-ui, sans-serif;
  font-size: 15px;
  line-height: 1.55;
  --ink: #182b35;
  --muted: #516670;
  --teal: #17665d;
  --deep: #153d3a;
  --line: #d9e3e4;
  --surface: #fff;
  --wash: #f5f8f8;
  --green-wash: #ebf6f1;
  --red: #9a3339;
  --red-wash: #fceced;
  --gold: #805100;
  --gold-wash: #fff3d9;
  --radius: 11px;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; min-width: 290px; }
body:has(dialog[open]) { overflow: hidden; }
h1, h2, h3, p { margin: 0; }
a { color: var(--teal); }
button, input, select, textarea { font: inherit; }
button, .button { cursor: pointer; }
button:disabled { cursor: wait; opacity: .64; }
:focus-visible { outline: 3px solid #4d91d1; outline-offset: 3px; }
.skip-link { position: fixed; z-index: 10; top: -80px; left: 12px; background: #fff; padding: 8px 16px; }
.skip-link:focus { top: 12px; }
.boot { min-height: 100vh; display: grid; place-content: center; padding: 24px; color: var(--muted); }

.shell { min-height: 100vh; display: grid; grid-template-columns: 216px minmax(0, 1fr); }
.sidebar { background: #173634; color: #ecf6f3; min-width: 0; position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; padding: 27px 15px 16px; }
.brand { color: inherit; text-decoration: none; display: flex; align-items: center; gap: 10px; margin: 0 4px 34px; font-weight: 700; font-size: 15px; white-space: nowrap; }
.brand-mark { display: inline-grid; place-content: center; inline-size: 28px; block-size: 28px; flex: 0 0 28px; border-radius: 7px; color: #153d3a; background: #9ee1c5; }
.brand-mark::before { content: ""; width: 12px; height: 11px; border-left: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: translate(1px,-2px) rotate(-40deg); }
.main-nav { display: grid; gap: 5px; }
.nav-link { color: #d6e6e2; text-decoration: none; display: flex; align-items: center; gap: 10px; border-radius: 8px; min-height: 43px; padding: 8px 11px; font-size: 14px; font-weight: 600; }
.nav-link:hover { background: #244643; color: #fff; }
.nav-link[aria-current="page"] { color: #fff; background: #2e524d; box-shadow: inset 3px 0 #9ee1c5; }
.nav-icon { display: inline-flex; width: 20px; justify-content: center; align-items: center; font-size: 17px; color: #a5d9ce; }
.account-panel { margin-top: auto; padding: 13px 5px 0; border-top: 1px solid #496460; }
.account-ident { display: block; overflow-wrap: anywhere; font-weight: 650; }
.account-role { color: #bfd5d1; font-size: 12px; }
.account-links { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.account-links button { appearance: none; border: 1px solid #5e7974; border-radius: 6px; color: #e7f2f0; background: transparent; padding: 5px 8px; font-size: 12px; }
.account-links button:hover { background: #2e524d; }
.content { min-width: 0; }
.topline { background: #fff; border-bottom: 1px solid var(--line); min-height: 53px; display: flex; align-items: center; justify-content: flex-end; padding: 10px clamp(16px, 3vw, 40px); }
.top-date { font-size: 13px; color: var(--muted); white-space: nowrap; }
#main { width: min(100%, 1540px); margin: auto; padding: 27px clamp(16px, 3vw, 40px) 50px; scroll-margin-top: 20px; }
.page-heading { display: flex; flex-wrap: wrap; column-gap: 16px; row-gap: 11px; justify-content: space-between; align-items: end; margin-bottom: 21px; }
.page-heading h1 { font-size: clamp(25px, 2.7vw, 34px); letter-spacing: -.025em; line-height: 1.28; }
.page-heading p { color: var(--muted); font-size: 13px; margin-top: 6px; }
.breadcrumb { display: flex; gap: 8px; align-items: center; margin-bottom: 12px; font-size: 13px; color: var(--muted); }
.breadcrumb a { font-weight: 650; text-underline-offset: 3px; }

.button { display: inline-flex; justify-content: center; align-items: center; min-height: 37px; border: 1px solid #aebfc1; border-radius: 7px; padding: 7px 12px; background: #fff; color: var(--ink); font-weight: 650; font-size: 13px; text-decoration: none; white-space: nowrap; }
.button:hover { background: #edf4f3; border-color: #8fa5a8; }
.button.primary { background: var(--teal); color: #fff; border-color: var(--teal); }
.button.primary:hover { background: #10524c; }
.button.secondary { color: var(--teal); border-color: #9cb6b3; }
.button.compact { min-height: 31px; padding: 4px 9px; font-size: 12px; }
.button.quiet { color: var(--teal); border-color: transparent; background: transparent; }
.button.quiet:hover { border-color: #dce9e6; background: #eef6f4; }
.button.danger { color: var(--red); }
.actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.tabs { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; }
.tab { background: #fff; color: var(--muted); border: 1px solid var(--line); border-radius: 6px; padding: 5px 9px; font-size: 12px; white-space: nowrap; }
.tab:hover { color: var(--teal); border-color: #a0b9b6; }
.tab[aria-pressed="true"] { background: #dceeea; color: #174e49; border-color: #9cc1b8; font-weight: 700; }

.card { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: 0 1px 2px #162b3f08; }
.section { margin-top: 19px; }
.section-header { padding: 16px 17px 14px; display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 9px; }
.section-header h2 { font-size: 18px; line-height: 1.35; }
.section-header p { color: var(--muted); font-size: 12px; margin-top: 4px; }
.metric-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 11px; }
.metric { text-align: left; padding: 13px 14px; min-height: 94px; display: flex; flex-direction: column; align-items: start; justify-content: center; gap: 3px; }
.metric:is(a,button) { text-decoration: none; color: inherit; }
.metric:is(a,button):hover { background: #f9fcfb; border-color: #9ebbba; }
.metric-name { color: var(--muted); font-size: 13px; font-weight: 600; }
.metric strong { font-size: 27px; line-height: 1.28; font-variant-numeric: tabular-nums; letter-spacing: -.03em; }
.metric.accent strong { color: var(--teal); }
.metric.overdue strong { color: var(--red); }
.metric.today strong { color: var(--gold); }
.metric.is-open { border-color: #83a9a3; box-shadow: inset 0 3px 0 #6fa99b; }

.table-wrap { overflow-x: auto; border-radius: 0 0 var(--radius) var(--radius); }
table { border-collapse: collapse; width: 100%; min-width: 600px; text-align: left; font-size: 13px; }
th, td { padding: 11px 13px; vertical-align: middle; overflow-wrap: anywhere; }
th { background: #f1f6f5; color: #465e61; font-weight: 650; font-size: 12px; white-space: nowrap; border-block: 1px solid var(--line); }
th:first-child, td:first-child { padding-left: 17px; }
th:last-child, td:last-child { padding-right: 17px; }
tr + tr td { border-top: 1px solid #e5eded; }
tbody tr:hover { background: #fafcfb; }
.table-primary { display: block; font-weight: 650; }
.table-secondary { display: block; margin-top: 3px; font-size: 12px; color: var(--muted); }
.table-link { font-weight: 650; text-decoration-thickness: 1px; text-underline-offset: 3px; }
.table-actions { text-align: right; white-space: nowrap; }
.nowrap { white-space: nowrap; }
.empty { min-height: 118px; padding: 19px; color: var(--muted); display: grid; align-content: center; justify-items: center; gap: 9px; text-align: center; }
.empty strong { color: var(--ink); font-size: 15px; }
.empty p { font-size: 13px; }
.failure { border: 1px solid #eebdc0; background: var(--red-wash); color: #7e2830; border-radius: 8px; padding: 9px 13px; margin-bottom: 14px; overflow-wrap: anywhere; }
.failure:empty { display: none; }

.tag { display: inline-flex; align-items: center; width: max-content; max-width: 100%; padding: 3px 8px; border-radius: 5px; font-size: 12px; font-weight: 650; color: #495d66; background: #edf1f3; white-space: nowrap; }
.tag.active { color: #0c5a70; background: #e5f4fa; }
.tag.done { color: #205d3f; background: #e4f4e9; }
.tag.blocked, .tag.overdue { color: var(--red); background: var(--red-wash); }
.tag.today { color: var(--gold); background: var(--gold-wash); }
.tag.soon { color: #395a47; background: #e9f3e9; }
.tag-set { display: flex; flex-wrap: wrap; gap: 5px; }

.project-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; padding: 14px 16px; }
.project-toolbar input[type=search] { flex: 1 1 230px; min-width: 170px; max-width: 420px; }
.summary-count { color: var(--muted); margin-left: auto; font-size: 13px; }
input, select, textarea { width: 100%; min-width: 0; border: 1px solid #adbfc2; border-radius: 7px; background: #fff; color: var(--ink); padding: 7px 9px; }
input[type=checkbox] { width: 17px; height: 17px; padding: 0; accent-color: var(--teal); flex: 0 0 auto; }
input[type=search], input[type=date], select { min-height: 39px; }
textarea { resize: vertical; min-height: 88px; }
.check-label { display: inline-flex; align-items: center; gap: 6px; color: var(--ink); font-size: 13px; min-height: 34px; }
.check-label input { margin: 0; }
.field { display: grid; gap: 5px; align-content: start; font-size: 13px; min-width: 0; }
.field > span:first-child { font-weight: 650; }
.field-wide { grid-column: 1 / -1; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 13px; }
.help { color: var(--muted); font-size: 12px; font-weight: 400; }
.progress { min-width: 90px; display: grid; gap: 4px; }
.progress > span { color: var(--muted); font-size: 12px; }
progress { width: 100%; height: 6px; appearance: none; border: none; border-radius: 12px; background: #e3eceb; overflow: hidden; }
progress::-webkit-progress-bar { background: #e3eceb; }
progress::-webkit-progress-value { background: #3b8d7a; border-radius: 12px; }
progress::-moz-progress-bar { background: #3b8d7a; border-radius: 12px; }
.project-facts { padding: 16px 17px; display: grid; grid-template-columns: repeat(4, minmax(0,1fr)) minmax(105px, 1fr); column-gap: 15px; row-gap: 13px; margin: 0 0 19px; }
.facts { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 7px 12px; margin: 0; }
.facts dt, .project-facts dt { font-size: 12px; color: var(--muted); }
.facts dd, .project-facts dd { margin: 2px 0 0; font-weight: 600; font-size: 13px; overflow-wrap: anywhere; }
.workflow { display: grid; gap: 12px; margin-top: 10px; }
.stage-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 12px; }
.stage-card { padding: 14px; min-width: 0; display: grid; align-content: start; gap: 10px; }
.stage-titlebar { display: flex; align-items: start; flex-wrap: wrap; gap: 6px 12px; justify-content: space-between; }
.stage-titlebar h3 { font-size: 16px; overflow-wrap: anywhere; }
.stage-card .facts { grid-template-columns: repeat(3, minmax(0,1fr)); }
.stage-card .actions { border-top: 1px solid #e7eeed; padding-top: 8px; align-self: end; }
.parallel-group { display: grid; gap: 9px; border: 1px solid #b3ccca; background: #e9f2f1; border-radius: var(--radius); padding: 11px; }
.parallel-group h3.parallel-label { font-size: 13px; font-weight: 650; padding-inline: 4px; color: #2c6259; }
.subtask-list, .history-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.stage-overlay { display: grid; gap: 15px; }
.stage-overlay section { display: grid; gap: 7px; }
.stage-overlay h3, .form-group legend { font-size: 14px; font-weight: 650; }
.stage-overlay .facts { grid-template-columns: repeat(3, minmax(0,1fr)); }
.preserve-lines { white-space: pre-wrap; overflow-wrap: anywhere; }
.subtask-list li { padding: 5px 8px; border: 1px solid var(--line); border-radius: 6px; overflow-wrap: anywhere; }
.subtask-list li .done-mark { color: #216745; font-weight: 700; }
.subtask-list li .pending-mark { color: var(--muted); }
.history-list li { border-left: 2px solid #b9d6d2; padding: 3px 9px; overflow-wrap: anywhere; }
.history-list time { color: var(--muted); font-size: 12px; margin-left: 8px; }
.history-list p { font-size: 13px; margin-top: 3px; }
.form-group { border: 1px solid var(--line); border-radius: 7px; padding: 6px 10px 9px; margin: 0; min-width: 0; }
.form-group legend { padding: 0 5px; }
.form-group .check-label { margin-right: 10px; }
.edit-subtasks { display: grid; gap: 7px; }
.edit-subtask-row { display: flex; align-items: center; gap: 6px; }
.edit-subtask-row input { flex: 1 1 auto; }
.edit-subtask-row button { flex: 0 0 auto; }

dialog { width: min(650px, calc(100% - 28px)); max-height: calc(100vh - 28px); max-height: calc(100dvh - 28px); border: 1px solid #afc0c0; border-radius: 13px; padding: 0; color: var(--ink); background: #fff; box-shadow: 0 18px 70px #122d414a; }
dialog::backdrop { background: #132d37a6; }
dialog[open] { display: flex; flex-direction: column; }
dialog > form { min-height: 0; display: flex; flex-direction: column; }
.modal-head { flex: 0 0 auto; display: flex; justify-content: space-between; align-items: start; gap: 12px; padding: 16px 19px; border-bottom: 1px solid var(--line); }
.modal-head h2 { font-size: 20px; overflow-wrap: anywhere; }
.modal-head p { color: var(--muted); font-size: 13px; overflow-wrap: anywhere; margin-top: 3px; }
.modal-close { flex: 0 0 auto; font-size: 20px; display: inline-grid; place-content: center; width: 30px; height: 30px; border: 0; border-radius: 6px; background: #f0f5f4; color: var(--ink); }
.modal-close:hover { background: #e0ece9; }
.modal-body { padding: 16px 19px; overflow: auto; min-height: 0; }
.modal-foot { flex: 0 0 auto; display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; min-height: 57px; padding: 10px 19px; border-top: 1px solid var(--line); background: #fcfdfd; gap: 7px; }
.notice { position: fixed; bottom: 16px; right: 16px; z-index: 8; width: max-content; max-width: min(440px, calc(100% - 32px)); padding: 10px 14px; border-radius: 8px; border: 1px solid #347666; background: #174d44; color: #fff; box-shadow: 0 6px 22px #183d3a39; overflow-wrap: anywhere; }
.notice.error { background: #7d3540; border-color: #96505b; }

.auth-shell { min-height: 100vh; display: grid; grid-template-columns: minmax(290px, 490px) minmax(325px, 470px); align-content: center; justify-content: center; padding: 26px; }
.auth-info { min-width: 0; min-height: 450px; display: flex; flex-direction: column; justify-content: space-between; position: relative; overflow: hidden; isolation: isolate; padding: 36px; color: #fff; border-radius: 15px 0 0 15px; background: #173c37; }
.auth-info::after { content: ""; position: absolute; z-index: -1; right: -105px; top: 70px; width: 360px; height: 360px; transform: rotate(-22deg); border-radius: 43px; border: 1px solid #93d6be4d; box-shadow: 0 0 0 32px #8eddb315, 0 0 0 65px #8eddb30e, 0 0 0 100px #8eddb309; }
.auth-info .brand-mark { width: 38px; height: 38px; border-radius: 9px; }
.auth-info h1 { font-size: clamp(25px, 3vw, 38px); line-height: 1.23; }
.auth-info p { max-width: 22em; color: #d3e8e1; font-size: 14px; margin-top: 9px; }
.auth-card { padding: 34px; border-radius: 0 15px 15px 0; align-content: center; display: grid; gap: 16px; }
.auth-card h2 { font-size: 23px; }
.auth-card form { display: grid; gap: 11px; }
.auth-card .failure { margin-bottom: 0; }
.auth-card input { min-height: 42px; }
.auth-card .button { min-height: 41px; }
.auth-card p { color: var(--muted); font-size: 13px; }

@media (max-width: 1060px) {
  .metric-grid { grid-template-columns: repeat(3, minmax(0,1fr)); }
  .project-facts { grid-template-columns: repeat(3, minmax(0,1fr)); }
}
@media (max-width: 800px) {
  .shell { display: block; }
  .sidebar { position: static; height: auto; flex-wrap: wrap; flex-direction: row; align-items: center; justify-content: space-between; gap: 8px 18px; padding: 11px 13px; }
  .brand { margin: 0; }
  .main-nav { order: 2; flex: 1 0 100%; display: flex; flex-wrap: wrap; }
  .nav-link { min-height: 37px; padding: 5px 8px; }
  .account-panel { margin: 0; padding: 0; border: 0; display: flex; align-items: center; gap: 5px 8px; flex-wrap: wrap; }
  .account-role { margin: 0; }
  .account-links { margin: 0; }
  .topline { min-height: 44px; }
  #main { padding-top: 20px; }
}
@media (max-width: 620px) {
  .stage-grid { grid-template-columns: 1fr; }
  .project-facts, .stage-overlay .facts { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .auth-shell { display: block; padding: 15px; max-width: 475px; margin-inline: auto; }
  .auth-info { min-height: 166px; padding: 20px; border-radius: 12px 12px 0 0; }
  .auth-info::after { right: -98px; top: -110px; }
  .auth-info h1 { margin-top: 16px; }
  .auth-card { border-radius: 0 0 12px 12px; padding: 20px; }
}
@media (max-width: 410px) {
  .metric-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .form-grid { grid-template-columns: 1fr; }
  .summary-count { margin-left: 0; }
}

