:root {
  color-scheme: light;
  --bg: #f4f5f7;
  --surface: #ffffff;
  --surface-soft: #f8f9fb;
  --ink: #171a20;
  --muted: #727987;
  --faint: #a4abba;
  --line: #e2e5ea;
  --line-strong: #d6dae2;
  --accent: #7f8694;
  --accent-strong: #6f7581;
  --danger: #d77b7b;
  --success: #3d8b61;
  --error: #b75a55;
  --shadow: 0 22px 70px rgba(44, 51, 63, 0.10);
  --font-sans: "Hiragino Sans GB", "PingFang SC", "Heiti SC", "Noto Sans CJK SC", "Microsoft YaHei", sans-serif;
  --font-mono: "SF Mono", "SFMono-Regular", "Cascadia Mono", "JetBrains Mono", Menlo, Consolas, monospace;
}

* {
  box-sizing: border-box;
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 16px;
  font-weight: 500;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  background:
    radial-gradient(circle at 12% 0%, rgba(210, 218, 255, 0.62), transparent 28rem),
    radial-gradient(circle at 84% 20%, rgba(255, 255, 255, 0.85), transparent 26rem),
    var(--bg);
}

button,
input,
textarea {
  font: inherit;
}

code {
  padding: 0.1rem 0.42rem;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #fff;
  color: #53606f;
  font-family: var(--font-mono);
  font-size: 0.9em;
  font-weight: 650;
}

.shell {
  width: min(1360px, calc(100% - 48px));
  margin: 0 auto;
  padding: 24px 0 44px;
}

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

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: inherit;
  text-decoration: none;
}

.brand-mark,
.theme-button {
  display: grid;
  width: 46px;
  height: 46px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.78);
  box-shadow: 0 12px 28px rgba(44, 51, 63, 0.06);
}

.brand-mark {
  color: var(--ink);
  font-size: 1.06rem;
  font-weight: 650;
}

.brand-text {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 650;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.theme-button {
  color: var(--ink);
  cursor: default;
  font-size: 1.05rem;
}

.hero {
  display: grid;
  justify-items: center;
  margin-bottom: 30px;
  text-align: center;
}

h1,
h2,
h3,
.lede {
  margin: 0;
}

h1 {
  font-family: var(--font-sans);
  font-size: clamp(2.15rem, 4.1vw, 3.65rem);
  font-weight: 760;
  line-height: 1.05;
  letter-spacing: -0.035em;
}

h2 {
  font-size: 1.25rem;
  font-weight: 650;
  letter-spacing: -0.02em;
}

h3 {
  font-size: 1rem;
  font-weight: 650;
  letter-spacing: -0.01em;
}

.lede {
  max-width: 720px;
  margin-top: 14px;
  color: var(--muted);
  font-size: 1rem;
  font-weight: 500;
  line-height: 1.7;
}

.session-link {
  display: inline-flex;
  align-items: center;
  margin-left: 0.35rem;
  padding: 0.1rem 0.48rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.74);
  font-weight: 650;
  text-decoration: none;
  white-space: nowrap;
  transition: border-color 150ms ease, background 150ms ease, transform 150ms ease;
}

.session-link:hover {
  border-color: var(--line-strong);
  background: #fff;
  transform: translateY(-1px);
}

.guide-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(360px, 0.72fr);
  gap: 22px;
  align-items: center;
  margin-bottom: 22px;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 28px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.9), rgba(248, 249, 251, 0.82)),
    var(--surface);
  box-shadow: var(--shadow);
}

.guide-panel p {
  max-width: 780px;
  margin: 10px 0 0;
  color: var(--muted);
  line-height: 1.75;
}

.guide-actions {
  display: grid;
  gap: 10px;
}

.guide-actions .session-link,
.guide-actions button {
  justify-content: center;
  width: 100%;
  min-height: 44px;
  margin: 0;
}

input[type="email"] {
  width: 100%;
  min-height: 44px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.86);
  outline: none;
}

input[type="email"]::placeholder {
  color: var(--faint);
}

input[type="email"]:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(127, 134, 148, 0.11);
}

.hero-status {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  width: min(680px, 100%);
  margin-top: 26px;
  padding: 18px 22px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.82);
  box-shadow: var(--shadow);
}

.hero-status div {
  text-align: left;
}

.hero-status span,
.kicker,
.summary-card span {
  display: block;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 650;
}

.hero-status strong {
  display: block;
  margin-top: 5px;
  color: var(--ink);
  font-size: 1.02rem;
  font-weight: 650;
}

.workspace {
  display: grid;
  grid-template-columns: minmax(420px, 1.05fr) minmax(420px, 0.95fr);
  gap: 22px;
  align-items: stretch;
}

.panel,
.result-card {
  border: 1px solid var(--line);
  border-radius: 28px;
  background: rgba(255, 255, 255, 0.84);
  box-shadow: var(--shadow);
}

.panel {
  padding: 30px;
}

.panel-heading,
.result-heading,
.actions,
.mini-actions {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
}

.input-panel,
.output-panel,
.result-card {
  display: flex;
  flex-direction: column;
}

.export-options {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 22px;
}

.export-options label {
  display: flex;
  min-height: 46px;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 16px;
  color: var(--muted);
  background: var(--surface-soft);
  font-size: 0.9rem;
  font-weight: 650;
}

.export-options label:hover {
  border-color: var(--line-strong);
  background: #fff;
}

.export-options input {
  width: 16px;
  height: 16px;
  accent-color: var(--accent-strong);
}

.export-options .auto-download {
  grid-column: 1 / -1;
  background: rgba(255, 255, 255, 0.82);
}

.kicker {
  margin: 0 0 8px;
  letter-spacing: 0.08em;
}

.drop-zone {
  display: grid;
  min-height: 86px;
  margin: 22px 0 16px;
  padding: 16px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 20px;
  color: var(--muted);
  background: var(--surface-soft);
  cursor: pointer;
  font-weight: 600;
  transition: border-color 150ms ease, background 150ms ease, transform 150ms ease;
}

.drop-zone input {
  display: none;
}

.drop-zone.is-dragging,
.drop-zone:hover {
  border-color: var(--line-strong);
  background: #fff;
  transform: translateY(-1px);
}

textarea {
  width: 100%;
  min-height: 390px;
  padding: 18px;
  resize: vertical;
  border: 1px solid var(--line);
  border-radius: 20px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.72);
  font-family: var(--font-mono);
  font-size: 0.86rem;
  font-weight: 450;
  line-height: 1.58;
  outline: none;
}

textarea::placeholder {
  color: var(--faint);
}

textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(127, 134, 148, 0.11);
}

.actions {
  justify-content: flex-start;
  margin-top: 18px;
}

button {
  min-height: 44px;
  padding: 0 20px;
  border: 1px solid var(--accent-strong);
  border-radius: 14px;
  color: #fff;
  background: var(--accent-strong);
  cursor: pointer;
  font-size: 0.94rem;
  font-weight: 650;
  transition: border-color 150ms ease, background 150ms ease, color 150ms ease, transform 150ms ease;
}

button:hover:not(:disabled) {
  transform: translateY(-1px);
}

button:disabled {
  color: var(--faint);
  border-color: var(--line);
  background: #fff;
  cursor: not-allowed;
}

.secondary-button,
.ghost-button {
  color: var(--muted);
  border-color: var(--line);
  background: #fff;
}

.secondary-button:hover:not(:disabled),
.ghost-button:hover:not(:disabled) {
  color: var(--ink);
  border-color: var(--line-strong);
}

.status {
  max-width: 330px;
  padding: 9px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  background: #fff;
  font-size: 0.86rem;
  font-weight: 500;
  text-align: right;
}

.status[data-tone="success"] {
  color: var(--success);
}

.status[data-tone="error"] {
  color: var(--error);
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin: 22px 0;
}

.summary-card {
  min-height: 78px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--surface-soft);
}

.summary-card strong {
  display: block;
  margin-top: 7px;
  overflow: hidden;
  color: var(--ink);
  font-family: var(--font-mono);
  font-size: 0.84rem;
  font-weight: 550;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.result-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
  flex: 1;
}

.result-card {
  min-width: 0;
  padding: 18px;
  box-shadow: none;
}

.result-card textarea {
  flex: 1;
  min-height: 210px;
  margin-top: 14px;
}

.mini-actions {
  gap: 8px;
}

.mini-actions button {
  min-height: 34px;
  padding: 0 12px;
  border-radius: 12px;
  font-size: 0.82rem;
}

@media (max-width: 1100px) {
  .guide-panel,
  .workspace {
    grid-template-columns: 1fr;
  }

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

@media (max-width: 760px) {
  .shell {
    width: min(100% - 24px, 1360px);
    padding: 18px 0 28px;
  }

  .topbar {
    margin-bottom: 32px;
  }

  .brand-text {
    display: none;
  }

  h1 {
    font-size: clamp(2.25rem, 13vw, 3.3rem);
  }

  .hero-status,
  .export-options,
  .summary-grid,
  .result-grid {
    grid-template-columns: 1fr;
  }

  .panel {
    padding: 20px;
    border-radius: 24px;
  }

  .panel-heading,
  .result-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .status {
    max-width: none;
    text-align: left;
  }
}
