/* OpenShare ADs
 * 意念:香港的街頭生意,遇上港產遊戲和工具。首頁用真實的香港街景和平台上的作品拼貼,
 * 中間一張白卡放標題。背景由淺藍漸變到淺紫;內容放在白色底上;主要按鈕用深墨色;
 * 重點字用黃色螢光筆底線。字型只用昭源黑體(香港字形)。沒有封面的作品用港鐵各線的平面色塊。 */
:root {
  --bg-top: #e3edff;
  --bg-mid: #e9e8ff;
  --bg-bottom: #f1e7ff;
  --surface: #ffffff;
  --surface-2: #eef0fb;
  --ink: #15142b;
  --ink-2: #2d2b55;
  --muted: #535870;
  --line: #d8ddf0;
  --accent: #4b3fd6;
  --accent-dark: #3a2fb3;
  --hl: #ffd23f;
  --red: #c8102e;
  --focus: #1d4ed8;
  --topbar-h: 68px;
  --sidebar-w: 232px;
  --radius: 14px;
  --hei: "Chiron Hei HK", "PingFang HK", "Noto Sans HK", "Microsoft JhengHei", system-ui, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  background-color: var(--bg-mid);
  background-image: linear-gradient(165deg, var(--bg-top) 0%, var(--bg-mid) 48%, var(--bg-bottom) 100%);
  background-attachment: fixed;
  color: var(--ink);
  font-family: var(--hei);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; }
img { display: block; max-width: 100%; }
h1, h2, h3 { margin: 0; line-height: 1.2; }
p { margin: 0; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
::selection { background: var(--accent); color: #fff; }

.visually-hidden, .hp {
  position: absolute !important;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}
.skip {
  position: absolute; left: 16px; top: -48px; z-index: 20;
  padding: 8px 14px; border-radius: 8px;
  background: var(--ink); color: #fff; text-decoration: none;
}
.skip:focus { top: 12px; }

.icon { width: 18px; height: 18px; flex: none; }
.icon-sm { width: 14px; height: 14px; }

/* ---------- 頂部導覽 ---------- */
.topbar {
  position: sticky; top: 0; z-index: 10;
  height: var(--topbar-h);
  display: flex; align-items: center; gap: 36px;
  padding: 0 24px;
  background: rgba(233, 236, 255, 0.86);
  -webkit-backdrop-filter: saturate(1.4) blur(14px);
  backdrop-filter: saturate(1.4) blur(14px);
}
.brand { display: flex; align-items: center; gap: 10px; flex: none; text-decoration: none; }
.logo { width: 32px; height: 32px; flex: none; transition: transform 0.4s var(--ease); }
.brand:hover .logo { transform: rotate(-12deg); }
.brand-name { font-weight: 900; font-size: 1.18rem; letter-spacing: -0.01em; white-space: nowrap; }
.brand-ads { display: inline-block; margin-left: 2px; padding: 0 6px; border-radius: 6px; background: var(--hl); font-size: 0.95em; }
.topnav { display: flex; align-items: center; gap: 4px; }
.topnav-link, .top-link {
  display: inline-flex; align-items: center; height: 40px; padding: 0 14px;
  border-radius: 999px; text-decoration: none; font-weight: 500; white-space: nowrap;
  transition: background-color 0.15s ease;
}
.topnav-link:hover, .top-link:hover { background: rgba(255, 255, 255, 0.7); }
.topnav-link.is-active, .top-link.is-active { background: var(--surface); font-weight: 700; }
.top-actions { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.topnav-mobile { display: none; }

.search {
  display: flex; align-items: center; gap: 10px;
  max-width: 560px; height: 46px; padding: 0 18px; margin-bottom: 28px;
  border-radius: 999px;
  background: var(--surface);
  color: var(--muted);
  transition: box-shadow 0.2s ease;
}
.search:focus-within { outline: 2px solid var(--accent); outline-offset: 0; }
.search input { flex: 1; min-width: 0; border: 0; padding: 0; background: transparent; font: inherit; color: var(--ink); }
.search input::placeholder { color: var(--muted); }
.search input:focus { outline: none; }

.cta {
  display: inline-flex; align-items: center; gap: 6px;
  height: 42px; padding: 0 20px;
  border-radius: 999px;
  background: var(--ink); color: #fff;
  font-weight: 700; text-decoration: none; white-space: nowrap;
  transition: background-color 0.2s ease, transform 0.2s var(--ease);
}
.cta:hover { background: var(--ink-2); }
.cta:active { transform: scale(0.97); }

/* ---------- 版面 ---------- */
.shell { display: flex; align-items: flex-start; }
.sidebar {
  position: sticky; top: var(--topbar-h);
  width: var(--sidebar-w); flex: none;
  height: calc(100vh - var(--topbar-h));
  overflow-y: auto;
  padding: 20px 12px 32px;
  scrollbar-width: thin;
}
.nav-heading { margin: 20px 12px 6px; font-size: 0.8rem; color: var(--muted); }
.nav-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 1px; }
.nav-item {
  display: flex; align-items: center; gap: 11px;
  padding: 7px 12px; border-radius: 8px;
  text-decoration: none; font-size: 0.95rem;
  transition: background-color 0.15s ease;
}
.nav-item .icon { color: var(--muted); transition: color 0.15s ease; }
.nav-item:hover { background: rgba(255, 255, 255, 0.65); }
.nav-item:hover .icon { color: var(--ink); }
.nav-item.is-active { background: var(--surface); font-weight: 700; }
.nav-item.is-active .icon { color: var(--accent); }

.content { flex: 1; min-width: 0; max-width: 1360px; padding: 24px 40px 0; }
/* wide 版面:介紹頁、廣告主、開發者、提交表格 */
.page { max-width: 1440px; margin: 0 auto; padding: 8px 24px 0; }
.page > .form-page, .page > .docs { margin: 32px auto 0; }
.mobile-nav { display: none; }

/* ---------- 列表 ---------- */
.list-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; flex-wrap: wrap; margin-bottom: 28px; }
.list-head h1 { font-family: var(--hei); font-weight: 900; font-size: clamp(2rem, 3.4vw, 3.1rem); letter-spacing: 0.01em; }
.lede { color: var(--muted); font-size: 1.05rem; margin-top: 8px; max-width: 40em; }
.section-title { font-family: var(--hei); font-weight: 900; font-size: 1.5rem; margin: 56px 0 20px; }

.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip, .pill {
  display: inline-flex; align-items: center;
  height: 36px; padding: 0 16px;
  border-radius: 999px;
  background: var(--surface-2);
  font-size: 0.92rem; font-weight: 500;
  text-decoration: none; white-space: nowrap;
  transition: background-color 0.15s ease, color 0.15s ease;
}
.chip:hover, .pill:hover { background: var(--line); }
.chip.is-active, .pill.is-active { background: var(--ink); color: var(--surface); }

/* 精選大圖 */
.spotlight {
  display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(0, 1fr);
  gap: 36px; align-items: center;
  padding: 20px; margin-bottom: 8px;
  border-radius: 20px;
  background: var(--surface);
}
.spotlight-media { display: block; border-radius: 14px; overflow: hidden; text-decoration: none; }
.cover-spotlight { border-radius: 14px; }
.cover-spotlight img { animation: drift 26s ease-in-out infinite alternate; }
.spotlight-text { padding: 8px 16px 8px 0; }
.spotlight-title { font-family: var(--hei); font-weight: 900; font-size: clamp(2.2rem, 4.2vw, 3.8rem); letter-spacing: 0.02em; }
.spotlight-title a { text-decoration: none; }
.spotlight-title a:hover { color: var(--accent); }
.spotlight-tagline { font-size: 1.15rem; line-height: 1.6; margin-top: 14px; }
.spotlight .meta { margin-top: 14px; }
.spotlight-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 26px; }
@keyframes drift { from { transform: scale(1); } to { transform: scale(1.07) translate(-1%, -1%); } }

/* 卡片 */
.grid {
  list-style: none; margin: 0; padding: 0;
  display: grid; gap: 36px 24px;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 290px), 1fr));
}
.card { display: flex; }
.card-link { display: flex; flex-direction: column; width: 100%; text-decoration: none; transition: transform 0.3s var(--ease); }
.card-link:hover { transform: translateY(-4px); }
.card-link:active { transform: translateY(-1px); }
.cover {
  position: relative;
  aspect-ratio: 16 / 9;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--surface-2);
}
.cover img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.6s var(--ease); }
.card-link:hover .cover img { transform: scale(1.06); }
.card-body { padding: 14px 2px 0; }
.card-title { font-size: 1.15rem; font-weight: 700; display: flex; align-items: center; gap: 8px; transition: color 0.15s ease; }
.card-link:hover .card-title { color: var(--accent); }
.card-tagline { margin-top: 6px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 4px; color: var(--muted); font-size: 0.9rem; }
.dot { opacity: 0.7; }

/* 印章式的「精選」 */
.mark-featured, .mark-sdk, .mark-ads {
  display: inline-block;
  padding: 1px 6px; border-radius: 3px;
  background: var(--red); color: #fff;
  font-family: var(--hei); font-weight: 900; font-size: 0.75rem; line-height: 1.6;
  white-space: nowrap;
}
.mark-sdk { background: var(--accent); font-family: var(--hei); font-weight: 700; }
.mark-ads { background: var(--surface-2); color: var(--ink); font-family: var(--hei); font-weight: 700; }
.meta .mark-featured { margin-right: 4px; }

/* 沒有封面:港鐵色平面色塊,名稱用宋體排在左下 */
.cover-art { display: flex; flex-direction: column; justify-content: space-between; padding: 18px 20px; color: #fff; }
.cover-name {
  order: 2;
  font-family: var(--hei); font-weight: 900; line-height: 1.1;
  font-size: clamp(1.7rem, 2.6vw, 2.4rem);
  transition: transform 0.6s var(--ease);
  transform-origin: left bottom;
}
.card-link:hover .cover-name { transform: scale(1.05); }
.cover-cat { order: 1; font-size: 0.85rem; font-weight: 700; opacity: 0.9; }
.tone-0 { background: #0075c2; }   /* 港島線藍 */
.tone-1 { background: #d71920; }   /* 荃灣線紅 */
.tone-2 { background: #00843d; }   /* 觀塘線綠 */
.tone-3 { background: #c4621d; }   /* 東涌線橙 */
.tone-4 { background: #923a27; }   /* 屯馬線啡 */
.tone-5 { background: #00788a; }   /* 迪士尼綫青 */

/* 邀請提交 */
.card-invite { min-height: 100%; }
.invite {
  display: flex; flex-direction: column; justify-content: flex-end; gap: 10px;
  width: 100%; min-height: 280px; padding: 26px;
  border-radius: var(--radius);
  background: var(--accent); color: #fff;
  text-decoration: none;
  transition: background-color 0.2s ease, transform 0.3s var(--ease);
}
.invite:hover { background: var(--accent-dark); transform: translateY(-4px); }
.invite-title { font-family: var(--hei); font-weight: 900; font-size: 2rem; line-height: 1.15; }
.invite-text { opacity: 0.92; max-width: 22em; }
.invite-action { display: inline-flex; align-items: center; gap: 6px; font-weight: 700; margin-top: 6px; }
.invite:hover .invite-action .icon { transform: translateX(4px); }
.invite-action .icon { transition: transform 0.2s var(--ease); }

.empty-note { padding: 20px 0 28px; color: var(--muted); font-size: 1.05rem; }
.empty-note a { color: var(--accent); font-weight: 700; }

/* ---------- 作品頁 ---------- */
.detail { max-width: 1040px; }
/* 1.91:1 是網站分享圖(og:image)的標準比例,分享圖可以完整顯示。 */
.cover-hero { aspect-ratio: 1.91 / 1; border-radius: 18px; }
.cover-hero .cover-name { font-size: clamp(2.4rem, 6vw, 4.5rem); }
.detail-head { display: flex; gap: 20px; align-items: center; margin: 28px 0 22px; }
.detail-title h1 { font-family: var(--hei); font-weight: 900; font-size: clamp(2rem, 4vw, 3.2rem); letter-spacing: 0.02em; }
.app-icon { width: 56px; height: 56px; border-radius: 14px; flex: none; object-fit: cover; }
.app-icon-lg { width: 96px; height: 96px; border-radius: 22px; }
.app-icon-letter { display: grid; place-items: center; color: #fff; font-family: var(--hei); font-weight: 900; font-size: 2.6rem; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 40px; }
.detail-grid { display: grid; grid-template-columns: minmax(0, 1fr) 280px; gap: 48px; align-items: start; }
.prose h2, .docs h2, .form-section h2 { font-family: var(--hei); font-weight: 900; font-size: 1.5rem; margin-bottom: 14px; }
.prose p { font-size: 1.06rem; line-height: 1.85; white-space: pre-line; }
.prose p + p { margin-top: 14px; }
.facts { background: var(--surface); border-radius: 14px; padding: 6px 20px; }
.facts dl { margin: 0; }
.facts dl > div { display: flex; justify-content: space-between; gap: 16px; padding: 12px 0; }
.facts dl > div + div { border-top: 1px solid var(--line); }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; font-weight: 700; text-align: right; }
.facts a { color: var(--accent); }

/* ---------- 按鈕 ---------- */
button, .button {
  font: inherit;
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  height: 44px; padding: 0 20px;
  border: 0; border-radius: 999px;
  background: var(--surface-2); color: var(--ink);
  font-weight: 700; text-decoration: none; white-space: nowrap;
  cursor: pointer;
  transition: background-color 0.15s ease, transform 0.15s var(--ease);
}
button:hover, .button:hover { background: var(--line); }
button:active, .button:active { transform: scale(0.97); }
.button-primary, .button-ink { background: var(--ink); color: #fff; }
.button-primary:hover, .button-ink:hover { background: var(--ink-2); }
.button-line { background: var(--surface); color: var(--ink); box-shadow: inset 0 0 0 1.5px var(--ink); }
.button-line:hover { background: var(--surface-2); }
.button-light { background: #fff; color: var(--ink); }
.button-light:hover { background: var(--hl); }
.button-ghost { background: transparent; color: #fff; box-shadow: inset 0 0 0 1.5px rgba(255, 255, 255, 0.5); }
.button-ghost:hover { background: rgba(255, 255, 255, 0.12); }
.button-lg { height: 52px; padding: 0 30px; font-size: 1.05rem; }
.button-small { height: 34px; padding: 0 14px; font-size: 0.88rem; }
.button-danger { color: var(--red); }
.page-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 24px; }

/* ---------- 表格 ---------- */
input, select, textarea {
  font: inherit; color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 11px 13px;
  width: 100%;
  transition: border-color 0.15s ease;
}
input:hover, select:hover, textarea:hover { border-color: var(--muted); }
input:focus, select:focus, textarea:focus { border-color: var(--accent); outline: 2px solid var(--accent); outline-offset: -1px; }
textarea { resize: vertical; }
input[aria-invalid="true"], select[aria-invalid="true"], textarea[aria-invalid="true"] { border-color: var(--red); }

.form-page { max-width: 720px; }
.form-page h1, .docs h1, .admin-head h1 { font-family: var(--hei); font-weight: 900; font-size: clamp(2rem, 3.4vw, 3rem); }
.form { display: flex; flex-direction: column; gap: 20px; margin-top: 28px; }
.form-section { display: flex; flex-direction: column; gap: 20px; padding: 26px; border-radius: 16px; background: var(--surface); }
.form-section h2 { margin-bottom: 0; }
.form-note { color: var(--muted); max-width: 40em; }
.field { display: flex; flex-direction: column; gap: 7px; border: 0; padding: 0; margin: 0; min-width: 0; }
.field label, .field legend { font-weight: 700; padding: 0; }
.hint { color: var(--muted); font-size: 0.9rem; }
.field-error { color: var(--red); font-size: 0.9rem; font-weight: 500; }
.link-row { display: grid; grid-template-columns: 10em 1fr; gap: 8px; margin-top: 6px; }
.check { flex-direction: row; flex-wrap: wrap; align-items: flex-start; gap: 10px; }
.check input { width: 20px; height: 20px; margin-top: 3px; flex: none; accent-color: var(--accent); }
.check label { flex: 1; font-weight: 400; }
.check .field-error { flex-basis: 100%; }
.form > .button-primary { align-self: flex-start; }
.alert { background: #fbe9e9; color: var(--ink); border-radius: 10px; padding: 12px 16px; margin-top: 16px; }

/* ---------- SDK 說明 ---------- */
.docs { max-width: 820px; }
.docs-head { margin-bottom: 12px; }
/* 告示:像街坊告示貼在牆上,紅色印章色的粗邊 */
.notice { margin: 8px 0 28px; padding: 22px 24px; border-left: 6px solid var(--red); border-radius: 0 var(--radius) var(--radius) 0; background: var(--surface); display: flex; flex-direction: column; gap: 10px; max-width: 46em; }
.notice-title { font-family: var(--hei); font-weight: 900; font-size: 1.35rem; }
.docs-section { margin-top: 48px; }
.docs p { margin-top: 12px; }
.docs a:not(.button) { color: var(--accent); font-weight: 700; }
.steps, .rules { margin: 0; padding-left: 1.4em; display: flex; flex-direction: column; gap: 12px; font-size: 1.04rem; }
.steps li::marker { font-family: var(--hei); font-weight: 900; color: var(--accent); }
code { font-family: var(--mono); font-size: 0.9em; background: var(--surface-2); padding: 1px 5px; border-radius: 4px; }
pre {
  margin: 16px 0 0; padding: 18px 20px;
  border-radius: 12px;
  background: var(--ink); color: #f1eee6;
  overflow-x: auto; font-size: 0.88rem; line-height: 1.6;
}
pre code { background: none; padding: 0; color: inherit; }
.table { width: 100%; border-collapse: collapse; margin-top: 16px; font-size: 0.95rem; }
.table th, .table td { text-align: left; padding: 11px 12px 11px 0; border-bottom: 1px solid var(--line); vertical-align: top; }
.table th { font-weight: 700; color: var(--muted); font-size: 0.85rem; }
.table .num { text-align: right; font-variant-numeric: tabular-nums; padding-right: 0; padding-left: 12px; white-space: nowrap; }
.table-wrap { overflow-x: auto; }
.table .nowrap, .table th { white-space: nowrap; }
.table .actions-cell { padding-right: 0; }

/* ---------- 管理後台 ---------- */
.admin-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.tabs { display: flex; gap: 8px; }
.admin-group { margin-top: 40px; }
.admin-group h2 { font-size: 1.15rem; display: flex; align-items: center; gap: 8px; }
.group-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.count { color: var(--muted); font-weight: 500; font-size: 0.9rem; }
.admin-list { list-style: none; margin: 14px 0 0; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.admin-item { display: grid; grid-template-columns: 200px 1fr; gap: 20px; padding: 16px; border-radius: 14px; background: var(--surface); }
.admin-thumb { border-radius: 10px; }
.admin-thumb .cover-name { font-size: 1.3rem; }
.admin-main { min-width: 0; overflow-wrap: anywhere; display: flex; flex-direction: column; gap: 4px; }
.admin-title { font-weight: 700; font-size: 1.05rem; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.admin-actions, .row-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.row-actions { margin-top: 0; justify-content: flex-end; }
.admin-form { display: grid; gap: 8px; margin-top: 12px; max-width: 560px; }
.admin-form label { display: flex; flex-direction: column; gap: 4px; font-size: 0.88rem; color: var(--muted); }
.admin-form .button { justify-self: start; }
.admin-form-row { grid-template-columns: 1fr 1fr auto; align-items: end; max-width: 760px; }
.admin-campaign-form { margin-top: 14px; padding: 24px; border-radius: 16px; background: var(--surface); }
.form-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.field-wide { grid-column: span 3; }
.check-grid { display: flex; flex-wrap: wrap; gap: 8px 18px; margin-top: 4px; }
.check-inline { display: inline-flex; align-items: center; gap: 6px; font-weight: 400 !important; }
.check-inline input { width: 18px; height: 18px; accent-color: var(--accent); }
.sdk-block { margin-top: 8px; font-size: 0.9rem; }
.sdk-block pre { margin-top: 8px; font-size: 0.8rem; }
.plain-list { margin: 10px 0 0; padding-left: 1.2em; }
.link-list { padding-left: 1.2em; }
.muted { color: var(--muted); font-size: 0.9rem; }
.prewrap { white-space: pre-line; margin: 8px 0; }
.inline { display: inline; margin: 0; }
details summary { cursor: pointer; color: var(--muted); font-size: 0.9rem; margin-top: 4px; }

/* ---------- 介紹頁 ---------- */
/* 首屏拼貼:五欄相片,中間三欄的下半部是白卡。 */
.hero {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  grid-template-rows: 220px minmax(150px, auto) 220px;
  grid-template-areas:
    "a b c d e"
    "a k k k e"
    "f k k k g";
  gap: 8px;
}
.tile { position: relative; margin: 0; overflow: hidden; border-radius: 18px; background: var(--surface-2); }
.tile img { width: 100%; height: 100%; object-fit: cover; }
.tile-a { grid-area: a; } .tile-b { grid-area: b; } .tile-c { grid-area: c; } .tile-d { grid-area: d; }
.tile-e { grid-area: e; } .tile-f { grid-area: f; } .tile-g { grid-area: g; }
.tile figcaption {
  position: absolute; left: 10px; bottom: 10px;
  padding: 3px 10px; border-radius: 999px;
  background: rgba(21, 20, 43, 0.74); color: #fff;
  font-size: 0.78rem; font-weight: 500;
}
.hero-card {
  grid-area: k;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 48px 44px 36px;
  border-radius: 28px;
  background: var(--surface);
  text-align: center;
}
.hero-title { font-weight: 900; font-size: clamp(2.6rem, 5.2vw, 4.8rem); line-height: 1.14; letter-spacing: 0.01em; }
/* 黃色螢光筆底線 */
.hl {
  padding: 0 0.06em;
  background: linear-gradient(transparent 60%, var(--hl) 60%, var(--hl) 94%, transparent 94%);
  -webkit-box-decoration-break: clone; box-decoration-break: clone;
}
.hero-lede { max-width: 34em; margin-top: 22px; color: var(--muted); font-size: 1.08rem; line-height: 1.7; }
.hero-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; margin-top: 28px; }
.hero-search {
  display: flex; align-items: center; gap: 8px;
  width: min(100%, 520px); height: 54px; margin-top: 26px; padding: 0 7px 0 20px;
  border-radius: 999px; background: var(--surface); box-shadow: inset 0 0 0 1px var(--line);
}
.hero-search:focus-within { box-shadow: inset 0 0 0 2px var(--accent); }
.hero-search input { flex: 1; min-width: 0; height: 100%; padding: 0; border: 0; background: transparent; }
.hero-search input:focus { outline: none; }
.hero-search button { width: 40px; height: 40px; padding: 0; flex: none; background: var(--ink); color: #fff; }
.hero-search button:hover { background: var(--ink-2); }
.hero-search button .icon { transform: rotate(-90deg); }

.section-title-lg, .duo-panel h2, .showcase-text h2, .works-head h2, .band h2, .page-head h1, .enquiry h2, .points h3 { font-weight: 900; }
.section-lede { margin-top: 14px; color: var(--muted); font-size: 1.05rem; max-width: 36em; }

.duo { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin-top: 96px; }
.duo-panel { display: flex; flex-direction: column; gap: 26px; padding: 44px 40px 40px; border-radius: 28px; background: var(--surface); }
.duo-panel h2 { font-size: clamp(1.6rem, 2.6vw, 2.3rem); line-height: 1.3; max-width: 14em; }
.duo-dark { background: var(--ink); color: #fff; }
.ticks { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 16px; font-size: 1.04rem; line-height: 1.7; }
.ticks li { position: relative; padding-left: 28px; }
.ticks li::before { content: ""; position: absolute; left: 0; top: 0.5em; width: 14px; height: 14px; border-radius: 50%; background: var(--accent); }
.duo-dark .ticks li::before { background: var(--hl); }
.duo-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: auto; }

.showcase { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 64px; align-items: center; margin-top: 120px; }
.demo { margin: 0; }
.demo-screen { position: relative; aspect-ratio: 4 / 3.3; overflow: hidden; border-radius: 26px; background: var(--ink); }
.demo-screen > img { width: 100%; height: 100%; object-fit: cover; }
/* 與 SDK 的全螢幕獎勵廣告相同的排法:上面狀態列,中間廣告,下面領取按鈕 */
.demo-overlay {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px;
  padding: 16px; background: rgba(20, 20, 18, 0.72);
  font-size: 14px;
}
.demo-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; width: 300px; max-width: 100%; color: #fff; }
.demo-close { padding: 5px 14px; border-radius: 999px; background: rgba(255, 255, 255, 0.16); }
.demo-ad { position: relative; display: flex; flex-direction: column; width: 300px; max-width: 100%; height: 250px; overflow: hidden; border-radius: 12px; background: #fbfaf6; }
.demo-ad-img { height: 118px; flex: none; }
.demo-ad-img img { width: 100%; height: 100%; object-fit: cover; }
.demo-ad-label { position: absolute; top: 0; right: 0; z-index: 1; padding: 1px 6px 2px; border-bottom-left-radius: 6px; background: #ece9e1; color: #4f4c44; font-size: 10px; line-height: 1.5; }
.demo-ad-label b { color: #1a1a17; }
.demo-ad-title { margin: 8px 12px 0; font-weight: 700; font-size: 15px; line-height: 1.3; color: #1a1a17; }
.demo-ad-text { margin: 3px 12px 0; font-size: 12.5px; line-height: 1.4; color: #4f4c44; }
.demo-ad-cta { align-self: flex-start; margin: auto 12px 12px; padding: 7px 14px; border-radius: 999px; background: var(--ink); color: #fff; font-size: 12.5px; font-weight: 700; }
.demo-claim { width: 300px; max-width: 100%; padding: 11px 18px; border-radius: 999px; background: var(--ink); color: #fff; font-weight: 700; text-align: center; opacity: 0.55; }
.demo figcaption { margin-top: 14px; color: var(--muted); font-size: 0.92rem; }
.showcase-text h2 { font-size: clamp(1.9rem, 3.2vw, 2.8rem); line-height: 1.2; }
.formats { margin: 28px 0 0; }
.formats > div { display: grid; grid-template-columns: 6.5em minmax(0, 1fr); gap: 16px; padding: 16px 0; border-top: 1px solid var(--line); }
.formats > div:last-child { border-bottom: 1px solid var(--line); }
.formats dt { font-weight: 700; }
.formats dd { margin: 0; }

.works { margin-top: 120px; }
.works-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 28px; }
.works-head h2 { font-size: clamp(1.9rem, 3.2vw, 2.8rem); }
.works-head .button { background: var(--surface); }

.band { margin-top: 120px; padding: 72px 32px; border-radius: 32px; background: var(--surface); text-align: center; }
.band h2 { font-size: clamp(2rem, 4.4vw, 3.6rem); line-height: 1.2; }
.band p { max-width: 32em; margin: 18px auto 0; color: var(--muted); font-size: 1.08rem; }
.band .band-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; margin-top: 30px; }

/* ---------- 廣告主 ---------- */
.page-head { max-width: 860px; padding-top: 40px; }
.page-head h1 { font-size: clamp(2.4rem, 5.4vw, 4.4rem); line-height: 1.15; }
.page-head .lede { font-size: 1.12rem; line-height: 1.75; max-width: 36em; margin-top: 18px; }
.strip { display: grid; grid-template-columns: 1.35fr 1fr 1fr; gap: 8px; height: clamp(200px, 28vw, 360px); margin-top: 44px; }
.points { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 40px; margin-top: 72px; }
.point { padding-top: 22px; border-top: 3px solid var(--ink); }
.point h3 { font-size: 1.45rem; }
.point p { margin-top: 12px; font-size: 1.04rem; line-height: 1.75; }
.page .docs-section { max-width: 980px; }
.page .docs-section h2 { font-weight: 900; font-size: clamp(1.7rem, 2.8vw, 2.4rem); margin-bottom: 4px; }
.enquiry {
  display: grid; grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr); gap: 56px;
  margin-top: 96px; padding: 48px; border-radius: 32px; background: var(--surface);
  scroll-margin-top: calc(var(--topbar-h) + 16px);
}
.enquiry h2 { font-size: clamp(1.9rem, 3.2vw, 2.8rem); line-height: 1.2; }
.enquiry-intro p { margin-top: 16px; font-size: 1.04rem; line-height: 1.75; }
.enquiry-intro .muted { font-size: 0.92rem; }
.enquiry-form { margin-top: 0; }
.enquiry-form input, .enquiry-form select, .enquiry-form textarea { background: var(--surface-2); border-color: transparent; }
.enquiry-form input:hover, .enquiry-form select:hover, .enquiry-form textarea:hover { border-color: var(--line); }
.enquiry-form .check input { background: none; }
.enquiry-form > .button { align-self: flex-start; }
.field-pair { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.admin-lead { padding: 16px 18px; border-radius: 14px; background: var(--surface); display: flex; flex-direction: column; gap: 4px; overflow-wrap: anywhere; }
.admin-lead a { color: var(--accent); }

/* ---------- 頁尾 ---------- */
.site-footer { margin-top: 120px; padding: 40px 0 48px; border-top: 1px solid var(--line); }
.footer-top { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px 32px; flex-wrap: wrap; }
.footer-top .footer-links { margin-top: 0; }
.credits { margin-top: 20px; color: var(--muted); font-size: 0.78rem; line-height: 1.7; max-width: 70em; }
.credits a { color: inherit; }
.footer-name {
  font-family: var(--hei); font-weight: 900;
  font-size: clamp(2.4rem, 7vw, 5.6rem); line-height: 1;
  letter-spacing: -0.01em;
}
.footer-line { color: var(--muted); margin-top: 16px; max-width: 40em; }
.footer-links { display: flex; flex-wrap: wrap; gap: 8px 24px; margin-top: 16px; }
.footer-links a { font-weight: 700; text-decoration: none; }
.footer-links a:hover { color: var(--accent); text-decoration: underline; text-underline-offset: 4px; }

/* ---------- 動態:卡片隨捲動浮現(只用 CSS;不支援的瀏覽器直接顯示)。首屏內容不做進場動畫,一載入就看到。 ---------- */
@media (prefers-reduced-motion: no-preference) {
  @supports (animation-timeline: view()) {
    .grid > .card {
      animation: rise linear both;
      animation-timeline: view();
      animation-range: entry 0% entry 35%;
    }
  }
}
@keyframes rise { from { opacity: 0; transform: translateY(28px); } to { opacity: 1; transform: none; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ---------- 平板與手機 ---------- */
@media (max-width: 1100px) {
  .hero { grid-template-rows: 170px minmax(150px, auto) 170px; }
  .hero-card { padding: 40px 28px 30px; }
  .showcase { grid-template-columns: 1fr; gap: 36px; }
  .demo { max-width: 680px; }
  .enquiry { grid-template-columns: 1fr; gap: 28px; padding: 36px; }
  .spotlight { grid-template-columns: 1fr; gap: 20px; }
  .spotlight-text { padding: 0 8px 8px; }
  .detail-grid { grid-template-columns: 1fr; gap: 32px; }
}
@media (max-width: 900px) {
  .sidebar { display: none; }
  .topbar { padding: 0 16px; gap: 12px; height: 60px; }
  .topnav, .top-link { display: none; }
  .topnav-mobile {
    display: flex; gap: 4px;
    overflow-x: auto; scrollbar-width: none;
    padding: 4px 10px 8px;
  }
  .topnav-mobile::-webkit-scrollbar { display: none; }
  .content { padding: 12px 16px 0; }
  .page { padding: 4px 16px 0; }
  .hero {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    grid-template-rows: 120px auto;
    grid-template-areas: "b c d" "k k k";
    gap: 6px;
  }
  .tile-a, .tile-e, .tile-f, .tile-g { display: none; }
  .tile { border-radius: 14px; }
  .tile figcaption { left: 6px; bottom: 6px; padding: 2px 8px; font-size: 0.7rem; }
  .hero-card { padding: 36px 20px 24px; border-radius: 22px; }
  .duo { grid-template-columns: 1fr; margin-top: 64px; }
  .duo-panel { padding: 32px 24px; border-radius: 22px; }
  .showcase, .works, .band { margin-top: 80px; }
  .band { padding: 52px 20px; border-radius: 24px; }
  .points { grid-template-columns: 1fr; gap: 28px; margin-top: 48px; }
  .enquiry { margin-top: 64px; padding: 28px 20px; border-radius: 24px; }
  .mobile-nav {
    display: flex; gap: 8px;
    overflow-x: auto; scrollbar-width: none;
    margin: 0 -16px 24px; padding: 0 16px 2px;
  }
  .mobile-nav::-webkit-scrollbar { display: none; }
  .admin-item { grid-template-columns: 1fr; }
  .form-grid { grid-template-columns: 1fr; }
  .field-wide { grid-column: auto; }
  .admin-form-row { grid-template-columns: 1fr; }
  .site-footer { margin-top: 80px; }
}
@media (max-width: 560px) {
  .brand-name { font-size: 1.05rem; }
  .cta { height: 38px; padding: 0 14px; font-size: 0.92rem; }
  .hero { grid-template-rows: 88px auto; }
  .hero-title { font-size: clamp(2.1rem, 10.5vw, 2.8rem); }
  .hero-lede { font-size: 1rem; }
  .hero-actions .button { flex: 1 1 auto; }
  .tile figcaption { display: none; }
  .demo-screen { aspect-ratio: auto; height: 470px; }
  .formats > div { grid-template-columns: 1fr; gap: 4px; }
  .field-pair { grid-template-columns: 1fr; }
  .strip { grid-template-columns: 1fr 1fr; height: 160px; }
  .strip .tile:nth-child(3) { display: none; }
  .spotlight { padding: 12px; border-radius: 16px; }
  .detail-head { align-items: flex-start; gap: 14px; }
  .app-icon-lg { width: 68px; height: 68px; border-radius: 16px; }
  .link-row { grid-template-columns: 1fr; }
  .form-section { padding: 18px; }
  .cover-hero { border-radius: 14px; }
}
