:root {
  color-scheme: light;
  --ink: #182a34;
  --muted: #53666d;
  --accent: #176757;
  --line: #d8e1df;
  --paper: #fff;
  font-family: "Inter", "Noto Sans CJK SC", "Microsoft YaHei", system-ui, sans-serif;
  color: var(--ink);
  background: #f5f7f6;
  line-height: 1.6;
}
* { box-sizing: border-box; }
body, h1, h2, p, form { margin: 0; }
button, input { font: inherit; }
a { color: var(--accent); }
button, .button { cursor: pointer; }
:focus-visible { outline: 3px solid #547fe4; outline-offset: 3px; }
.visually-hidden, .skip-link:not(:focus) {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}
.skip-link:focus { position: absolute; z-index: 2; background: white; padding: .6rem 1rem; }
.topbar { background: #172f32; color: #fff; }
.topbar-inner, .page {
  width: min(100% - 3rem, 72rem);
  margin-inline: auto;
}
.topbar-inner {
  min-height: 4.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
.brand, .account { display: flex; align-items: center; }
.brand { gap: .75rem; color: inherit; text-decoration: none; font-weight: 650; white-space: nowrap; }
.brand-mark {
  display: inline-block;
  width: 1.4rem;
  height: 1.4rem;
  border-radius: .32rem;
  background: linear-gradient(90deg, transparent 43%, #172f32 43% 57%, transparent 57%),
              linear-gradient(0deg, transparent 43%, #172f32 43% 57%, transparent 57%), #94e2c7;
}
.account { justify-content: flex-end; gap: 1rem; min-width: 0; font-size: .875rem; }
.account-name { overflow-wrap: anywhere; color: #d3e4df; }
.signout { background: transparent; border: 1px solid #5c7978; color: #fff; border-radius: .4rem; padding: .35rem .65rem; white-space: nowrap; }
.signout:hover { background: #29494a; }
.page { margin-block: clamp(2rem, 5vw, 4rem); }
.page-heading { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 1rem; margin-bottom: 1.5rem; }
.page-heading h1 { min-width: 0; overflow-wrap: anywhere; }
h1 { font-size: clamp(1.55rem, 3.2vw, 2.2rem); line-height: 1.3; font-weight: 720; }
h2 { font-size: 1.18rem; font-weight: 650; }
.panel { border: 1px solid var(--line); border-radius: .85rem; background: var(--paper); }
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .35rem;
  min-height: 2.65rem;
  padding: .5rem 1.1rem;
  border: 1px solid transparent;
  border-radius: .45rem;
  font-size: .9375rem;
  font-weight: 650;
  text-decoration: none;
}
.primary { background: var(--accent); color: white; }
.primary:hover { background: #105548; }
.secondary { border-color: var(--line); color: var(--ink); background: var(--paper); }
.secondary:hover { background: #f2f6f4; }
.full { width: 100%; }
.empty-state { display: grid; justify-items: center; gap: .6rem; padding: clamp(3rem, 8vw, 6rem) 1.25rem; text-align: center; }
.empty-state p, .hint, .login-panel > p { color: var(--muted); font-size: .925rem; }
.empty-icon {
  width: 2.6rem; height: 2.1rem; border: 2px solid #5a897d; border-radius: .4rem;
  background: linear-gradient(to bottom, #e0efe9 25%, #5a897d 25% 30%, #f3f9f6 30%);
  margin-bottom: .45rem;
}
.table-panel { overflow: hidden; }
.site-table { width: 100%; border-collapse: collapse; font-size: .93rem; }
.site-table th, .site-table td { padding: .95rem 1rem; text-align: left; vertical-align: top; overflow-wrap: anywhere; }
.site-table thead { background: #ecf2ef; }
.site-table thead th { color: #415b54; font-size: .85rem; }
.site-table tbody tr { border-top: 1px solid var(--line); }
.site-name { max-width: 18rem; }
.hostname, time { font-family: "IBM Plex Mono", ui-monospace, monospace; font-size: .9em; overflow-wrap: anywhere; }
.site-table time { white-space: nowrap; }
.status { display: inline-block; color: #475b51; border: 1px solid #ccdad1; background: #f1f5f1; padding: .06rem .55rem; border-radius: 1rem; white-space: nowrap; font-size: .82rem; }
.page-form { max-width: 45rem; }
.page-login { max-width: 27rem; margin-top: clamp(3rem, 10vw, 7rem); }
.form-panel, .login-panel { padding: clamp(1.3rem, 4.5vw, 2.35rem); }
.login-panel h1 { font-size: 1.55rem; margin-bottom: 1.65rem; }
.back-link { display: inline-flex; align-items: center; gap: .45rem; margin-bottom: 1.3rem; color: var(--accent); font-weight: 600; text-decoration: none; font-size: .9rem; }
.back-link:hover { text-decoration: underline; }
.editor { display: grid; gap: 1.4rem; }
.field { display: grid; gap: .45rem; }
.field[hidden] { display: none; }
.field label { font-weight: 650; }
.field input, .field select, .field textarea { min-width: 0; width: 100%; border: 1px solid #9baca7; border-radius: .4rem; background: white; padding: .56rem .75rem; color: var(--ink); font: inherit; }
.field textarea { resize: vertical; }
.field input[aria-invalid="true"] { border-color: #ba5756; }
.account-permissions { display: grid; gap: .5rem; margin: 0; padding: .75rem 1rem; border: 1px solid var(--line); border-radius: .4rem; }
.account-permissions legend { padding-inline: .3rem; font-weight: 650; }
.account-permissions label { display: flex; align-items: center; gap: .6rem; width: fit-content; cursor: pointer; }
.account-permissions input { width: 1.1rem; height: 1.1rem; margin: 0; accent-color: var(--accent); }
.errorlist { margin: 0; padding-inline-start: 1.3rem; color: #972e2f; font-size: .9rem; }
.hint { font-size: .85rem; }
.preview { display: grid; gap: .3rem; min-width: 0; padding: .85rem 1rem; border-left: .22rem solid #66a792; background: #eef6f2; }
.preview-label { color: #3b6254; font-weight: 600; font-size: .83rem; }
.form-actions { display: flex; gap: .65rem; flex-wrap: wrap; padding-top: .35rem; }
.messages { margin-bottom: 1.25rem; padding: .75rem 1rem; color: #22533f; background: #e9f5ec; border: 1px solid #bfdac7; border-radius: .45rem; }
.release-heading { margin-bottom: 1.6rem; }
.release-heading h1 { overflow-wrap: anywhere; }
.site-meta { display: flex; flex-wrap: wrap; gap: .35rem 1.75rem; margin: .7rem 0 0; font-size: .94rem; }
.site-meta div { display: flex; align-items: baseline; gap: .6rem; min-width: 0; }
.site-meta dt { flex: none; color: var(--muted); }
.site-meta dd { margin: 0; overflow-wrap: anywhere; }
.git-clone { margin-top: .85rem; }
.copy-value { user-select: all; }
.release-panel { padding: clamp(1.15rem, 3.3vw, 2.1rem); }
.release-title, .release-actions, .account-actions { display: flex; align-items: center; flex-wrap: wrap; gap: .65rem; }
.release-title { margin-bottom: .45rem; }
.release-panel p, .history-empty { color: var(--muted); }
.release-actions { margin-top: 1.1rem; }
.release-section { margin-top: 2rem; }
.release-section h2 { margin-bottom: .7rem; }
.status-live { color: #126149; border-color: #a8d6c5; background: #e9f7ef; }
.status-withdrawn { color: #805121; border-color: #d9c5ae; background: #fbf3e8; }
.withdraw { color: #933c35; background: white; border-color: #dfc4c0; }
.withdraw:hover { background: #fff3f1; }
.delete-repository { display: flex; align-items: baseline; gap: .5rem; overflow-wrap: anywhere; }
.action-link {
  border: 0; background: transparent; color: var(--accent); padding: .15rem 0;
  font: inherit; font-weight: 650; text-decoration: underline; text-underline-offset: .2em; white-space: nowrap;
}
.action-link:hover { color: #104c40; }
.action-error { margin-bottom: 1rem; padding: .75rem 1rem; color: #8b312b; border: 1px solid #e2bdb9; border-radius: .45rem; background: #fff1ef; }
.history-empty { padding: 1.1rem 1.25rem; }
.release-events { margin: 0; padding: 0; list-style: none; }
.release-events li { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr) auto; align-items: baseline; gap: .4rem 1rem; padding: .75rem 1rem; font-size: .93rem; overflow-wrap: anywhere; }
.release-events li + li { border-top: 1px solid var(--line); }
.release-events time { color: var(--muted); }
.current-source { display: flex; flex-wrap: wrap; align-items: baseline; gap: .25rem .75rem; margin-top: .45rem; font-size: .92rem; }
.source-path, .source-ref, .source-row-body strong { overflow-wrap: anywhere; }
.source-ref { display: block; color: var(--muted); font-size: .87rem; }
.source-instruction { margin: -.35rem 0 1.3rem; color: var(--muted); }
.source-panel { padding: clamp(1rem, 3vw, 1.8rem); }
.source-heading, .source-rows li, .source-pager, .project-search, .commit-meta { display: flex; flex-wrap: wrap; align-items: center; gap: .65rem 1rem; }
.source-heading, .source-rows li { justify-content: space-between; }
.project-search { align-items: flex-end; margin-top: .85rem; }
.project-search .field { width: min(100%, 30rem); }
.source-rows { list-style: none; margin: 1rem 0 0; padding: 0; }
.source-rows li { border-top: 1px solid var(--line); padding-block: .95rem; }
.source-rows li:last-child { padding-bottom: 0; }
.source-row-body { min-width: 0; flex: 1 1 16rem; }
.source-row-body strong { display: block; }
.commit-meta { color: var(--muted); font-size: .91rem; }
.commit-meta code, .source-ref code { font-family: ui-monospace, monospace; }
.source-empty { margin-top: 1rem; color: var(--muted); }
.source-pager { margin-top: 1rem; justify-content: center; }
.list-filters {
  display: flex; flex-wrap: wrap; align-items: end; gap: .75rem 1rem;
  margin-bottom: 1.2rem; padding: 1rem; background: var(--paper); border: 1px solid var(--line); border-radius: .65rem;
}
.list-filters .field { flex: 1 1 9rem; gap: .25rem; }
.list-filters .field:first-child { flex: 2 1 16rem; }
.list-filters label { font-size: .85rem; }
.list-filters input, .list-filters select { min-height: 2.65rem; }
.event-summary, .event-byline, .cell-meta { display: block; }
.event-byline, .cell-meta { font-size: .85rem; color: var(--muted); }
.previous-release { margin-top: .55rem; }
.status-error { color: #923d34; border-color: #e5bcb5; background: #fff0ec; }
.inline-action { margin-inline-start: .4rem; font-size: .85rem; }
.release-latest { margin-top: .85rem; padding-top: .7rem; border-top: 1px solid var(--line); }
.release-latest > strong { font-size: .85rem; color: var(--muted); }
.resource-meta { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 17rem), 1fr)); gap: 0 1.5rem; }
.resource-meta div { display: block; border-top: 1px solid var(--line); padding-block: .65rem; }
.resource-meta dt { margin-bottom: .22rem; font-size: .85rem; }
@media (max-width: 48rem) {
  .topbar-inner, .page { width: calc(100% - 2rem); }
  .table-panel { border: 0; background: transparent; border-radius: 0; }
  .site-table, .site-table tbody { display: block; }
  .site-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  .site-table tbody tr { display: block; padding: 1rem; margin-bottom: .8rem; background: white; border: 1px solid var(--line); border-radius: .6rem; }
  .site-table .site-name { display: block; max-width: none; padding: 0 0 .5rem; font-size: 1.05rem; }
  .site-table td { display: grid; grid-template-columns: 4.5rem minmax(0, 1fr); align-items: start; justify-items: start; gap: .6rem; padding: .22rem 0; }
  .site-table td::before { content: attr(data-label); color: var(--muted); font-size: .85rem; }
  .list-table td > * { grid-column: 2; }
}
@media (max-width: 32rem) {
  .topbar-inner { gap: .5rem; flex-wrap: wrap; padding-block: .7rem; }
  .account { gap: .65rem; flex-wrap: wrap; }
  .brand { gap: .45rem; }
  .list-filters .field:first-child { flex-basis: 100%; }
  .release-events li { grid-template-columns: minmax(0, 1fr) auto; }
  .release-events time { grid-column: 1 / -1; }
}
