/* Morphowiki manual — light, minimal, calm */

/* ===== Color tokens ===== */
:root {
  --bg: #ffffff;
  --bg-muted: #f6f7f9;
  --bg-code: #f2f3f5;
  --border: #e4e7eb;
  --border-strong: #cfd4da;
  --text: #1f2933;
  --text-muted: #5b6470;
  --accent: #0f766e;       /* teal-700 */
  --accent-hover: #115e59; /* teal-800 */
  --accent-soft: #e6f4f2;
  --warn-bg: #fff7e6;
  --warn-border: #f5c97a;
  --tip-bg: #e6f4f2;
  --tip-border: #5eaaa2;
  --note-bg: #eef2ff;
  --note-border: #8da4ef;
}

/* ===== Reset / base ===== */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans TC", "PingFang TC", "Microsoft JhengHei", sans-serif;
  font-size: 16px;
  line-height: 1.7;
  color: var(--text);
  background: var(--bg);
}

/* ===== Bilingual visibility (critical) ===== */
[data-lang] { display: none; }
[data-lang].active { display: block; }

/* ===== Header ===== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  padding: 12px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.site-header .brand {
  font-weight: 600;
  font-size: 1.05rem;
  color: var(--text);
  text-decoration: none;
}
.site-header .brand:hover { color: var(--accent); }
.lang-switch { display: flex; gap: 6px; }
.lang-switch button {
  font: inherit;
  font-size: 0.9rem;
  padding: 6px 12px;
  border: 1px solid var(--border-strong);
  background: var(--bg);
  color: var(--text);
  border-radius: 4px;
  cursor: pointer;
}
.lang-switch button:hover { background: var(--bg-muted); }
[data-lang-btn].active {
  background: var(--accent);
  color: #ffffff;
  border-color: var(--accent);
}

/* ===== Main column ===== */
main {
  max-width: 720px;
  margin: 0 auto;
  padding: 32px 24px 64px;
}

/* ===== Headings ===== */
h1, h2, h3, h4 { color: var(--text); line-height: 1.3; }
h1 {
  font-size: 2rem;
  margin: 0 0 16px;
  font-weight: 700;
}
h2 {
  font-size: 1.4rem;
  margin: 40px 0 12px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--border);
  font-weight: 600;
}
h3 {
  font-size: 1.1rem;
  margin: 28px 0 8px;
  font-weight: 600;
}

p { margin: 12px 0; }

/* ===== Links ===== */
a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-hover); text-decoration: underline; }

/* ===== Lists ===== */
ul, ol { padding-left: 1.5em; }
li { margin: 4px 0; }

/* ===== Code ===== */
code {
  font-family: "SF Mono", "Cascadia Code", "Consolas", monospace;
  font-size: 0.9em;
  background: var(--bg-code);
  padding: 1px 5px;
  border-radius: 3px;
  white-space: nowrap;
}
pre {
  background: var(--bg-code);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 14px 16px;
  overflow-x: auto;
  line-height: 1.5;
}
pre code {
  background: transparent;
  padding: 0;
  border-radius: 0;
  font-size: 0.9rem;
  white-space: inherit;
}

/* ===== Callouts ===== */
.callout-tip, .callout-warn, .callout-note {
  border-left: 4px solid;
  border-radius: 4px;
  padding: 12px 16px;
  margin: 18px 0;
}
.callout-tip { background: var(--tip-bg); border-color: var(--tip-border); }
.callout-warn { background: var(--warn-bg); border-color: var(--warn-border); }
.callout-note { background: var(--note-bg); border-color: var(--note-border); }
.callout-tip > :first-child,
.callout-warn > :first-child,
.callout-note > :first-child { margin-top: 0; }
.callout-tip > :last-child,
.callout-warn > :last-child,
.callout-note > :last-child { margin-bottom: 0; }

/* ===== Hero ===== */
.hero {
  padding: 8px 0 12px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 24px;
}
.hero .tagline {
  font-size: 1.15rem;
  color: var(--text-muted);
  margin-top: 4px;
}

/* ===== Card grid ===== */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 14px;
  margin: 14px 0;
}
.card {
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 16px;
  background: var(--bg-muted);
  min-width: 0;
  overflow-wrap: anywhere;
}
.card h3 { margin-top: 0; }
.card p { overflow-wrap: anywhere; }

/* ===== Preview figure (screenshots) ===== */
figure.preview {
  margin: 24px auto;
  text-align: center;
}
figure.preview img {
  max-width: 100%;
  width: 380px;
  height: auto;
  border-radius: 10px;
  border: 1px solid var(--border);
  box-shadow: 0 6px 24px rgba(20, 30, 45, 0.12);
}
figure.preview figcaption {
  margin-top: 10px;
  font-size: 0.9em;
  color: var(--text-muted);
}

/* ===== Start-here CTA ===== */
.cta {
  display: inline-block;
  margin: 8px 0;
  padding: 10px 18px;
  background: var(--accent);
  color: #ffffff;
  border-radius: 4px;
  font-weight: 500;
}
.cta:hover {
  background: var(--accent-hover);
  color: #ffffff;
  text-decoration: none;
}

/* ===== Sitemap nav ===== */
.sitemap {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 20px;
  margin: 16px 0;
}
.sitemap section {
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 14px 16px;
}
.sitemap section h3 { margin: 0 0 8px; }
.sitemap ul { list-style: none; padding-left: 0; margin: 0; }
.sitemap li { margin: 6px 0; }

/* ===== Footer ===== */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 20px;
  text-align: center;
  font-size: 0.85rem;
  color: var(--text-muted);
}
.site-footer a { color: var(--text-muted); }

/* ===== Responsive ===== */
@media (max-width: 760px) {
  main { padding: 24px 18px 48px; }
  .site-header { padding: 10px 14px; }
  .site-header .brand { font-size: 1rem; }
  h1 { font-size: 1.7rem; }
  h2 { font-size: 1.25rem; }
  .card-grid, .sitemap { grid-template-columns: 1fr; }
}
