/* ============================================================
   pages.css — 各頁面專屬樣式
   ============================================================ */

/* ---------------- 登入 / 品牌 ---------------- */
.hero {
  min-height: calc(100vh - 80px);
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 24px 4px 40px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 26px;
}

.brand-mark {
  width: 62px;
  height: 62px;
  border-radius: 19px;
  background: linear-gradient(145deg, #2b6fff, #0a84ff 45%, #06b6d4);
  display: grid;
  place-items: center;
  color: #fff;
  box-shadow: 0 12px 30px -10px rgba(10, 132, 255, 0.75);
  flex-shrink: 0;
}

.brand-mark svg {
  width: 32px;
  height: 32px;
  stroke-width: 1.9;
}

.brand h1 {
  font-size: 25px;
  letter-spacing: -0.03em;
  line-height: 1.15;
}

.brand .sub {
  font-size: 13px;
  color: var(--text-2);
  margin-top: 3px;
  letter-spacing: 0.02em;
}

.hero-title {
  font-size: 30px;
  font-weight: 800;
  letter-spacing: -0.035em;
  line-height: 1.28;
  margin-bottom: 12px;
}

.hero-title em {
  font-style: normal;
  background: linear-gradient(100deg, #0a84ff, #06b6d4);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero-desc {
  color: var(--text-2);
  font-size: 15px;
  line-height: 1.65;
  margin-bottom: 28px;
}

.hero-points {
  display: grid;
  gap: 12px;
  margin-bottom: 30px;
}

.hero-point {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  font-size: 14px;
  color: var(--text-2);
  line-height: 1.5;
}

.hero-point .b {
  width: 26px;
  height: 26px;
  border-radius: 9px;
  background: var(--accent-soft);
  color: var(--accent);
  display: grid;
  place-items: center;
  flex-shrink: 0;
  margin-top: -1px;
}

.hero-point .b svg {
  width: 14px;
  height: 14px;
  stroke-width: 2.4;
}

.hero-point b {
  color: var(--text);
  font-weight: 650;
}

.gsi-wrap {
  display: flex;
  justify-content: center;
  min-height: 48px;
  margin: 6px 0 14px;
}

.gsi-fallback {
  width: 100%;
}

.legal {
  text-align: center;
  font-size: 11.5px;
  color: var(--text-3);
  line-height: 1.7;
  margin-top: 18px;
}

/* ---------------- 首頁 ---------------- */
.greet {
  font-size: 13.5px;
  color: var(--text-2);
  font-weight: 600;
}

.task-card {
  position: relative;
  overflow: hidden;
}

.task-card.done {
  background: linear-gradient(180deg, var(--surface), var(--surface));
}

.task-card .task-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.task-card .task-ico {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}

.task-card .task-ico svg {
  width: 22px;
  height: 22px;
  stroke-width: 1.8;
}

.task-card .task-ico.blue {
  background: var(--accent-soft);
  color: var(--accent);
}
.task-card .task-ico.green {
  background: var(--green-soft);
  color: var(--green);
}
.task-card .task-ico.gray {
  background: var(--gray-soft);
  color: var(--gray);
}

.task-card .task-name {
  font-size: 17px;
  font-weight: 750;
  letter-spacing: -0.02em;
}

.task-card .task-due {
  font-size: 12.5px;
  color: var(--text-2);
  margin-top: 3px;
}

.countdown {
  font-size: 12.5px;
  font-weight: 700;
  padding: 5px 11px;
  border-radius: var(--radius-pill);
  background: var(--surface-3);
  color: var(--text-2);
  white-space: nowrap;
}

.countdown.urgent {
  background: var(--orange-soft);
  color: var(--orange);
}

.countdown.over {
  background: var(--red-soft);
  color: var(--red);
}

.summary-line {
  font-family: var(--mono);
  font-size: 13px;
  line-height: 1.65;
  color: var(--text-2);
  background: var(--surface-2);
  border-radius: 12px;
  padding: 11px 13px;
  word-break: break-word;
  margin-top: 10px;
}

.status-steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-top: 14px;
}

.step-btn {
  height: 46px;
  border-radius: 14px;
  background: var(--surface-2);
  border: 1.5px solid var(--line);
  font-size: 14px;
  font-weight: 700;
  color: var(--text-2);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: all 0.18s var(--ease);
}

.step-btn svg {
  width: 16px;
  height: 16px;
}

.step-btn.on {
  background: var(--green-soft);
  border-color: var(--green);
  color: var(--green);
}

.step-btn.next {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: var(--accent);
}

.step-btn:disabled {
  opacity: 0.4;
}

/* ---------------- 回報表單 ---------------- */
.form-section {
  margin-bottom: 20px;
}

.form-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-soft);
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.form-card > .sec-label {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--text-2);
  letter-spacing: 0.03em;
}

.two-col {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 10px;
}

/* 左右欄內容長度不對稱時使用，避免中文地名被截斷 */
.two-col.wide-left {
  grid-template-columns: minmax(0, 1.45fr) minmax(0, 1fr);
}

.two-col.wide-right {
  grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr);
}

.three-col {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 8px;
}

.last-record {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 15px;
  border-radius: 16px;
  background: var(--accent-soft);
  border: 1px solid transparent;
}

.last-record .lr-main {
  flex: 1;
  min-width: 0;
}

.last-record .lr-t {
  font-size: 12px;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: 0.02em;
}

.last-record .lr-d {
  font-size: 13.5px;
  color: var(--text);
  margin-top: 2px;
  font-weight: 600;
}

/* 班次選擇 */
.train-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1.5px solid var(--line);
  background: var(--surface-2);
  margin-bottom: 8px;
  transition: all 0.16s;
}

.train-item:active {
  transform: scale(0.985);
}

.train-item.on {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.train-item .no {
  font-family: var(--mono);
  font-weight: 800;
  font-size: 15px;
  letter-spacing: -0.02em;
  min-width: 46px;
}

.train-item .times {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--mono);
  font-size: 15px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.train-item .arrow {
  color: var(--text-3);
  font-size: 12px;
}

.train-item .meta {
  margin-left: auto;
  text-align: right;
  font-size: 11.5px;
  color: var(--text-2);
  line-height: 1.4;
}

/* 症狀 chips */
.symptom-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

/* ---------------- 看板 ---------------- */
.board-squad {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-soft);
  overflow: hidden;
  margin-bottom: 12px;
}

.board-squad-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 13px 16px;
  background: var(--surface-2);
  border-bottom: 1px solid var(--line);
  font-size: 13.5px;
  font-weight: 700;
}

.board-squad-head .cnt {
  font-size: 12px;
  color: var(--text-2);
  font-weight: 600;
}

.board-row {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
  min-height: 56px;
}

.board-row:last-child {
  border-bottom: 0;
}

.board-row:active {
  background: var(--surface-2);
}

.board-row .who {
  flex: 1;
  min-width: 0;
}

.board-row .lbl {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--text-3);
  font-weight: 600;
  letter-spacing: 0.02em;
}

.board-row .nm {
  font-size: 14.5px;
  font-weight: 650;
  letter-spacing: -0.01em;
  line-height: 1.25;
}

.board-row .info {
  font-size: 11.5px;
  color: var(--text-2);
  margin-top: 2px;
  line-height: 1.4;
}

.board-row.missing {
  background: linear-gradient(90deg, var(--gray-soft), transparent 65%);
}

.board-row.late-row {
  background: linear-gradient(90deg, var(--red-soft), transparent 65%);
}

/* 長條統計 */
.bar-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 9px;
  font-size: 12.5px;
}

.bar-row .bl {
  width: 44px;
  flex-shrink: 0;
  font-weight: 650;
  color: var(--text-2);
}

.bar-track {
  flex: 1;
  height: 20px;
  border-radius: 7px;
  background: var(--surface-3);
  overflow: hidden;
  display: flex;
}

.bar-track > i {
  height: 100%;
  transition: width 0.5s var(--ease);
}

.bar-track > i.g {
  background: var(--green);
}
.bar-track > i.b {
  background: var(--accent);
}
.bar-track > i.o {
  background: var(--orange);
}
.bar-track > i.p {
  background: var(--purple);
}
.bar-track > i.r {
  background: var(--red);
}

.bar-row .bn {
  width: 46px;
  text-align: right;
  font-variant-numeric: tabular-nums;
  font-weight: 700;
}

/* ---------------- 管理後台 ---------------- */
.admin-tabs {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding-bottom: 4px;
  margin-bottom: 16px;
  scrollbar-width: none;
}

.admin-tabs::-webkit-scrollbar {
  display: none;
}

.admin-tabs button {
  flex: 0 0 auto;
  height: 36px;
  padding: 0 15px;
  border-radius: var(--radius-pill);
  background: var(--surface-2);
  border: 1px solid var(--line);
  font-size: 13.5px;
  font-weight: 650;
  color: var(--text-2);
}

.admin-tabs button.on {
  background: var(--text);
  color: var(--bg);
  border-color: transparent;
}

/* ---------------- 我的 ---------------- */
.profile-card {
  display: flex;
  align-items: center;
  gap: 15px;
  padding: 20px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-soft);
}

.profile-card img,
.profile-card .ph {
  width: 58px;
  height: 58px;
  border-radius: 50%;
  object-fit: cover;
  background: var(--surface-3);
  flex-shrink: 0;
}

.profile-card .ph {
  display: grid;
  place-items: center;
  font-size: 22px;
  font-weight: 800;
  color: var(--text-2);
  background: var(--accent-soft);
}

.profile-card .nm {
  font-size: 19px;
  font-weight: 750;
  letter-spacing: -0.02em;
}

.profile-card .rl {
  font-size: 12.5px;
  color: var(--text-2);
  margin-top: 3px;
}

/* ---------------- 邀請碼 ---------------- */
.invite-code {
  font-family: var(--mono);
  font-size: 34px;
  font-weight: 800;
  letter-spacing: 0.18em;
  text-align: center;
  padding: 20px 0;
  color: var(--accent);
}

/* ---------------- 安裝橫幅 ---------------- */
#install-banner {
  position: fixed;
  left: 50%;
  transform: translate(-50%, 140%);
  bottom: calc(env(safe-area-inset-bottom) + 12px);
  width: min(calc(100% - 24px), 500px);
  z-index: 150;
  transition: transform 0.42s var(--ease);
}

#install-banner.show {
  transform: translate(-50%, 0);
}

/* 離線提示 */
.offline-bar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  padding: calc(env(safe-area-inset-top) + 6px) 16px 6px;
  background: var(--orange);
  color: #fff;
  font-size: 12.5px;
  font-weight: 650;
  text-align: center;
  z-index: 300;
}
