/* 石流：一顆結石的一生（結石島）。選擇器都加 .sf，避免跟全站樣式互相影響 */
.sf { --bad: #b03a2e; }
@media (prefers-color-scheme: dark) { .sf { --bad: #ff8a7a; } }

.sf .sf-wrap { max-width: 72rem; margin: 0 auto; padding: 1rem var(--pad) 3rem; }
.sf .eyebrow { margin: 0; font-size: .8rem; letter-spacing: .12em; color: var(--accent); font-weight: 700; }
.sf h1 { margin: .2rem 0 .3rem; font-size: clamp(1.5rem, 4vw, 2rem); line-height: 1.3; }
.sf .lede { margin: 0 0 1rem; color: var(--ink-soft); line-height: 1.7; }

.sf .stage { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 1rem; align-items: start; line-height: 1.7; }
@media (max-width: 760px) { .sf .stage { grid-template-columns: 1fr; } }

.sf .field { position: relative; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: .75rem; overflow: hidden; }
@media (min-width: 761px) { .sf .field { position: sticky; top: 1rem; } }
.sf .field svg { display: block; width: 100%; height: auto; max-height: 72vh; margin: 0 auto; border-radius: 10px; }
@media (max-width: 760px) { .sf .field svg { max-height: 52vh; } }
.sf .caption { min-height: 1.6em; margin: .35rem 0 0; text-align: center; font-weight: 700; color: var(--accent-ink); }

.sf .panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 1.1rem; }
.sf .chapters { display: grid; grid-template-columns: repeat(7, 1fr); gap: .3rem; margin: 0 0 1rem; padding: 0; list-style: none; }
@media (max-width: 520px) { .sf .chapters { grid-template-columns: repeat(4, 1fr); } }
.sf .chapters button {
  width: 100%; font: inherit; font-size: .78rem; font-weight: 700; line-height: 1.3; cursor: pointer;
  min-height: 44px; padding: .25rem .1rem; border-radius: 8px; border: 1px solid var(--line); background: var(--bg); color: var(--ink-faint);
}
.sf .chapters button b { display: block; font-size: .95rem; }
.sf .chapters button.done { color: var(--accent-ink); border-color: var(--accent); }
.sf .chapters button[aria-current="step"] { background: var(--accent); border-color: var(--accent); color: #fff; }
@media (prefers-color-scheme: dark) { .sf .chapters button[aria-current="step"] { color: #0f1619; } }

.sf .count { margin: 0; font-size: .85rem; color: var(--ink-faint); font-weight: 700; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .3rem; }
.sf .auto { font: inherit; font-size: .85rem; font-weight: 700; cursor: pointer; min-height: 36px; padding: .2rem .8rem; border-radius: 999px; border: 1px solid var(--line); background: var(--bg); color: var(--ink-soft); }
.sf .auto[aria-pressed="true"] { border-color: var(--accent); color: var(--accent-ink); }
.sf .trio { display: flex; flex-wrap: wrap; align-items: center; gap: .35rem; margin: .6rem 0 .4rem; padding: 0; list-style: none; font-size: .88rem; font-weight: 700; }
.sf .trio .t { color: var(--ink-faint); margin-right: .15rem; }
.sf .trio li.p { padding: .1rem .65rem; border-radius: 999px; border: 1px solid var(--line); color: var(--ink-faint); }
.sf .trio li.p.on { background: color-mix(in srgb, var(--bad) 12%, var(--surface)); border-color: var(--bad); color: var(--bad); }
@media (max-width: 520px) { .sf .trio { font-size: .8rem; gap: .25rem; } .sf .trio .t { flex-basis: 100%; } .sf .trio li.p { padding: .05rem .5rem; } }

.sf .panel h2 { margin: .1rem 0 .5rem; font-size: 1.35rem; line-height: 1.4; }
.sf .panel p.say { margin: 0 0 .8rem; font-size: 1.02rem; }
.sf .alert { margin: 0 0 .9rem; padding: .55rem .8rem; border-radius: 10px; font-size: .95rem; background: color-mix(in srgb, var(--bad) 9%, var(--surface)); border: 1px solid color-mix(in srgb, var(--bad) 35%, var(--line)); }
.sf .read { margin: 0 0 1rem; padding: 0; list-style: none; }
.sf .read li { margin: .2rem 0; }
.sf .read a { color: var(--accent-ink); font-weight: 700; text-underline-offset: .2em; }
.sf .read .kind { display: inline-block; font-size: .72rem; font-weight: 700; margin-right: .35rem; background: var(--accent-soft); color: var(--accent-ink); border-radius: 6px; padding: 0 .4rem; vertical-align: .1em; }

.sf .nav { display: flex; flex-wrap: wrap; gap: .6rem; align-items: center; }
.sf .btn {
  font: inherit; font-weight: 700; font-size: 1rem; cursor: pointer; min-height: 44px;
  border: 0; border-radius: 999px; padding: .55rem 1.3rem; text-decoration: none; display: inline-flex; align-items: center;
  background: var(--accent); color: #fff; box-shadow: 0 2px 8px rgba(15, 122, 108, .25);
}
.sf .btn.ghost { background: var(--surface); color: var(--accent-ink); border: 1px solid var(--accent); box-shadow: none; }
.sf .btn.plain { background: none; color: var(--ink-soft); box-shadow: none; padding: .55rem .6rem; font-weight: 500; text-decoration: underline; text-underline-offset: .2em; }
@media (prefers-color-scheme: dark) { .sf .btn { color: #0f1619; } .sf .btn.ghost { color: var(--accent-ink); } .sf .btn.plain { color: var(--ink-soft); } }
.sf .btn.next { position: relative; overflow: hidden; }
.sf .btn.next .fill { position: absolute; inset: 0; background: rgba(255, 255, 255, .3); transform-origin: left; transform: scaleX(var(--p, 0)); pointer-events: none; }

.sf .exits { display: grid; gap: .6rem; margin: .2rem 0 1rem; }
.sf .exit { display: flex; gap: .7rem; align-items: center; padding: .7rem .9rem; border-radius: 12px; border: 1px solid var(--accent); background: var(--accent-soft); color: var(--ink); text-decoration: none; }
.sf .exit b { display: block; color: var(--accent-ink); font-size: 1.05rem; }
.sf .exit small { color: var(--ink-soft); }
.sf .exit .go { margin-left: auto; font-weight: 700; color: var(--accent-ink); white-space: nowrap; }
.sf .note { margin-top: 1.25rem; font-size: .85rem; color: var(--ink-faint); }

/* SVG：底圖永遠是淺色，所以這裡的顏色不跟深色模式變 */
.sf #svg { --stone: #e0a12b; --stone-edge: #a86f10; }
.sf .ureter { fill: none; stroke: #eab4a3; stroke-width: 9.5; stroke-linecap: round; filter: drop-shadow(1.5px 2px 1.5px rgba(110, 45, 30, .38)); }
.sf .lbl { font-size: 12px; font-weight: 700; fill: #16232b; paint-order: stroke; stroke: #fff; stroke-width: 4px; stroke-linejoin: round; }
.sf .lbl.big { font-size: 15px; }
.sf .lbl.red { fill: #b03a2e; }
.sf .org text { font-size: 13.5px; font-weight: 700; fill: #0a5f54; paint-order: stroke; stroke: #fff; stroke-width: 3.5px; stroke-linejoin: round; letter-spacing: .05em; }
.sf .lead { fill: none; stroke: #4a5f6b; stroke-width: 1; stroke-dasharray: 2 2; }
.sf .drop { fill: #ffe58a; stroke: #d4a017; stroke-width: .7; }
.sf .hydro-water circle { fill: #ffe58a; fill-opacity: .8; stroke: #d4a017; stroke-width: .8; }
.sf .crystal { fill: #fff7e0; stroke: #c99a3a; stroke-width: .8; }
.sf .stent { fill: none; stroke: #2f7fc8; stroke-width: 3; stroke-linecap: round; stroke-dasharray: 5 3; filter: drop-shadow(0 0 1px #fff) drop-shadow(0 0 1px #fff); }
.sf .germ circle.b { fill: #7cc35a; stroke: #3d7a25; stroke-width: 1; }
.sf .germ circle.e { fill: #1d3a12; }
.sf .bob { animation: sf-bob 1.4s ease-in-out infinite alternate; }
@keyframes sf-bob { from { transform: translateY(1px) rotate(-4deg); } to { transform: translateY(-1.5px) rotate(4deg); } }
.sf .wiggle { transform-box: fill-box; transform-origin: center; animation: sf-wig .9s ease-in-out infinite alternate; }
@keyframes sf-wig { from { transform: scale(.92) rotate(-8deg); } to { transform: scale(1.06) rotate(8deg); } }
.sf .zap { fill: #ffd43b; stroke: #c0392b; stroke-width: 1.2; stroke-linejoin: round; transform-box: fill-box; transform-origin: center; animation: sf-zap .5s steps(2) infinite; }
@keyframes sf-zap { 50% { opacity: .25; transform: scale(.85); } }
.sf .zz { font-size: 13px; font-weight: 900; fill: #0a5f54; paint-order: stroke; stroke: #fff; stroke-width: 3px; animation: sf-zz 2.4s ease-in-out infinite; }
@keyframes sf-zz { 0% { opacity: 0; transform: translate(0, 4px); } 30%, 70% { opacity: 1; } 100% { opacity: 0; transform: translate(6px, -10px); } }
.sf .sonar { fill: none; stroke: #2f7fc8; stroke-width: 2; animation: sf-sonar 1.6s ease-out infinite; }
@keyframes sf-sonar { from { opacity: .9; } to { opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .sf .bob, .sf .wiggle, .sf .zap, .sf .zz, .sf .sonar { animation: none; } }

/* 手機上按鈕滿版直排，下一幕放最上面 */
@media (max-width: 520px) {
  .sf .nav .btn { flex: 1 1 100%; justify-content: center; }
  .sf .nav .next, .sf .nav [data-go="0"] { order: -1; }
}
.sf .breadcrumb { margin-bottom: .5rem; }
