/* Journey Uncharted 公會網站
   配色沿用機器人名片的調性：深板岩底、燙金重點色。 */

/* 標題與數字用的窄體。只含 Latin 與數字 —— 中文一律走系統字型，
   因為會員可以自創稱號，字集無法預先界定，子集化一定會有人的稱號
   掉到 fallback。這套字沒有中文字符，剛好只影響該影響的地方。 */
@font-face {
  font-family: "JU Condensed";
  src: url("/ju/static/fonts/ju-condensed.woff2") format("woff2");
  font-weight: 400 800;
  font-display: swap;
}

:root {
  --ground:   #0F1216;
  --surface:  #171B21;
  --surface-2:#1E242B;
  --line:     #2B333C;
  --ink:      #EEF1F4;
  --ink-2:    #94A0AB;
  --ink-3:    #65717C;
  --gold:     #FF7A2F;
  --gold-dim: #9C4517;
  --silver:   #FFFFFF;

  --font: "PingFang TC", "Microsoft JhengHei", "Noto Sans TC", -apple-system,
          "Segoe UI", Roboto, sans-serif;
  --mono: ui-monospace, "SF Mono", Consolas, "Noto Sans Mono", monospace;

  /* 字體角色：標題／數字／小標籤都套窄體，內文與中文維持系統字 */
  --f-display: "JU Condensed", var(--font);
  --f-num:     "JU Condensed", var(--font);
  --f-label:   "JU Condensed", var(--font);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--ground);
  color: var(--ink);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--gold); text-decoration: none; }
a:hover { text-decoration: underline; }
a:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; border-radius: 2px; }

/* ---------------------------------------------------------------- 版頭 */

.top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 28px;
  padding: 16px 28px;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}

.brand {
  font-family: var(--f-display);
  font-weight: 800;
  letter-spacing: 0.06em;
  color: var(--gold);
  font-size: 15px;
  text-transform: uppercase;
}
.brand:hover { text-decoration: none; opacity: 0.85; }

.nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 20px;
  margin-left: auto;
  font-size: 14.5px;
}

.nav a { color: var(--ink-2); }
.nav a:hover { color: var(--ink); text-decoration: none; }
.nav a.on { color: var(--gold); }

.nav .who {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--ink-2);
  padding-left: 20px;
  border-left: 1px solid var(--line);
}

.nav .who img { border-radius: 50%; display: block; }

.badge {
  font-family: var(--f-label);
  font-style: normal;
  font-size: 11.5px;
  letter-spacing: 0.08em;
  color: var(--gold);
  border: 1px solid var(--gold-dim);
  border-radius: 2px;
  padding: 1px 6px;
}

.nav .out { color: var(--ink-3); }

main { max-width: 1060px; margin: 0 auto; padding: 40px 28px 96px; }

.foot {
  border-top: 1px solid var(--line);
  padding: 20px 28px;
  color: var(--ink-3);
  font-size: 13px;
  text-align: center;
}

/* ---------------------------------------------------------------- 首頁 */

.hero { max-width: 44ch; margin: 64px auto; text-align: center; }

.eyebrow {
  font-family: var(--f-label);
  font-size: 12px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--gold);
  margin: 0 0 14px;
}

.hero h1 {
  font-family: var(--f-display);
  font-size: clamp(44px, 9vw, 68px);
  line-height: 1.05;
  margin: 0 0 16px;
  letter-spacing: -0.01em;
}

.lede { color: var(--ink-2); margin: 0 0 28px; }

.error {
  color: #e8907c;
  border: 1px solid #6d3a30;
  background: #2a1c19;
  padding: 10px 14px;
  margin: 0 0 22px;
  font-size: 15px;
}

.btn {
  font-family: var(--f-label);
  letter-spacing: 0.04em;
  display: inline-block;
  background: var(--gold);
  color: #14171d;
  font-weight: 700;
  padding: 11px 26px;
  border-radius: 3px;
  letter-spacing: 0.02em;
}
.btn:hover { text-decoration: none; background: #eec478; }

/* ---------------------------------------------------------------- 數字列 */

.counts {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0;
  margin: 44px 0 0;
  padding: 0;
  border: 1px solid var(--line);
}

.counts > div {
  flex: 1 1 120px;
  padding: 14px 18px;
  border-right: 1px solid var(--line);
}
.counts > div:last-child { border-right: none; }

.counts dt {
  font-family: var(--f-label);
  font-size: 12px;
  letter-spacing: 0.1em;
  color: var(--ink-3);
  margin-bottom: 4px;
}

.counts dd {
  font-family: var(--f-num);
  margin: 0;
  font-size: 26px;
  font-variant-numeric: tabular-nums;
  color: var(--silver);
}

.counts.wide { justify-content: flex-start; margin: 28px 0; }
.counts.wide dd { font-size: 32px; }
.counts dd.rank { font-size: 13px; color: var(--ink-3); margin-top: 2px; }

/* ---------------------------------------------------------------- 頁首區 */

.pagehead {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px 24px;
  margin: 0 0 28px;
}

.pagehead .ph-main { min-width: 0; }

.pagehead h1 {
  font-family: var(--f-display);
  letter-spacing: -0.005em;
  font-size: clamp(30px, 4.6vw, 42px);
  line-height: 1.25;
  margin: 0 0 6px;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 12px;
}

.pagehead .sub { color: var(--ink-3); font-size: 14px; margin: 0; }

/* 操作按鈕貼在標題右側，不必捲到頁尾去找 */
.pagehead .ph-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  padding-top: 4px;
}
.pagehead .ph-actions form { display: inline; margin: 0; }
.pagehead .ph-actions .btn { padding: 7px 16px; font-size: 14px; }

.title { font-weight: 700; }

/* ---------------------------------------------------------------- 工具列 */

.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 14px 24px;
  align-items: center;
  justify-content: space-between;
  margin: 0 0 18px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
}

.tabs { display: flex; gap: 4px; }

.tabs a {
  color: var(--ink-2);
  font-size: 14px;
  padding: 5px 13px;
  border: 1px solid transparent;
  border-radius: 3px;
}
.tabs a:hover { text-decoration: none; color: var(--ink); }
.tabs a.on { color: var(--gold); border-color: var(--gold-dim); background: var(--surface-2); }

.search { display: flex; gap: 8px; align-items: center; }

.search input[type="search"] {
  background: var(--surface);
  border: 1px solid var(--line);
  color: var(--ink);
  padding: 7px 12px;
  border-radius: 3px;
  font: inherit;
  font-size: 14px;
  min-width: 200px;
}
.search input:focus { outline: none; border-color: var(--gold-dim); }

.search button {
  background: var(--surface-2);
  border: 1px solid var(--line);
  color: var(--ink);
  padding: 7px 15px;
  border-radius: 3px;
  font: inherit;
  font-size: 14px;
  cursor: pointer;
}
.search button:hover { border-color: var(--gold-dim); color: var(--gold); }

.search .clear { font-size: 13px; color: var(--ink-3); }

/* ---------------------------------------------------------------- 成員表 */

.tablewrap { overflow-x: auto; border: 1px solid var(--line); }

table.members { border-collapse: collapse; width: 100%; font-size: 14.5px; }

.members th {
  font-family: var(--f-label);
  text-transform: uppercase;
  text-align: left;
  font-size: 11.5px;
  letter-spacing: 0.1em;
  color: var(--ink-3);
  font-weight: 600;
  padding: 10px 14px;
  background: var(--surface-2);
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}

.members td {
  padding: 9px 14px;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}

.members tbody tr:last-child td { border-bottom: none; }
.members tbody tr:hover { background: var(--surface); }

.members .rank {
  font-family: var(--f-num);
  width: 1%;
  color: var(--ink-3);
  font-variant-numeric: tabular-nums;
  text-align: right;
}

.members .who a {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 10px;
  color: var(--ink);
}
.members .who a:hover { text-decoration: none; }
.members .who a:hover .name { color: var(--gold); }
.members .who .name { font-weight: 600; }
.members .who .title { font-size: 13px; font-weight: 700; }

.members .num {
  font-family: var(--f-num);
  font-size: 19px;
  text-align: right;
  font-variant-numeric: tabular-nums;
  color: var(--silver);
  white-space: nowrap;
}

.members .coll { white-space: nowrap; color: var(--ink-3); font-size: 13px; }
.members td.coll span + span::before { content: " / "; color: var(--line); }

.empty { color: var(--ink-3); padding: 40px 0; text-align: center; }

/* ---------------------------------------------------------------- 名片頁 */

.cardwrap { margin: 0 0 8px; }

.card {
  display: block;
  width: 100%;
  height: auto;
  max-width: 800px;
  border: 1px solid var(--line);
  border-radius: 6px;
}

.collections {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 28px 32px;
  margin: 36px 0 0;
  padding-top: 28px;
  border-top: 1px solid var(--line);
}

.collections h2 {
  font-family: var(--f-label);
  text-transform: uppercase;
  font-size: 13px;
  letter-spacing: 0.1em;
  color: var(--ink-3);
  font-weight: 600;
  margin: 0 0 12px;
}

.collections h2 em {
  font-style: normal;
  color: var(--gold);
  margin-left: 4px;
}

.chips { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }

.chips li {
  font-size: 13px;
  padding: 3px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  font-weight: 600;
}

.none { color: var(--ink-3); font-size: 14px; margin: 0; }

.back { margin: 44px 0 0; font-size: 14px; }

@media (max-width: 620px) {
  main { padding: 28px 18px 72px; }
  .top { padding: 14px 18px; }
  .members .coll { display: none; }
  .members th.coll { display: none; }
}

/* 分頁上的數量標記 */
.tabs a em {
  font-family: var(--f-num);
  font-style: normal;
  margin-left: 6px;
  font-size: 12px;
  color: var(--ink-3);
  font-variant-numeric: tabular-nums;
}
.tabs a.on em { color: var(--gold-dim); }

/* ---------------------------------------------------------------- 可排序表頭 */

.members th.sortable { padding: 0; }
.members th.sortable a {
  font-family: var(--f-label);
  text-transform: uppercase;
  display: block;
  padding: 10px 14px;
  color: var(--ink-3);
  font: inherit;
  font-size: 11.5px;
  letter-spacing: 0.1em;
  white-space: nowrap;
}
.members th.sortable a:hover { text-decoration: none; color: var(--ink); background: var(--surface); }
.members th.sortable.on a { color: var(--gold); }
.members th.sortable.num a { text-align: right; }
.members th.sortable i {
  font-style: normal;
  display: inline-block;
  width: 10px;
  margin-left: 2px;
}

/* ---------------------------------------------------------------- 可點選的稱號／背景 */

.chips.choices li { padding: 0; border: none; background: none; }

.chips.choices li,
.chips.choices li button {
  font-size: 13px;
  line-height: 1.6;
}

.chips.choices li:not(:has(form)) {
  padding: 3px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  font-weight: 600;
}

.chips.choices form { margin: 0; }

.chips.choices button {
  padding: 3px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--ink);
  font-family: inherit;
  font-weight: 600;
  cursor: pointer;
}
.chips.choices button:hover:not(:disabled) { border-color: var(--gold-dim); background: var(--surface-2); }

/* 目前生效的那一個 */
.chips.choices li.on button,
.chips.choices li.on:not(:has(form)) {
  border-color: var(--gold);
  box-shadow: 0 0 0 1px var(--gold-dim) inset;
  cursor: default;
}
.chips.choices li.on button:disabled { opacity: 1; }
