/* 打磨版 A：配色仍是现行海军蓝 / 铜。不改正文字体。总览卡片对齐研究台。 */
html.theme-a {
  color-scheme: light;
  --serif: "Source Han Serif SC", "Noto Serif SC", "Songti SC", "SimSun", Georgia, serif;
}

.theme-a .skip-link {
  position: absolute;
  left: 12px;
  top: 12px;
  z-index: 200;
  padding: 8px 12px;
  background: var(--paper-2);
  color: var(--ink);
  border: 1px solid var(--accent);
  transform: translateY(-160%);
}
.theme-a .skip-link:focus {
  transform: none;
}

.theme-a .ui-switch {
  font-size: 12px;
  color: #f0d4c4;
  text-decoration: underline;
  white-space: nowrap;
}
.theme-a .login-page .ui-switch,
.theme-a .login-foot .ui-switch {
  color: var(--accent);
}

.theme-a :focus {
  outline: none;
}
.theme-a :focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.theme-a .sidebar {
  padding: max(8px, env(safe-area-inset-top, 0px)) 18px 8px;
  gap: 8px 12px;
  box-shadow: 0 6px 16px rgba(7, 19, 32, 0.14);
}
.theme-a .nav a,
.theme-a .nav-ext {
  padding: 8px 12px;
}
.theme-a .nav a.active,
.theme-a .nav-ext.active {
  background: #1a3a54;
  color: #f6e4d8;
  border-bottom: 0;
}
.theme-a .kicker {
  letter-spacing: 0.08em;
  padding-right: 0;
}
.theme-a .topbar {
  padding: 4px 0 12px;
}
.theme-a .topbar h1 {
  letter-spacing: 0;
  font-size: 28px;
}
.theme-a .main {
  padding: 8px 36px 48px;
}
.theme-a .hint {
  margin: 0 0 16px;
  color: var(--muted);
}
.theme-a .welcome {
  max-width: 42em;
  margin: 0 0 22px;
  font-size: 15px;
  line-height: 1.7;
  color: var(--ink-soft);
}

.theme-a .cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(280px, 100%), 1fr));
  gap: 14px;
}
.theme-a .card,
.theme-a .hub-cards .card {
  min-height: 132px;
  padding: 16px 16px 14px;
  box-shadow: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
  position: relative;
}
.theme-a .card::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  height: 2px;
  width: 28px;
  background: var(--accent);
}
.theme-a .card:hover {
  transform: none;
  box-shadow: none;
  border-color: var(--accent);
  background: #fff;
}
.theme-a .card .kicker {
  color: var(--accent);
  margin: 0;
}
.theme-a .card h2 {
  margin: 0;
  letter-spacing: 0;
  font-size: 18px;
  font-family: var(--serif);
  font-weight: 650;
}
.theme-a .card p {
  margin: 0;
  flex: 1;
  font-size: 13px;
  line-height: 1.6;
}
.theme-a .card .meta {
  font-size: 11px;
  color: var(--muted);
  letter-spacing: 0;
}

body.theme-a.page-accounts .main {
  width: 100%;
  max-width: none;
}
body.theme-a.page-accounts #oa-root,
body.theme-a.page-accounts .oa-table-wrap {
  width: 100%;
  min-width: 0;
}
body.theme-a.page-accounts .oa-table-wrap {
  overflow-x: auto;
}
body.theme-a.page-accounts .oa-matrix {
  width: 100%;
  min-width: 100%;
  table-layout: auto;
}
body.theme-a.page-accounts .oa-matrix th:first-child,
body.theme-a.page-accounts .oa-matrix td:first-child {
  min-width: 170px;
}
body.theme-a.page-accounts .oa-matrix th:not(:first-child):not(:last-child),
body.theme-a.page-accounts .oa-matrix td:not(:first-child):not(:last-child) {
  min-width: 112px;
  text-align: center;
}
body.theme-a.page-accounts .oa-matrix th:last-child,
body.theme-a.page-accounts .oa-matrix td:last-child {
  width: 1%;
  min-width: 70px;
  white-space: nowrap;
}

.theme-a .btn {
  letter-spacing: 0;
}
.theme-a .btn:hover:not(:disabled) {
  filter: brightness(1.06);
}
.theme-a .btn.accent:hover:not(:disabled) {
  filter: brightness(1.04);
}

.theme-a table.plain th,
.theme-a table.plain td {
  font-variant-numeric: tabular-nums;
}
.theme-a table.plain thead th {
  position: sticky;
  top: 0;
  background: var(--paper-2);
  z-index: 1;
}
.theme-a table.plain tbody tr:hover {
  background: rgba(196, 110, 56, 0.08);
}

.theme-a .login-card {
  padding: 32px 28px 24px;
  box-shadow: none;
}
.theme-a .login-form button {
  letter-spacing: 0;
}
.theme-a .login-foot {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.theme-a .oa-desk {
  display: grid;
  gap: 12px;
  margin: 0 0 16px;
}
.theme-a .oa-desk-main {
  display: grid;
  align-content: start;
  gap: 12px;
  min-width: 0;
}
.theme-a .oa-desk-main .oa-table-wrap {
  width: 100%;
  min-width: 0;
  overflow-x: auto;
}
body.theme-a.page-records .main {
  width: 100%;
  max-width: none;
}
.theme-a .filters,
.theme-a .upload,
.theme-a .actions,
.theme-a .oa-toolbar,
.theme-a form#enrol {
  padding: 12px 14px;
  margin: 0 0 14px;
  background: var(--paper-2);
  border: 1px solid var(--rule);
}
.theme-a .oa-desk .filters,
.theme-a .oa-desk .upload {
  margin: 0;
}
.theme-a .oa-desk-side {
  display: grid;
  gap: 0;
  overflow: hidden;
  background: var(--paper-2);
  border: 1px solid var(--rule);
}
.theme-a .oa-desk-side .upload {
  margin: 0;
  border: 0;
  background: transparent;
  padding: 14px;
}
.theme-a .oa-desk-side .upload + .upload {
  border-top: 1px solid var(--rule);
}
.theme-a .oa-desk-side #lock-working {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.theme-a .oa-desk-side #lock-working button {
  grid-column: 2;
}
.theme-a .filters label,
.theme-a .upload label:not(.check),
.theme-a form#enrol label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 12px;
  color: var(--ink-soft);
}
.theme-a .filters {
  align-items: flex-end;
}
.theme-a .filters input,
.theme-a .filters select,
.theme-a .upload input,
.theme-a .upload select,
.theme-a .oa-add input,
.theme-a form#enrol input {
  min-height: 36px;
}
.theme-a .upload {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(10rem, 1fr));
  align-items: end;
}
.theme-a .upload strong {
  grid-column: 1 / -1;
  font-size: 13px;
}
.theme-a .upload .check,
.theme-a .upload button {
  align-self: end;
}
.theme-a .oa-toolbar {
  align-items: flex-end;
}
.theme-a .oa-add input {
  min-width: 12rem;
}
.theme-a .oa-new-grants {
  padding: 0 2px 8px;
}
.theme-a .oa-status {
  min-height: 1.4em;
  margin: 0 0 10px;
}
.theme-a .actions {
  gap: 10px;
}
.theme-a .log {
  margin: 0;
}
.theme-a form#enrol {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 14px;
  align-items: flex-end;
  max-width: 36rem;
}
.theme-a .main > ul {
  max-width: 42em;
  padding-left: 1.2em;
  line-height: 1.65;
  color: var(--ink-soft);
}
.theme-a .main > h2 {
  margin: 28px 0 8px;
  font-size: 16px;
  letter-spacing: 0;
}

.theme-a.page-files .main,
body.theme-a.page-files .main {
  padding: 8px 20px 10px;
}
.theme-a .files-toolbar {
  padding: 8px 10px;
  background: var(--paper-2);
  border: 1px solid var(--rule);
}
.theme-a .files-filter-label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 12px;
  color: var(--ink-soft);
}
.theme-a .files-toolbar input[type="search"] {
  min-height: 36px;
}
.theme-a #files-body tr[data-path]:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: -2px;
}

.theme-a {
  touch-action: manipulation;
}

@media (min-width: 960px) {
  body.theme-a.page-records {
    min-height: 100dvh;
  }
  body.theme-a.page-records .main {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    min-height: 0;
    padding-bottom: 12px;
  }
  body.theme-a.page-records .oa-desk {
    flex: 1 1 auto;
    min-height: 0;
    margin-bottom: 0;
    grid-template-columns: minmax(0, 3fr) minmax(20rem, 2fr);
    align-items: stretch;
  }
  body.theme-a.page-records .oa-desk-main {
    min-height: 0;
    grid-template-rows: auto minmax(0, 1fr);
  }
  body.theme-a.page-records .oa-desk-main .oa-table-wrap {
    overflow: auto;
  }
  body.theme-a.page-records .oa-desk-side {
    display: grid;
    grid-template-rows: repeat(2, minmax(0, 1fr));
    min-height: 0;
  }
  body.theme-a.page-records .oa-desk-side .upload {
    min-height: 0;
    overflow: auto;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-auto-rows: min-content;
    align-content: start;
  }
  body.theme-a.page-records .oa-desk-side:not(:has(#lock-working)) {
    grid-template-rows: minmax(0, 1fr);
  }
  body.theme-a.page-records .oa-desk-side .upload label {
    min-width: 0;
  }
  body.theme-a.page-records .oa-desk-side .upload input,
  body.theme-a.page-records .oa-desk-side .upload select {
    width: 100%;
    min-width: 0;
  }
  body.theme-a.page-records #lock-working {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  body.theme-a.page-records #lock-working button {
    grid-column: 2;
  }
}

@media (max-width: 960px) {
  .theme-a .main {
    padding-left: 16px;
    padding-right: 16px;
  }
  .theme-a .topbar h1 {
    font-size: 22px;
  }
}

@media (max-width: 560px) {
  .theme-a .oa-desk-side #lock-working {
    grid-template-columns: 1fr;
  }
  .theme-a .oa-desk-side #lock-working button {
    grid-column: 1;
  }
}

@media (prefers-reduced-motion: reduce) {
  .theme-a *,
  .theme-a *::before,
  .theme-a *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
