:root {
  --paper: #eef5f8;
  --paper-deep: #d9e8ed;
  --ink: #112f3a;
  --muted: #59717a;
  --blue: #3370ff;
  --blue-deep: #2458d8;
  --aqua: #60d8ce;
  --white: #ffffff;
  --danger: #bd394d;
  --success: #14866d;
  --line: rgba(17, 47, 58, 0.14);
  --shadow: 0 28px 80px rgba(17, 47, 58, 0.12);
  font-family: "Avenir Next", "SF Pro Text", "PingFang SC", "Microsoft YaHei", sans-serif;
  color: var(--ink);
  background: var(--paper);
}

* {
  box-sizing: border-box;
}

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  background:
    radial-gradient(circle at 82% 14%, rgba(96, 216, 206, 0.36), transparent 25rem),
    linear-gradient(135deg, #f7fbfc 0%, var(--paper) 50%, #e4f0f4 100%);
}

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

button:focus-visible,
input:focus-visible,
textarea:focus-visible {
  outline: 3px solid rgba(51, 112, 255, 0.28);
  outline-offset: 2px;
}

button {
  cursor: pointer;
}

.grain {
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.22;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.13'/%3E%3C/svg%3E");
}

.shell {
  position: relative;
  width: min(1180px, calc(100% - 48px));
  margin: 0 auto;
  padding: 28px 0 56px;
}

.wide-shell {
  width: min(1380px, calc(100% - 48px));
}

.masthead {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 52px;
  margin-bottom: clamp(52px, 8vh, 96px);
}

/* 管理页以信息处理为主，登录后的品牌栏和页面标题需要更紧凑，让人员台账尽快进入首屏。 */
.console-active .shell {
  padding-top: 18px;
}

.console-active .masthead {
  min-height: 44px;
  margin-bottom: 18px;
}

.brand {
  display: inline-flex;
  gap: 12px;
  align-items: center;
  color: inherit;
  text-decoration: none;
}

.brand-mark {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: 50% 50% 50% 12%;
  color: var(--white);
  background: var(--blue);
  font-family: "STKaiti", "KaiTi", serif;
  font-size: 24px;
  box-shadow: 0 10px 26px rgba(51, 112, 255, 0.28);
}

.brand strong,
.brand small {
  display: block;
}

.brand strong {
  letter-spacing: 0.08em;
}

.brand small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 11px;
}

.login-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(360px, 0.7fr);
  gap: clamp(48px, 8vw, 120px);
  align-items: center;
  min-height: 52vh;
}

.intro-copy h1,
.editor-heading h1 {
  margin: 0;
  font-family: "STKaiti", "KaiTi", "Songti SC", serif;
  font-weight: 500;
  letter-spacing: -0.055em;
}

.intro-copy h1 {
  font-size: clamp(64px, 8.2vw, 116px);
  line-height: 0.92;
}

.intro-copy h1 span {
  color: var(--blue);
}

.eyebrow {
  margin: 0 0 20px;
  color: var(--blue-deep);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.18em;
}

.intro-note {
  max-width: 520px;
  margin: 38px 0 0;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.85;
}

.login-card,
.editor-panel {
  background: rgba(255, 255, 255, 0.86);
  box-shadow: var(--shadow);
  backdrop-filter: blur(20px);
}

.login-card {
  padding: 38px;
  border-radius: 30px 30px 30px 6px;
}

.card-index {
  display: inline-block;
  margin-bottom: 14px;
  padding-bottom: 5px;
  border-bottom: 2px solid var(--aqua);
  color: var(--muted);
  font-size: 12px;
}

.login-card h2 {
  margin: 0;
  font-size: 28px;
}

.login-card > div > p {
  margin: 8px 0 30px;
  color: var(--muted);
  line-height: 1.6;
}

.field-label {
  display: block;
  margin-bottom: 10px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.password-row {
  display: flex;
  gap: 10px;
}

input,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  outline: none;
  color: var(--ink);
  background: #f8fbfc;
  transition: border-color 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

input {
  height: 50px;
  padding: 0 16px;
  border-radius: 12px;
}

textarea {
  min-height: 180px;
  padding: 22px;
  resize: vertical;
  border-radius: 18px 18px 18px 4px;
  font-family: "STKaiti", "KaiTi", "PingFang SC", sans-serif;
  font-size: clamp(22px, 3vw, 34px);
  line-height: 1.55;
}

input:focus,
textarea:focus,
select:focus {
  border-color: var(--blue);
  background: var(--white);
  box-shadow: 0 0 0 4px rgba(51, 112, 255, 0.12);
}

.primary-button {
  display: inline-flex;
  min-height: 54px;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
  padding: 0 22px;
  border: 0;
  border-radius: 16px 16px 16px 4px;
  color: var(--white);
  background: var(--blue);
  font-weight: 700;
  box-shadow: 0 12px 28px rgba(51, 112, 255, 0.25);
  transition: transform 160ms ease, background 160ms ease, box-shadow 160ms ease;
}

.primary-button:hover:not(:disabled) {
  transform: translateY(-2px);
  background: var(--blue-deep);
  box-shadow: 0 16px 32px rgba(51, 112, 255, 0.3);
}

.primary-button:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

.primary-button.compact {
  min-width: 84px;
  min-height: 50px;
  justify-content: center;
  padding: 0 18px;
  border-radius: 12px;
}

.text-button {
  padding: 9px 2px;
  border: 0;
  border-bottom: 1px solid var(--ink);
  color: var(--ink);
  background: transparent;
  font-size: 13px;
}

.workspace {
  display: grid;
  grid-template-columns: 250px minmax(0, 1fr);
  gap: clamp(28px, 5vw, 72px);
  align-items: start;
}

.profile-workspace {
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr);
  gap: clamp(24px, 4vw, 56px);
  align-items: start;
}

.profile-rail {
  position: sticky;
  top: 24px;
  min-width: 0;
}

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

.profile-rail-heading h2 {
  margin: 0;
  font-size: 27px;
}

.profile-tools {
  margin-bottom: 14px;
}

.profile-search {
  position: relative;
  display: flex;
  align-items: center;
}

.profile-search > span {
  position: absolute;
  left: 13px;
  z-index: 1;
  color: var(--muted);
  font-size: 18px;
  pointer-events: none;
}

.profile-search input {
  height: 42px;
  padding: 0 38px;
  border-radius: 13px 13px 13px 4px;
  background: rgba(255, 255, 255, 0.72);
  font-size: 12px;
}

.profile-search input::-webkit-search-cancel-button {
  display: none;
}

.search-clear {
  position: absolute;
  right: 8px;
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 9px;
  color: var(--muted);
  background: transparent;
  font-size: 18px;
}

.search-clear:hover {
  color: var(--ink);
  background: rgba(17, 47, 58, 0.06);
}

.profile-filter-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 9px;
}

.profile-filter-group {
  display: inline-flex;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.46);
}

.profile-filter-group button {
  min-height: 26px;
  padding: 0 9px;
  border: 0;
  border-radius: 8px;
  color: var(--muted);
  background: transparent;
  font-size: 10px;
  font-weight: 700;
}

.profile-filter-group button.active {
  color: var(--blue-deep);
  background: var(--white);
  box-shadow: 0 3px 10px rgba(17, 47, 58, 0.08);
}

#profileResultCount {
  flex: 0 0 auto;
  color: var(--muted);
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 9px;
}

.icon-button {
  display: grid;
  width: 42px;
  height: 42px;
  flex: 0 0 auto;
  place-items: center;
  border: 0;
  border-radius: 14px 14px 14px 4px;
  color: var(--white);
  background: var(--blue);
  font-size: 24px;
  line-height: 1;
  box-shadow: 0 10px 22px rgba(51, 112, 255, 0.22);
}

.profile-list {
  display: grid;
  gap: 10px;
  max-height: min(54vh, 560px);
  padding-right: 4px;
  overflow-y: auto;
}

.profile-list-empty {
  margin: 20px 0;
  padding: 22px 12px;
  border: 1px dashed var(--line);
  border-radius: 16px 16px 16px 4px;
  color: var(--muted);
  text-align: center;
  font-size: 12px;
}

.profile-ticket {
  display: flex;
  width: 100%;
  min-height: 78px;
  align-items: center;
  gap: 13px;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 18px 18px 18px 4px;
  color: var(--ink);
  text-align: left;
  background: rgba(255, 255, 255, 0.58);
  transition: border-color 160ms ease, background 160ms ease, transform 160ms ease;
}

.profile-ticket:hover,
.profile-ticket.active {
  border-color: rgba(51, 112, 255, 0.55);
  background: rgba(255, 255, 255, 0.94);
}

.profile-ticket.active {
  transform: translateX(5px);
  box-shadow: 0 12px 30px rgba(17, 47, 58, 0.08);
}

.ticket-mark {
  display: grid;
  width: 42px;
  height: 42px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 12px 12px 12px 3px;
  color: var(--white);
  background: var(--ink);
  font-family: "STKaiti", "KaiTi", serif;
  font-size: 22px;
}

.profile-ticket.active .ticket-mark {
  background: var(--blue);
}

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

.ticket-copy strong,
.ticket-copy small,
.ticket-copy em {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ticket-copy strong {
  font-size: 14px;
}

.ticket-copy small {
  margin-top: 5px;
  color: var(--muted);
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 10px;
}

.ticket-copy em {
  margin-top: 6px;
  font-size: 10px;
  font-style: normal;
}

.ticket-copy em.scheduled {
  color: var(--success);
}

.ticket-copy em.manual {
  color: var(--muted);
}

.system-line {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  margin-top: 26px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
}

.system-line p,
.system-line strong,
.system-line small {
  display: block;
  margin: 0;
}

.system-line strong {
  font-size: 12px;
}

.system-line small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
}

.multi-editor {
  min-width: 0;
}

.profile-editor-heading {
  align-items: center;
}

.editor-heading-actions {
  display: flex;
  align-items: center;
  gap: 16px;
}

.identity-fields {
  display: grid;
  grid-template-columns: minmax(160px, 0.7fr) minmax(300px, 1.3fr);
  gap: 14px;
}

.identity-fields label > span {
  display: block;
  margin-bottom: 7px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.employee-lookup-field {
  position: relative;
  min-width: 0;
}

.employee-lookup-field > label > span {
  display: block;
  margin-bottom: 7px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.employee-search-status {
  min-height: 17px;
  margin: 6px 2px 0;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.5;
}

.employee-search-results {
  position: absolute;
  top: calc(100% - 12px);
  right: 0;
  left: 0;
  z-index: 20;
  display: grid;
  max-height: 280px;
  padding: 7px;
  overflow-y: auto;
  border: 1px solid rgba(51, 112, 255, 0.24);
  border-radius: 16px 16px 16px 5px;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 18px 42px rgba(17, 47, 58, 0.16);
  backdrop-filter: blur(18px);
}

.employee-search-result {
  display: flex;
  width: 100%;
  align-items: center;
  gap: 11px;
  padding: 9px;
  border: 0;
  border-radius: 11px;
  color: var(--ink);
  text-align: left;
  background: transparent;
}

.employee-search-result:hover:not(:disabled),
.employee-search-result:focus-visible {
  background: var(--paper);
}

.employee-search-result:disabled {
  cursor: not-allowed;
  opacity: 0.48;
}

.employee-result-avatar {
  display: grid;
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 10px 10px 10px 3px;
  color: var(--white);
  background: var(--blue);
  font-family: "STKaiti", "KaiTi", serif;
  font-size: 17px;
}

.employee-search-result strong,
.employee-search-result small {
  display: block;
}

.employee-search-result strong {
  font-size: 13px;
}

.employee-search-result small {
  margin-top: 3px;
  color: var(--muted);
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 9px;
}

#openId {
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 13px;
}

.profile-runtime {
  display: grid;
  grid-template-columns: minmax(150px, 0.65fr) minmax(180px, 0.8fr) minmax(0, 1.55fr);
  gap: 16px;
  margin-top: 28px;
  padding: 18px;
  border-left: 3px solid var(--aqua);
  background: rgba(238, 245, 248, 0.52);
}

.profile-runtime span,
.profile-runtime strong {
  display: block;
}

.profile-runtime span {
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 11px;
}

.profile-runtime strong {
  font-size: 12px;
  line-height: 1.6;
  overflow-wrap: anywhere;
}

.error-text {
  color: var(--danger);
}

.status-rail {
  padding: 18px 0;
}

.status-rail h2 {
  margin: 0 0 34px;
  font-size: 26px;
}

.status-list {
  display: grid;
  gap: 24px;
}

.status-item {
  display: flex;
  gap: 13px;
  align-items: flex-start;
}

.status-item strong {
  font-size: 14px;
}

.status-item p {
  margin: 5px 0 0;
  color: var(--muted);
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 11px;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.status-dot {
  width: 10px;
  height: 10px;
  flex: 0 0 auto;
  margin-top: 5px;
  border: 2px solid var(--paper);
  border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 0 2px rgba(20, 134, 109, 0.2);
}

.status-dot.error {
  background: var(--danger);
  box-shadow: 0 0 0 2px rgba(189, 57, 77, 0.18);
}

.status-dot.neutral {
  background: var(--aqua);
  box-shadow: 0 0 0 2px rgba(96, 216, 206, 0.2);
}

.rail-note {
  margin: 38px 0 0;
  padding-top: 22px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
  line-height: 1.75;
}

.config-warning {
  margin-top: 26px;
  padding: 14px;
  border-left: 3px solid var(--danger);
  color: #742739;
  background: rgba(255, 255, 255, 0.55);
  font-size: 12px;
  line-height: 1.65;
}

.editor-panel {
  padding: clamp(28px, 4vw, 52px);
  border-radius: 38px 38px 38px 8px;
}

.editor-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 38px;
}

.editor-heading h1 {
  font-size: clamp(40px, 5vw, 64px);
}

.char-count {
  color: var(--muted);
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 11px;
}

.preview-block {
  display: flex;
  gap: 14px;
  align-items: center;
  margin-top: 24px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(238, 245, 248, 0.6);
}

.avatar-placeholder {
  display: grid;
  width: 46px;
  height: 46px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 16px;
  color: var(--white);
  background: var(--ink);
  font-family: "STKaiti", "KaiTi", serif;
  font-size: 22px;
}

.preview-copy strong {
  font-size: 13px;
}

.preview-copy p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 13px;
  overflow-wrap: anywhere;
}

.form-section + .form-section {
  margin-top: 42px;
  padding-top: 38px;
  border-top: 1px solid var(--line);
}

.section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 20px;
}

.section-heading > div {
  display: flex;
  align-items: center;
  gap: 12px;
}

.section-heading h2 {
  margin: 0;
  font-size: 21px;
}

.section-heading > p,
.section-help {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
}

.section-index {
  color: var(--blue);
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 11px;
  font-weight: 700;
}

.section-help {
  margin: -8px 0 16px;
}

.secondary-button {
  min-height: 40px;
  padding: 0 15px;
  border: 1px solid rgba(51, 112, 255, 0.28);
  border-radius: 12px;
  color: var(--blue-deep);
  background: rgba(255, 255, 255, 0.72);
  font-size: 13px;
  font-weight: 700;
}

.secondary-button:hover:not(:disabled) {
  border-color: var(--blue);
  background: var(--white);
}

.secondary-button.large {
  min-height: 54px;
  padding: 0 22px;
}

.secondary-button:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

.counter-list {
  display: grid;
  gap: 12px;
}

.counter-card {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 18px 18px 18px 4px;
  background: rgba(238, 245, 248, 0.48);
}

.counter-fields {
  display: grid;
  grid-template-columns: 1fr 1.15fr 0.9fr 0.9fr;
  gap: 12px;
}

.counter-fields > label > span,
.counter-direction legend,
.time-field > span {
  display: block;
  margin-bottom: 7px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.counter-direction {
  min-width: 0;
  padding: 0;
  border: 0;
}

.counter-direction-segments {
  display: grid;
  height: 42px;
  grid-template-columns: 1fr 1fr;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #f8fbfc;
}

.counter-direction-segments label {
  min-width: 0;
  cursor: pointer;
}

.counter-direction-segments input {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  opacity: 0;
  pointer-events: none;
}

.counter-direction-segments span {
  display: flex;
  height: 34px;
  align-items: center;
  justify-content: center;
  border-radius: 7px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.counter-direction-segments input:checked + span {
  color: var(--white);
  background: var(--blue);
  box-shadow: 0 4px 10px rgba(51, 112, 255, 0.2);
}

.counter-direction-segments input:focus-visible + span {
  outline: 2px solid var(--blue-deep);
  outline-offset: 1px;
}

.counter-fields input {
  height: 42px;
  padding: 0 12px;
  border-radius: 10px;
  font-size: 13px;
}

.token-input {
  display: flex;
  height: 42px;
  align-items: center;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--blue-deep);
  background: #f8fbfc;
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 12px;
}

.token-input:focus-within {
  border-color: var(--blue);
  background: var(--white);
  box-shadow: 0 0 0 4px rgba(51, 112, 255, 0.12);
}

.token-input input {
  min-width: 0;
  height: 40px;
  padding: 0 3px;
  border: 0;
  box-shadow: none;
  background: transparent;
  font-family: inherit;
}

.token-input input:focus {
  box-shadow: none;
  background: transparent;
}

.counter-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 13px;
}

.counter-value {
  color: var(--success);
  font-size: 12px;
  font-weight: 700;
}

.inline-button {
  padding: 5px 8px;
  border: 0;
  color: var(--blue-deep);
  background: transparent;
  font-size: 12px;
  font-weight: 700;
}

.inline-button.danger {
  color: var(--danger);
}

.schedule-control {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 160px;
  gap: 16px;
  align-items: end;
}

.training-control {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 130px 130px;
  gap: 16px;
  align-items: end;
}

.interval-field > span {
  display: block;
  margin-bottom: 7px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.interval-field input,
.interval-field select {
  width: 100%;
  height: 66px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  outline: none;
  color: var(--ink);
  background: #f8fbfc;
  font-size: 16px;
  font-weight: 700;
}

.interval-field input:focus,
.interval-field select:focus {
  border-color: var(--blue);
  background: var(--white);
  box-shadow: 0 0 0 4px rgba(51, 112, 255, 0.12);
}

.interval-field input:disabled,
.interval-field select:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.training-preview {
  display: flex;
  min-height: 50px;
  align-items: center;
  gap: 14px;
  margin-top: 14px;
  padding: 11px 16px;
  border-left: 3px solid #d08a2c;
  background: rgba(255, 249, 232, 0.62);
}

.training-preview span {
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.training-preview strong {
  font-size: 12px;
  line-height: 1.6;
}

.symbol-controls {
  display: block;
}

.employment-preset {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 180px;
  gap: 12px 16px;
  margin-bottom: 24px;
}

.preset-switch {
  height: 66px;
  min-height: 66px;
  /* 日期字段上方还有标签；开关固定高度并贴底，才能与日期输入框等高对齐。 */
  align-self: end;
}

.employment-date-field > span {
  display: block;
  margin-bottom: 7px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.employment-date-field input {
  height: 66px;
}

.preset-preview {
  grid-column: 1 / -1;
  display: flex;
  min-height: 50px;
  align-items: center;
  gap: 14px;
  padding: 11px 16px;
  border-left: 3px solid var(--blue);
  background: rgba(238, 245, 248, 0.62);
}

.preset-preview span {
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.preset-preview strong {
  font-family: "STKaiti", "KaiTi", serif;
  font-size: 17px;
  font-weight: 500;
}

.custom-template-label {
  margin-top: 4px;
}

.mode-fieldset {
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

.mode-fieldset legend,
.symbol-date-field > span {
  display: block;
  margin-bottom: 7px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.mode-segments {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  min-height: 50px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: #f8fbfc;
}

.mode-segments label {
  position: relative;
  display: grid;
  min-width: 0;
  place-items: center;
  cursor: pointer;
}

.mode-segments input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.mode-segments span {
  display: grid;
  width: 100%;
  height: 40px;
  place-items: center;
  border-radius: 9px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.mode-segments input:checked + span {
  color: var(--white);
  background: var(--blue);
  box-shadow: 0 5px 14px rgba(51, 112, 255, 0.2);
}

.mode-segments input:focus-visible + span {
  outline: 3px solid rgba(51, 112, 255, 0.28);
  outline-offset: 2px;
}

.symbol-preview {
  display: flex;
  min-height: 54px;
  align-items: center;
  gap: 14px;
  margin-top: 14px;
  padding: 12px 16px;
  border-left: 3px solid #f2ad2e;
  background: rgba(255, 249, 232, 0.62);
}

.symbol-preview span {
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.symbol-preview strong {
  font-size: 17px;
  line-height: 1.65;
  overflow-wrap: anywhere;
}

.switch-row {
  display: flex;
  min-height: 66px;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 12px 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(238, 245, 248, 0.48);
  cursor: pointer;
}

.switch-row strong,
.switch-row small {
  display: block;
}

.switch-row strong {
  font-size: 14px;
}

.switch-row small {
  margin-top: 4px;
  color: var(--muted);
  font-size: 11px;
}

.switch-row input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.switch-row i {
  position: relative;
  width: 48px;
  height: 28px;
  flex: 0 0 auto;
  border-radius: 20px;
  background: #b8c7cc;
  transition: background 160ms ease;
}

.switch-row i::after {
  position: absolute;
  top: 4px;
  left: 4px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--white);
  box-shadow: 0 2px 6px rgba(17, 47, 58, 0.25);
  content: "";
  transition: transform 160ms ease;
}

.switch-row input:checked + i {
  background: var(--blue);
}

.switch-row input:checked + i::after {
  transform: translateX(20px);
}

.switch-row input:focus-visible + i {
  outline: 3px solid rgba(51, 112, 255, 0.28);
  outline-offset: 2px;
}

.time-field input {
  height: 66px;
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 18px;
  font-weight: 700;
}

.time-field input:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.action-buttons {
  display: flex;
  gap: 10px;
}

.form-actions {
  display: flex;
  min-height: 76px;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-top: 24px;
}

/* 人员配置较长，保存操作固定在视口底部，避免用户每次修改后都要滚到页面末尾。 */
.editor-view .editor-panel {
  padding-bottom: 136px;
  /* backdrop-filter 会把 fixed 子元素的包含块锁在面板内，取消后操作栏才能真正固定到浏览器视口。 */
  backdrop-filter: none;
}

.editor-view .form-actions {
  position: fixed;
  right: 50%;
  bottom: max(14px, env(safe-area-inset-bottom));
  z-index: 50;
  width: min(1016px, calc(100% - 64px));
  min-height: 76px;
  margin: 0;
  padding: 11px 13px 11px 18px;
  border: 1px solid rgba(17, 47, 58, 0.14);
  border-radius: 18px 18px 18px 6px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 18px 50px rgba(17, 47, 58, 0.2);
  transform: translateX(50%);
  backdrop-filter: blur(20px);
}

.editor-view .form-actions .form-message {
  max-width: 52%;
  margin: 0;
}

.editor-view .form-actions .form-message:empty {
  display: none;
}

.editor-view .form-actions .action-buttons {
  margin-left: auto;
}

.form-message {
  min-height: 20px;
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.form-message.error {
  color: var(--danger);
}

.form-message.success {
  color: var(--success);
}

.console-view {
  margin-top: 0;
}

.management-view {
  display: grid;
  gap: 16px;
}

.management-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 32px;
}

.management-heading h1 {
  margin: 0;
  font-family: "STKaiti", "KaiTi", "Songti SC", serif;
  font-size: clamp(44px, 4.5vw, 62px);
  font-weight: 500;
  letter-spacing: -0.05em;
  line-height: 1;
}

.management-heading p:last-child {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.management-heading .eyebrow {
  margin-bottom: 8px;
}

.management-add {
  min-width: 152px;
}

.management-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border: 1px solid var(--line);
  border-radius: 24px 24px 24px 6px;
  background: rgba(255, 255, 255, 0.58);
  overflow: hidden;
  backdrop-filter: blur(16px);
}

.management-stats article {
  position: relative;
  min-width: 0;
  padding: 14px 18px;
}

.management-stats article + article {
  border-left: 1px solid var(--line);
}

.management-stats span,
.management-stats strong,
.management-stats small {
  display: block;
}

.management-stats span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.management-stats strong {
  margin: 5px 0 2px;
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 27px;
  line-height: 1;
}

.management-stats small {
  color: var(--muted);
  font-size: 10px;
}

.management-stats article:nth-child(2)::after,
.management-stats article:nth-child(3)::after {
  position: absolute;
  top: 15px;
  right: 16px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--success);
  content: "";
}

.management-stats article:nth-child(3)::after {
  background: var(--danger);
}

.directory-panel {
  border-radius: 30px 30px 30px 7px;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: var(--shadow);
  overflow: hidden;
  backdrop-filter: blur(20px);
}

.directory-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 22px 24px 16px;
}

.directory-toolbar .profile-search {
  width: min(420px, 42vw);
}

.directory-toolbar .profile-search input {
  height: 48px;
  border-radius: 14px 14px 14px 4px;
  background: var(--paper);
  font-size: 13px;
}

.directory-controls {
  display: flex;
  align-items: center;
  gap: 12px;
}

.directory-controls .profile-filter-group {
  padding: 4px;
  border-radius: 13px;
}

.directory-controls .profile-filter-group button {
  min-height: 34px;
  padding: 0 12px;
  font-size: 11px;
}

.sort-field {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.sort-field select {
  height: 42px;
  padding: 0 34px 0 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  outline: none;
  color: var(--ink);
  background: #f8fbfc;
  font-size: 12px;
}

.directory-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 0 24px 14px;
  color: var(--muted);
  font-size: 10px;
}

.directory-meta strong {
  color: var(--ink);
  font-family: "SFMono-Regular", Consolas, monospace;
}

.directory-table-wrap {
  overflow-x: auto;
}

.directory-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}

.directory-table th {
  padding: 12px 18px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  background: rgba(238, 245, 248, 0.58);
  text-align: left;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.06em;
}

.directory-table th:nth-child(1) { width: 21%; }
.directory-table th:nth-child(2) { width: 31%; }
.directory-table th:nth-child(3) { width: 15%; }
.directory-table th:nth-child(4) { width: 20%; }
.directory-table th:nth-child(5) { width: 13%; }

.directory-table td {
  height: 82px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}

.directory-table tbody tr {
  position: relative;
  transition: background 150ms ease;
}

.directory-table tbody tr::after {
  position: absolute;
  top: 12px;
  bottom: 12px;
  left: 0;
  width: 3px;
  border-radius: 0 3px 3px 0;
  background: transparent;
  content: "";
  transition: background 150ms ease;
}

.directory-table tbody tr:hover {
  background: rgba(238, 245, 248, 0.52);
}

.directory-table tbody tr:hover::after {
  background: var(--blue);
}

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

.person-cell > span:last-child {
  min-width: 0;
}

.person-avatar {
  display: grid;
  width: 42px;
  height: 42px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 13px 13px 13px 4px;
  color: var(--white);
  background: var(--ink);
  font-family: "STKaiti", "KaiTi", serif;
  font-size: 21px;
}

.person-cell strong,
.person-cell small,
.runtime-cell strong,
.runtime-cell small {
  display: block;
}

.person-cell strong {
  overflow: hidden;
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.person-cell small {
  margin-top: 4px;
  overflow: hidden;
  color: var(--muted);
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 9px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.signature-cell {
  display: -webkit-box;
  margin: 0;
  overflow: hidden;
  color: #34515b;
  font-size: 12px;
  line-height: 1.55;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.schedule-badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 9px;
  border-radius: 999px;
  color: var(--muted);
  background: rgba(89, 113, 122, 0.08);
  font-size: 10px;
  font-weight: 700;
  white-space: nowrap;
}

.schedule-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.schedule-badge i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #9aabb1;
}

.schedule-badge.scheduled {
  color: var(--success);
  background: rgba(20, 134, 109, 0.09);
}

.schedule-badge.scheduled i {
  background: var(--success);
}

.schedule-badge.training {
  color: #9a5b10;
  background: rgba(208, 138, 44, 0.11);
}

.schedule-badge.training i {
  background: #d08a2c;
}

.runtime-cell {
  min-width: 0;
  padding-left: 12px;
  border-left: 2px solid #b8c7cc;
}

.runtime-cell.success { border-color: var(--success); }
.runtime-cell.error { border-color: var(--danger); }
.runtime-cell.pending { border-color: #b8c7cc; }

.runtime-cell strong {
  font-size: 11px;
}

.runtime-cell.error strong {
  color: var(--danger);
}

.runtime-cell.success strong {
  color: var(--success);
}

.runtime-cell small {
  margin-top: 4px;
  overflow: hidden;
  color: var(--muted);
  font-size: 9px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.table-action,
.back-button {
  border: 0;
  color: var(--blue-deep);
  background: transparent;
  font-size: 11px;
  font-weight: 700;
}

.table-action {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  white-space: nowrap;
}

.table-action:hover span {
  transform: translateX(3px);
}

.table-action span {
  transition: transform 150ms ease;
}

.directory-empty {
  padding: 64px 24px;
  color: var(--muted);
  text-align: center;
}

.directory-empty strong {
  color: var(--ink);
  font-size: 16px;
}

.directory-empty p {
  margin: 8px 0 0;
  font-size: 12px;
}

.management-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  color: var(--muted);
  font-size: 10px;
}

.management-footer .system-line {
  margin: 0;
  padding: 0;
  border: 0;
}

.management-footer .config-warning {
  margin: 0;
}

.management-footer > p {
  margin: 0;
}

.editor-view {
  width: min(1080px, 100%);
  margin: 0 auto;
}

.editor-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 14px;
  color: var(--muted);
  font-size: 10px;
}

.back-button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 0;
}

.back-button span {
  font-size: 17px;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.hidden {
  display: none !important;
}

@media (max-width: 820px) {
  .shell {
    width: min(100% - 28px, 640px);
    padding-top: 18px;
  }

  .masthead {
    margin-bottom: 44px;
  }

  .login-layout,
  .workspace,
  .profile-workspace {
    grid-template-columns: 1fr;
  }

  .console-view {
    margin-top: 0;
  }

  .management-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .management-stats article:nth-child(3) {
    border-left: 0;
    border-top: 1px solid var(--line);
  }

  .management-stats article:nth-child(4) {
    border-top: 1px solid var(--line);
  }

  .directory-toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .directory-toolbar .profile-search {
    width: 100%;
  }

  .directory-controls {
    justify-content: space-between;
  }

  .directory-table thead {
    display: none;
  }

  .directory-table,
  .directory-table tbody,
  .directory-table tr,
  .directory-table td {
    display: block;
    width: 100%;
  }

  .directory-table tbody {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    padding: 0 18px 18px;
  }

  .directory-table tbody tr {
    padding: 16px;
    border: 1px solid var(--line);
    border-radius: 18px 18px 18px 5px;
    background: rgba(248, 251, 252, 0.72);
  }

  .directory-table tbody tr::after {
    top: 15px;
    bottom: 15px;
  }

  .directory-table td {
    display: grid;
    height: auto;
    min-height: 40px;
    grid-template-columns: 86px minmax(0, 1fr);
    align-items: center;
    padding: 9px 0;
    border-bottom: 1px solid var(--line);
  }

  .directory-table td::before {
    color: var(--muted);
    content: attr(data-label);
    font-size: 9px;
    font-weight: 700;
  }

  .directory-table td:first-child {
    display: block;
    padding-top: 0;
  }

  .directory-table td:first-child::before,
  .directory-table td:last-child::before {
    display: none;
  }

  .directory-table td:last-child {
    display: flex;
    justify-content: flex-end;
    padding-bottom: 0;
    border: 0;
  }

  .management-footer {
    align-items: flex-start;
    flex-direction: column;
  }

  .editor-view .form-actions {
    width: min(612px, calc(100% - 28px));
  }

  .profile-rail {
    position: static;
  }

  .profile-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    max-height: none;
  }

  .profile-tools {
    max-width: 520px;
  }

  .login-layout {
    gap: 48px;
  }

  .intro-copy h1 {
    font-size: clamp(58px, 18vw, 90px);
  }

  .status-rail {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
  }

  .status-rail > .eyebrow,
  .status-rail > h2 {
    grid-column: 1 / -1;
  }

  .status-list {
    grid-column: 1 / -1;
    grid-template-columns: 1fr 1fr;
  }

  .config-warning,
  .rail-note {
    margin: 0;
  }
}

@media (max-width: 520px) {
  .login-card,
  .editor-panel {
    padding: 24px;
    border-radius: 24px 24px 24px 6px;
  }

  .password-row,
  .form-actions,
  .editor-heading {
    align-items: stretch;
    flex-direction: column;
  }

  .editor-view .editor-panel {
    padding-bottom: 118px;
  }

  .editor-view .form-actions {
    bottom: max(8px, env(safe-area-inset-bottom));
    min-height: 72px;
    align-items: center;
    padding: 9px;
    border-radius: 16px 16px 16px 5px;
    flex-direction: row;
  }

  .editor-view .form-actions .form-message:not(:empty) {
    position: absolute;
    right: 0;
    bottom: calc(100% + 7px);
    left: 0;
    max-width: none;
    padding: 9px 12px;
    border: 1px solid var(--line);
    border-radius: 12px 12px 12px 4px;
    background: rgba(255, 255, 255, 0.96);
    box-shadow: 0 8px 24px rgba(17, 47, 58, 0.14);
  }

  .editor-view .action-buttons {
    width: 100%;
    margin-left: 0;
    grid-template-columns: minmax(104px, 0.75fr) minmax(0, 1.25fr);
  }

  .editor-view .action-buttons .secondary-button,
  .editor-view .action-buttons .primary-button {
    width: 100%;
    min-width: 0;
    padding-right: 14px;
    padding-left: 14px;
  }

  .editor-view .action-buttons .primary-button {
    gap: 8px;
  }

  .password-row {
    display: grid;
  }

  .status-rail,
  .status-list {
    grid-template-columns: 1fr;
  }

  .profile-list,
  .identity-fields,
  .profile-runtime {
    grid-template-columns: 1fr;
  }

  .management-heading {
    align-items: stretch;
    flex-direction: column;
    gap: 16px;
  }

  .management-heading h1 {
    font-size: 48px;
  }

  .management-add {
    width: 100%;
  }

  .management-stats article {
    padding: 16px;
  }

  .management-stats strong {
    font-size: 25px;
  }

  .directory-controls {
    align-items: stretch;
    flex-direction: column;
  }

  .directory-controls .profile-filter-group {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .sort-field {
    justify-content: space-between;
  }

  .sort-field select {
    flex: 1;
  }

  .directory-meta span {
    display: none;
  }

  .directory-table tbody {
    grid-template-columns: 1fr;
    padding: 0 12px 12px;
  }

  .editor-toolbar > span {
    display: none;
  }

  .profile-filter-bar {
    align-items: flex-start;
    flex-direction: column;
  }

  .profile-editor-heading,
  .editor-heading-actions {
    align-items: flex-start;
  }

  .form-actions .primary-button {
    width: 100%;
  }

  .counter-fields,
  .schedule-control,
  .training-control,
  .symbol-controls,
  .employment-preset {
    grid-template-columns: 1fr;
  }

  .preset-preview {
    grid-column: auto;
  }

  .mode-segments {
    grid-template-columns: 1fr;
  }

  .section-heading,
  .counter-footer,
  .action-buttons {
    align-items: stretch;
    flex-direction: column;
  }

  .action-buttons {
    display: grid;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}

/* 组合切换只隐藏不参与当前输出的字段，不清空用户草稿。 */
.signature-content-group { border: 0; padding: 0; margin: 0; min-width: 0; }
[data-signature-text][hidden], [data-signature-text-control][hidden],
[data-signature-symbols][hidden], [data-signature-preset][hidden],
[data-signature-date][hidden] { display: none !important; }
[data-signature-mode="symbols"] .employment-preset { grid-template-columns: minmax(0, 320px); }
[data-signature-date="false"] .employment-preset { grid-template-columns: 1fr; }
#signatureModeHelp { margin: 12px 0 20px; }
