/* ═══════════════════════════════════════════════════
   LESSON PLAN → PPTX — Professional Design System
   ═══════════════════════════════════════════════════ */

/* ── CSS Variables ── */
:root {
  --color-primary: #065A82;
  --color-primary-light: #1C7293;
  --color-accent: #F0A500;
  --color-bg: #F1F5F9;
  --color-surface: #FFFFFF;
  --color-text: #1E293B;
  --color-text-muted: #64748B;
  --color-text-light: #94A3B8;
  --color-border: #E2E8F0;
  --color-border-light: #F1F5F9;
  --color-danger: #EF4444;
  --color-success: #10B981;

  --font-sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-tc: "Noto Sans TC", var(--font-sans);
  --font-mono: "SF Mono", "Fira Code", "Cascadia Code", monospace;

  --radius-sm: 6px;
  --radius: 10px;
  --radius-lg: 16px;
  --radius-xl: 20px;

  --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
  --shadow: 0 1px 3px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.04);
  --shadow-md: 0 4px 6px rgba(0,0,0,0.05), 0 2px 4px rgba(0,0,0,0.04);
  --shadow-lg: 0 10px 25px rgba(0,0,0,0.06), 0 4px 10px rgba(0,0,0,0.04);
  --shadow-xl: 0 20px 50px rgba(0,0,0,0.08), 0 8px 20px rgba(0,0,0,0.05);

  --transition: 200ms ease;
  --transition-slow: 350ms ease;
}

/* ── Reset ── */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-tc);
  background: var(--color-bg);
  color: var(--color-text);
  line-height: 1.6;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ── Nav ── */
.nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--color-border-light);
}

.nav-inner {
  max-width: 960px;
  margin: 0 auto;
  padding: 0 24px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--color-text);
  font-weight: 700;
  font-size: 17px;
}

.nav-logo {
  font-size: 22px;
  line-height: 1;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 8px;
}

.nav-link {
  text-decoration: none;
  color: var(--color-text-muted);
  font-size: 14px;
  font-weight: 500;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  transition: color var(--transition), background var(--transition);
}

.nav-link:hover {
  color: var(--color-primary);
  background: rgba(6, 90, 130, 0.06);
}

.nav-link-gh {
  display: flex;
  align-items: center;
  gap: 5px;
}

/* ── Hero ── */
.hero {
  background: linear-gradient(135deg, #065A82 0%, #0A3D55 40%, #1C7293 100%);
  padding: 64px 24px 56px;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: "";
  position: absolute;
  top: -30%;
  right: -10%;
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, rgba(255,255,255,0.06) 0%, transparent 70%);
  border-radius: 50%;
}

.hero::after {
  content: "";
  position: absolute;
  bottom: -20%;
  left: -5%;
  width: 400px;
  height: 400px;
  background: radial-gradient(circle, rgba(240,165,0,0.08) 0%, transparent 70%);
  border-radius: 50%;
}

.hero-inner {
  position: relative;
  z-index: 1;
  max-width: 700px;
  margin: 0 auto;
}

.hero-title {
  font-size: clamp(28px, 5vw, 44px);
  font-weight: 800;
  color: #FFFFFF;
  line-height: 1.25;
  letter-spacing: -0.02em;
  margin-bottom: 12px;
}

.hero-highlight {
  background: linear-gradient(135deg, #F0A500, #F5C842);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-sub {
  font-size: 17px;
  color: rgba(255,255,255,0.75);
  max-width: 520px;
  margin: 0 auto;
  line-height: 1.6;
}

/* ── Main ── */
.main {
  max-width: 860px;
  margin: -24px auto 48px;
  padding: 0 24px;
  position: relative;
  z-index: 2;
}

.card {
  background: var(--color-surface);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-xl);
  padding: 36px 32px;
  border: 1px solid var(--color-border-light);
}

/* ── Field ── */
.field {
  margin-bottom: 28px;
}

.field-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
  flex-wrap: wrap;
  gap: 8px;
}

.field-label {
  font-weight: 600;
  font-size: 15px;
  color: var(--color-text);
  display: block;
}

.field-actions {
  display: flex;
  gap: 6px;
}

.field-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 8px;
  min-height: 20px;
}

.char-count {
  font-size: 12px;
  color: var(--color-text-light);
}

.format-hint {
  font-size: 12px;
  font-weight: 500;
}

.format-hint.valid {
  color: var(--color-success);
}

.format-hint.invalid {
  color: var(--color-text-light);
}

/* ── Textarea ── */
.textarea {
  width: 100%;
  border: 2px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 16px 18px;
  font-family: var(--font-mono);
  font-size: 14px;
  line-height: 1.7;
  color: var(--color-text);
  background: #FAFBFC;
  resize: vertical;
  transition: border-color var(--transition), box-shadow var(--transition);
  outline: none;
  min-height: 260px;
}

.textarea::placeholder {
  color: var(--color-text-light);
  font-family: var(--font-tc);
}

.textarea:focus {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(6, 90, 130, 0.1);
  background: #FFFFFF;
}

/* ── Buttons ── */
.btn-primary {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  padding: 15px 24px;
  border: none;
  border-radius: var(--radius);
  background: linear-gradient(135deg, var(--color-primary), var(--color-primary-light));
  color: #FFFFFF;
  font-family: var(--font-tc);
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: transform var(--transition), box-shadow var(--transition), opacity var(--transition);
  box-shadow: 0 2px 8px rgba(6, 90, 130, 0.25);
  position: relative;
  overflow: hidden;
}

.btn-primary:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(6, 90, 130, 0.35);
}

.btn-primary:active:not(:disabled) {
  transform: translateY(0);
}

.btn-primary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-content,
.btn-loader {
  display: flex;
  align-items: center;
  gap: 8px;
}

.btn-loader[hidden] {
  display: none;
}

.btn-primary.loading .btn-content {
  display: none;
}

.btn-primary.loading .btn-loader {
  display: flex;
}

.btn-icon {
  font-size: 18px;
}

/* Spinner */
.spinner {
  width: 20px;
  height: 20px;
  border: 2.5px solid rgba(255,255,255,0.3);
  border-top-color: #FFFFFF;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.btn-ghost {
  background: none;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  padding: 5px 12px;
  font-family: var(--font-tc);
  font-size: 13px;
  font-weight: 500;
  color: var(--color-text-muted);
  cursor: pointer;
  transition: all var(--transition);
}

.btn-ghost:hover {
  background: var(--color-bg);
  color: var(--color-text);
  border-color: var(--color-text-light);
}

.btn-ghost-sm {
  background: none;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  padding: 4px 10px;
  font-family: var(--font-tc);
  font-size: 12px;
  font-weight: 500;
  color: var(--color-text-muted);
  cursor: pointer;
  transition: all var(--transition);
}

.btn-ghost-sm:hover {
  background: var(--color-bg);
  color: var(--color-text);
}

/* ── Theme Grid ── */
.theme-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}

.theme-card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 14px 8px;
  border: 2px solid var(--color-border);
  border-radius: var(--radius);
  cursor: pointer;
  transition: all var(--transition);
  background: var(--color-surface);
}

.theme-card:hover {
  border-color: var(--color-text-light);
}

.theme-card:has(input:checked) {
  border-color: var(--color-primary);
  background: rgba(6, 90, 130, 0.04);
}

.theme-card input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.theme-swatch {
  width: 100%;
  height: 28px;
  border-radius: var(--radius-sm);
  background: var(--swatch, #ccc);
}

.theme-name {
  font-weight: 600;
  font-size: 13px;
  color: var(--color-text);
}

/* ── Status ── */
.status {
  margin-top: 20px;
  padding: 14px 18px;
  border-radius: var(--radius);
  font-size: 14px;
  font-weight: 500;
  line-height: 1.5;
}

.status[hidden] {
  display: none;
}

.status.success {
  background: #ECFDF5;
  color: #065F46;
  border: 1px solid #A7F3D0;
}

.status.error {
  background: #FEF2F2;
  color: #991B1B;
  border: 1px solid #FECACA;
}

/* ── Download Area ── */
.download-area {
  margin-top: 24px;
}

.download-area[hidden] {
  display: none;
}

.download-card {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 18px 20px;
  background: linear-gradient(135deg, #ECFDF5, #F0FDF4);
  border: 1px solid #A7F3D0;
  border-radius: var(--radius);
}

.download-icon {
  font-size: 28px;
  flex-shrink: 0;
}

.download-info {
  flex: 1;
  min-width: 0;
}

.download-info strong {
  display: block;
  font-size: 15px;
  color: #065F46;
  margin-bottom: 2px;
}

.download-info #downloadFilename {
  font-size: 13px;
  color: #047857;
  opacity: 0.8;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: block;
  max-width: 300px;
}

.btn-download {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 20px;
  background: var(--color-success);
  color: #FFFFFF;
  border: none;
  border-radius: var(--radius);
  font-family: var(--font-tc);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: all var(--transition);
  box-shadow: 0 2px 6px rgba(16, 185, 129, 0.25);
}

.btn-download:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.35);
}

/* ── Guide / Wizard Section ── */
.guide-section {
  max-width: 860px;
  margin: 0 auto 64px;
  padding: 0 24px;
}

.guide-title {
  font-size: 28px;
  font-weight: 800;
  margin-bottom: 4px;
}

.guide-subtitle {
  font-size: 15px;
  color: var(--color-text-muted);
  margin-bottom: 32px;
}

/* Step Cards */
.step-card {
  display: flex;
  gap: 18px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 22px 20px;
  margin-bottom: 14px;
  transition: border-color var(--transition);
}

.step-card:hover {
  border-color: var(--color-primary-light);
}

.step-num {
  flex-shrink: 0;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--color-primary);
  color: #FFFFFF;
  font-size: 18px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}

.step-body {
  flex: 1;
  min-width: 0;
}

.step-title {
  font-size: 17px;
  font-weight: 700;
  margin-bottom: 6px;
  color: var(--color-text);
}

.step-desc {
  font-size: 14px;
  color: var(--color-text-muted);
  line-height: 1.65;
  margin-bottom: 10px;
}

.step-hint {
  font-size: 12px;
  color: var(--color-text-light);
  margin-left: 8px;
}

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

.step-list {
  margin: 0 0 10px 18px;
  font-size: 14px;
  color: var(--color-text-muted);
  line-height: 1.8;
}

.step-list kbd {
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: 4px;
  padding: 1px 7px;
  font-family: var(--font-mono);
  font-size: 12px;
}

/* Step 2 — example instruction box */
.step-example-box {
  position: relative;
  background: #F0F4FF;
  border: 1px solid #D0DBF5;
  border-radius: var(--radius);
  padding: 14px 16px;
  margin-top: 6px;
}

.step-example-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--color-primary);
  margin-bottom: 6px;
}

.step-example-text {
  display: block;
  font-family: var(--font-tc);
  font-size: 14px;
  line-height: 1.6;
  color: var(--color-text);
  white-space: pre-wrap;
  word-break: break-word;
}

.step-copy-btn {
  position: absolute;
  top: 10px;
  right: 10px;
}

/* Step 3 — details/pre */
.step-details {
  margin-top: 12px;
}

.step-details summary {
  font-size: 13px;
  color: var(--color-text-muted);
  cursor: pointer;
  font-weight: 500;
}

.step-pre {
  background: #1E293B;
  color: #E2E8F0;
  padding: 16px;
  border-radius: var(--radius);
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 1.7;
  overflow-x: auto;
  white-space: pre-wrap;
  word-break: break-word;
  margin-top: 8px;
  max-height: 360px;
  overflow-y: auto;
}

/* Buttons in steps */
.btn-outline {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 8px 16px;
  border: 2px solid var(--color-border);
  border-radius: var(--radius);
  font-family: var(--font-tc);
  font-size: 14px;
  font-weight: 600;
  color: var(--color-text);
  text-decoration: none;
  transition: all var(--transition);
}

.btn-outline:hover {
  border-color: var(--color-primary);
  color: var(--color-primary);
}

.btn-accent {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 20px;
  border: none;
  border-radius: var(--radius);
  background: var(--color-primary);
  color: #FFFFFF;
  font-family: var(--font-tc);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
}

.btn-accent:hover {
  filter: brightness(1.1);
  transform: translateY(-1px);
}

/* Collapsed format reference */
.ref-details {
  margin-top: 32px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 16px 20px;
}

.ref-details > summary {
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
}

.ref-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 8px;
  margin-top: 12px;
}

.ref-item {
  padding: 8px 10px;
  background: var(--color-bg);
  border-radius: var(--radius-sm);
  font-size: 13px;
}

.ref-item strong {
  display: block;
  margin-bottom: 2px;
  color: var(--color-text);
}

.ref-item code {
  font-size: 12px;
  color: var(--color-primary);
  background: none;
  padding: 0;
}

.ref-sub-details {
  margin-top: 10px;
}

.ref-sub-details summary {
  font-size: 13px;
  color: var(--color-text-muted);
  cursor: pointer;
  font-weight: 500;
}

/* ── Footer ── */
.footer {
  text-align: center;
  padding: 32px 24px;
  border-top: 1px solid var(--color-border);
  color: var(--color-text-muted);
  font-size: 13px;
}

/* ── Responsive ── */
@media (max-width: 640px) {
  .nav-inner {
    padding: 0 16px;
  }

  .nav-title {
    display: none;
  }

  .hero {
    padding: 40px 16px 36px;
  }

  .main {
    margin-top: -20px;
    padding: 0 16px;
  }

  .card {
    padding: 24px 18px;
  }

  .theme-grid {
    grid-template-columns: 1fr;
  }

  .download-card {
    flex-direction: column;
    align-items: flex-start;
    text-align: center;
  }

  .download-info #downloadFilename {
    max-width: 100%;
  }

  .field-header {
    flex-direction: column;
    align-items: flex-start;
  }

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

  .textarea {
    font-size: 13px;
    min-height: 220px;
  }
}
