/* 麻糬棋館支援頁與隱私權政策；色票照 docs/design-direction.md 3.2（淺色、深色兩欄），字級照 3.1 */

:root {
  color-scheme: light dark;
  --font: ui-rounded, "SF Pro Rounded", -apple-system, "PingFang TC", "Noto Sans TC", sans-serif;
  --bg: #FBF3E4;
  --surface: #F3E6CF;
  --text-1: #3A2A1C;
  --text-2: #6B5440;
  --border: #9A7B55;
  --primary: #4A3323;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #1F1813;
    --surface: #2B221A;
    --text-1: #F3E8D6;
    --text-2: #C9B79C;
    --border: #8C7455;
    --primary: #F3E8D6;
  }
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text-1);
  font-family: var(--font);
  font-size: 17px;
  line-height: 28px;
  font-weight: 400;
  letter-spacing: 0;
  overflow-wrap: break-word;
}

h1,
h2,
p,
ol,
ul,
pre {
  margin: 0;
}

/* 單欄置中；640 不含左右內距 */
.page {
  max-width: 640px;
  box-sizing: content-box;
  margin: 0 auto;
  padding: 48px 16px;
}

@media (min-width: 600px) {
  .page {
    padding-left: 24px;
    padding-right: 24px;
  }
}

/* 頁首：App 名＋語言切換 */
.site-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 16px;
}

.app-name {
  font-size: 17px;
  line-height: 28px;
  font-weight: 600;
}

.lang-switch {
  display: flex;
  flex-wrap: wrap;
  column-gap: 16px;
}

.lang-switch a {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
}

.lang-switch a[aria-current="page"] {
  font-weight: 700;
  text-decoration: none;
}

main {
  margin-top: 32px;
}

h1 {
  font-size: 28px;
  line-height: 36px;
  font-weight: 700;
}

h2 {
  font-size: 22px;
  line-height: 28px;
  font-weight: 700;
}

main > * + * {
  margin-top: 16px;
}

main > * + h2 {
  margin-top: 32px;
}

main > h2 + * {
  margin-top: 8px;
}

ol,
ul {
  padding-left: 24px;
}

li + li {
  margin-top: 8px;
}

/* 規格裡的數字與字串 */
code {
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  overflow-wrap: anywhere;
}

/* 連結：text-1 加底線，不用藍色 */
a {
  color: var(--text-1);
  text-decoration-line: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.15em;
}

@media (hover: hover) {
  a:hover {
    text-decoration-thickness: 2px;
  }
}

a:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
  border-radius: 8px;
}

/* 信箱獨立一列，整列是一個 mailto 連結 */
a.email {
  display: block;
  min-height: 44px;
  padding: 12px 16px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--surface);
  overflow-wrap: anywhere;
}

/* 頁尾：meta 級 */
.site-footer {
  margin-top: 48px;
  color: var(--text-2);
  font-size: 13px;
  line-height: 18px;
}

.site-footer a {
  display: inline-flex;
  min-width: 44px;
  min-height: 44px;
  align-items: center;
}

/* 根頁 site/index.html 的備用連結 */
.fallback {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
}

sup { line-height: 0; }
code { white-space: nowrap; }
