/* ========================================
   mmguo — Shared Page Base Styles
   Used by all subpages (prompts, writings, etc.)

   HOW TO USE:
   <link rel="stylesheet" href="../shared/page-base.css">

   Change any style here → all pages update.
   ======================================== */

/* === Variables === */
:root {
  --bg: #f3f1ed;
  --ink: #1d1b1b;
  --muted: #4f4d4a;
  --border: #c5c1bb;
  --code-bg: #e8e4db;
  --code-fg: #2a2825;
  --accent: #57c5c8;
}

/* === Reset === */
* { box-sizing: border-box; margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: "IBM Plex Mono", "SFMono-Regular", Menlo, Consolas, monospace;
  -webkit-font-smoothing: antialiased;
}

/* === Layout === */
.page {
  max-width: 800px;
  margin: 0 auto;
  padding: 80px 32px 120px;
}

/* === Top bar === */
.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 80px;
}
.back-link {
  font-size: 13px;
  color: var(--muted);
  text-decoration: none;
  transition: color 0.2s;
}
.back-link:hover { color: var(--ink); }
.lang-toggle {
  font-family: inherit;
  font-size: 12px;
  padding: 6px 10px;
  border: 1px solid var(--border);
  background: #fbf9f6;
  color: var(--ink);
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s;
}
.lang-toggle:hover {
  background: #f1eeea;
  border-color: #b6b2ac;
}

/* === Page header === */
.prompt-header {
  margin-bottom: 48px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 24px;
}
.prompt-title {
  font-family: "IBM Plex Mono", monospace;
  font-size: 24px;
  font-weight: 600;
  margin-bottom: 16px;
  letter-spacing: -0.02em;
  line-height: 1.3;
  color: var(--ink);
}
.prompt-subtitle {
  font-size: 14px;
  color: var(--muted);
  margin-bottom: 12px;
  line-height: 1.5;
}
.prompt-meta {
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 20px;
  display: flex;
  align-items: baseline;
  gap: 24px;
  flex-wrap: wrap;
}
.prompt-meta a {
  color: var(--muted);
  text-decoration: none;
  transition: color 0.2s;
}
.prompt-meta a:hover { color: var(--ink); }

/* === Article body === */
.article { margin-bottom: 40px; }
.article-section { margin-bottom: 32px; }
.article-section-title {
  font-family: "IBM Plex Mono", monospace;
  font-size: 16px;
  font-weight: 600;
  color: #204F56;
  margin-bottom: 20px;
  margin-top: 40px;
  letter-spacing: -0.01em;
  text-transform: uppercase;
}
.article p {
  font-family: "Lora", serif;
  font-size: 17px;
  line-height: 1.85;
  color: var(--muted);
  margin-bottom: 14px;
}
.article p:last-child { margin-bottom: 0; }

/* === Links in article === */
.article a {
  color: var(--ink);
  text-decoration: underline;
  text-decoration-color: var(--border);
  text-underline-offset: 4px;
  transition: text-decoration-color 0.2s ease;
}
.article a:hover {
  text-decoration-color: var(--ink);
}

/* === Text highlights (change here → all pages update) === */
.article .hl {
  color: var(--ink);
  font-weight: 500;
}
.article .ylw {
  background: linear-gradient(to top, rgba(255,220,100,.35) 40%, transparent 40%);
  padding: 0 2px;
}

/* === Tags (cyan label) === */
.article .tag {
  display: inline-block;
  font-size: 13px;
  font-weight: 600;
  color: #2a2825;
  background: var(--accent);
  padding: 3px 10px;
  border-radius: 4px;
  letter-spacing: 0.04em;
  margin-right: 8px;
}

/* === Lists === */
.article ul {
  font-family: "Lora", serif;
  font-size: 17px;
  line-height: 1.85;
  color: var(--muted);
  margin: 8px 0 14px 20px;
  list-style: none;
}
.article ul.no-bullets {
  margin-left: 0;
}
.article ul li { margin-bottom: 8px; }
.article ul li::before {
  content: "·";
  margin-right: 8px;
  color: var(--accent);
}
.article ul.no-bullets li::before {
  content: none;
}

.article ol {
  font-family: "Lora", serif;
  font-size: 17px;
  line-height: 1.85;
  color: var(--muted);
  margin: 8px 0 14px 0;
  padding-left: 24px;
}
.article ol li {
  margin-bottom: 8px;
  padding-left: 4px;
}
.article ol li::marker {
  color: var(--muted);
  font-family: "IBM Plex Mono", monospace;
  font-size: 15px;
}

/* === Usage steps & notes (prompts pages) === */
.article ol.usage-step {
  font-family: "Lora", serif;
  font-size: 17px;
  line-height: 1.85;
  color: var(--ink);
  margin: 0 0 24px 0;
  padding-left: 20px;
}
.article ol.usage-step li {
  margin-bottom: 8px;
  padding-left: 8px;
}
.article ol.usage-step li::marker {
  color: var(--muted);
  font-family: "IBM Plex Mono", monospace;
  font-size: 14px;
}
.article .note {
  font-size: 13px;
  color: var(--muted);
  line-height: 1.6;
  margin-top: 10px;
  font-style: italic;
}

/* === Dialogue box (for testing diary etc.) === */
.article .dialogue-box {
  background: var(--code-bg);
  border-radius: 3px;
  padding: 12px 16px;
  margin: 8px 0 14px;
  font-size: 13px;
  line-height: 1.7;
  color: var(--code-fg);
}
.article .dialogue-speaker {
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 2px;
}
.article .dialogue-line {
  margin-bottom: 6px;
}
.article .dialogue-line:last-child { margin-bottom: 0; }

/* === Inline prompt block (ChatGPT style) === */
.article .inline-prompt-container {
  background: #f3f1ecab;
  border: 1px solid #e5e5e5;
  border-radius: 8px;
  margin: 16px 0 20px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0,0,0,0.02);
}

.inline-prompt-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 12px;
  background: #f3f1ecab;
  border-bottom: 1px solid #e5e5e5;
  color: #1d1b1b;
}

.inline-prompt-header-left {
  display: flex;
  align-items: center;
  gap: 6px;
  color: #1d1b1b;
  font-size: 12px;
  font-weight: 500;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.inline-prompt-copy-btn {
  display: flex;
  align-items: center;
  gap: 4px;
  background: transparent;
  border: none;
  color: #1d1b1b;
  font-size: 12px;
  font-family: inherit;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 4px;
  transition: all 0.2s ease;
}

.inline-prompt-copy-btn:hover {
  background: #e5e5e5;
  color: #343541;
}

.article .inline-prompt-content {
  padding: 16px 20px;
  font-family: "IBM Plex Mono", Menlo, Consolas, monospace;
  font-size: 13.5px;
  line-height: 1.6;
  color: #343541;
  white-space: pre-wrap;
  word-break: break-word;
  background: #f3f1ecab;
}

/* Fallback for the original inline-prompt just in case JS doesn't run */
.article .inline-prompt {
  background: #f3f1ecab;
  border: 1px solid #e5e5e5;
  border-radius: 8px;
  padding: 16px 20px;
  margin: 16px 0 20px;
  font-family: "IBM Plex Mono", Menlo, Consolas, monospace;
  font-size: 13.5px;
  line-height: 1.6;
  color: #343541;
  white-space: pre-wrap;
  word-break: break-word;
}

/* === Sub-prompt labels & notes (writings pages) === */
.sub-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
  margin: 20px 0 8px;
  letter-spacing: 0.01em;
}
.sub-note {
  font-family: "Lora", serif;
  font-size: 17px;
  line-height: 1.85;
  color: var(--ink);
  margin: 16px 0 24px;
}

/* === Step blocks (for method steps) === */
.step { margin-bottom: 16px; }
.step-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 4px;
}
.step-body {
  font-family: "Lora", serif;
  font-size: 17px;
  line-height: 1.85;
  color: var(--muted);
}

/* === Images === */
.img-wrap { margin: 14px 0 18px; text-align: center; }
.img-wrap img {
  max-width: 100%;
  height: auto;
  border-radius: 6px;
  border: 1px solid rgba(0,0,0,0.05);
  box-shadow: 0 8px 24px rgba(0,0,0,0.06);
}

/* === Image placeholder === */
.img-placeholder {
  background: var(--code-bg);
  border: 1px dashed var(--border);
  border-radius: 6px;
  padding: 40px 20px;
  margin: 14px 0 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  font-size: 12px;
  min-height: 160px;
  text-align: center;
}

/* === Blockquote === */
.article blockquote {
  position: relative;
  margin: 16px 0 16px 28px;
  padding: 2px 0 2px 20px;
  background: none;
  border: none;
  border-left: 2.5px solid var(--border);
  font-family: "Lora", serif;
  font-size: 17px;
  line-height: 1.85;
  color: var(--muted);
  font-style: italic;
}
.article blockquote::before {
  content: "\201C";
  position: absolute;
  left: -28px;
  top: -2px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 28px;
  font-style: normal;
  color: var(--border);
  line-height: 1;
}
.article blockquote p {
  color: var(--muted);
  margin-bottom: 8px;
  font-size: 17px;
}
.article blockquote p:last-child { margin-bottom: 0; }

/* === Date labels (testing diary etc.) === */
.article .date-label {
  font-size: 12px;
  color: var(--muted);
  font-weight: 600;
  margin-bottom: 4px;
  margin-top: 20px;
  letter-spacing: 0.02em;
}
.article .my-words {
  color: var(--muted);
  font-style: italic;
}
.article .separator {
  width: 40px;
  height: 1px;
  background: var(--border);
  margin: 32px 0;
}
.article .cta {
  font-size: 14px;
  color: var(--ink);
  font-weight: 500;
  margin-top: 20px;
}
.article .prompt-intro {
  font-size: 14px;
  color: var(--muted);
  line-height: 1.6;
  margin-bottom: 0;
}

/* === AI Summary (for LLM crawlers — visually hidden, DOM-accessible) === */
.ai-summary {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* === Utility === */
.hidden { display: none; }

/* === Responsive === */
@media (max-width: 600px) {
  .page { padding: 56px 16px 80px; }
  .topbar { margin-bottom: 56px; }
  .prompt-title { font-size: 17px; }
}
