:root {
  --paper: #f3eee6;
  --card: #ebe5dc;
  --ink: #15130f;
  --muted: #7f776c;
  --gold: #b88d4a;
  --line: rgba(21, 19, 15, .12);
  --black: #050504;
  --radius: 34px;
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", Arial, sans-serif;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; background: var(--paper); }
body { margin: 0; color: var(--ink); background: var(--paper); overflow-x: hidden; }
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
button, input, textarea { font: inherit; }

.topbar {
  position: fixed;
  inset: 0 0 auto;
  z-index: 20;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: max(16px, env(safe-area-inset-top)) 24px 12px;
  background: linear-gradient(to bottom, rgba(243,238,230,.92), rgba(243,238,230,0));
}
.brand { display: flex; align-items: center; gap: 10px; }
.brand-mark {
  width: 36px; height: 36px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--ink); color: #fff8eb; font-family: "Songti SC", serif; font-weight: 700;
}
.brand strong { display: block; font-size: 17px; line-height: 1; }
.brand small { display: block; margin-top: 4px; font-size: 10px; color: var(--muted); text-transform: uppercase; }
.nav { display: flex; gap: 18px; color: var(--muted); font-size: 13px; }

.hero { min-height: 100svh; display: grid; place-items: center; padding: 86px 20px 34px; }
.hero-card {
  position: relative;
  width: min(1160px, 100%);
  min-height: 720px;
  overflow: hidden;
  border-radius: var(--radius);
  background: linear-gradient(135deg, #f2eee8, #e8e1d7);
  box-shadow: 0 30px 90px rgba(38,31,21,.16);
}
.hero-card::before {
  content: "WANG";
  position: absolute;
  left: 54px;
  top: 210px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(120px, 20vw, 300px);
  color: rgba(21,19,15,.035);
  line-height: .8;
}
.hero-copy {
  position: relative;
  z-index: 2;
  width: 56%;
  padding: 112px 0 180px 72px;
  animation: rise .85s ease both;
}
.index { margin: 0 0 34px; font-weight: 800; }
.hero h1 {
  margin: 0;
  font-family: Georgia, "Songti SC", "STSong", serif;
  font-size: clamp(56px, 12vw, 128px);
  line-height: .95;
  letter-spacing: 0;
}
.subtitle { margin: 20px 0 0; max-width: 560px; color: var(--ink); font-size: 20px; line-height: 1.7; }
.identity { max-width: 560px; color: var(--muted); line-height: 1.85; }
.hero-actions, .contact-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 30px; }
.btn {
  min-height: 48px; padding: 12px 18px; border-radius: 999px;
  border: 1px solid var(--line); background: rgba(255,255,255,.54); color: var(--ink);
  display: inline-flex; align-items: center; justify-content: center;
}
.btn.primary { background: var(--black); color: #fff8eb; animation: breathe 2.8s ease-in-out infinite; }
.hero-portrait {
  position: absolute;
  right: 0; top: 0; bottom: 92px;
  width: 50%;
  display: flex; align-items: flex-end; justify-content: center;
  padding: 28px 34px 0 0;
  background:
    radial-gradient(circle at 62% 22%, rgba(184,141,74,.24), transparent 34%),
    linear-gradient(110deg, rgba(5,5,4,0), rgba(5,5,4,.1) 42%, rgba(5,5,4,.78));
}
.hero-picture {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}
.hero-portrait img {
  height: 100%;
  width: 100%;
  object-fit: contain;
  object-position: center bottom;
  filter: saturate(.96) contrast(1.02) drop-shadow(0 24px 50px rgba(0,0,0,.26));
  animation: portraitIn 1s ease both;
}
.hero-strip {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  min-height: 92px;
  display: grid;
  grid-template-columns: 1.2fr 1fr 1fr;
  align-items: center;
  gap: 18px;
  padding: 22px 72px;
  color: rgba(255,248,235,.78);
  background: rgba(0,0,0,.92);
  backdrop-filter: blur(12px);
}
.hero-strip strong { color: #fff8eb; }

.section { width: min(1080px, 100%); margin: 0 auto; padding: 78px 22px; }
.section-kicker, .section-head span, .contact-copy span {
  display: block; margin-bottom: 12px; color: var(--gold); font-size: 12px; font-weight: 800; text-transform: uppercase;
}
.profile-grid { display: grid; grid-template-columns: .72fr 1.1fr .72fr; gap: 34px; align-items: start; }
h2 {
  margin: 0;
  font-family: Georgia, "Songti SC", "STSong", serif;
  font-size: clamp(30px, 6vw, 56px);
  font-weight: 600;
  line-height: 1.1;
}
.profile-grid p, .contact-copy p { margin: 0; color: var(--muted); font-size: 18px; line-height: 2; }
.profile-photo {
  overflow: hidden;
  border-radius: 24px;
  border: 1px solid rgba(21,19,15,.1);
  background: #ded3c7;
  box-shadow: 0 22px 56px rgba(38,31,21,.14);
  opacity: 0;
  transform: translateY(20px);
  transition: .7s ease;
}
.profile-photo picture,
.contact-card picture { display: block; }
.profile-photo img {
  width: 100%;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  object-position: center top;
}
.section-head { margin-bottom: 28px; }

.position-list { display: grid; gap: 12px; }
.position-card {
  min-height: 72px; padding: 18px 22px; border-radius: 18px;
  background: rgba(255,255,255,.5); border: 1px solid var(--line);
  display: flex; align-items: center; justify-content: space-between; gap: 20px;
  opacity: 0; transform: translateY(20px); transition: .7s ease;
}
.position-card.visible, .direction-card.visible, .org-item.visible, .contact-card.visible, .profile-photo.visible { opacity: 1; transform: translateY(0); }
.position-card span { color: var(--gold); font-weight: 800; }

.warm {
  width: 100%;
  max-width: none;
  background: #e9dfd2;
}
.warm > * { width: min(1080px, 100%); margin-left: auto; margin-right: auto; }
.direction-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.direction-card {
  min-height: 190px; padding: 22px; border-radius: 22px;
  background: #f7f1e8; border: 1px solid rgba(21,19,15,.08);
  opacity: 0; transform: translateY(20px); transition: .7s ease;
}
.direction-card h3 { margin: 0 0 12px; font-size: 21px; }
.direction-card p { margin: 0; color: var(--muted); line-height: 1.75; }
.org-strip { display: flex; flex-wrap: wrap; gap: 12px; }
.org-item {
  padding: 15px 18px; border-radius: 999px; border: 1px solid var(--line);
  background: rgba(255,255,255,.48); opacity: 0; transform: translateY(18px); transition: .7s ease;
}

.contact-section {
  width: 100%; max-width: none;
  display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 28px;
  padding: 86px max(22px, calc((100vw - 1080px) / 2));
  background: var(--black); color: #fff8eb;
}
.contact-copy p { color: rgba(255,248,235,.7); }
.contact-card {
  padding: 24px; border-radius: 24px; background: rgba(255,255,255,.08);
  border: 1px solid rgba(255,255,255,.14); opacity: 0; transform: translateY(20px); transition: .7s ease;
}
.contact-card p { margin: 0 0 12px; padding-bottom: 12px; border-bottom: 1px solid rgba(255,255,255,.12); color: rgba(255,248,235,.75); line-height: 1.7; }
.contact-card strong { display: block; color: var(--gold); }
.contact-card img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 18px; margin-top: 16px; }
.footer { padding: 30px 20px calc(30px + env(safe-area-inset-bottom)); text-align: center; background: var(--black); color: rgba(255,248,235,.62); }
.footer p { margin: 0 0 8px; color: #fff8eb; }

.hidden-zone { position: fixed; right: 18px; bottom: calc(18px + env(safe-area-inset-bottom)); width: 56px; height: 56px; border: 0; background: transparent; z-index: 20; }

.admin-modal { position: fixed; inset: 0; z-index: 60; display: none; background: rgba(0,0,0,.65); padding: 16px; }
.admin-modal.open { display: grid; place-items: center; }
.admin-panel { width: min(940px,100%); max-height: 92vh; overflow: auto; border-radius: 20px; background: #fff8ed; position: relative; }
.admin-close { position: sticky; top: 10px; float: right; z-index: 3; margin: 10px; width: 38px; height: 38px; border: 0; border-radius: 50%; background: var(--black); color: #fff; font-size: 24px; }
.admin-login, .admin-editor { padding: 24px; }
.admin-login input, .admin-field input, .admin-field textarea { width: 100%; border: 1px solid var(--line); border-radius: 12px; padding: 12px; background: #fff; }
.admin-login button, .admin-tools button, .admin-savebar button { min-height: 42px; padding: 10px 14px; border-radius: 12px; border: 1px solid var(--line); background: var(--black); color: #fff; }
.admin-note { color: #9b2c1e; }
.admin-head { display: flex; justify-content: space-between; gap: 18px; align-items: start; }
#adminStatus { padding: 10px 12px; border-radius: 12px; background: rgba(184,141,74,.18); white-space: nowrap; }
#adminStatus.success { color: #1f7b48; background: rgba(31,123,72,.14); }
#adminForm { display: grid; gap: 16px; }
.admin-section { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 14px; padding: 18px; border: 1px solid var(--line); border-radius: 16px; background: #fffdf8; }
.admin-section h3 { grid-column: 1 / -1; margin: 0; padding-bottom: 10px; border-bottom: 1px solid var(--line); }
.admin-field.wide { grid-column: 1 / -1; }
.admin-field label { display: block; margin-bottom: 6px; font-weight: 700; }
.admin-field small { display: block; margin-top: 6px; color: var(--muted); font-size: 12px; line-height: 1.45; }
.admin-field textarea { min-height: 92px; resize: vertical; }
.admin-advanced { margin-top: 16px; padding: 12px; border: 1px solid var(--line); border-radius: 16px; }
.admin-tools { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.admin-tip { margin: 14px 0 70px; padding: 12px; border-radius: 12px; background: rgba(184,141,74,.16); color: var(--muted); }
.admin-savebar { position: sticky; bottom: 0; display: flex; justify-content: flex-end; gap: 10px; margin: 0 -24px -24px; padding: 14px 24px calc(14px + env(safe-area-inset-bottom)); background: rgba(255,248,237,.96); border-top: 1px solid var(--line); }
#cancelEdit { background: #fff; color: var(--ink); }
#saveEdit { background: var(--gold); color: var(--ink); font-weight: 800; }

@keyframes rise { from { opacity: 0; transform: translateY(24px); } to { opacity: 1; transform: translateY(0); } }
@keyframes portraitIn { from { opacity: 0; transform: translateX(24px) scale(1.02); } to { opacity: 1; transform: none; } }
@keyframes breathe { 50% { box-shadow: 0 0 28px rgba(184,141,74,.35); } }

@media (max-width: 820px) {
  .nav { display: none; }
  .hero { padding: 76px 12px 24px; }
  .hero-card { min-height: auto; border-radius: 28px; }
  .hero-copy { width: 100%; padding: 46px 26px 20px; }
  .hero-card::before { left: 18px; top: 120px; font-size: 140px; }
  .hero-portrait {
    position: relative;
    width: 100%;
    height: min(70svh, 520px);
    min-height: 430px;
    bottom: auto;
    padding: 18px 18px 0;
    background:
      radial-gradient(circle at 55% 12%, rgba(184,141,74,.24), transparent 34%),
      linear-gradient(180deg, rgba(5,5,4,.02), rgba(5,5,4,.86));
  }
  .hero-portrait img { object-fit: contain; object-position: center bottom; }
  .hero-strip { position: relative; grid-template-columns: 1fr; padding: 20px 26px; gap: 8px; }
  .subtitle { font-size: 17px; }
  .hero-actions, .contact-actions { display: grid; }
  .btn { width: 100%; }
  .profile-grid, .direction-grid, .contact-section { grid-template-columns: 1fr; }
  .profile-photo { order: -1; max-width: 360px; justify-self: center; }
  .section { padding: 62px 18px; }
  .contact-section { padding: 64px 18px; }
  .admin-modal { padding: 0; }
  .admin-panel { width: 100%; height: 100dvh; max-height: none; border-radius: 0; }
  .admin-login, .admin-editor { padding: 18px; }
  .admin-head { display: block; }
  #adminStatus { white-space: normal; }
  .admin-section { grid-template-columns: 1fr; padding: 15px; }
  .admin-savebar { margin: 0 -18px -18px; padding-left: 18px; padding-right: 18px; }
  .admin-savebar button { flex: 1; }
}

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