body { font-family: "Noto Sans TC", "Microsoft JhengHei", system-ui, sans-serif; }
* { box-sizing: border-box; }
html, body { max-width: 100%; overflow-x: hidden; }
.fade-in { animation: fadeIn .3s ease both; }
@keyframes fadeIn { from { opacity:0; transform:translateY(6px);} to {opacity:1; transform:none;} }
@media (prefers-reduced-motion: reduce){ .fade-in{ animation:none; } }
.prose-line { white-space: pre-line; }

.wrap { container-type: inline-size; }

/* 手機：頂部下拉按鈕 */
.nav-toggle { display: flex; }
.sidebar { display: none; }
.sidebar.open { display: block; }
.layout { display: block; }

/* 桌機 / 寬 iframe：左右兩欄 */
@container (min-width: 760px) {
    .nav-toggle { display: none; }
    .sidebar { display: block !important; }
    .layout { display: flex; gap: 1.25rem; align-items: flex-start; }
    .sidebar { width: 232px; flex: none; }
    .detail { flex: 1; min-width: 0; }
}

.nav-item.active { background:#1f7a52; color:#fff; }
.nav-item.active .nav-sub { color:#d6ecdf; }

/* 清冊：照片卡片網格（自動填滿寬度，依容器寬度決定欄數） */
.grid-wrap { container-type: inline-size; }
.grid-cards { display:grid; grid-template-columns:1fr; gap:.75rem; }
@container (min-width: 560px) { .grid-cards { grid-template-columns:1fr 1fr; } }
@container (min-width: 980px) { .grid-cards { grid-template-columns:1fr 1fr 1fr; } }

.pcard { display:flex; gap:.85rem; padding:.85rem; border:1px solid #e6efe9; border-radius:.85rem; background:#fff; box-shadow:0 1px 2px rgba(0,0,0,.04); cursor:pointer; transition:box-shadow .15s, border-color .15s, transform .1s; text-align:left; }
.pcard:hover { box-shadow:0 6px 16px rgba(31,122,82,.12); border-color:#1f7a52; transform:translateY(-1px); }
.pcard-tags { overflow-wrap:anywhere; word-break:break-word; }

/* 統計帶 */
.stat-band { display:grid; grid-template-columns:repeat(2,1fr); gap:1px; background:#1a6a47; border-radius:.85rem; overflow:hidden; }
@container (min-width: 560px) { .stat-band { grid-template-columns:repeat(3,1fr); } }
@container (min-width: 860px) { .stat-band { grid-template-columns:repeat(6,1fr); } }
.stat-cell { background:linear-gradient(135deg,#1f7a52,#18553b); padding:1rem 1.1rem; color:#fff; text-align:left; border:0; width:100%; }
.stat-cell.clickable { cursor:pointer; transition:filter .15s; }
.stat-cell.clickable:hover { filter:brightness(1.12); }
.stat-cell.all { background:linear-gradient(135deg,#0f3f2c,#0b2f21); }   /* 全部：墨綠 */
.stat-cell.active { box-shadow:inset 0 0 0 3px rgba(255,255,255,.85); }
