:root {
  --bg: #f7f7f5;
  --surface: #ffffff;
  --text: #1d1d1f;
  --muted: #5f6368;
  --line: #e3e3e0;
  --accent: #6d4bd8;
  --accent-soft: #efeafd;
  --gold: #8a5a00;
  --gold-soft: #fbefd2;
  --merit: #3f5a73;
  --merit-soft: #e4ebf2;
  --shadow: 0 1px 2px rgba(0,0,0,.04), 0 4px 16px rgba(0,0,0,.05);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #121214;
    --surface: #1c1c1f;
    --text: #ececec;
    --muted: #a0a0a6;
    --line: #2e2e33;
    --accent: #a78bfa;
    --accent-soft: #2a2340;
    --gold: #f2c45a;
    --gold-soft: #3a2e12;
    --merit: #a9c1d8;
    --merit-soft: #1f2a35;
    --shadow: none;
  }
}
:root[data-theme="dark"] {
  --bg: #121214;
  --surface: #1c1c1f;
  --text: #ececec;
  --muted: #a0a0a6;
  --line: #2e2e33;
  --accent: #a78bfa;
  --accent-soft: #2a2340;
  --gold: #f2c45a;
  --gold-soft: #3a2e12;
  --merit: #a9c1d8;
  --merit-soft: #1f2a35;
  --shadow: none;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.75 -apple-system, BlinkMacSystemFont, "PingFang TC", "Noto Sans TC", "Microsoft JhengHei", sans-serif;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
.wrap { max-width: 880px; margin: 0 auto; padding: 0 16px; }
.en { color: var(--muted); font-size: .9em; }

header.hero { padding: 72px 0 48px; }
.hero h1 { font-size: clamp(2rem, 6vw, 2.75rem); line-height: 1.2; margin: 0 0 8px; letter-spacing: -.01em; }
.hero .role { font-size: 1.15rem; color: var(--muted); margin: 0 0 20px; }
.hero p { max-width: 640px; margin: 0 0 8px; }
.hero .links { margin-top: 24px; display: flex; flex-wrap: wrap; gap: 10px; }
.btn {
  display: inline-block; padding: 8px 16px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--surface); color: var(--text); font-size: .95rem;
}
.btn:hover { text-decoration: none; border-color: var(--accent); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }

section { padding: 40px 0; border-top: 1px solid var(--line); }
section > .wrap > h2 { font-size: 1.4rem; margin: 0 0 4px; }
section > .wrap > .en { margin: 0 0 24px; }

.app {
  background: var(--surface); border: 1px solid var(--line); border-radius: 16px;
  box-shadow: var(--shadow); padding: 24px; margin-bottom: 24px;
}
.app-head { display: flex; gap: 16px; align-items: center; margin-bottom: 12px; }
.app-head img { width: 72px; height: 72px; border-radius: 16px; flex: none; }
.app-head h3 { margin: 0; font-size: 1.25rem; line-height: 1.3; }
.app-head .tag { color: var(--muted); font-size: .9rem; }
.app p { margin: 0 0 12px; }
.credit { font-size: .9rem; color: var(--muted); background: var(--bg); border-radius: 8px; padding: 8px 12px; margin: 0 0 12px; }
.credit b { color: var(--text); font-weight: 600; }
.shots { display: flex; gap: 10px; overflow-x: auto; padding: 4px 0 8px; margin: 16px 0; scroll-snap-type: x mandatory; }
.shots img { border-radius: 10px; border: 1px solid var(--line); scroll-snap-align: start; flex: none; background: var(--line); }
.shots.landscape img { height: 180px; width: auto; }
.shots.portrait img { height: 300px; width: auto; }
.store { display: flex; flex-wrap: wrap; gap: 8px 16px; font-size: .95rem; }
.store .soon { color: var(--muted); }

.services { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr)); gap: 16px; }
.service { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 20px; }
.service h3 { margin: 0 0 6px; font-size: 1.05rem; }
.service p { margin: 0; color: var(--muted); font-size: .95rem; }

.writing { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.writing li { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 14px 18px; }
.writing li.featured { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent) inset; }
.writing .yr { display: block; font-size: .85rem; color: var(--muted); }
.writing a { font-weight: 600; }
.more { margin: 16px 0 0; }
.award { display: inline-block; margin-left: 6px; padding: 0 8px; border-radius: 999px; font-size: .8rem; font-weight: 600; background: var(--accent-soft); color: var(--accent); }
.award.gold { background: var(--gold-soft); color: var(--gold); }
.award.merit { background: var(--merit-soft); color: var(--merit); }
.timeline { list-style: none; margin: 0; padding: 0 0 0 20px; border-left: 2px solid var(--line); }
.timeline li { position: relative; padding: 0 0 20px 8px; }
.timeline li::before {
  content: ""; position: absolute; left: -27px; top: 9px; width: 12px; height: 12px;
  border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft);
}
.timeline time { display: block; font-weight: 600; font-variant-numeric: tabular-nums; }

footer { border-top: 1px solid var(--line); padding: 32px 0 48px; color: var(--muted); font-size: .9rem; }
footer p { margin: 0 0 4px; }

@media (max-width: 480px) {
  header.hero { padding: 48px 0 32px; }
  .app { padding: 18px; }
  .shots.landscape img { height: 140px; }
  .shots.portrait img { height: 240px; }
}

.support p { margin: 0 0 8px; }
.feedback { display: flex; flex-wrap: wrap; gap: 24px; margin: 20px 0; }
.feedback a { display: flex; flex-direction: column; align-items: center; gap: 6px; color: var(--text); font-size: .9rem; }
.feedback a:hover { text-decoration: none; color: var(--accent); }
.feedback img { width: 72px; height: 72px; border-radius: 16px; border: 1px solid var(--line); transition: border-color .15s, box-shadow .15s; }
.feedback a:hover img, .feedback a:focus-visible img { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-soft); }
.projects { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.projects li { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 14px 18px; display: flex; gap: 14px; align-items: center; }
.projects img { width: 48px; height: 48px; border-radius: 12px; flex: none; }
.projects b { display: block; }
.projects span { color: var(--muted); font-size: .9rem; }

.home section > .wrap > h2 { margin-bottom: 20px; }
.hero .wrap { position: relative; }
.lang-switch { position: absolute; top: -40px; right: 16px; font-size: .9rem; }
