/* 共用樣式 — UNION ARENA 台灣上位卡表資訊站（淺色版） */
:root {
  --bg:#F2F9FE; --card:#fff; --line:#E4EBF0; --line2:#E0E8EE;
  --accent:#1E9BD7; --accent-dark:#1683BC; --badge-bg:#E8F5FC;
  --text:#14222B; --muted:#6B7A85; --muted2:#51606B; --link:#3A4650;
}
* { margin:0; padding:0; box-sizing:border-box; }
body { background:var(--bg); color:var(--text); font-family:'Noto Sans TC',sans-serif; }
a { color:inherit; }
.wrap { max-width:1200px; margin:0 auto; }

/* nav */
header.nav { display:flex; align-items:center; justify-content:space-between; padding:22px 56px; border-bottom:1px solid var(--line); background:var(--card); }
.brand { display:flex; align-items:center; gap:12px; text-decoration:none; }
.brand .logo { width:40px; height:40px; border-radius:11px; object-fit:cover; display:block; }
.brand .name { font-family:'Fredoka',sans-serif; font-weight:600; font-size:18px; letter-spacing:.02em; line-height:1.05; color:var(--text); }
.brand .sub { font-size:12px; color:var(--muted); font-weight:500; letter-spacing:.18em; }
nav.links { display:flex; align-items:center; gap:30px; }
nav.links a { text-decoration:none; color:var(--link); font-weight:500; font-size:15px; }
nav.links a:hover, nav.links a.active { color:var(--accent-dark); }

/* buttons */
.btn { text-decoration:none; display:inline-flex; align-items:center; justify-content:center; font-weight:700; border-radius:12px; cursor:pointer; border:none; font-family:'Noto Sans TC',sans-serif; font-size:15px; padding:10px 20px; }
.btn-primary { background:var(--accent); color:#fff; }
.btn-primary:hover { background:var(--accent-dark); }
.btn-ghost { background:var(--card); color:var(--text); border:1px solid #D9E2EA; }
.btn-ghost:hover { border-color:var(--accent); color:var(--accent-dark); }
.nav .btn { font-size:14px; padding:10px 20px; border-radius:10px; }

/* page header */
.page-head { padding:40px 56px 8px; }
.page-head .eyebrow { font-family:'Fredoka',sans-serif; font-weight:600; font-size:13px; letter-spacing:.16em; color:var(--accent-dark); }
.page-head h1 { font-weight:900; font-size:38px; margin:6px 0 0; }
.page-head p { font-size:15px; color:var(--muted2); margin:8px 0 0; }

/* toolbar (filters + sort) */
.toolbar { display:flex; flex-wrap:wrap; gap:12px; align-items:center; margin:20px 56px 8px; background:var(--card); border:1px solid var(--line); border-radius:16px; padding:14px 18px; }
.toolbar .group { display:flex; align-items:center; gap:8px; }
.toolbar .lbl { font-size:13px; color:var(--muted); font-weight:600; }
.chip { background:transparent; border:1px solid var(--line2); color:var(--link); font-weight:600; font-size:13px; padding:7px 14px; border-radius:999px; cursor:pointer; font-family:inherit; }
.chip:hover { border-color:var(--accent); color:var(--accent-dark); }
.chip.active { background:var(--accent); border-color:var(--accent); color:#fff; }
.toolbar select { padding:7px 11px; border:1px solid var(--line2); border-radius:8px; font-size:13px; font-family:inherit; color:var(--text); background:#FAFDFF; cursor:pointer; }
.toolbar select:focus { outline:none; border-color:var(--accent); }
.toolbar .count { margin-left:auto; font-size:13px; color:var(--muted); }

/* deck grid: 一行最多 3 篇 */
.deck-grid { display:grid; grid-template-columns:repeat(3,1fr); gap:22px; padding:18px 56px 24px; }
.deck-card { background:var(--card); border:1px solid var(--line); border-radius:16px; overflow:hidden; cursor:pointer; display:flex; flex-direction:column; transition:border-color .15s, transform .15s, box-shadow .15s; text-align:left; padding:0; font-family:inherit; }
.deck-card:hover { border-color:#BFE2F4; transform:translateY(-3px); box-shadow:0 14px 28px rgba(11,58,82,.10); }
.deck-thumb { aspect-ratio:16/10; background:repeating-linear-gradient(135deg,#EDF3F8,#EDF3F8 9px,#E3EAF0 9px,#E3EAF0 18px); display:flex; align-items:center; justify-content:center; overflow:hidden; }
.deck-thumb img { width:100%; height:100%; object-fit:cover; display:block; }
.deck-thumb .ph { font-family:monospace; font-size:11px; color:#8A98A2; }
.deck-body { padding:16px 18px 18px; }
.deck-title { font-weight:800; font-size:18px; line-height:1.4; margin:0 0 8px; display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical; overflow:hidden; }
.deck-meta { display:flex; flex-wrap:wrap; gap:8px; }
.tag { display:inline-block; font-family:'Fredoka',sans-serif; font-weight:600; font-size:12px; padding:3px 10px; border-radius:999px; }
.tag.format { background:var(--badge-bg); color:var(--accent-dark); }
.tag.people { background:#EEF6EF; color:#2C7A4B; }
.tag.date { background:#F1F3F5; color:var(--muted); }

/* load more */
.more-row { display:flex; justify-content:center; padding:8px 56px 56px; }

.state { padding:48px 0; text-align:center; color:var(--muted); font-size:15px; }

/* footer */
footer.foot { border-top:1px solid var(--line); padding:34px 56px; display:flex; align-items:center; justify-content:space-between; flex-wrap:wrap; gap:16px; }
footer.foot .copy { display:flex; align-items:center; gap:11px; font-size:13px; color:var(--muted); }
footer.foot .logo-sm { width:30px; height:30px; border-radius:8px; background:var(--accent); display:flex; align-items:center; justify-content:center; color:#fff; font-family:'Fredoka',sans-serif; font-weight:700; font-size:13px; overflow:hidden; }
footer.foot .logo-sm img { width:100%; height:100%; object-fit:cover; }
footer.foot .fnav { display:flex; gap:18px; }
footer.foot .fnav a { text-decoration:none; color:var(--link); font-weight:600; font-size:14px; }
footer.foot .fnav a:hover { color:var(--accent-dark); }

/* detail modal（大展式） */
.modal-mask { position:fixed; inset:0; background:rgba(11,34,43,.55); display:none; align-items:center; justify-content:center; padding:32px; z-index:50; }
.modal-mask.open { display:flex; }
.modal { background:var(--card); border-radius:20px; width:min(1040px,100%); max-height:90vh; overflow:hidden; display:grid; grid-template-columns:1.1fr 1fr; box-shadow:0 30px 70px rgba(11,34,43,.35); }
.modal-img { background:#0B1B24; display:flex; align-items:center; justify-content:center; }
.modal-img img { width:100%; height:100%; max-height:90vh; object-fit:contain; display:block; }
.modal-img .ph { color:#5b7384; font-family:monospace; font-size:13px; padding:40px; }
.modal-side { display:flex; flex-direction:column; max-height:90vh; }
.modal-side .head { padding:22px 24px 14px; border-bottom:1px solid var(--line); }
.modal-side h2 { font-weight:900; font-size:22px; line-height:1.4; margin:0 0 10px; }
.modal-side .text { padding:18px 24px; overflow-y:auto; flex:1; font-size:15px; line-height:1.7; white-space:pre-wrap; color:var(--text); }
.modal-side .foot { padding:16px 24px 20px; border-top:1px solid var(--line); display:flex; gap:10px; }
.btn-discuss { flex:1; background:#1877F2; color:#fff; font-size:16px; padding:14px 20px; box-shadow:0 8px 20px rgba(24,119,242,.28); }
.btn-discuss:hover { background:#1463d2; }
.modal-close { position:absolute; top:0; right:0; }
.x-btn { position:fixed; top:24px; right:28px; width:40px; height:40px; border-radius:50%; background:#fff; border:none; font-size:20px; cursor:pointer; z-index:60; box-shadow:0 4px 12px rgba(0,0,0,.2); }

/* ───── 表單（投稿） ───── */
.form-wrap { max-width:760px; margin:8px auto 0; padding:0 24px 64px; }
.seg { display:inline-flex; background:#E8EEF3; border-radius:999px; padding:4px; gap:4px; margin:8px 0 22px; }
.seg button { border:none; background:transparent; color:var(--muted); font-weight:700; font-size:14px; padding:9px 20px; border-radius:999px; cursor:pointer; font-family:inherit; }
.seg button.active { background:#fff; color:var(--accent-dark); box-shadow:0 1px 3px rgba(0,0,0,.1); }
.fcard { background:var(--card); border:1px solid var(--line); border-radius:16px; padding:22px 24px; margin-bottom:18px; }
.fcard h3 { font-size:15px; font-weight:800; margin:0 0 4px; }
.fcard .hint { font-size:13px; color:var(--muted); margin:0 0 16px; }
.frow { display:flex; flex-direction:column; gap:6px; margin-bottom:16px; }
.frow:last-child { margin-bottom:0; }
.frow > label { font-size:13px; font-weight:700; color:var(--text); }
.frow .req { color:#D9534F; margin-left:3px; }
.inp, .sel, .ta { width:100%; padding:11px 13px; border:1px solid var(--line2); border-radius:10px; font-size:15px; font-family:inherit; color:var(--text); background:#FAFDFF; }
.inp:focus, .sel:focus, .ta:focus { outline:none; border-color:var(--accent); }
.ta { resize:vertical; min-height:90px; line-height:1.6; }
.grid2 { display:grid; grid-template-columns:1fr 1fr 1fr; gap:12px; }
.rounds .round-row { display:flex; align-items:center; gap:10px; margin-bottom:10px; }
.rounds .round-row .rlabel { font-size:13px; color:var(--muted); white-space:nowrap; min-width:54px; }
.rounds .round-row button { border:none; background:#F1D7D7; color:#B5403B; width:30px; height:30px; border-radius:8px; cursor:pointer; font-size:16px; }
.btn-add { background:transparent; border:1px dashed var(--line2); color:var(--accent-dark); font-weight:700; font-size:14px; padding:9px 16px; border-radius:10px; cursor:pointer; font-family:inherit; }
.btn-add:hover { border-color:var(--accent); }
.file-in { font-size:14px; }
.file-in::file-selector-button { border:1px solid var(--line2); background:#fff; color:var(--text); font-weight:600; padding:8px 14px; border-radius:8px; margin-right:12px; cursor:pointer; font-family:inherit; }
.form-actions { display:flex; align-items:center; gap:14px; margin-top:6px; }
.form-actions .btn-primary { font-size:16px; padding:14px 32px; }
.form-msg { font-size:14px; font-weight:600; }
.form-msg.ok { color:#2C7A4B; }
.form-msg.err { color:#D9534F; }
.hp-field { position:absolute !important; left:-9999px !important; width:1px; height:1px; opacity:0; overflow:hidden; }
.privacy-note { margin:14px 0 0; font-size:12px; line-height:1.6; color:var(--muted); background:#F7FBFE; border:1px solid var(--line); border-radius:8px; padding:9px 12px; }

/* ───── 工作人員審核 ───── */
.gate { max-width:420px; margin:60px auto; background:var(--card); border:1px solid var(--line); border-radius:16px; padding:32px 28px; text-align:center; }
.gate h2 { font-size:20px; margin:0 0 6px; }
.gate p { color:var(--muted); font-size:14px; margin:0 0 18px; }
.review-tabs { display:flex; gap:8px; margin:8px 56px 0; }
.review-list { padding:18px 56px 56px; display:flex; flex-direction:column; gap:18px; }
.sub-card { background:var(--card); border:1px solid var(--line); border-radius:16px; padding:20px 22px; }
.sub-top { display:flex; justify-content:space-between; align-items:flex-start; gap:16px; flex-wrap:wrap; }
.sub-top h3 { font-size:18px; font-weight:800; margin:0; }
.sub-type { font-size:12px; font-weight:700; padding:3px 10px; border-radius:999px; background:var(--badge-bg); color:var(--accent-dark); }
.status-badge { font-size:12px; font-weight:700; padding:3px 10px; border-radius:999px; }
.status-pending { background:#FFF3D6; color:#9A6B00; }
.status-approved { background:#E2F3E8; color:#2C7A4B; }
.status-rejected { background:#FBE2E2; color:#B5403B; }
.sub-body { white-space:pre-wrap; font-size:14px; line-height:1.7; color:var(--text); margin:14px 0; background:#F8FBFD; border:1px solid var(--line); border-radius:10px; padding:14px 16px; }
.sub-imgs { display:flex; gap:10px; flex-wrap:wrap; margin-bottom:14px; }
.sub-imgs img { width:120px; height:120px; object-fit:cover; border-radius:10px; border:1px solid var(--line); cursor:pointer; }
.sub-actions { display:flex; gap:10px; align-items:center; flex-wrap:wrap; border-top:1px solid var(--line); padding-top:14px; }
.sub-actions .ta { min-height:auto; flex:1; min-width:200px; }
.btn-approve { background:#2C9A57; color:#fff; }
.btn-approve:hover { background:#24824a; }
.btn-reject { background:#D9534F; color:#fff; }
.btn-reject:hover { background:#c2403c; }
.reply-shown { font-size:13px; color:var(--muted); margin-top:8px; }

/* ───── 本月登頂牌組控制（建檔後台內） ───── */
.topctl { margin:8px 56px 0; background:var(--card); border:1px solid var(--line); border-radius:16px; padding:18px 20px; }
.topctl h3 { font-size:16px; margin:0 0 4px; }
.topctl .hint { font-size:13px; color:var(--muted); margin:0 0 14px; }
.topctl .slots { display:grid; grid-template-columns:repeat(3,1fr); gap:14px; }
.topslot { border:1px solid var(--line); border-radius:12px; padding:14px; display:flex; flex-direction:column; gap:9px; }
.topslot .st-head { display:flex; align-items:center; gap:8px; }
.topslot .st-rank { width:26px; height:26px; border-radius:50%; display:flex; align-items:center; justify-content:center; color:#fff; font-family:'Fredoka',sans-serif; font-weight:700; font-size:13px; flex:none; }
.topslot.r1 .st-rank { background:#E8B923; } .topslot.r2 .st-rank { background:#A9B4BD; } .topslot.r3 .st-rank { background:#C58B5B; }
.topslot .st-name { font-weight:700; font-size:14px; line-height:1.3; }
.topslot .st-count { font-size:12px; color:var(--muted); }
.topslot img.preview { width:100%; aspect-ratio:4/3; object-fit:contain; background:#F7FBFE; border:1px solid var(--line); border-radius:8px; }
.topslot .st-status { font-size:12px; font-weight:700; }
.topslot .st-status.custom { color:#2C7A4B; }
.topslot .st-status.official { color:#9A6B00; }
.topslot .st-actions { display:flex; gap:8px; align-items:center; flex-wrap:wrap; }
.topslot .st-actions .file-in { font-size:12px; max-width:160px; }
.topslot .st-actions .btn { padding:7px 12px; font-size:12px; }

/* ───── 站長閒聊發文（後台） ───── */
.noteadmin { margin:18px 56px 0; background:var(--card); border:1px solid var(--line); border-radius:16px; padding:18px 20px; }
.noteadmin h3 { font-size:16px; margin:0 0 14px; }
.noteadmin .inp, .noteadmin .ta { width:100%; margin-bottom:12px; }
.noteadmin label { display:block; font-size:13px; color:var(--muted); font-weight:600; margin-bottom:12px; }
.noteadmin .file-in { display:block; margin-top:6px; }
.na-actions { display:flex; align-items:center; gap:12px; margin-top:4px; }
.na-msg { font-size:13px; font-weight:600; }
.na-msg.ok { color:#2C7A4B; } .na-msg.err { color:#D9534F; }
.editor-toolbar { display:flex; gap:6px; flex-wrap:wrap; margin-bottom:8px; }
.editor-toolbar button { border:1px solid var(--line2); background:#fff; color:var(--text); border-radius:7px; padding:6px 11px; font-size:13px; cursor:pointer; font-family:inherit; }
.editor-toolbar button:hover { border-color:var(--accent); color:var(--accent-dark); }
.editor { border:1px solid var(--line2); border-radius:10px; padding:12px 14px; min-height:160px; font-size:15px; line-height:1.7; background:#FAFDFF; margin-bottom:12px; outline:none; }
.editor:focus { border-color:var(--accent); }
.editor:empty:before { content:attr(data-ph); color:#9AA7B0; }
.editor img { max-width:100%; border-radius:8px; margin:6px 0; cursor:pointer; }
.editor img.sel { outline:2px solid var(--accent); outline-offset:1px; }
.imgsizebar { display:flex; align-items:center; gap:6px; flex-wrap:wrap; font-size:12px; color:var(--muted); margin:-4px 0 12px; }
.imgsizebar button { border:1px solid var(--line2); background:#fff; border-radius:6px; padding:4px 11px; font-size:12px; cursor:pointer; font-family:inherit; }
.imgsizebar button:hover { border-color:var(--accent); color:var(--accent-dark); }
.editor h3 { font-size:18px; margin:10px 0 6px; }
.na-pubrow { display:flex; align-items:center; gap:14px; flex-wrap:wrap; margin:4px 0 12px; padding:12px 14px; background:#F7FBFE; border:1px solid var(--line); border-radius:10px; }
.na-pubrow .na-pl { font-size:13px; font-weight:700; color:var(--muted); }
.na-pubrow .rad { display:flex; align-items:center; gap:5px; font-size:13px; color:var(--text); font-weight:600; cursor:pointer; margin:0; }
.na-pubrow input[type=datetime-local] { padding:6px 9px; border:1px solid var(--line2); border-radius:8px; font-size:13px; font-family:inherit; }
.na-status { font-size:11px; font-weight:700; padding:2px 9px; border-radius:999px; margin-left:6px; }
.na-status.draft { background:#FFF3D6; color:#9A6B00; }
.na-status.scheduled { background:#E5EEFB; color:#2E5AAC; }
.na-status.published { background:#E2F3E8; color:#2C7A4B; }
.na-pin { color:#E8B923; margin-left:4px; }
.na-list { margin-top:20px; display:flex; flex-direction:column; gap:10px; }
.na-item { display:flex; align-items:center; gap:12px; border:1px solid var(--line); border-radius:12px; padding:10px 12px; }
.na-item img.na-thumb { width:64px; height:48px; object-fit:cover; border-radius:8px; background:#EDF3F8; flex:none; }
.na-item .na-thumb.ph { display:flex; align-items:center; justify-content:center; font-size:10px; color:#9AA7B0; }
.na-item .na-info { flex:1; min-width:0; }
.na-item .na-title { font-weight:700; font-size:14px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.na-item .na-date { font-size:12px; color:var(--muted); }
.na-item .btn { padding:6px 13px; font-size:12px; }

/* ───── 建檔後台 ───── */
.admin-bar { display:flex; align-items:center; gap:14px; margin:8px 56px 0; flex-wrap:wrap; }
.admin-bar .progress { font-weight:700; color:var(--accent-dark); }
.admin-list { padding:14px 56px 56px; display:flex; flex-direction:column; gap:12px; }
.admin-row { background:var(--card); border:1px solid var(--line); border-radius:14px; padding:14px 16px; display:grid; grid-template-columns:88px 1fr auto; gap:16px; align-items:center; }
.admin-row.done { border-color:#BFE2D0; background:#FBFEFC; }
.admin-row .thumb { width:88px; height:66px; border-radius:8px; object-fit:cover; background:#EDF3F8; }
.admin-row .info { min-width:0; }
.admin-row .deck { font-weight:700; font-size:15px; margin:0 0 4px; }
.admin-row .raw { font-size:12px; color:var(--muted); display:flex; gap:10px; flex-wrap:wrap; }
.admin-row .raw a { color:var(--accent-dark); }
.admin-row .controls { display:flex; align-items:center; gap:8px; flex-wrap:wrap; justify-content:flex-end; }
.admin-row .controls select { padding:8px 10px; border:1px solid var(--line2); border-radius:8px; font-size:13px; font-family:inherit; background:#FAFDFF; max-width:150px; }
.admin-row .saved { font-size:12px; color:#2C7A4B; font-weight:700; min-width:42px; }
.admin-row .sugg { font-size:11px; color:#9A6B00; }

@media (max-width:880px) {
  header.nav { padding:16px 22px; }
  nav.links { gap:16px; font-size:14px; }
  .page-head, .toolbar, .deck-grid, .more-row, footer.foot, .review-list, .review-tabs, .admin-list, .admin-bar { padding-left:22px; padding-right:22px; }
  .admin-bar { margin-left:22px; margin-right:22px; }
  .admin-row { grid-template-columns:1fr; }
  .toolbar { margin-left:22px; margin-right:22px; }
  .review-tabs { margin-left:22px; margin-right:22px; }
  .deck-grid { grid-template-columns:1fr; }
  .grid2 { grid-template-columns:1fr; }
  .modal { grid-template-columns:1fr; max-height:92vh; }
  .modal-img img { max-height:40vh; }
}
