/* ==========================================================================
   成员关系与歌单查询（本地候选） · 2026-10-25
   视觉基准：docs/design/HOME_V1_APPROVED.md（暖白编辑式）
   字体：assets/typography.css 13 角色成套，lang 边界选族
   ========================================================================== */

:root {
  --bg: #F7F6F2;
  --surface: #FCFBF8;
  --ink: #24272C;
  --sub: #555A60;
  --weak: #73716B;
  --line: #DDDAD2;
  --control: #8B8880;
  --brand-pink: #EC4899;
  --g-nogizaka46: #8B2A8E;
  --g-sakurazaka46: #D94683;
  --g-hinatazaka46: #41B6E6;
  --g-keyakizaka46: #16935B;
  --g-hiragana-keyakizaka46: #41B6E6;
  --radius-s: 6px;
  --radius-m: 10px;
}

* { box-sizing: border-box; }

html, body { margin: 0; padding: 0; }

body {
  background: var(--bg);
  color: var(--ink);
}

.wrap {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 24px;
}

a { color: inherit; }

/* ---- Header ---- */
.site-head {
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}
.head-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding-top: 12px;
  padding-bottom: 12px;
}
.brand {
  text-decoration: none;
  font-family: var(--type-font-ja);
  font-weight: 700;
  font-size: 1.25rem;
  line-height: 1.35;
  letter-spacing: 0.02em;
  white-space: nowrap;
}
.brand-yoku, .brand-moto { font-style: normal; color: var(--brand-pink); }
.head-nav {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
}
.head-nav a {
  font-size: var(--type-ui-size);
  line-height: var(--type-ui-lh);
  font-weight: 500;
  text-decoration: none;
  color: var(--sub);
  padding: 6px 12px;
  border-radius: var(--radius-s);
  white-space: nowrap;
}
.head-nav a:hover { background: var(--bg); color: var(--ink); }
.head-nav a[aria-current="page"] { color: var(--ink); background: var(--bg); }

/* ---- Main layout ---- */
.site-main { padding: 32px 0 64px; }

.loading-note, .empty-note { color: var(--weak); }
.empty-note { padding: 16px 0; }

.error-box {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-m);
  padding: 24px;
  max-width: 560px;
}
.error-box p { margin: 0 0 16px; color: var(--sub); }

button.retry-btn, .btn {
  font-size: var(--type-ui-size);
  line-height: var(--type-ui-lh);
  font-weight: 500;
  background: var(--ink);
  color: var(--surface);
  border: 1px solid var(--ink);
  border-radius: var(--radius-s);
  padding: 8px 16px;
  cursor: pointer;
}
.btn-ghost {
  background: transparent;
  color: var(--sub);
  border: 1px solid var(--control);
}
.btn-ghost:hover { color: var(--ink); border-color: var(--ink); }

/* ---- View head ---- */
.view-head { margin-bottom: 24px; }
.view-title { margin: 0 0 8px; }
.view-desc { margin: 0; color: var(--sub); max-width: 640px; }
/* 长场馆名的换行区域保持连续可点击。 */
.occurrence-venue-link { display: inline-block; max-width: 100%; }
.coverage-note { color: var(--weak); margin: 8px 0 0; }

/* ---- Filters ---- */
.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: flex-end;
  padding: 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-m);
  margin-bottom: 24px;
}
.filter-field { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.filter-field > span { color: var(--weak); }
.filter-field input[type="search"],
.filter-field input[type="date"],
.filter-field select {
  font-family: inherit;
  font-size: var(--type-ui-size);
  line-height: var(--type-ui-lh);
  font-weight: 500;
  color: var(--ink);
  background: var(--bg);
  border: 1px solid var(--control);
  border-radius: var(--radius-s);
  padding: 6px 10px;
  min-height: 34px;
}
/* select 保留原生下拉箭头，不设 appearance:none */
.filter-field input[type="search"] { width: 220px; }
/* select 遵守 UI 角色（14/500/1.4，与 input 同级等高）：
   appearance:none 使 line-height 生效，配静态小箭头保留可识别下拉形态，
   键盘与其它原生选择行为不变 */
.filter-field select {
  appearance: none;
  -webkit-appearance: none;
  padding-right: 28px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='%23555A60' stroke-width='1.5' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
}
.filter-actions { display: flex; gap: 8px; }

/* ---- Tabs ---- */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 24px; }
.tabs a {
  font-size: var(--type-ui-size);
  line-height: var(--type-ui-lh);
  font-weight: 500;
  text-decoration: none;
  color: var(--sub);
  padding: 8px 12px;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  white-space: nowrap;
}
.tabs a[aria-current="true"] { color: var(--ink); border-bottom-color: var(--ink); }

/* ---- List rows（同级信息同一骨架） ---- */
.row-list {
  list-style: none;
  margin: 0;
  padding: 0;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-m);
}
.row-item {
  display: flex;
  align-items: baseline;
  gap: 16px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
}
.row-item:last-child { border-bottom: 0; }
.row-item:hover { background: var(--bg); }
.row-main { flex: 1 1 auto; min-width: 0; display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; }
.row-title { text-decoration: none; color: var(--ink); }
a.row-title:hover { text-decoration: underline; }
.row-meta { color: var(--weak); display: flex; flex-wrap: wrap; gap: 4px 12px; }
.row-side { flex: 0 0 auto; color: var(--sub); text-align: right; }
/* 仅含来源列表的侧列允许收缩并限宽，不挤压主列；日期/计数侧列不收缩 */
.row-side:has(.sources) { flex: 0 1 auto; min-width: 0; max-width: 48%; }

/* 原子项：姓名/团名/日期整项换行 */
.atomic { display: inline-block; white-space: nowrap; }

/* ---- Group dot ---- */
.gdot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--weak);
  flex: 0 0 auto;
  align-self: center;
}
.gdot[data-group="nogizaka46"] { background: var(--g-nogizaka46); }
.gdot[data-group="sakurazaka46"] { background: var(--g-sakurazaka46); }
.gdot[data-group="hinatazaka46"] { background: var(--g-hinatazaka46); }
.gdot[data-group="keyakizaka46"] { background: var(--g-keyakizaka46); }
.gdot[data-group="hiragana-keyakizaka46"] { background: var(--g-hiragana-keyakizaka46); }

/* ---- Badges / labels ---- */
.badge {
  display: inline-block;
  font-size: var(--type-label-size);
  line-height: var(--type-label-lh);
  font-weight: 600;
  color: var(--sub);
  border: 1px solid var(--line);
  border-radius: var(--radius-s);
  padding: 1px 6px;
  white-space: nowrap;
}
.badge.badge-held { color: #2F6B3A; border-color: #B9D2BE; }
.badge.badge-upcoming { color: #8A5A00; border-color: #E3CDA1; }
.badge.badge-cancelled { color: var(--weak); text-decoration: line-through; }

/* ---- Detail page ---- */
.detail-grid {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);
  gap: 32px;
  align-items: start;
}
.detail-main, .detail-side { min-width: 0; }

.profile-head { display: flex; gap: 24px; align-items: flex-start; margin-bottom: 32px; }
.profile-photo {
  flex: 0 0 auto;
  width: 120px;
  height: 120px;
  border-radius: var(--radius-m);
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--line);
}
.profile-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.profile-info { min-width: 0; }
.profile-name { margin: 0 0 4px; }
.profile-kana { color: var(--weak); margin: 0 0 8px; }
.profile-facts { margin: 0; padding: 0; list-style: none; color: var(--sub); display: flex; flex-wrap: wrap; gap: 4px 16px; }

.section { margin-bottom: 48px; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; margin-bottom: 16px; }
.section-title { margin: 0; }
.section-note { color: var(--weak); margin: 4px 0 0; }

.stat-line { display: flex; flex-wrap: wrap; gap: 8px 24px; margin-bottom: 16px; }
.stat { display: flex; align-items: baseline; gap: 8px; }
.stat-num { color: var(--ink); text-decoration: none; }
a.stat-num:hover { text-decoration: underline; }
.stat-cap { color: var(--weak); }

/* 可展开依据 */
details.evidence {
  border: 1px solid var(--line);
  border-radius: var(--radius-s);
  background: var(--surface);
  padding: 8px 12px;
  margin-bottom: 8px;
}
details.evidence > summary {
  cursor: pointer;
  font-size: var(--type-ui-size);
  line-height: var(--type-ui-lh);
  font-weight: 500;
  color: var(--sub);
  list-style-position: inside;
}
details.evidence[open] > summary { color: var(--ink); margin-bottom: 8px; }
.evidence-list { margin: 0; padding: 0; list-style: none; }
.evidence-list li { padding: 6px 0; border-top: 1px solid var(--line); display: flex; flex-wrap: wrap; gap: 4px 12px; align-items: baseline; }
.evidence-list li:first-child { border-top: 0; }

/* 来源 */
.sources { margin: 8px 0 0; padding: 0; list-style: none; display: flex; flex-wrap: wrap; gap: 4px 12px; min-width: 0; max-width: 100%; }
.sources li { min-width: 0; }
.sources a { color: var(--weak); text-decoration: underline; text-underline-offset: 2px; overflow-wrap: anywhere; }
.sources a:hover { color: var(--ink); }

/* 成功分词的长日文标题：只在 wbr/词边界换行；异常长无空格词局部应急折行 */
.ja-wrap { word-break: keep-all; overflow-wrap: anywhere; }

/* 歌单明细 */
.setlist-block { margin-bottom: 24px; }
.setlist-seg {
  font-size: var(--type-label-size);
  line-height: var(--type-label-lh);
  font-weight: 600;
  color: var(--weak);
  letter-spacing: 0.04em;
  margin: 0 0 8px;
}
.seq-list { margin: 0; padding: 0; list-style: none; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-m); }
.seq-item { display: flex; gap: 12px; padding: 10px 16px; border-bottom: 1px solid var(--line); align-items: baseline; }
.seq-item:last-child { border-bottom: 0; }
.seq-no { flex: 0 0 2.2ch; text-align: right; color: var(--weak); }
.seq-no.seq-unknown { flex-basis: auto; }
.seq-body { flex: 1 1 auto; min-width: 0; }
.seq-participants { color: var(--sub); margin-top: 2px; display: flex; flex-wrap: wrap; gap: 2px 10px; }
.center-mark { color: var(--brand-pink); font-weight: 600; }

/* Daily */
.daily-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 32px; align-items: start; }
.daily-date-row { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; margin-bottom: 24px; }

/* Member cards（成员浏览栅格） */
.member-grid {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 12px;
}
.member-cell {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-m);
  padding: 12px 16px;
  display: flex;
  gap: 12px;
  align-items: center;
  min-width: 0;
}
.member-cell:hover { background: var(--bg); }
.member-cell a.cell-link { display: flex; gap: 12px; align-items: center; text-decoration: none; color: inherit; min-width: 0; flex: 1 1 auto; }
.member-thumb {
  flex: 0 0 auto;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  overflow: hidden;
  background: var(--bg);
  border: 1px solid var(--line);
}
.member-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.member-cell-body { min-width: 0; }
.member-cell-name { display: block; }
.member-cell-meta { color: var(--weak); display: flex; flex-wrap: wrap; gap: 2px 8px; }

/* ---- Footer ---- */
.site-foot {
  border-top: 1px solid var(--line);
  background: var(--surface);
  padding: 24px 0;
}
.foot-grid { display: flex; flex-wrap: wrap; gap: 8px 24px; align-items: baseline; }
.foot-grid a { font-size: var(--type-ui-size); line-height: var(--type-ui-lh); color: var(--sub); text-decoration: none; }
.foot-grid a:hover { color: var(--ink); text-decoration: underline; }
.foot-note { color: var(--weak); margin-left: auto; }

/* ---- Responsive ---- */
@media (max-width: 900px) {
  .detail-grid { grid-template-columns: 1fr; }
  .daily-grid { grid-template-columns: 1fr; }
}
@media (max-width: 767px) {
  .wrap { padding: 0 16px; }
  .site-main { padding: 24px 0 48px; }
  .head-row { flex-direction: column; align-items: flex-start; gap: 8px; }
  .filter-field input[type="search"] { width: 100%; }
  .filter-field { flex: 1 1 100%; }
  .filter-actions { flex: 1 1 100%; }
  .profile-head { flex-direction: column; gap: 16px; }
  .row-item { gap: 8px; flex-wrap: wrap; }
  .row-side { text-align: left; flex-basis: 100%; max-width: 100%; }
  .row-side:has(.sources) { max-width: 100%; }
  .foot-note { margin-left: 0; flex-basis: 100%; }
  /* 窄屏 section-head：标题不收窄，状态标签作为整体移到下一行 */
  .section-head { flex-wrap: wrap; row-gap: 4px; }
  .section-head .section-title { flex: 0 0 auto; }
  .section-head .badge { flex: 0 0 auto; }
}

/* ---- 页内导航 / 返回 / 筛选口径 ---- */
.inpage-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 16px;
  padding: 8px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  margin-bottom: 24px;
}
.inpage-nav a { color: var(--sub); text-decoration: none; white-space: nowrap; }
.inpage-nav a:hover { color: var(--ink); text-decoration: underline; }
.back-row { margin: 0 0 16px; }
.back-row a { color: var(--sub); text-decoration: none; }
.back-row a:hover { color: var(--ink); text-decoration: underline; }
.filter-ctx-note { color: var(--weak); margin: 8px 0 0; }

/* ---- 成员资料来源折叠 / 阵型逐排 ---- */
.profile-links { margin: 8px 0 0; }
.profile-links a { color: var(--sub); }
.profile-links a:hover { color: var(--ink); }
.profile-sources { margin-top: 8px; }
.formation-evidence { display: block; }
.formation-row { display: flex; flex-wrap: wrap; gap: 2px 10px; padding: 2px 0; align-items: baseline; }
.formation-row-label { color: var(--weak); flex: 0 0 3.5em; }

/* 纯日期原子数字层：仅字体/数字特性，尺寸字重行高继承所在角色 */
.type-date {
  font-family: var(--type-font-latin);
  font-variant-numeric: tabular-nums lining-nums;
  font-feature-settings: "tnum" 1, "lnum" 1;
  font-kerning: none;
}
