/**
 * Shared styling for the published legal documents (terms.html, privacy.html).
 * They render Markdown at runtime via shared/md.js, so everything here targets
 * plain generated tags rather than classed elements.
 */

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

body {
  font-family: "Noto Sans TC", "PingFang TC", "Microsoft JhengHei", sans-serif;
  font-size: 1rem;
  line-height: 1.85;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

.doc-topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 20px;
  background: var(--card);
  border-bottom: 1px solid var(--border);
}
.doc-back { color: var(--text2); text-decoration: none; font-size: 0.9rem; }
.doc-back:hover { color: var(--primary); }
.doc-brand {
  font-family: "Noto Serif TC", serif;
  font-weight: 700;
  font-size: 0.98rem;
  color: var(--primary);
}

.doc {
  max-width: 760px;
  margin: 0 auto;
  padding: 36px 20px 96px;
}
.doc-loading { color: var(--text3); }

.doc h1, .doc h2, .doc h3 { font-family: "Noto Serif TC", serif; line-height: 1.45; }
.doc h1 { font-size: 1.75rem; margin-bottom: 20px; }
.doc h2 {
  font-size: 1.2rem;
  margin: 40px 0 12px;
  padding-top: 4px;
  color: var(--primary-dark);
}
.doc h3 { font-size: 1.02rem; margin: 26px 0 8px; }

.doc p { margin-bottom: 14px; color: var(--text2); }
.doc ul, .doc ol { margin: 0 0 16px 22px; color: var(--text2); }
.doc li { margin-bottom: 6px; }
.doc strong { color: var(--text); }
.doc a { color: var(--primary); }

.doc hr { border: none; border-top: 1px solid var(--border); margin: 28px 0; }

.doc code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.88em;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 5px;
  padding: 1px 5px;
}

/* Front matter (version / effective date / "not yet reviewed by counsel")
   renders as a blockquote — it is the first thing a reader should notice. */
.doc blockquote {
  background: #fffdf5;
  border: 1px solid #f0d9a8;
  border-left: 4px solid #e0b25c;
  border-radius: var(--radius-md);
  padding: 14px 18px;
  margin: 0 0 24px;
}
.doc blockquote p { margin-bottom: 8px; font-size: 0.9rem; }
.doc blockquote p:last-child { margin-bottom: 0; }

/* Tables can be wide (the who-sees-what matrix); they scroll inside their own
   wrapper so the page body never scrolls sideways on a phone. */
.md-table-wrap {
  overflow-x: auto;
  margin: 0 0 20px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--card);
}
.doc table { border-collapse: collapse; width: 100%; font-size: 0.88rem; }
.doc th, .doc td {
  padding: 9px 13px;
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid var(--border);
}
.doc th { background: var(--surface); font-weight: 600; white-space: nowrap; }
.doc tr:last-child td { border-bottom: none; }
.doc td { color: var(--text2); }

@media (max-width: 640px) {
  .doc { padding: 24px 16px 72px; }
  .doc h1 { font-size: 1.45rem; }
}
