:root {
    --cream: #EEE9DD;
    --cream-light: #F5F1E8;
    --cream-mid: #E4D8CB;
    --cream-dark: #D9CBBA;
    --ink: #241A0E;
    --ink-mid: #5C4A36;
    --rose: #A96464;
    --rose-deep: #945858;
    --rust: #8A3C33;
    --olive: #6A7555;
    --outline: #CDB89C;
    /* App 內建 12 色標籤色盤 */
    --tag-red: #F44336; --tag-pink: #E91E63; --tag-purple: #9C27B0;
    --tag-blue: #2196F3; --tag-cyan: #00BCD4; --tag-teal: #009688;
    --tag-green: #4CAF50; --tag-yellow: #FFEB3B; --tag-orange: #FF9800;
    --tag-black: #000000; --tag-white: #FFFFFF; --tag-grey: #90A4AE;
  }

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

  html { scroll-behavior: smooth; }
  body {
    background: var(--cream);
    color: var(--ink);
    font-family: "Noto Sans TC", sans-serif;
    margin: 0;
    overflow-x: hidden;
  }

  .font-display { font-family: "Iansui", serif; }

  ::selection { background: var(--rose); color: var(--cream-light); }

  a:focus-visible, button:focus-visible {
    outline: 3px solid var(--rust);
    outline-offset: 3px;
    border-radius: 6px;
  }

  /* ── 標籤 chip 母題 ── */
  .tk-chip {
    display: inline-flex; align-items: center; gap: .45em;
    padding: .3em .85em;
    border-radius: 999px;
    background: var(--cream-light);
    border: 1.5px solid var(--outline);
    font-size: .85rem;
    font-weight: 500;
    color: var(--ink);
    white-space: nowrap;
  }
  .tk-chip .dot {
    width: .65em; height: .65em; border-radius: 50%;
    background: var(--chip, var(--tag-grey));
    flex: none;
  }
  .tk-chip.selected {
    background: color-mix(in srgb, var(--chip, var(--tag-grey)) 16%, var(--cream-light));
    border-color: var(--chip, var(--tag-grey));
  }

  .eyebrow {
    display: inline-flex; align-items: center; gap: .5em;
    font-size: .8rem; letter-spacing: .18em;
    color: var(--ink-mid); font-weight: 700;
  }
  .eyebrow::before {
    content: ""; width: .7em; height: .7em; border-radius: 50%;
    background: var(--chip, var(--rose));
  }

  /* ── 按鈕（胭脂粉紅，與 App Ivory 主題 CTA 一致） ── */
  .btn-tk {
    display: inline-flex; align-items: center; justify-content: center; gap: .5em;
    background: var(--rose); color: #FFF8F2;
    border: none; border-radius: 8px;
    padding: .62em 1.5em; font-size: .95rem; font-weight: 700;
    font-family: "Noto Sans TC", sans-serif;
    cursor: pointer; text-decoration: none;
    box-shadow: 0 4px 14px rgba(169, 100, 100, .32);
    transition: background .18s ease;
  }
  .btn-tk:hover { background: var(--rose-deep); }
  .btn-tk-ghost {
    display: inline-flex; align-items: center; justify-content: center; gap: .5em;
    background: transparent; color: var(--ink-mid);
    border: 1.5px solid var(--outline); border-radius: 8px;
    padding: .62em 1.5em; font-size: .95rem; font-weight: 700;
    font-family: "Noto Sans TC", sans-serif;
    cursor: pointer; text-decoration: none;
    transition: background .18s ease;
  }
  .btn-tk-ghost:hover { background: rgba(169, 100, 100, .1); }
  .btn-tk-soon {
    display: inline-flex; align-items: center; justify-content: center; gap: .5em;
    background: transparent; color: var(--ink-mid); opacity: .6;
    border: 1.5px dashed var(--outline); border-radius: 8px;
    padding: .62em 1.5em; font-size: .95rem; font-weight: 700;
    font-family: "Noto Sans TC", sans-serif;
    cursor: default; user-select: none;
  }

  .lang-btn {
    background: transparent; border: 1.5px solid var(--outline);
    border-radius: 8px; padding: .35em 1em;
    font-size: .82rem; font-weight: 700; color: var(--ink-mid);
    font-family: "Noto Sans TC", sans-serif; cursor: pointer;
    transition: background .18s ease;
  }
  .lang-btn:hover { background: rgba(169, 100, 100, .1); }

  .logo-mark { width: 34px; height: 34px; border-radius: 9px; flex: none; }
  .brand-name { font-size: 1.5rem; }
  @media (max-width: 640px) {
    .logo-mark { width: 29px; height: 29px; border-radius: 8px; }
    .brand-name { font-size: 1.18rem; }
    .nav-download { padding: .44em .9em !important; font-size: .8rem !important; }
    .brand-inline { gap: .18em; }
  }

  .btn-platform-icon { width: 1em; height: 1em; flex: none; }
  .brand-inline { gap: .32em; }

  /* ── Hero 手機動畫 ── */
  .phone {
    width: 300px; height: 610px;
    border-radius: 42px;
    background: #0F1419;
    padding: 10px;
    box-shadow: 0 30px 60px rgba(36, 26, 14, .3), 0 4px 12px rgba(36, 26, 14, .18);
    position: relative;
  }
  @media (min-width: 1024px) {
    .phone { width: 344px; height: 699px; }
  }
  .phone-screen {
    width: 100%; height: 100%;
    border-radius: 34px;
    background: #101010;
    overflow: hidden;
    position: relative;
    display: flex; flex-direction: column;
  }
  .phone-notch {
    position: absolute; top: 18px; left: 50%; transform: translateX(-50%);
    width: 78px; height: 22px; border-radius: 999px; background: #0F1419;
    z-index: 30;
  }
  .threads-topbar {
    display: flex; align-items: center; gap: 8px;
    margin: 62px 18px 12px; color: #F5F5F5;
  }
  .threads-topbar .tp-threads { width: 22px; height: 22px; flex: none; margin-left: 0; }
  .threads-wordmark { font-weight: 700; font-size: .95rem; letter-spacing: .01em; }
  .threads-post {
    margin: 0 16px 12px;
    background: #181A1D;
    color: #F5F5F5;
    border-radius: 18px;
    padding: 16px;
    border: 1px solid #2A2A2A;
    box-shadow: 0 10px 24px rgba(0, 0, 0, .28);
  }
  .tp-head { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
  .tp-avatar {
    width: 36px; height: 36px; border-radius: 50%; flex: none;
    background: conic-gradient(from 40deg, var(--tag-orange), var(--tag-pink), var(--tag-purple), var(--tag-orange));
  }
  .tp-name { font-weight: 700; font-size: .85rem; }
  .tp-threads { width: 20px; height: 20px; flex: none; margin-left: auto; color: #F5F5F5; opacity: .92; }
  .tp-handle { font-size: .72rem; color: #9B9B9B; }
  .skeleton-post {
    opacity: .5;
    padding: 14px 16px;
  }
  .skeleton-post .tp-avatar { width: 30px; height: 30px; background: #33383F; }
  .skeleton-post .tp-name-line { height: 9px; width: 40%; border-radius: 5px; background: #33383F; }
  .tp-line { height: 9px; border-radius: 5px; background: #2F2F2F; margin-bottom: 8px; }
  .tp-line.w80 { width: 80%; } .tp-line.w95 { width: 95%; } .tp-line.w60 { width: 60%; }
  .tp-line.w55 { width: 55%; } .tp-line.w88 { width: 88%; }
  .tp-share {
    margin-top: 14px; margin-left: auto; width: fit-content;
    display: flex; align-items: center; justify-content: flex-end; gap: 6px;
    font-size: .78rem; color: #E8E8E8; font-weight: 700;
    background: transparent; border-radius: 999px; padding: 4px 0 4px 8px;
  }
  .plane-icon {
    width: 17px; height: 17px; display: inline-block; flex: none;
  }
  .save-sheet {
    position: absolute; left: 0; right: 0; bottom: 0;
    background: var(--cream-light);
    color: var(--ink);
    border: none;
    border-radius: 26px 26px 0 0;
    box-shadow: 0 -8px 30px rgba(36, 26, 14, .22);
    padding: 18px 18px 22px;
    z-index: 20;
  }
  .sheet-grip { width: 40px; height: 4px; border-radius: 2px; background: var(--outline); margin: 0 auto 14px; }
  .sheet-title { font-family: "Iansui", serif; font-size: 1.05rem; margin-bottom: 12px; }
  .sheet-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
  .sheet-save {
    width: 100%; border: none; border-radius: 8px;
    background: var(--rose); color: #FFF8F2;
    padding: 10px; font-weight: 700; font-size: .9rem;
    font-family: "Noto Sans TC", sans-serif;
  }
  .save-toast {
    position: absolute; left: 50%; top: 46%;
    background: var(--cream-light); color: var(--ink);
    border-radius: 12px; padding: 14px 22px;
    display: flex; align-items: center; gap: 10px;
    font-weight: 700; font-size: .9rem;
    opacity: 0; z-index: 25;
    box-shadow: 0 12px 30px rgba(36, 26, 14, .32);
    white-space: nowrap;
  }
  .save-toast .check {
    width: 22px; height: 22px; border-radius: 50%; flex: none;
    background: var(--olive); display: grid; place-items: center;
    color: #fff; font-size: .8rem; line-height: 1;
  }
  .tap-dot {
    position: absolute; z-index: 40; width: 30px; height: 30px;
    border-radius: 50%; pointer-events: none;
    background: rgba(255, 255, 255, .28);
    border: 2px solid rgba(255, 255, 255, .78);
    box-shadow: 0 0 0 4px rgba(15, 20, 25, .28), 0 0 18px rgba(255, 255, 255, .32);
    opacity: 0; top: 0; left: 0;
  }

  /* Hero 漂浮 chips */
  .float-chip { position: absolute; will-change: transform; pointer-events: none; opacity: .9; }
  @media (max-width: 1023px) { .float-chip { display: none; } }

  /* ── 三步驟小動畫場景 ── */
  .step-scene {
    height: 130px; background: #fff; border-radius: 8px;
    border: 1.5px solid var(--cream-dark);
    position: relative; overflow: hidden; margin-bottom: 18px;
  }
  .step-card { min-width: 0; }
  .ms-card {
    position: absolute; left: 16px; top: 50%; transform: translateY(-50%);
    width: 120px; background: var(--cream-light);
    border: 1.5px solid var(--outline); border-radius: 8px; padding: 10px;
  }
  .ms-line { height: 7px; border-radius: 4px; background: var(--cream-dark); margin-bottom: 6px; }
  .ms-share {
    position: absolute; left: 88px; top: calc(50% + 30px);
    font-size: .72rem; color: var(--rust); font-weight: 700;
    background: rgba(169,100,100,.12); border-radius: 999px; padding: 4px 10px;
    display: inline-flex; align-items: center; gap: 4px;
  }
  .ms-path { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
  #s1-guide { stroke: var(--cream-dark); stroke-width: 2; stroke-dasharray: 2 6; stroke-linecap: round; }
  #s1-draw { stroke: var(--rose); stroke-width: 2; stroke-linecap: round; }
  .ms-packet {
    position: absolute; top: 0; left: 0; width: 18px; height: 14px;
    border-radius: 4px; background: var(--rose);
    box-shadow: 0 2px 6px rgba(169, 100, 100, .45);
    opacity: 0;
  }
  .ms-book {
    position: absolute; right: 22px; top: 50%; transform: translateY(-50%);
    width: 44px; height: 44px; border-radius: 12px; background: #0F1419;
    display: grid; place-items: center;
  }
  .ms-book svg { width: 44px; height: 44px; }
  .scene2-card {
    position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
    width: 82%; background: var(--cream-light);
    border: 1.5px solid var(--outline); border-radius: 8px; padding: 12px;
  }
  .scene2-chips { display: flex; gap: 6px; margin-top: 10px; flex-wrap: wrap; }
  .scene2-chips .tk-chip { font-size: .68rem; }
  .scene3-wrap { position: absolute; inset: 12px 16px; display: flex; flex-direction: column; gap: 8px; }
  .scene3-search {
    display: flex; align-items: center; flex-wrap: wrap; gap: 6px;
    background: var(--cream-light); border: 1.5px solid var(--outline);
    border-radius: 999px; padding: 5px 12px; font-size: .7rem; color: var(--ink-mid);
  }
  .scene3-search .tk-chip { font-size: .62rem; padding: .2em .6em; }
  .scene3-rows { display: flex; gap: 8px; flex: 1; }
  .scene3-row {
    flex: 1; border: 1.5px solid var(--outline); border-radius: 8px;
    background: var(--cream-light); padding: 8px;
  }
  .scene3-row .ms-line { height: 6px; margin-bottom: 5px; }
  .scene3-row.hit { border-color: var(--olive); }

  /* ── 階層樹 ── */
  .tree { font-size: .92rem; }
  .tree .node { display: flex; align-items: center; gap: .6em; padding: .38em 0; }
  .tree .branch { position: relative; margin-left: 1.1em; padding-left: 1.3em; border-left: 2px solid var(--outline); }
  .tree .branch .node::before {
    content: ""; width: .9em; height: 2px; background: var(--outline);
    margin-left: -1.3em; margin-right: .4em; flex: none;
  }

  /* ── 多標籤示範 ── */
  .demo-post {
    background: var(--cream-light);
    border: 1.5px solid var(--outline);
    border-radius: 8px; padding: 14px 16px;
    transition: opacity .35s ease, transform .35s ease;
  }
  .demo-post.dimmed { opacity: .28; transform: scale(.97); }
  .demo-post .mini-line { height: 8px; border-radius: 4px; background: var(--cream-dark); margin-bottom: 7px; }

  .mode-toggle {
    display: inline-flex; border: 1.5px solid var(--rose); border-radius: 999px; overflow: hidden;
  }
  .mode-toggle button {
    border: none; background: transparent; color: var(--rust);
    font-weight: 700; font-size: .82rem; padding: .5em 1.1em; cursor: pointer;
    font-family: "Noto Sans TC", sans-serif;
    transition: background .2s ease, color .2s ease;
    white-space: nowrap;
  }
  .mode-toggle button.active { background: var(--rose); color: #FFF8F2; }

  /* ── 日期範圍示意 ── */
  .date-pill {
    display: inline-flex; align-items: center; gap: .5em;
    background: var(--cream-light); border: 1.5px solid var(--rose);
    border-radius: 999px; padding: .4em 1em; font-size: .85rem; font-weight: 700; color: var(--rust);
  }
  .timeline-bar {
    position: relative; height: 10px; border-radius: 6px;
    background: var(--cream-dark); margin: 18px 4px 6px;
  }
  .timeline-bar .timeline-fill {
    position: absolute; top: 0; bottom: 0; left: 12%; width: 24%;
    background: var(--rose); border-radius: 6px;
  }
  .timeline-labels { display: flex; justify-content: space-between; font-size: .72rem; color: var(--ink-mid); }

  /* ── 功能卡（無 hover 效果，避免誤以為可點） ── */
  .feature-card {
    background: var(--cream-light);
    border: 1.5px solid var(--cream-dark);
    border-radius: 8px;
    padding: 26px 24px;
    min-width: 0;
  }
  .feature-card .icon-pad {
    width: 40px; height: 40px; border-radius: 10px;
    display: grid; place-items: center; font-size: 1.3rem;
    background: color-mix(in srgb, var(--chip, var(--rose)) 18%, var(--cream-light));
    color: var(--chip, var(--rose));
    flex: none;
  }
  .feature-card .icon-pad svg { width: 21px; height: 21px; }
  .feature-title-row {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
  }

  /* ── 實際畫面（模擬裝置截圖，直立展示） ── */
  .shot-frame {
    border-radius: 22px;
    border: 7px solid #0F1419;
    overflow: hidden;
    position: relative;
    box-shadow: 0 24px 50px rgba(36, 26, 14, .26);
    max-width: 260px;
    aspect-ratio: 1080 / 2210;
    margin: 0 auto;
  }
  .shot-img { display: block; width: 100%; height: 100%; object-fit: contain; background: #EEE9DD; }
  html[data-lang="en"] .shot-img.lang-zh { display: none; }
  html[data-lang="zh"] .shot-img.lang-en { display: none; }
  .plan-row { display: flex; align-items: baseline; gap: .6em; padding: .5em 0; border-bottom: 1px dashed var(--outline); font-size: .95rem; }
  .plan-row:last-child { border-bottom: none; }
  .plan-row .yes { color: var(--olive); font-weight: 700; }

  .section-pad { padding: 96px 24px; }
  @media (max-width: 640px) { .section-pad { padding: 64px 20px; } }
  .headline-underline {
    color: var(--rust);
    border-bottom: 4px solid var(--rose);
  }
  .step-heading { display: flex; align-items: baseline; gap: 12px; margin-bottom: 8px; }
  .step-number { font-family: "Iansui", serif; font-size: 2.15rem; color: var(--rose); line-height: 1; flex: none; }
  .subtag-title {
    min-width: 0;
    white-space: normal;
    line-height: 1.35;
  }
  .subtag-control,
  .subtag-children {
    display: flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
    overflow-x: auto;
    scrollbar-width: none;
  }
  .subtag-control::-webkit-scrollbar,
  .subtag-children::-webkit-scrollbar { display: none; }
  @media (max-width: 767px) {
    #top { padding: 56px 20px 72px !important; }
    #how .grid { gap: 0; }
    .step-card {
      display: flex;
      flex-direction: column;
      padding: 0 0 32px;
      margin-bottom: 32px;
      border-bottom: 1.5px solid var(--outline);
    }
    .step-card:last-child {
      border-bottom: none;
      margin-bottom: 0;
      padding-bottom: 0;
    }
    .step-heading { order: 1; }
    .step-card p { order: 2; margin-top: 0; }
    .step-scene { order: 3; margin: 18px 0 0; }
    .feature-card { padding: 24px 20px; }
    .mode-toggle { margin-left: 0 !important; max-width: 100%; }
    .mode-toggle button { padding: .48em .78em; font-size: .76rem; }
  }

  .reveal { opacity: 0; }
  @media (prefers-reduced-motion: reduce) {
    .reveal { opacity: 1 !important; transform: none !important; }
    html { scroll-behavior: auto; }
  }
