/* TeamMJ 360 正式版樣式。品牌色由 body[data-team] 切換；藍＝理性、橘＝感性 兩團一致。 */
:root {
  --brand: #002856;        /* 預設：拓海藍 */
  --brand-dark: #001A3A;
  --brand-soft: #E9EEF5;
  --accent: #CC9F53;       /* 領航金 */
  --ink: #1C2733;
  --ink-soft: #5B6B7C;
  --card: #FFFFFF;
  --line: #E3E8EF;
  --bg-top: #F6F8FB;
  --bg-bot: #EEF2F7;
  --hover: #F7F9FC;
  --ok: #2F9E44;
  --warn: #E03131;
  --sys2: #1971C2;   /* 系統 2 理性 = 藍 */
  --sys1: #E8590C;   /* 系統 1 感性 = 橘 */
  --radius: 20px;
  --shadow: 0 10px 30px rgba(0, 40, 86, .07);
}
body[data-team="ga"] {
  --brand: #1A1A1A;
  --brand-dark: #000000;
  --brand-soft: #ECECEC;
  --accent: #B1896D;       /* GA 金屬金棕，只當點綴 */
  --ink: #111111;
  --ink-soft: #666666;
  --line: #E0E0E0;
  --bg-top: #F4F4F4;
  --bg-bot: #E4E4E4;
  --hover: #F6F6F6;
  --shadow: 0 10px 30px rgba(0, 0, 0, .07);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: "PingFang TC", "Noto Sans TC", "Microsoft JhengHei", sans-serif;
  background: linear-gradient(180deg, var(--bg-top) 0%, var(--bg-bot) 100%);
  min-height: 100vh;
  color: var(--ink);
  font-size: 16px;
  line-height: 1.7;
  padding-bottom: 90px;
}

/* ── 頂部導覽 ── */
.topbar {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255,255,255,.94); backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
  padding: 0 28px;
  display: flex; align-items: center; gap: 8px;
  height: 66px;
}
.logo-mark {
  width: 34px; height: 34px; border-radius: 10px;
  background: var(--brand);
  color: var(--accent); font-weight: 900; font-size: 12px;
  display: flex; align-items: center; justify-content: center;
  letter-spacing: -0.5px;
}
.topbar .logo {
  font-weight: 900; font-size: 18px; color: var(--ink);
  margin-right: auto; white-space: nowrap;
  display: flex; align-items: center; gap: 10px;
}
.topbar .logo small { font-size: 12.5px; color: var(--ink-soft); font-weight: 600; }
.topbar a {
  text-decoration: none; color: var(--ink-soft);
  font-size: 15px; font-weight: 600;
  padding: 8px 14px; border-radius: 999px; white-space: nowrap;
}
.topbar a:hover { color: var(--brand); }
.topbar a.active { background: var(--brand-soft); color: var(--brand); font-weight: 800; }
.topbar .who { font-size: 12.5px; color: var(--ink-soft); margin-left: 6px; white-space: nowrap; }

.notice {
  text-align: center; font-size: 13.5px; padding: 8px 12px;
  background: #FFF3BF; color: #7A5A00;
}
.notice.closed { background: #FDECEC; color: #9B2C2C; }

.wrap { max-width: 1200px; margin: 0 auto; padding: 28px 24px; }
.wrap.narrow { max-width: 880px; }

/* ── Hero 區 ── */
.hero-grid {
  display: grid; grid-template-columns: 1.9fr 1fr; gap: 22px;
  margin-bottom: 34px; align-items: stretch;
}
.hero-card {
  background: var(--card);
  border: 1px solid var(--line); border-radius: 26px;
  padding: 40px 44px; box-shadow: var(--shadow);
  border-top: 6px solid var(--brand);
}
.hero-date { font-size: 14.5px; color: var(--accent); letter-spacing: 1px; font-weight: 800; }
.hero-title {
  font-size: 40px; font-weight: 900; letter-spacing: 1px;
  line-height: 1.3; margin: 6px 0 10px; color: var(--brand);
}
.hero-sub { font-size: 16.5px; color: var(--ink-soft); max-width: 560px; }
.battle {
  margin-top: 24px; background: var(--brand-soft);
  border-left: 5px solid var(--accent);
  border-radius: 14px; padding: 16px 20px;
  font-size: 16px;
}
.battle b { color: var(--brand); }

.side-card {
  background: var(--card); border: 1px solid var(--line);
  border-radius: 26px; padding: 28px; box-shadow: var(--shadow);
  display: flex; flex-direction: column; gap: 14px;
}
.side-card h3 { font-size: 18px; font-weight: 900; }

.quick-item {
  display: block; width: 100%; text-align: left;
  background: var(--hover); border: 1px solid var(--line);
  border-radius: 14px; padding: 15px 18px;
  font-size: 15.5px; font-weight: 700; color: var(--ink);
  font-family: inherit; cursor: pointer; text-decoration: none;
  transition: all .15s;
}
.quick-item:hover { border-color: var(--accent); color: var(--brand); }

/* ── 區塊標題 ── */
.section-label {
  font-size: 12.5px; letter-spacing: 4px; font-weight: 800;
  color: var(--accent); text-transform: uppercase;
}
.section-head { font-size: 26px; font-weight: 900; margin: 2px 0 16px; color: var(--brand); }

/* ── 卡片 ── */
.card {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 26px 28px; margin-bottom: 18px;
  box-shadow: var(--shadow);
}
.card h2 { font-size: 20px; font-weight: 900; margin-bottom: 14px; }
.card h3 { font-size: 17px; margin: 16px 0 8px; }

.badge {
  display: inline-block; font-size: 13px; font-weight: 700;
  padding: 4px 12px; border-radius: 999px;
}
.badge.brand { background: var(--brand-soft); color: var(--brand); }
.badge.green { background: #EBFBEE; color: var(--ok); }
.badge.gray { background: #F1F3F5; color: #666; }
.badge.red { background: #FDECEC; color: var(--warn); }
.badge.gold { background: #FBF3E4; color: #8A6A2E; }

.progress-track { background: var(--brand-soft); border-radius: 999px; height: 12px; overflow: hidden; }
.progress-fill { background: linear-gradient(90deg, var(--brand), var(--accent)); height: 100%; border-radius: 999px; transition: width .3s; }
.progress-note { font-size: 14.5px; color: var(--ink-soft); margin-top: 8px; }

/* ── 守則摺疊 ── */
details.rules { background: var(--brand-soft); border-radius: 16px; padding: 16px 22px; margin-bottom: 18px; }
details.rules summary { cursor: pointer; font-weight: 800; color: var(--brand); font-size: 15.5px; }
details.rules ul { margin: 10px 0 0 22px; font-size: 15px; }

/* ── 成員評分卡 ── */
.member-card { position: relative; }
.member-card .head { display: flex; align-items: center; gap: 14px; margin-bottom: 10px; }
.avatar {
  width: 52px; height: 52px; border-radius: 50%;
  background: var(--brand); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-weight: 900; font-size: 20px; flex-shrink: 0;
}
.member-card .name { font-weight: 900; font-size: 18px; }
.member-card .role { font-size: 13.5px; color: var(--ink-soft); }
.done-tag { margin-left: auto; }

.sys-block { margin-top: 14px; }
.sys-label { display: flex; align-items: baseline; gap: 8px; font-size: 15.5px; font-weight: 800; }
.sys-label .range { font-size: 13px; color: var(--ink-soft); font-weight: 400; }
.sys-label.s2 { color: var(--sys2); }
.sys-label.s1 { color: var(--sys1); }
.sys-hint { font-size: 13.5px; color: var(--ink-soft); margin: 2px 0 10px; }

.chips { display: flex; flex-wrap: wrap; gap: 9px; }
.chip {
  border: 1.5px solid var(--line); background: #fff;
  border-radius: 999px; padding: 9px 17px;
  font-size: 15.5px; font-weight: 800; cursor: pointer;
  color: var(--ink-soft); transition: all .12s; font-family: inherit;
}
.chip:hover { border-color: var(--brand); color: var(--brand); }
.chip.sel-s2 { background: var(--sys2); border-color: var(--sys2); color: #fff; }
.chip.sel-s1 { background: var(--sys1); border-color: var(--sys1); color: #fff; }
.chip:disabled { cursor: not-allowed; opacity: .55; }
.chip:disabled:hover { border-color: var(--line); color: var(--ink-soft); }
.chip.sel-s2:disabled, .chip.sel-s1:disabled { opacity: 1; }

.subtotal {
  margin-top: 14px; padding-top: 12px; border-top: 1px dashed var(--line);
  display: flex; justify-content: space-between; align-items: center;
  font-size: 15px;
}
.subtotal b { font-size: 22px; color: var(--brand); }

/* ── 表單 ── */
.field { margin-bottom: 16px; }
.field label { display: block; font-size: 14.5px; font-weight: 800; margin-bottom: 6px; }
.field select, .field textarea, .field input {
  width: 100%; border: 1.5px solid var(--line); border-radius: 12px;
  padding: 12px 14px; font-size: 15.5px; font-family: inherit; background: #fff;
  color: var(--ink);
}
.field textarea { min-height: 84px; resize: vertical; }
.field select:focus, .field textarea:focus, .field input:focus { outline: 2px solid var(--brand-soft); border-color: var(--brand); }
.field select:disabled, .field textarea:disabled { background: #F5F5F5; color: var(--ink-soft); }

/* ── 按鈕 ── */
.btn {
  display: inline-block; border: none; cursor: pointer;
  border-radius: 14px; padding: 14px 26px;
  font-size: 16px; font-weight: 800; font-family: inherit;
  transition: transform .1s;
  text-decoration: none; text-align: center;
}
.btn:active { transform: scale(.97); }
.btn.primary { background: var(--brand); color: #fff; }
.btn.primary:hover { background: var(--brand-dark); }
.btn.primary:disabled { opacity: .5; cursor: not-allowed; }
.btn.ghost { background: #fff; color: var(--brand); border: 1.5px solid var(--brand); }
.btn.ghost:disabled { opacity: .5; cursor: not-allowed; }
.btn.small { padding: 9px 16px; font-size: 14px; border-radius: 11px; }
.btn.block { display: block; width: 100%; }

.submit-bar {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 40;
  background: rgba(255,255,255,.95); backdrop-filter: blur(6px);
  border-top: 1px solid var(--line);
  padding: 14px 16px; display: flex; align-items: center; gap: 14px;
  justify-content: center;
}
.submit-bar .note { font-size: 14.5px; color: var(--ink-soft); }

.toast {
  position: fixed; top: 80px; left: 50%; transform: translateX(-50%);
  background: var(--ink); color: #fff; padding: 12px 24px;
  border-radius: 999px; font-size: 15px; z-index: 100;
  opacity: 0; pointer-events: none; transition: opacity .25s;
  max-width: 90vw; text-align: center;
}
.toast.show { opacity: 1; }
.toast.err { background: var(--warn); }

/* ── 準則頁 ── */
.guide-section { border-left: 5px solid var(--sys2); padding-left: 16px; margin: 20px 0 10px; }
.guide-section.s1 { border-color: var(--sys1); }
.guide-section h2 { font-size: 20px; }
.guide-section .sub { font-size: 14px; color: var(--ink-soft); }
.dna-list { list-style: none; }
.dna-list li {
  display: flex; gap: 12px; align-items: baseline;
  padding: 9px 0; border-bottom: 1px dashed var(--line); font-size: 16px;
}
.dna-list li:last-child { border-bottom: none; }
.dna-num {
  flex-shrink: 0; width: 27px; height: 27px; border-radius: 50%;
  background: var(--brand-soft); color: var(--brand);
  font-size: 13.5px; font-weight: 900;
  display: flex; align-items: center; justify-content: center;
  transform: translateY(5px);
}
.dna-en { font-size: 13px; color: var(--ink-soft); display: block; }
.score-table { width: 100%; border-collapse: collapse; font-size: 15.5px; margin-top: 8px; }
.score-table th, .score-table td { padding: 10px 12px; border-bottom: 1px solid var(--line); text-align: left; }
.score-table th { background: var(--brand-soft); color: var(--brand); font-size: 14px; }
.score-table td.pt { font-weight: 900; color: var(--brand); white-space: nowrap; }

/* ── 收件匣 ── */
.inbox-month { margin: 26px 0 10px; font-size: 14px; color: var(--accent); font-weight: 800; letter-spacing: 2px; }
.comment-box {
  background: var(--hover); border-radius: 14px; padding: 14px 18px;
  margin: 10px 0; font-size: 15.5px; border-left: 4px solid var(--accent);
}
.comment-box.enc { border-left-color: var(--sys1); }
.comment-box .kind { font-size: 13px; font-weight: 800; color: var(--ink-soft); display: block; margin-bottom: 4px; }
.empty { text-align: center; color: var(--ink-soft); padding: 40px 10px; font-size: 15.5px; }

.state-box { text-align: center; padding: 50px 20px; color: var(--ink-soft); font-size: 16px; }
.state-box h2 { color: var(--brand); font-size: 22px; margin-bottom: 8px; }

/* ── 桌機版排版 ── */
@media (min-width: 900px) {
  #memberCards { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; align-items: start; }
  #memberCards .card { margin-bottom: 0; }
}

/* ── 手機版 ── */
@media (max-width: 899px) {
  .hero-grid { grid-template-columns: 1fr; }
  .hero-card { padding: 28px 24px; }
  .hero-title { font-size: 28px; }
  .topbar { padding: 0 10px; gap: 4px; overflow-x: auto; }
  .topbar a { padding: 6px 9px; font-size: 14px; }
  .topbar .logo { font-size: 0; gap: 0; }   /* 手機只留 360 方塊，文字收起來讓分頁放得下 */
  .topbar .logo-mark { font-size: 12px; }
  .topbar .logo small, .topbar .who { display: none; }
  .section-head { font-size: 21px; }
  .hero-sub { font-size: 15px; }
  .wrap { padding: 20px 14px; }
}
