/* =====================================================================
   台北捷兔前台（index.php）：頁首、選單、頁尾、首頁區塊 —— 藍印古典
   載入順序：new1_style.css → th3-front.css → th3-site.css
   ===================================================================== */
.site { margin: 0; }
.site-main { max-width: 1280px; margin: 0 auto; padding: 0 24px 40px; }
@media (max-width: 760px) { .site-main { padding: 0 12px 32px; } }

/* ---------- 頁首 ---------- */
.site-top { position: sticky; top: 0; z-index: 900; background: var(--gradient-bg); color: var(--th3-cream); box-shadow: 0 2px 0 var(--th3-navy-dark); }
.site-top-inner { max-width: 1280px; margin: 0 auto; padding: 10px 24px; display: flex; align-items: center; gap: 12px; }
.site-brand { display: flex; align-items: center; gap: 12px; text-decoration: none !important; color: var(--th3-cream) !important; }
.site-brand img { width: 52px; height: 52px; border-radius: 50% !important; border: 3px solid var(--th3-cream); background: var(--th3-cream); }
.site-brand b { display: block; font-family: var(--th3-font-title); font-weight: 900; font-size: 1.5rem; letter-spacing: .06em; line-height: 1.2; }
.site-brand small { display: block; font-size: .78rem; letter-spacing: .1em; opacity: .85; font-weight: 500; }
.site-burger { display: none; margin-left: auto; background: transparent !important; color: var(--th3-cream) !important; border: 2px solid var(--th3-cream) !important; box-shadow: none !important; font-size: 1.4rem !important; line-height: 1; padding: 4px 12px !important; cursor: pointer; }
/* 右上角：登入／登入後的下拉選單 */
.site-acct { margin-left: auto; }
.site-me { position: relative; }
.site-acct + .site-burger { margin-left: 0; }
.site-signin, .site-me summary { display: flex; align-items: center; gap: 6px; padding: 6px 14px; border: 2px solid var(--th3-cream); color: var(--th3-cream) !important; text-decoration: none !important; font-weight: 700; cursor: pointer; list-style: none; white-space: nowrap; }
.site-signin small { font-size: .7rem; font-weight: 500; opacity: .85; }
.site-me summary::-webkit-details-marker { display: none; }
.site-me summary span { max-width: 9em; overflow: hidden; text-overflow: ellipsis; }
.site-signin:hover, .site-me summary:hover, .site-me[open] summary { background: var(--th3-cream); color: var(--th3-navy) !important; }
.site-me-menu { position: absolute; right: 0; top: calc(100% + 6px); min-width: 190px; background: var(--th3-card, #fff); border: 2px solid var(--th3-navy); box-shadow: 4px 4px 0 var(--th3-navy); z-index: 950; }
.site-me-menu a { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding: 10px 14px; color: var(--th3-navy) !important; text-decoration: none !important; font-weight: 700; border-bottom: 1px solid var(--th3-line); }
.site-me-menu a:last-child { border-bottom: 0; }
.site-me-menu a small { font-size: .7rem; font-weight: 500; color: #4d5a73; }
.site-me-menu a:hover { background: rgba(27,58,107,.08); }
.site-me-menu .site-me-out { color: var(--th3-red) !important; }

/* 登入頁（pages/login.php） */
.lg-box { max-width: 380px; margin: 40px auto 20px; padding: 22px 24px 18px; background: var(--th3-card, #fff); border: 2px solid var(--th3-navy); box-shadow: 5px 5px 0 var(--th3-navy); }
.lg-box h1 { margin: 0 0 14px; font-size: 1.5rem; font-weight: 900; color: var(--th3-navy); }
.lg-box h1 small { font-size: .85rem; font-weight: 500; color: #4d5a73; }
.lg-box label { display: block; margin-bottom: 12px; font-weight: 700; color: var(--th3-navy); }
.lg-box label small { font-weight: 500; color: #4d5a73; }
.lg-box input[type=text], .lg-box input[type=password] { display: block; width: 100%; box-sizing: border-box; margin-top: 4px; padding: 9px 10px; font-size: 1.05rem; border: 2px solid var(--th3-navy); }
.lg-box button { width: 100%; padding: 10px; font-size: 1.05rem; font-weight: 700; cursor: pointer; }
.lg-err { margin: 0 0 12px; padding: 8px 10px; background: #fdecea; color: var(--th3-red); font-weight: 700; border-left: 4px solid var(--th3-red); }
.lg-note { margin: 14px 0 6px; font-size: .9rem; color: #4d5a73; }
.lg-admin { margin: 0; text-align: right; font-size: .9rem; }
.lg-box.lg-wide { max-width: 440px; }
.lg-box input[type=tel] { display: block; width: 100%; box-sizing: border-box; margin-top: 4px; padding: 9px 10px; font-size: 1.05rem; border: 2px solid var(--th3-navy); }
.lg-box label.lg-check { display: flex; gap: 8px; align-items: center; font-weight: 500; font-size: .95rem; }
.lg-box label.lg-check input { width: 18px; height: 18px; margin: 0; }
.lg-links { display: flex; justify-content: space-between; gap: 12px; margin: 14px 0 4px; font-size: .95rem; font-weight: 700; }
.lg-ok { margin: 0 0 12px; padding: 8px 10px; background: #e8f4ea; color: #1f6b35; font-weight: 700; border-left: 4px solid #2e8b4b; }
.lg-steps { display: flex; gap: 6px; margin: 0 0 16px; padding: 0; list-style: none; counter-reset: st; font-size: .9rem; }
.lg-steps li { flex: 1; padding: 6px 8px; border: 2px solid #c9cfda; color: #4d5a73; counter-increment: st; }
.lg-steps li::before { content: counter(st) ". "; }
.lg-steps li.on { border-color: var(--th3-navy); color: var(--th3-navy); font-weight: 900; }
.lg-steps li.done { color: #2e8b4b; }
.lg-steps li.done::before { content: "✓ "; }
.lg-confirm { text-align: center; }
.lg-confirm p { margin: 4px 0; }
.lg-who { font-size: 1.6rem; font-weight: 900; color: var(--th3-navy); }
.lg-who small { font-size: 1rem; font-weight: 500; color: #4d5a73; }
.lg-confirm form { margin-top: 12px; }
.lg-box button.lg-plain { background: none; border: 0; color: #4d5a73; text-decoration: underline; font-weight: 500; }
.lg-line { display: block; padding: 11px; text-align: center; background: #06c755; color: #fff; font-weight: 900; font-size: 1.05rem; text-decoration: none; border: 2px solid var(--th3-navy); }
.lg-line:hover { background: #05b34c; color: #fff; }
.lg-or { display: flex; align-items: center; gap: 10px; margin: 14px 0; font-size: .9rem; color: #4d5a73; }
.lg-or::before, .lg-or::after { content: ""; flex: 1; border-top: 1px solid #c9cfda; }
.pf-line { display: inline-block; padding: 8px 14px; background: #06c755; color: #fff; font-weight: 700; text-decoration: none; }
.lg-apply { margin-top: 16px; padding-top: 12px; border-top: 1px dashed #c9cfda; }
.lg-apply summary { cursor: pointer; font-weight: 700; color: var(--th3-navy); margin-bottom: 10px; }

.site-nav { background: var(--th3-cream); border-bottom: 4px solid var(--th3-red); }
.site-nav-inner { max-width: 1280px; margin: 0 auto; padding: 0 16px; display: flex; flex-wrap: wrap; }
.site-nav a { display: flex; flex-direction: column; align-items: center; padding: 8px 14px; color: var(--th3-navy) !important; text-decoration: none !important; font-weight: 700; font-size: 1rem; line-height: 1.25; border-bottom: 3px solid transparent; }
.site-nav a small { font-size: .68rem; font-weight: 500; letter-spacing: .06em; color: #4d5a73; }
.site-nav a:hover { background: rgba(27,58,107,.08); }
.site-nav a.active { background: var(--th3-navy); color: var(--th3-cream) !important; }
.site-nav a.active small { color: rgba(245,241,232,.8); }
@media (max-width: 860px) {
  .site-top-inner { padding: 8px 12px; }
  .site-brand img { width: 42px; height: 42px; }
  .site-brand b { font-size: 1.25rem; }
  .site-burger { display: block; }
  .site-since { display: none; }
  .site-signin, .site-me summary { padding: 5px 10px; }
  .site-signin small { display: none; }
  .site-me summary span { max-width: 5em; }
  .site-nav { display: none; }
  .site-nav.open { display: block; }
  .site-nav-inner { flex-direction: column; padding: 0; }
  .site-nav a { flex-direction: row; justify-content: space-between; padding: 12px 16px; border-bottom: 1px solid var(--th3-line); }
}

/* ---------- 頁尾 ---------- */
.site-foot { background: var(--th3-navy); color: var(--th3-cream); text-align: center; padding: 22px 16px 26px; border-top: 4px solid var(--th3-red); }
.site-foot p { margin: 4px 0; }
.site-foot-small { font-size: .85rem; opacity: .75; }

/* 內頁（公告、服務團隊）放進新外框：不要再留舊版的大外距 */
.site .container { max-width: none !important; padding-left: 0 !important; padding-right: 0 !important; }

/* ---------- 首頁 ---------- */
.hm-en { color: #4d5a73; }
.hm-hero { margin: 22px 0 6px; padding: 26px 28px; background: var(--th3-card); border: 2px solid var(--th3-navy); box-shadow: 5px 5px 0 var(--th3-navy);
  background-image: repeating-linear-gradient(135deg, rgba(27,58,107,.035) 0 12px, transparent 12px 24px); }
.hm-hero h1 { margin: 0; font-size: 2rem; font-weight: 900; color: var(--th3-navy); }
.hm-hero h1 + .hm-en { margin: 2px 0 12px; font-size: 1.05rem; letter-spacing: .04em; font-style: italic; }
.hm-hero p { margin: 6px 0; }
.hm-block { margin-top: 30px; }
.hm-title { display: flex; align-items: baseline; gap: 10px; font-size: 1.45rem; font-weight: 900; color: var(--th3-navy); margin: 0 0 14px; padding-bottom: 6px; border-bottom: 2px solid var(--th3-navy); }
.hm-title::before { content: ""; width: 12px; height: 12px; background: var(--th3-red); align-self: center; }
.hm-title small { font-family: var(--th3-font-body); font-size: .85rem; font-weight: 500; color: #4d5a73; letter-spacing: .08em; }
.hm-tbd { color: #7a8599; font-style: italic; }
.hm-badge { display: inline-block; background: var(--th3-red); color: var(--th3-cream); font-size: .8rem; font-weight: 700; padding: 1px 8px; }

/* 跑步卡片 */
.hm-run { background: var(--th3-card); border: 2px solid var(--th3-navy); box-shadow: 4px 4px 0 var(--th3-navy); }
.hm-run-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; background: var(--th3-navy); color: var(--th3-cream); padding: 10px 16px; }
.hm-run-no { font-family: var(--th3-font-title); font-weight: 900; font-size: 1.25rem; }
.hm-run-date { font-weight: 700; }
.hm-run-body { margin: 0; padding: 12px 16px 14px; display: grid; grid-template-columns: max-content 1fr; gap: 8px 16px; }
.hm-run-body dt { font-weight: 700; color: var(--th3-navy); white-space: nowrap; }
.hm-run-body dt small { display: block; font-size: .72rem; font-weight: 500; color: #4d5a73; letter-spacing: .05em; }
.hm-run-body dd { margin: 0; display: flex; flex-direction: column; gap: 2px; }
.hm-site span:first-child { font-weight: 700; font-size: 1.05rem; }
.hm-person { display: block; }
.hm-person + .hm-person { margin-top: 2px; }
a.hm-tel { font-weight: 600; margin-left: 4px; }
a.hm-map { align-self: flex-start; margin-top: 6px; display: inline-block; text-decoration: none !important; font-weight: 700; color: var(--th3-cream) !important; background: var(--th3-navy); padding: 4px 12px; box-shadow: 3px 3px 0 var(--th3-red); }
a.hm-map:hover { background: var(--th3-red); box-shadow: 3px 3px 0 var(--th3-navy); }
/* 本週：大卡，朱紅強調 */
.hm-run-big { border-width: 3px; box-shadow: 6px 6px 0 var(--th3-navy); }
.hm-run-big .hm-run-head { background: var(--th3-red); padding: 14px 20px; }
.hm-run-big .hm-run-no { font-size: 1.7rem; }
.hm-run-big .hm-run-date { font-size: 1.15rem; }
.hm-run-big .hm-badge { background: var(--th3-cream); color: var(--th3-red); }
.hm-run-big .hm-run-body { padding: 16px 20px 18px; gap: 12px 22px; }
.hm-run-big .hm-site span:first-child { font-size: 1.35rem; font-family: var(--th3-font-title); font-weight: 900; color: var(--th3-navy); }
/* 兔子／副兔子照片（4:5，與服務團隊同框線）
   桌機：卡片右上角、地點右邊；未來預告小卡 56px、本週大卡 92px；地點文字讓出照片寬度，小卡地點那一列至少和照片一樣高 */
.hm-run-body.hm-ph { position: relative; }
.hm-site-row { display: contents; }
.hm-hares { position: absolute; top: 12px; right: 14px; display: flex; gap: 8px; }
.hm-hare-photo { width: 56px; aspect-ratio: 4 / 5; border: 2px solid var(--th3-navy); box-shadow: 2px 2px 0 var(--th3-red); }
.hm-hare-photo::before { font-size: 1.4rem; }
.hm-ph .hm-site { min-height: 70px; }
.hm-h1 .hm-site { padding-right: 70px; }
.hm-h2 .hm-site { padding-right: 134px; }
.hm-run-big .hm-hares { top: 16px; right: 20px; gap: 12px; }
.hm-run-big .hm-hare-photo { width: 92px; box-shadow: 3px 3px 0 var(--th3-red); }
.hm-run-big .hm-hare-photo::before { font-size: 2.2rem; }
.hm-run-big .hm-ph .hm-site { min-height: 0; }   /* 大卡右邊很寬，照片可以延伸到兔子那一列旁邊，不用把地點撐高 */
.hm-run-big .hm-h1 .hm-site { padding-right: 110px; }
.hm-run-big .hm-h2 .hm-site { padding-right: 214px; }
.hm-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 18px; }

/* 特別活動 */
.hm-specials { list-style: none; margin: 0; padding: 0; background: var(--th3-card); border: 2px solid var(--th3-navy); }
.hm-specials li { display: flex; gap: 14px; align-items: flex-start; padding: 10px 14px; border-bottom: 1px solid var(--th3-line); }
.hm-specials li:last-child { border-bottom: 0; }
.hm-specials li:first-child { background: #fbefe9; box-shadow: inset 5px 0 0 var(--th3-red); }
.hm-sp-date { flex: 0 0 auto; background: var(--th3-navy); color: var(--th3-cream); font-weight: 700; padding: 2px 8px; font-variant-numeric: tabular-nums; }
.hm-specials li:first-child .hm-sp-date { background: var(--th3-red); }
.hm-sp-title { font-weight: 700; color: var(--th3-navy); }
.hm-sp-title small { display: block; font-weight: 500; color: #4d5a73; }
.hm-more { text-align: right; margin: 8px 0 0; }

/* 如何參加 */
.hm-join-grid { display: grid; grid-template-columns: 1fr 260px; gap: 22px; align-items: start; background: var(--th3-card); border: 2px solid var(--th3-navy); box-shadow: 4px 4px 0 var(--th3-navy); padding: 16px 20px; }
.hm-join-text p { margin: 0 0 10px; line-height: 1.75; }
.hm-steps { list-style: none; margin: 0; padding: 0; counter-reset: st; }
.hm-steps li { counter-increment: st; display: flex; flex-direction: column; padding: 10px 12px 10px 52px; position: relative; border: 2px solid var(--th3-navy); margin-bottom: 10px; background: #fff; }
.hm-steps li::before { content: counter(st); position: absolute; left: 0; top: 0; bottom: 0; width: 40px; display: flex; align-items: center; justify-content: center; background: var(--th3-red); color: var(--th3-cream); font-family: var(--th3-font-title); font-weight: 900; font-size: 1.3rem; }
.hm-steps li b { color: var(--th3-navy); }

/* 最近幾次 */
.hm-recent { background: var(--th3-card); border: 2px solid var(--th3-navy); }
.hm-recent-row { display: flex; align-items: baseline; gap: 14px; flex-wrap: wrap; padding: 8px 14px; border-bottom: 1px solid var(--th3-line); }
.hm-recent-row:last-child { border-bottom: 0; }
.hm-recent-row .hm-run-no { font-size: 1rem; color: var(--th3-navy); min-width: 4em; }
.hm-recent-date { color: #4d5a73; font-variant-numeric: tabular-nums; }
.hm-recent-site { display: flex; gap: 8px; flex-wrap: wrap; }
.hm-recent-site span:first-child { font-weight: 700; }

@media (max-width: 760px) {
  .hm-hero { padding: 18px 16px; }
  .hm-hero h1 { font-size: 1.5rem; }
  .hm-join-grid { grid-template-columns: 1fr; }
  .hm-run-body { grid-template-columns: 1fr; gap: 2px; }
  .hm-run-body dt { margin-top: 8px; }
  .hm-grid { grid-template-columns: 1fr; }
  /* 手機：「地點」標題＋地點中英文在左，照片在右，照片上下和這整塊切齊（高度跟著文字，寬度照 4:5） */
  .hm-site-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; column-gap: 12px; margin-top: 8px; }
  .hm-site-row > dt, .hm-site-row > dd { margin-top: 0; }
  .hm-site-row > .hm-hares { grid-column: 2; grid-row: 1 / span 2; align-self: stretch; }
  .hm-site-row .hm-site, .hm-run-big .hm-site-row .hm-site { min-height: 0; padding-right: 0; }
  .hm-hares, .hm-run-big .hm-hares { position: static; flex: 0 0 auto; gap: 8px; }
  .hm-hare-photo, .hm-run-big .hm-hare-photo { width: auto; height: 100%; max-height: 120px; contain: size; flex: 0 0 auto; }   /* 地點英文很長換行時不要撐太大 */
}

/* ---------- 龍虎榜 /leaderboard ---------- */
.lb-tools { display: flex; flex-wrap: wrap; gap: 10px 16px; align-items: center; margin-top: 14px; }
.lb-tools input[type=search] { flex: 1 1 260px; max-width: 380px; padding: 8px 12px; font-size: 1rem; border: 2px solid var(--th3-navy); border-radius: 0; background: #fff; }
.lb-jump { display: flex; flex-wrap: wrap; gap: 6px; }
.lb-jump a { text-decoration: none !important; font-weight: 700; color: var(--th3-navy) !important; border: 2px solid var(--th3-navy); padding: 3px 10px; background: var(--th3-cream); font-variant-numeric: tabular-nums; }
.lb-jump a:hover { background: var(--th3-navy); color: var(--th3-cream) !important; }
.lb-nohash-btn { font: inherit; font-family: var(--th3-font-body) !important; font-weight: 700 !important; color: var(--th3-red) !important; border: 2px solid var(--th3-red) !important; padding: 3px 10px; background: var(--th3-cream) !important; cursor: pointer; border-radius: 0; box-shadow: none !important; line-height: inherit; }   /* 未取名：只看還沒取兔名的（前台共用按鈕樣式有 !important，這裡也要） */
.lb-nohash-btn:hover, .lb-nohash-btn[aria-pressed="true"] { background: var(--th3-red) !important; color: var(--th3-cream) !important; }
.lb-tier { scroll-margin-top: 140px; }
.lb-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 14px; }
.lb-grid-big { grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 18px; }
.lb-card { background: var(--th3-card); border: 2px solid var(--th3-navy); box-shadow: 3px 3px 0 var(--th3-navy); display: flex; flex-direction: column; }
.lb-card[hidden], .lb-tier[hidden] { display: none; }
.lb-photo { aspect-ratio: 1 / 1; }
.lb-rank { position: absolute; left: 0; top: 0; background: var(--th3-navy); color: var(--th3-cream); font-family: var(--th3-font-title); font-weight: 900; font-size: 1.05rem; line-height: 1; padding: 5px 8px 6px; font-variant-numeric: tabular-nums; }
.lb-rank small { display: block; font-family: var(--th3-font-body); font-size: .58rem; font-weight: 700; letter-spacing: .12em; opacity: .8; margin-bottom: 2px; }
.lb-year { position: absolute; right: 0; top: 0; background: var(--th3-cream); color: var(--th3-navy); border-left: 2px solid var(--th3-navy); border-bottom: 2px solid var(--th3-navy); font-family: var(--th3-font-title); font-weight: 900; font-size: 1.05rem; line-height: 1; padding: 5px 8px 6px; text-align: center; font-variant-numeric: tabular-nums; }   /* 今年跑次：疊在照片右上角，不動版面 */
.lb-year small { display: block; font-family: var(--th3-font-body); font-size: .58rem; font-weight: 700; letter-spacing: .12em; opacity: .8; margin-bottom: 2px; }
.lb-info { padding: 8px 10px 10px; text-align: center; display: flex; flex-direction: column; gap: 1px; flex: 1; }
.lb-hash { font-family: var(--th3-font-title); font-weight: 900; font-size: 1.05rem; color: var(--th3-navy); line-height: 1.3; word-break: break-word; }
.lb-hash.lb-nohash { color: var(--th3-red); }   /* 還沒取兔名：紅字「待取兔名」 */
.lb-name { font-size: .9rem; color: #4d5a73; }
.lb-runs { margin-top: auto; padding-top: 4px; font-size: .85rem; color: #4d5a73; }
.lb-runs b { font-family: var(--th3-font-title); font-size: 1.2rem; color: var(--th3-red); font-variant-numeric: tabular-nums; }
/* 前三名 */
.lb-top { border-width: 3px; box-shadow: 5px 5px 0 var(--th3-red); }
.lb-top .lb-rank { background: var(--th3-red); font-size: 1.35rem; padding: 7px 10px 8px; }
.lb-top1 .lb-rank { background: #a8862c; }
.lb-note { margin: 24px 0 0; text-align: center; color: #4d5a73; font-size: .9rem; }
@media (max-width: 760px) {
  .lb-grid, .lb-grid-big { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .lb-tier { scroll-margin-top: 80px; }
}

/* ---------- 姐妹會 /links ---------- */
.ln-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 16px; }
.ln-card { display: flex; gap: 14px; align-items: flex-start; background: var(--th3-card); border: 2px solid var(--th3-navy); box-shadow: 4px 4px 0 var(--th3-navy); padding: 12px; }
.ln-card-wide { max-width: 720px; }
.ln-logo { flex: 0 0 96px; width: 96px; height: 96px; display: flex; align-items: center; justify-content: center; background: #fff; border: 1px solid var(--th3-line); text-decoration: none !important; overflow: hidden; }
.ln-logo img { max-width: 100%; max-height: 100%; object-fit: contain; display: block; }
.ln-noimg { font-family: var(--th3-font-title); font-weight: 900; font-size: 2.4rem; color: var(--th3-navy); }
.ln-info { flex: 1; min-width: 0; }
h3.ln-name { margin: 0 0 4px; font-size: 1.15rem; font-weight: 900; line-height: 1.35; }
h3.ln-name a { text-decoration: none !important; color: var(--th3-navy) !important; font-weight: 900; }
h3.ln-name a:hover { color: var(--th3-red) !important; text-decoration: underline !important; }
h3.ln-name small { display: block; font-family: var(--th3-font-body); font-size: .85rem; font-weight: 600; color: #4d5a73; }
.ln-desc { margin: 0 0 6px; font-size: .92rem; line-height: 1.5; }
.ln-desc .hm-en { display: block; font-size: .85rem; }
.ln-links { margin: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.ln-links a { font-size: .85rem; text-decoration: none !important; color: var(--th3-navy) !important; border: 1px solid var(--th3-navy); padding: 1px 8px; background: var(--th3-cream); }
.ln-links a.ln-fb { color: #fff !important; background: #1b3a6b; }
.ln-links a:hover { background: var(--th3-red) !important; border-color: var(--th3-red); color: #fff !important; }
.ln-events { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }
a.ln-event { display: flex; flex-direction: column; gap: 2px; text-decoration: none !important; color: var(--th3-text) !important; background: var(--th3-card); border: 2px solid var(--th3-navy); box-shadow: 4px 4px 0 var(--th3-red); padding: 12px 16px; font-weight: 400; }
a.ln-event:hover { background: #fbefe9; }
a.ln-event b { font-family: var(--th3-font-title); font-size: 1.2rem; color: var(--th3-navy); }
.ln-event-date { align-self: flex-start; background: var(--th3-red); color: var(--th3-cream); font-weight: 700; padding: 1px 8px; font-size: .9rem; }
.ln-event-place { color: #4d5a73; font-size: .92rem; }
@media (max-width: 760px) {
  .ln-grid, .ln-events { grid-template-columns: 1fr; }
  .ln-logo { flex-basis: 72px; width: 72px; height: 72px; }
}

/* ---------- 財務（pages/finance.php） ---------- */
.fin-hero h1 small { font-size: .55em; font-weight: 500; color: #4d5a73; letter-spacing: .08em; }
.fin-sub { margin: 6px 0 0; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; color: #4d5a73; }
.fin-years { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.fin-years a { padding: 3px 12px; border: 2px solid var(--th3-navy); color: var(--th3-navy) !important; text-decoration: none !important; font-weight: 700; font-variant-numeric: tabular-nums; background: #fff; }
.fin-years a.active { background: var(--th3-navy); color: var(--th3-cream) !important; }
.fin-tag { display: inline-block; font-size: .78rem; font-weight: 700; padding: 1px 8px; background: #e6e9f0; color: var(--th3-navy); }
.fin-tag-open { background: #fbefe9; color: var(--th3-red); }
.fin-pos { color: #1f6b3a; }
.fin-neg { color: var(--th3-red); }
.fin-kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.fin-kpi { background: var(--th3-card); border: 2px solid var(--th3-navy); box-shadow: 4px 4px 0 var(--th3-navy); padding: 12px 16px; display: flex; flex-direction: column; gap: 2px; }
.fin-kpi span { font-weight: 700; color: #4d5a73; }
.fin-kpi b { font-size: 1.6rem; font-weight: 900; color: var(--th3-navy); font-variant-numeric: tabular-nums; line-height: 1.2; }
.fin-kpi small { color: #6b7488; font-size: .8rem; }
.fin-kpi-in b { color: #1f6b3a; }
.fin-kpi-out b { color: var(--th3-red); }
.fin-kpi-bal { background: var(--th3-navy); }
.fin-kpi-bal span, .fin-kpi-bal small, .fin-kpi-bal b { color: var(--th3-cream); }
.fin-note { margin: 12px 0 0; color: #4d5a73; font-size: .92rem; }
.fin-none { color: #6b7488; text-align: center; padding: 10px; }
.fin-sum { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; align-items: start; }
.fin-h3 { margin: 0; padding: 6px 12px; font-size: 1.05rem; color: #fff !important; background: #1f6b3a; }
.fin-h3-out { background: var(--th3-red); }
.fin-items, .fin-rows { width: 100%; border-collapse: collapse; background: var(--th3-card); border: 2px solid var(--th3-navy); font-variant-numeric: tabular-nums; }
.fin-items th, .fin-items td { padding: 7px 10px; border-bottom: 1px solid var(--th3-line); text-align: right; white-space: nowrap; }
.fin-items tbody th { text-align: left; font-weight: 500; white-space: normal; position: relative; }
.fin-bar { display: block; height: 4px; margin-top: 3px; background: #1f6b3a; opacity: .45; }
.fin-out .fin-bar { background: var(--th3-red); }
.fin-pct { color: #6b7488; font-size: .85rem; width: 3.5em; }
.fin-items tfoot th, .fin-items tfoot td { font-weight: 900; color: var(--th3-navy); border-top: 2px solid var(--th3-navy); border-bottom: 0; }
.fin-items tfoot th { text-align: left; }
.fin-run { background: var(--th3-card); border: 2px solid var(--th3-navy); margin-bottom: 10px; }
.fin-run summary { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; padding: 9px 14px; cursor: pointer; list-style: none; font-variant-numeric: tabular-nums; }
.fin-run summary::-webkit-details-marker { display: none; }
.fin-run summary::before { content: "▸"; color: var(--th3-navy); }
.fin-run[open] summary::before { content: "▾"; }
.fin-run[open] summary { background: #eef1f7; border-bottom: 1px solid var(--th3-line); }
.fin-run-no { font-family: var(--th3-font-title); font-weight: 900; color: var(--th3-navy); }
.fin-run-date { color: #4d5a73; }
.fin-run-nums { margin-left: auto; display: flex; flex-wrap: wrap; gap: 4px 14px; font-weight: 700; }
.fin-run-bal { color: var(--th3-navy); }
.fin-run-ear { border-style: dashed; }
.fin-rows { border: 0; }
.fin-rows th, .fin-rows td { padding: 7px 14px; border-bottom: 1px solid var(--th3-line); text-align: right; vertical-align: top; white-space: nowrap; }
.fin-rows th { font-size: .85rem; color: #4d5a73; font-weight: 700; }
.fin-rows th:first-child, .fin-rows td:first-child { text-align: left; white-space: normal; width: 100%; }
.fin-rows tr:last-child td { border-bottom: 0; }
.fin-desc, .fin-qty { display: block; color: #4d5a73; font-size: .88rem; }
.fin-qty { color: #6b7488; }
@media (max-width: 860px) {
  .fin-kpis { grid-template-columns: 1fr 1fr; gap: 10px; }
  .fin-sum { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  .fin-years { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 4px; }
  .fin-kpi { padding: 10px 12px; }
  .fin-kpi b { font-size: 1.25rem; }
  .fin-rows th, .fin-rows td { padding: 7px 10px; }
  .fin-run summary { padding: 9px 10px; }
  .fin-run-nums { margin-left: 0; width: 100%; }
}

/* ---------- 個人資料（pages/profile.php） ---------- */
.pf-head { display: flex; gap: 24px; align-items: flex-start; margin: 22px 0 14px; padding: 20px 22px; background: var(--th3-card, #fff); border: 2px solid var(--th3-navy); box-shadow: 5px 5px 0 var(--th3-navy); }
.pf-photo { flex: 0 0 auto; display: flex; flex-direction: column; align-items: center; gap: 10px; margin: 0; }
.pf-pic { width: 170px; height: 200px; display: flex; align-items: center; justify-content: center; background: #eef0f4; border: 2px solid var(--th3-navy); overflow: hidden; color: #4d5a73; }
.pf-pic img { width: 100%; height: 100%; object-fit: cover; }
.pf-pic.busy { opacity: .4; }
.pf-btn { position: relative; display: inline-block; padding: 7px 18px; border: 2px solid var(--th3-navy); background: var(--th3-navy); color: var(--th3-cream); font-weight: 700; cursor: pointer; }
.pf-btn:hover { background: var(--th3-cream); color: var(--th3-navy); }
.pf-btn input { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; }
.pf-who { flex: 1; min-width: 0; }
.pf-who h1 { margin: 0 0 12px; font-size: 1.9rem; font-weight: 900; color: var(--th3-navy); }
.pf-who h1 small { font-size: 1.1rem; font-weight: 700; color: var(--th3-red); margin-left: 6px; }
.pf-runs { display: flex; flex-wrap: wrap; gap: 14px 24px; align-items: center; margin: 0 0 14px; padding: 16px 22px; background: var(--th3-navy); color: #fff; box-shadow: 5px 5px 0 var(--th3-red, #c8102e); }
.pf-run { display: flex; flex-direction: column; min-width: 110px; }
.pf-run-n { font-size: 2.6rem; font-weight: 900; line-height: 1; font-variant-numeric: tabular-nums; }
.pf-run-main .pf-run-n { font-size: 3.2rem; color: #ffd66b; }
.pf-run-l { margin-top: 6px; font-size: .9rem; font-weight: 700; }
.pf-run-l small { font-weight: 500; opacity: .8; }
.pf-run-more { margin-left: auto; font-size: .95rem; }
.pf-run-more p { margin: 3px 0; }
.pf-run-more a { color: #ffd66b !important; }
@media (max-width: 600px) { .pf-run-more { margin-left: 0; width: 100%; border-top: 1px solid rgba(255,255,255,.25); padding-top: 8px; } }
.pf-facts { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px 18px; margin: 0; }
.pf-facts div { border-left: 3px solid var(--th3-navy); padding-left: 10px; }
.pf-facts dt { font-size: .8rem; color: #4d5a73; }
.pf-facts dd { margin: 0; font-weight: 700; font-size: 1.05rem; }
.pf-hint { margin: 12px 0 0; font-size: .88rem; color: #4d5a73; }
.pf-ok { margin: 0 0 14px; padding: 10px 14px; background: #e8f3ea; color: #2f6b3a; font-weight: 700; border-left: 4px solid #2f6b3a; }
.pf-err { margin: 0 0 14px; padding: 8px 14px; background: #fdecea; color: var(--th3-red); font-weight: 700; border-left: 4px solid var(--th3-red); }
.pf-err p { margin: 2px 0; }
.pf-box { margin: 0 0 18px; padding: 18px 22px 20px; background: var(--th3-card, #fff); border: 2px solid var(--th3-navy); box-shadow: 5px 5px 0 var(--th3-navy); }
.pf-box h2 { margin: 0 0 14px; font-size: 1.35rem; font-weight: 900; color: var(--th3-navy); }
.pf-box h2 small { font-size: .8rem; font-weight: 500; color: #4d5a73; }
.pf-form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 20px; }
.pf-form label { display: block; margin: 0; font-weight: 700; color: var(--th3-navy); }
.pf-form label b { color: var(--th3-red); }
.pf-form input[type=text], .pf-form input[type=tel], .pf-form input[type=email], .pf-form input[type=date], .pf-form input[type=password], .pf-form select { display: block; width: 100%; box-sizing: border-box; margin-top: 4px; padding: 8px 10px; font-size: 1rem; border: 2px solid var(--th3-navy); background: #fff; font-weight: 400; }
.pf-form .pf-wide, .pf-form .pf-act, .pf-addr { grid-column: 1 / -1; }
.pf-addr { display: grid; grid-template-columns: 140px 1fr; gap: 0 20px; }
.pf-form .pf-hint { margin: 0; }
.pf-act button { padding: 10px 26px; font-size: 1.05rem; font-weight: 700; cursor: pointer; }
@media (max-width: 760px) {
  .pf-head { flex-direction: column; align-items: center; padding: 16px; }
  .pf-who h1 { text-align: center; font-size: 1.6rem; }
  .pf-facts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .pf-form { grid-template-columns: 1fr; }
  .pf-addr { grid-template-columns: 1fr; gap: 12px; }
  .pf-box { padding: 16px; }
  .pf-act button { width: 100%; }
}
