
:root {
  font-family: "Inter", "Microsoft YaHei UI", "PingFang SC", system-ui, sans-serif;
  color: var(--ink);
  background: #f5f5f5;
  accent-color: var(--accent);
  font-synthesis: none;
  --ink: #202020;
  --muted: #606060;
  --line: #e4e4e4;
  --paper: #fff;
  --accent: #007e4b;
  --chrome: #ededed;
  --surface: #f8f8f8;
  --selected: #d4f0df;
  --soft: #e3f5eb;
}
* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; }
button, summary { cursor: pointer; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
h1, h2, p { margin-top: 0; }
h1 { margin: 0; font-size: clamp(1.5rem, 2.5vw, 2rem); line-height: 1.3; letter-spacing: -.025em; overflow-wrap: anywhere; }
h2 { margin: 0 0 14px; font-size: 1.04rem; }
small { font-size: .78rem; color: var(--muted); }
.topbar { background: var(--chrome); border-bottom: 1px solid #dedede; }
.topbar-inner, .pagebar-inner, .content { width: min(100%, 1660px); margin-inline: auto; padding-inline: clamp(16px, 3vw, 42px); }
.topbar-inner { min-height: 60px; display: flex; align-items: center; justify-content: space-between; gap: 18px; }
.brand { display: flex; flex: 0 1 auto; align-items: center; gap: 10px; min-width: 0; }
.brand strong { display: block; font-size: 1.18rem; letter-spacing: -.035em; }
.brand small { display: block; margin-top: 3px; color: var(--muted); font-size: .75rem; }
.brand-icon { width: 34px; height: 34px; flex: 0 0 auto; padding: 7px; border-radius: 8px; background: #07c160; display: grid; grid-template-columns: repeat(2, 1fr); gap: 3px; }
.brand-icon i { border-radius: 2px; background: #ffffff; }
.brand-icon i:nth-child(2) { background: #b9f4d5; border-radius: 5px 2px 2px; }
.topbar-tools, .top-links { display: flex; align-items: center; gap: 14px; }
.top-links { align-self: stretch; gap: 4px; }
.top-links a { display: grid; place-items: center; padding: 8px 12px; border-radius: 6px; color: var(--muted); font-size: .9rem; white-space: nowrap; }
.top-links a:hover { background: #e3e3e3; color: var(--ink); }
.top-links a[aria-current="page"] { background: var(--selected); color: #075e38; font-weight: 600; }
.environment { color: var(--muted); font-size: .75rem; white-space: nowrap; }
.workspace { min-width: 0; }
.page-top-heading { display: flex; align-items: center; gap: 10px; min-width: 0; }
.page-top-heading a { display: inline-flex; flex: 0 0 auto; border-radius: 8px; }
.page-top-heading h1 { font-size: clamp(1.25rem, 2vw, 1.55rem); }
.page-with-footer { display: flex; flex-direction: column; }
.page-with-footer > .workspace { flex: 1; }
.page-with-footer .content { padding-bottom: 24px; }
.site-footer { padding-inline: clamp(14px, 3vw, 42px); }
.site-footer-inner {
  width: min(100%, 1576px);
  margin-inline: auto;
  border-top: 1px solid var(--line);
  padding-block: 11px;
  color: var(--muted);
  text-align: right;
  font-size: .78rem;
}
.site-footer-inner strong { margin-right: 5px; }
.pagebar { background: #fff; border-bottom: 1px solid var(--line); }
.pagebar-inner { min-height: 53px; display: flex; align-items: center; flex-wrap: wrap; gap: 10px; padding-block: 10px; font-size: .87rem; }
.pagebar a { color: var(--accent); }
.pagebar a:hover { text-decoration: underline; }
.pagebar h1 { font-size: 1.08rem; letter-spacing: 0; }
.profile { position: relative; z-index: 2; }
.profile summary { list-style: none; display: flex; align-items: center; gap: 9px; font-weight: 600; font-size: .86rem; }
.profile summary::after { content: "⌄"; color: var(--muted); }
.profile summary small { color: var(--muted); }
.identity-menu { color: var(--ink); }
.profile summary small, .identity-card small { display: block; margin-top: 3px; font-weight: normal; }
.avatar { border-radius: 7px; background: #daf3e4; color: #12633d; width: 34px; height: 34px; display: inline-grid; place-items: center; flex: 0 0 auto; }
.avatar-vendor { background: #e9eeeb; color: #43534a; }
.identity-menu, .filter-popover { position: absolute; top: calc(100% + 10px); right: 0; z-index: 2; width: 236px; background: var(--paper); border: 1px solid var(--line); border-radius: 10px; padding: 14px; box-shadow: 0 8px 24px #00000014; }
.identity-menu fieldset { border: 0; margin: 0; padding: 0; }
.identity-menu button { display: block; text-align: left; width: 100%; margin-top: 7px; }
.identity-menu small { display: block; }
.content { padding-block: 24px 48px; }
.page-heading { display: flex; align-items: center; justify-content: space-between; gap: 24px; margin-bottom: 23px; }
.page-heading p { margin: 9px 0 0; color: var(--muted); }
.button, button { display: inline-flex; align-items: center; justify-content: center; gap: 6px; width: fit-content; border: 1px solid #d9d9d9; border-radius: 6px; background: #fff; color: var(--ink); padding: .56rem .88rem; font-size: .9rem; line-height: 1.45; font-weight: 600; white-space: nowrap; }
.button:hover, button:hover { background: #f1f1f1; }
button:disabled { opacity: .6; cursor: default; }
.primary { background: var(--accent); color: #fff; border-color: var(--accent); }
.primary:hover { background: #006a3f; }
.list-panel, .panel { background: var(--paper); border: 1px solid var(--line); border-radius: 9px; }
.tabs { padding: 8px 14px; display: flex; gap: 8px; overflow-x: auto; border-bottom: 1px solid var(--line); background: var(--surface); border-radius: 9px 9px 0 0; }
.tabs a { padding: 8px 10px; color: var(--muted); border-radius: 6px; white-space: nowrap; font-size: .9rem; }
.tabs a:hover { background: var(--chrome); color: var(--ink); }
.tabs a.current { color: #075e38; font-weight: 650; background: var(--selected); }
.tabs a span { display: inline-block; min-width: 20px; margin-left: 2px; padding: 1px 5px; border-radius: 999px; background: #eeeeee; font-size: .76rem; text-align: center; }
.tabs a.current span { color: #075e38; background: #bce9ce; }
.list-tools { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; min-height: 66px; padding: 11px 17px; }
.filter-form { display: flex; gap: 7px; flex-wrap: wrap; align-items: center; }
.filter-form select { min-height: 37px; font-size: .86rem; }
.filters { position: relative; }
.filters summary { padding: 8px 10px; font-size: .84rem; }
.filter-popover { display: grid; gap: 9px; }
.filter-popover label { display: grid; gap: 4px; font-size: .84rem; }
.reset { color: var(--accent); text-decoration: underline; font-size: .83rem; }
.list-count, .muted { color: var(--muted); font-size: .84rem; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: .85rem; text-align: left; }
th { background: #f0f0f0; color: #505050; font-weight: 600; font-size: .78rem; white-space: nowrap; }
th, td { padding: 13px 14px; vertical-align: middle; }
th:first-child, td:first-child { padding-left: 18px; }
td + td { white-space: nowrap; }
tbody tr + tr { border-top: 1px solid #ebebeb; }
tbody tr:hover { background: #f7f7f7; }
.issue-cell { width: 43%; min-width: 245px; }
.issue-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin-bottom: 4px; color: var(--muted); font-size: .76rem; }
.identifier { color: #515151; font-weight: 650; font-variant-numeric: tabular-nums; }
.issue-link { display: inline-block; font-size: .95rem; font-weight: 700; overflow-wrap: anywhere; }
.issue-link:hover { color: var(--accent); text-decoration: underline; }
.row-progress { display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden; color: var(--muted); margin-top: 5px; font-size: .81rem; overflow-wrap: anywhere; }
.badge, .due-label, .priority { display: inline-block; padding: 3px 7px; border-radius: 5px; line-height: 1.4; font-size: .76rem; }
.state-active { background: #daf3e4; color: #12633d; }
.state-queue, .state-neutral { background: #efefef; color: #505050; }
.state-review { background: #f0eafa; color: #57428c; }
.state-done { background: #eaf3ed; color: #2e6144; }
.priority, .overdue { background: #f9e8e3; color: #8e3227; }
.soon { background: #fbefce; color: #6d4b0c; }
.due-label { display: table; margin-top: 4px; }
.empty { padding: 35px 20px; text-align: center; color: var(--ink); }
.empty p { margin: 8px 0 0; font-size: .86rem; color: var(--muted); }
.pagination { display: flex; justify-content: center; align-items: center; gap: 10px; padding: 14px; border-top: 1px solid var(--line); }
.welcome { max-width: 780px; padding: 40px 0; }
.welcome-heading p { color: var(--muted); margin-top: 15px; }
.identity-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 13px; margin-top: 28px; }
.identity-card { width: 100%; min-height: 86px; justify-content: flex-start; text-align: left; gap: 12px; border-radius: 12px; white-space: normal; }
.identity-card .arrow { color: var(--accent); margin-left: auto; }
.breadcrumb { display: inline-block; color: var(--accent); font-size: .88rem; margin-bottom: 16px; }
.breadcrumb:hover { text-decoration: underline; }
.panel.issue-detail { padding: 0; }
.detail-header { container-type: inline-size; padding: clamp(16px, 2vw, 23px); border-bottom: 1px solid var(--line); }
.detail-heading, .detail-title { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.detail-heading { justify-content: space-between; margin-bottom: 13px; }
.detail-title { min-width: 0; flex: 1 1 460px; }
.detail-title h1 { font-size: clamp(1.2rem, 2vw, 1.65rem); min-width: 0; }
.detail-title .identifier { font-size: .82rem; white-space: nowrap; }
.detail-primary-action .form-message { max-width: 32ch; margin-top: 6px; }
.detail-metadata { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 16px; margin: 8px 0 0; }
@container (min-width: 830px) {
  .detail-metadata { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
.detail-metadata > div { display: flex; align-items: baseline; flex-wrap: wrap; gap: 3px 8px; min-width: 0; }
.detail-metadata dt { color: var(--ink); font-size: .81rem; font-weight: 650; }
.detail-metadata dd { min-width: 0; margin: 0; font-size: .88rem; overflow-wrap: anywhere; }
.detail-metadata .due-label { display: inline-block; margin: 0 0 0 4px; }
.detail-grid { display: grid; grid-template-columns: minmax(0, 1fr); }
.detail-grid.has-history { grid-template-columns: minmax(0, 1.9fr) minmax(295px, 1fr); }
.detail-content, .detail-history { min-width: 0; padding: clamp(16px, 2vw, 23px); }
.detail-history { border-left: 1px solid var(--line); background: var(--surface); border-radius: 0 0 9px 0; }
.detail-review { margin-top: 16px; padding-top: 13px; border-top: 1px solid var(--line); }
.entry-form .inline-field { grid-template-columns: max-content minmax(0, 225px); align-items: center; gap: 8px; }
.detail-supplements, .detail-remark { margin-top: 16px; }
.detail-supplements h2 { margin: 0 0 8px; }
.supplement-list { display: grid; gap: 8px; list-style: none; margin: 0; padding: 0; }
.supplement-list li { padding: 8px 11px; border-radius: 6px; background: var(--soft); color: var(--ink); }
.supplement-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 12px;
  margin-bottom: 4px;
  color: var(--muted);
  font-size: .79rem;
}
.supplement-meta time { font-variant-numeric: tabular-nums; }
.detail-remark-heading { display: flex; align-items: baseline; flex-wrap: wrap; gap: 6px 12px; }
.detail-remark-heading h2 { margin: 0; }
.detail-remark-heading button { padding: 0; border: 0; background: transparent; color: var(--accent); font-size: .86rem; }
.detail-remark-heading button:hover { text-decoration: underline; }
.detail-remark-heading button[hidden] { display: none; }
.detail-remark pre { font-family: inherit; margin-top: 8px; font-size: .88rem; }
.detail-remark .remark-preview { max-height: 6.6em; overflow: hidden; }
.history-more summary { color: var(--accent); font-size: .86rem; font-weight: 600; }
.history-more { margin-top: 9px; }
.history-more[open] > summary { margin-bottom: 9px; }
.detail-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.detail-return { padding-block: .4rem; }
.detail-manage { margin-inline-start: 5px; padding: 0; border: 0; background: transparent; color: var(--accent); font-size: .82rem; }
.detail-manage:hover { text-decoration: underline; }
.issue-action-dialog {
  position: fixed;
  inset: 0 0 0 auto;
  width: min(100%, 510px);
  max-width: none;
  height: 100dvh;
  max-height: none;
  margin: 0;
  padding: 0;
  border: 0;
  border-left: 1px solid var(--line);
  color: var(--ink);
  background: var(--paper);
}
.issue-action-dialog::backdrop { background: #20202066; }
.issue-action-dialog .entry-form { display: flex; flex-direction: column; gap: 0; max-height: 100%; }
.issue-dialog-header, .issue-dialog-actions { flex-shrink: 0; padding: 16px 20px; }
.issue-dialog-header { border-bottom: 1px solid var(--line); }
.issue-dialog-header h2 { margin: 0; font-size: 1.15rem; }
.issue-dialog-fields { display: grid; align-content: start; gap: 16px; min-height: 0; overflow: auto; padding: 20px; }
.character-count { color: var(--muted); font-size: .75rem; font-variant-numeric: tabular-nums; }
.character-count.over-limit { color: #8a2b22; }
.registration-field .character-count { display: block; }
.issue-dialog-text textarea {
  field-sizing: content;
  min-height: 8rem;
  max-height: var(--issue-text-limit, 45dvh);
  overflow-y: auto;
}
.issue-dialog-actions { justify-content: flex-end; border-top: 1px solid var(--line); }
.dialog-hint { margin: 0; color: var(--muted); font-size: .88rem; }
.issue-dialog-reference { font-size: .9rem; }
.issue-dialog-reference summary { color: var(--accent); font-weight: 600; }
.issue-dialog-reference h3 { margin: 10px 0 4px; font-size: .88rem; }
.issue-dialog-reference pre { font-family: inherit; }

@media (min-width: 1000px) {
  .issue-screen:has(.issue-action-dialog[open]) {
    display: grid;
    grid-template-columns: minmax(0, 1fr) clamp(330px, 32vw, 480px);
    align-items: start;
    gap: 16px;
  }
  .issue-screen:has(.issue-action-dialog[open]) .detail-grid.has-history {
    grid-template-columns: minmax(0, 1fr);
  }
  .issue-screen:has(.issue-action-dialog[open]) .detail-history {
    border-left: 0;
    border-top: 1px solid var(--line);
    border-radius: 0 0 9px 9px;
  }
  .issue-editor { position: sticky; top: 16px; min-width: 0; }
  .issue-action-dialog:not(:modal) {
    position: static;
    width: 100%;
    height: auto;
    max-height: calc(100dvh - 32px);
    border: 1px solid var(--line);
    border-radius: 9px;
  }
  .issue-action-dialog:not(:modal) .entry-form { max-height: calc(100dvh - 34px); }
  .issue-action-dialog:not(:modal) .issue-dialog-reference { display: none; }
  .issue-screen.align-editor:has(.issue-action-dialog[open]) { align-items: stretch; }
  .align-editor .issue-editor { position: static; }
  .align-editor .issue-action-dialog:not(:modal) { height: 100%; }
  .align-editor .issue-action-dialog:not(:modal) .entry-form { height: 100%; }
  .align-editor .issue-dialog-fields,
  .align-editor .issue-dialog-text { display: flex; flex: 1 0 auto; flex-direction: column; }
  .align-editor .issue-dialog-fields { flex-shrink: 1; }
  .align-editor .issue-dialog-text textarea { flex: 1 0 auto; }
}
.stack { display: grid; gap: 16px; min-width: 0; }
.panel { padding: clamp(16px, 2.5vw, 25px); }
.multiline { white-space: pre-wrap; overflow-wrap: anywhere; margin: 0; line-height: 1.65; }
.subheading { margin-top: 20px; }
.facts dl { margin: 0; }
.facts dt { color: var(--muted); font-size: .79rem; }
.facts dd { margin: 4px 0 14px; font-size: .9rem; }
.entry-form { display: grid; gap: 12px; }
form.panel { max-width: 780px; }
.entry-form label, .draft-fields label { display: grid; gap: 6px; font-size: .88rem; }
.entry-form .check-label { display: flex; align-items: center; }
input:not([type="checkbox"]), select, textarea { padding: 8px 10px; background: #ffffff; border: 1px solid #d9d9d9; border-radius: 7px; color: var(--ink); min-width: 0; width: 100%; }
textarea { resize: vertical; }
textarea::placeholder { color: #666666; }
.draft-fields { border: 0; padding: 14px 0 0; margin: 6px 0 4px; min-width: 0; display: grid; gap: 13px; }
.draft-fields legend, .action-panel summary { font-weight: 700; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 13px; }
.form-tools, .form-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 9px; }
.form-message { margin: 0; font-size: .84rem; line-height: 1.5; color: var(--accent); }
.form-message:empty { display: none; }
.form-message[data-state="error"] { color: #8a2b22; }
.action-panel[open] summary { margin-bottom: 14px; }
.date-field { max-width: 245px; }
.review-action { display: grid; gap: 8px; }
.nested-action { margin-top: 13px; }
.nested-action summary { color: var(--accent); font-size: .9rem; font-weight: 600; }
.nested-action[open] summary { margin-bottom: 10px; }
.timeline { list-style: none; padding: 0; margin: 0; }
.timeline li { padding: 10px 0; border-top: 1px solid var(--line); }
.history-line { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 10px; font-size: .84rem; overflow-wrap: anywhere; }
.history-line .history-label { color: var(--ink); font-weight: 600; }
.history-actor, .history-line time { color: var(--muted); }
.history-line time { margin-left: auto; font-variant-numeric: tabular-nums; }
.timeline p { width: fit-content; max-width: 100%; padding: 7px 10px; border-radius: 6px; background: var(--soft); font-size: .86rem; margin-top: 6px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
@media (min-width: 1000px) {
  .brand > span:last-child, .profile summary > span:last-child {
    display: flex;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 3px 9px;
  }
  .brand small, .profile summary small { margin: 0; }
}

@media(max-width: 850px) {
  .topbar-inner { flex-wrap: wrap; gap: 4px 12px; padding-block: 6px; }
  .detail-grid.has-history { grid-template-columns: minmax(0, 1fr); }
  .detail-history { border-left: 0; border-top: 1px solid var(--line); border-radius: 0 0 9px 9px; }
}
@media(max-width: 580px) {
  .content { padding-block: 16px 32px; }
  .topbar-inner, .pagebar-inner, .content { padding-inline: 14px; }
  .topbar-tools { flex-wrap: wrap; gap: 8px; }
  .top-links a { padding: 7px 6px; }
  .brand small { font-size: .7rem; }
  .topbar-tools .environment { font-size: .7rem; }
  .detail-title { flex-basis: 100%; }
  .entry-form .inline-field { grid-template-columns: minmax(0, 1fr); }
  .detail-metadata { column-gap: 14px; }
  .page-heading { gap: 10px; }
  .tabs { padding-inline: 11px; gap: 10px; }
  .detail-grid, .identity-grid { grid-template-columns: minmax(0, 1fr); }
  .welcome { padding-top: 15px; }
  .table-wrap { overflow: visible; }
  .table-wrap table, .table-wrap tbody { display: block; }
  .table-wrap thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  .table-wrap tr { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); padding: 11px 14px; gap: 9px; }
  .table-wrap td { display: block; padding: 0; white-space: normal; }
  .table-wrap td::before { content: attr(data-label); display: block; margin-bottom: 3px; font-size: .72rem; color: var(--muted); }
  .table-wrap .issue-cell { grid-column: 1 / -1; width: auto; min-width: 0; }
  .table-wrap .issue-cell::before { content: none; }
}
