/* =========================================================
   雙渠道物料申請系統 — 共用樣式 (手機版優先)
   ========================================================= */
:root {
  --c-bg: #f4f5f7;
  --c-surface: #ffffff;
  --c-text: #1f2933;
  --c-muted: #6b7280;
  --c-border: #e2e5ea;
  --c-primary: #2563eb;
  --c-primary-dark: #1d4ed8;
  --c-hq: #0d9488;      /* 總公司渠道色 */
  --c-local: #d97706;   /* 本店渠道色 */
  --c-danger: #dc2626;
  --c-success: #16a34a;
  --radius: 12px;
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
  --maxw: 640px;
}

* { box-sizing: border-box; }

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

/* 頂部列 */
.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--c-primary);
  color: #fff;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.topbar__title { font-size: 17px; font-weight: 700; }
.topbar__user { font-size: 13px; opacity: 0.95; }

/* 版面容器 */
.container {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 16px;
}

/* 卡片 */
.card {
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px;
  margin-bottom: 16px;
}
.card__title {
  font-size: 15px;
  font-weight: 700;
  margin: 0 0 4px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.card__desc { color: var(--c-muted); font-size: 13px; margin: 0 0 12px; }

/* 表單 */
.field { margin-bottom: 14px; }
.field label { display: block; font-size: 14px; font-weight: 600; margin-bottom: 6px; }
.field input, .field select {
  width: 100%;
  padding: 12px;
  font-size: 16px;
  border: 1px solid var(--c-border);
  border-radius: 10px;
  background: #fff;
}
.field input:focus, .field select:focus {
  outline: none;
  border-color: var(--c-primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

/* 按鈕 */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 100%;
  padding: 13px 16px;
  font-size: 16px;
  font-weight: 700;
  border: none;
  border-radius: 10px;
  background: var(--c-primary);
  color: #fff;
  cursor: pointer;
}
.btn:hover { background: var(--c-primary-dark); }
.btn:disabled { background: #cbd5e1; cursor: not-allowed; }
.btn--ghost {
  background: transparent;
  color: var(--c-primary);
  border: 1px solid var(--c-primary);
}
.btn--ghost:hover { background: rgba(37, 99, 235, 0.08); }
.btn--sm { width: auto; padding: 8px 14px; font-size: 14px; }
.btn--light { background: rgba(255,255,255,0.2); }
.btn--light:hover { background: rgba(255,255,255,0.3); }

/* 標籤 / 徽章 */
.badge {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
}
.badge--hq { background: rgba(13,148,136,0.12); color: var(--c-hq); }
.badge--local { background: rgba(217,119,6,0.12); color: var(--c-local); }
.badge--todo { background: #eef1f5; color: var(--c-muted); }

/* 清單 */
.list { list-style: none; margin: 0; padding: 0; }
.list__item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid var(--c-border);
  font-size: 14px;
}
.list__item:last-child { border-bottom: none; }
.list__meta { color: var(--c-muted); font-size: 12px; }

/* 提示訊息 */
.alert { padding: 10px 12px; border-radius: 10px; font-size: 14px; margin-bottom: 12px; }
.alert--error { background: rgba(220,38,38,0.1); color: var(--c-danger); }
.alert--info { background: rgba(37,99,235,0.08); color: var(--c-primary-dark); }
.hidden { display: none !important; }

/* 登入頁置中 */
.auth-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.auth-card { width: 100%; max-width: 360px; }
.auth-card__brand { text-align: center; margin-bottom: 20px; }
.auth-card__brand h1 { font-size: 20px; margin: 0 0 4px; }
.auth-card__brand p { color: var(--c-muted); font-size: 13px; margin: 0; }

/* 開發用: 測試帳號提示 */
.hint {
  font-size: 12px;
  color: var(--c-muted);
  background: #fafbfc;
  border: 1px dashed var(--c-border);
  border-radius: 10px;
  padding: 10px 12px;
  margin-top: 14px;
}
.hint code { background: #eef1f5; padding: 1px 5px; border-radius: 4px; }

.footer-note { text-align: center; color: var(--c-muted); font-size: 12px; padding: 8px 0 24px; }
pre.code-out {
  background: #0f172a; color: #e2e8f0; font-size: 12px;
  padding: 12px; border-radius: 10px; overflow-x: auto; white-space: pre-wrap;
}
