:root {
  --bg: #f5efe5;
  --paper: rgba(255, 252, 247, 0.88);
  --paper-strong: #fffdfa;
  --panel: #f7f1e7;
  --ink: #16342e;
  --muted: #6c7d77;
  --line: rgba(22, 52, 46, 0.1);
  --accent: #1d6a57;
  --accent-deep: #123c32;
  --accent-soft: #d8ebe3;
  --sand: #ece0cc;
  --warn: #a84c3e;
  --shadow: 0 24px 80px rgba(18, 60, 50, 0.11);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  font-family: "PingFang SC", "Hiragino Sans GB", "Source Han Sans SC", "Microsoft YaHei", sans-serif;
  background:
    radial-gradient(circle at 12% 18%, rgba(29, 106, 87, 0.14), transparent 0 26%),
    radial-gradient(circle at 88% 14%, rgba(198, 162, 102, 0.16), transparent 0 22%),
    linear-gradient(180deg, #faf7f1 0%, #f3ebdf 100%);
}

.ambient {
  position: fixed;
  inset: auto;
  border-radius: 999px;
  filter: blur(60px);
  opacity: 0.55;
  pointer-events: none;
}

.ambient-a {
  width: 340px;
  height: 340px;
  left: -120px;
  top: 120px;
  background: rgba(29, 106, 87, 0.16);
}

.ambient-b {
  width: 300px;
  height: 300px;
  right: -90px;
  bottom: 60px;
  background: rgba(200, 166, 106, 0.18);
}

.hidden {
  display: none !important;
}

.employee-body {
  padding: 24px;
}

.login-screen {
  min-height: calc(100vh - 48px);
  display: grid;
  place-items: center;
}

.login-stage {
  width: min(560px, 100%);
  padding: 52px 44px;
  border-radius: 36px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.86), rgba(255, 251, 245, 0.92)),
    var(--paper-strong);
  border: 1px solid rgba(255, 255, 255, 0.55);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.brand-mark,
.section-kicker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 14px;
  color: var(--accent);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.login-stage h1,
.dashboard-top h2,
.hero-panel h3,
.section-head h3,
.salary-group-head h4,
.teacher-sheet-hero h4,
.record-summary h5 {
  margin: 0;
}

.login-stage h1 {
  font-size: clamp(36px, 6vw, 54px);
  line-height: 1.05;
}

.login-subtitle,
.muted,
.section-head p,
.teacher-sheet-hero p,
.record-summary p {
  color: var(--muted);
}

.login-subtitle {
  margin: 16px 0 0;
  font-size: 16px;
  line-height: 1.75;
}

.login-panel,
.field {
  display: grid;
  gap: 9px;
}

.login-panel {
  margin-top: 28px;
}

.field span {
  font-size: 14px;
  font-weight: 700;
}

input,
select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.92);
  padding: 14px 16px;
  font-size: 15px;
  color: var(--ink);
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

input:focus,
select:focus {
  border-color: rgba(29, 106, 87, 0.5);
  box-shadow: 0 0 0 4px rgba(29, 106, 87, 0.08);
  transform: translateY(-1px);
}

.primary-btn,
.ghost-btn,
.detail-tab {
  border: 0;
  cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease, opacity 0.18s ease;
}

.primary-btn {
  margin-top: 8px;
  border-radius: 18px;
  padding: 15px 18px;
  color: #fff;
  font-size: 16px;
  font-weight: 700;
  background: linear-gradient(135deg, var(--accent-deep), var(--accent));
  box-shadow: 0 16px 40px rgba(18, 60, 50, 0.18);
}

.primary-btn:hover,
.ghost-btn:hover,
.detail-tab:hover {
  transform: translateY(-1px);
}

.login-error,
.empty-state {
  margin: 0;
  border-radius: 16px;
  padding: 13px 14px;
  background: #fcf1ee;
  color: var(--warn);
  font-size: 14px;
}

.app-shell {
  width: min(1520px, 100%);
  margin: 0 auto;
}

.dashboard-top,
.card,
.hero-panel {
  border: 1px solid rgba(255, 255, 255, 0.62);
  background: var(--paper);
  border-radius: 30px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.dashboard-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  padding: 24px 28px;
}

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

.compact-field {
  min-width: 170px;
}

.ghost-btn {
  padding: 13px 18px;
  border-radius: 16px;
  background: rgba(246, 250, 248, 0.92);
  color: var(--accent-deep);
  border: 1px solid rgba(29, 106, 87, 0.1);
}

.dashboard-main {
  display: grid;
  gap: 18px;
  margin-top: 18px;
}

.hero-panel {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  align-items: center;
  padding: 28px;
  background:
    linear-gradient(135deg, rgba(18, 60, 50, 0.96), rgba(29, 106, 87, 0.9)),
    var(--paper);
  color: #fff;
}

.hero-panel .section-kicker,
.hero-panel .muted {
  color: rgba(255, 255, 255, 0.76);
}

.hero-copy-block {
  max-width: 760px;
}

.hero-panel h3 {
  font-size: 34px;
  line-height: 1.15;
}

.hero-panel .muted {
  margin-top: 10px;
}

.role-badge {
  display: inline-flex;
  padding: 10px 16px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
}

.role-badge.teacher {
  background: rgba(216, 235, 227, 0.2);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.18);
}

.role-badge.nonteacher {
  background: rgba(236, 224, 204, 0.24);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.18);
}

.card {
  padding: 24px 28px 28px;
}

.section-head {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: end;
}

.section-head p {
  margin: 8px 0 0;
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 220px));
  gap: 14px;
  margin-top: 18px;
  justify-content: start;
}

.compact-grid {
  margin-top: 16px;
}

.summary-card {
  padding: 18px 18px 20px;
  border-radius: 22px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(247, 251, 249, 0.9));
  border: 1px solid rgba(29, 106, 87, 0.1);
}

.summary-card .label {
  display: block;
  color: var(--muted);
  font-size: 13px;
}

.summary-card .value {
  display: block;
  margin-top: 10px;
  font-size: 30px;
  line-height: 1.1;
  color: var(--accent-deep);
}

.salary-grid {
  display: grid;
  gap: 14px;
  margin-top: 18px;
}

.salary-group {
  border: 1px solid rgba(22, 52, 46, 0.08);
  border-radius: 22px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.82);
}

.salary-group summary {
  list-style: none;
  cursor: pointer;
  padding: 18px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
}

.salary-group summary::-webkit-details-marker {
  display: none;
}

.salary-group[open] summary {
  background: linear-gradient(180deg, rgba(247, 250, 249, 0.9), rgba(241, 247, 244, 0.9));
}

.group-title {
  display: block;
  font-weight: 700;
}

.group-subtitle,
.group-toggle {
  color: var(--muted);
  font-size: 13px;
}

.salary-table-wrap {
  overflow: auto;
}

.salary-card-wrap {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 240px));
  gap: 10px;
  padding: 10px 14px 14px;
  justify-content: start;
}

.salary-item-card {
  padding: 12px 14px;
  border-radius: 16px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(246, 250, 248, 0.92));
  border: 1px solid rgba(22, 52, 46, 0.07);
}

.salary-item-label {
  display: block;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.salary-item-value {
  display: block;
  margin-top: 6px;
  color: var(--accent-deep);
  font-variant-numeric: tabular-nums;
  font-size: 22px;
  line-height: 1.1;
}

.detail-sheet-tabs {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 18px;
}

.detail-tab {
  padding: 12px 16px;
  border-radius: 18px;
  background: rgba(246, 250, 248, 0.86);
  border: 1px solid rgba(29, 106, 87, 0.1);
  color: var(--ink);
  display: grid;
  gap: 4px;
  text-align: left;
}

.detail-tab strong {
  color: var(--muted);
  font-size: 12px;
}

.detail-tab.active {
  background: linear-gradient(135deg, var(--accent-deep), var(--accent));
  color: #fff;
  box-shadow: 0 14px 34px rgba(18, 60, 50, 0.18);
}

.detail-tab.active strong {
  color: rgba(255, 255, 255, 0.76);
}

.detail-sheet-content {
  margin-top: 18px;
}

.teacher-sheet-hero {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
}

.teacher-sheet-hero h4 {
  font-size: 24px;
}

.teacher-list-shell {
  display: grid;
  gap: 12px;
  margin-top: 16px;
}

.teacher-record-item {
  border-radius: 22px;
  border: 1px solid rgba(22, 52, 46, 0.08);
  background: rgba(255, 255, 255, 0.86);
  overflow: hidden;
}

.teacher-record-item summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: start;
  padding: 16px 18px;
}

.teacher-record-item summary::-webkit-details-marker {
  display: none;
}

.teacher-record-item[open] summary {
  background: linear-gradient(180deg, rgba(247, 250, 249, 0.9), rgba(242, 247, 244, 0.92));
}

.teacher-record-main {
  min-width: 0;
  flex: 1;
}

.teacher-record-main h5 {
  margin: 0;
  font-size: 15px;
  line-height: 1.42;
}

.teacher-record-meta,
.teacher-record-amounts {
  display: grid;
  gap: 6px;
  grid-template-columns: repeat(auto-fit, minmax(130px, max-content));
  margin-top: 8px;
  align-items: start;
}

.teacher-meta-chip,
.teacher-amount-chip {
  display: grid;
  gap: 2px;
  align-content: start;
  padding: 8px 10px;
  border-radius: 14px;
  font-size: 11px;
}

.teacher-meta-chip {
  background: rgba(236, 224, 204, 0.5);
  color: var(--accent-deep);
}

.teacher-amount-chip {
  background: rgba(216, 235, 227, 0.72);
  color: var(--accent-deep);
}

.teacher-meta-chip em,
.teacher-amount-chip em {
  font-style: normal;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.35;
}

.teacher-meta-chip strong,
.teacher-amount-chip strong {
  line-height: 1.35;
}

.teacher-amount-chip strong {
  font-size: 15px;
  font-variant-numeric: tabular-nums;
}

.teacher-record-side {
  display: grid;
  gap: 8px;
  justify-items: end;
  min-width: 210px;
}

.teacher-expand-text {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.teacher-record-detail-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  padding: 0 18px 18px;
  align-items: start;
}

.teacher-section-card {
  border-radius: 16px;
  background: rgba(247, 250, 249, 0.82);
  border: 1px solid rgba(22, 52, 46, 0.06);
  overflow: hidden;
  min-width: 0;
}

.teacher-section-head {
  padding: 10px 12px;
  background: linear-gradient(180deg, rgba(238, 245, 241, 0.92), rgba(245, 249, 247, 0.92));
  border-bottom: 1px solid rgba(22, 52, 46, 0.05);
}

.teacher-section-head h6 {
  margin: 0;
  font-size: 12px;
  color: var(--accent-deep);
}

.teacher-section-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 6px;
  padding: 10px;
}

.teacher-field-row {
  display: grid;
  grid-template-columns: minmax(0, 92px) minmax(0, 1fr);
  gap: 8px;
  align-items: start;
  padding: 8px 9px;
  border-radius: 12px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(248, 251, 249, 0.94));
  border: 1px solid rgba(22, 52, 46, 0.06);
}

.teacher-field-row span {
  color: var(--muted);
  font-size: 10px;
  line-height: 1.3;
}

.teacher-field-row .field-label-note {
  display: block;
}

.teacher-field-row strong {
  text-align: right;
  font-size: 10px;
  line-height: 1.35;
  word-break: break-word;
  white-space: pre-wrap;
}

.teacher-field-row.numeric strong {
  color: var(--accent-deep);
  font-variant-numeric: tabular-nums;
}

.admin-page {
  width: min(1360px, 100%);
  margin: 0 auto;
}

.admin-header {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: end;
  margin-bottom: 18px;
}

.admin-grid {
  display: grid;
  grid-template-columns: minmax(320px, 420px) minmax(0, 1fr);
  gap: 18px;
}

.upload-dropzone {
  display: grid;
  gap: 12px;
  border: 1px dashed rgba(29, 106, 87, 0.24);
  border-radius: 24px;
  padding: 20px;
  background: rgba(247, 251, 249, 0.76);
}

.upload-dropzone input[type="file"] {
  padding: 12px;
  background: #fff;
}

.status-list,
.publish-list,
.preview-list {
  display: grid;
  gap: 12px;
  margin-top: 16px;
}

.status-item,
.publish-item,
.preview-item {
  padding: 16px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.82);
  border: 1px solid rgba(22, 52, 46, 0.08);
}

.status-item strong,
.publish-item strong,
.preview-item strong {
  display: block;
  font-size: 16px;
}

.status-item span,
.publish-item span,
.preview-item span {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  line-height: 1.6;
}

.table-like {
  width: 100%;
  border-collapse: collapse;
  margin-top: 14px;
}

.table-like th,
.table-like td {
  padding: 12px 10px;
  border-top: 1px solid rgba(22, 52, 46, 0.08);
  text-align: left;
  font-size: 14px;
  vertical-align: top;
}

.table-like th {
  color: var(--muted);
  font-weight: 700;
}

.download-link {
  display: inline-flex;
  margin-top: 10px;
  color: var(--accent);
  font-weight: 700;
  text-decoration: none;
}

.download-link:hover {
  text-decoration: underline;
}

@media (max-width: 980px) {
  .employee-body {
    padding: 14px;
  }

  .dashboard-top,
  .hero-panel,
  .admin-grid,
  .admin-header {
    grid-template-columns: 1fr;
    flex-direction: column;
    align-items: flex-start;
  }

  .top-actions {
    width: 100%;
  }

  .compact-field {
    width: 100%;
  }

  .teacher-record-detail-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 720px) {
  .login-stage,
  .dashboard-top,
  .hero-panel,
  .card {
    padding: 20px;
    border-radius: 24px;
  }

  .hero-panel h3 {
    font-size: 28px;
  }

  .summary-grid,
  .salary-grid {
    grid-template-columns: 1fr;
  }

  .salary-card-wrap {
    grid-template-columns: 1fr;
  }

  .teacher-record-item summary {
    flex-direction: column;
  }

  .teacher-record-side {
    justify-items: start;
    min-width: 0;
  }

  .teacher-record-detail-grid {
    grid-template-columns: 1fr;
  }

  .teacher-record-meta,
  .teacher-record-amounts {
    grid-template-columns: 1fr;
  }

  .teacher-field-row {
    grid-template-columns: 1fr;
    gap: 6px;
  }

  .teacher-field-row strong {
    text-align: left;
  }
}
