/* ==========================================================
   Yu 個人站 — 暖色手帳桌墊（自己的視覺，不抄介面）
   結構：代幣 → 基礎 → 元件 → 首頁 → 動態 → 專案/分享 → Studio → RWD
   ========================================================== */

:root {
  --brand: #c45c26;
  --brand-2: #e07a5f;
  --brand-soft: rgba(196, 92, 38, 0.16);
  --ink: #2c2418;
  --ink-2: #6b5c4c;
  --ink-3: #9a8b7a;
  --bg: #f6efe3;
  --card: rgba(255, 252, 246, 0.72);
  --card-strong: rgba(255, 252, 246, 0.92);
  --line: rgba(255, 255, 255, 0.7);
  --hair: rgba(44, 36, 24, 0.1);
  --yellow: #e8b84a;
  --pink: #c47b9a;

  --font-display: "PingFang TC", "Noto Sans TC", "Microsoft JhengHei", -apple-system, system-ui, sans-serif;
  --font-sans: "PingFang TC", "Noto Sans TC", "Microsoft JhengHei", -apple-system, "Segoe UI", Roboto, "Noto Sans", sans-serif;
  --font-mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;

  --r-xl: 22px;
  --r-lg: 16px;
  --r-md: 12px;
  --shadow: 0 18px 36px -22px rgba(60, 40, 20, 0.28), 0 1px 0 rgba(255, 255, 255, 0.55) inset;
  --shadow-hover: 0 24px 44px -22px rgba(60, 40, 20, 0.34), 0 1px 0 rgba(255, 255, 255, 0.65) inset;

  --wash-1: rgba(224, 122, 95, 0.22);
  --wash-2: rgba(255, 248, 235, 0.9);
  --wash-3: rgba(129, 178, 154, 0.28);
  --wash-4: rgba(244, 198, 120, 0.32);
  color-scheme: light;
}

:root[data-theme="dark"] {
  --ink: #f2e8dc;
  --ink-2: #c4b4a4;
  --ink-3: #9a8a7a;
  --bg: #2a2622;
  --card: rgba(52, 44, 38, 0.78);
  --card-strong: rgba(62, 52, 44, 0.92);
  --line: rgba(255, 240, 220, 0.12);
  --hair: rgba(255, 230, 200, 0.1);
  --brand-soft: rgba(232, 168, 124, 0.18);
  --shadow: 0 18px 36px -22px rgba(0, 0, 0, 0.5), 0 1px 0 rgba(255, 255, 255, 0.05) inset;
  --shadow-hover: 0 24px 44px -22px rgba(0, 0, 0, 0.55), 0 1px 0 rgba(255, 255, 255, 0.08) inset;
  --wash-1: rgba(232, 168, 124, 0.18);
  --wash-2: rgba(60, 52, 46, 0.7);
  --wash-3: rgba(100, 80, 70, 0.35);
  --wash-4: rgba(80, 60, 90, 0.3);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html {
  min-height: 100%;
  -webkit-text-size-adjust: 100%;
  background: var(--bg);
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.65;
  background:
    radial-gradient(1100px 720px at 0% -8%, var(--wash-1), transparent 58%),
    radial-gradient(900px 640px at 100% 8%, var(--wash-2), transparent 55%),
    radial-gradient(1000px 700px at 12% 110%, var(--wash-4), transparent 58%),
    radial-gradient(820px 580px at 96% 96%, var(--wash-3), transparent 52%),
    var(--bg);
  background-attachment: fixed;
  cursor: url("./assets/cursor.svg") 4 2, auto;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* 背景：極淡薄荷柔光 */
.bg-blobs {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
}
.bg-blobs span {
  position: absolute;
  width: 50vmax;
  height: 50vmax;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.55;
  animation: drift 32s ease-in-out infinite alternate;
}
.bg-blobs span:nth-child(1) { background: var(--wash-1); top: -18vmax; left: -12vmax; }
.bg-blobs span:nth-child(2) { background: var(--wash-2); top: -10vmax; right: -18vmax; animation-delay: -8s; }
.bg-blobs span:nth-child(3) { background: var(--wash-3); bottom: -22vmax; left: 20vw; animation-delay: -14s; }
.bg-blobs span:nth-child(4) { background: var(--wash-4); bottom: -20vmax; left: -20vmax; width: 38vmax; height: 38vmax; animation-delay: -20s; }
@keyframes drift {
  0% { transform: translate(0, 0) scale(1); }
  100% { transform: translate(5vmax, 3vmax) scale(1.08); }
}

a { color: inherit; text-decoration: none; }
a:hover { color: var(--brand); }
button, input { font: inherit; color: inherit; }
button { cursor: url("./assets/cursor.svg") 4 2, pointer; }
img { max-width: 100%; }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 3px; border-radius: 12px; }

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

/* ===== 通用元件 ===== */
.card {
  background: var(--card);
  backdrop-filter: blur(10px) saturate(1.15);
  -webkit-backdrop-filter: blur(10px) saturate(1.15);
  border: 1px solid var(--line);
  border-radius: var(--r-xl);
  box-shadow: var(--shadow);
  padding: 1.55rem;
}

.rise { animation: rise 0.65s cubic-bezier(.2, .8, .2, 1) both; }
@keyframes rise {
  from { opacity: 0; transform: translateY(16px) scale(0.98); }
  to { opacity: 1; transform: none; }
}

.averia { font-family: var(--font-display); letter-spacing: 0.01em; }
.muted { color: var(--ink-2); }

.mini-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin: 0 0 0.95rem;
  font-family: var(--font-display);
  font-size: 0.92rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  color: var(--ink);
}
.mini-title a { font-family: var(--font-sans); font-size: 0.78rem; font-weight: 500; color: var(--ink-2); }
.mini-title a:hover { color: var(--brand); }

.chip {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  background: var(--brand-soft);
  color: var(--brand);
  border-radius: 999px;
  padding: 0.2rem 0.68rem;
  font-size: 0.74rem;
  font-weight: 600;
  line-height: 1.4;
  white-space: nowrap;
}
.chip--plain { background: var(--hair); color: var(--ink-2); font-weight: 500; }

.chip-btn {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.42rem 1rem;
  font-size: 0.88rem;
  background: var(--card);
  backdrop-filter: blur(8px);
  color: var(--ink-2);
  transition: background 0.2s, color 0.2s, transform 0.2s, border-color 0.2s;
}
.chip-btn:hover { transform: translateY(-1px); color: var(--ink); }
.chip-btn.is-active { background: var(--brand); border-color: var(--brand); color: #fff; }
.chip-btn small { opacity: 0.7; margin-left: 0.2rem; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  border: none;
  border-radius: 16px;
  padding: 0.58rem 1.15rem;
  font-size: 0.88rem;
  font-weight: 600;
  background: var(--brand);
  color: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1), 0 8px 18px -10px rgba(53, 191, 171, 0.55);
  transition: transform 0.2s, filter 0.2s;
}
.btn:hover { color: #fff; transform: translateY(-1px); filter: brightness(1.04); }
.btn--ghost {
  background: var(--card-strong);
  color: var(--ink);
  box-shadow: none;
  border: 1px solid var(--line);
}
.btn--ghost:hover { color: var(--brand); }
.btn svg { width: 16px; height: 16px; }

.thumb {
  width: 56px;
  height: 56px;
  border-radius: 18px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  overflow: hidden;
  font-family: var(--font-display);
  font-size: 0.72rem;
  line-height: 1.1;
  text-align: center;
  padding: 0.3rem;
  color: var(--ink);
  background: linear-gradient(145deg, var(--card-strong), var(--brand-soft));
  border: 1px solid var(--line);
}
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.thumb.has-img { padding: 0; }

.empty { grid-column: 1 / -1; text-align: center; color: var(--ink-2); padding: 3rem 1rem; }

.theme-toggle {
  width: 36px; height: 36px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: var(--card-strong);
  display: grid; place-items: center;
  color: var(--ink-2);
  transition: color 0.2s, transform 0.3s;
}
.theme-toggle:hover { color: var(--brand); transform: rotate(18deg); }
.theme-toggle svg { width: 17px; height: 17px; }

/* ===== 首頁 bento ===== */
.stage { width: min(1140px, calc(100% - 2rem)); margin: 0 auto; padding: 2.2rem 0 3rem; }

.board {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr) 290px;
  grid-template-areas:
    "nav   greet  tools"
    "nav   art    tools"
    "latest latest extra"
    "social recommend extra";
  gap: 1.15rem;
  align-items: stretch;
}
.board > * { min-width: 0; }
.p-nav { grid-area: nav; }
.p-greet { grid-area: greet; }
.p-art { grid-area: art; }
.p-tools { grid-area: tools; }
.p-latest { grid-area: latest; }
.p-social { grid-area: social; }
.p-recommend { grid-area: recommend; }
.p-extra { grid-area: extra; }
.board > *:nth-child(1) { animation-delay: 0s; }
.board > *:nth-child(2) { animation-delay: .05s; }
.board > *:nth-child(3) { animation-delay: .1s; }
.board > *:nth-child(4) { animation-delay: .15s; }
.board > *:nth-child(5) { animation-delay: .2s; }
.board > *:nth-child(6) { animation-delay: .25s; }
.board > *:nth-child(7) { animation-delay: .3s; }
.board > *:nth-child(8) { animation-delay: .35s; }

/* 側欄 */
.profile-card { display: flex; flex-direction: column; padding: 1.45rem 1.25rem; }
.profile-top { display: flex; align-items: center; gap: 0.8rem; margin-bottom: 0.5rem; }
.avatar {
  width: 48px; height: 48px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid rgba(255, 255, 255, 0.9);
  box-shadow: 0 10px 20px -12px rgba(0, 0, 0, 0.2);
}
.profile-name { font-family: var(--font-display); font-size: 1.28rem; font-weight: 700; line-height: 1.15; letter-spacing: 0.01em; }
.profile-handle { font-size: 0.78rem; color: var(--ink-2); }
.profile-bio { margin: 0.7rem 0 1.15rem; font-size: 0.84rem; color: var(--ink-2); line-height: 1.6; }
.side-label {
  margin: 0 0 0.55rem;
  font-family: var(--font-display);
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-3);
  font-weight: 600;
}
.side-nav { display: flex; flex-direction: column; gap: 0.28rem; }
.side-nav a {
  display: flex; align-items: center; gap: 0.75rem;
  padding: 0.66rem 0.85rem;
  border-radius: var(--r-md);
  font-weight: 600;
  font-size: 0.92rem;
  transition: background 0.2s, color 0.2s, transform 0.2s;
}
.side-nav a:hover { background: var(--card-strong); color: var(--ink); transform: translateX(2px); }
.side-nav a.is-active { background: var(--card-strong); }
.side-nav a.is-active .nav-ico { background: var(--brand); color: #fff; }
.side-nav a .count { margin-left: auto; font-size: 0.75rem; color: var(--ink-3); font-weight: 500; }
.nav-ico {
  width: 30px; height: 30px; border-radius: 10px;
  display: inline-grid; place-items: center;
  background: var(--hair); color: var(--ink-2);
  flex: 0 0 auto;
  transition: background 0.2s, color 0.2s;
}
.nav-ico svg { width: 16px; height: 16px; }
.profile-foot { margin-top: auto; padding-top: 1.15rem; display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; }
.stat-row { display: flex; gap: 1.15rem; }
.stat b { display: block; font-family: var(--font-display); font-size: 1.12rem; line-height: 1.15; font-weight: 700; }
.stat span { font-size: 0.7rem; color: var(--ink-3); }

/* 問候 */
.greet-card {
  display: flex; align-items: center; gap: 1.55rem;
  padding: 1.75rem 1.95rem;
  min-height: 188px;
}
.greet-avatar { position: relative; flex: 0 0 auto; }
.greet-avatar img {
  width: 108px; height: 108px;
  border-radius: 36px;
  object-fit: cover;
  border: 3px solid rgba(255, 255, 255, 0.9);
  box-shadow: 0 22px 36px -20px rgba(0, 0, 0, 0.22);
  transition: transform 0.4s;
}
.greet-card:hover .greet-avatar img { transform: scale(1.04) rotate(2deg); }
.greet-avatar::after {
  content: "🐾";
  position: absolute; right: -8px; bottom: -6px;
  font-size: 1.25rem;
  filter: drop-shadow(0 3px 4px rgba(0, 0, 0, 0.12));
}
.greet-card h1 {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(1.45rem, 2.7vw, 2.05rem);
  font-weight: 700;
  line-height: 1.28;
  letter-spacing: 0.01em;
}
.greet-card h1 .name {
  background: linear-gradient(100deg, var(--brand), var(--brand-2));
  -webkit-background-clip: text; background-clip: text;
  color: transparent;
}
.greet-card p { margin: 0.55rem 0 0; color: var(--ink-2); font-size: 0.92rem; line-height: 1.65; }

/* 媒體拼貼 */
.art-card { padding: 1.15rem 1.35rem 1.25rem; overflow: hidden; }
.polaroids {
  display: flex; justify-content: center; align-items: center;
  gap: 0; min-height: 178px; padding: 0.45rem 0 0.25rem;
}
.polaroid {
  display: block;
  width: 31%;
  max-width: 176px;
  aspect-ratio: 4 / 5;
  background: rgba(255, 255, 255, 0.92);
  padding: 8px 8px 24px;
  border-radius: 12px;
  box-shadow: 0 18px 30px -18px rgba(0, 0, 0, 0.18);
  margin: 0 -8px;
  transition: transform 0.35s cubic-bezier(.2, .8, .2, 1), z-index 0s;
  position: relative;
}
.polaroid img { width: 100%; height: 100%; object-fit: cover; border-radius: 8px; display: block; }
.polaroid:nth-child(1) { transform: rotate(-5deg) translateY(6px); }
.polaroid:nth-child(2) { transform: rotate(1.5deg) translateY(-4px); z-index: 1; }
.polaroid:nth-child(3) { transform: rotate(5deg) translateY(8px); }
.polaroid:hover { transform: rotate(0) translateY(-10px) scale(1.06); z-index: 3; }

/* 工具欄 */
.tools-stack { display: flex; flex-direction: column; gap: 1.15rem; }
.clock-card { padding: 1.15rem; }
.clock-face {
  border-radius: 28px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.55), rgba(255, 255, 255, 0.12)),
    var(--brand-soft);
  border: 1px solid var(--line);
  padding: 1.25rem 0.5rem 1.05rem;
  text-align: center;
}
.clock-time { font-family: var(--font-mono); font-size: clamp(2.3rem, 4.2vw, 2.85rem); font-weight: 700; letter-spacing: 0.04em; line-height: 1; }
.clock-time .colon { animation: blink 1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0.25; } }
.clock-sub { margin-top: 0.55rem; font-size: 0.78rem; color: var(--ink-2); }

.cal-card { padding: 1.35rem 1.35rem 1.25rem; }
.cal-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 0.85rem; }
.cal-head h2 { margin: 0; font-family: var(--font-display); font-size: 1.02rem; font-weight: 700; }
.cal-head span { font-size: 0.72rem; color: var(--ink-3); }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 0.35rem 0.15rem; text-align: center; font-size: 0.84rem; }
.cal-grid .dow { color: var(--ink-3); font-size: 0.74rem; font-weight: 600; }
.cal-grid .day {
  position: relative;
  min-height: 1.95rem;
  display: grid; place-items: center;
  border-radius: 12px;
}
.cal-grid a.day:hover { background: var(--card-strong); color: var(--ink); }
.cal-grid .day.has-post::after {
  content: ""; position: absolute; bottom: 3px; left: 50%;
  width: 4px; height: 4px; margin-left: -2px; border-radius: 50%;
  background: var(--brand);
}
.cal-grid .day.is-today { background: var(--brand); color: #fff; font-weight: 700; }
.cal-grid .day.is-today::after { background: #fff; }
.cal-grid .day.is-empty { visibility: hidden; }

/* 最新貼文 — 時間軸列表 */
.latest-card { display: flex; flex-direction: column; }
.latest-body { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 1.25rem; align-items: start; }
.latest-meta { display: flex; align-items: center; gap: 0.55rem; font-size: 0.8rem; color: var(--ink-2); margin-bottom: 0.55rem; }
.latest-text {
  margin: 0;
  font-size: 0.96rem;
  line-height: 1.75;
  white-space: pre-line;
  display: -webkit-box; -webkit-line-clamp: 6; -webkit-box-orient: vertical;
  overflow: hidden;
}
.latest-imgs { display: flex; gap: 0.55rem; }
.latest-imgs img {
  width: 120px; height: 150px;
  object-fit: cover;
  border-radius: var(--r-md);
  border: 1px solid var(--line);
}
.latest-foot { display: flex; gap: 0.6rem; margin-top: 1.15rem; flex-wrap: wrap; }

.latest-list {
  grid-template-columns: minmax(0, 1fr);
  margin: 1.15rem 0 0;
  padding: 1.15rem 0 0;
  list-style: none;
  border-top: 1px solid var(--hair);
  display: grid;
  gap: 0.15rem;
}
.latest-list a {
  display: flex;
  gap: 0.95rem;
  align-items: center;
  font-size: 0.9rem;
  padding: 0.55rem 0.35rem;
  border-radius: 12px;
  transition: background 0.2s;
}
.latest-list a:hover { background: var(--card-strong); color: var(--ink); }
.latest-list time {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--ink-3);
  flex: 0 0 3.4rem;
  letter-spacing: 0.02em;
}
.latest-list a::before {
  content: "";
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--brand);
  opacity: 0.55;
  flex: 0 0 auto;
}
.latest-list span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* 社群 */
.social-row { display: flex; flex-wrap: wrap; gap: 0.6rem; }
.soc {
  display: inline-flex; align-items: center; gap: 0.48rem;
  min-height: 2.55rem;
  padding: 0.48rem 1.05rem;
  border-radius: 999px;
  font-weight: 600; font-size: 0.9rem;
  border: 1px solid var(--line);
  background: var(--card-strong);
  transition: transform 0.2s, filter 0.2s;
}
.soc:hover { transform: translateY(-2px); }
.soc svg { width: 18px; height: 18px; }
.soc--dark { background: #1f2426; border-color: #1f2426; color: #fff; }
.soc--dark:hover { color: #fff; filter: brightness(1.2); }
.soc--brand { background: var(--brand); border-color: transparent; color: #fff; }
.soc--brand:hover { color: #fff; }

/* 隨機推薦 */
.rec-row { display: flex; gap: 0.95rem; align-items: center; }
.rec-row h3 { margin: 0 0 0.25rem; font-family: var(--font-display); font-size: 1.05rem; line-height: 1.35; font-weight: 700; }
.rec-row p { margin: 0; color: var(--ink-2); font-size: 0.85rem; line-height: 1.55; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.shuffle {
  margin-left: auto; flex: 0 0 auto;
  width: 36px; height: 36px; border-radius: 50%;
  border: 1px solid var(--line); background: var(--card-strong);
  display: grid; place-items: center; color: var(--ink-2);
  transition: transform 0.4s, color 0.2s;
}
.shuffle:hover { color: var(--brand); transform: rotate(180deg); }
.shuffle svg { width: 15px; height: 15px; }

/* 專注白噪音 + 按讚 */
.p-extra { display: flex; flex-direction: column; gap: 1.2rem; }
.music-row { display: flex; align-items: center; gap: 0.85rem; }
.music-meta { flex: 1; min-width: 0; }
.music-meta strong { font-family: var(--font-display); font-weight: 700; }
.music-meta small { display: block; font-size: 0.75rem; color: var(--ink-3); }
.eq { display: flex; align-items: flex-end; gap: 3px; height: 18px; margin-top: 0.45rem; }
.eq i { width: 4px; height: 30%; border-radius: 2px; background: var(--brand); opacity: 0.4; }
.is-playing .eq i { opacity: 1; animation: eq 0.9s ease-in-out infinite alternate; }
.is-playing .eq i:nth-child(2) { animation-delay: -0.3s; }
.is-playing .eq i:nth-child(3) { animation-delay: -0.6s; }
.is-playing .eq i:nth-child(4) { animation-delay: -0.15s; }
.is-playing .eq i:nth-child(5) { animation-delay: -0.45s; }
@keyframes eq { from { height: 20%; } to { height: 100%; } }
.play-btn {
  width: 46px; height: 46px; border-radius: 50%;
  border: 1px solid var(--line); background: var(--card-strong);
  color: var(--brand);
  display: grid; place-items: center; flex: 0 0 auto;
  transition: transform 0.2s;
}
.play-btn:hover { transform: scale(1.06); }
.play-btn svg { width: 16px; height: 16px; }
.noise-tabs { display: flex; gap: 0.4rem; flex-wrap: wrap; }
.noise-tabs button {
  border: 1px solid var(--line); background: transparent;
  border-radius: 999px; padding: 0.24rem 0.72rem; font-size: 0.76rem; color: var(--ink-2);
}
.noise-tabs button.is-active { background: var(--brand-soft); color: var(--brand); border-color: transparent; font-weight: 600; }
.pomodoro { display: flex; align-items: center; justify-content: space-between; gap: 0.65rem; padding-top: 1.15rem; border-top: 1px solid var(--hair); }
.pomodoro .btn { white-space: nowrap; }
.pomo-time { font-family: var(--font-mono); font-size: 1.55rem; font-weight: 700; }
.pomo-label { font-size: 0.74rem; color: var(--ink-3); }
.like-row { display: flex; align-items: center; gap: 0.75rem; margin-top: auto; padding-top: 1.15rem; border-top: 1px solid var(--hair); }
.like-btn {
  width: 46px; height: 46px; border-radius: 50%;
  border: 1px solid var(--line); background: var(--card-strong);
  display: grid; place-items: center;
  color: #f2a0b5; font-size: 1.2rem;
  transition: transform 0.2s, color 0.2s;
}
.like-btn:hover { transform: scale(1.08); }
.like-btn.is-on { color: var(--pink); animation: pop 0.4s; }
@keyframes pop { 50% { transform: scale(1.3); } }
.like-row span { font-size: 0.85rem; color: var(--ink-2); }

.foot-note {
  margin: 2.15rem 0 0;
  text-align: center;
  color: var(--ink-3);
  font-family: var(--font-display);
  font-size: 0.82rem;
}
.foot-note a { text-decoration: underline; text-underline-offset: 3px; }

/* ===== 內頁通用 ===== */
.page-shell { width: min(1140px, calc(100% - 2rem)); margin: 0 auto; padding: 1.35rem 0 3rem; }
.top-nav {
  position: sticky; top: 0.85rem; z-index: 20;
  display: flex; align-items: center; gap: 0.35rem;
  width: fit-content; max-width: 100%;
  margin: 0 auto 1.95rem;
  padding: 0.38rem;
  border-radius: 999px;
  background: var(--card);
  backdrop-filter: blur(12px) saturate(1.2);
  -webkit-backdrop-filter: blur(12px) saturate(1.2);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  overflow-x: auto;
  scrollbar-width: none;
}
.top-nav::-webkit-scrollbar { display: none; }
.top-nav a {
  display: inline-flex; align-items: center; gap: 0.42rem;
  padding: 0.5rem 0.98rem;
  border-radius: 999px;
  font-size: 0.88rem; font-weight: 600;
  color: var(--ink-2);
  white-space: nowrap;
  transition: background 0.2s, color 0.2s;
}
.top-nav a:hover { color: var(--ink); background: var(--card-strong); }
.top-nav a.is-active { background: var(--brand); color: #fff; }
.top-nav .home img { width: 30px; height: 30px; border-radius: 50%; object-fit: cover; }
.top-nav .home { padding: 0.18rem; flex: 0 0 auto; }
.top-nav .theme-toggle { width: 32px; height: 32px; flex: 0 0 auto; margin-left: 0.2rem; }

.page-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 1rem; margin-bottom: 1.35rem; }
.page-head h1 { margin: 0; font-family: var(--font-display); font-size: clamp(1.75rem, 3.5vw, 2.35rem); line-height: 1.18; font-weight: 700; }
.page-head p { margin: 0.35rem 0 0; color: var(--ink-2); font-size: 0.93rem; }
.search {
  width: min(320px, 100%);
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--card-strong);
  padding: 0.65rem 1.15rem;
  color: var(--ink);
  outline: none;
  transition: box-shadow 0.2s;
}
.search:focus { box-shadow: 0 0 0 3px var(--brand-soft); }
.search::placeholder { color: var(--ink-3); }
.filters { display: flex; flex-wrap: wrap; gap: 0.48rem; margin-bottom: 1.55rem; }

/* ===== 動態（Threads）===== */
.feed-layout { display: grid; grid-template-columns: minmax(0, 1fr) 280px; gap: 1.45rem; align-items: start; }
.feed-col { min-width: 0; }
.feed { display: flex; flex-direction: column; gap: 1.15rem; }
.feed-aside { position: sticky; top: 5.2rem; display: flex; flex-direction: column; gap: 1.1rem; }

.post { padding: 1.45rem 1.55rem 1.25rem; transition: box-shadow 0.25s; }
.post:hover { box-shadow: var(--shadow-hover); }
.post-head { display: flex; align-items: center; gap: 0.75rem; margin-bottom: 0.85rem; }
.post-head img { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; border: 2px solid rgba(255, 255, 255, 0.75); }
.post-head .who { font-weight: 700; font-size: 0.93rem; line-height: 1.25; }
.post-head .when { font-size: 0.76rem; color: var(--ink-3); }
.post-head .chip { margin-left: auto; }
.post-text {
  font-size: 0.96rem;
  line-height: 1.78;
  white-space: pre-line;
  word-break: break-word;
  overflow-wrap: anywhere;
}
.post-text a { color: var(--brand); text-decoration: underline; text-decoration-color: rgba(53, 191, 171, 0.4); text-underline-offset: 3px; }
.post-part + .post-part { margin-top: 0.95rem; padding-top: 0.95rem; border-top: 1px solid var(--hair); }
.post-part-label { display: block; font-size: 0.7rem; color: var(--ink-3); margin-bottom: 0.25rem; font-family: var(--font-mono); }
.post.is-clamped .post-body { max-height: 15.5em; overflow: hidden; -webkit-mask-image: linear-gradient(180deg, #000 70%, transparent); mask-image: linear-gradient(180deg, #000 70%, transparent); }
.post-more {
  margin-top: 0.45rem;
  border: none; background: none; padding: 0.25rem 0;
  color: var(--brand); font-weight: 600; font-size: 0.86rem;
}
.post-media { display: grid; gap: 0.45rem; margin-top: 0.95rem; border-radius: var(--r-lg); overflow: hidden; }
.post-media.n1 { grid-template-columns: 1fr; }
.post-media.n1 img { max-height: 460px; }
.post-media.n2 { grid-template-columns: 1fr 1fr; }
.post-media.n2 img { aspect-ratio: 1 / 1; }
.post-media.n3 { grid-template-columns: repeat(3, 1fr); }
.post-media.n4 { grid-template-columns: repeat(4, 1fr); }
.post-media.many { grid-auto-flow: column; grid-auto-columns: 38%; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: thin; }
.post-media.many img { scroll-snap-align: start; }
.post-media button { padding: 0; border: none; background: none; display: block; }
.post-media img {
  display: block; width: 100%; height: 100%;
  aspect-ratio: 4 / 5; object-fit: cover;
  background: var(--hair);
  transition: filter 0.2s;
}
.post-media.n1 img { aspect-ratio: auto; object-fit: contain; background: var(--card-strong); }
.post-media button:hover img { filter: brightness(0.94); }
.post-links { display: flex; flex-wrap: wrap; gap: 0.42rem; margin-top: 0.85rem; }
.post-links a {
  display: inline-flex; align-items: center; gap: 0.35rem;
  max-width: 100%;
  padding: 0.3rem 0.75rem;
  border-radius: 999px;
  background: var(--hair);
  font-size: 0.78rem; color: var(--ink-2);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.post-links a:hover { background: var(--brand-soft); color: var(--brand); }
.post-foot { display: flex; justify-content: flex-end; margin-top: 0.85rem; }
.post-foot a { font-size: 0.8rem; color: var(--ink-3); display: inline-flex; align-items: center; gap: 0.32rem; }
.post-foot a:hover { color: var(--brand); }
.post-foot svg { width: 14px; height: 14px; }
.post.is-target { box-shadow: 0 0 0 3px var(--brand), var(--shadow-hover); }

.aside-profile { text-align: center; }
.aside-profile img { width: 78px; height: 78px; border-radius: 50%; object-fit: cover; border: 3px solid rgba(255, 255, 255, 0.85); }
.aside-profile h2 { margin: 0.55rem 0 0; font-family: var(--font-display); font-size: 1.28rem; font-weight: 700; }
.aside-profile .handle { font-size: 0.8rem; color: var(--ink-2); }
.aside-profile p { font-size: 0.85rem; color: var(--ink-2); margin: 0.75rem 0 1rem; }
.month-list { display: flex; flex-direction: column; gap: 0.22rem; }
.month-list button {
  display: flex; justify-content: space-between; gap: 0.65rem;
  border: none; background: none;
  padding: 0.5rem 0.75rem; border-radius: 12px;
  font-size: 0.88rem; color: var(--ink);
  text-align: left;
}
.month-list button:hover { background: var(--card-strong); }
.month-list button.is-active { background: var(--brand-soft); color: var(--brand); font-weight: 700; }
.month-list span { color: var(--ink-3); font-size: 0.8rem; }
.load-more { align-self: center; }

/* 燈箱 */
.lightbox {
  position: fixed; inset: 0; z-index: 100;
  display: none; place-items: center;
  background: rgba(10, 16, 18, 0.78);
  backdrop-filter: blur(8px);
  padding: 2rem;
}
.lightbox.is-open { display: grid; animation: fade 0.2s; }
@keyframes fade { from { opacity: 0; } }
.lightbox img { max-width: min(92vw, 1000px); max-height: 86vh; border-radius: 18px; box-shadow: 0 30px 60px rgba(0, 0, 0, 0.45); }
.lightbox button {
  position: absolute;
  width: 44px; height: 44px; border-radius: 50%;
  border: none; background: rgba(255, 255, 255, 0.16); color: #fff;
  font-size: 1.3rem; display: grid; place-items: center;
}
.lightbox button:hover { background: rgba(255, 255, 255, 0.28); }
.lb-close { top: 1rem; right: 1rem; }
.lb-prev { left: 1rem; top: 50%; transform: translateY(-50%); }
.lb-next { right: 1rem; top: 50%; transform: translateY(-50%); }
.lb-count { position: absolute; bottom: 1.2rem; left: 50%; transform: translateX(-50%); color: rgba(255, 255, 255, 0.8); font-size: 0.85rem; font-family: var(--font-mono); }

/* ===== 分享 / 專案 卡片 ===== */
.grid-cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1.2rem; }
.item-card {
  display: flex; flex-direction: column; gap: 0.85rem;
  padding: 1.45rem 1.5rem;
  transition: transform 0.25s, box-shadow 0.25s;
  animation: rise 0.5s cubic-bezier(.2, .8, .2, 1) both;
}
.item-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-hover); }
.item-head { display: flex; gap: 0.85rem; align-items: center; }
.item-head h3 { margin: 0; font-family: var(--font-display); font-size: 1.1rem; line-height: 1.35; font-weight: 700; }
.item-head .repo { display: block; font-size: 0.74rem; color: var(--ink-3); font-family: var(--font-mono); }
.item-tags { display: flex; flex-wrap: wrap; gap: 0.38rem; }
.item-desc { margin: 0; color: var(--ink-2); font-size: 0.89rem; line-height: 1.65; flex: 1; }
.item-foot { display: flex; align-items: center; justify-content: space-between; gap: 0.55rem; padding-top: 0.85rem; border-top: 1px solid var(--hair); font-size: 0.8rem; color: var(--ink-2); }
.item-foot .meta { display: inline-flex; align-items: center; gap: 0.75rem; }
.item-foot .star { color: var(--yellow); }
.lang-dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 0.32rem; vertical-align: 0; }
.item-links { display: inline-flex; gap: 0.38rem; }
.item-links a {
  padding: 0.28rem 0.75rem; border-radius: 999px;
  background: var(--card-strong); border: 1px solid var(--line);
  font-size: 0.78rem; font-weight: 600; color: var(--ink);
}
.item-links a:hover { color: var(--brand); }
.item-links a.primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.item-links a.primary:hover { color: #fff; filter: brightness(1.04); }

.proj-feature {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1.2rem; margin-bottom: 1.2rem;
}
.proj-feature .item-card {
  background:
    linear-gradient(160deg, rgba(255, 255, 255, 0.55), rgba(255, 255, 255, 0.18)),
    var(--card);
}
.proj-feature .item-card .big-star { font-family: var(--font-display); font-size: 2.1rem; line-height: 1; color: var(--ink); font-weight: 700; }
.proj-feature .item-card .big-star small { font-size: 0.8rem; color: var(--ink-3); margin-left: 0.35rem; font-family: var(--font-sans); font-weight: 500; }

/* ===== 關於 ===== */
.about-grid { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 1.35rem; align-items: start; }
.about-id { text-align: center; }
.about-id img {
  width: 124px; height: 124px;
  border-radius: 40px;
  object-fit: cover;
  border: 3px solid rgba(255, 255, 255, 0.88);
  box-shadow: 0 22px 36px -20px rgba(0, 0, 0, 0.22);
}
.about-id h1 { margin: 1rem 0 0.15rem; font-family: var(--font-display); font-size: 1.75rem; font-weight: 700; }
.about-id .handle { color: var(--ink-2); font-size: 0.86rem; }
.about-id .social-row { justify-content: center; margin-top: 1.15rem; }
.about-main { display: flex; flex-direction: column; gap: 1.35rem; }
.about-main h2 { margin: 0 0 0.7rem; font-family: var(--font-display); font-size: 1.18rem; font-weight: 700; }
.about-main p { margin: 0; color: var(--ink-2); }
.quote {
  position: relative;
  font-size: 0.98rem; line-height: 1.85; color: var(--ink);
  padding-left: 1.15rem; border-left: 3px solid var(--brand);
}
.facts { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 0.8rem; }
.fact {
  padding: 0.95rem 1.1rem;
  border-radius: var(--r-md);
  background: var(--card-strong);
  border: 1px solid var(--line);
}
.fact b { display: block; font-family: var(--font-display); font-size: 1.38rem; line-height: 1.25; font-weight: 700; }
.fact span { font-size: 0.78rem; color: var(--ink-2); }
.topic-cloud { display: flex; flex-wrap: wrap; gap: 0.48rem; }

/* ===== RWD ===== */
@media (max-width: 1020px) {
  .board {
    grid-template-columns: 1fr 1fr;
    grid-template-areas:
      "nav greet"
      "nav art"
      "latest latest"
      "tools extra"
      "social recommend";
  }
  .grid-cards, .proj-feature { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .feed-layout { grid-template-columns: 1fr; }
  .feed-aside { position: static; order: -1; }
  .feed-aside .aside-profile { display: none; }
  .month-list { flex-direction: row; flex-wrap: wrap; }
  .about-grid { grid-template-columns: 1fr; }
}

@media (max-width: 720px) {
  body { cursor: auto; font-size: 14.5px; }
  button { cursor: pointer; }
  .stage, .page-shell { width: calc(100% - 2rem); padding-top: 1rem; }
  .board {
    grid-template-columns: 1fr;
    grid-template-areas: "greet" "nav" "latest" "art" "tools" "extra" "social" "recommend";
    gap: 1rem;
  }
  .card { border-radius: 28px; padding: 1.25rem; }
  .greet-card { flex-direction: column; text-align: center; gap: 1.1rem; padding: 1.65rem 1.35rem; }
  .latest-body { grid-template-columns: 1fr; }
  .latest-imgs img { width: 100%; height: 180px; }
  .latest-imgs { display: grid; grid-template-columns: 1fr 1fr; }
  .latest-imgs img:only-child { grid-column: 1 / -1; }
  .grid-cards, .proj-feature { grid-template-columns: 1fr; }
  .post { padding: 1.2rem 1.15rem 1.1rem; }
  .post-media.n3, .post-media.n4 { grid-template-columns: 1fr 1fr; }
  .post-media.many { grid-auto-columns: 70%; }
  .top-nav { width: 100%; justify-content: flex-start; }
  .top-nav a { padding: 0.48rem 0.78rem; }
  .page-head .search { width: 100%; }
  .polaroids { min-height: 145px; }
}

/* ==========================================================
   Studio — 設定面板 / 拖拽 / 寫作台 / 友鏈 / 新功能
   ========================================================== */

/* 浮動設定鈕 */
.studio-fab {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 40;
  width: 48px;
  height: 48px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: var(--card-strong);
  color: var(--ink-2);
  box-shadow: var(--shadow);
  display: grid;
  place-items: center;
}
.studio-fab:hover { color: var(--brand); transform: translateY(-2px) rotate(20deg); }
.studio-fab svg { width: 20px; height: 20px; }

.studio-open { overflow: hidden; }

/* 設定面板 */
.studio-backdrop {
  position: fixed;
  inset: 0;
  z-index: 60;
  background: rgba(44, 36, 24, 0.28);
  backdrop-filter: blur(6px);
  display: grid;
  place-items: center;
  padding: 20px;
}
.studio-backdrop[hidden] { display: none; }

.studio {
  width: min(720px, 100%);
  max-height: min(86vh, 820px);
  overflow: auto;
  background: var(--card-strong);
  border: 1px solid var(--line);
  border-radius: var(--r-xl);
  box-shadow: var(--shadow-hover);
  padding: 20px 22px 24px;
}
.studio-head {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px dashed var(--hair);
}
.studio-tabs { display: flex; gap: 6px; flex-wrap: wrap; }
.studio-tabs button {
  border: 1px solid transparent;
  background: transparent;
  border-radius: 999px;
  padding: 8px 14px;
  font-size: 14px;
  font-weight: 700;
  color: var(--ink-2);
}
.studio-tabs button.is-active {
  background: var(--brand-soft);
  color: var(--brand);
  border-color: transparent;
}
.studio-actions { display: flex; gap: 8px; }

.studio-pane { display: none; }
.studio-pane.is-active { display: grid; gap: 14px; }

.field { display: grid; gap: 6px; font-size: 13px; color: var(--ink-2); font-weight: 700; }
.field--full { grid-column: 1 / -1; }
.field input[type="text"],
.field input[type="url"],
.field textarea,
.field select,
.write-input,
.write-title,
.write-slug {
  width: 100%;
  border: 1px solid var(--hair);
  background: rgba(255, 255, 255, 0.55);
  border-radius: 12px;
  padding: 10px 12px;
  font-size: 14px;
  color: var(--ink);
  font-weight: 600;
}
:root[data-theme="dark"] .field input,
:root[data-theme="dark"] .field textarea,
:root[data-theme="dark"] .field select,
:root[data-theme="dark"] .write-input {
  background: rgba(0, 0, 0, 0.22);
}

.check {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  font-weight: 700;
  color: var(--ink);
}
.check input { width: 16px; height: 16px; accent-color: var(--brand); }

.hint { margin: 0; font-size: 13px; color: var(--ink-2); line-height: 1.55; }

.social-edit { display: grid; gap: 8px; margin: 8px 0 10px; }
.social-row-edit {
  display: grid;
  grid-template-columns: 110px 1fr 36px 36px 36px;
  gap: 6px;
  align-items: center;
}
.social-row-edit button {
  height: 36px;
  border-radius: 10px;
  border: 1px solid var(--hair);
  background: var(--card);
  color: var(--ink-2);
}
.social-row-edit .s-del { color: var(--pink); }
.social-row-edit input {
  border: 1px solid var(--hair);
  background: rgba(255, 255, 255, 0.55);
  border-radius: 10px;
  padding: 8px 10px;
  font-size: 13px;
}

.palette-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
  gap: 10px;
}
.palette-card {
  display: grid;
  gap: 8px;
  justify-items: center;
  padding: 12px 8px;
  border-radius: 14px;
  border: 1px solid var(--hair);
  background: var(--card);
  color: var(--ink-2);
  font-size: 13px;
  font-weight: 700;
}
.palette-card.is-active {
  border-color: var(--brand);
  color: var(--brand);
  box-shadow: 0 0 0 3px var(--brand-soft);
}
.pal-swatch {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  border: 1px solid var(--hair);
}

.color-row {
  display: flex;
  gap: 12px;
  align-items: center;
}
.color-row input[type="color"] {
  width: 48px;
  height: 40px;
  border: 1px solid var(--hair);
  border-radius: 10px;
  padding: 2px;
  background: transparent;
}
.color-row code {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--ink-2);
}

.layout-list {
  margin: 0 0 12px;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 8px;
}
.layout-list li {
  display: flex;
  gap: 10px;
  align-items: center;
  padding: 10px 12px;
  border-radius: 12px;
  background: var(--card);
  border: 1px dashed var(--hair);
  font-size: 13px;
  font-weight: 700;
  color: var(--ink-2);
}
.layout-list .num {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--brand-soft);
  color: var(--brand);
  font-size: 12px;
}

/* 首頁拖拽 */
.board.can-drag > * { transition: box-shadow 0.2s ease, transform 0.2s ease; }
.board.layout-mode > * {
  outline: 1.5px dashed var(--brand);
  outline-offset: 4px;
  cursor: grab;
}
.board > *.is-dragging {
  opacity: 0.55;
  transform: scale(0.98) rotate(-0.5deg);
  cursor: grabbing;
}
.drag-tag {
  display: inline-block;
  margin-bottom: 8px;
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--brand-soft);
  color: var(--brand);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.04em;
  transform: rotate(-1.5deg);
}

/* Toast */
.yu-toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  transform: translateX(-50%) translateY(20px);
  z-index: 80;
  background: var(--ink);
  color: var(--bg);
  padding: 12px 18px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 700;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease, transform 0.25s ease;
  box-shadow: var(--shadow);
}
.yu-toast.is-show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* 動態：時間範圍 */
.range-tabs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin: 0 0 12px;
}
.range-tabs button,
.chip-btn {
  border: 1px solid var(--hair);
  background: var(--card);
  border-radius: 999px;
  padding: 7px 14px;
  font-size: 13px;
  font-weight: 700;
  color: var(--ink-2);
}
.range-tabs button.is-active,
.chip-btn.is-active {
  background: var(--brand);
  border-color: transparent;
  color: #fff;
}
.chip-btn small {
  margin-left: 6px;
  opacity: 0.75;
  font-size: 11px;
}

/* Views / Marks */
.views-row {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-top: 8px;
  font-size: 12px;
  color: var(--ink-3);
  font-weight: 700;
}
.views-row button {
  border: 1px solid var(--hair);
  background: var(--card-strong);
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 12px;
  color: var(--ink-2);
  font-weight: 700;
}
.views-row button.is-on {
  color: var(--pink);
  border-color: transparent;
  background: rgba(196, 123, 154, 0.18);
}

/* 寫作台 */
.write-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.write-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(260px, 0.9fr);
  gap: 18px;
  align-items: start;
}
.write-main { display: grid; gap: 12px; padding: 18px; }
.write-title-row {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(140px, 0.7fr);
  gap: 10px;
}
.write-title { font-size: 20px; font-weight: 800; }
.write-body {
  width: 100%;
  min-height: 420px;
  resize: vertical;
  border: 1px solid var(--hair);
  background: rgba(255, 255, 255, 0.5);
  border-radius: 14px;
  padding: 14px;
  font-family: var(--font-mono);
  font-size: 13.5px;
  line-height: 1.7;
  color: var(--ink);
}
.write-foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}
.write-side { display: grid; gap: 14px; }
.write-side .card { padding: 16px; display: grid; gap: 10px; }
.write-preview {
  max-height: 360px;
  overflow: auto;
  font-size: 13.5px;
  line-height: 1.7;
  color: var(--ink);
}
.draft-card h1 { margin: 0 0 8px; font-size: 22px; line-height: 1.3; }
.draft-meta { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.draft-cover {
  width: 100%;
  max-height: 180px;
  object-fit: cover;
  border-radius: 12px;
  margin-bottom: 12px;
}
.draft-body p { margin: 0 0 0.75em; }
.draft-body h1, .draft-body h2, .draft-body h3 { margin: 1em 0 0.4em; line-height: 1.3; }
.draft-body pre {
  background: rgba(44, 36, 24, 0.08);
  padding: 10px 12px;
  border-radius: 10px;
  overflow: auto;
  font-size: 12.5px;
}
.draft-body code {
  font-family: var(--font-mono);
  font-size: 0.92em;
  background: rgba(44, 36, 24, 0.08);
  padding: 1px 5px;
  border-radius: 5px;
}
.draft-body blockquote {
  margin: 0 0 0.75em;
  padding: 6px 12px;
  border-left: 3px solid var(--brand);
  color: var(--ink-2);
}

/* 友鏈 */
.friend-card {
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr);
  gap: 14px;
  align-items: start;
  padding: 16px;
}
.friend-card:hover { transform: translateY(-3px); color: inherit; }
.friend-avatar {
  width: 52px;
  height: 52px;
  border-radius: 16px;
  display: grid;
  place-items: center;
  font-size: 22px;
  font-weight: 800;
  color: var(--ink);
  border: 1px solid var(--line);
}
.friend-card h3 {
  margin: 0 0 4px;
  font-size: 17px;
  font-weight: 800;
}
.friend-card p {
  margin: 0 0 6px;
  font-size: 13px;
  color: var(--ink-2);
  line-height: 1.5;
}
.friend-url {
  font-size: 12px;
  color: var(--ink-3);
  font-family: var(--font-mono);
}

/* 按鈕 */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 40px;
  padding: 0 16px;
  border-radius: 12px;
  border: 1px solid transparent;
  background: var(--brand);
  color: #fff;
  font-size: 14px;
  font-weight: 800;
  cursor: pointer;
}
.btn:hover { filter: brightness(1.05); color: #fff; }
.btn--ghost {
  background: var(--card-strong);
  border-color: var(--hair);
  color: var(--ink-2);
}
.btn--ghost:hover { color: var(--brand); }
.btn-sm { min-height: 32px; padding: 0 12px; font-size: 12px; }

/* 首頁卡片：紙感圓角稍微收斂，加一條頂邊像便條紙 */
.card {
  border-radius: var(--r-xl);
  background: var(--card);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  backdrop-filter: blur(10px) saturate(1.05);
  -webkit-backdrop-filter: blur(10px) saturate(1.05);
}

/* RWD */
@media (max-width: 900px) {
  .write-layout { grid-template-columns: 1fr; }
  .social-row-edit { grid-template-columns: 1fr 1fr; }
  .social-row-edit .s-up,
  .social-row-edit .s-down,
  .social-row-edit .s-del { grid-column: span 1; }
}
@media (max-width: 640px) {
  .studio-head { flex-direction: column; align-items: stretch; }
  .write-title-row { grid-template-columns: 1fr; }
  .studio-fab { right: 12px; bottom: 12px; width: 44px; height: 44px; }
}

.studio-fab--drag {
  bottom: 78px;
  right: 18px;
}
.studio-fab--drag.is-on {
  color: #fff;
  background: var(--brand);
}
@media (max-width: 640px) {
  .studio-fab--drag { right: 12px; bottom: 68px; width: 44px; height: 44px; }
}
