*, *::before, *::after {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

:root {
  color-scheme: light;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #eef2ff;
  color: #172033;
}

body {
  margin: 0;
  min-height: 100vh;
  background: linear-gradient(145deg, #eef2ff 0%, #f8fafc 48%, #e0f2fe 100%);
}

.portal-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.portal-card {
  width: min(420px, 100%);
  padding: 36px;
  border: 1px solid #d7deeb;
  border-radius: 20px;
  background: #ffffff;
  box-shadow: 0 20px 55px rgba(30, 41, 59, 0.13);
}

.eyebrow {
  margin: 0 0 10px;
  color: #1d4ed8;
  font-size: 0.78rem;
  font-weight: 750;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  color: #0f172a;
  font-size: clamp(1.75rem, 7vw, 2.25rem);
  line-height: 1.15;
}

.subtitle {
  margin: 12px 0 26px;
  color: #475569;
  line-height: 1.65;
}

form {
  display: grid;
  gap: 10px;
}

label {
  margin-top: 6px;
  color: #243047;
  font-size: 0.9rem;
  font-weight: 650;
}

input {
  width: 100%;
  min-height: 46px;
  padding: 10px 12px;
  border: 1px solid #64748b;
  border-radius: 10px;
  background: #ffffff;
  color: #0f172a;
  font: inherit;
}

button {
  min-height: 46px;
  margin-top: 8px;
  padding: 10px 18px;
  border: 1px solid #1d4ed8;
  border-radius: 10px;
  background: #1d4ed8;
  color: #ffffff;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

button.secondary {
  border-color: #334155;
  background: #ffffff;
  color: #1e293b;
}

button:disabled {
  cursor: wait;
  opacity: 0.66;
}

input:focus-visible,
button:focus-visible {
  outline: 3px solid #9a3412;
  outline-offset: 3px;
}

.form-error {
  min-height: 1.4em;
  margin: 4px 0 0;
  color: #b42318;
  font-size: 0.9rem;
  line-height: 1.45;
}

#employee-welcome {
  margin: 20px 0 0;
  color: #1e293b;
  font-weight: 650;
}

#employee-authenticated { width: min(1440px, 100%); align-self: start; }
.repository-header { display: flex; align-items: center; gap: 20px; flex-wrap: wrap; padding: 22px 0; border-bottom: 1px solid #d7deeb; }
.repository-brand { color: #0f172a; font-size: 1.25rem; font-weight: 750; text-decoration: none; }
#repository-search-form { display: flex; flex: 1; min-width: 240px; }
#repository-search-form input { min-width: 0; flex: 1; width: auto; }
#repository-search-form button { flex: 0 0 auto; white-space: nowrap; }
#repository-search-form button, .repository-header button { margin: 0; }
.repository-header #employee-welcome { margin: 0; font-size: .9rem; }
#employee-repository-shell { display: grid; grid-template-columns: 180px minmax(0, 1fr); gap: 32px; padding-top: 28px; }
#repository-kinds { display: flex; flex-direction: column; gap: 8px; align-items: stretch; }
#repository-kinds button { text-align: left; margin: 0; }
#repository-kinds button[aria-current="page"] { background: #1d4ed8; color: white; border-color: #1d4ed8; }
.repository-main { min-width: 0; }
.repository-main h1 { font-size: 1.8rem; margin: 18px 0; }
.repository-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 18px; }
.repository-card { background: white; border: 1px solid #d7deeb; border-radius: 14px; padding: 22px; display: flex; flex-direction: column; overflow-wrap: anywhere; }
.repository-card h2 { margin: 12px 0 0; font-size: 1.15rem; }
.repository-card p { color: #475569; line-height: 1.6; }
.repository-card button { margin-top: auto; }
.repository-card img { width: 48px; height: 48px; object-fit: contain; margin-bottom: 12px; }
.kind-label { color: #1d4ed8; font-size: .8rem; }
.repository-pagination { display: flex; gap: 18px; align-items: center; justify-content: center; margin: 30px 0; }
#repository-readme-and-assets > section { padding: 24px; margin: 20px 0; background: white; border: 1px solid #d7deeb; border-radius: 14px; overflow-wrap: anywhere; }
.repository-readme { line-height: 1.75; }
.repository-readme img { max-width: 100%; height: auto; }
.repository-readme .external-link::after { content: '↗ 外部链接'; margin-left: .3em; font-size: .8em; }
.repository-readme pre, .repository-readme table { max-width: 100%; overflow: auto; display: block; }
.repository-readme pre { padding: 16px; background: #f1f5f9; }
.repository-readme td, .repository-readme th { padding: 8px 14px; border: 1px solid #cbd5e1; }
.package-row { padding: 18px 0; border-top: 1px solid #e2e8f0; }
.changelog { white-space: pre-wrap; }
.image-unavailable { color: #64748b; font-size: .85rem; }
select { font: inherit; padding: 10px; max-width: 100%; }
a:focus-visible, select:focus-visible { outline: 3px solid #9a3412; outline-offset: 3px; }
.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 (max-width: 760px) {
  #employee-repository-shell { grid-template-columns: minmax(0, 1fr); gap: 12px; }
  #repository-kinds { flex-direction: row; overflow-x: auto; padding-bottom: 8px; }
  #repository-kinds button { flex: 0 0 auto; }
  .repository-header { gap: 14px; }
  #repository-search-form { order: 4; flex-basis: 100%; }
  #repository-readme-and-assets > section { padding: 18px; }
}

@media (max-width: 520px) {
  .portal-shell {
    align-items: start;
    padding: 18px;
  }

  .portal-card {
    margin-top: 8vh;
    padding: 28px 22px;
    border-radius: 16px;
  }
}

#repository-feedback-list, .feedback-new-floor-form { margin: 28px 0; }
#repository-feedback-notice:empty { display: none; }
#repository-feedback-notice { padding: 12px; border-left: 3px solid #2563eb; background: #eff6ff; }
.feedback-floor, .feedback-new-floor-form { padding: 24px; background: #fff; border: 1px solid #d7deeb; border-radius: 14px; }
.feedback-floor { margin: 18px 0; overflow-wrap: anywhere; }
.feedback-floor header { display: flex; align-items: center; flex-wrap: wrap; gap: 10px 16px; }
.feedback-floor header time { color: #64748b; font-size: .85rem; }
.feedback-floor header button { margin: 0 0 0 auto; }
.feedback-text { white-space: pre-wrap; line-height: 1.75; }
.feedback-replies { margin: 20px 0 0; padding-left: 18px; border-left: 2px solid #e2e8f0; }
.feedback-reply { padding: 18px 0; border-top: 1px solid #e2e8f0; }
.feedback-reply-form { margin-top: 18px; padding: 18px; background: #f8fafc; border-radius: 10px; }
.feedback-body { display: block; width: 100%; min-height: 100px; margin-top: 8px; padding: 12px; resize: vertical; border: 1px solid #64748b; border-radius: 10px; background: white; color: #172033; font: inherit; line-height: 1.6; }
.feedback-body:focus-visible { outline: 3px solid #9a3412; outline-offset: 3px; }
.feedback-form-actions { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
button.feedback-image-trigger { border-color: transparent; padding: 6px 10px; background: transparent; font-size: .9rem; }
.feedback-image-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; }
.feedback-image-grid:empty, .feedback-target:empty, .feedback-status:empty { display: none; }
.feedback-picture, .feedback-preview { min-width: 0; }
.feedback-picture img, .feedback-preview img { display: block; width: 100%; height: 130px; object-fit: contain; background: #f1f5f9; border: 1px solid #d7deeb; border-radius: 8px; }
.feedback-preview { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.feedback-preview > span { width: 100%; color: #475569; font-size: .85rem; }
.feedback-preview button { min-height: 36px; margin: 0; padding: 5px 10px; font-size: .85rem; }
.feedback-target, .feedback-status { color: #334155; font-size: .9rem; }
@media (max-width: 760px) {
  .feedback-image-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .feedback-floor, .feedback-new-floor-form { padding: 16px; }
  .feedback-replies { padding-left: 12px; }
  .feedback-reply-form { padding: 12px; }
}
