/* thesis.yuchengji.com - 浅色风格，参考 zhiyuxing.yuchengji.com */

:root {
  --bg: #F9F9F7;
  --bg-soft: #F0EFEB;
  --bg-cream: #FAF6F0;
  --ink: #1A1A1A;
  --ink-60: rgba(26, 26, 26, 0.6);
  --ink-80: rgba(26, 26, 26, 0.8);
  --ink-50: rgba(26, 26, 26, 0.5);
  --ink-20: rgba(26, 26, 26, 0.15);
  --line: #E5E5E2;
  --line-strong: #C9C9C4;
  --accent: #1A1A1A;
  --accent-hover: #333;
  --success: #4F7A28;
  --warn: #B45309;
  --error: #B91C1C;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --font: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.04);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 12px 32px rgba(0, 0, 0, 0.08);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--ink);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a { color: inherit; text-decoration: none; }
button { font-family: inherit; }

.page {
  max-width: 760px;
  margin: 0 auto;
  padding: 64px 24px 96px;
}

/* ---------- Hero ---------- */
.hero { text-align: left; margin-bottom: 48px; }
.brand {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 14px; color: var(--ink-60);
  padding: 6px 12px; background: var(--bg-soft);
  border-radius: 999px; margin-bottom: 24px;
}
.brand .dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--ink);
}
.brand-name { font-weight: 500; letter-spacing: 0.02em; }

.hero h1 {
  font-size: 48px; line-height: 1.1; font-weight: 700;
  letter-spacing: -0.02em; margin: 0 0 16px;
  color: var(--ink);
}
.subtitle {
  font-size: 17px; color: var(--ink-60); margin: 0; line-height: 1.6;
}

/* ---------- Card ---------- */
.card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  padding: 32px;
  margin-bottom: 24px;
  box-shadow: var(--shadow-sm);
  position: relative;
}
.card h2 {
  font-size: 20px; font-weight: 600; margin: 0 0 8px;
  letter-spacing: -0.01em;
}
.card .muted { color: var(--ink-60); font-size: 14px; margin: 0 0 20px; }
.step-badge {
  position: absolute; top: -10px; left: 24px;
  background: var(--ink); color: #fff;
  font-size: 12px; font-weight: 600; padding: 4px 10px;
  border-radius: 999px; letter-spacing: 0.05em;
}
.hidden { display: none; }

/* ---------- Drop Zone ---------- */
.upload-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 16px;
  margin: 24px 0 24px;
}
@media (max-width: 600px) { .upload-grid { grid-template-columns: 1fr; } }

.drop-zone {
  display: flex; flex-direction: column; align-items: center;
  justify-content: center; padding: 28px 16px;
  border: 2px dashed var(--line-strong);
  border-radius: var(--radius-lg);
  background: var(--bg-cream);
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: center;
  position: relative;
  min-height: 160px;
}
.drop-zone:hover {
  border-color: var(--ink);
  background: #fff;
}
.drop-zone.has-file {
  border-color: var(--success);
  border-style: solid;
  background: rgba(79, 122, 40, 0.04);
}
.drop-zone input { display: none; }
.drop-icon { font-size: 32px; margin-bottom: 8px; }
.drop-title { font-weight: 600; font-size: 15px; margin-bottom: 4px; }
.drop-hint { font-size: 12px; color: var(--ink-50); }
.drop-filename {
  margin-top: 10px; font-size: 12px; color: var(--success);
  font-family: var(--font-mono);
  word-break: break-all;
  max-width: 100%;
  display: none;
}
.drop-zone.has-file .drop-filename { display: block; }

/* ---------- CTA ---------- */
.cta {
  display: flex; align-items: center; gap: 12px;
  flex-wrap: wrap;
  margin-top: 8px;
}
.btn-primary {
  background: var(--ink); color: #fff;
  border: 0; padding: 12px 24px; border-radius: 999px;
  font-size: 15px; font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
  display: inline-flex; align-items: center; gap: 8px;
  text-decoration: none;
}
.btn-primary:hover { background: var(--accent-hover); }
.btn-primary:disabled {
  background: var(--ink-20); color: var(--ink-50); cursor: not-allowed;
}
.btn-ghost {
  background: transparent; color: var(--ink);
  border: 1px solid var(--line-strong);
  padding: 11px 20px; border-radius: 999px;
  font-size: 15px; font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
  text-decoration: none;
  display: inline-flex; align-items: center; gap: 8px;
}
.btn-ghost:hover { background: var(--bg-soft); border-color: var(--ink); }
.cta-hint { color: var(--ink-50); font-size: 13px; }

/* ---------- Progress ---------- */
.progress-row {
  display: flex; gap: 24px; margin: 20px 0 16px;
  flex-wrap: wrap;
}
.progress-stage {
  display: flex; align-items: center; gap: 8px;
  font-size: 14px; color: var(--ink-50);
}
.dot-stage {
  width: 10px; height: 10px; border-radius: 50%;
  background: var(--ink-20);
}
.progress-stage.active .dot-stage { background: var(--ink); }
.progress-stage.active { color: var(--ink); font-weight: 500; }
.progress-stage.done .dot-stage { background: var(--success); }
.progress-stage.done { color: var(--success); }

.progress-bar {
  width: 100%; height: 6px;
  background: var(--bg-soft);
  border-radius: 999px; overflow: hidden;
  margin: 16px 0;
}
.progress-fill {
  height: 100%; width: 0;
  background: var(--ink);
  border-radius: 999px;
  transition: width 0.4s ease;
}
.progress-message { color: var(--ink-60); font-size: 14px; margin: 0; }

/* ---------- Spec View ---------- */
.spec-view {
  background: var(--bg-soft);
  border-radius: var(--radius-md);
  padding: 16px;
  margin: 16px 0;
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 1.5;
  max-height: 320px;
  overflow: auto;
}
.spec-view pre { margin: 0; white-space: pre-wrap; word-break: break-all; }

/* ---------- Done ---------- */
.done-msg { color: var(--ink-80); font-size: 15px; margin: 8px 0 20px; }
.error-msg { color: var(--error); font-size: 15px; margin: 8px 0 20px; }
.summary-block { margin-top: 24px; }
.summary-block summary {
  cursor: pointer; color: var(--ink-60); font-size: 14px;
  padding: 8px 0;
}
.summary-block pre {
  background: var(--bg-soft); border-radius: var(--radius-md);
  padding: 16px; font-size: 12px; font-family: var(--font-mono);
  overflow: auto; max-height: 320px;
  white-space: pre-wrap; word-break: break-all;
  margin: 8px 0 0;
}

/* ---------- Foot ---------- */
.foot {
  text-align: center;
  color: var(--ink-50); font-size: 13px;
  margin-top: 48px;
  display: flex; justify-content: center; gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}
.foot a:hover { color: var(--ink); }
.foot .muted { opacity: 0.5; }
