:root {
  --bg: #ffffff;
  --bg-secondary: #f7f7f8;
  --bg-elevated: #f0f0f1;
  --text-primary: #1a1a1a;
  --text-secondary: #555555;
  --text-tertiary: #999999;
  --border: #e5e5e5;
  --accent: #1a1a1a;
  --accent-hover: #000000;
  --accent-light: #f5f5f5;
  --success-bg: #ecfdf5;
  --success: #059669;
  --warning-bg: #fffbeb;
  --warning: #d97706;
  --error-bg: #fef2f2;
  --error: #dc2626;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.06);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.08);
  --shadow-lg: 0 8px 24px rgba(0,0,0,0.1);
  --radius: 12px;
  --radius-sm: 8px;
  --radius-lg: 20px;
}

* { box-sizing: border-box; margin: 0; }

body {
  font-family: -apple-system, "SF Pro Display", "Helvetica Neue", "Microsoft YaHei", sans-serif;
  background: var(--bg);
  color: var(--text-primary);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* --- Header --- */
header {
  padding: 16px max(40px, calc((100% - 1250px) / 2));
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  background: rgba(255,255,255,0.95);
  backdrop-filter: blur(16px);
  z-index: 100;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand-icon {
  width: 30px;
  height: 30px;
  background: var(--accent);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--bg);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: -0.5px;
}

h1 {
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.4px;
}

.brand-tag {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  background: linear-gradient(135deg, #1a1a1a, #444);
  color: #fff;
  padding: 2px 6px;
  border-radius: 4px;
  line-height: 1;
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

#file { display: none; }
#homeBtn, #backBtn, #reuploadBtn { display: none; }

button {
  background: var(--accent);
  color: var(--bg);
  border: none;
  padding: 9px 18px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  transition: all 0.2s ease;
}

button:hover {
  background: var(--accent-hover);
  box-shadow: var(--shadow-md);
}

button:active { transform: scale(0.97); }
button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

button.secondary {
  background: var(--bg-elevated);
  color: var(--text-primary);
  border: 1px solid var(--border);
}

button.secondary:hover {
  background: var(--accent-light);
  border-color: var(--text-tertiary);
  box-shadow: none;
}

/* --- Transitions --- */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.fade-in { animation: fadeIn 0.3s ease forwards; }

/* --- Landing Page --- */
#landing {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 40px 40px;
}

.landing-headline {
  text-align: center;
  margin-bottom: 40px;
}

.landing-headline h2 {
  font-size: 32px;
  font-weight: 700;
  letter-spacing: -0.5px;
  line-height: 1.3;
  margin-bottom: 12px;
}

.landing-headline p {
  font-size: 15px;
  color: var(--text-secondary);
  max-width: 480px;
  margin: 0 auto;
  line-height: 1.6;
}

/* Upload zone */
.upload-zone {
  width: 100%;
  max-width: 480px;
  padding: 48px 40px;
  border: 1.5px dashed var(--border);
  border-radius: var(--radius-lg);
  cursor: pointer;
  transition: all 0.25s ease;
  background: var(--bg-secondary);
  text-align: center;
}

.upload-zone:hover {
  border-color: var(--text-tertiary);
  background: var(--bg-elevated);
  box-shadow: var(--shadow-md);
}

.upload-zone.dragover {
  border-color: var(--accent);
  background: var(--accent-light);
  transform: scale(1.01);
}

.upload-icon {
  width: 44px;
  height: 44px;
  margin: 0 auto 14px;
  background: var(--accent);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.upload-icon svg {
  width: 20px;
  height: 20px;
  stroke: var(--bg);
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.upload-title {
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 6px;
}

.upload-desc {
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 18px;
}

.upload-btn {
  padding: 10px 28px;
  font-size: 14px;
  font-weight: 500;
  border-radius: var(--radius-sm);
}

.upload-hint {
  margin-top: 14px;
  font-size: 12px;
  color: var(--text-tertiary);
}

/* Features */
.features-section {
  width: 100%;
  max-width: 820px;
  margin-top: 64px;
}

.features-heading {
  text-align: center;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 1.5px;
  margin-bottom: 24px;
}

.features {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.feature-item {
  text-align: left;
  padding: 24px 20px;
  border-radius: var(--radius);
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  transition: border-color 0.2s, box-shadow 0.2s;
}

.feature-item:hover {
  border-color: var(--text-tertiary);
  box-shadow: var(--shadow-sm);
}

.feature-item .f-icon {
  font-size: 22px;
  margin-bottom: 12px;
}

.feature-item h4 {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 6px;
}

.feature-item p {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.6;
}

/* --- Status hint --- */
#status {
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 16px;
  display: none;
}

#status.on { display: block; }

.upload-error {
  font-size: 13px;
  color: var(--error);
  margin-top: 10px;
  min-height: 0;
}

/* --- Main Content --- */
#stage {
  padding: 32px 40px;
  max-width: 1400px;
  margin: 0 auto;
  width: 100%;
  flex: 1;
  display: none;
}

#stage.on { display: block; }
