/* Rowcast 網站示意稿：共用樣式。只是設計稿，還不是正式網站。 */
:root {
  /* 顏色照 App 的設定（carousel-swift/Sources/CarouselUI/UIStyle.swift） */
  --bg: #f7f7f5;          /* UI.background */
  --surface: #ffffff;     /* UI.panelBackground */
  --text: #1c1c1e;
  --muted: #6b6a66;
  --line: #e3e1dc;        /* UI.line */
  --grid: #cfccc4;        /* UI.gridLine */
  --zebra: #f8f7f4;       /* UI.zebra */
  --accent: #7a5a3a;      /* UI.accent 咖啡色 */
  --accent-bg: #f3ece4;   /* UI.accentBackground */
  --accent-text: #ffffff;
  --pending: #fff3b0;
  --radius: 14px;
  --max: 64rem;
  color-scheme: light;
}
/* 深色：跟著系統，除非使用者按了切換鈕（html 上的 data-theme） */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
      --bg: #181817;
      --surface: #222220;
      --text: #f2f2f0;
      --muted: #a3a19b;
      --line: #3a3936;
      --grid: #55534e;
      --zebra: #252422;
      --accent: #d9b48e;
      --accent-bg: #3a3026;
      --accent-text: #181817;
      --pending: #5a4b00;
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #181817;
  --surface: #222220;
  --text: #f2f2f0;
  --muted: #a3a19b;
  --line: #3a3936;
  --grid: #55534e;
  --zebra: #252422;
  --accent: #d9b48e;
  --accent-bg: #3a3026;
  --accent-text: #181817;
  --pending: #5a4b00;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 17px/1.65 -apple-system, BlinkMacSystemFont, "PingFang TC", "Noto Sans TC", system-ui, sans-serif;
}
a { color: var(--accent); }
mark { background: var(--pending); color: inherit; padding: 0 .2em; border-radius: 3px; }

/* 頁首 */
.top {
  max-width: var(--max); margin: 0 auto; padding: 18px 16px;
  display: flex; align-items: center; justify-content: space-between;
}
.brand { font-weight: 700; font-size: 1.15rem; color: var(--text); text-decoration: none; letter-spacing: -.01em; }
.top-actions { display: flex; align-items: center; gap: 8px; }
.theme {
  width: 30px; height: 30px; display: grid; place-items: center; padding: 0;
  border: 1px solid var(--line); border-radius: 999px; background: transparent; color: var(--muted); cursor: pointer;
}
.theme:hover { color: var(--text); }
.theme svg { width: 16px; height: 16px; }
.theme .moon { display: none; }
:root[data-theme="dark"] .theme .sun { display: none; }
:root[data-theme="dark"] .theme .moon { display: block; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme .sun { display: none; }
  :root:not([data-theme="light"]) .theme .moon { display: block; }
}
.lang { font-size: .9rem; color: var(--muted); text-decoration: none; border: 1px solid var(--line); border-radius: 999px; padding: 2px 12px; }

/* 首頁 */
.hero {
  max-width: var(--max); margin: 0 auto; padding: 40px 16px 32px; text-align: center;
  display: grid; gap: 28px; grid-template-areas: "text" "art" "cta";
}
.hero-text { grid-area: text; }
.hero-art { grid-area: art; display: flex; justify-content: center; }
.hero-cta { grid-area: cta; }
.hero-text > :last-child { margin-bottom: 0; }
#rows { display: block; width: 100%; max-width: 400px; height: auto; }
@media (min-width: 760px) {
  .hero {
    text-align: left; align-items: center; column-gap: 48px; padding-top: 64px;
    grid-template-columns: 1fr auto; grid-template-areas: "text art" "cta art";
  }
  .hero-text { align-self: end; }
  .hero-cta { align-self: start; }
  #rows { width: 400px; }
}
.hero h1 { font-size: clamp(2.4rem, 8vw, 3.6rem); line-height: 1.1; margin: 0 0 .3em; letter-spacing: -.02em; }
.hero .tagline { font-size: clamp(1.15rem, 3.5vw, 1.4rem); margin: 0 0 .4em; }
.hero .sub { color: var(--muted); margin: 0 0 1.6em; }
.cta {
  display: inline-block; padding: 12px 26px; border-radius: 999px;
  background: var(--accent); color: var(--accent-text); font-weight: 600; text-decoration: none;
}
.cta[aria-disabled="true"] { opacity: .55; cursor: default; }

.shots {
  max-width: var(--max); margin: 0 auto; padding: 24px 16px 64px;
  display: grid; gap: 28px; grid-template-columns: 1fr;
}
@media (min-width: 720px) { .shots { grid-template-columns: repeat(3, 1fr); gap: 20px; } }
.shot { margin: 0; }
.shot figcaption { margin-top: 10px; text-align: center; font-weight: 600; }

/* 截圖位置：之後可以換成短片（img 換成 video），版面不用改 */
.media {
  aspect-ratio: 16 / 10; width: 100%;
  border-radius: var(--radius); border: 1px solid var(--line); background: var(--surface);
  overflow: hidden; display: grid; place-items: center;
}
.media > img, .media > video { width: 100%; height: 100%; object-fit: cover; object-position: top left; display: block; }
.media .placeholder { color: var(--muted); font-size: .9rem; }

/* 內文頁 */
.doc { max-width: 42rem; margin: 0 auto; padding: 24px 16px 64px; }
.doc h1 { font-size: 2rem; line-height: 1.2; margin: .4em 0 .2em; }
.doc h2 { font-size: 1.2rem; margin: 2em 0 .5em; }
.doc .meta { color: var(--muted); font-size: .9rem; }
.doc ul, .doc ol { padding-left: 1.3em; }
.doc li + li { margin-top: .3em; }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; }

details { border-bottom: 1px solid var(--line); padding: 14px 0; }
details summary { cursor: pointer; font-weight: 600; list-style: none; }
details summary::-webkit-details-marker { display: none; }
details summary::after { content: "+"; float: right; color: var(--muted); }
details[open] summary::after { content: "−"; }
details p, details ul { margin: .6em 0 0; }

.table-wrap { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; font-size: .95rem; }
th, td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { color: var(--muted); font-weight: 600; }
.note { color: var(--muted); font-size: .85rem; margin-top: .6em; }

/* 頁尾 */
.foot {
  border-top: 1px solid var(--line); color: var(--muted); font-size: .9rem;
}
.foot .inner {
  max-width: var(--max); margin: 0 auto; padding: 22px 16px;
  display: flex; flex-wrap: wrap; gap: 8px 20px; justify-content: space-between;
}
.foot nav { display: flex; flex-wrap: wrap; gap: 8px 18px; }
.foot a { color: var(--muted); text-decoration: none; }
.foot a:hover { color: var(--text); }

/* 說明頁 */
.help-search {
  width: 100%; margin: 8px 0 4px; padding: 11px 16px; font: inherit; color: var(--text);
  background: var(--surface); border: 1px solid var(--line); border-radius: 999px; outline: none;
}
.help-search:focus { border-color: var(--accent); }
.help-sec h2 { margin-top: 2.2em; }
.help details summary { display: flex; gap: .4em; }
.help details summary::after { margin-left: auto; padding-left: .6em; }
.help .qn { color: var(--muted); font-weight: 500; min-width: 2.1em; }
.help details > :not(summary) { margin-left: 2.5em; }
.help pre { background: var(--zebra); border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; overflow-x: auto; font-size: .85rem; line-height: 1.5; }
.help code { font-size: .9em; }
.help li + li { margin-top: .2em; }
@media (max-width: 520px) { .help details > :not(summary) { margin-left: 0; } }
