/* 配色：藍莓夜色開場 → 藍莓牛奶內頁，薄荷＋蜜桃＋檸檬點綴。要換顏色只改這一段。 */
:root {
  --night: #23264F;    /* 開場的深色底 */
  --sky: #EEF1FF;      /* 內頁底色 */
  --paper: #FFFFFF;
  --ink: #33376B;      /* 文字（藍莓） */
  --soft: #6B7099;
  --berry: #8F9BE8;
  --mint: #C7EBD8;
  --peach: #FFC2B0;
  --lemon: #FFE39A;
  --lilac: #D6C8FF;
  --line: #D9DEFA;
  --mx: 0; --my: 0;    /* 滑鼠位置（-1 到 1），effects.js 會更新 */
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; overflow-x: clip; }
body {
  margin: 0; color: var(--ink); background: var(--sky); overflow-x: hidden;
  font: 500 18px/1.8 "Chiron GoRound TC", "Microsoft JhengHei", "PingFang TC", sans-serif;
}
ul { margin: 0; padding: 0; list-style: none; }

/* ---------- 圖層 ---------- */
.iris {
  position: fixed; inset: 0; z-index: 1; background-color: var(--sky);
  background-image: radial-gradient(var(--line) 1.6px, transparent 1.7px); background-size: 26px 26px;
}
#gl { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 3; pointer-events: none; display: none; }
.ring, .scrollhint, .hero-space { display: none; }

/* ---------- 開場（沒有動態時的樣子：名字、頭像照順序排好） ---------- */
.bigname {
  position: relative; z-index: 2; max-width: 1100px; margin: 0 auto; padding: 56px 24px 0;
  font-size: clamp(64px, 14vw, 170px); font-weight: 900; line-height: 1.05;
}
.avatar3d { position: relative; z-index: 5; width: 190px; margin: 28px auto 0; left: calc(min(50vw, 550px) * -1 + 119px); perspective: 800px; }
.sticker {
  padding: 9px; background: #fff; border-radius: 50%; position: relative;
  box-shadow: 0 6px 0 rgba(51, 55, 107, .14), 0 24px 34px -10px rgba(20, 22, 60, .5);
  transform: rotate(-5deg);
}
.sticker svg { display: block; width: 100%; height: auto; }
.sticker .photo { aspect-ratio: 1; border-radius: 50%; background: center / cover no-repeat; }

/* 防複製：不能選字、不能拖圖、不能長按存圖、不能列印（只能擋一般操作，擋不了截圖） */
body { user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; }
img, svg, canvas { -webkit-user-drag: none; }
@media print { body { display: none; } }

/* ---------- 內容 ---------- */
main { position: relative; z-index: 4; max-width: 1100px; margin: 0 auto; padding: 48px 24px 160px; }
section { margin: 0 0 clamp(90px, 14vh, 160px); }

.tagline { margin: 0 0 30px; max-width: 13em; font-size: clamp(30px, 5.4vw, 68px); font-weight: 900; line-height: 1.3; }
.links { display: flex; flex-wrap: wrap; gap: 14px; }
.links a {
  padding: 10px 26px; border-radius: 999px; font-weight: 700;
  color: var(--ink); text-decoration: none; background: #fff; border: 2px solid var(--ink);
  box-shadow: 0 4px 0 var(--ink); transition: box-shadow .15s;
}
.links a:hover { box-shadow: 0 1px 0 var(--ink); }
a:focus-visible { outline: 3px solid var(--berry); outline-offset: 3px; }

h2 { margin: 0 0 26px; font-size: clamp(26px, 3.2vw, 40px); font-weight: 900; line-height: 1.3; }
h2::before {
  content: ""; display: inline-block; width: .55em; height: .55em; margin-right: .5em;
  border-radius: 50%; background: var(--peach); box-shadow: .35em 0 0 -.12em var(--berry);
}
h3 { margin: 0 0 6px; font-size: 17px; font-weight: 700; }

/* 基本資料：名牌 */
.block-pairs dl {
  margin: 0; max-width: 760px; background: var(--paper); border: 2px solid var(--ink); border-radius: 26px; overflow: hidden;
  box-shadow: 0 6px 0 var(--ink), 0 30px 40px -18px rgba(51, 55, 107, .5);
  display: grid; grid-template-columns: 7em 1fr; font-size: clamp(18px, 1.7vw, 22px);
}
.block-pairs dt, .block-pairs dd { margin: 0; padding: 14px 22px; border-top: 2px dashed var(--line); }
.block-pairs dt:first-of-type, .block-pairs dd:first-of-type { border-top: 0; }
.block-pairs dt { background: var(--mint); font-weight: 700; }

/* 文字：捲到哪裡，字就亮到哪裡 */
.scrub { margin: 0 0 .8em; max-width: 24em; font-size: clamp(21px, 2.6vw, 34px); font-weight: 700; line-height: 1.6; scroll-margin-top: 30vh; border-radius: 12px; }
.scrub:target { background: var(--lemon); box-shadow: 0 0 0 12px var(--lemon); }
.fx .scrub:target span { opacity: 1; }
a.jump { color: inherit; text-decoration: underline wavy var(--berry); text-underline-offset: 5px; }
a.jump::after { content: "（點我看上面的說明）"; font-size: .8em; color: var(--soft); }

/* 觀看次數 */
.views { display: table; margin: 26px 0 0; padding: 4px 18px; border-radius: 999px; background: var(--lemon); border: 2px solid var(--ink); font-size: 15px; font-weight: 700; }
.views b { font-size: 1.25em; font-weight: 900; }
.fx .views { opacity: 0; transition: opacity .8s .3s; }
.fx .intro.in .views { opacity: 1; }

/* 每日想法：一頁一則，用按鈕翻頁 */
.thoughts { max-width: 760px; }
.thoughts > li {
  display: grid; grid-template-columns: 1fr; gap: 4px; margin: 0; padding: 22px 26px; min-height: 9.5em; align-content: start;
  background: var(--paper); border: 2px solid var(--ink); border-radius: 24px 24px 24px 4px;
  box-shadow: 0 6px 0 var(--ink), 0 26px 36px -18px rgba(51, 55, 107, .45);
  font-size: clamp(20px, 2.2vw, 28px); font-weight: 700; line-height: 1.5;
}
.thoughts > li[hidden] { display: none; }
.fx .thoughts > li.flip { transform-origin: 0 50%; animation: flip .55s cubic-bezier(.2, .9, .2, 1); }
.fx .thoughts > li.flip.back { transform-origin: 100% 50%; animation-name: flipback; }
@keyframes flip { from { transform: perspective(1000px) rotateY(-75deg); opacity: 0; } }
@keyframes flipback { from { transform: perspective(1000px) rotateY(75deg); opacity: 0; } }
.pager { display: flex; align-items: center; justify-content: space-between; gap: 14px; max-width: 760px; margin-top: 22px; position: relative; z-index: 1; }
.pager span { color: var(--soft); font-size: 15px; font-weight: 700; white-space: nowrap; }
.pager button { white-space: nowrap; }   /* 手機上按鈕的字不要被擠成直的 */
@media (max-width: 420px) { .pager { gap: 8px; } .pager button { padding: 6px 14px; } }
.thoughts > li > .cmdel { text-align: left; }
.pager button { font: inherit; font-weight: 700; color: var(--ink); padding: 6px 22px; border: 2px solid var(--ink); border-radius: 999px; background: #fff; box-shadow: 0 4px 0 var(--ink); cursor: pointer; }
.pager button:active { box-shadow: 0 0 0 var(--ink); translate: 0 4px; }
.pager button:disabled { opacity: .35; cursor: default; box-shadow: none; translate: 0 4px; }
.pager button:focus-visible { outline: 3px solid var(--berry); outline-offset: 3px; }

/* 留言 */
.cm { grid-column: 1 / -1; font-size: 16px; font-weight: 500; line-height: 1.6; }
.cm summary { display: inline-block; cursor: pointer; padding: 2px 14px; border-radius: 999px; border: 2px solid var(--line); color: var(--soft); font-size: 14px; font-weight: 700; list-style: none; }
.cm summary::-webkit-details-marker { display: none; }
.cm[open] summary { border-color: var(--ink); color: var(--ink); background: var(--lemon); }
.cmlist li { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; padding: 8px 0; border-top: 2px dashed var(--line); grid-template-columns: none; }
.cmlist li:first-child { margin-top: 10px; }
.cmlist b { color: var(--berry); }
.cmlist span { flex: 1 1 12em; overflow-wrap: anywhere; }
.cmlist small { color: var(--soft); }
.cmdel { border: 0; background: none; color: var(--soft); font: inherit; font-size: 13px; text-decoration: underline; cursor: pointer; padding: 0; }
.cmform { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.cmform input { font: inherit; color: var(--ink); padding: 6px 14px; border: 2px solid var(--ink); border-radius: 999px; background: #fff; min-width: 0; user-select: text; -webkit-user-select: text; }
.cmform { align-items: center; }
.cmform input { flex: 1 1 12em; }
.cmwho { font-weight: 700; color: var(--berry); }
.cmlist b.isowner { color: var(--ink); background: var(--lemon); padding: 0 8px; border-radius: 999px; }
.cmform input.short { flex: 0 1 8em; }
.cmform textarea {
  flex: 1 1 100%; order: 2; min-height: 6.5em; resize: vertical; font: inherit; color: var(--ink); line-height: 1.6;
  padding: 10px 16px; border: 2px solid var(--ink); border-radius: 18px; background: #fff; user-select: text; -webkit-user-select: text;
}
.cmform textarea:focus-visible { outline: 3px solid var(--berry); outline-offset: 2px; }
.cmform textarea ~ button { order: 3; }
.thoughts > li > span { white-space: pre-wrap; overflow-wrap: anywhere; }   /* 想法照你換的行顯示 */
.cmform button:disabled { opacity: .5; }
.owner { max-width: 760px; margin: 0 0 18px; }
.owner:empty { display: none; }
.thoughts > li > .cmdel { justify-self: start; }
.cmnote { margin: 6px 0 0; color: var(--soft); font-size: 14px; }
.cmform input:focus-visible { outline: 3px solid var(--berry); outline-offset: 2px; }
.cmform button { font: inherit; font-weight: 700; color: var(--ink); padding: 6px 20px; border: 2px solid var(--ink); border-radius: 999px; background: var(--mint); box-shadow: 0 3px 0 var(--ink); cursor: pointer; }
.cmform button:active { box-shadow: 0 0 0 var(--ink); translate: 0 3px; }
.cmwarn { margin: 6px 0 0; color: #B4432B; font-size: 14px; min-height: 0; }
.cmwarn:empty { display: none; }
.thoughts time { color: var(--soft); font-size: 15px; font-weight: 700; padding-top: .2em; }

/* 找我 */
.contact { display: grid; grid-template-columns: 1fr minmax(180px, 280px); gap: 32px; align-items: center; }
.ways li { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 18px; padding: 16px 0; border-top: 2px dashed var(--line); font-size: clamp(18px, 1.8vw, 23px); }
.ways li:first-child { border-top: 0; }
.ways a { min-width: 7.2em; text-align: center; padding: 8px 22px; border-radius: 999px; font-weight: 700; color: var(--ink); text-decoration: none; background: #fff; border: 2px solid var(--ink); box-shadow: 0 4px 0 var(--ink); }
.ways a:hover { box-shadow: 0 1px 0 var(--ink); translate: 0 3px; }
.copyable { user-select: text; -webkit-user-select: text; font-weight: 700; cursor: text; }
.qr { margin: 0; padding: 14px 14px 12px; background: #fff; border: 2px solid var(--ink); border-radius: 26px; box-shadow: 0 6px 0 var(--ink), 0 30px 40px -18px rgba(51, 55, 107, .5); rotate: 3deg; }
.qrpic { aspect-ratio: 1754 / 2000; background: center / contain no-repeat; }
.qr figcaption { text-align: center; font-size: 14px; color: var(--soft); line-height: 1.4; }
@media (max-width: 700px) { .contact { grid-template-columns: 1fr; } .qr { max-width: 260px; margin: 0 auto; } }

/* 喜歡的東西 */
.marquee { display: none; }
.legend { display: flex; flex-wrap: wrap; gap: 8px 22px; margin: 0 0 18px; font-size: 16px; font-weight: 700; color: var(--soft); }
.legend li::before { content: ""; display: inline-block; width: .8em; height: .8em; margin-right: .45em; border-radius: 50%; border: 2px solid var(--ink); vertical-align: -.08em; background: var(--c); }
.g0 { --c: #FFD3C4; } .g1 { --c: var(--mint); } .g2 { --c: var(--lemon); } .g3 { --c: var(--lilac); }
.table { display: flex; flex-wrap: wrap; gap: 12px; }
.chip { padding: 6px 20px; border-radius: 999px; font-weight: 700; background: var(--c); border: 2px solid var(--ink); box-shadow: 0 4px 0 var(--ink); }
.tablehint { display: none; }

/* 左右兩欄 */
.cols { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; font-size: clamp(18px, 1.7vw, 22px); }
.cols > div { border-radius: 26px; padding: 22px 26px 26px; background: #FFE9E1; box-shadow: 0 2px 3px rgba(51, 55, 107, .08), 0 26px 38px -20px rgba(51, 55, 107, .4); }
.cols > div + div { background: #DFF5EA; }
.cols li { padding-left: 1.1em; position: relative; }
.cols li::before { content: ""; position: absolute; left: 0; top: .78em; width: 7px; height: 7px; border-radius: 50%; background: var(--ink); }

/* =====================================================================
   以下是動態版（effects.js 在 <html> 加上 .fx 才生效；系統設定「減少動態」時不會加）
   ===================================================================== */
.fx body { background: var(--night); }
.fx #gl { display: block; }
.fx .iris { clip-path: circle(0 at 50% 50%); }
.fx .hero-space { display: block; height: 260vh; }

/* 大名字：固定在畫面中央，顏色會跟底下的畫面反相（深底變亮字、亮底變深字） */
.fx .bigname {
  position: fixed; left: 50%; top: 50%; transform: translate(-50%, -50%); z-index: 2;
  margin: 0; padding: 0; max-width: none; display: flex; white-space: nowrap; pointer-events: none;
  color: #fff; mix-blend-mode: difference; line-height: 1;
  font-size: min(calc(84vw / var(--n, 2)), 62vh);
}
.fx .bigname span { display: inline-block; will-change: transform; animation: rise 1s cubic-bezier(.2, .9, .2, 1) both; }
.fx .bigname span:nth-child(2) { animation-delay: .1s; }
.fx .bigname span:nth-child(3) { animation-delay: .2s; }
.fx .bigname span:nth-child(4) { animation-delay: .3s; }
@keyframes rise { from { translate: 0 45%; opacity: 0; } }

.fx .avatar3d { position: fixed; left: 50%; top: 50%; margin: 0; width: min(30vh, 44vw); transform: translate(-50%, -50%); will-change: transform; }
.fx .sticker { animation: hello 1.2s cubic-bezier(.2, .9, .2, 1) .35s both; }
@keyframes hello { 0% { transform: rotate(-40deg) scale(0); } 60% { transform: rotate(6deg) scale(1.08); } 100% { transform: rotate(-5deg) scale(1); } }
.fx .sticker::after {   /* 表面的亮光，跟著滑鼠移動 */
  content: ""; position: absolute; inset: 9px; border-radius: 50%; pointer-events: none;
  background: radial-gradient(circle at calc(50% - var(--mx) * 34%) calc(28% - var(--my) * 26%), rgba(255, 255, 255, .5), rgba(255, 255, 255, 0) 46%);
}

.fx .scrollhint {
  display: block; position: fixed; left: 50%; bottom: 26px; z-index: 5; margin: 0; translate: -50% 0;
  color: #fff; font-size: 15px; font-weight: 700; letter-spacing: .3em; pointer-events: none;
  animation: bob 1.6s ease-in-out infinite;
}
.fx .scrollhint::after { content: ""; display: block; width: 2px; height: 26px; margin: 6px auto 0; background: currentColor; border-radius: 2px; }
@keyframes bob { 50% { transform: translateY(8px); } }

/* 跟著滑鼠的圈圈 */
.fx .ring {
  display: block; position: fixed; left: 0; top: 0; z-index: 9; width: 38px; height: 38px; margin: -19px 0 0 -19px;
  border: 2px solid #fff; border-radius: 50%; mix-blend-mode: difference; pointer-events: none; opacity: 0;
  transition: width .25s, height .25s, margin .25s, opacity .3s, background-color .25s;
}
.fx .ring.on { opacity: 1; }
.fx .ring.big { width: 76px; height: 76px; margin: -38px 0 0 -38px; background: rgba(255, 255, 255, .25); }

/* 捲到才出現：從後面立體翻進來 */
.fx .rv { opacity: 0; transform: perspective(900px) rotateX(-26deg) translateY(60px); transform-origin: 50% 0; }
.fx .rv.in { opacity: 1; transform: none; transition: opacity .7s, transform 1s cubic-bezier(.2, .9, .25, 1.15); }
.fx .tagline, .fx .links { opacity: 0; translate: 0 40px; transition: opacity .8s, translate .9s cubic-bezier(.2, .9, .2, 1); }
.fx .intro.in .tagline, .fx .intro.in .links { opacity: 1; translate: 0 0; }
.fx .intro.in .links { transition-delay: .15s; }

/* 文字逐字點亮 */
.fx .scrub span { opacity: .13; transition: opacity .45s; }
.fx .scrub span.on { opacity: 1; }

/* 卡片：朝滑鼠傾斜＋反光 */
.fx .tilt.in { position: relative; transform: perspective(900px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg)); transition: transform .35s cubic-bezier(.2, .8, .2, 1); }
.fx .tilt.in:hover { transition-duration: .08s; }
.tilt::after {
  content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; opacity: 0; transition: opacity .3s;
  background: radial-gradient(circle at var(--gx, 50%) var(--gy, 50%), rgba(255, 255, 255, .34), rgba(255, 255, 255, 0) 50%);
}
.tilt:hover::after { opacity: 1; }

/* 跑馬燈大字：捲越快跑越快，還會歪 */
.fx .marquee { display: block; overflow: hidden; width: 100vw; margin: 0 0 30px calc(50% - 50vw); }
.track { display: inline-flex; white-space: nowrap; will-change: transform; font-size: clamp(84px, 17vw, 250px); font-weight: 900; line-height: 1.15; color: transparent; -webkit-text-stroke: 2px var(--ink); }
.track span { padding-right: .35em; }
.track span:nth-child(even) { color: var(--ink); -webkit-text-stroke: 0; }

/* 桌面：標籤可以抓起來丟 */
.fx .table.live {
  display: block; position: relative; height: min(72vh, 600px); overflow: hidden; touch-action: pan-y;
  border: 3px dashed var(--berry); border-radius: 36px; background: rgba(255, 255, 255, .6);
  box-shadow: inset 0 10px 30px -12px rgba(51, 55, 107, .35);
}
.fx .table.live .chip {
  position: absolute; left: 0; top: 0; cursor: grab; user-select: none; -webkit-user-select: none; touch-action: none; will-change: transform;
  padding: 10px 26px; font-size: clamp(17px, 1.9vw, 25px); white-space: nowrap;
  box-shadow: 0 4px 0 var(--ink), 0 12px 14px -6px rgba(51, 55, 107, .35); transition: box-shadow .2s;
}
.fx .table.live .chip.held { cursor: grabbing; z-index: 5; box-shadow: 0 4px 0 var(--ink), 0 34px 30px -10px rgba(51, 55, 107, .55); }
.fx .tablehint { display: block; margin: 12px 0 0; color: var(--soft); font-size: 15px; }

/* ---------- 手機 ---------- */
@media (max-width: 820px) {
  .avatar3d { width: 150px; left: 0; margin-left: 24px; }
  section { margin-bottom: 84px; }
}
@media (max-width: 520px) {
  .cols { grid-template-columns: 1fr; }
  .block-pairs dl { grid-template-columns: 5.5em 1fr; }
  .block-pairs dt, .block-pairs dd { padding: 12px 14px; }
}
