/* 小島主頁（templates/world.html）的樣式 */
:root { --ink: #1f2f2a; --muted: #5a6b66; --pine: #2c6e49; --amber: #ffb64a; --paper: #fbfaf5; --line: #e7e4da; }
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; height: 100%; overflow: hidden; background: #0f4f73; color: var(--ink);
  font-family: 'PingFang TC', 'Noto Sans TC', 'Microsoft JhengHei', system-ui, sans-serif; }
#world { position: fixed; inset: 0; touch-action: none; cursor: grab; }
#world.hovering { cursor: pointer; }
#world.panning, #world.panning canvas { cursor: move; }
#world canvas { display: block; }
#vignette { position: fixed; inset: 0; pointer-events: none; z-index: 1;
  background: radial-gradient(ellipse at 50% 45%, transparent 55%, rgba(4, 30, 48, .45) 100%); }

.stamp { position: fixed; z-index: 10; top: 18px; left: 20px; background: var(--pine); color: #f6f3e8;
  font-weight: 900; font-size: 1.15rem; letter-spacing: .12em; padding: 4px 12px 5px 14px; border-radius: 7px;
  transform: rotate(-2deg); text-decoration: none; box-shadow: 0 4px 0 rgba(0,0,0,.2); }
#chips { position: fixed; z-index: 26; top: 18px; right: 18px; display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.chip { all: unset; cursor: pointer; padding: 7px 14px; border-radius: 999px; font-size: .9rem; color: #fff;
  background: rgba(6, 40, 60, .38); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  border: 1px solid rgba(255,255,255,.22); transition: background .15s; }
.chip:hover, .chip.active { background: rgba(6, 40, 60, .66); }
.chip.cta { background: #fff; color: var(--pine); font-weight: 800; border-color: #fff; }
#hint { position: fixed; z-index: 10; left: 50%; bottom: 18px; transform: translateX(-50%); color: rgba(255,255,255,.88);
  font-size: .82rem; background: rgba(6,40,60,.32); padding: 6px 14px; border-radius: 999px; -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
  white-space: nowrap; }
#hint i { display: inline-block; width: 0; height: 0; border-left: 5px solid transparent; border-right: 5px solid transparent;
  border-bottom: 9px solid; margin: 0 3px 0 8px; vertical-align: -1px; font-style: normal; }
#ad { position: fixed; z-index: 10; right: 18px; bottom: 18px; width: 250px; min-height: 60px; padding: 0; font-size: .76rem;
  color: rgba(255,255,255,.8); text-align: center; border-radius: 12px; background: rgba(6,40,60,.32);
  border: 1px dashed rgba(255,255,255,.3); }
#ad .ad-placeholder { padding: 10px 12px; }
/* 廣告還沒回來前先隱形但保留大小（AdSense 要量得到寬度才會投放）；沒有廣告可放就整塊拿掉，不留空框 */
#ad:has(ins.adsbygoogle):not(:has(ins[data-ad-status="filled"])) { visibility: hidden; }
#ad:has(ins[data-ad-status="unfilled"]) { display: none; }

.w-label { position: fixed; z-index: 5; left: 0; top: 0; transform: translate(-50%, -100%); pointer-events: none; will-change: transform;
  background: #fff; color: var(--ink); font-size: 12px; font-weight: 800; padding: 2px 9px; border-radius: 999px;
  white-space: nowrap; box-shadow: 0 3px 0 rgba(0,0,0,.16); }
.w-label.minor { font-size: 11px; font-weight: 700; padding: 1px 7px; background: rgba(255,255,255,.88); }
.w-label.climbed { background: var(--amber); }
#tip { position: fixed; z-index: 6; pointer-events: none; transform: translate(12px, -130%); background: #1f2f2a;
  color: #fff; font-size: 12px; padding: 3px 10px; border-radius: 6px; white-space: nowrap; }

/* 捲軸：細、圓角、配色一致，並留在圓角內側 */
.card, #list, #q-results { scrollbar-width: thin; scrollbar-color: rgba(44,110,73,.45) transparent; }
.card::-webkit-scrollbar, #list::-webkit-scrollbar, #q-results::-webkit-scrollbar { width: 10px; }
.card::-webkit-scrollbar-track, #q-results::-webkit-scrollbar-track { background: transparent; margin: 18px 0; }
.card::-webkit-scrollbar-thumb, #list::-webkit-scrollbar-thumb, #q-results::-webkit-scrollbar-thumb {
  background: rgba(44,110,73,.35); border-radius: 999px; border: 3px solid transparent; background-clip: padding-box; }
.card::-webkit-scrollbar-thumb:hover { background-color: rgba(44,110,73,.6); }

/* 共用面板 */
.card { position: fixed; z-index: 20; background: var(--paper); border-radius: 18px; overflow: auto;
  box-shadow: 0 8px 0 rgba(0,0,0,.15), 0 20px 50px rgba(0,0,0,.25); }
/* 關閉按鈕：圓形底＋用兩條線畫的 ✕（字型的 ✕ 在各平台粗細、置中都不一致） */
.close { all: unset; cursor: pointer; position: absolute; top: 10px; right: 10px; width: 36px; height: 36px; border-radius: 50%;
  color: var(--muted); transition: background .15s, color .15s, transform .12s; -webkit-tap-highlight-color: transparent; }
.close::before, .close::after, .tabs .t-close::before, .tabs .t-close::after { content: ''; position: absolute; left: 50%; top: 50%;
  width: 15px; height: 2px; border-radius: 2px; background: currentColor; }
.close::before, .tabs .t-close::before { transform: translate(-50%, -50%) rotate(45deg); }
.close::after, .tabs .t-close::after { transform: translate(-50%, -50%) rotate(-45deg); }
.close:hover { background: rgba(31, 47, 42, .08); color: var(--ink); }
.close:active, .tabs .t-close:active { transform: scale(.9); }
.close:focus-visible, .tabs .t-close:focus-visible { outline: 2px solid var(--pine); outline-offset: 2px; }
.kind { display: inline-block; font-size: .78rem; font-weight: 800; color: var(--pine); border: 1.5px solid var(--pine);
  border-radius: 4px; padding: 1px 8px; }
.btn { all: unset; cursor: pointer; padding: 9px 16px; border-radius: 999px; font-weight: 800; font-size: .92rem;
  background: var(--pine); color: #fff; text-align: center; }
.btn.on { background: var(--amber); color: #3c2a10; }
.btn.ghost { background: transparent; color: var(--pine); border: 1.5px solid var(--pine); padding: 7.5px 14px; }
.btn.small { padding: 6px 12px; font-size: .82rem; }

/* 山的資訊卡（右） */
#sheet { top: 76px; right: 18px; width: min(360px, calc(100vw - 36px)); max-height: calc(100vh - 100px);
  padding: 18px 20px 20px; transform: translateX(calc(100% + 30px)); transition: transform .35s cubic-bezier(.2,.9,.3,1.1); }
#sheet.open { transform: none; }
#sheet h2 { margin: 6px 0 2px; font-size: 1.7rem; }
#sheet .ele { font-size: 2.4rem; font-weight: 900; color: #c76a1c; line-height: 1.1; margin: 8px 0 2px; }
#sheet .ele small { font-size: .9rem; color: var(--muted); font-weight: 600; }
#sheet table { width: 100%; border-collapse: collapse; margin: 12px 0; font-size: .9rem; }
#sheet th { text-align: left; color: var(--muted); font-weight: 700; padding: 6px 8px 6px 0; white-space: nowrap;
  vertical-align: top; border-bottom: 1px solid var(--line); }
#sheet td { padding: 6px 0; border-bottom: 1px solid var(--line); }
#sheet .actions { display: flex; gap: 10px; flex-wrap: wrap; }
#s-huts { margin-top: 10px; border-top: 1px dashed var(--line); padding-top: 8px; }
#s-huts p { margin: 0 0 6px; font-size: .78rem; font-weight: 800; color: var(--muted); }
#s-huts a { display: flex; align-items: center; gap: 8px; padding: 6px 8px; border-radius: 10px; text-decoration: none; color: inherit; }
#s-huts a:hover { background: #fff4e3; }
#s-huts a .t { flex: 1; min-width: 0; }
#s-huts a b { font-size: .88rem; margin-right: 4px; }
#s-huts small { display: block; font-size: .72rem; color: var(--muted); }
#s-huts .who { font-size: .7rem; font-weight: 800; padding: 1px 7px; border-radius: 999px; background: #eaf3ec; color: #2c6e49; }
#s-huts .who.guest { background: #fff1d6; color: #9a5b12; }

/* 清單／紀錄面板（左） */
#drawer { top: 76px; left: 18px; width: min(380px, calc(100vw - 36px)); max-height: calc(100vh - 100px);
  display: flex; flex-direction: column; padding: 18px 18px 12px;
  transform: translateX(calc(-100% - 30px)); transition: transform .35s cubic-bezier(.2,.9,.3,1.1); }
#drawer.open { transform: none; }
#drawer h2 { margin: 0 0 8px; font-size: 1.35rem; }
.progress { display: flex; align-items: baseline; gap: 8px; margin-bottom: 6px; }
.progress b { font-size: 2rem; font-weight: 900; color: #c76a1c; }
.bar { height: 8px; background: var(--line); border-radius: 999px; overflow: hidden; margin-bottom: 12px; }
.bar > div { height: 100%; background: linear-gradient(90deg, var(--pine), var(--amber)); border-radius: 999px; transition: width .5s ease; }
.tools { display: flex; gap: 8px; margin-bottom: 10px; }
.tools input { flex: 1; min-width: 0; padding: 8px 12px; border: 1.5px solid var(--line); border-radius: 999px;
  font-size: .9rem; background: #fff; color: var(--ink); }
.tools select { padding: 8px 10px; border: 1.5px solid var(--line); border-radius: 999px; background: #fff; font-size: .85rem; }
#list { overflow: auto; margin: 0 -6px; padding: 0 6px; flex: 1; }
.item { display: flex; align-items: center; gap: 10px; padding: 7px 6px; border-radius: 10px; }
.item:hover { background: #f1efe6; }
.item.climbed { background: #fff3dc; }
.item input { width: 18px; height: 18px; accent-color: var(--pine); cursor: pointer; flex: none; }
.item .no { width: 46px; color: var(--muted); font-size: .8rem; text-align: right; flex: none; }
.ktag { display: inline-block; width: 42px; text-align: center; font-size: .68rem; font-weight: 800; color: #fff; border-radius: 4px; padding: 1px 0; }
.ktag.b { background: #e8553a; } .ktag.x { background: #3a86d5; } .ktag.m { background: #8e5cc7; }
body.drawer-open #island-title { display: none; }
.item .nm { all: unset; cursor: pointer; flex: 1; font-weight: 700; }
.item .nm:hover { color: var(--pine); text-decoration: underline; }
.item .el { color: var(--muted); font-size: .82rem; font-variant-numeric: tabular-nums; }
.stats { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 6px 0 14px; }
.stat { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; }
.stat.wide { grid-column: 1 / -1; }
.stat p { margin: 0; color: var(--muted); font-size: .8rem; }
.stat b { font-size: 1.6rem; font-weight: 900; color: #c76a1c; }
.stat small { color: var(--muted); font-weight: 600; }
.section-title { font-size: .85rem; color: var(--muted); font-weight: 800; margin: 14px 0 6px; }
.row { display: flex; gap: 8px; flex-wrap: wrap; }
.muted { color: var(--muted); font-size: .85rem; margin: 0 0 8px; }

/* 搜尋 */
#search { position: fixed; z-index: 15; top: 16px; left: 50%; transform: translateX(-50%); width: min(380px, calc(100vw - 260px)); }
#q { width: 100%; padding: 10px 16px 10px 40px; border-radius: 999px; border: 1px solid rgba(255,255,255,.4);
  background: rgba(255,255,255,.94); font-size: .95rem; color: var(--ink); box-shadow: 0 4px 0 rgba(0,0,0,.14); outline: none; }
#q:focus { border-color: var(--amber); box-shadow: 0 0 0 3px rgba(255,182,74,.45), 0 4px 0 rgba(0,0,0,.14); }
#search .ico { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); pointer-events: none; }
#q-results { margin-top: 6px; background: var(--paper); border-radius: 14px; overflow: auto; max-height: 50vh;
  box-shadow: 0 8px 0 rgba(0,0,0,.12), 0 16px 40px rgba(0,0,0,.2); }
.res { all: unset; box-sizing: border-box; display: flex; width: 100%; gap: 10px; align-items: center; padding: 9px 14px; cursor: pointer; }
.res:hover, .res.hl { background: #fff1d6; }
.res b { font-size: .98rem; }
.res .meta { color: var(--muted); font-size: .8rem; flex: 1; }
.res .tag { font-size: .72rem; font-weight: 800; padding: 1px 7px; border-radius: 4px; color: #fff; }
.res .tag.b { background: #e8553a; } .res .tag.x { background: #3a86d5; } .res .tag.m { background: #8e5cc7; } .res .tag.f { background: #4f8f7a; }
.res-note { padding: 8px 14px; font-size: .8rem; color: var(--muted); border-bottom: 1px solid var(--line); }

/* 完整資料頁 */
#detail { position: fixed; z-index: 40; inset: 0; background: rgba(4, 30, 48, .6); display: flex; -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px);
  align-items: center; justify-content: center; padding: 3vh 3vw; opacity: 0; pointer-events: none; transition: opacity .25s; }
body.detail-open #sheet { opacity: 0; pointer-events: none; }
#detail.open { opacity: 1; pointer-events: auto; }
/* 外框負責圓角裁切；裡面捲動的內容不各自做圓角，邊緣才不會透出底色 */
#detail .frame { position: relative; width: min(880px, 100%); max-height: 94vh; display: flex; overflow: hidden; isolation: isolate;
  border-radius: 20px; background: var(--paper); box-shadow: 0 10px 0 rgba(0,0,0,.18), 0 30px 80px rgba(0,0,0,.35);
  transform: translateY(16px) scale(.98); transition: transform .3s cubic-bezier(.2,.9,.3,1.1); }
#detail.open .frame { transform: none; }
#detail .panel { position: relative; flex: 1; min-width: 0; max-height: 94vh; overflow-y: auto; overscroll-behavior: contain;
  scrollbar-width: none; }
#detail .panel::-webkit-scrollbar { display: none; }
/* 自繪捲軸：浮在內容上、不佔寬度；捲動或滑過視窗時才出現，經過深色標題區時改用白色 */
.sbar { position: absolute; z-index: 5; top: 10px; bottom: 10px; right: 4px; width: 12px; opacity: 0; transition: opacity .3s; }
.sbar i { position: absolute; right: 3px; width: 6px; border-radius: 999px; background: rgba(44,110,73,.5);
  box-shadow: 0 0 0 1px rgba(255,255,255,.55); transition: width .15s, background-color .2s, right .15s; cursor: grab; touch-action: none; }
.sbar.on-hero i { background: rgba(255,255,255,.75); box-shadow: 0 0 0 1px rgba(0,0,0,.08); }
.frame:hover .sbar, .sbar.active, .sbar:hover { opacity: 1; }
.sbar:hover i, .sbar.dragging i { width: 9px; right: 1.5px; background: rgba(44,110,73,.75); }
.sbar.on-hero:hover i, .sbar.on-hero.dragging i { background: rgba(255,255,255,.95); }
.sbar.dragging i { cursor: grabbing; }
.sbar[hidden] { display: none; }
.hero { position: relative; padding: 26px 28px 20px; color: #fff;
  background: linear-gradient(135deg, #1f6d55 0%, #2a8fb4 100%); overflow: hidden; }
.hero::after { content: ''; position: absolute; left: 0; right: 0; bottom: -2px; height: 70px; opacity: .25;
  background: linear-gradient(135deg, transparent 33%, #fff 33.5%, #fff 34%, transparent 34.5%) 0 0 / 120px 70px,
              linear-gradient(225deg, transparent 33%, #fff 33.5%, #fff 34%, transparent 34.5%) 60px 0 / 120px 70px; }
.hero .close { color: #fff; background: rgba(255, 255, 255, .16); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .32), 0 4px 14px rgba(0, 0, 0, .12); }
.hero .close:hover { background: rgba(255, 255, 255, .28); color: #fff; }
.hero h1 { margin: 6px 0 2px; font-size: 2.2rem; }
.hero .alias { opacity: .85; font-size: .9rem; }
.hero .big { font-size: 2.8rem; font-weight: 900; letter-spacing: .02em; margin-top: 8px; }
.hero .big small { font-size: 1rem; opacity: .85; font-weight: 600; }
.tags { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 12px; }
.tags span { font-size: .78rem; padding: 3px 10px; border-radius: 999px; background: rgba(255,255,255,.2); border: 1px solid rgba(255,255,255,.35); }
.hero .actions { display: flex; gap: 10px; margin-top: 16px; flex-wrap: wrap; position: relative; z-index: 1; }
.hero .btn.ghost { color: #fff; border-color: rgba(255,255,255,.7); }
.tabs { position: sticky; top: 0; z-index: 2; display: flex; gap: 4px; align-items: center; padding: 8px 20px; background: var(--paper);
  border-bottom: 1px solid var(--line); overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tabs .t-name { display: none; font-weight: 900; padding: 0 10px 0 4px; white-space: nowrap; }
.tabs .t-close { all: unset; cursor: pointer; display: none; margin-left: auto; position: sticky; right: 0; flex: none;
  width: 34px; height: 34px; border-radius: 50%; color: var(--ink); background: #efebe1;
  box-shadow: -12px 0 12px var(--paper), 0 0 0 4px var(--paper); transition: background .15s, transform .12s; }
.tabs .t-close:hover { background: #e6e1d4; }
.tabs.stuck .t-name, .tabs.stuck .t-close { display: block; }
.tabs button[aria-current="true"] { background: #e4efe5; color: var(--pine); }
.tabs button { all: unset; cursor: pointer; padding: 7px 14px; border-radius: 999px; font-size: .9rem; font-weight: 700; color: var(--muted); white-space: nowrap; }
.tabs button:hover { background: #f1efe6; color: var(--ink); }
.dsec { padding: 20px 28px 8px; scroll-margin-top: 52px; }
.dsec h3 { margin: 0 0 12px; font-size: 1.1rem; }
.fields { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 10px; }
.field { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 10px 14px; }
.field p { margin: 0; font-size: .78rem; color: var(--muted); font-weight: 700; }
.field div { margin-top: 2px; font-weight: 700; }
.copy { all: unset; cursor: pointer; font-weight: 700; border-radius: 6px; padding: 0 4px; margin: 0 -4px; }
.copy:hover { background: var(--pine-soft, #e4efe5); }
.copy .ci { font-size: .85em; opacity: .6; }
.copy.done .ci::after { content: ' 已複製'; color: var(--pine); font-size: .8rem; }
.summary { line-height: 1.85; white-space: pre-line; margin: 0; }
.src { font-size: .78rem; color: var(--muted); margin-top: 8px; }
.src a { color: var(--pine); }
.notice { background: #fff6e6; border: 1px solid #f3d7a6; border-radius: 12px; padding: 12px 16px; font-size: .9rem; line-height: 1.7; }
.wx-tabs { display: grid; grid-template-columns: repeat(7, minmax(64px, 1fr)); gap: 6px; overflow-x: auto; padding-bottom: 4px;
  scrollbar-width: thin; }
.wx-day { all: unset; cursor: pointer; display: grid; justify-items: center; gap: 1px; padding: 8px 4px; border-radius: 12px;
  background: #fff; border: 1.5px solid var(--line); text-align: center; }
.wx-day b { font-size: .85rem; } .wx-day small { font-size: .72rem; color: var(--muted); font-weight: 700; }
.wx-day .ico { font-size: 1.3rem; line-height: 1.4; }
.wx-day:hover { border-color: #e0b98a; }
.wx-day.on { background: #fff4e3; border-color: #c76a1c; box-shadow: inset 0 -3px 0 #c76a1c; }
.wx-day:focus-visible { outline: 2px solid #c76a1c; outline-offset: 2px; }
.wx-detail { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 10px; }
.wx .field div.n small { font-size: .8rem; color: var(--muted); }
.wx .field div.n { font-size: 1.5rem; font-weight: 900; color: #c76a1c; }
.near { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 10px; padding-bottom: 20px; }
.near button, .near a { all: unset; cursor: pointer; background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 10px 14px; }
.near button:hover, .near a:hover { border-color: var(--pine); }
#dt-gear h4 { margin: 12px 0 8px; font-size: .95rem; color: var(--pine); }
.near small { color: var(--muted); }
.go { display: flex; gap: 10px; flex-wrap: wrap; }
.rep-form { display: grid; gap: 8px; margin-bottom: 14px; }
.rep-form select, .rep-form textarea { font: inherit; padding: 8px 12px; border: 1.5px solid var(--line); border-radius: 10px; background: #fff; color: var(--ink); }
.rep-form textarea { min-height: 70px; resize: vertical; }
.rep-form .row { justify-content: space-between; align-items: center; }
.rep { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 10px 14px; margin-bottom: 8px; }
.rep .hd { display: flex; gap: 8px; align-items: center; font-size: .8rem; color: var(--muted); margin-bottom: 4px; }
.rep .k { font-weight: 800; color: #fff; background: var(--pine); padding: 1px 8px; border-radius: 4px; }
.rep .del { all: unset; cursor: pointer; margin-left: auto; color: #b23418; }
.rep p { margin: 0; white-space: pre-wrap; word-break: break-word; }
.near-inline { all: unset; cursor: pointer; color: var(--pine); font-weight: 700; margin-right: 10px; }
.near-inline:hover { text-decoration: underline; }

#share-banner { position: fixed; z-index: 10; top: 16px; left: 18px; max-width: min(380px, calc(100vw - 36px)); color: #fff; display: flex; gap: 12px; align-items: flex-start;
  background: rgba(6,40,60,.5); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); border: 1px solid rgba(255,255,255,.25); border-radius: 14px; padding: 8px 14px; font-size: .88rem; }
#share-banner b { color: var(--amber); }
#share-banner .nm, #island-title .nm { font-size: 1.5rem; line-height: 1.25; color: #fff; text-shadow: 0 2px 0 rgba(0,0,0,.25); }
#share-banner .sub { font-size: .82rem; opacity: .92; }
#share-banner .handle { color: #bfe6ff; }
#island-title { position: fixed; z-index: 10; top: 14px; left: 20px; max-width: min(420px, calc(100vw - 40px)); pointer-events: none; }
#island-title .nm { font-size: clamp(1.6rem, 3.2vw, 2.4rem); text-shadow: 0 3px 0 rgba(0,0,0,.28), 0 0 18px rgba(0,0,0,.25); }
#island-title .sub { color: rgba(255,255,255,.85); font-size: .85rem; text-shadow: 0 1px 2px rgba(0,0,0,.4); }
.av { width: 26px; height: 26px; border-radius: 50%; object-fit: cover; flex: none; display: inline-grid; place-items: center;
  background: var(--pine); color: #fff; font-weight: 800; font-size: .8rem; vertical-align: middle; }
.av.big { width: 56px; height: 56px; font-size: 1.4rem; border: 2px solid rgba(255,255,255,.7); }
.avatar-chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 12px 4px 4px !important; }
#menu { position: absolute; top: 44px; right: 0; min-width: 190px; padding: 6px; z-index: 30; }
#menu a, #menu button { all: unset; box-sizing: border-box; display: block; width: 100%; cursor: pointer; padding: 9px 12px; border-radius: 10px; font-size: .92rem; color: var(--ink); }
#menu a:hover, #menu button:hover { background: #f1efe6; }
#menu hr { border: none; border-top: 1px solid var(--line); margin: 4px 6px; }
.fld { display: grid; gap: 4px; font-size: .82rem; color: var(--muted); font-weight: 700; margin-bottom: 10px; }
.fld input { font: inherit; font-weight: 400; color: var(--ink); padding: 8px 12px; border: 1.5px solid var(--line); border-radius: 10px; }
.catalog.fonts button { font-size: 1.05rem; padding: 8px 4px; }
.res .av { margin-right: 4px; }
#alerts { position: fixed; z-index: 14; top: 66px; left: 50%; transform: translateX(-50%); display: grid; gap: 6px; width: min(440px, calc(100vw - 36px)); }
.alert { all: unset; cursor: pointer; background: #fff6e6; border: 1px solid #f3d7a6; color: var(--ink); border-radius: 12px; padding: 8px 14px;
  font-size: .88rem; box-shadow: 0 4px 0 rgba(0,0,0,.12); }
#sky { position: fixed; inset: 0; pointer-events: none; z-index: 1; opacity: var(--sky-op, 1); transition: opacity 1s;
  background: linear-gradient(180deg, var(--band, transparent) 0%, transparent 38%); }
#sky .disc, #sky .halo { position: absolute; left: var(--x, 80vw); top: var(--y, 12vh); border-radius: 50%; transform: translate(-50%, -50%); }
#sky .disc { width: var(--size, 48px); height: var(--size, 48px); background: var(--disc, #fff6dd);
  box-shadow: 0 0 24px 6px var(--halo, rgba(255,220,150,.4));
  background-image: radial-gradient(circle at 35% 40%, rgba(0,0,0,calc(.07 * var(--crater, 0))) 0 12%, transparent 13%),
    radial-gradient(circle at 62% 62%, rgba(0,0,0,calc(.06 * var(--crater, 0))) 0 9%, transparent 10%),
    radial-gradient(circle at 58% 30%, rgba(0,0,0,calc(.05 * var(--crater, 0))) 0 6%, transparent 7%); }
#sky .halo { width: calc(var(--size, 48px) * 6); height: calc(var(--size, 48px) * 6);
  background: radial-gradient(circle, var(--halo, rgba(255,220,150,.3)) 0%, transparent 65%); }
#rainbow { position: fixed; inset: 0; pointer-events: none; z-index: 1; mix-blend-mode: screen; filter: blur(2.5px);
  background: radial-gradient(circle 400px at 9% 64%, transparent 0 86%, rgba(255,70,70,.0) 86%, rgba(255,70,70,.55) 87.5%,
    rgba(255,160,50,.55) 89%, rgba(255,235,80,.55) 90.5%, rgba(90,215,110,.5) 92%, rgba(70,160,255,.5) 93.5%,
    rgba(120,90,255,.45) 95%, rgba(170,90,255,.0) 96.5%, transparent 96.5%);
  -webkit-mask-image: linear-gradient(to bottom, #000 30%, transparent 58%); mask-image: linear-gradient(to bottom, #000 30%, transparent 58%);
  transition: opacity 1s; }
body.night #vignette { background: radial-gradient(ellipse at 50% 45%, transparent 45%, rgba(0, 6, 18, .7) 100%); }
.log-grid { display: grid; gap: 8px; }
.log-grid textarea { font: inherit; min-height: 90px; padding: 8px 12px; border: 1.5px solid var(--line); border-radius: 10px; resize: vertical; }
input[type=date] { font: inherit; padding: 7px 10px; border: 1.5px solid var(--line); border-radius: 10px; background: #fff; color: var(--ink); }
.log-photo img { max-width: 100%; max-height: 360px; border-radius: 12px; display: block; margin-top: 4px; }
.trk { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 10px 14px; margin-bottom: 8px; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.trk b { flex: 1; min-width: 120px; } .trk .st { color: var(--muted); font-size: .85rem; }
.mini { display: flex; gap: 10px; align-items: center; padding: 7px 0; border-bottom: 1px solid var(--line); }
.mini img, .mini .ph { width: 44px; height: 44px; object-fit: cover; border-radius: 8px; background: #eef0e8; flex: none; }
.mini .nm { all: unset; cursor: pointer; font-weight: 700; }
.mini small { display: block; color: var(--muted); }
.share-link { display: flex; gap: 8px; margin-top: 8px; }
.share-link input { flex: 1; min-width: 0; font-size: .8rem; padding: 6px 10px; border: 1.5px solid var(--line); border-radius: 999px; }

#social { left: 18px; bottom: 18px; width: min(320px, calc(100vw - 36px)); max-height: 46vh; padding: 14px 16px; z-index: 12; }
#social input { flex: 1; min-width: 0; padding: 7px 12px; border: 1.5px solid var(--line); border-radius: 999px; font: inherit; }
.cm { padding: 6px 0; border-bottom: 1px solid var(--line); font-size: .88rem; }
.cm .who { color: var(--muted); font-size: .76rem; display: flex; gap: 8px; }
.cm .who button { all: unset; cursor: pointer; color: #b23418; margin-left: auto; }
.catalog { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px; }
.catalog button { all: unset; cursor: pointer; text-align: center; background: #fff; border: 1.5px solid var(--line); border-radius: 12px; padding: 8px 6px; font-size: .85rem; }
.catalog button .ic { display: block; font-size: 1.5rem; }
.catalog button small { display: block; color: var(--muted); font-size: .7rem; margin-top: 2px; }
.catalog button.sel { border-color: var(--pine); background: var(--pine-soft, #e4efe5); }
.catalog button:disabled { cursor: not-allowed; opacity: .45; }
a.isl { color: inherit; text-decoration: none; }
a.isl:hover { border-color: var(--pine); }
.isl { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 10px 14px; margin-bottom: 8px; display: flex; gap: 10px; align-items: center; }
.isl > div { flex: 1; } .isl small { display: block; color: var(--muted); }
#world.decorating { cursor: crosshair; }

@media (max-width: 640px) {
  /* 換行的第二排會疊到下面的搜尋框（top: 64px）；手機上維持一排，窄螢幕再把字縮短 */
  /* 按鈕靠右排，左邊的空白不能擋住拖動小島，只有按鈕本身接收點擊 */
  #chips { left: 18px; flex-wrap: nowrap; pointer-events: none; }
  #chips > * { pointer-events: auto; }
  #chips .chip { flex: none; white-space: nowrap; }  /* 不然會被壓窄、字在按鈕裡換行，按鈕變高一樣疊到搜尋框 */
  #share-banner { top: 112px; }
  #alerts { top: 112px; }
  #search { top: 64px; width: calc(100vw - 36px); }
  #detail { padding: 0; }
  /* dvh：iOS Safari 的 100vh 不扣網址列與底部工具列，內容會被蓋住 */
  #detail .frame { max-height: 100vh; height: 100vh; max-height: 100dvh; height: 100dvh; border-radius: 0; }
  #detail .panel { max-height: 100vh; max-height: 100dvh; }
  /* 標題區很高：往下捲時 ✕ 會跟著捲走，分頁列卻要等標題區整個離開才固定（才出現自己的 ✕）；
     中間這段手機上沒有任何關閉按鈕，所以把 ✕ 釘在右上角，分頁列固定後再交給分頁列的 ✕ */
  #detail-close { position: fixed; z-index: 6; top: calc(10px + env(safe-area-inset-top)); right: 10px; width: 40px; height: 40px;
    background: rgba(12, 40, 36, .5); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .35), 0 4px 16px rgba(0, 0, 0, .18); }
  /* 固定在右上角的 ✕ 有時會疊到淺色內容上，線條加陰影維持對比 */
  #detail-close::before, #detail-close::after { box-shadow: 0 0 2px rgba(0, 0, 0, .45); }
  #detail:has(.tabs.stuck) #detail-close { display: none; }
  #detail .sbar { display: none; }  /* 自訂捲軸是給滑鼠拖的；手機有自己的捲動，留著會疊在 ✕ 旁邊 */
  .dsec { padding: 18px 16px 6px; }
  .tabs { padding: 8px 12px; }
  .tabs .t-close { right: -12px; }  /* sticky 會停在 padding 內側，留下一條縫讓後面的分頁字露出來 */
  .wx-tabs { grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
  .wx-day { padding: 7px 0; } .wx-day small:first-of-type { display: none; } .wx-day b { font-size: .78rem; }
  .wx-detail { grid-template-columns: repeat(2, 1fr); }
  .wx-detail .field:last-child:nth-child(odd) { grid-column: 1 / -1; }
  #sheet, #drawer { top: auto; bottom: 0; left: 0; right: 0; width: 100vw; border-radius: 18px 18px 0 0; max-height: 72vh; }
  #sheet { transform: translateY(105%); }
  #drawer { transform: translateY(105%); }
  #sheet.open, #drawer.open { transform: none; }
  #hint, #ad { display: none; }
}
@media (max-width: 400px) {
  #chips .wide-only { display: none; }
}

/* ---------- 開場：轉動的小島＋撥雲見日 ---------- */
#boot { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; overflow: hidden; transition: opacity .8s; }
#boot .sky, #boot .mist { position: absolute; inset: 0; }
#boot .sky { background: linear-gradient(#bfe0f2, #f3e7d2 70%, #f6dcc0); transition: opacity .5s .3s; }
#boot .mist { background: radial-gradient(ellipse at 50% 55%, #ffffff 30%, #eef4f8 100%); opacity: 0; transition: opacity .45s; }
#boot .stage { display: grid; justify-items: center; gap: 18px; transition: opacity .35s, transform .5s; }
#boot .isle { width: 220px; height: 170px; perspective: 700px; display: grid; place-items: center; }
#boot .plate { position: relative; width: 150px; height: 150px; transform-style: preserve-3d;
  transform: rotateX(60deg) rotateZ(0deg); animation: boot-spin 7s linear infinite; }
#boot .plate i { position: absolute; inset: 0; margin: auto; transform-style: preserve-3d; }
#boot .sea { width: 150px; height: 150px; border-radius: 50%; background: radial-gradient(#7ec6e6 55%, #4a9fd0 56% 64%, #7ec6e6 65%);
  box-shadow: 0 0 0 6px rgba(255,255,255,.55); animation: boot-wave 2.4s ease-in-out infinite; }
#boot .l1 { width: 104px; height: 96px; border-radius: 46% 54% 52% 48% / 55% 45% 55% 45%; background: #f0d9a4; transform: translateZ(6px);
  box-shadow: 0 0 0 2px #e2c587; }
#boot .l2 { width: 88px; height: 80px; border-radius: 52% 48% 45% 55%; background: #8cc26a; transform: translateZ(12px); box-shadow: 0 2px 0 3px #6fa552; }
#boot .l3 { width: 62px; height: 58px; border-radius: 50% 50% 46% 54%; background: #5f9a4c; transform: translateZ(20px) translate(4px, -4px); box-shadow: 0 2px 0 3px #4c8040; }
#boot .l4 { width: 38px; height: 34px; border-radius: 48% 52% 50% 50%; background: #8a7f6a; transform: translateZ(28px) translate(7px, -7px); box-shadow: 0 2px 0 3px #6f6655; }
#boot .l5 { width: 18px; height: 16px; border-radius: 50%; background: #f6f2ea; transform: translateZ(34px) translate(9px, -9px); }
#boot .flag { width: 2px; height: 26px; background: #4a3a2a; transform: translateZ(34px) translate(9px, -9px) rotateX(-90deg); transform-origin: bottom;
  top: auto !important; bottom: 50% !important; }
#boot .flag::after { content: ''; position: absolute; left: 2px; top: 0; width: 14px; height: 9px; background: #e8553a; border-radius: 0 3px 3px 0; }
@keyframes boot-spin { to { transform: rotateX(60deg) rotateZ(360deg); } }
@keyframes boot-wave { 50% { box-shadow: 0 0 0 11px rgba(255,255,255,.25); } }
#boot .pct { font-size: 2.4rem; font-weight: 900; color: #2a211b; font-variant-numeric: tabular-nums; letter-spacing: .02em; }
#boot .pct small { font-size: 1rem; margin-left: 2px; }
#boot .bar { width: 200px; height: 6px; border-radius: 999px; background: rgba(42,33,27,.12); overflow: hidden; margin-top: -8px; }
#boot .bar b { display: block; height: 100%; width: 0; background: #2c6e49; border-radius: inherit; }
#boot .msg { color: #75685c; font-size: .9rem; font-weight: 700; min-height: 1.3em; }
#boot .stage { position: relative; z-index: 2; }
#boot .cloud { position: absolute; z-index: 3; opacity: 0; pointer-events: none; transform: translate(-50%, -50%) scale(.7);
  transition: transform .6s cubic-bezier(.2,.7,.3,1), opacity .45s; }
#boot .puff { position: absolute; border-radius: 50%;
  background: radial-gradient(circle at 50% 40%, #fff 0 36%, rgba(255,255,255,.85) 50%, rgba(255,255,255,.4) 61%, rgba(255,255,255,0) 71%); }
#boot.covering .cloud { opacity: 1; transform: translate(-50%, -50%) scale(1); }
#boot.covering .stage { opacity: 0; transform: scale(.9); }
#boot.covering .mist { opacity: 1; }
#boot.covering .sky { opacity: 0; }
#boot.reveal { pointer-events: none; }
#boot.reveal .mist { opacity: 0; transition: opacity 1.3s .15s; }
#boot.reveal .cloud { opacity: 0; transition: transform 2s cubic-bezier(.45,.05,.3,1), opacity 1.4s .5s; }
#boot.gone { opacity: 0; }
#boot.failed .plate { animation-play-state: paused; filter: grayscale(.6); }
#boot.failed .msg { color: #b23418; }
#boot.failed .msg button { all: unset; cursor: pointer; margin-left: 6px; padding: 4px 12px; border-radius: 999px; background: #2c6e49; color: #fff; }
@media (prefers-reduced-motion: reduce) { #boot .plate, #boot .sea { animation: none; } #boot .cloud { display: none; } }
.fld.check { display: flex; align-items: center; gap: 8px; font-weight: 700; }
.fld.check input { width: 18px; height: 18px; accent-color: var(--pine); }
.notice.cwa { background: #fdecea; border-color: #f2b8ae; margin-bottom: 10px; }
