:root {
  --brand: #0d5b2b;
  --brand-2: #6ca447;
  --mint: #e7f1e5;
  --paper: #fffdf8;
  --cream: #f5f2e8;
  --ink: #213328;
  --muted: #6b776e;
  --line: #d7dfd7;
  --coral: #e56f4a;
  --danger: #b33a2f;
  --shadow: 0 16px 50px rgba(20, 50, 31, 0.1);
  font-family: "Noto Sans SC", "Microsoft YaHei", "PingFang SC", sans-serif;
  color: var(--ink);
  background: #eef3ec;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  background:
    linear-gradient(110deg, rgba(13, 91, 43, 0.04), transparent 42%),
    #eef3ec;
}

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

button {
  cursor: pointer;
}

a {
  color: inherit;
}

.app-shell {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 28px 0 64px;
}

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

.topbar-brand {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}

.topbar-brand img {
  width: 150px;
  height: 76px;
  object-fit: contain;
}

.topbar-title {
  border-left: 1px solid var(--line);
  padding-left: 14px;
  font-family: "Noto Serif SC", "Source Han Serif SC", serif;
  font-size: 20px;
  font-weight: 700;
  white-space: nowrap;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.button {
  border: 0;
  border-radius: 8px;
  background: var(--brand);
  color: #fff;
  min-height: 42px;
  padding: 0 16px;
  font-size: 14px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-decoration: none;
  transition: transform 0.15s ease, background 0.15s ease, border-color 0.15s ease;
}

.button:hover {
  transform: translateY(-1px);
  background: #0a4b23;
}

.button.secondary {
  color: var(--brand);
  background: #fff;
  border: 1px solid rgba(13, 91, 43, 0.28);
}

.button.ghost {
  color: var(--ink);
  background: transparent;
  border: 1px solid var(--line);
}

.button.coral {
  background: var(--coral);
}

.button.danger {
  background: var(--danger);
}

.button[disabled] {
  opacity: 0.55;
  cursor: wait;
  transform: none;
}

.panel {
  background: var(--paper);
  border: 1px solid rgba(13, 91, 43, 0.12);
  border-radius: 14px;
  box-shadow: var(--shadow);
  padding: 26px;
}

.narrow {
  width: min(520px, 100%);
  margin: 9vh auto 0;
}

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

.section-title h1,
.section-title h2 {
  margin: 0;
  font-family: "Noto Serif SC", "Source Han Serif SC", serif;
}

.section-title h1 {
  font-size: 30px;
}

.section-title h2 {
  font-size: 22px;
}

.section-title p {
  color: var(--muted);
  margin: 6px 0 0;
  font-size: 14px;
  line-height: 1.6;
}

.status {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  border-radius: 999px;
  padding: 0 10px;
  font-size: 12px;
  font-weight: 800;
}

.status.draft {
  color: #5e6b61;
  background: #edf0ed;
}

.status.submitted {
  color: #76531b;
  background: #fff0cf;
}

.status.returned {
  color: #9e332b;
  background: #ffe2dd;
}

.status.published {
  color: #0b5d2a;
  background: #dff1e2;
}

.login-grid {
  display: grid;
  gap: 14px;
}

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

.field label {
  color: #314338;
  font-size: 13px;
  font-weight: 800;
}

.field small {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.field input,
.field textarea,
.field select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  padding: 12px 13px;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.field input:focus,
.field textarea:focus,
.field select:focus {
  border-color: var(--brand-2);
  box-shadow: 0 0 0 3px rgba(108, 164, 71, 0.16);
}

.field textarea {
  min-height: 116px;
  resize: vertical;
  line-height: 1.7;
}

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

.form-grid .wide {
  grid-column: 1 / -1;
}

.form-layout {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  gap: 24px;
  align-items: start;
}

.photo-panel {
  position: sticky;
  top: 20px;
  display: grid;
  gap: 14px;
}

.photo-preview {
  width: 100%;
  aspect-ratio: 3 / 4;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid var(--line);
  background:
    repeating-linear-gradient(135deg, #e3ece2 0 1px, transparent 1px 14px),
    #f3f7f2;
  display: grid;
  place-items: center;
  color: var(--brand);
  text-align: center;
  font-size: 13px;
  line-height: 1.7;
}

.photo-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.file-button {
  position: relative;
  overflow: hidden;
}

.file-button input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.action-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 22px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
}

.action-row .spacer {
  flex: 1;
}

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

.profile-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 18px;
  align-items: center;
  padding: 18px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 10px;
}

.profile-row h3 {
  margin: 0 0 5px;
  font-size: 18px;
}

.profile-row p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

.profile-row-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.empty {
  padding: 44px 20px;
  border: 1px dashed #cbd6cc;
  border-radius: 10px;
  text-align: center;
  color: var(--muted);
  background: #fafcf9;
}

.notice {
  padding: 14px 16px;
  border-radius: 8px;
  background: #eef7ec;
  color: #305e3a;
  line-height: 1.6;
  font-size: 13px;
}

.notice.warn {
  background: #fff1d8;
  color: #754b13;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  z-index: 20;
  transform: translate(-50%, 18px);
  opacity: 0;
  pointer-events: none;
  padding: 12px 18px;
  min-width: 220px;
  max-width: calc(100vw - 32px);
  border-radius: 8px;
  background: #183d25;
  color: #fff;
  text-align: center;
  font-size: 14px;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.18);
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}

.muted {
  color: var(--muted);
}

.mono {
  overflow-wrap: anywhere;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
}

.preview-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}

.resume {
  width: min(1080px, 100%);
  margin: 0 auto;
  background: var(--paper);
  color: #26352b;
  box-shadow: var(--shadow);
  overflow: hidden;
}

.resume-top {
  display: grid;
  grid-template-columns: 220px 1fr auto;
  gap: 24px;
  align-items: center;
  padding: 42px 48px 22px;
  border-bottom: 2px solid #26352b;
}

.resume-logo {
  width: 200px;
  height: 96px;
  object-fit: contain;
}

.resume-title {
  font-family: "Noto Serif SC", "Source Han Serif SC", serif;
  text-align: center;
  font-size: 30px;
  letter-spacing: 0.25em;
}

.resume-number {
  color: var(--coral);
  font-family: "Noto Serif SC", "Source Han Serif SC", serif;
  font-weight: 700;
}

.resume-hero {
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr);
  gap: 48px;
  padding: 44px 48px 36px;
}

.resume-photo-frame {
  position: relative;
  padding: 18px 0 0 18px;
}

.resume-photo-frame::before {
  content: "";
  position: absolute;
  inset: 0 18px 18px 0;
  background: var(--coral);
}

.resume-photo {
  position: relative;
  z-index: 1;
  aspect-ratio: 3 / 4;
  overflow: hidden;
  display: grid;
  place-items: center;
  background: #e9f0e7;
  border: 1px solid rgba(13, 91, 43, 0.2);
  color: var(--brand);
  text-align: center;
  font-weight: 700;
}

.resume-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.resume-kicker {
  color: var(--coral);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.22em;
  margin-bottom: 12px;
}

.resume-name {
  margin: 0 0 10px;
  font-family: "Noto Serif SC", "Source Han Serif SC", serif;
  font-size: 54px;
  line-height: 1.1;
  letter-spacing: 0.08em;
}

.resume-subject {
  margin: 0 0 22px;
  font-size: 20px;
  font-weight: 800;
}

.resume-school {
  background: var(--brand);
  color: #fff;
  padding: 18px 20px;
  margin-bottom: 20px;
}

.resume-school small {
  display: block;
  color: #bde19f;
  font-weight: 800;
  letter-spacing: 0.15em;
  margin-bottom: 8px;
}

.resume-school strong {
  display: block;
  font-family: "Noto Serif SC", "Source Han Serif SC", serif;
  font-size: 27px;
  margin-bottom: 6px;
}

.resume-school span {
  color: #dbe9d8;
  font-size: 14px;
}

.resume-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 18px;
}

.resume-tags span {
  border: 1px solid var(--brand);
  border-radius: 999px;
  color: var(--brand);
  padding: 6px 13px;
  font-size: 13px;
  font-weight: 800;
}

.resume-lead {
  color: #4c5d50;
  font-size: 16px;
  line-height: 1.8;
}

.resume-body {
  padding: 0 48px 54px;
}

.resume-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  column-gap: 40px;
  row-gap: 30px;
  border-top: 2px solid #26352b;
  padding-top: 34px;
}

.resume-block {
  border-top: 2px solid var(--brand);
  padding-top: 15px;
  min-height: 150px;
}

.resume-block h2 {
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin: 0 0 16px;
  font-family: "Noto Serif SC", "Source Han Serif SC", serif;
  font-size: 20px;
}

.resume-block h2 b {
  color: var(--coral);
  font-size: 23px;
}

.resume-block p,
.resume-block li {
  color: #4d5d51;
  font-size: 14px;
  line-height: 1.75;
}

.resume-block ul {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 12px;
}

.resume-block li {
  display: grid;
  grid-template-columns: 62px 1fr;
  gap: 12px;
}

.resume-block li time {
  color: var(--brand);
  font-weight: 800;
}

.resume-message {
  color: var(--brand) !important;
  font-family: "STKaiti", "KaiTi", serif;
  font-size: 20px !important;
}

.loading {
  padding: 80px 20px;
  text-align: center;
  color: var(--muted);
}

.error-page {
  max-width: 620px;
  margin: 10vh auto;
  text-align: center;
}

.error-page h1 {
  font-family: "Noto Serif SC", "Source Han Serif SC", serif;
}

@media (max-width: 820px) {
  .app-shell {
    width: min(100% - 20px, 680px);
    padding-top: 16px;
  }

  .topbar,
  .section-title {
    align-items: flex-start;
    flex-direction: column;
  }

  .topbar-actions {
    width: 100%;
    justify-content: flex-start;
  }

  .panel {
    padding: 18px;
  }

  .form-layout,
  .form-grid,
  .profile-row {
    grid-template-columns: 1fr;
  }

  .photo-panel {
    position: static;
  }

  .photo-preview {
    max-width: 240px;
  }

  .profile-row-actions {
    justify-content: flex-start;
  }

  .resume-top,
  .resume-hero,
  .resume-grid {
    grid-template-columns: 1fr;
  }

  .resume-top {
    padding: 24px 22px 18px;
  }

  .resume-logo {
    width: 165px;
    height: 78px;
  }

  .resume-title {
    text-align: left;
    font-size: 24px;
  }

  .resume-hero {
    padding: 26px 22px;
    gap: 28px;
  }

  .resume-photo-frame {
    max-width: 300px;
  }

  .resume-name {
    font-size: 42px;
  }

  .resume-body {
    padding: 0 22px 36px;
  }

  .resume-grid {
    row-gap: 26px;
  }
}
