:root {
  --paper: #f3f0e8;
  --paper-strong: #e8e3d6;
  --surface: #fffdf7;
  --ink: #17202a;
  --ink-soft: #59616a;
  --line: #d3cdbf;
  --line-dark: #9d978c;
  --blue: #1557a6;
  --blue-deep: #103a6b;
  --red: #c5302b;
  --amber: #d7861c;
  --green: #2c7a5a;
  --shadow: 0 24px 60px rgba(29, 35, 41, 0.12);
  --serif: "Noto Serif SC", "Songti SC", STSong, serif;
  --sans: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  background: var(--paper);
  overflow-x: clip;
}

body {
  margin: 0;
  color: var(--ink);
  background:
    linear-gradient(rgba(23, 32, 42, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(23, 32, 42, 0.018) 1px, transparent 1px),
    var(--paper);
  background-size: 32px 32px;
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
}

button,
input,
textarea,
select {
  font: inherit;
}

button {
  color: inherit;
}

.app-shell {
  min-height: 100vh;
}

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 10;
  display: flex;
  width: 248px;
  flex-direction: column;
  padding: 32px 24px 24px;
  color: #f7f3e8;
  background:
    radial-gradient(circle at 10% 10%, rgba(39, 103, 178, 0.42), transparent 34%),
    linear-gradient(160deg, #182a3e 0%, #0d1c2b 62%, #09141e 100%);
  overflow: hidden;
}

.sidebar::after {
  content: "";
  position: absolute;
  right: -90px;
  bottom: 76px;
  width: 230px;
  height: 54px;
  border-top: 12px solid rgba(197, 48, 43, 0.68);
  border-bottom: 12px solid rgba(21, 87, 166, 0.62);
  transform: rotate(-54deg);
  pointer-events: none;
}

.brand-lockup {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 13px;
  padding-bottom: 28px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.14);
}

.brand-mark {
  display: flex;
  width: 45px;
  height: 33px;
  align-items: stretch;
  gap: 3px;
  transform: skew(-18deg);
}

.brand-mark span {
  flex: 1;
  background: var(--blue);
}

.brand-mark span:first-child {
  background: var(--red);
}

.brand-mark span:nth-child(2) {
  margin-top: 8px;
}

.brand-mark span:nth-child(3) {
  margin-top: 15px;
}

.brand-lockup strong {
  display: block;
  font-family: var(--serif);
  font-size: 20px;
  letter-spacing: 0.16em;
}

.brand-lockup small {
  display: block;
  margin-top: 3px;
  color: rgba(255, 255, 255, 0.58);
  font-size: 11px;
  letter-spacing: 0.12em;
}

.side-nav {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 8px;
  margin-top: 34px;
}

.nav-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: center;
  padding: 13px 14px;
  border: 1px solid transparent;
  border-radius: 6px;
  color: rgba(255, 255, 255, 0.66);
  background: transparent;
  text-align: left;
  cursor: pointer;
  transition: 180ms ease;
}

.nav-item:hover {
  color: white;
  border-color: rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.05);
}

.nav-item.is-active {
  color: white;
  border-color: rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.1);
  box-shadow: inset 3px 0 0 var(--red);
}

.nav-index {
  color: rgba(255, 255, 255, 0.32);
  font-family: Georgia, serif;
  font-size: 12px;
}

.policy-note {
  position: relative;
  z-index: 1;
  margin-top: auto;
  padding: 18px 18px 14px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(0, 0, 0, 0.1);
}

.policy-note p {
  display: flex;
  justify-content: space-between;
  margin: 10px 0;
  color: rgba(255, 255, 255, 0.72);
  font-size: 12px;
}

.policy-note b {
  color: white;
  font-family: Georgia, serif;
  font-size: 14px;
}

.local-badge {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 16px;
  color: rgba(255, 255, 255, 0.42);
  font-size: 10px;
}

.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #55b88a;
  box-shadow: 0 0 0 4px rgba(85, 184, 138, 0.12);
}

.main-stage {
  min-height: 100vh;
  margin-left: 248px;
  padding: 30px clamp(24px, 4vw, 64px) 64px;
}

.topbar {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 30px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--line);
}

.eyebrow {
  display: block;
  margin: 0 0 8px;
  color: var(--blue);
  font-family: Georgia, serif;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.topbar h1,
.panel h2,
.modal h2,
.score-hero h2 {
  margin: 0;
  font-family: var(--serif);
  font-weight: 700;
  letter-spacing: 0.02em;
}

.topbar h1 {
  font-size: clamp(26px, 3vw, 39px);
}

.top-actions {
  display: flex;
  align-items: flex-end;
  gap: 10px;
}

.month-control {
  display: grid;
  gap: 6px;
}

.month-control span,
.field > span {
  color: var(--ink-soft);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
}

input,
textarea,
select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 4px;
  color: var(--ink);
  background: rgba(255, 253, 247, 0.78);
  outline: none;
  transition: border-color 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

input {
  min-height: 43px;
  padding: 0 12px;
}

textarea {
  padding: 12px;
  resize: vertical;
  line-height: 1.65;
}

input:focus,
textarea:focus,
select:focus {
  border-color: var(--blue);
  background: white;
  box-shadow: 0 0 0 3px rgba(21, 87, 166, 0.1);
}

.button {
  min-height: 43px;
  padding: 0 17px;
  border: 1px solid transparent;
  border-radius: 4px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: transform 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

.button:hover {
  transform: translateY(-1px);
}

.button-primary {
  color: white;
  background: var(--blue-deep);
  box-shadow: 0 8px 22px rgba(16, 58, 107, 0.16);
}

.button-primary:hover {
  background: var(--blue);
}

.button-secondary {
  border-color: var(--line-dark);
  background: rgba(255, 253, 247, 0.7);
}

.button-secondary:hover,
.button-ghost:hover {
  background: white;
}

.button-ghost {
  border-color: transparent;
  background: transparent;
}

.button-danger {
  color: var(--red);
  border-color: rgba(197, 48, 43, 0.35);
  background: rgba(197, 48, 43, 0.05);
}

.button:disabled,
.text-button:disabled {
  opacity: 0.38;
  cursor: not-allowed;
  pointer-events: none;
}

.view {
  display: none;
  min-width: 0;
  animation: view-in 360ms ease both;
}

.view.is-visible {
  display: block;
}

.result-gallery-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 30px;
  margin-bottom: 24px;
  padding: 28px 0 20px;
  border-bottom: 1px solid var(--line-dark);
}

.result-gallery-heading h2 {
  margin-top: 6px;
  font-size: clamp(30px, 4vw, 48px);
}

.result-gallery-heading p {
  margin: 10px 0 0;
  color: var(--ink-soft);
  font-size: 12px;
}

.result-gallery-meta {
  display: grid;
  min-width: 150px;
  justify-items: end;
}

.result-gallery-meta span,
.result-gallery-meta small { color: var(--ink-soft); font-size: 10px; }
.result-gallery-meta strong { margin: 3px 0; font-family: Georgia, serif; font-size: 28px; font-weight: 400; }

.result-card-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.performance-id-card {
  position: relative;
  display: grid;
  grid-template-columns: 116px minmax(0, 1fr);
  grid-template-rows: auto 164px auto auto;
  gap: 0 18px;
  min-width: 0;
  padding: 18px;
  border: 1px solid var(--line-dark);
  background: var(--paper);
  box-shadow: 0 15px 38px rgba(16, 40, 63, 0.08);
  overflow: hidden;
  animation: id-card-in 420ms ease both;
  animation-delay: calc(var(--card-order) * 45ms);
}

.performance-id-card::after {
  content: "";
  position: absolute;
  top: -80px;
  right: -64px;
  width: 150px;
  height: 170px;
  border: 14px solid rgba(42, 111, 190, 0.05);
  transform: rotate(28deg);
  pointer-events: none;
}

.performance-id-card.is-complete { border-top: 5px solid var(--blue-deep); }
.performance-id-card.is-pending { border-top: 5px solid var(--line-dark); }

@keyframes id-card-in {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

.id-card-topline {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: -18px -18px 18px;
  padding: 11px 18px;
  color: white;
  background: var(--blue-deep);
  font-size: 8px;
  letter-spacing: 0.12em;
}

.id-card-topline b { color: rgba(255, 255, 255, 0.7); font-weight: 400; }

.id-photo-area {
  position: relative;
  min-width: 0;
  height: 164px;
  background: #e6e1d6;
  overflow: hidden;
}

.id-photo {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 24%;
}

.photo-placeholder {
  display: grid;
  place-items: center;
  color: rgba(16, 40, 63, 0.35);
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.7), transparent),
    #ded9cd;
}

.avatar-placeholder-icon {
  display: block;
  width: 56%;
  height: 56%;
  color: inherit;
  flex: 0 0 auto;
}

.id-photo-label {
  position: absolute;
  right: 0;
  bottom: 0;
  padding: 5px 7px;
  color: white;
  background: rgba(16, 40, 63, 0.86);
  font-size: 7px;
  letter-spacing: 0.12em;
}

.id-person-copy {
  align-self: center;
  min-width: 0;
}

.id-person-copy > small { color: var(--ink-soft); font-size: 8px; letter-spacing: 0.09em; }
.id-person-copy h3 { margin: 8px 0 6px; font-size: 27px; }
.id-person-copy p { margin: 0; color: var(--ink-soft); font-size: 11px; line-height: 1.6; }
.id-number { display: inline-block; margin-top: 22px; padding-top: 8px; border-top: 1px solid var(--line); color: var(--blue); font: 10px Georgia, serif; letter-spacing: 0.08em; }

.id-result-stack {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: 1fr 1fr 1.2fr;
  margin-top: 18px;
  border: 1px solid var(--line);
}

.id-result-stack > div {
  display: grid;
  min-width: 0;
  min-height: 74px;
  align-content: center;
  justify-items: start;
  gap: 7px;
  padding: 12px;
  border-right: 1px solid var(--line);
}

.id-result-stack > div:last-child { border-right: 0; }
.id-result-stack span { color: var(--ink-soft); font-size: 8px; }
.id-final-result { color: white; background: var(--blue-deep); }
.id-final-result span,
.id-final-result small { color: rgba(255, 255, 255, 0.58); font-size: 8px; }
.id-final-result strong { font-family: var(--serif); font-size: 20px; }

.id-card-footer {
  grid-column: 1 / -1;
  display: flex;
  justify-content: space-between;
  margin-top: 14px;
  color: var(--ink-soft);
  font-size: 8px;
  letter-spacing: 0.05em;
}

.id-card-footer b { color: var(--blue); font-weight: 600; }

.role-intro {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 180px;
  align-items: center;
  gap: 36px;
  min-height: 218px;
  margin-bottom: 18px;
  padding: 34px 40px;
  color: white;
  background: var(--blue-deep);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.role-intro::after {
  content: "";
  position: absolute;
  right: -70px;
  bottom: -105px;
  width: 330px;
  height: 180px;
  border: 18px solid rgba(255, 255, 255, 0.06);
  transform: rotate(-20deg);
}

.role-intro-primary { border-top: 5px solid var(--red); }
.role-intro-secondary { border-top: 5px solid #4f94d4; }
.role-intro .eyebrow { color: #9ec8f4; }
.role-intro h2 { margin-top: 7px; font-size: clamp(27px, 3vw, 39px); }
.role-intro p { max-width: 700px; margin: 17px 0 0; color: rgba(255, 255, 255, 0.67); font-size: 13px; line-height: 1.8; }
.role-intro p b { color: white; }

.role-formula {
  position: relative;
  z-index: 1;
  display: grid;
  min-height: 128px;
  align-content: center;
  justify-items: center;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.06);
}

.role-formula span,
.role-formula small { color: rgba(255, 255, 255, 0.55); font-size: 10px; letter-spacing: 0.08em; }
.role-formula strong { margin: 7px 0; font-family: Georgia, serif; font-size: 30px; font-weight: 400; }
.role-queue-panel { border-top: 3px solid var(--blue); }
.role-intro-primary + .role-queue-panel { border-top-color: var(--red); }
.queue-count { padding: 9px 12px; color: var(--blue-deep); border: 1px solid var(--line-dark); background: var(--surface); font-size: 11px; white-space: nowrap; }
.role-table .text-button { white-space: nowrap; }

.level-pill {
  display: inline-flex;
  min-width: 52px;
  min-height: 28px;
  align-items: center;
  justify-content: center;
  padding: 4px 10px;
  border: 1px solid var(--line-dark);
  background: var(--surface);
  font-weight: 600;
  font-size: 11px;
}

.level-excellent { color: #8a4a0d; border-color: #d8b277; background: #fff4d8; }
.level-good { color: var(--green); border-color: #9bc5ad; background: #e9f5ef; }
.level-average { color: var(--blue); border-color: #a9c7e5; background: #edf5fc; }
.level-pass { color: #725d33; border-color: #cfc4a6; background: #f3efe4; }
.level-poor { color: var(--red); border-color: #dfaaa7; background: #fbeceb; }

@keyframes view-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(280px, 0.65fr);
  gap: 18px;
}

.score-hero {
  position: relative;
  display: grid;
  min-height: 284px;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 28px;
  padding: clamp(28px, 4vw, 48px);
  color: white;
  background:
    linear-gradient(128deg, rgba(255, 255, 255, 0.04), transparent 45%),
    linear-gradient(135deg, #183c63 0%, #0e2a46 66%, #0a2036 100%);
  box-shadow: var(--shadow);
  overflow: hidden;
  contain: layout paint;
}

.score-hero::before {
  content: "";
  position: absolute;
  inset: auto -40px -90px auto;
  width: 340px;
  height: 180px;
  border-top: 20px solid rgba(197, 48, 43, 0.85);
  border-bottom: 20px solid rgba(42, 111, 190, 0.7);
  transform: rotate(-24deg);
}

.score-hero .eyebrow {
  color: #9ec8f4;
}

.hero-copy {
  position: relative;
  z-index: 1;
}

.score-hero h2 {
  font-size: clamp(30px, 4vw, 50px);
  line-height: 1.25;
}

.score-hero p {
  max-width: 600px;
  margin: 22px 0 0;
  color: rgba(255, 255, 255, 0.64);
  font-size: 13px;
  line-height: 1.8;
}

.hero-meter {
  position: relative;
  z-index: 1;
  display: grid;
  justify-items: center;
  gap: 12px;
}

.meter-ring {
  --score-angle: 0deg;
  display: grid;
  width: 156px;
  height: 156px;
  place-items: center;
  border-radius: 50%;
  background: conic-gradient(#f3b64b var(--score-angle), rgba(255, 255, 255, 0.12) 0deg);
}

.meter-ring::before {
  content: "";
  position: absolute;
  width: 126px;
  height: 126px;
  border-radius: 50%;
  background: #112f4d;
}

.meter-ring div {
  position: relative;
  display: grid;
  z-index: 1;
  justify-items: center;
}

.meter-ring strong {
  font-family: Georgia, serif;
  font-size: 38px;
  font-variant-numeric: tabular-nums;
}

.meter-ring span,
.hero-meter p {
  color: rgba(255, 255, 255, 0.55);
  font-size: 10px;
  letter-spacing: 0.08em;
}

.hero-meter p {
  margin: 0;
}

.deadline-card,
.panel,
.stat-card {
  border: 1px solid var(--line);
  background: rgba(255, 253, 247, 0.86);
}

.deadline-card {
  padding: 28px;
}

.deadline-list {
  display: grid;
  gap: 0;
  margin: 20px 0 0;
  padding: 0;
  list-style: none;
}

.deadline-list li {
  position: relative;
  display: grid;
  grid-template-columns: 50px 1fr;
  gap: 14px;
  padding: 15px 0;
  border-top: 1px solid var(--line);
}

.deadline-list li::before {
  content: "";
  position: absolute;
  top: 23px;
  left: -4px;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--line-dark);
}

.deadline-list li.is-current::before {
  background: var(--red);
  box-shadow: 0 0 0 5px rgba(197, 48, 43, 0.1);
}

.deadline-list b {
  padding-left: 12px;
  color: var(--blue-deep);
  font-family: Georgia, serif;
  font-size: 13px;
}

.deadline-list span {
  color: var(--ink-soft);
  font-size: 12px;
  line-height: 1.55;
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin: 18px 0;
}

.stat-card {
  position: relative;
  padding: 21px 22px;
  overflow: hidden;
}

.stat-card::after {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  width: 28px;
  height: 4px;
  background: var(--blue);
}

.stat-card-alert::after {
  background: var(--red);
}

.stat-card span,
.stat-card small {
  display: block;
  color: var(--ink-soft);
  font-size: 11px;
}

.stat-card strong {
  display: block;
  margin: 7px 0 6px;
  font-family: Georgia, serif;
  font-size: 30px;
  font-weight: 400;
}

.panel {
  min-width: 0;
  padding: 28px;
}

.panel-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 22px;
}

.panel-heading h2,
.settings-card h2 {
  font-size: 23px;
}

.panel-heading p,
.settings-card > p {
  margin: 8px 0 0;
  color: var(--ink-soft);
  font-size: 12px;
  line-height: 1.7;
}

.legend {
  display: flex;
  gap: 15px;
  color: var(--ink-soft);
  font-size: 10px;
}

.legend span {
  display: flex;
  align-items: center;
  gap: 6px;
}

.legend-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.dot-final { background: var(--green); }
.dot-draft { background: var(--amber); }

.table-wrap {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  overflow-x: auto;
  contain: layout paint;
  overscroll-behavior-inline: contain;
  -webkit-overflow-scrolling: touch;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}

.data-table th {
  padding: 11px 14px;
  color: var(--ink-soft);
  border-bottom: 1px solid var(--line-dark);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-align: left;
  white-space: nowrap;
}

.data-table td {
  padding: 16px 14px;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}

.person-cell {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 190px;
}

.avatar {
  display: grid;
  width: 39px;
  height: 39px;
  flex: 0 0 auto;
  place-items: center;
  border: 1px solid rgba(21, 87, 166, 0.28);
  border-radius: 50%;
  color: var(--blue-deep);
  background: rgba(21, 87, 166, 0.07);
  font-family: var(--serif);
  font-weight: 700;
}

.person-cell strong,
.employee-card strong {
  display: block;
  font-size: 13px;
}

.person-cell small,
.employee-card small {
  display: block;
  margin-top: 4px;
  color: var(--ink-soft);
  font-size: 10px;
}

.score-number {
  font-family: Georgia, serif;
  font-size: 16px;
  font-variant-numeric: tabular-nums;
}

.result-cell {
  display: flex;
  align-items: center;
  gap: 8px;
}

.grade-chip {
  display: inline-grid;
  min-width: 27px;
  height: 27px;
  place-items: center;
  border: 1px solid currentColor;
  border-radius: 50%;
  font-family: Georgia, serif;
  font-weight: 700;
}

.grade-S { color: #9e6413; background: #fff6df; }
.grade-A { color: var(--green); background: #edf8f2; }
.grade-B { color: var(--blue); background: #edf5fe; }
.grade-C { color: #9a6816; background: #fff8e8; }
.grade-D { color: var(--red); background: #fff0ef; }

.status-pill {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 0 9px;
  border-radius: 20px;
  color: var(--ink-soft);
  background: var(--paper-strong);
  font-size: 10px;
  white-space: nowrap;
}

.status-pill.is-final { color: var(--green); background: #e9f5ef; }
.status-pill.is-pending { color: #8d5d11; background: #fff4da; }

.row-actions {
  display: flex;
  justify-content: flex-end;
  gap: 7px;
  white-space: nowrap;
}

.text-button {
  padding: 5px 2px;
  border: 0;
  color: var(--blue);
  background: transparent;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
}

.text-button:hover { text-decoration: underline; }
.text-button.is-danger { color: var(--red); }

.empty-state {
  padding: 54px 20px;
  border-top: 1px solid var(--line);
  text-align: center;
}

.empty-state span {
  font-family: var(--serif);
  font-size: 20px;
}

.empty-state p {
  margin: 8px 0 20px;
  color: var(--ink-soft);
  font-size: 12px;
}

.employee-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.employee-card {
  position: relative;
  min-height: 168px;
  padding: 22px;
  border: 1px solid var(--line);
  background: var(--surface);
}

.employee-card .avatar {
  margin-bottom: 18px;
}

.employee-card-photo {
  width: 58px;
  height: 70px;
  margin-bottom: 16px;
  border: 1px solid var(--line-dark);
  object-fit: cover;
  object-position: center 24%;
}

.photo-upload-block {
  display: grid;
  grid-template-columns: 100px 1fr;
  gap: 18px;
  align-items: center;
  margin: 20px 0 6px;
  padding: 16px;
  border: 1px solid var(--line);
  background: var(--surface);
}

.employee-photo-preview {
  display: grid;
  width: 100px;
  height: 122px;
  place-items: center;
  color: rgba(16, 40, 63, 0.38);
  border: 1px solid var(--line-dark);
  background: #e4dfd4;
  overflow: hidden;
}

.employee-photo-preview .avatar-placeholder-icon { width: 54%; height: 54%; }
.employee-photo-preview img { width: 100%; height: 100%; object-fit: cover; object-position: center 24%; }
.photo-upload-block .field-label { display: block; font-size: 11px; font-weight: 600; }
.photo-upload-block p { margin: 6px 0 13px; color: var(--ink-soft); font-size: 10px; line-height: 1.6; }
.photo-upload-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.photo-upload-actions .button { min-height: 36px; padding: 0 13px; font-size: 10px; }

.employee-card .employee-actions {
  position: absolute;
  top: 16px;
  right: 16px;
}

.template-list {
  display: grid;
  gap: 8px;
}

.template-row {
  display: grid;
  grid-template-columns: 42px minmax(150px, 0.7fr) minmax(180px, 1.5fr) 90px 34px;
  align-items: center;
  gap: 10px;
  padding: 11px 12px;
  border: 1px solid var(--line);
  background: var(--surface);
}

.template-row .metric-order {
  color: var(--line-dark);
  font-family: Georgia, serif;
  font-size: 12px;
}

.template-row input {
  min-height: 39px;
}

.weight-input {
  position: relative;
}

.weight-input::after {
  content: "分";
  position: absolute;
  top: 12px;
  right: 10px;
  color: var(--ink-soft);
  font-size: 10px;
  pointer-events: none;
}

.weight-input input { padding-right: 30px; }

.remove-metric {
  width: 32px;
  height: 32px;
  border: 0;
  color: var(--red);
  background: transparent;
  cursor: pointer;
}

.weight-total {
  padding: 10px 15px;
  border: 1px solid var(--blue);
  color: var(--blue-deep);
  font-family: Georgia, serif;
  font-size: 16px;
}

.weight-total.is-invalid {
  border-color: var(--red);
  color: var(--red);
}

.template-actions {
  display: flex;
  justify-content: flex-end;
  gap: 9px;
  margin-top: 18px;
}

.settings-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

#view-settings.is-primary-settings .settings-grid {
  grid-template-columns: minmax(0, 1fr);
}

.settings-card {
  display: grid;
  align-content: start;
  gap: 15px;
}

.settings-card .button {
  justify-self: start;
}

.field {
  display: grid;
  gap: 7px;
}

.data-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  margin-top: 8px;
}

.danger-card {
  border-top: 4px solid var(--red);
}

.policy-boundary {
  grid-column: 1 / -1;
  color: white;
  border: 0;
  background: var(--blue-deep);
}

.policy-boundary .eyebrow { color: #9ec8f4; }

.policy-boundary ul {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px 32px;
  margin: 20px 0 0;
  padding: 0;
  list-style: none;
}

.policy-boundary li {
  position: relative;
  padding-left: 18px;
  color: rgba(255, 255, 255, 0.72);
  font-size: 12px;
  line-height: 1.75;
}

.policy-boundary li::before {
  content: "";
  position: absolute;
  top: 8px;
  left: 0;
  width: 7px;
  height: 7px;
  background: var(--red);
  transform: rotate(45deg);
}

.modal {
  width: min(1100px, calc(100vw - 30px));
  max-height: calc(100vh - 30px);
  padding: 0;
  border: 0;
  color: var(--ink);
  background: transparent;
  overflow: visible;
}

.modal::backdrop {
  background: rgba(8, 17, 27, 0.68);
  backdrop-filter: blur(6px);
}

.modal-card {
  max-height: calc(100vh - 30px);
  border: 1px solid rgba(255, 255, 255, 0.4);
  border-radius: 8px;
  background: var(--paper);
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.34);
  overflow: hidden;
}

.compact-modal {
  width: min(500px, calc(100vw - 30px));
  margin: auto;
  padding: 26px;
}

.compact-modal .field { margin-top: 15px; }

.modal-heading {
  display: flex;
  align-items: flex-start;
  gap: 20px;
}

.modal-heading > div:first-child { flex: 1; }

.modal-heading p {
  margin: 5px 0 0;
  color: var(--ink-soft);
  font-size: 12px;
}

.icon-button {
  display: grid;
  width: 36px;
  height: 36px;
  flex: 0 0 auto;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: transparent;
  font-size: 22px;
  cursor: pointer;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 9px;
  margin-top: 24px;
}

.input-with-unit {
  position: relative;
}

.input-with-unit span {
  position: absolute;
  top: 13px;
  right: 12px;
  color: var(--ink-soft);
  font-size: 11px;
}

.assessment-card {
  display: flex;
  flex-direction: column;
}

.sticky-heading {
  position: relative;
  z-index: 3;
  align-items: center;
  padding: 23px 28px;
  color: white;
  background: var(--blue-deep);
}

.sticky-heading .eyebrow { color: #9ec8f4; }
.sticky-heading p { color: rgba(255, 255, 255, 0.55); }
.sticky-heading .icon-button { color: white; border-color: rgba(255, 255, 255, 0.2); }

.live-score {
  display: grid;
  min-width: 120px;
  grid-template-columns: auto auto;
  align-items: center;
  column-gap: 10px;
}

.live-score span {
  grid-column: 1 / -1;
  color: rgba(255, 255, 255, 0.55);
  font-size: 10px;
}

.live-score strong {
  font-family: Georgia, serif;
  font-size: 28px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.level-select-section {
  padding: 12px 0 28px;
}

.level-select-heading {
  max-width: 720px;
  margin-bottom: 22px;
}

.level-select-heading h3 {
  margin: 5px 0 8px;
  font-family: var(--serif);
  font-size: 24px;
}

.level-select-heading p {
  margin: 0;
  color: var(--ink-soft);
  font-size: 11px;
  line-height: 1.75;
}

.level-choice-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
}

.level-choice {
  position: relative;
  display: grid;
  min-height: 190px;
  align-content: start;
  padding: 20px 17px;
  border: 1px solid var(--line);
  background: var(--surface);
  cursor: pointer;
  transition: 180ms ease;
}

.level-choice:hover {
  border-color: var(--blue);
  transform: translateY(-3px);
  box-shadow: 0 12px 26px rgba(16, 40, 63, 0.1);
}

.level-choice input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.level-choice .level-code {
  display: grid;
  width: 34px;
  height: 34px;
  margin-bottom: 24px;
  place-items: center;
  border: 1px solid var(--line-dark);
  border-radius: 50%;
  color: var(--ink-soft);
  font-family: Georgia, serif;
}

.level-choice strong {
  font-family: var(--serif);
  font-size: 22px;
}

.level-choice small {
  margin-top: 4px;
  color: var(--blue);
  font-family: Georgia, serif;
}

.level-choice p {
  margin: 16px 0 0;
  color: var(--ink-soft);
  font-size: 10px;
  line-height: 1.6;
}

.level-choice.is-selected {
  color: white;
  border-color: var(--blue-deep);
  background: var(--blue-deep);
  box-shadow: inset 0 4px 0 var(--red), 0 14px 30px rgba(16, 40, 63, 0.17);
}

.level-choice.is-selected .level-code { color: white; border-color: rgba(255, 255, 255, 0.4); }
.level-choice.is-selected small { color: #9ec8f4; }
.level-choice.is-selected p { color: rgba(255, 255, 255, 0.62); }
.level-choice.is-locked { cursor: default; }
.level-choice.is-locked:not(.is-selected) { opacity: 0.35; }
.level-choice.is-locked:hover { transform: none; box-shadow: none; }

.live-score em {
  display: grid;
  width: 29px;
  height: 29px;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.4);
  border-radius: 50%;
  font-family: Georgia, serif;
  font-style: normal;
}

.assessment-scroll {
  flex: 1;
  padding: 28px;
  overflow-y: auto;
}

.self-summary,
.adjustment-section,
.improvement-section {
  display: grid;
  grid-template-columns: minmax(200px, 0.42fr) minmax(0, 1fr);
  gap: 28px;
  padding: 22px 0;
  border-bottom: 1px solid var(--line);
}

.self-summary h3,
.score-section h3,
.adjustment-section h3,
.improvement-section h3 {
  margin: 2px 0 5px;
  font-family: var(--serif);
  font-size: 17px;
}

.self-summary p,
.adjustment-section p,
.improvement-section p {
  margin: 0;
  color: var(--ink-soft);
  font-size: 11px;
  line-height: 1.7;
}

.section-number {
  color: var(--red);
  font-family: Georgia, serif;
  font-size: 10px;
  font-weight: 700;
}

.score-section {
  padding: 22px 0;
  border-bottom: 1px solid var(--line);
}

.section-title-row {
  display: grid;
  grid-template-columns: 1fr 190px;
  align-items: end;
  margin-bottom: 12px;
}

.score-columns-label {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  color: var(--ink-soft);
  font-size: 10px;
  text-align: center;
}

.metric-score-list {
  display: grid;
  gap: 7px;
}

.metric-score-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 90px 90px;
  gap: 10px;
  align-items: center;
  padding: 13px;
  border: 1px solid var(--line);
  background: var(--surface);
}

.metric-copy {
  min-width: 0;
}

.metric-copy div {
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.metric-copy strong {
  font-size: 12px;
}

.metric-copy b {
  color: var(--blue);
  font-family: Georgia, serif;
  font-size: 11px;
}

.metric-copy p {
  margin: 4px 0 0;
  color: var(--ink-soft);
  font-size: 10px;
  line-height: 1.5;
}

.score-input-wrap {
  position: relative;
}

.score-input-wrap input {
  min-height: 40px;
  padding-right: 31px;
  text-align: right;
  font-family: Georgia, serif;
}

.score-input-wrap.is-active-role {
  outline: 2px solid rgba(42, 111, 190, 0.16);
  outline-offset: 2px;
}

.score-input-wrap.is-readonly {
  opacity: 0.48;
}

.score-input-wrap.is-readonly input,
.field.is-readonly input,
.field.is-readonly textarea,
textarea[readonly] {
  color: var(--ink-soft);
  background: #ece9e1;
  cursor: not-allowed;
}

.score-input-wrap span {
  position: absolute;
  top: 12px;
  right: 10px;
  color: var(--ink-soft);
  font-size: 10px;
}

.adjustment-controls {
  display: flex;
  gap: 12px;
}

.adjustment-controls .field:first-child { width: 130px; }
.field-grow { flex: 1; }

.improvement-section {
  transition: opacity 180ms ease;
}

.improvement-section.is-muted {
  opacity: 0.5;
}

.improvement-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.result-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr)) minmax(180px, 1.2fr);
  margin-top: 22px;
  border: 1px solid var(--line-dark);
}

.result-strip > div {
  display: grid;
  align-content: center;
  gap: 5px;
  min-height: 90px;
  padding: 15px 18px;
  border-right: 1px solid var(--line);
}

.result-strip > div:last-child { border-right: 0; }

.result-strip span,
.result-strip small {
  color: var(--ink-soft);
  font-size: 10px;
}

.result-strip strong {
  font-family: Georgia, serif;
  font-size: 23px;
  font-weight: 400;
}

.result-main {
  color: white;
  background: var(--blue-deep);
}

.result-main span,
.result-main small { color: rgba(255, 255, 255, 0.6); }
.result-main strong { font-size: 28px; }

.sticky-actions {
  position: relative;
  z-index: 3;
  margin: 0;
  padding: 16px 28px;
  border-top: 1px solid var(--line);
  background: rgba(243, 240, 232, 0.96);
}

.toast {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 100;
  max-width: 360px;
  padding: 13px 18px;
  color: white;
  border-left: 4px solid #7bb9f5;
  background: #10283f;
  box-shadow: var(--shadow);
  font-size: 12px;
  line-height: 1.55;
  opacity: 0;
  transform: translateY(12px);
  pointer-events: none;
  transition: 220ms ease;
}

.toast.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.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: 1120px) {
  .hero-grid { grid-template-columns: 1fr; }
  .deadline-list { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
  .deadline-list li { grid-template-columns: 1fr; }
  .stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .employee-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .result-card-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 820px) {
  .sidebar {
    position: static;
    width: auto;
    min-height: auto;
    padding: 18px;
  }
  .sidebar::after { display: none; }
  .brand-lockup { padding-bottom: 16px; }
  .side-nav { grid-template-columns: repeat(3, minmax(0, 1fr)); margin-top: 16px; }
  .nav-item { grid-template-columns: 1fr; justify-items: center; padding: 10px 5px; text-align: center; }
  .nav-index { display: none; }
  .policy-note,
  .local-badge { display: none; }
  .main-stage { margin-left: 0; padding: 22px 16px 48px; }
  .topbar { align-items: flex-start; }
  .top-actions { flex-wrap: wrap; justify-content: flex-end; }
  .score-hero { grid-template-columns: 1fr; }
  .role-intro { grid-template-columns: 1fr 160px; padding: 30px; }
  .hero-meter { justify-self: start; grid-template-columns: auto auto; }
  .deadline-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .settings-grid { grid-template-columns: 1fr; }
  .policy-boundary { grid-column: auto; }
  .policy-boundary ul { grid-template-columns: 1fr; }
  .template-row { grid-template-columns: 34px 1fr 90px 34px; }
  .template-row .metric-desc { grid-column: 2 / 4; }
  .self-summary,
  .adjustment-section,
  .improvement-section { grid-template-columns: 1fr; }
  .result-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .level-choice-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .result-strip > div:nth-child(2) { border-right: 0; }
  .result-strip > div:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
}

@media (max-width: 560px) {
  .topbar { display: grid; }
  .top-actions { justify-content: flex-start; }
  .top-actions .button { flex: 1; }
  .month-control { width: 100%; }
  .hero-copy h2 { font-size: 30px; }
  .role-intro { grid-template-columns: 1fr; gap: 22px; padding: 26px 22px; }
  .role-formula { min-height: 96px; justify-self: stretch; }
  .score-hero::before {
    right: 8px;
    bottom: -64px;
    width: 170px;
    height: 120px;
    border-top-width: 12px;
    border-bottom-width: 12px;
  }
  .stat-grid,
  .employee-grid,
  .deadline-list,
  .result-card-grid { grid-template-columns: 1fr; }
  .result-gallery-heading { display: grid; }
  .result-gallery-meta { justify-items: start; }
  .performance-id-card { grid-template-columns: 104px minmax(0, 1fr); }
  .photo-upload-block { grid-template-columns: 82px 1fr; }
  .employee-photo-preview { width: 82px; height: 102px; }
  .panel { padding: 20px 16px; }
  .data-table { min-width: 700px; }
  .panel-heading { display: grid; }
  .legend { justify-content: flex-start; }
  .template-row { grid-template-columns: 25px 1fr 30px; }
  .template-row .metric-category,
  .template-row .metric-desc,
  .template-row .weight-input { grid-column: 2 / 3; }
  .template-row .remove-metric { grid-column: 3; grid-row: 1; }
  .template-actions { flex-direction: column; }
  .section-title-row { grid-template-columns: 1fr; gap: 10px; }
  .score-columns-label { margin-left: calc(100% - 190px); }
  .metric-score-row { grid-template-columns: minmax(0, 1fr) 70px 70px; }
  .adjustment-controls { display: grid; }
  .adjustment-controls .field:first-child { width: auto; }
  .improvement-grid { grid-template-columns: 1fr; }
  .level-choice-grid { grid-template-columns: 1fr; }
  .level-choice { min-height: 118px; }
  .level-choice .level-code { margin-bottom: 12px; }
  .sticky-heading { padding: 18px; }
  .assessment-scroll { padding: 18px; }
  .live-score { order: 3; width: 100%; }
  .sticky-heading { flex-wrap: wrap; }
  .sticky-heading .icon-button { position: absolute; top: 16px; right: 16px; }
  .sticky-actions { padding: 12px; flex-wrap: wrap; }
  .sticky-actions .button { flex: 1; padding: 0 10px; }
}

/* Direction A — 工业档案证件系统 */
@media screen {
  :root {
    --paper: #eeeae0;
    --paper-strong: #e2ddd1;
    --surface: #faf8f2;
    --ink: #14202b;
    --ink-soft: #5b6268;
    --line: #cbc5b8;
    --line-dark: #8f918e;
    --blue: #175ca8;
    --blue-deep: #0d345d;
    --red: #bf302c;
    --shadow: 0 18px 48px rgba(17, 36, 53, 0.1);
  }

  body {
    background:
      linear-gradient(rgba(13, 52, 93, 0.032) 1px, transparent 1px),
      linear-gradient(90deg, rgba(13, 52, 93, 0.024) 1px, transparent 1px),
      var(--paper);
    background-size: 28px 28px;
  }

  .sidebar {
    width: 264px;
    padding: 28px 22px 22px;
    background:
      linear-gradient(90deg, transparent 21px, rgba(255, 255, 255, 0.06) 22px, transparent 23px),
      linear-gradient(155deg, #123c67 0%, #0b2948 45%, #081a2a 100%);
  }

  .sidebar::before {
    content: "PM—04";
    position: absolute;
    right: 18px;
    bottom: 210px;
    color: rgba(255, 255, 255, 0.06);
    font: 700 50px/1 Georgia, serif;
    letter-spacing: -0.04em;
    transform: rotate(-90deg) translateX(100%);
    transform-origin: right bottom;
    pointer-events: none;
  }

  .sidebar::after {
    right: -116px;
    bottom: 58px;
    width: 280px;
    height: 62px;
    border-top-width: 10px;
    border-bottom-width: 10px;
    opacity: 0.82;
  }

  .brand-lockup {
    align-items: flex-start;
    padding: 2px 4px 25px;
  }

  .brand-lockup strong {
    font-size: 19px;
    letter-spacing: 0.2em;
  }

  .brand-lockup small {
    color: rgba(255, 255, 255, 0.68);
    letter-spacing: 0.08em;
  }

  .document-code {
    display: block;
    margin-top: 10px;
    color: #86b7e7;
    font: 9px/1.2 Georgia, serif;
    letter-spacing: 0.1em;
  }

  .side-nav {
    gap: 4px;
    margin-top: 26px;
  }

  .nav-item {
    position: relative;
    min-height: 50px;
    grid-template-columns: 36px 1fr;
    padding: 12px 13px;
    border: 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.09);
    border-radius: 0;
    transition: color 160ms ease, background 160ms ease;
  }

  .nav-item::before {
    content: "";
    position: absolute;
    inset: 0 auto 0 0;
    width: 3px;
    background: var(--red);
    transform: scaleY(0);
    transition: transform 160ms ease;
  }

  .nav-item:hover {
    border-color: rgba(255, 255, 255, 0.09);
    background: rgba(255, 255, 255, 0.06);
  }

  .nav-item.is-active {
    color: #fff;
    border-color: rgba(255, 255, 255, 0.09);
    background: rgba(255, 255, 255, 0.11);
    box-shadow: none;
  }

  .nav-item.is-active::before { transform: scaleY(1); }
  .nav-item.is-active .nav-index { color: #91c3f0; }

  .policy-note {
    padding: 16px 15px 12px;
    border-color: rgba(255, 255, 255, 0.16);
    background: rgba(0, 0, 0, 0.12);
  }

  .policy-note .eyebrow { color: #8ebce7; }
  .policy-note p { margin: 9px 0; }

  .main-stage {
    margin-left: 264px;
    padding: 26px clamp(26px, 3.6vw, 58px) 70px;
  }

  .topbar {
    position: relative;
    min-height: 92px;
    align-items: center;
    margin-bottom: 18px;
    padding: 4px 0 19px;
    border-bottom-color: var(--line-dark);
  }

  .topbar::after {
    content: "内部资料 ／ LOCAL DATA";
    position: absolute;
    right: 0;
    bottom: -1px;
    padding: 4px 8px;
    color: white;
    background: var(--blue-deep);
    font: 8px/1 Georgia, serif;
    letter-spacing: 0.08em;
  }

  .view-identity {
    position: relative;
    padding-left: 18px;
  }

  .view-identity::before {
    content: "";
    position: absolute;
    inset: 3px auto 2px 0;
    width: 4px;
    background: linear-gradient(var(--red) 0 34%, var(--blue) 34% 100%);
  }

  .topbar h1 { font-size: clamp(27px, 2.7vw, 38px); }
  .eyebrow { letter-spacing: 0.12em; }

  input,
  textarea,
  select,
  .button {
    border-radius: 1px;
  }

  .button {
    min-height: 42px;
    letter-spacing: 0.03em;
  }

  .button-primary {
    position: relative;
    box-shadow: none;
  }

  .button-primary::before {
    content: "";
    position: absolute;
    inset: 0 auto 0 0;
    width: 3px;
    background: var(--red);
  }

  .view { animation: dossier-view-in 240ms cubic-bezier(.2,.7,.2,1) both; }

  @keyframes dossier-view-in {
    from { opacity: 0; transform: translateY(6px); clip-path: inset(0 0 12px 0); }
    to { opacity: 1; transform: translateY(0); clip-path: inset(0); }
  }

  .result-gallery-heading {
    align-items: center;
    margin-bottom: 18px;
    padding: 27px 0 21px;
    border-bottom: 2px solid var(--ink);
  }

  .result-gallery-heading h2 {
    margin-top: 5px;
    font-size: clamp(31px, 3.5vw, 47px);
    letter-spacing: 0.01em;
  }

  .result-gallery-heading p { max-width: 640px; font-size: 11px; }

  .result-gallery-meta {
    min-width: 180px;
    padding-left: 22px;
    border-left: 1px solid var(--line-dark);
  }

  .result-gallery-meta strong {
    color: var(--blue-deep);
    font-size: 32px;
    font-weight: 700;
  }

  .result-card-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
  }

  .performance-id-card {
    grid-template-columns: 124px minmax(120px, 1fr) 154px;
    grid-template-rows: auto 176px auto;
    gap: 0 18px;
    min-height: 260px;
    padding: 16px;
    border-color: var(--line-dark);
    background:
      linear-gradient(90deg, rgba(13, 52, 93, 0.035) 1px, transparent 1px),
      var(--surface);
    background-size: 22px 100%;
    box-shadow: 0 11px 28px rgba(13, 52, 93, 0.075);
  }

  .performance-id-card::before {
    content: "";
    position: absolute;
    inset: auto -34px -34px auto;
    width: 94px;
    height: 94px;
    border: 1px solid rgba(13, 52, 93, 0.13);
    border-radius: 50%;
    box-shadow: inset 0 0 0 9px var(--surface), inset 0 0 0 10px rgba(13, 52, 93, 0.13);
  }

  .performance-id-card::after { display: none; }
  .performance-id-card.is-complete { border-top: 1px solid var(--line-dark); }
  .performance-id-card.is-pending { border-top: 1px solid var(--line-dark); opacity: 0.82; }

  .id-card-topline {
    grid-column: 1 / -1;
    margin: -16px -16px 16px;
    padding: 10px 16px;
    border-bottom: 3px solid var(--red);
    font-size: 8px;
  }

  .id-photo-area {
    grid-column: 1;
    grid-row: 2;
    height: 176px;
    border: 1px solid var(--line-dark);
  }

  .id-photo-label {
    padding: 5px 7px;
    font-size: 8px;
    letter-spacing: 0.06em;
  }

  .id-person-copy {
    grid-column: 2;
    grid-row: 2;
    align-self: stretch;
    display: flex;
    min-width: 0;
    flex-direction: column;
    justify-content: center;
    padding-right: 4px;
  }

  .id-person-copy > small { font-size: 9px; letter-spacing: 0.12em; }
  .id-person-copy h3 { margin: 8px 0 4px; font-size: clamp(24px, 2.15vw, 31px); }
  .id-person-copy p { font-size: 11px; }
  .id-number {
    margin-top: auto;
    padding-top: 10px;
    color: var(--ink-soft);
    border-top-style: dashed;
    font-size: 9px;
  }

  .id-result-stack {
    grid-column: 3;
    grid-row: 2;
    display: grid;
    grid-template-columns: 1fr;
    grid-template-rows: 1fr 1fr 1.35fr;
    margin: 0;
    border-color: var(--line-dark);
  }

  .id-result-stack > div {
    min-height: 0;
    padding: 8px 12px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .id-result-stack > div:last-child { border-bottom: 0; }
  .id-result-stack span { font-size: 8px; letter-spacing: 0.06em; }
  .id-final-result { position: relative; overflow: hidden; }
  .id-final-result::after {
    content: "核";
    position: absolute;
    right: 8px;
    bottom: -9px;
    color: rgba(255, 255, 255, 0.08);
    font: 700 54px/1 var(--serif);
  }
  .id-final-result strong { position: relative; z-index: 1; font-size: 22px; }

  .id-card-footer {
    grid-column: 1 / -1;
    grid-row: 3;
    margin-top: 13px;
    padding-top: 10px;
    border-top: 1px dashed var(--line-dark);
    font-size: 8px;
  }

  .role-intro {
    grid-template-columns: minmax(0, 1fr) 180px;
    min-height: 166px;
    margin-bottom: 14px;
    padding: 27px 32px;
    border: 1px solid #071d32;
    box-shadow: 0 14px 34px rgba(13, 52, 93, 0.14);
  }

  .role-intro-primary { border-top: 4px solid var(--red); }
  .role-intro-secondary { border-top: 4px solid #65a0d7; }
  .role-intro h2 { font-size: clamp(26px, 2.6vw, 36px); }
  .role-intro p { margin-top: 11px; font-size: 12px; }
  .role-formula { min-height: 104px; }
  .role-formula strong { font-size: 28px; }

  .panel {
    padding: 25px;
    border-color: var(--line-dark);
    background: rgba(250, 248, 242, 0.93);
  }

  .role-queue-panel { border-top-width: 1px; }
  .role-intro-primary + .role-queue-panel { border-top-color: var(--line-dark); }
  .panel-heading { margin-bottom: 16px; padding-bottom: 16px; border-bottom: 1px solid var(--line); }
  .queue-count { border-radius: 0; background: var(--paper); }

  .role-table {
    border-collapse: separate;
    border-spacing: 0 7px;
  }

  .role-table th { padding: 4px 13px 7px; border: 0; }
  .role-table td {
    padding: 12px 13px;
    border-top: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
    background: var(--surface);
  }
  .role-table td:first-child { border-left: 3px solid var(--blue-deep); }
  .role-table td:last-child { border-right: 1px solid var(--line); text-align: right; }

  .person-cell { min-width: 180px; gap: 11px; }
  .queue-photo {
    width: 39px;
    height: 47px;
    flex: 0 0 auto;
    border: 1px solid var(--line-dark);
    object-fit: cover;
    object-position: center 24%;
  }
  .role-table .text-button {
    min-height: 34px;
    padding: 0 12px;
    border: 1px solid var(--blue-deep);
    color: var(--blue-deep);
    background: transparent;
    text-decoration: none;
  }
  .role-table .text-button:hover { color: white; background: var(--blue-deep); text-decoration: none; }

  .status-pill { border-radius: 1px; }
  .level-pill { min-height: 27px; border-radius: 1px; }

  .employee-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
  }

  .employee-card {
    display: grid;
    grid-template-columns: 76px minmax(0, 1fr);
    grid-template-rows: auto 92px auto;
    gap: 12px 16px;
    min-height: 172px;
    padding: 16px;
    border-color: var(--line-dark);
    background: var(--surface);
    animation: id-card-in 320ms ease both;
    animation-delay: calc(var(--card-order) * 35ms);
  }

  .employee-file-number {
    grid-column: 1 / -1;
    padding-bottom: 9px;
    color: var(--blue-deep);
    border-bottom: 1px solid var(--line);
    font: 9px/1.2 Georgia, serif;
    letter-spacing: 0.09em;
  }

  .employee-card-photo {
    grid-column: 1;
    grid-row: 2;
    width: 76px;
    height: 92px;
    margin: 0;
  }

  .employee-card-copy {
    grid-column: 2;
    grid-row: 2;
    align-self: center;
  }
  .employee-card-copy strong { font-family: var(--serif); font-size: 21px; }
  .employee-card .employee-actions { top: 10px; right: 14px; }

  .settings-grid { gap: 13px; }
  .settings-card { border-top: 3px solid var(--blue-deep); }
  .danger-card { border-top-color: var(--red); }
  .policy-boundary { border-top: 4px solid var(--red); }

  .modal { width: min(1040px, calc(100vw - 32px)); }
  .modal::backdrop { background: rgba(5, 16, 27, 0.76); backdrop-filter: blur(3px); }
  .modal-card { border-radius: 1px; }
  dialog[open] .modal-card { animation: modal-file-in 210ms cubic-bezier(.2,.7,.2,1) both; }

  @keyframes modal-file-in {
    from { opacity: 0; transform: translateY(10px) scale(.992); }
    to { opacity: 1; transform: translateY(0) scale(1); }
  }

  .sticky-heading {
    padding: 21px 26px;
    border-bottom: 4px solid var(--red);
    background:
      linear-gradient(90deg, rgba(255,255,255,.04) 1px, transparent 1px),
      var(--blue-deep);
    background-size: 28px 100%;
  }
  .sticky-heading .icon-button { border-radius: 1px; }

  .level-select-heading { margin-bottom: 17px; }
  .level-select-heading h3 { font-size: 22px; }
  .section-number { letter-spacing: .12em; }
  .level-choice-grid { gap: 8px; }
  .level-choice {
    min-height: 164px;
    padding: 17px 15px;
    border-color: var(--line-dark);
    transition: border-color 150ms ease, background 150ms ease, color 150ms ease;
  }
  .level-choice:hover { border-color: var(--blue-deep); transform: none; box-shadow: inset 0 -3px 0 var(--blue-deep); }
  .level-choice .level-code { width: 30px; height: 30px; margin-bottom: 17px; border-radius: 1px; }
  .level-choice strong { font-size: 21px; }
  .level-choice p { margin-top: 11px; }
  .level-choice.is-selected {
    color: white;
    background: var(--blue-deep);
    box-shadow: inset 0 4px 0 var(--red);
  }
  .level-choice.is-selected::after {
    content: "已选择";
    position: absolute;
    right: 8px;
    top: 9px;
    padding: 4px 6px;
    color: #fff;
    border: 1px solid rgba(255,255,255,.45);
    font-size: 8px;
    letter-spacing: .1em;
    transform: rotate(3deg);
  }
  .live-score em { border-radius: 1px; }
  .result-strip { border-width: 1px 1px 3px; border-bottom-color: var(--blue-deep); }
  .sticky-actions { background: rgba(238, 234, 224, 0.98); }

  @media (max-width: 1180px) {
    .result-card-grid { grid-template-columns: 1fr; }
    .employee-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  }

  @media (max-width: 820px) {
    .sidebar { width: auto; padding: 16px; }
    .sidebar::before { display: none; }
    .main-stage { margin-left: 0; padding: 20px 16px 48px; }
    .side-nav { grid-template-columns: repeat(5, minmax(0, 1fr)); }
    .nav-item { min-height: 44px; border: 1px solid rgba(255,255,255,.09); }
    .nav-item::before { inset: auto 0 0 0; width: auto; height: 3px; transform: scaleX(0); }
    .nav-item.is-active::before { transform: scaleX(1); }
    .topbar::after { display: none; }
    .role-intro { grid-template-columns: 1fr 154px; }
  }

  @media (max-width: 620px) {
    .brand-lockup { padding-bottom: 13px; }
    .document-code { display: none; }
    .side-nav { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .topbar { display: grid; align-items: start; }
    .view-identity { padding-left: 13px; }
    .top-actions { justify-content: stretch; }
    .result-gallery-heading { display: grid; }
    .result-gallery-meta { justify-items: start; padding: 12px 0 0; border: 0; border-top: 1px solid var(--line); }
    .performance-id-card {
      grid-template-columns: 94px minmax(0, 1fr);
      grid-template-rows: auto 134px auto auto;
      gap: 0 13px;
      min-height: 0;
    }
    .id-photo-area { grid-column: 1; grid-row: 2; height: 134px; }
    .id-person-copy { grid-column: 2; grid-row: 2; }
    .id-person-copy h3 { font-size: 25px; }
    .id-number { font-size: 8px; }
    .id-result-stack {
      grid-column: 1 / -1;
      grid-row: 3;
      grid-template-columns: 1fr 1fr 1.2fr;
      grid-template-rows: 1fr;
      margin-top: 13px;
    }
    .id-result-stack > div { min-height: 69px; border-right: 1px solid var(--line); border-bottom: 0; }
    .id-result-stack > div:last-child { border-right: 0; }
    .id-card-footer { grid-row: 4; }
    .role-intro { grid-template-columns: 1fr; padding: 24px 21px; }
    .role-formula { min-height: 88px; }
    .employee-grid { grid-template-columns: 1fr; }
    .panel { padding: 18px 14px; }
    .data-table { min-width: 650px; }
    .level-choice-grid { grid-template-columns: 1fr; }
    .level-choice { min-height: 112px; grid-template-columns: 36px 1fr auto; align-items: center; column-gap: 10px; }
    .level-choice .level-code { grid-row: 1 / 3; margin: 0; }
    .level-choice p { grid-column: 2 / -1; margin: 4px 0 0; }
    .level-choice.is-selected::after { display: none; }
  }

  @media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
      scroll-behavior: auto !important;
      animation-duration: .01ms !important;
      animation-iteration-count: 1 !important;
      transition-duration: .01ms !important;
    }
  }
}

@media print {
  body { background: white; }
  .sidebar,
  .topbar,
  .sticky-actions,
  .icon-button,
  .toast { display: none !important; }
  .main-stage { margin: 0; padding: 0; }
  .view { display: none !important; }
  dialog[open] { position: static; width: 100%; max-height: none; }
  dialog[open]::backdrop { display: none; }
  .assessment-card { max-height: none; border: 0; box-shadow: none; overflow: visible; }
  .assessment-scroll { overflow: visible; }
  .sticky-heading { color: var(--ink); background: white; border-bottom: 2px solid var(--ink); }
  .sticky-heading .eyebrow,
  .sticky-heading p { color: var(--ink-soft); }
  .metric-score-row,
  .result-strip { break-inside: avoid; }
}
