:root {
  --background: #070b12;
  --surface: #0d1420;
  --surface-raised: #121c2a;
  --surface-soft: #172232;
  --border: #263448;
  --text: #f3f6fb;
  --muted: #9eabbd;
  --accent: #f3b53f;
  --accent-dark: #2a1d08;
  --danger: #ff8d98;
}

* { box-sizing: border-box; }
html { color-scheme: dark; }
body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  color: var(--text);
  background: radial-gradient(circle at 50% -15%, rgba(55, 82, 125, .26), transparent 34rem), var(--background);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
button, input { font: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }

.share-gate, .share-page {
  min-height: 100vh;
  padding: 24px;
}
.share-gate { display: grid; place-items: center; }
.gate-card, .blueprint-panel {
  border: 1px solid var(--border);
  border-radius: 24px;
  background: linear-gradient(180deg, rgba(18, 28, 42, .98), rgba(10, 16, 26, .98));
  box-shadow: 0 30px 90px rgba(0, 0, 0, .42);
}
.gate-card { width: min(100%, 520px); padding: clamp(28px, 6vw, 48px); }
.gate-top, .share-header { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.brand { display: inline-flex; align-items: center; gap: 12px; font-weight: 850; }
.brand-mark { width: 18px; height: 18px; border: 2px solid var(--accent); border-radius: 4px; box-shadow: 6px 6px 0 -2px var(--background), 6px 6px 0 0 var(--accent); }
.eyebrow { margin: 30px 0 8px; color: var(--accent); font-size: .72rem; font-weight: 800; letter-spacing: .16em; text-transform: uppercase; }
h1, p { margin-top: 0; }
.gate-card h1 { margin-bottom: 14px; font-size: clamp(2.15rem, 7vw, 3.6rem); line-height: .98; letter-spacing: -.055em; }
.muted { color: var(--muted); line-height: 1.65; }
form { margin-top: 28px; }
label { display: block; margin-bottom: 9px; font-weight: 750; font-size: .9rem; }
.password-row { display: flex; gap: 10px; }
input {
  min-width: 0;
  border: 1px solid var(--border);
  border-radius: 11px;
  outline: none;
  color: var(--text);
  background: #070c14;
}
.password-row input { flex: 1; padding: 12px 13px; }
input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(243, 181, 63, .12); }
.primary-button, .secondary-button {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  border-radius: 11px;
  padding: 12px 17px;
  text-decoration: none;
  font-weight: 800;
}
.primary-button { border: 1px solid #ffd370; color: var(--accent-dark); background: var(--accent); }
.secondary-button { border: 1px solid var(--border); color: var(--text); background: var(--surface-soft); }
.small-button { padding: 8px 11px; font-size: .8rem; }
.form-message { min-height: 22px; margin: 10px 0 0; color: var(--danger); font-size: .88rem; }
.gate-note { margin: 18px 0 0; color: #748197; font-size: .78rem; }

.share-page { width: min(100%, 1040px); margin: 0 auto; }
.share-header { min-height: 74px; border-bottom: 1px solid rgba(38, 52, 72, .72); }
.header-actions { display: flex; gap: 8px; }
.blueprint-panel { overflow: hidden; margin: clamp(36px, 8vw, 82px) 0; }
.blueprint-layout { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(300px, .9fr); }
.preview-wrap { min-height: 460px; display: grid; place-items: center; padding: 28px; background: #080e17; }
.preview-wrap img { width: 100%; height: 100%; max-height: 580px; object-fit: contain; border-radius: 15px; }
.blueprint-copy { display: flex; flex-direction: column; justify-content: center; padding: clamp(28px, 6vw, 58px); }
.blueprint-copy .eyebrow { margin-top: 0; }
.blueprint-copy h1 { margin-bottom: 7px; font-size: clamp(2.4rem, 6vw, 5rem); line-height: .94; letter-spacing: -.06em; }
.zh-title { margin-bottom: 22px; color: #c9d2df; font-size: 1.14rem; }
.description { max-width: 42ch; color: var(--muted); line-height: 1.7; }
.meta { display: flex; flex-wrap: wrap; gap: 9px; margin: 20px 0 26px; }
.meta span { padding: 7px 10px; border: 1px solid var(--border); border-radius: 999px; color: #c2ccda; background: rgba(13,20,32,.76); font-size: .78rem; }
.actions { display: grid; gap: 10px; }
.private-note { margin: 20px 0 0; color: #748197; font-size: .78rem; line-height: 1.5; }

.viewer-page { height: 100vh; display: grid; grid-template-rows: auto minmax(0, 1fr); overflow: hidden; }
.viewer-toolbar { display: flex; align-items: center; gap: 14px; min-height: 66px; padding: 10px 16px; border-bottom: 1px solid var(--border); background: rgba(7,11,18,.97); }
.viewer-toolbar strong { flex: 1; text-align: center; }
.viewer-toolbar .secondary-button { padding: 9px 12px; font-size: .82rem; }
.viewer-frame { width: 100%; height: 100%; border: 0; background: #fff; }

@media (max-width: 760px) {
  .share-gate, .share-page { padding: 14px; }
  .blueprint-layout { grid-template-columns: 1fr; }
  .preview-wrap { min-height: 290px; padding: 16px; }
  .blueprint-copy { padding: 28px 22px 30px; }
  .password-row { display: grid; }
  .share-header .brand span:last-child { display: none; }
  .viewer-toolbar { min-height: 58px; padding: 8px; gap: 8px; }
  .viewer-toolbar strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .88rem; }
}
