/* TuoTuo LIFF — gallery / editorial register.
 *
 * Mirrors the design language of the marketing homepage:
 *   - paper cream background grounds the whole UI
 *   - deep ink text, serif headings
 *   - brand orange as the single accent (replaces the previous LINE green)
 *   - LINE green retained ONLY as a success / "active" signal
 *   - hairline rules instead of card drop-shadows
 *   - tool-level information density preserved (button heights, form spacing
 *     stay close to the previous SaaS layout — we borrowed the look, not the
 *     marketing site's luxurious leading)
 */

/* Noto Serif TC for display / headings only. Google Fonts auto-subsets
 * via the `text=` API, but the standard css2 endpoint already serves
 * per-unicode-range slices so the browser only fetches what's needed. */
@import url("https://fonts.googleapis.com/css2?family=Noto+Serif+TC:wght@500;700&display=swap");

:root {
  /* ---------- Palette ---------- */
  --ink: #1a1a1a;
  --ink-deeper: #0c0a08;     /* display type */
  --ink-soft: #4a4744;
  --ink-muted: #8a857d;
  --ink-faint: #cdc7bb;
  --ink-rule: #1a1a1a;
  --ink-rule-soft: #d6d0c1;

  --paper: #fbf8f0;
  --paper-warm: #f4ebd9;
  --paper-deep: #ede2c7;
  --paper-card: #fffdf6;
  --paper-ink: #0c0a08;

  --brand-orange: #ee8a14;
  --brand-orange-deep: #c46c00;
  --brand-orange-soft: #fbd9a8;
  --brand-yellow: #ffd935;
  --brand-yellow-soft: #fff2a0;

  /* Success / active state retains a warm green tone — used sparingly. */
  --success: #2f7d4f;
  --success-soft: #e6efe6;
  --warning: #b56516;
  --warning-soft: #fbd9a8;
  --danger: #a02929;
  --danger-soft: #f4d6d0;

  /* ---------- Typography ---------- */
  --font-serif: "Noto Serif TC", "Source Han Serif TC", "PMingLiU", "新細明體", "Times New Roman", serif;
  --font-sans: "Noto Sans TC", "Source Han Sans TC", "PingFang TC", "Microsoft JhengHei", "微軟正黑體", -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-pill: 999px;
}

/* ---------- Base ---------- */
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font-sans);
  background: var(--paper);
  color: var(--ink-deeper);
  -webkit-tap-highlight-color: transparent;
}
h1, h2, h3, h4, h5 { font-family: var(--font-serif); color: var(--ink-deeper); }

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

/* ---------- App header ---------- */
.app-header {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 16px;
  background: var(--paper);
  border-bottom: 1px solid var(--ink-rule-soft);
  position: sticky; top: 0; z-index: 50;
}
.app-header img { width: 36px; height: 36px; border-radius: 50%; background: var(--ink-faint); }
.app-header h1 {
  font-size: 18px; margin: 0; font-weight: 700;
  letter-spacing: -0.01em;
}

/* Two-line header (home page: display_name + subtitle). */
.header-titles { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.header-display-name {
  font-family: var(--font-serif);
  font-size: 18px; font-weight: 700; margin: 0;
  letter-spacing: -0.01em;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%;
}
.header-subtitle { font-size: 11px; color: var(--ink-muted); letter-spacing: 0.12em; text-transform: uppercase; line-height: 1.2; }

/* Avatar button + dropdown (F7 edit-profile entry). */
.user-avatar-btn {
  padding: 0; border: none; background: transparent; cursor: pointer;
  border-radius: 50%; line-height: 0;
}
.user-avatar-btn:active { transform: scale(0.94); }
.profile-menu {
  position: absolute; top: 56px; left: 12px; min-width: 180px;
  background: var(--paper-card);
  border: 1px solid var(--ink-rule-soft); border-radius: var(--radius-md);
  box-shadow: 0 8px 20px rgba(12,10,8,0.08);
  padding: 6px 0;
  display: none; z-index: 100;
}
.profile-menu.open { display: block; }
.profile-menu-name {
  padding: 10px 16px 6px; font-size: 13px; color: var(--ink-deeper);
  font-weight: 600; border-bottom: 1px solid var(--ink-rule-soft); word-break: break-word;
}
.profile-menu-item {
  display: block; width: 100%; padding: 10px 16px; text-align: left;
  background: transparent; border: none; font-size: 14px;
  color: var(--brand-orange-deep); cursor: pointer;
}
.profile-menu-item:hover, .profile-menu-item:active { background: var(--paper-warm); }

/* Profile-page asset upload progress (slim bar under each photo button). */
.profile-asset-progress { height: 4px; background: var(--paper-deep); border-radius: var(--radius-pill); overflow: hidden; }
.profile-asset-progress-bar { height: 100%; width: 0%; background: var(--brand-orange); transition: width 0.18s ease; }

/* ---------- Cards ---------- */
.card {
  background: var(--paper-card);
  border: 1px solid var(--ink-rule-soft);
  border-radius: var(--radius-lg);
  padding: 16px; margin-bottom: 12px;
}
.card h2 { margin: 0 0 4px; font-size: 17px; font-weight: 700; letter-spacing: -0.01em; }
.card .meta { color: var(--ink-muted); font-size: 13px; }
.card .actions { display: flex; gap: 8px; margin-top: 12px; }
.card .actions button { flex: 1; }

.empty { text-align: center; padding: 48px 16px; color: var(--ink-muted); }
.empty .emoji { font-size: 48px; margin-bottom: 8px; }

/* ---------- Buttons ---------- */
button {
  appearance: none; border: none; cursor: pointer;
  border-radius: var(--radius-md); padding: 10px 14px;
  font-size: 15px; font-weight: 500; font-family: inherit;
  transition: opacity 0.15s, background 0.15s, color 0.15s, border-color 0.15s;
}
button:disabled { opacity: 0.45; cursor: not-allowed; }

.btn-primary {
  background: var(--brand-orange);
  color: var(--paper-card);
  border: 1px solid var(--brand-orange);
}
.btn-primary:hover:not(:disabled) { background: var(--brand-orange-deep); border-color: var(--brand-orange-deep); }

.btn-secondary {
  background: var(--paper-card);
  color: var(--ink-deeper);
  border: 1px solid var(--ink-rule-soft);
}
.btn-secondary:hover:not(:disabled) { background: var(--paper-warm); border-color: var(--ink-muted); }

.btn-danger {
  background: var(--danger);
  color: var(--paper-card);
  border: 1px solid var(--danger);
}

.btn-link {
  background: transparent;
  color: var(--ink-deeper);
  padding: 8px;
}
.btn-link:hover:not(:disabled) { color: var(--brand-orange-deep); }

/* ---------- FAB (large pill bottom-center, e.g. 建立新的製作) ---------- */
.fab {
  position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%);
  background: var(--ink-deeper); color: var(--paper);
  border-radius: var(--radius-pill);
  padding: 14px 28px; font-size: 15px; font-weight: 600;
  letter-spacing: 0.04em;
  box-shadow: 0 8px 22px rgba(12,10,8,0.18);
  text-decoration: none;
  border: 1px solid var(--ink-deeper);
}
.fab:visited, .fab:active, .fab:hover { text-decoration: none; color: var(--paper); }

/* Circular bottom-right FAB (e.g. crews `+`) */
.fab-add {
  position: fixed; right: 20px; bottom: 24px;
  width: 56px; height: 56px; border-radius: 50%;
  background: var(--brand-orange); color: var(--paper-card);
  font-size: 30px; font-weight: 300; line-height: 1;
  border: none; padding: 0; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
  box-shadow: 0 8px 20px rgba(196,108,0,0.30);
  z-index: 40;
  transition: transform 0.12s, opacity 0.18s, background 0.15s;
}
.fab-add:hover { background: var(--brand-orange-deep); transform: scale(1.05); }
.fab-add:active { transform: scale(0.92); }
.fab-add[hidden] { display: none; }

/* ---------- Swipe-to-delete crew row ---------- */
.crew-row-wrap {
  position: relative;
  margin-bottom: 12px;
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--danger);
}
.crew-row-wrap > .card {
  margin-bottom: 0;
  position: relative;
  transform: translateX(0);
  transition: transform 0.22s ease;
  will-change: transform;
  z-index: 1;
}
.crew-row-wrap.swiping > .card { transition: none; }
.crew-row-wrap.swiped > .card { transform: translateX(-88px); }
.crew-swipe-delete {
  position: absolute; top: 0; right: 0; bottom: 0;
  width: 88px;
  display: flex; align-items: center; justify-content: center;
  color: var(--paper-card); font-size: 14px; font-weight: 600;
  background: var(--danger); border: none; padding: 0;
  cursor: pointer; user-select: none;
  z-index: 0;
}
.crew-swipe-delete:active { background: #8a2222; }

/* ---------- Header icon button ---------- */
.header-icon-btn {
  margin-left: auto;
  width: 36px; height: 36px; border-radius: 50%;
  background: transparent; color: var(--ink-soft);
  font-size: 20px; padding: 0;
  display: inline-flex; align-items: center; justify-content: center;
  transition: transform 0.12s, opacity 0.15s, background 0.15s;
}
.header-icon-btn:hover { background: var(--paper-warm); }
.header-icon-btn:active { transform: scale(0.85); }
.header-icon-btn:disabled { opacity: 0.4; cursor: default; }

/* ---------- Top progress bar (indeterminate) ---------- */
.top-progress {
  position: fixed; top: 0; left: 0; right: 0;
  height: 3px; pointer-events: none; z-index: 1000;
  overflow: hidden;
  opacity: 0; transition: opacity 0.2s;
}
.top-progress.active { opacity: 1; }
.top-progress::before {
  content: ''; position: absolute; top: 0; bottom: 0;
  left: -40%; width: 40%;
  background: linear-gradient(90deg, transparent, var(--brand-orange) 40%, var(--brand-orange) 60%, transparent);
}
.top-progress.active::before { animation: top-progress-slide 1.1s ease-in-out infinite; }
@keyframes top-progress-slide {
  0%   { left: -40%; }
  100% { left: 100%; }
}

/* Subtle fade for list during refresh */
#list-active.refreshing, #list-past.refreshing { opacity: 0.55; transition: opacity 0.15s; }

/* ---------- Production hero (detail page) ---------- */
.prod-hero {
  background: var(--paper-deep);
  color: var(--ink-deeper);
  border: 1px solid var(--ink-rule-soft);
  border-radius: var(--radius-lg);
  padding: 22px 20px;
  margin-bottom: 16px;
  position: relative;
}
.prod-hero-status { position: absolute; top: 16px; right: 16px; }
.prod-hero-status .status-badge {
  background: var(--paper-card);
  color: var(--ink-deeper);
  border: 1px solid var(--ink-rule-soft);
}
.prod-hero-name {
  font-family: var(--font-serif);
  margin: 0 0 6px;
  font-size: 26px; font-weight: 700;
  line-height: 1.22; letter-spacing: -0.02em;
  padding-right: 80px;
}
.prod-hero-team {
  font-size: 14px; font-weight: 500;
  color: var(--ink-soft); margin-bottom: 8px;
}
.prod-hero-meta { font-size: 13px; color: var(--ink-soft); line-height: 1.7; }
.prod-hero .actions { display: flex; gap: 8px; margin-top: 16px; }
.prod-hero .actions button {
  flex: 1;
  background: var(--paper-card);
  color: var(--ink-deeper);
  border: 1px solid var(--ink-rule-soft);
}
.prod-hero .actions button:hover { background: var(--paper-warm); }

.producer-controls-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 16px;
}
.producer-controls-grid button {
  flex: 0 0 calc((100% - 16px) / 3);
  min-width: 0;
  white-space: nowrap;
  background: var(--paper-card);
  color: var(--ink-deeper);
  border: 1px solid var(--ink-rule-soft);
}
.producer-controls-grid button:hover { background: var(--paper-warm); }

/* ---------- F10 製作期程 ---------- */

.schedule-entry-link {
  display: block;
  margin: 12px 0 16px;
  padding: 14px 16px;
  background: var(--paper-card);
  border: 1px solid var(--ink-rule-soft);
  border-radius: var(--radius-lg);
  font-size: 15px;
  font-weight: 600;
  color: var(--ink-deeper);
  text-decoration: none;
}
.schedule-entry-link:hover { background: var(--paper-warm); }

/* Rounded mode switch (預覽 / 編輯) */
.mode-toggle-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin: 6px 0 16px;
  font-size: 13px;
  color: var(--ink-muted);
}
.mode-toggle-wrap .mode-label { user-select: none; }
.mode-switch {
  position: relative;
  display: inline-block;
  width: 44px; height: 24px;
}
.mode-switch input { opacity: 0; width: 0; height: 0; }
.mode-track {
  position: absolute; top: 0; left: 0; right: 0; bottom: 0;
  background: var(--ink-faint);
  border-radius: var(--radius-pill);
  transition: background 0.18s;
  cursor: pointer;
}
.mode-thumb {
  position: absolute; top: 2px; left: 2px;
  width: 20px; height: 20px;
  background: var(--paper-card); border-radius: 50%;
  box-shadow: 0 1px 3px rgba(12,10,8,0.18);
  transition: left 0.18s;
}
.mode-switch input:checked + .mode-track { background: var(--brand-orange); }
.mode-switch input:checked + .mode-track .mode-thumb { left: 22px; }
body.schedule-edit-mode #label-edit { color: var(--brand-orange-deep); font-weight: 600; }
body:not(.schedule-edit-mode) #label-preview { color: var(--ink-deeper); font-weight: 600; }

/* Month switcher */
.month-bar {
  display: flex; align-items: center; justify-content: space-between;
  background: var(--paper-card); border: 1px solid var(--ink-rule-soft);
  border-radius: var(--radius-lg);
  padding: 8px 12px; margin-bottom: 12px;
}
.month-arrow {
  background: transparent; color: var(--ink-soft);
  width: 32px; height: 32px; border-radius: 50%;
  font-size: 22px; line-height: 1; padding: 0;
  display: inline-flex; align-items: center; justify-content: center;
}
.month-arrow:hover { background: var(--paper-warm); }
.month-current {
  flex: 1; text-align: center;
  font-family: var(--font-serif);
  font-size: 16px; font-weight: 700; color: var(--ink-deeper);
  letter-spacing: -0.01em;
}

/* Event card */
.event-card {
  position: relative;
  background: var(--paper-card); border: 1px solid var(--ink-rule-soft);
  border-radius: var(--radius-lg);
  padding: 14px 16px; margin-bottom: 10px;
}
.event-card.event-past { opacity: 0.55; }
.event-card-editable { cursor: pointer; }
.event-card-editable:hover { background: var(--paper-warm); }
.event-date {
  font-size: 11px;
  color: var(--brand-orange-deep);
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 6px;
}
.event-title {
  font-family: var(--font-serif);
  font-size: 17px; font-weight: 700;
  color: var(--ink-deeper);
  letter-spacing: -0.01em;
  margin-bottom: 6px; padding-right: 28px;
}
.event-desc {
  font-size: 13px; color: var(--ink-soft); line-height: 1.65;
  margin-bottom: 6px;
  white-space: pre-wrap; word-break: break-word;
}
.event-targets {
  font-size: 12px; color: var(--ink-muted);
  border-top: 1px solid var(--ink-rule-soft); padding-top: 6px; margin-top: 6px;
}
.event-remove {
  position: absolute; top: 8px; right: 8px;
  width: 28px; height: 28px; border-radius: 50%;
  background: var(--danger-soft); color: var(--danger);
  font-size: 20px; font-weight: 600; line-height: 1;
  padding: 0; border: none; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
}
.event-remove:hover { background: #ecbcb4; }

/* Notification chips on event cards */
.event-notify-chips {
  display: flex; flex-wrap: wrap; gap: 6px;
  margin-top: 8px;
}
.notify-chip {
  display: inline-block;
  padding: 2px 10px;
  background: var(--paper-warm);
  color: var(--brand-orange-deep);
  border: 1px solid var(--brand-orange-soft);
  border-radius: var(--radius-pill);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
}

/* Per-event notify pref checkbox row (in event modal) */
.notify-prefs-row {
  display: flex; flex-wrap: wrap; gap: 16px;
  margin-top: 4px;
}
.notify-pref-chk {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 14px; cursor: pointer;
}
.notify-pref-chk input { width: 16px; height: 16px; accent-color: var(--brand-orange); }

/* Notification-prefs modal sections */
.prefs-section {
  border: 1px solid var(--ink-rule-soft);
  border-radius: var(--radius-md);
  padding: 12px;
  margin-bottom: 10px;
  background: var(--paper);
}
.prefs-section-title {
  font-family: var(--font-serif);
  font-size: 14px;
  font-weight: 700;
  color: var(--brand-orange-deep);
  letter-spacing: -0.01em;
  margin-bottom: 8px;
}
.prefs-row {
  display: flex; flex-wrap: wrap; align-items: center;
  gap: 6px;
  font-size: 14px; color: var(--ink-deeper);
}
.prefs-row input[type="number"] {
  width: 70px; padding: 6px 8px;
  border: 1px solid var(--ink-rule-soft); border-radius: var(--radius-sm);
  font-size: 14px; text-align: center;
  background: var(--paper-card); color: var(--ink-deeper);
}
.prefs-row select {
  padding: 6px 8px;
  border: 1px solid var(--ink-rule-soft); border-radius: var(--radius-sm);
  font-size: 14px; background: var(--paper-card); color: var(--ink-deeper);
}

/* Reimbursements hub tiles */
.reim-hub-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 16px;
}
.reim-tile {
  background: var(--paper-card);
  border: 1px solid var(--ink-rule-soft);
  border-radius: var(--radius-lg);
  padding: 18px 14px;
  text-align: left;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-height: 110px;
  color: var(--ink-deeper);
  font-family: inherit;
  transition: transform 0.12s, background 0.15s;
}
.reim-tile:hover { background: var(--paper-warm); transform: translateY(-1px); }
.reim-tile:active { transform: translateY(0); }
.reim-tile-primary {
  background: var(--brand-orange);
  border-color: var(--brand-orange);
  color: var(--paper-card);
}
.reim-tile-primary:hover { background: var(--brand-orange-deep); }
.reim-tile-icon { font-size: 24px; line-height: 1; }
.reim-tile-title {
  font-family: var(--font-serif);
  font-size: 16px; font-weight: 700; letter-spacing: -0.01em;
}
.reim-tile-meta { font-size: 12px; font-weight: 400; opacity: 0.78; }
.reim-pending-badge {
  display: inline-block; margin-left: 6px;
  padding: 1px 8px;
  background: var(--brand-yellow-soft);
  color: var(--warning);
  border-radius: var(--radius-pill);
  font-size: 11px; font-weight: 700;
  vertical-align: middle;
}

/* Toolbar row below the sticky header */
.page-toolbar {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin: 12px 0 16px;
}
.page-toolbar button {
  flex: 1 1 auto;
  min-width: 0;
  padding: 10px 12px;
  font-size: 14px;
}

/* Production list — sections */
.section-heading {
  font-family: var(--font-serif);
  font-size: 15px; color: var(--ink-deeper); font-weight: 700;
  letter-spacing: -0.01em;
  margin: 20px 4px 12px;
  display: flex; align-items: center; gap: 8px;
}
.section-count {
  background: var(--paper-deep); color: var(--ink-soft);
  border: 1px solid var(--ink-rule-soft);
  border-radius: var(--radius-pill); padding: 2px 10px;
  font-size: 11px; font-weight: 600;
  font-family: var(--font-sans);
}

/* Production card on the home list */
.prod-card {
  position: relative;
  background: var(--paper-card);
  border: 1px solid var(--ink-rule-soft);
  border-radius: var(--radius-lg);
  padding: 16px 16px 16px 20px;
  margin-bottom: 12px;
  border-left: 4px solid var(--ink-faint);
  cursor: pointer;
  transition: background 0.12s, transform 0.1s;
}
.prod-card:hover { background: var(--paper-warm); }
.prod-card:active { transform: scale(0.99); }
.prod-card.status-active   { border-left-color: var(--brand-orange); }
.prod-card.status-upcoming { border-left-color: var(--ink-deeper); }
.prod-card.status-ended    { border-left-color: var(--ink-faint); opacity: 0.85; }

.prod-card .top {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 8px;
  margin-bottom: 6px;
}
.prod-card h2 {
  font-family: var(--font-serif);
  margin: 0; font-size: 18px; font-weight: 700;
  letter-spacing: -0.01em; line-height: 1.3; flex: 1;
}
.prod-card .chevron {
  flex-shrink: 0; color: var(--ink-muted); font-size: 18px;
  align-self: center; padding-left: 4px;
}
.prod-card .status-badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 2px 8px; border-radius: var(--radius-pill);
  font-size: 10px; font-weight: 600; flex-shrink: 0;
  letter-spacing: 0.06em;
}
.status-badge.active   { background: var(--success-soft); color: var(--success); }
.status-badge.upcoming { background: var(--paper-deep); color: var(--ink-deeper); }
.status-badge.ended    { background: var(--paper-warm); color: var(--ink-muted); }
.prod-card .producer-tag-inline {
  display: inline-block; margin-left: 6px;
  padding: 1px 6px;
  background: var(--success-soft); color: var(--success);
  border-radius: var(--radius-sm);
  font-size: 10px; font-weight: 600;
  vertical-align: middle;
}
.prod-card .actions { margin-top: 10px; }
.prod-card .meta-icon {
  display: flex; align-items: center; gap: 8px;
  color: var(--ink-soft); font-size: 13px;
  padding: 3px 0;
}
.prod-card .meta-icon-glyph {
  display: inline-flex; align-items: center; justify-content: center;
  width: 20px; flex-shrink: 0;
  font-size: 14px; line-height: 1;
}

/* ---------- Forms ---------- */
.form-group { margin-bottom: 16px; }
.form-group label {
  display: block;
  font-size: 12px; color: var(--ink-soft);
  margin-bottom: 6px; font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.form-group label .required { color: var(--brand-orange-deep); text-transform: none; }
.form-group input, .form-group select, .form-group textarea {
  width: 100%; padding: 12px;
  font-size: 16px;        /* 16px 防止 iOS 自動縮放 */
  font-family: inherit;
  border: 1px solid var(--ink-rule-soft); border-radius: var(--radius-md);
  background: var(--paper-card); color: var(--ink-deeper);
}
.form-group input:focus, .form-group select:focus, .form-group textarea:focus {
  outline: none;
  border-color: var(--ink-deeper);
  box-shadow: 0 0 0 3px rgba(238,138,20,0.15);
}
.form-group input:disabled { background: var(--paper-warm); color: var(--ink-muted); }
.form-group .hint { font-size: 12px; color: var(--ink-muted); margin-top: 4px; }
.form-group .error-msg { font-size: 12px; color: var(--danger); margin-top: 4px; display: none; }
.form-group.error .error-msg { display: block; }
.form-group.error input, .form-group.error select { border-color: var(--danger); }

/* In-page section grouping label (form pages: 基本資料 / 支付資料 …).
 * Not a headline — these are categorical markers. Sans-serif weighted, with
 * a short orange seal bar on the left to echo the marketing site's mark. */
.section-title {
  font-family: var(--font-sans);
  font-size: 13px; color: var(--ink-deeper); font-weight: 700;
  margin: 24px 0 12px;
  letter-spacing: 0.06em;
  display: flex;
  align-items: center;
  gap: 8px;
}
.section-title::before {
  content: '';
  display: inline-block;
  width: 16px; height: 2px;
  background: var(--brand-orange);
}
.row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

/* Team-suggest dropdown (create.html) */
.team-suggestions {
  background: var(--paper-card);
  border: 1px solid var(--ink-rule-soft); border-radius: var(--radius-md);
  margin-top: 4px; max-height: 200px; overflow-y: auto;
}
.team-suggestions div {
  padding: 12px; cursor: pointer;
  border-bottom: 1px solid var(--ink-rule-soft);
}
.team-suggestions div:last-child { border-bottom: none; }
.team-suggestions div:hover, .team-suggestions div.active { background: var(--paper-warm); }
.team-suggestions .new { color: var(--brand-orange-deep); font-weight: 600; }

/* ---------- Toast ---------- */
.toast {
  position: fixed; bottom: 80px; left: 50%; transform: translateX(-50%);
  background: var(--ink-deeper); color: var(--paper);
  padding: 10px 18px; border-radius: var(--radius-pill);
  font-size: 14px; z-index: 1000;
  animation: toast-in 0.2s ease-out;
}
.toast.error { background: var(--danger); }
@keyframes toast-in { from { opacity: 0; transform: translate(-50%, 10px); } to { opacity: 1; transform: translate(-50%, 0); } }

/* ---------- Loading / spinner ---------- */
.loading { text-align: center; padding: 40px; color: var(--ink-muted); }
.spinner {
  width: 24px; height: 24px;
  border: 3px solid var(--paper-deep);
  border-top-color: var(--brand-orange);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  display: inline-block; vertical-align: middle;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Sticky bottom action bar (form pages) ---------- */
.actions-bar {
  position: fixed; bottom: 0; left: 0; right: 0;
  background: var(--paper);
  padding: 12px 16px;
  border-top: 1px solid var(--ink-rule-soft);
  display: flex; gap: 8px;
}
.actions-bar button { flex: 1; }

/* ---------- Member list ---------- */
.member-row {
  display: flex; align-items: center; gap: 12px;
  padding: 12px;
  background: var(--paper-card);
  border: 1px solid var(--ink-rule-soft);
  border-radius: var(--radius-md);
  margin-bottom: 8px;
}
.member-avatar { width: 36px; height: 36px; border-radius: 50%; background: var(--ink-faint); flex-shrink: 0; }
.member-info { flex: 1; min-width: 0; }
.member-info .role { font-size: 13px; color: var(--ink-muted); }
.member-info .name { font-size: 15px; font-weight: 600; color: var(--ink-deeper); }
.member-info .name .producer-tag {
  display: inline-block; margin-left: 6px;
  padding: 2px 6px;
  background: var(--success-soft); color: var(--success);
  border-radius: var(--radius-sm);
  font-size: 11px; font-weight: 600;
}
.member-info .name .cap-tag {
  display: inline-block; margin-left: 6px;
  padding: 2px 8px;
  background: var(--paper-warm); color: var(--brand-orange-deep);
  border: 1px solid var(--brand-orange-soft);
  border-radius: var(--radius-pill);
  font-size: 11px; font-weight: 600;
  letter-spacing: 0.04em;
}
.member-actions { display: flex; gap: 6px; }
.member-actions button { padding: 6px 10px; font-size: 13px; }

/* Hamburger action menu on member row */
.member-menu { position: relative; flex-shrink: 0; }
.hamburger-btn {
  width: 36px; height: 36px; border-radius: var(--radius-md);
  background: var(--paper-warm); color: var(--ink-soft);
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; padding: 0;
  border: 1px solid var(--ink-rule-soft);
}
.hamburger-btn:hover { background: var(--paper-deep); }
.hamburger-popup {
  position: absolute; top: 100%; right: 0; margin-top: 6px;
  background: var(--paper-card); border-radius: var(--radius-md);
  box-shadow: 0 8px 24px rgba(12,10,8,0.12);
  min-width: 140px; z-index: 50;
  border: 1px solid var(--ink-rule-soft); overflow: hidden;
}
.hamburger-popup button {
  display: block; width: 100%; text-align: left;
  background: var(--paper-card); color: var(--ink-deeper);
  padding: 12px 16px; font-size: 14px; border-radius: 0; border: none;
}
.hamburger-popup button:hover { background: var(--paper-warm); }
.hamburger-popup button.danger { color: var(--danger); }
.hamburger-popup button.warn { color: var(--warning); }
.hamburger-popup button + button { border-top: 1px solid var(--ink-rule-soft); }

/* ---------- Budget cards ---------- */
.budget-card { padding: 16px; }
.budget-row {
  display: flex; justify-content: space-between; align-items: baseline;
  padding: 6px 0; font-size: 14px; color: var(--ink-soft);
}
.budget-row b {
  font-size: 16px; color: var(--ink-deeper);
  font-variant-numeric: tabular-nums;
}
.budget-row.remaining {
  border-top: 1px solid var(--ink-rule-soft);
  padding-top: 10px; margin-top: 4px;
}
.budget-row.remaining b {
  color: var(--brand-orange-deep); font-size: 19px; font-weight: 700;
  font-family: var(--font-serif);
  letter-spacing: -0.01em;
}

/* Member row budget snippet (producer view) */
.member-budget { font-size: 12px; color: var(--ink-muted); margin-top: 4px; display: flex; gap: 8px; flex-wrap: wrap; }
.member-budget span { background: var(--paper-warm); padding: 2px 6px; border-radius: var(--radius-sm); font-variant-numeric: tabular-nums; }
.member-budget span.remaining { background: var(--success-soft); color: var(--success); }
.member-actions .btn-warn { background: var(--warning); color: var(--paper-card); border: 1px solid var(--warning); }

/* Horizontal category tabs (approve / history) */
.category-tabs {
  display: flex; gap: 8px;
  overflow-x: auto; padding: 4px 0 12px;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.category-tabs::-webkit-scrollbar { display: none; }
.category-tabs button {
  padding: 6px 14px;
  background: var(--paper-card); color: var(--ink-soft);
  border: 1px solid var(--ink-rule-soft); border-radius: var(--radius-pill);
  font-size: 13px; white-space: nowrap; flex-shrink: 0;
}
.category-tabs button.active {
  background: var(--ink-deeper); color: var(--paper-card); border-color: var(--ink-deeper);
}
.category-tabs button .count {
  display: inline-block; margin-left: 4px;
  font-size: 11px; opacity: 0.85;
}

/* Search box */
.search-box { margin-bottom: 12px; }
.search-box input {
  width: 100%; padding: 12px 14px;
  font-size: 16px;
  border: 1px solid var(--ink-rule-soft);
  border-radius: var(--radius-md);
  background: var(--paper-card); color: var(--ink-deeper);
}
.search-box input:focus { outline: none; border-color: var(--ink-deeper); box-shadow: 0 0 0 3px rgba(238,138,20,0.15); }

/* ---------- Modal ---------- */
.modal-backdrop {
  position: fixed; inset: 0;
  background: rgba(12,10,8,0.42);
  display: flex; align-items: flex-end; justify-content: center;
  z-index: 999; animation: fade-in 0.15s ease-out;
}
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
.modal {
  background: var(--paper-card);
  border: 1px solid var(--ink-rule-soft);
  border-bottom: none;
  width: 100%; border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  padding: 20px 16px; max-height: 80vh; overflow-y: auto;
  animation: slide-up 0.2s ease-out;
}
@keyframes slide-up { from { transform: translateY(100%); } to { transform: translateY(0); } }
.modal h3 {
  font-family: var(--font-serif);
  margin: 0 0 16px; font-size: 19px; font-weight: 700;
  letter-spacing: -0.01em;
}
.modal .close-x { position: absolute; top: 12px; right: 12px; background: transparent; padding: 6px 10px; }
.invite-link-box {
  background: var(--paper-warm); border: 1px solid var(--ink-rule-soft);
  border-radius: var(--radius-md);
  padding: 12px; word-break: break-all;
  font-size: 13px; color: var(--ink-deeper);
  margin-bottom: 12px; font-family: var(--font-mono);
}
.modal .actions { display: flex; gap: 8px; margin-top: 16px; }
.modal .actions button { flex: 1; }

/* ─────────────────────────────────────────────
 * F8 — Login / landing page
 * ───────────────────────────────────────────── */
.login-body {
  background: var(--paper);
  min-height: 100vh;
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
  font-family: var(--font-sans);
}
.login-card {
  background: var(--paper-card);
  border: 1px solid var(--ink-rule-soft);
  border-radius: var(--radius-lg);
  padding: 36px 28px; text-align: center;
  width: 100%; max-width: 420px;
  display: flex; flex-direction: column; gap: 24px;
}
.login-brand { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.login-mark {
  width: 96px; height: 96px;
  margin-bottom: 8px;
  object-fit: contain;
  display: block;
}
.login-title {
  font-family: var(--font-serif);
  margin: 0; font-size: 26px; font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--ink-deeper);
}
.login-subtitle {
  font-size: 11px; color: var(--ink-muted);
  letter-spacing: 0.28em; font-weight: 600;
  text-transform: uppercase;
}
.login-tagline { margin: 8px 0 0; font-size: 14px; color: var(--ink-soft); }

.btn-line-login {
  width: 100%; padding: 14px 16px;
  background: #06c755; color: white;
  border: none; border-radius: var(--radius-md);
  font-size: 16px; font-weight: 600;
  display: flex; align-items: center; justify-content: center; gap: 10px;
  cursor: pointer;
  box-shadow: 0 6px 14px rgba(6,199,85,0.28);
  transition: transform 0.1s ease, box-shadow 0.15s ease;
}
.btn-line-login:hover:not(:disabled) { box-shadow: 0 8px 18px rgba(6,199,85,0.34); }
.btn-line-login:active:not(:disabled) { transform: scale(0.98); }
.btn-line-login:disabled { opacity: 0.5; cursor: default; }
.btn-line-glyph {
  display: inline-flex; align-items: center; justify-content: center;
  width: 24px; height: 24px; border-radius: 5px;
  background: white; color: #06c755; font-weight: 700;
}

.login-note { margin: 12px 0 0; font-size: 12px; color: var(--ink-muted); line-height: 1.5; }
.login-loading { color: var(--ink-muted); font-size: 14px; padding: 24px 0; }
.login-footer {
  color: var(--ink-muted); font-size: 11px;
  margin-top: 8px; letter-spacing: 0.06em;
  display: flex; flex-direction: column; gap: 6px; align-items: center;
}
.login-footer-links { display: inline-flex; gap: 8px; align-items: center; }
.login-footer-links a {
  color: var(--ink-soft);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: color 0.15s, border-color 0.15s;
}
.login-footer-links a:hover {
  color: var(--brand-orange-deep);
  border-bottom-color: var(--brand-orange-soft);
}

#login-actions { display: none; }

/* Danger style for the 登出 dropdown item. */
.profile-menu-item-danger { color: var(--danger); }
.profile-menu-item-danger:hover, .profile-menu-item-danger:active { background: var(--danger-soft); }


/* ─────────────────────────────────────────────
 * Desktop / tablet (≥ 768 px)
 * ───────────────────────────────────────────── */
@media (min-width: 768px) {
  body { background: var(--paper); }

  .app-header { padding: 16px 32px; gap: 16px; max-width: none; }
  .app-header h1, .header-display-name { font-size: 20px; }

  .container { max-width: 960px; padding: 28px 32px 120px; }
  .card { padding: 20px 24px; }

  /* Modals — float-centered on desktop, full radius. */
  .modal-backdrop { align-items: center; padding: 16px; }
  .modal {
    width: min(560px, 100%);
    max-height: 85vh;
    border: 1px solid var(--ink-rule-soft);
    border-radius: var(--radius-lg);
  }

  .actions-bar {
    padding: 14px 32px;
    justify-content: flex-end;
    gap: 12px;
  }
  .actions-bar button { max-width: 220px; }

  /* Production list as a 2-col grid. */
  #list-active, #list-past {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
  }
  #list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }

  .form-group label { font-size: 13px; }

  /* FAB on desktop. */
  .fab {
    width: max-content;
    min-width: 200px;
    max-width: 240px;
    padding: 12px 28px;
    bottom: 28px;
  }

  /* Login page bigger on desktop. */
  .login-card { padding: 48px 40px; max-width: 480px; gap: 28px; }
  .login-mark { width: 120px; height: 120px; }
  .login-title { font-size: 30px; }
}

@media (min-width: 1200px) {
  .container { max-width: 1100px; }
  #list-active, #list-past { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
