/* 手機優先：預設就是手機版面，寬螢幕只是把內容置中、限制寬度。
   名單與結算頁會被截圖貼到 LINE 群組，所以字級偏大、對比清楚。 */

:root {
  --color-primary: #1f7a4d;
  --color-text: #1d1d1f;
  --color-muted: #6b6b70;
  --color-bg: #f4f5f2;
  --color-card: #ffffff;
  --color-border: #dcdcd6;
  --radius: 12px;
}

* {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--color-bg);
  color: var(--color-text);
  font-family: system-ui, -apple-system, "PingFang TC", "Noto Sans TC", "Microsoft JhengHei",
    sans-serif;
  font-size: 18px;
  line-height: 1.6;
}

.site-header {
  background: var(--color-primary);
  padding: 12px 16px;
  padding-top: calc(12px + env(safe-area-inset-top));
}

.site-name {
  color: #fff;
  font-size: 20px;
  font-weight: 700;
  text-decoration: none;
}

.container {
  max-width: 480px;
  margin: 0 auto;
  padding: 16px;
}

.card {
  background: var(--color-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 16px;
}

h1 {
  font-size: 24px;
  margin: 0 0 8px;
}

p {
  margin: 0 0 8px;
}

.muted {
  color: var(--color-muted);
  font-size: 16px;
}

h2 {
  font-size: 20px;
  margin: 0 0 8px;
}

.site-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 4px 12px;
}

.site-nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 14px;
  font-size: 16px;
}

.site-nav a,
.link-button {
  color: #fff;
  text-decoration: none;
}

.link-button {
  background: none;
  border: 0;
  padding: 0;
  font: inherit;
  cursor: pointer;
}

.inline-form {
  display: inline;
  margin: 0;
}

/* 按鈕：手指好按，至少 44px 高。 */
.btn {
  display: inline-block;
  min-height: 44px;
  padding: 10px 18px;
  border: 0;
  border-radius: 10px;
  background: var(--color-primary);
  color: #fff;
  font: inherit;
  font-weight: 600;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
}

.btn-line {
  display: block;
  margin-top: 12px;
  background: #06c755;
}

.btn:disabled {
  background: #c9ccc6;
  color: #fff;
  cursor: not-allowed;
}

.btn-secondary {
  background: #e8ece6;
  color: var(--color-text);
}

.btn-danger {
  background: #fbe9e7;
  color: #b3261e;
}

.btn-small {
  min-height: 36px;
  padding: 6px 12px;
  font-size: 15px;
}

.form label {
  display: block;
  font-weight: 600;
  margin-top: 12px;
}

.form input,
.form textarea {
  display: block;
  width: 100%;
  margin-top: 4px;
  padding: 10px 12px;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  font: inherit;
}

.form .btn {
  margin-top: 16px;
  width: 100%;
}

.hint {
  color: var(--color-muted);
  font-size: 14px;
  margin-top: 4px;
}

.notice {
  background: #e6f4ea;
  border-radius: 8px;
  padding: 8px 12px;
}

.error {
  background: #fbe9e7;
  color: #b3261e;
  border-radius: 8px;
  padding: 8px 12px;
}

.badge {
  display: inline-block;
  padding: 0 8px;
  border-radius: 999px;
  background: #e6f4ea;
  color: var(--color-primary);
  font-size: 14px;
  font-weight: 600;
  vertical-align: middle;
}

.member-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 0;
  border-top: 1px solid var(--color-border);
}

.member-row:first-of-type {
  border-top: 0;
}

.member-actions {
  display: flex;
  gap: 8px;
}

.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.button-row .btn {
  flex: 1 1 0;
}

.form .button-row .btn {
  margin-top: 0;
}

.form select {
  display: block;
  width: 100%;
  margin-top: 4px;
  padding: 10px 12px;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  background: #fff;
  font: inherit;
}

.field-row {
  display: flex;
  gap: 12px;
}

.field-row > div {
  flex: 1 1 0;
}

.badge-muted {
  background: #ececea;
  color: var(--color-muted);
}

.badge-warn {
  background: #fff4d6;
  color: #8a5a00;
}

/* 首頁的場次卡片 */
.event-card {
  display: block;
  padding: 12px 0;
  border-top: 1px solid var(--color-border);
  color: inherit;
  text-decoration: none;
}

.event-card:first-of-type {
  border-top: 0;
}

.event-card-when {
  display: block;
  font-size: 20px;
  font-weight: 700;
}

.event-card-where {
  display: block;
  color: var(--color-muted);
  font-size: 16px;
}

.event-card-mine {
  display: block;
  margin-top: 4px;
}

/* 名單頁：會被截圖貼到 LINE 群組 */
.roster-when {
  font-size: 24px;
  font-weight: 700;
  margin: 0;
}

.roster-where {
  color: var(--color-muted);
  margin-bottom: 4px;
}

.roster-total {
  font-size: 20px;
  margin-bottom: 12px;
}

.roster-total strong {
  font-size: 32px;
  color: var(--color-primary);
}

.roster-list {
  margin: 0 0 12px;
  padding-left: 1.6em;
  font-size: 20px;
  line-height: 1.7;
}

.guest {
  color: var(--color-primary);
  font-weight: 700;
}

.roster-other {
  font-size: 16px;
}

.roster-label {
  display: inline-block;
  margin-right: 6px;
  color: var(--color-muted);
  font-weight: 600;
}

/* 結算後的名單：名字靠左、金額靠右 */
.roster-list li .roster-name {
  display: inline-block;
}

.roster-list li .roster-amount {
  float: right;
  font-variant-numeric: tabular-nums;
}

.roster-fee {
  font-size: 16px;
  margin-bottom: 4px;
}

.paid {
  color: var(--color-primary);
  font-weight: 700;
}

.collector {
  border-top: 1px solid var(--color-border);
  padding-top: 8px;
  font-size: 16px;
}

.collector p {
  margin: 0 0 4px;
}

.transfer {
  font-size: 18px;
  font-weight: 600;
  white-space: pre-line;
}

/* 結算頁的出席勾選 */
.attend-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 6px 0;
  border-top: 1px solid var(--color-border);
}

.attend-check {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  font-weight: 400;
}

/* 表單的 label/input 預設是整行寬，勾選列要蓋回來，讓勾選框和名字排在同一行 */
.form .attend-check {
  display: flex;
  margin-top: 0;
  font-weight: 400;
}

.form .attend-check input {
  display: inline-block;
  width: 22px;
  height: 22px;
  margin: 0;
}

.form .attend-row select {
  width: auto;
  margin-top: 0;
}

.unpaid-total {
  background: #fff4d6;
  border-radius: 8px;
  padding: 8px 12px;
  color: #8a5a00;
}

.unpaid-total a {
  color: inherit;
  text-decoration: none;
}

.unpaid-total strong {
  font-size: 22px;
}

a.member-name {
  color: inherit;
  text-decoration: none;
}
