:root {
  color-scheme: light;
  --canvas: #f4f6fa;
  --surface: #fff;
  --ink: #19253b;
  --muted: #506079;
  --border: #dbe2ee;
  --soft: #edf1f7;
  --brand: #244caa;
  --brand-soft: #e9efff;
  --green: #13734d;
  --green-soft: #e4f5ed;
  --orange: #985300;
  --orange-soft: #fff0d9;
  --red: #a62e42;
  --red-soft: #fbe8ec;
  --shadow: 0 3px 12px rgb(23 42 81 / 5%);
  --radius: 14px;
  font-family: Inter, "Segoe UI", "Microsoft YaHei UI", "PingFang SC", system-ui, sans-serif;
  color: var(--ink);
  background: var(--canvas);
  font-size: 16px;
  line-height: 1.55;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
body, h1, h2, h3, p, dl, dd { margin: 0; }
button, input, select { font: inherit; }
input, button, select { color: inherit; }
button, summary, a, select { cursor: pointer; }
button:disabled { cursor: default; }
button, summary, a { -webkit-tap-highlight-color: transparent; }
a { color: var(--brand); }
:focus-visible { outline: 3px solid var(--brand); outline-offset: 3px; }
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.shell { width: min(100% - 64px, 1456px); margin-inline: auto; }
.site-header { background: var(--surface); border-bottom: 1px solid var(--border); }
.topbar { display: flex; min-height: 68px; align-items: center; justify-content: space-between; gap: 16px; }
.brand { display: inline-flex; align-items: center; gap: 12px; color: var(--ink); font-weight: 750; text-decoration: none; }
.brand-mark {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: var(--brand);
  box-shadow: 0 2px 7px rgb(36 76 170 / 25%);
}
.brand-mark::before {
  content: "";
  width: 16px;
  height: 12px;
  border: 1.5px solid white;
  border-radius: 2px;
  background: linear-gradient(white, white) 0 3px / 100% 1px no-repeat, linear-gradient(white, white) 4px 4px / 1px 100% no-repeat;
}
.snapshot { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 0.8125rem; }
.snapshot span { width: 7px; height: 7px; background: var(--brand); border-radius: 50%; }
.snapshot time { color: var(--ink); font-variant-numeric: tabular-nums; }

.overview { padding-block: 37px 30px; }
.overview-heading { margin-bottom: 23px; }
h1 { font-size: clamp(1.85rem, 3vw, 2.6rem); font-weight: 780; line-height: 1.24; letter-spacing: -0.045em; }
.overview-heading p { margin-top: 8px; color: var(--muted); }
.metric-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 14px; }
.metric {
  position: relative;
  min-width: 0;
  padding: 17px clamp(14px, 1.45vw, 22px) 15px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.metric::after {
  position: absolute;
  top: 18px;
  right: 16px;
  content: "";
  width: 12px;
  height: 12px;
  border: 2px solid var(--metric-tone, var(--brand));
  border-radius: 3px;
  background: var(--metric-bg, var(--brand-soft));
}
.metric-activity { --metric-tone: var(--green); --metric-bg: var(--green-soft); }
.metric-completion { --metric-tone: var(--orange); --metric-bg: var(--orange-soft); }
.metric-activity::after, .metric-completion::after { border-radius: 50%; }
.metric-categories::after { transform: rotate(45deg) scale(.82); }
.metric-lines::after { height: 11px; border-width: 2px 0; border-radius: 0; }
.metric dt { padding-right: 17px; color: var(--muted); font-size: 0.875rem; font-weight: 650; }
.metric dd { margin-top: 5px; font-variant-numeric: tabular-nums; font-size: clamp(1.35rem, 2.16vw, 2rem); line-height: 1.25; font-weight: 760; letter-spacing: -0.045em; overflow-wrap: anywhere; }
.metric-hint { display: block; margin-top: 5px; color: var(--muted); font-size: .75rem; font-weight: 400; letter-spacing: normal; }
.notice { margin-top: 12px; padding: 12px; border-radius: 8px; background: var(--red-soft); color: var(--red); }

.workspace { display: grid; grid-template-columns: minmax(205px, 246px) minmax(0, 1fr); align-items: start; gap: clamp(16px, 1.9vw, 28px); }
.filters { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }
.filter-header, .projects-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.filter-header { padding: 7px 15px 7px 17px; }
.filter-header h2 { font-size: .95rem; }
.text-button { padding: 0 6px; min-height: 40px; color: var(--brand); font-size: .8125rem; font-weight: 650; background: none; border: 0; border-radius: 5px; }
.text-button:hover:not(:disabled) { text-decoration: underline; }
.text-button:disabled { color: var(--muted); opacity: .65; }
.filter-group { border-top: 1px solid var(--border); }
.filter-group summary { display: flex; gap: 9px; align-items: center; list-style: none; min-height: 49px; padding: 0 18px; font-size: .875rem; font-weight: 650; }
.filter-group summary::-webkit-details-marker { display: none; }
.filter-group summary::after { content: ""; width: 7px; height: 7px; margin-left: 2px; border-block-end: 1.5px solid currentColor; border-inline-end: 1.5px solid currentColor; transform: rotate(45deg); }
.filter-group[open] summary::after { transform: translateY(2px) rotate(225deg); }
.group-count { margin-left: auto; color: var(--muted); font-size: .75rem; font-variant-numeric: tabular-nums; }
.filter-options { max-height: 252px; margin: 0 6px 10px; padding: 2px 7px; overflow-y: auto; scrollbar-width: thin; scrollbar-color: #a6b4ce transparent; list-style: none; }
.filter-option { display: flex; width: 100%; min-height: 36px; align-items: center; justify-content: space-between; gap: 8px; padding: 7px 9px; text-align: left; line-height: 1.35; color: var(--ink); font-size: .8125rem; border: 0; border-radius: 7px; background: none; }
.filter-option span:first-child { overflow-wrap: anywhere; }
.filter-option:hover { background: var(--soft); }
.filter-option[aria-pressed="true"] { background: var(--brand-soft); color: var(--brand); font-weight: 700; }
.filter-option:focus-visible, .filter-group summary:focus-visible { outline-offset: -3px; }
.filter-count { color: var(--muted); font-size: .75rem; font-variant-numeric: tabular-nums; }

.projects-heading { min-height: 35px; margin-bottom: 11px; }
.projects-heading h2 { font-size: 1.25rem; line-height: 1.3; }
.result-count { color: var(--muted); font-size: .8125rem; font-variant-numeric: tabular-nums; }
.toolbar { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 9px; margin-bottom: 15px; }
.search { position: relative; display: flex; align-items: center; }
.search-icon { position: absolute; left: 14px; width: 13px; height: 13px; border: 1.5px solid var(--muted); border-radius: 50%; pointer-events: none; }
.search-icon::after { content: ""; position: absolute; width: 6px; height: 1.5px; bottom: -2px; right: -4px; background: var(--muted); transform: rotate(45deg); }
.search input, .sort select { width: 100%; min-height: 44px; background: var(--surface); border: 1px solid var(--border); border-radius: 9px; font-size: .875rem; }
.search input { min-width: 0; padding: 0 12px 0 37px; }
.search input::placeholder { color: var(--muted); opacity: 1; }
.sort select { padding: 0 12px; }
.view-switch { display: flex; gap: 2px; background: #e8edf5; border: 1px solid var(--border); border-radius: 9px; padding: 3px; }
.view-switch button { display: grid; min-width: 37px; place-items: center; color: var(--muted); background: transparent; border: 0; border-radius: 6px; }
.view-switch button:hover { color: var(--brand); }
.view-switch button[aria-pressed="true"] { color: var(--brand); background: var(--surface); box-shadow: var(--shadow); }
.grid-icon, .table-icon { width: 15px; height: 15px; }
.grid-icon { background: linear-gradient(currentColor, currentColor) 0 0 / 6px 6px no-repeat, linear-gradient(currentColor, currentColor) 100% 0 / 6px 6px no-repeat, linear-gradient(currentColor, currentColor) 0 100% / 6px 6px no-repeat, linear-gradient(currentColor, currentColor) 100% 100% / 6px 6px no-repeat; }
.table-icon { border: 1.5px solid currentColor; border-radius: 2px; background: linear-gradient(currentColor, currentColor) 0 36% / 100% 1px no-repeat, linear-gradient(currentColor, currentColor) 0 70% / 100% 1px no-repeat; }
.active-filters { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.active-filters button { min-height: 34px; padding: 4px 10px; text-align: left; color: var(--brand); background: var(--brand-soft); border: 1px solid #cbd8f8; border-radius: 8px; font-size: .8125rem; overflow-wrap: anywhere; }
.active-filters button span { display: inline-block; padding-left: 5px; font-size: 1rem; }

.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 255px), 1fr)); gap: 14px; }
.project-card { display: flex; flex-direction: column; position: relative; min-width: 0; padding: 16px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow); transition: border-color .16s, box-shadow .16s; }
.project-card:hover, .project-card:focus-within { border-color: #8ca8e3; box-shadow: 0 5px 20px rgb(26 64 141 / 11%); }
.card-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
.card-category { align-self: center; font-size: .75rem; font-weight: 700; color: var(--brand); overflow-wrap: anywhere; }
.project-card h3 { display: flex; justify-content: space-between; gap: 8px; font-size: 1.07rem; line-height: 1.38; }
.project-card h3::after { content: "↗"; flex: none; color: var(--brand); font-weight: 450; }
.project-open { padding: 0; border: 0; border-radius: 3px; background: transparent; color: var(--ink); text-align: left; font-weight: 760; overflow-wrap: anywhere; }
.project-card .project-open::after { content: ""; position: absolute; inset: 0; border-radius: var(--radius); }
.project-open:hover { color: var(--brand); }
.card-type { margin-top: 4px; color: var(--muted); font-size: .8125rem; overflow-wrap: anywhere; }
.card-stack { margin: 11px 0 15px; color: var(--muted); font-size: .8125rem; }
.stack { display: flex; flex-wrap: wrap; gap: 4px; padding: 0; margin: 0; list-style: none; }
.stack li { padding: 2px 6px; background: var(--soft); border-radius: 5px; color: var(--muted); font-size: .75rem; overflow-wrap: anywhere; }
.badge { display: inline-flex; padding: 2px 7px; border-radius: 6px; white-space: nowrap; font-size: .75rem; font-weight: 700; }
.difficulty-high { color: var(--red); background: var(--red-soft); }
.difficulty-medium { color: var(--orange); background: var(--orange-soft); }
.difficulty-low { color: var(--green); background: var(--green-soft); }
.difficulty-neutral { color: var(--muted); background: var(--soft); }
.status { display: inline-flex; gap: 6px; align-items: baseline; color: var(--muted); font-size: .8125rem; font-weight: 600; overflow-wrap: anywhere; }
.status::before { content: ""; flex: 0 0 6px; height: 6px; border-radius: 50%; background: currentColor; transform: translateY(-1px); }
.status-active { color: var(--green); }
.card-progress { margin-top: auto; padding: 10px 11px 11px; border: 1px solid var(--soft); border-radius: 9px; background: #f7f9fc; }
.card-status { margin-bottom: 6px; }
.progress-label { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; column-gap: 8px; font-size: .75rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.progress-label strong { color: var(--ink); font-size: .875rem; }
.progress-track { height: 6px; margin-top: 5px; overflow: hidden; border-radius: 999px; background: #dde4f0; }
.progress-track span { display: block; height: 100%; border-radius: inherit; }
.progress-green { background: #21865e; }
.progress-blue { background: #3b64d4; }
.progress-orange { background: #bf6e10; }
.card-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px 5px; margin-top: 12px; }
.card-stats dt, .detail-stats dt { margin-bottom: 2px; color: var(--muted); font-size: .75rem; }
.card-stats dd, .detail-stats dd { font-variant-numeric: tabular-nums; font-size: .8125rem; font-weight: 690; overflow-wrap: anywhere; }
.attention { display: inline-block; padding: 0 5px; border-radius: 5px; background: var(--orange-soft); color: var(--orange); font-weight: 750; }

.table-wrap { overflow-x: auto; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }
table { width: 100%; min-width: 975px; border-collapse: collapse; text-align: left; font-size: .8125rem; }
thead th { color: var(--muted); font-size: .75rem; white-space: nowrap; background: #eff3f9; }
th, td { padding: 10px; border-bottom: 1px solid var(--border); vertical-align: middle; }
tbody th { min-width: 160px; font-weight: 600; }
tbody tr { cursor: pointer; }
tbody tr:last-child th, tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover, tbody tr:focus-within { background: #f4f7ff; }
.row-category { display: block; color: var(--muted); font-size: .75rem; font-weight: 400; }
td .progress { min-width: 106px; }
.numeric { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.empty { display: grid; justify-items: center; gap: 6px; padding: 38px 14px 32px; border: 1px dashed #b9c7de; border-radius: var(--radius); background: var(--surface); }
.footer { margin-top: 28px; padding: 15px 0 26px; border-top: 1px solid var(--border); color: var(--muted); font-size: .8125rem; }
body:has(dialog[open]) { overflow: hidden; }

dialog { margin: auto 0 auto auto; padding: 0; border: 0; border-radius: 16px 0 0 16px; max-width: 100%; width: min(100%, 615px); height: 100%; max-height: 100%; background: var(--surface); color: var(--ink); box-shadow: -14px 0 45px rgb(11 28 58 / 20%); }
dialog::backdrop { background: rgb(16 30 55 / 53%); }
.detail-header { display: flex; align-items: start; justify-content: space-between; gap: 12px; padding: 22px clamp(16px, 4vw, 28px); border-bottom: 1px solid var(--border); background: #f7f9fd; }
.detail-header p { color: var(--brand); font-size: .8125rem; font-weight: 650; overflow-wrap: anywhere; }
.detail-header h2 { margin-top: 3px; font-size: 1.55rem; line-height: 1.3; overflow-wrap: anywhere; }
.close-button { width: 44px; height: 44px; border: 1px solid var(--border); border-radius: 9px; background: var(--surface); color: var(--ink); font-size: 1.4rem; line-height: 1; }
.close-button:hover, .copy-button:hover { background: var(--brand-soft); border-color: #becdf1; }
.detail-body { padding: 20px clamp(16px, 4vw, 28px) 32px; }
.detail-badges { display: flex; flex-wrap: wrap; align-items: center; gap: 9px; }
.detail-section { margin-top: 23px; padding-top: 18px; border-top: 1px solid var(--border); }
.detail-section h3 { margin-bottom: 9px; font-size: 1rem; }
.description { margin-top: 6px; white-space: pre-wrap; overflow-wrap: anywhere; }
.detail-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-top: 12px; }
.detail-stats > div { min-width: 0; padding: 8px 10px; border-radius: 7px; background: var(--soft); }
.repo-data > div { display: grid; grid-template-columns: 89px minmax(0, 1fr); align-items: baseline; gap: 8px; padding: 9px 0; font-size: .875rem; }
.repo-data dt { color: var(--muted); }
.repo-data dd { overflow-wrap: anywhere; }
.repo-data code { user-select: text; font-family: "Cascadia Code", Consolas, monospace; }
.copy-button { min-height: 44px; display: inline-block; margin: 5px 5px 0 0; padding: 4px 8px; border: 1px solid var(--border); border-radius: 6px; background: var(--surface); color: var(--brand); font-size: .8125rem; }
#copy-status { font-size: .75rem; color: var(--muted); }
.copy-fallback { position: fixed; top: 0; left: 0; width: 1px; height: 1px; opacity: 0; pointer-events: none; }

@media (max-width: 1050px) {
  .shell { width: calc(100% - 44px); }
  .workspace { grid-template-columns: 205px minmax(0, 1fr); }
}

@media (max-width: 760px) {
  .shell { width: calc(100% - 32px); }
  .workspace { grid-template-columns: minmax(0, 1fr); gap: 20px; }
  .overview { padding-block: 24px 20px; }
  .metric-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
  .metric { padding: 12px 10px; }
  .metric::after { top: 13px; right: 9px; width: 8px; height: 8px; }
  .metric dt { padding-right: 9px; font-size: .8125rem; }
  #filter-groups { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; }
  .filter-group:nth-child(even) { border-left: 1px solid var(--border); }
  .filter-options { max-height: 145px; }
  .filter-option { min-height: 42px; }
}

@media (max-width: 465px) {
  .topbar { min-height: 60px; gap: 8px; }
  .brand { gap: 7px; font-size: .9rem; }
  .brand-mark { width: 28px; height: 28px; border-radius: 8px; }
  .snapshot { font-size: .73rem; gap: 5px; }
  .snapshot span { display: none; }
  .overview-heading { margin-bottom: 16px; }
  .overview-heading p { font-size: .875rem; }
  .metric-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .metric:last-child { grid-column: 1 / -1; }
  .toolbar { grid-template-columns: minmax(0, 1fr) auto; }
  .search { grid-column: 1 / -1; }
  .view-switch button { min-width: 44px; }
  .repo-data > div { grid-template-columns: minmax(0, 1fr); gap: 2px; }
  dialog { border-radius: 0; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; }
}
