:root {
  --paper: #fbf7ec;
  --paper-deep: #f5ead0;
  --surface: #fffefa;
  --ink: #050505;
  --muted: #4f4b43;
  --accent: #f5ad22;
  --accent-soft: #f8d98f;
  --line: #171717;
  --border: #efa51f;
  --danger: #d73f2f;
  --success: #25874d;
  --shadow: 0 18px 45px rgba(71, 53, 24, 0.12);
  --display: "Arial Black", Impact, "Microsoft YaHei", sans-serif;
  --text: "Microsoft YaHei", "PingFang SC", "Noto Sans CJK SC", Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 320px;
  overflow-x: hidden;
  color: var(--ink);
  font-family: var(--text);
  letter-spacing: 0;
  background:
    radial-gradient(circle at 15% 5%, rgba(245, 173, 34, 0.1), transparent 22rem),
    linear-gradient(180deg, var(--paper), #fffaf0 60%, var(--paper));
}

button,
input,
textarea {
  font: inherit;
  letter-spacing: 0;
}

a {
  color: inherit;
  text-decoration: none;
}

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

.brand-rail {
  display: grid;
  grid-template-columns: auto auto minmax(180px, 1fr) auto auto;
  align-items: center;
  gap: 18px;
  margin-bottom: 34px;
}

.year-badge {
  grid-column: 1;
  grid-row: 1;
  display: inline-flex;
  align-items: center;
  min-height: 58px;
  padding: 0 16px;
  color: #fff;
  background: var(--accent);
  font-family: var(--display);
  font-size: 2.65rem;
  line-height: 1;
}

.script-name {
  grid-column: 2;
  grid-row: 1;
  color: var(--accent);
  font-family: var(--display);
  font-size: 2.2rem;
  line-height: 1;
}

.rail-line {
  grid-column: 3;
  grid-row: 1;
  height: 12px;
  border-radius: 999px;
  background: var(--ink);
}

.rail-dots {
  grid-column: 4;
  grid-row: 1;
  display: inline-flex;
  gap: 22px;
}

.rail-dots i,
.side-dots span {
  display: block;
  width: 15px;
  height: 15px;
  border-radius: 50%;
  background: var(--ink);
}

.rail-label {
  grid-column: 5;
  grid-row: 1;
  justify-self: end;
  color: var(--accent);
  font-family: var(--display);
  font-size: 2.15rem;
  line-height: 1;
}

.top-nav {
  grid-column: 1 / -1;
  grid-row: 2;
  display: flex;
  flex-wrap: wrap;
  gap: 16px 34px;
  align-items: center;
  padding-left: 16px;
  font-size: 0.96rem;
  font-weight: 700;
}

.top-nav a {
  position: relative;
  padding-bottom: 8px;
}

.top-nav a:hover::after,
.top-nav a:focus-visible::after {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  height: 3px;
  content: "";
  background: var(--accent);
}

.hero-section {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 0.96fr) minmax(300px, 0.78fr) 34px;
  gap: 42px;
  align-items: start;
  min-height: 520px;
  margin-bottom: 28px;
}

.side-dots {
  position: absolute;
  top: 46%;
  left: -16px;
  display: grid;
  gap: 12px;
}

.side-dots span {
  width: 10px;
  height: 10px;
  border: 3px solid var(--accent);
  background: transparent;
}

.hero-copy {
  min-width: 0;
  padding-left: 42px;
  padding-top: 42px;
}

.hero-year {
  margin: 0 0 2px;
  color: var(--accent);
  font-family: var(--display);
  font-size: 5.7rem;
  line-height: 0.95;
}

.hero-copy h1 {
  max-width: 620px;
  margin: 0 0 46px;
  color: var(--accent);
  font-family: var(--display);
  font-size: 4.85rem;
  line-height: 0.9;
}

.identity-line {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin-bottom: 14px;
}

.identity-line strong,
.identity-line span {
  display: inline-block;
  color: #fff;
  background: var(--ink);
  font-family: var(--display);
  font-size: 2.7rem;
  line-height: 1.05;
  padding: 0 8px 4px;
}

.identity-line strong {
  color: var(--ink);
  background: transparent;
  padding-left: 0;
}

.role-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0 8px;
  align-items: center;
  max-width: 100%;
  margin: 0 0 24px;
  font-size: 1.35rem;
  font-weight: 800;
  overflow-wrap: anywhere;
}

.role-tags span,
.role-tags b {
  display: inline-block;
}

.hero-summary {
  max-width: 560px;
  margin: 0;
  padding-left: 16px;
  border-left: 10px solid var(--accent);
  color: var(--muted);
  font-size: 1.02rem;
  line-height: 1.72;
  font-weight: 700;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.hero-media {
  position: relative;
  align-self: start;
  height: 520px;
  min-height: 0;
}

.hero-media::before {
  position: absolute;
  inset: 34px -18px -24px 22px;
  z-index: 0;
  content: "";
  border-radius: 8px;
  background: var(--accent);
  transform: rotate(-3deg);
}

.hero-media img {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 100%;
  min-height: 0;
  object-fit: cover;
  border: 1px solid var(--ink);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.vertical-note {
  margin: 0;
  writing-mode: vertical-rl;
  color: var(--accent);
  font-size: 1.05rem;
  font-weight: 700;
  line-height: 1.5;
}

.section-stack {
  display: grid;
  gap: 42px;
}

.content-panel {
  position: relative;
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 34px;
  align-items: start;
  padding: 56px 64px;
  border: 2px solid var(--border);
  border-radius: 70px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.content-panel::before {
  position: absolute;
  inset: 18px -28px -18px -34px;
  z-index: -1;
  content: "";
  border: 2px solid var(--border);
  border-radius: 58px;
  background: rgba(245, 173, 34, 0.35);
  transform: rotate(1.5deg);
}

.panel-heading span {
  display: block;
  color: var(--accent);
  font-family: var(--display);
  font-size: 3.2rem;
  line-height: 1;
}

.panel-heading h2 {
  margin: 8px 0 0;
  font-family: var(--display);
  font-size: 2.05rem;
  line-height: 1.05;
}

.panel-body {
  min-width: 0;
}

.summary-copy {
  display: grid;
  gap: 14px;
}

.summary-copy p {
  margin: 0;
  font-size: 1.05rem;
  line-height: 1.85;
  font-weight: 700;
}

.timeline {
  position: relative;
  display: grid;
  gap: 30px;
  padding-left: 28px;
  border-left: 1px solid #cfc4ad;
}

.timeline-item {
  position: relative;
}

.timeline-item::before {
  position: absolute;
  top: 2px;
  left: -37px;
  width: 14px;
  height: 14px;
  content: "";
  border: 3px solid var(--accent);
  border-radius: 50%;
  background: var(--surface);
}

.item-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  align-items: center;
  margin-bottom: 10px;
  font-size: 0.98rem;
  font-weight: 900;
}

.item-meta span,
.item-meta strong {
  padding-right: 18px;
  border-right: 2px solid var(--ink);
}

.item-meta span:last-child,
.item-meta strong:last-child {
  padding-right: 0;
  border-right: 0;
}

.timeline ul {
  margin: 0;
  padding-left: 19px;
}

.timeline li {
  margin-bottom: 6px;
  color: var(--muted);
  line-height: 1.75;
  font-weight: 650;
}

.skills-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 26px;
}

.skill-group h3 {
  display: inline-block;
  min-width: 112px;
  margin: 0 0 18px;
  padding: 6px 16px;
  border-radius: 6px;
  background: var(--accent);
  font-size: 1rem;
  text-align: center;
}

.skill-row {
  display: grid;
  grid-template-columns: minmax(88px, 1fr) 108px;
  gap: 10px;
  align-items: center;
  margin-bottom: 15px;
  font-size: 0.92rem;
  font-weight: 700;
}

.skill-track {
  height: 7px;
  overflow: hidden;
  border-radius: 999px;
  background: #dedbd5;
}

.skill-track i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--accent);
}

.footer-block {
  margin-top: 42px;
}

.contact-strip {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) auto auto;
  gap: 36px;
  align-items: center;
  padding: 14px 26px;
  border-top: 12px solid #d6d6d6;
  border-radius: 7px;
  color: #fff;
  background: #000;
  font-family: "Courier New", monospace;
  font-size: 1.18rem;
  font-weight: 800;
}

.contact-strip strong {
  font-size: 1.55rem;
}

.copyright {
  margin: 16px 0 0;
  color: #777064;
  text-align: center;
  font-size: 0.9rem;
}

.admin-body {
  background:
    radial-gradient(circle at 80% 20%, rgba(245, 173, 34, 0.12), transparent 22rem),
    linear-gradient(180deg, var(--paper), #fffaf1);
}

.admin-brand {
  grid-template-columns: auto auto minmax(180px, 1fr) auto auto;
}

.admin-layout {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr) 330px;
  gap: 28px;
  align-items: start;
}

.admin-sidebar {
  position: sticky;
  top: 24px;
}

.admin-sidebar h1 {
  margin: 0 0 20px;
  font-family: var(--display);
  font-size: 2.35rem;
  line-height: 1;
}

.back-home,
.admin-sidebar nav a,
.admin-actions button,
.add-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: transparent;
  font-weight: 800;
  cursor: pointer;
}

.back-home {
  width: 100%;
  margin-bottom: 28px;
}

.admin-sidebar nav {
  display: grid;
  gap: 12px;
}

.admin-sidebar nav a {
  justify-content: flex-start;
  gap: 14px;
  min-height: 48px;
  padding: 0 14px;
  background: rgba(255, 255, 255, 0.6);
}

.admin-sidebar nav a:hover,
.admin-sidebar nav a:focus-visible {
  background: var(--accent);
}

.admin-sidebar nav strong {
  font-family: var(--display);
  font-size: 1.3rem;
}

.admin-hint {
  margin: 64px 0 0;
  padding-left: 18px;
  border-left: 8px dotted var(--accent);
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.7;
  font-weight: 700;
  overflow-wrap: anywhere;
}

.admin-panel {
  position: relative;
  padding: 36px 48px 40px;
  border: 2px solid var(--border);
  border-radius: 66px;
  background: rgba(255, 254, 250, 0.96);
  box-shadow: var(--shadow);
}

.admin-panel::before {
  position: absolute;
  inset: 18px -24px -16px -28px;
  z-index: -1;
  content: "";
  border: 2px solid var(--border);
  border-radius: 56px;
  background: rgba(245, 173, 34, 0.3);
  transform: rotate(-1.6deg);
}

.admin-section {
  padding: 0 0 26px;
  margin-bottom: 24px;
  border-bottom: 1px dashed #cfc4ad;
}

.admin-section h2 {
  display: flex;
  gap: 14px;
  align-items: baseline;
  margin: 0 0 18px;
  font-size: 1.28rem;
}

.admin-section h2 span {
  font-family: var(--display);
  font-size: 1.75rem;
}

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

.field,
.inline-field {
  display: grid;
  gap: 7px;
  color: var(--ink);
  font-size: 0.92rem;
  font-weight: 800;
}

.full-field {
  margin-top: 12px;
}

.field input,
.field textarea,
.inline-field input,
.skill-edit-row input[type="text"] {
  width: 100%;
  border: 1px solid #cfc8ba;
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
  font-size: 0.95rem;
  line-height: 1.45;
}

.field input,
.inline-field input,
.skill-edit-row input[type="text"] {
  min-height: 38px;
  padding: 8px 10px;
}

.field textarea {
  min-height: 118px;
  padding: 10px 12px;
  resize: vertical;
}

.entry-list,
.skill-edit-list {
  display: grid;
  gap: 14px;
}

.entry-editor {
  padding: 14px;
  border: 1px solid #ead8ae;
  border-radius: 8px;
  background: rgba(255, 250, 239, 0.7);
}

.entry-header {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.entry-header strong {
  font-family: var(--display);
}

.entry-header button,
.skill-edit-row button {
  min-height: 32px;
  padding: 0 10px;
  border: 1px solid rgba(215, 63, 47, 0.35);
  border-radius: 6px;
  color: var(--danger);
  background: #fff;
  font-size: 0.85rem;
  font-weight: 800;
  cursor: pointer;
}

.add-button {
  min-height: 36px;
  margin-top: 12px;
  padding: 0 18px;
  color: var(--accent);
  background: #fff;
}

.add-button.compact {
  min-height: 32px;
  margin-top: 8px;
  font-size: 0.88rem;
}

.skill-editor .entry-header {
  align-items: end;
}

.skill-editor .inline-field {
  width: min(340px, 100%);
}

.skill-edit-row {
  display: grid;
  grid-template-columns: minmax(120px, 1fr) minmax(220px, 1.2fr) auto;
  gap: 12px;
  align-items: center;
  margin-bottom: 10px;
}

.skill-edit-row label {
  display: grid;
  grid-template-columns: auto minmax(110px, 1fr) 52px;
  gap: 10px;
  align-items: center;
  font-size: 0.86rem;
  font-weight: 800;
}

.skill-edit-row input[type="range"] {
  accent-color: var(--accent);
}

.admin-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  padding-top: 2px;
}

.password-field {
  display: grid;
  gap: 6px;
  min-width: 180px;
  font-size: 0.86rem;
  font-weight: 800;
}

.password-field input {
  min-height: 40px;
  padding: 8px 10px;
  border: 1px solid #cfc8ba;
  border-radius: 6px;
  background: #fff;
}

.admin-actions button {
  min-width: 136px;
  padding: 0 20px;
  background: #fff;
}

.admin-actions .primary-action {
  color: #fff;
  background: var(--accent);
}

.save-status {
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  padding: 0 14px;
  border-radius: 6px;
  color: var(--success);
  background: rgba(37, 135, 77, 0.1);
  font-weight: 800;
}

.save-status.is-error {
  color: var(--danger);
  background: rgba(215, 63, 47, 0.1);
}

.preview-panel {
  position: sticky;
  top: 24px;
  padding: 24px;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: rgba(255, 254, 250, 0.84);
  box-shadow: var(--shadow);
}

.preview-panel h2 {
  margin: 0 0 18px;
  font-size: 1.1rem;
}

.mini-card {
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--paper);
}

.mini-rail {
  display: flex;
  gap: 7px;
  align-items: center;
  margin-bottom: 18px;
  font-family: var(--display);
  color: var(--accent);
}

.mini-rail strong {
  padding: 4px 7px;
  color: #fff;
  background: var(--accent);
}

.mini-body {
  display: grid;
  grid-template-columns: 1fr 112px;
  gap: 16px;
  align-items: center;
}

.mini-body p,
.mini-body h3 {
  margin: 0;
  color: var(--accent);
  font-family: var(--display);
  line-height: 1;
}

.mini-body p {
  font-size: 2rem;
}

.mini-body h3 {
  margin-bottom: 14px;
  font-size: 1.42rem;
}

.mini-body strong {
  display: inline-block;
  padding: 2px 6px 4px;
  color: #fff;
  background: var(--ink);
  font-family: var(--display);
}

.mini-body img {
  width: 112px;
  height: 146px;
  object-fit: cover;
  border: 1px solid var(--ink);
  border-radius: 6px;
}

.mini-card > p {
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.7;
  font-weight: 700;
}

.admin-strip {
  margin-top: 34px;
}

:focus-visible {
  outline: 3px solid rgba(245, 173, 34, 0.55);
  outline-offset: 3px;
}

@media (max-width: 1120px) {
  .hero-section {
    grid-template-columns: minmax(0, 1fr) 36%;
  }

  .vertical-note {
    display: none;
  }

  .content-panel {
    grid-template-columns: 180px minmax(0, 1fr);
    padding: 46px 44px;
  }

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

  .admin-layout {
    grid-template-columns: 190px minmax(0, 1fr);
  }

  .preview-panel {
    position: static;
    grid-column: 2;
  }
}

@media (max-width: 860px) {
  .site-shell,
  .admin-shell {
    width: min(100% - 28px, 720px);
    padding-top: 20px;
  }

  .brand-rail,
  .admin-brand {
    grid-template-columns: auto auto 1fr;
    gap: 12px;
  }

  .rail-label {
    grid-column: 1 / -1;
    grid-row: 3;
    justify-self: start;
  }

  .rail-dots {
    display: none;
  }

  .year-badge {
    min-height: 48px;
    font-size: 2rem;
  }

  .script-name,
  .rail-label {
    font-size: 1.7rem;
  }

  .hero-section {
    grid-template-columns: 1fr;
    gap: 28px;
    min-height: 0;
  }

  .hero-copy {
    padding-left: 0;
    padding-top: 0;
  }

  .hero-year {
    font-size: 4rem;
  }

  .hero-copy h1 {
    margin-bottom: 26px;
    font-size: 3.6rem;
  }

  .identity-line strong,
  .identity-line span {
    font-size: 2.05rem;
  }

  .hero-media,
  .hero-media img {
    min-height: 420px;
  }

  .content-panel {
    grid-template-columns: 1fr;
    gap: 22px;
    padding: 34px 26px;
    border-radius: 44px;
  }

  .content-panel::before {
    inset: 12px -12px -12px -14px;
    border-radius: 40px;
  }

  .admin-layout {
    grid-template-columns: 1fr;
  }

  .admin-sidebar,
  .preview-panel {
    position: static;
  }

  .admin-sidebar nav {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .admin-panel {
    padding: 30px 22px;
    border-radius: 38px;
  }

  .admin-panel::before {
    inset: 12px -10px -12px -12px;
    border-radius: 36px;
  }

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

  .contact-strip {
    grid-template-columns: 1fr;
    gap: 10px;
  }
}

@media (max-width: 620px) {
  .top-nav {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px 14px;
    padding-left: 0;
  }

  .top-nav a {
    white-space: nowrap;
  }

  .rail-label {
    font-size: 1.45rem;
  }

  .rail-line {
    display: none;
  }

  .hero-year {
    font-size: 3.1rem;
  }

  .hero-copy h1 {
    font-size: 2.75rem;
  }

  .role-tags {
    font-size: 1.05rem;
    word-break: break-all;
  }

  .hero-summary {
    max-width: 315px;
    word-break: break-all;
  }

  .panel-heading span {
    font-size: 2.55rem;
  }

  .panel-heading h2 {
    font-size: 1.8rem;
  }

  .item-meta {
    display: grid;
    gap: 6px;
  }

  .item-meta span,
  .item-meta strong {
    padding-right: 0;
    border-right: 0;
  }

  .skills-grid,
  .field-grid,
  .admin-sidebar nav,
  .skill-edit-row,
  .skill-edit-row label {
    grid-template-columns: 1fr;
  }

  .skill-row {
    grid-template-columns: 1fr;
  }

  .side-dots {
    display: none;
  }

  .admin-actions button,
  .password-field,
  .save-status {
    width: 100%;
  }

  .admin-hint {
    max-width: 315px;
    word-break: break-all;
  }
}
