/* ---------------------------------------------
   me.roboyeti.tw — Notion 風格的清爽版面
--------------------------------------------- */

:root {
  --text: rgb(55, 53, 47);
  --text-muted: rgba(55, 53, 47, 0.65);
  --text-faint: rgba(55, 53, 47, 0.45);
  --bg: #f5f9fd;
  --bg-hover: rgba(55, 53, 47, 0.06);
  --border: rgba(55, 53, 47, 0.12);
  --callout: #e9f0f7;
  --link: rgb(35, 131, 226);
  --code-bg: rgba(135, 131, 120, 0.15);
  --code-fg: #eb5757;
  --page-width: 720px;
  --sans: ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang TC",
    "Noto Sans TC", "Microsoft JhengHei", Helvetica, Arial, sans-serif;
  --mono: "SFMono-Regular", Menlo, Consolas, "Liberation Mono", monospace;
}

* {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.7;
}

/* 頁面主體：固定寬度 */
.page {
  width: 100%;
  max-width: var(--page-width);
  margin: 0 auto;
  padding: 80px 24px 64px;
}

.page-icon {
  font-size: 78px;
  line-height: 1;
  margin-bottom: 12px;
  user-select: none;
}

.page-title {
  font-size: 40px;
  font-weight: 700;
  line-height: 1.2;
  margin: 0 0 16px;
}

hr {
  border: 0;
  border-top: 1px solid var(--border);
  margin: 16px 0;
}

/* 目錄 */
.toc {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-bottom: 8px;
}

.toc a {
  color: var(--text-muted);
  font-size: 14px;
  padding: 2px 8px;
  border-radius: 4px;
  text-decoration: none;
}

.toc a:hover {
  background: var(--bg-hover);
  color: var(--text);
}

/* 標題與段落 */
h2 {
  font-size: 30px;
  font-weight: 600;
  line-height: 1.3;
  margin: 40px 0 8px;
  scroll-margin-top: 16px;
}

h3 {
  font-size: 20px;
  font-weight: 600;
  line-height: 1.3;
  margin: 28px 0 6px;
}

p {
  margin: 4px 0 8px;
}

ul {
  margin: 4px 0 8px;
  padding-left: 1.6em;
}

li {
  margin: 2px 0;
}

a {
  color: inherit;
  text-decoration: underline;
  text-decoration-color: rgba(55, 53, 47, 0.4);
  text-underline-offset: 3px;
}

a:hover {
  color: var(--link);
  text-decoration-color: var(--link);
}

code {
  font-family: var(--mono);
  font-size: 85%;
  color: var(--code-fg);
  background: var(--code-bg);
  border-radius: 4px;
  padding: 0.2em 0.4em;
}

s {
  color: var(--text-faint);
}

.muted {
  color: var(--text-muted);
}

/* 圖片 */
.image {
  margin: 12px 0;
}

.image img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 4px;
}

/* 連結卡片 */
.links {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  margin-top: 12px;
}

.link-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 4px;
  text-decoration: none;
  transition: background 0.12s ease;
}

.link-card:hover {
  background: var(--bg-hover);
  color: inherit;
}

.link-icon {
  font-size: 20px;
  line-height: 1;
}

.link-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.link-title {
  font-weight: 500;
  font-size: 14px;
}

.link-sub {
  color: var(--text-muted);
  font-size: 13px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* 標籤 */
.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 8px 0;
}

.tag {
  font-size: 14px;
  line-height: 1.5;
  padding: 0 8px;
  border-radius: 4px;
  white-space: nowrap;
}

.tag-gray   { background: rgb(227, 226, 224); color: rgb(50, 48, 44); }
.tag-red    { background: rgb(255, 226, 221); color: rgb(93, 23, 21); }
.tag-blue   { background: rgb(211, 229, 239); color: rgb(24, 51, 71); }
.tag-orange { background: rgb(250, 222, 201); color: rgb(73, 41, 14); }
.tag-purple { background: rgb(232, 222, 238); color: rgb(65, 36, 84); }
.tag-green  { background: rgb(219, 237, 219); color: rgb(28, 56, 41); }

/* Callout */
.callout {
  display: flex;
  gap: 12px;
  padding: 16px 16px 12px 12px;
  margin: 8px 0;
  background: var(--callout);
  border-radius: 4px;
}

.callout-icon {
  font-size: 20px;
  line-height: 1.4;
  flex: 0 0 auto;
}

.callout p:first-child {
  margin-top: 0;
}

.callout p:last-child {
  margin-bottom: 0;
}

/* Footer */
.footer {
  margin-top: 56px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
  color: var(--text-faint);
  font-size: 13px;
}

/* RWD */
@media (max-width: 600px) {
  body {
    font-size: 15px;
  }

  .page {
    padding: 48px 16px 48px;
  }

  .page-icon {
    font-size: 64px;
  }

  .page-title {
    font-size: 32px;
  }

  h2 {
    font-size: 24px;
    margin-top: 32px;
  }

  h3 {
    font-size: 18px;
  }

  .links {
    grid-template-columns: 1fr;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  * {
    transition: none !important;
  }
}
