:root {
  --paper: #f7efe3;
  --paper-deep: #efe2d0;
  --ink: #282826;
  --muted: #736d65;
  --line: #d8cbb7;
  --dark: #292a28;
  --dark-soft: #383936;
  --white: #fffaf2;
  --teal: #58b7b0;
  --blue: #8db9d6;
  --coral: #ea986c;
  --yellow: #ead08a;
  --shadow: 0 24px 70px rgba(38, 33, 26, 0.16);
  --radius: 8px;
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif;
  color: var(--ink);
  background: var(--paper);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 320px;
  background:
    linear-gradient(rgba(255, 250, 242, 0.64), rgba(255, 250, 242, 0.64)),
    repeating-linear-gradient(0deg, rgba(120, 98, 72, 0.03) 0, rgba(120, 98, 72, 0.03) 1px, transparent 1px, transparent 10px),
    var(--paper);
}

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

button,
input,
select {
  font: inherit;
}

img {
  display: block;
  max-width: 100%;
}

.brand-mark {
  color: var(--ink);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 34px;
  font-weight: 700;
  letter-spacing: 0;
  line-height: 1;
  white-space: nowrap;
}

.simple-topbar,
.site-header,
.viewer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  width: min(1180px, calc(100% - 40px));
  min-height: 76px;
  margin: 0 auto;
  border-bottom: 1px solid var(--line);
}

.simple-topbar nav,
.site-nav {
  display: flex;
  align-items: center;
  gap: clamp(14px, 3vw, 40px);
  color: #615c54;
  font-size: 14px;
  font-weight: 650;
}

.site-nav a,
.simple-topbar span {
  white-space: nowrap;
}

.button,
.text-button {
  min-height: 42px;
  border: 1px solid transparent;
  border-radius: 8px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-weight: 750;
  line-height: 1;
  transition:
    transform 160ms ease,
    border-color 160ms ease,
    background 160ms ease;
}

.button:hover,
.text-button:hover {
  transform: translateY(-1px);
}

.button.primary {
  background: var(--ink);
  color: var(--white);
  padding: 0 22px;
}

.button.secondary,
.button.small {
  background: rgba(255, 250, 242, 0.72);
  border-color: var(--line);
  color: var(--ink);
  padding: 0 18px;
}

.button.small {
  min-height: 36px;
  padding: 0 14px;
}

.button.full-width {
  width: 100%;
}

.text-button {
  background: transparent;
  color: var(--muted);
  padding: 0 4px;
}

.launch-screen {
  min-height: 100svh;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 20px;
  text-align: center;
  padding: 32px;
}

.launch-screen h1 {
  margin: 0;
  font-family: "Songti SC", SimSun, serif;
  font-size: clamp(46px, 8vw, 96px);
  font-weight: 500;
}

.launch-screen p {
  margin: 0;
  color: var(--muted);
}

.login-shell {
  width: min(1120px, calc(100% - 40px));
  min-height: calc(100svh - 76px);
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(340px, 430px);
  align-items: center;
  gap: clamp(32px, 6vw, 76px);
  padding: 52px 0 72px;
}

.kicker,
.eyebrow {
  margin: 0;
  color: #5f5a52;
  font-size: 14px;
  font-weight: 800;
}

.login-intro h1,
.hero-section h1 {
  margin: 28px 0 24px;
  max-width: 920px;
  font-family: "Songti SC", SimSun, serif;
  font-size: clamp(54px, 8vw, 104px);
  font-weight: 500;
  line-height: 1.05;
  letter-spacing: 0;
}

.hero-copy {
  max-width: 680px;
  margin: 0;
  color: #59534d;
  font-size: 17px;
  font-weight: 650;
  line-height: 1.9;
}

.login-notes {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 44px;
}

.login-notes span,
.tag-row span,
.chip {
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 250, 242, 0.72);
  color: #4f4942;
  font-size: 13px;
  font-weight: 750;
}

.login-notes span {
  padding: 10px 16px;
}

.login-panel {
  position: relative;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 250, 242, 0.86);
  box-shadow: var(--shadow);
  padding: 34px;
}

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

.login-panel p {
  margin: 0 0 24px;
  color: var(--muted);
  line-height: 1.7;
}

.tape-note,
.paper-sticker {
  border: 1px solid rgba(156, 123, 70, 0.22);
  background: var(--yellow);
  color: #3d362b;
  box-shadow: 0 10px 24px rgba(66, 52, 27, 0.14);
}

.tape-note {
  position: absolute;
  top: -18px;
  right: 30px;
  padding: 10px 16px;
  transform: rotate(4deg);
  font-size: 13px;
  font-weight: 850;
}

form {
  display: grid;
  gap: 18px;
}

label {
  display: grid;
  gap: 8px;
  color: #4d4841;
  font-size: 14px;
  font-weight: 800;
}

input,
select {
  width: 100%;
  min-height: 44px;
  border: 1px solid #cfbfaa;
  border-radius: 8px;
  background: #fffaf2;
  color: var(--ink);
  padding: 0 14px;
  outline: none;
}

input:focus,
select:focus {
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(88, 183, 176, 0.18);
}

.form-error {
  min-height: 22px;
  margin: 0;
  color: #b34732;
  font-weight: 750;
}

.security-note {
  margin-top: 22px;
  margin-bottom: 0;
  font-size: 13px;
}

.hero-section {
  position: relative;
  width: min(1180px, calc(100% - 40px));
  min-height: 560px;
  margin: 0 auto;
  display: grid;
  place-items: center;
  align-content: center;
  text-align: center;
  padding: 60px 0 72px;
}

.hero-section .hero-copy {
  margin: 0 auto;
}

.hero-section h1 {
  max-width: 1120px;
  font-size: clamp(52px, 7vw, 92px);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 14px;
  margin-top: 36px;
}

.paper-sticker {
  position: absolute;
  display: grid;
  gap: 4px;
  width: 138px;
  min-height: 96px;
  place-content: center;
  padding: 14px;
  text-align: left;
  transform: rotate(-8deg);
}

.paper-sticker span {
  color: #746344;
  font-size: 12px;
  font-weight: 800;
}

.paper-sticker strong {
  font-size: 16px;
}

.sticker-left {
  top: 96px;
  left: 7%;
}

.sticker-right {
  right: -1%;
  top: 120px;
  background: #d8eef1;
  transform: rotate(8deg);
}

.hand-note {
  position: absolute;
  left: 10%;
  bottom: 130px;
  color: #6f7370;
  font-family: "Segoe Print", "Comic Sans MS", cursive;
  font-size: 34px;
  transform: rotate(-8deg);
}

.dark-band {
  display: grid;
  grid-template-columns: minmax(280px, 0.88fr) minmax(0, 1.12fr);
  gap: clamp(30px, 6vw, 72px);
  align-items: center;
  width: 100%;
  margin: 0 auto;
  padding: clamp(54px, 8vw, 86px) max(20px, calc((100vw - 1180px) / 2));
  background: var(--dark);
  color: var(--white);
}

.dark-media {
  justify-self: center;
  width: min(420px, 100%);
}

.dark-media img {
  border-radius: var(--radius);
  border: 8px solid rgba(255, 250, 242, 0.12);
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.28);
}

.dark-copy .eyebrow {
  color: #d0c4b5;
}

.dark-copy h2,
.section-heading h2 {
  margin: 14px 0 18px;
  font-family: "Songti SC", SimSun, serif;
  font-size: clamp(34px, 4.8vw, 60px);
  font-weight: 500;
  letter-spacing: 0;
}

.dark-copy p {
  max-width: 680px;
  margin: 0;
  color: #ddd2c3;
  font-size: 16px;
  line-height: 1.9;
}

.metric-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-top: 34px;
}

.metric-strip div {
  border: 1px solid rgba(255, 250, 242, 0.16);
  border-radius: var(--radius);
  background: rgba(255, 250, 242, 0.08);
  padding: 18px;
}

.metric-strip strong {
  display: block;
  color: var(--yellow);
  font-size: 34px;
}

.metric-strip span {
  color: #cfc5b8;
  font-size: 13px;
  font-weight: 750;
}

.prototype-tools,
.timeline-section {
  width: min(1180px, calc(100% - 40px));
  margin: 0 auto;
  padding: 76px 0 0;
}

.section-heading {
  text-align: center;
}

.section-heading .eyebrow {
  color: var(--muted);
}

.toolbar {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) minmax(180px, 240px) minmax(180px, 240px);
  gap: 14px;
  align-items: end;
  margin-top: 30px;
}

.chip-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin: 28px 0;
}

.chip {
  min-height: 36px;
  padding: 0 14px;
  cursor: pointer;
}

.chip.active {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--white);
}

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

.prototype-card {
  display: grid;
  grid-template-rows: auto auto 1fr auto auto;
  min-height: 286px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 250, 242, 0.82);
  padding: 22px;
  box-shadow: 0 12px 34px rgba(38, 33, 26, 0.08);
}

.card-topline,
.card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.card-topline span,
.card-footer time {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.card-topline strong {
  color: #3b766f;
  font-size: 13px;
}

.prototype-card h3 {
  margin: 22px 0 12px;
  font-size: 22px;
}

.prototype-card p {
  margin: 0;
  color: #686159;
  line-height: 1.7;
}

.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 18px;
}

.tag-row span {
  padding: 7px 10px;
}

.card-footer {
  margin-top: 22px;
}

.empty-state {
  margin: 30px 0 0;
  text-align: center;
  color: var(--muted);
  font-weight: 750;
}

.timeline-section {
  padding-bottom: 90px;
}

.timeline-list {
  display: grid;
  gap: 14px;
  margin-top: 34px;
}

.timeline-group {
  display: grid;
  grid-template-columns: 190px minmax(0, 1fr);
  gap: 24px;
  border-top: 1px solid var(--line);
  padding: 22px 0;
}

.timeline-group > div {
  display: grid;
  gap: 8px;
}

.timeline-group > div span {
  color: var(--muted);
  font-weight: 800;
}

.timeline-group > div strong {
  font-size: 22px;
}

.timeline-group ul {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.timeline-group li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 250, 242, 0.66);
  padding: 13px 14px;
}

.timeline-group a {
  font-weight: 850;
}

.timeline-group li span {
  color: var(--muted);
  font-size: 13px;
  white-space: nowrap;
}

.viewer-page {
  min-height: 100svh;
  overflow: hidden;
}

.viewer-header {
  width: 100%;
  min-height: 78px;
  padding: 0 18px;
  border-color: var(--line);
  background: rgba(247, 239, 227, 0.96);
}

.viewer-title {
  flex: 1;
  min-width: 0;
}

.viewer-title span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.viewer-title h1 {
  margin: 4px 0 0;
  overflow: hidden;
  font-size: 20px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.viewer-actions {
  display: flex;
  gap: 10px;
}

.viewer-shell {
  display: grid;
  grid-template-columns: 310px minmax(0, 1fr);
  height: calc(100svh - 78px);
}

.prototype-sidebar {
  overflow: auto;
  border-right: 1px solid var(--line);
  background: #f1e6d6;
  padding: 18px;
}

.sidebar-search {
  position: sticky;
  top: 0;
  z-index: 2;
  background: #f1e6d6;
  padding-bottom: 14px;
}

.sidebar-list {
  display: grid;
  gap: 10px;
}

.sidebar-item {
  display: grid;
  gap: 7px;
  width: 100%;
  min-height: 70px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 250, 242, 0.74);
  color: var(--ink);
  cursor: pointer;
  padding: 12px;
  text-align: left;
}

.sidebar-item.active {
  border-color: var(--ink);
  background: var(--ink);
  color: var(--white);
}

.sidebar-item span {
  font-weight: 850;
}

.sidebar-item small {
  color: inherit;
  opacity: 0.7;
}

.frame-stage {
  display: grid;
  grid-template-rows: 44px minmax(0, 1fr);
  min-width: 0;
  background: #e7dece;
}

.frame-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border-bottom: 1px solid var(--line);
  color: #5c554c;
  font-size: 13px;
  font-weight: 750;
  padding: 0 16px;
}

.frame-meta span:first-child {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.frame-meta span:last-child {
  border-radius: 999px;
  background: rgba(88, 183, 176, 0.2);
  color: #275f58;
  padding: 6px 10px;
  white-space: nowrap;
}

iframe {
  width: 100%;
  height: 100%;
  border: 0;
  background: white;
}

@media (max-width: 980px) {
  .login-shell,
  .dark-band,
  .viewer-shell {
    grid-template-columns: 1fr;
  }

  .login-shell {
    align-items: start;
    min-height: auto;
  }

  .simple-topbar nav {
    display: none;
  }

  .site-header {
    flex-wrap: wrap;
    padding: 14px 0;
  }

  .hero-section {
    min-height: 520px;
  }

  .paper-sticker,
  .hand-note {
    display: none;
  }

  .toolbar,
  .prototype-grid,
  .timeline-group ul {
    grid-template-columns: 1fr;
  }

  .timeline-group {
    grid-template-columns: 1fr;
  }

  .viewer-page {
    overflow: auto;
  }

  .viewer-header {
    align-items: flex-start;
    flex-wrap: wrap;
    height: auto;
    padding: 14px 18px;
  }

  .viewer-actions {
    width: 100%;
  }

  .viewer-actions .button {
    flex: 1;
  }

  .viewer-shell {
    height: auto;
  }

  .prototype-sidebar {
    max-height: 280px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .frame-stage {
    height: 72svh;
  }
}

@media (max-width: 640px) {
  .site-nav {
    width: 100%;
    justify-content: space-between;
    gap: 10px;
    order: 3;
  }

  .site-nav a {
    font-size: 12px;
  }

  .login-intro h1,
  .hero-section h1 {
    font-size: 48px;
  }

  .hero-section {
    min-height: 480px;
    padding-top: 42px;
  }

  .dark-band {
    padding-top: 44px;
    padding-bottom: 50px;
  }

  .metric-strip {
    grid-template-columns: 1fr;
  }

  .prototype-tools,
  .timeline-section {
    width: min(100% - 28px, 1180px);
    padding-top: 56px;
  }

  .prototype-card {
    min-height: auto;
  }

  .timeline-group li {
    align-items: flex-start;
    flex-direction: column;
  }
}
