/* 壹玖靈命理・Facebook 廣告投放系統
   手機優先，單欄，觸控目標 ≥44px */

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

:root {
  --ink:      #1C1917;
  --ink-2:    #57534E;
  --ink-3:    #78716C;
  --line:     #E7E5E4;
  --line-2:   #D6D3D1;
  --bg:       #F5F4F0;
  --card:     #FFFFFF;
  --brand:    #1F4E5F;
  --brand-2:  #173C4A;
  --brand-soft: #EAF2F4;
  --accent:   #B45309;
  --accent-soft: #FEF7EC;
  --ok:       #15803D;
  --ok-soft:  #F0FDF4;
  --warn:     #B45309;
  --warn-soft:#FFFBEB;
  --danger:   #B91C1C;
  --danger-soft: #FEF2F2;

  --w-half1:  #B91C1C;
  --w-half1-bg: #FEF2F2;
  --w-half2:  #7C3AED;
  --w-half2-bg: #F5F3FF;
  --w-full:   #0369A1;
  --w-full-bg: #F0F9FF;

  --r-sm: 8px;
  --r: 12px;
  --r-lg: 16px;
  --shadow: 0 1px 3px rgba(28,25,23,.06), 0 1px 2px rgba(28,25,23,.04);
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang HK",
               "Microsoft JhengHei", "Noto Sans TC", sans-serif;
  background: var(--bg);
  color: var(--ink);
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

button, input, select, textarea { font-family: inherit; font-size: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; }
a { color: var(--brand); }

.hidden { display: none !important; }
.num { font-variant-numeric: tabular-nums; }

/* ---------------- 登入 ---------------- */

#loginView {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 20px;
}

.login-box {
  width: 100%;
  max-width: 360px;
  text-align: center;
}

.login-logo {
  width: 62px; height: 62px;
  margin: 0 auto 18px;
  border-radius: 17px;
  background: linear-gradient(150deg, #2C6B80, #1F4E5F);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 22px; font-weight: 700; letter-spacing: .5px;
}

.login-title { font-size: 19px; font-weight: 600; letter-spacing: -.01em; }
.login-sub { font-size: 13.5px; color: var(--ink-2); margin-top: 5px; margin-bottom: 26px; }

.login-box input[type=password] {
  width: 100%;
  padding: 14px 16px;
  font-size: 17px;
  text-align: center;
  letter-spacing: .12em;
  border: 1.5px solid var(--line-2);
  border-radius: var(--r);
  background: var(--card);
  transition: border-color .15s, box-shadow .15s;
}
.login-box input[type=password]:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(31,78,95,.10);
}

.btn-enter {
  width: 100%;
  margin-top: 12px;
  padding: 15px;
  font-size: 16px;
  font-weight: 600;
  color: #fff;
  background: var(--brand);
  border-radius: var(--r);
  transition: background .15s, transform .1s;
}
.btn-enter:hover { background: var(--brand-2); }
.btn-enter:active { transform: scale(.99); }
.btn-enter:disabled { opacity: .55; cursor: default; }

.login-msg {
  margin-top: 14px;
  font-size: 13.5px;
  min-height: 20px;
}
.login-msg.err { color: var(--danger); }
.login-msg.ok  { color: var(--ok); }

.banned-box {
  background: var(--danger-soft);
  border: 1px solid #FECACA;
  border-radius: var(--r);
  padding: 18px;
  text-align: left;
  font-size: 14px;
  color: #7F1D1D;
}
.banned-box strong { display: block; font-size: 15px; margin-bottom: 8px; }
.banned-box .meta { font-size: 12.5px; color: #991B1B; margin-top: 6px; }

/* ---------------- 應用框架 ---------------- */

.shell {
  max-width: 680px;
  margin: 0 auto;
  padding-bottom: calc(96px + env(safe-area-inset-bottom, 0px));
}
@media (min-width: 600px) { .shell { max-width: 760px; } }
@media (min-width: 1000px) { .shell { max-width: 1240px; } }
@media (min-width: 1600px) { .shell { max-width: 1400px; } }

.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  background: rgba(255,255,255,.92);
  backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--line);
}
.topbar-inner {
  max-width: 680px;
  margin: 0 auto;
  padding: 7px 12px;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
@media (min-width: 600px) { .topbar-inner { max-width: 760px; } }
@media (min-width: 1000px) { .topbar-inner { max-width: 1240px; } }
@media (min-width: 1600px) { .topbar-inner { max-width: 1400px; } }
.topbar-badge {
  width: 30px; height: 30px; border-radius: 8px;
  background: linear-gradient(150deg, #2C6B80, #1F4E5F);
  color: #fff; display: flex; align-items: center; justify-content: center;
  font-size: 12.5px; font-weight: 700; flex-shrink: 0;
}
.topbar-id { min-width: 0; }
.topbar-name { font-size: 14px; font-weight: 600; line-height: 1.15; }
.topbar-role { font-size: 11px; color: var(--ink-3); }
.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 2px; }

.btn-ghost {
  font-size: 13px;
  color: var(--ink-2);
  padding: 6px 10px;
  min-height: 32px;
  border-radius: var(--r-sm);
  transition: background .15s;
  display: inline-flex;
  align-items: center;
}
.btn-ghost:hover { background: #F5F5F4; color: var(--ink); }

/* 分頁：跟頂欄同一行（桌面）；手機折落第二行 */
.tabs {
  display: flex;
  gap: 3px;
  overflow-x: auto;
  scrollbar-width: none;
  margin-left: 6px;
}
.tabs::-webkit-scrollbar { display: none; }
.tab {
  padding: 5px 13px;
  min-height: 30px;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--ink-2);
  border-radius: 999px;
  white-space: nowrap;
  transition: background .15s, color .15s;
  display: inline-flex;
  align-items: center;
}
.tab:hover { background: #EFEFEC; }
.tab.on { background: var(--brand); color: #fff; }

/* 手機：全嘢一行——徽章＋分頁＋返回／登出，唔再折兩三行浪費空間 */
@media (max-width: 999px) {
  .topbar-inner { padding: 6px 10px; flex-wrap: nowrap; }
  .topbar-role { display: none; }
  .tabs { flex: 1 1 auto; margin-left: 0; padding-bottom: 0; min-width: 0; }
  .tab { min-height: 34px; padding: 6px 11px; font-size: 13px; }
  .btn-ghost { min-height: 34px; padding: 6px 8px; font-size: 12.5px; }
  .topbar-right { gap: 0; }
}
/* 窄屏（<600）：店名都收埋——徽章「壹玖」已經代表，分頁有更多位 */
@media (max-width: 599px) {
  .topbar-id { display: none; }
}

.page { padding: 16px; }

/* ---------------- 週次狀態卡 ---------------- */

.week-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 11px 14px;
  margin-bottom: 10px;
  box-shadow: var(--shadow);
}
.week-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 2px;
}
.week-label { font-size: 12px; color: var(--ink-3); font-weight: 500; display: flex; align-items: center; gap: 7px; }
.wk-num {
  font-size: 12px;
  font-weight: 600;
  color: var(--brand);
  background: var(--brand-soft, #EAF1F4);
  border-radius: 999px;
  padding: 2px 9px;
  line-height: 1.3;
}
.week-dates { font-size: 17px; font-weight: 600; letter-spacing: -.01em; margin-top: 1px; line-height: 1.25; }

.status-pill {
  font-size: 12px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 999px;
  white-space: nowrap;
  flex-shrink: 0;
}
.st-draft     { background: #F5F5F4; color: var(--ink-2); }
.st-submitted { background: #EFF6FF; color: #1D4ED8; }
.st-live      { background: var(--ok-soft); color: var(--ok); }

/* 週卡：數字一行（N 篇 / 合計 / 提示）＋ 備註同按鈕一行 */
.week-meta {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 4px 14px;
  margin-top: 8px;
}
.wk-n { font-size: 15px; font-weight: 600; }
.wk-total { font-size: 12.5px; color: var(--ink-2); }
.wk-hint { font-size: 12.5px; color: var(--ink-3); }
.over-cap { color: var(--danger); }
.week-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 9px;
}
.week-actions .camp-note-input,
.week-actions .camp-note {
  flex: 1 1 200px;
  min-width: 160px;
  margin-top: 0;
}
.week-actions .chip-toggle { margin-top: 0; }

/* ---------------- 篩選 ---------------- */

.filter-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}
.search-box {
  flex: 1;
  position: relative;
}
.search-box input {
  width: 100%;
  padding: 11px 14px 11px 38px;
  font-size: 14.5px;
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: var(--card);
}
.search-box input:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(31,78,95,.08);
}
.search-box::before {
  content: "";
  position: absolute;
  left: 13px; top: 50%;
  width: 15px; height: 15px;
  transform: translateY(-50%);
  background: currentColor;
  color: var(--ink-3);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='M20 20l-4.2-4.2'/%3E%3C/svg%3E") center/contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='M20 20l-4.2-4.2'/%3E%3C/svg%3E") center/contain no-repeat;
  pointer-events: none;
}
.chip-toggle {
  padding: 10px 14px;
  font-size: 13.5px;
  font-weight: 500;
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: var(--card);
  color: var(--ink-2);
  white-space: nowrap;
}
.chip-toggle.on {
  background: var(--accent-soft);
  border-color: #FCD9A8;
  color: var(--accent);
}

/* ---------------- 貼文卡 ---------------- */

.post-list { display: flex; flex-direction: column; gap: 10px; }

.post-card {
  background: var(--card);
  border: 1.5px solid var(--line);
  border-radius: var(--r-lg);
  padding: 13px;
  display: grid;
  grid-template-columns: 96px 1fr;
  gap: 13px;
  transition: border-color .15s, box-shadow .15s;
}
.post-card:hover { border-color: var(--line-2); }

.post-card.picked {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(31,78,95,.07);
}
.post-card.picked.w-half1 { border-color: var(--w-half1); box-shadow: 0 0 0 3px rgba(185,28,28,.07); }
.post-card.picked.w-half2 { border-color: var(--w-half2); box-shadow: 0 0 0 3px rgba(124,58,237,.07); }
.post-card.picked.w-full  { border-color: var(--w-full);  box-shadow: 0 0 0 3px rgba(3,105,161,.07); }

.post-thumb {
  width: 96px;
  aspect-ratio: 3 / 4;
  border-radius: 9px;
  overflow: hidden;
  background: #F1F0ED;
  position: relative;
  cursor: zoom-in;
}
.post-thumb img {
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
}
/* 橫向截圖（影片類）完整顯示，不裁切 */
.post-thumb.is-wide { background: #0F172A; }
.post-thumb.is-wide img { object-fit: contain; }
.post-thumb.no-img {
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; color: var(--ink-3); text-align: center; padding: 4px;
}

.post-body { min-width: 0; display: flex; flex-direction: column; }

.post-head {
  display: flex;
  align-items: baseline;
  gap: 7px;
  margin-bottom: 3px;
}
.post-id {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--brand);
  background: var(--brand-soft);
  padding: 1px 7px;
  border-radius: 5px;
  flex-shrink: 0;
}
.post-star { color: #D97706; font-size: 13px; flex-shrink: 0; }

.post-title {
  font-size: 14.5px;
  font-weight: 600;
  line-height: 1.4;
  margin-bottom: 4px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.post-meta {
  font-size: 12.5px;
  color: var(--ink-3);
  align-items: center;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}
.post-meta .na { color: var(--warn); font-weight: 600; }

/* 投放開關 */
.pick-btn {
  width: 100%;
  min-height: 44px;
  margin-top: 4px;
  font-size: 14.5px;
  font-weight: 600;
  color: var(--brand);
  background: var(--brand-soft);
  border: 1.5px dashed #A9C7CF;
  border-radius: var(--r-sm);
  transition: all .13s;
}
.pick-btn:hover { background: #DCEAEE; border-color: var(--brand); }
.pick-btn:active { transform: scale(.985); }
.pick-btn.on {
  color: #fff;
  background: var(--brand);
  border: 1.5px solid var(--brand);
  border-style: solid;
}

/* 已選後的時段 / 預算 / 受眾 / 備註 */
.picked-extra {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px dashed var(--line);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* 投放時段（客戶決定，可留空） */
.win-pick-wrap { display: flex; flex-direction: column; gap: 6px; }
.win-pick-label {
  display: flex;
  align-items: baseline;
  gap: 8px;
  font-size: 13px;
  color: var(--ink-2);
}
.win-pick-hint {
  font-size: 12px;
  color: var(--ink-3);
  margin-left: auto;
}
.win-pick {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 6px;
}
.win-opt {
  min-height: 42px;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--ink-2);
  background: #FAFAF9;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  transition: all .13s;
}
.win-opt:hover { background: #F5F5F4; border-color: var(--line-2); }
.win-opt:active { transform: scale(.97); }
.win-opt.on.w-half1 { background: var(--w-half1-bg); border-color: #FCA5A5; color: var(--w-half1); border-width: 1.5px; }
.win-opt.on.w-half2 { background: var(--w-half2-bg); border-color: #C4B5FD; color: var(--w-half2); border-width: 1.5px; }
.win-opt.on.w-full  { background: var(--w-full-bg);  border-color: #7DD3FC; color: var(--w-full);  border-width: 1.5px; }

.budget-row {
  display: flex;
  align-items: center;
  gap: 8px;
}
.budget-row .bl { font-size: 13px; color: var(--ink-2); flex-shrink: 0; }
.budget-input {
  width: 86px;
  padding: 10px 11px;
  font-size: 16px;
  font-weight: 600;
  text-align: right;
  border: 1px solid var(--line-2);
  border-radius: var(--r-sm);
  background: #fff;
}
.budget-input:focus { outline: none; border-color: var(--brand); }
.budget-quick {
  display: flex;
  gap: 5px;
  margin-left: auto;
}
.budget-quick button {
  padding: 9px 13px;
  min-height: 38px;
  font-size: 13px;
  font-weight: 600;
  color: var(--brand);
  background: var(--brand-soft);
  border-radius: 7px;
}
.budget-quick button:hover { background: #DCEAEE; }

.note-input {
  width: 100%;
  padding: 10px 11px;
  font-size: 14px;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  background: #FAFAF9;
  resize: vertical;
  min-height: 42px;
}
.note-input:focus { outline: none; border-color: var(--brand); background: #fff; }

/* 受眾折疊 */
.aud-toggle {
  width: 100%;
  min-height: 42px;
  padding: 8px 11px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13.5px;
  color: var(--ink-2);
  background: #FAFAF9;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  text-align: left;
}
.aud-toggle:hover { border-color: var(--line-2); }
.aud-toggle.has { background: var(--brand-soft); border-color: #CFE0E5; color: var(--brand); }
.aud-toggle .aud-state {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12.5px;
  color: var(--ink-3);
}
.aud-toggle.has .aud-state { color: var(--brand); }
.aud-toggle .caret { font-size: 12px; color: var(--ink-3); flex-shrink: 0; }

.aud-editor {
  background: #FCFCFB;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  padding: 10px 11px;
  display: flex;
  flex-direction: column;
  gap: 7px;
}
/* 投手睇客戶設定的唯讀版：高亮藍框，一眼就見 */
.aud-editor.ro.has-set {
  background: #F2F8FD;
  border-color: #B7D8F0;
}
.aud-hint {
  font-size: 12px;
  color: var(--ink-3);
  line-height: 1.5;
  padding-bottom: 3px;
  border-bottom: 1px dashed var(--line);
  display: flex;
  align-items: center;
  gap: 8px;
}
.aud-hint::after { content: none; }
.aud-clear {
  margin-left: auto;
  font-size: 12px;
  color: #B45309;
  background: #FEF7EC;
  border: 1px solid #F5D9A8;
  border-radius: 6px;
  padding: 3px 9px;
  min-height: 24px;
  cursor: pointer;
  flex-shrink: 0;
}
.aud-clear:hover { background: #FDEBC8; }
.aud-row {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  flex-wrap: wrap;   /* 唔會冲出卡外——年齡快捷掣塞唔落就折去下一行 */
}
.aud-row.col { flex-direction: column; align-items: stretch; gap: 4px; }
.aud-label {
  font-size: 12.5px;
  color: var(--ink-2);
  width: 36px;
  flex-shrink: 0;
}
.aud-age {
  width: 54px;
  padding: 7px 6px;
  font-size: 14px;
  font-weight: 600;
  text-align: center;
  border: 1px solid var(--line-2);
  border-radius: 7px;
  background: #fff;
}
.aud-age:focus { outline: none; border-color: var(--brand); }
.aud-sep, .aud-unit { font-size: 12.5px; color: var(--ink-3); flex-shrink: 0; }
.aud-val { font-size: 14px; font-weight: 600; color: var(--ink); min-height: 20px; }

/* 年齡快捷掣：縮細留喺同行右邊（自動推埋去，唔再直疊） */
.aud-quick { display: flex; gap: 4px; margin-left: auto; }
.aud-quick button {
  padding: 4px 8px;
  min-height: 28px;
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-2);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 6px;
  white-space: nowrap;
}
.aud-quick button:hover { border-color: var(--brand); color: var(--brand); }

/* 窄屏（<420）快捷掣容唔落就折落下一行，靠左對齊 */
@media (max-width: 420px) {
  .aud-quick { flex-basis: 100%; margin-left: 0; justify-content: flex-start; }
}

/* 週期日期：手機用短格式（11/16（一）– 11/22（日）），桌面用全格式 */
.wk-dates-short { display: none; }
@media (max-width: 599px) {
  .wk-dates-full { display: none; }
  .wk-dates-short { display: inline; }
  .week-dates { font-size: 14.5px; }
}

.seg {
  display: flex;
  gap: 4px;
  flex: 1;
}
.seg-btn {
  flex: 1;
  min-height: 38px;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--ink-2);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 7px;
}
.seg-btn.on { background: var(--brand); color: #fff; border-color: var(--brand); }

.aud-select {
  flex: 1;
  padding: 9px 10px;
  font-size: 14px;
  border: 1px solid var(--line-2);
  border-radius: 7px;
  background: #fff;
}

/* 已選摘要（唯讀 / 投手） */
.picked-sum {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 4px;
  flex-wrap: wrap;
}
.sum-amt { font-size: 14.5px; font-weight: 700; margin-left: auto; }
.aud-sum {
  font-size: 12.5px;
  color: var(--brand);
  margin-top: 5px;
  line-height: 1.45;
}
.note-view {
  font-size: 13px;
  color: var(--ink-2);
  margin-top: 6px;
  padding: 8px 10px;
  background: #FAFAF9;
  border-radius: 7px;
  line-height: 1.5;
}
.note-view b { font-weight: 600; color: var(--ink); }
.not-picked {
  font-size: 13px;
  color: var(--ink-3);
  margin-top: 6px;
}

.na-tag {
  font-size: 12px;
  font-weight: 600;
  color: var(--warn);
  background: var(--warn-soft);
  padding: 1px 6px;
  border-radius: 4px;
}

/* 漏投開關 */
.skip-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 9px;
  padding: 9px 11px;
  font-size: 13px;
  color: var(--ink-2);
  background: #FAFAF9;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  cursor: pointer;
  min-height: 42px;
}
.skip-toggle input { width: 24px; height: 24px; accent-color: var(--warn); flex-shrink: 0; }
.post-card.is-skipped { opacity: .6; }
.post-card.is-skipped .skip-toggle { background: var(--warn-soft); border-color: #FDE68A; color: var(--warn); }

/* ---------------- 底部固定條 ---------------- */

.bottom-bar {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 40;
  background: rgba(255,255,255,.96);
  backdrop-filter: saturate(180%) blur(12px);
  border-top: 1px solid var(--line);
  padding: 11px 16px calc(11px + env(safe-area-inset-bottom, 0px));
}
.bottom-inner {
  max-width: 680px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 12px;
}
@media (min-width: 600px) { .bottom-inner { max-width: 760px; } }
@media (min-width: 1000px) { .bottom-inner { max-width: 1240px; } }
@media (min-width: 1600px) { .bottom-inner { max-width: 1400px; } }
.bottom-info { flex: 1; min-width: 0; }
.bottom-count { font-size: 13px; color: var(--ink-2); }
.bottom-total { font-size: 17px; font-weight: 700; letter-spacing: -.01em; }
.bottom-total small { font-size: 12.5px; font-weight: 500; color: var(--ink-3); }

.btn-submit {
  padding: 13px 22px;
  font-size: 15px;
  font-weight: 600;
  color: #fff;
  background: var(--brand);
  border-radius: var(--r);
  white-space: nowrap;
  transition: background .15s, transform .1s;
}
.btn-submit:hover { background: var(--brand-2); }
.btn-submit:active { transform: scale(.98); }
.btn-submit:disabled { background: var(--line-2); color: #fff; cursor: default; }
.btn-submit.done { background: var(--ok); }
.btn-submit.secondary {
  background: #fff;
  color: var(--brand);
  border: 1.5px solid var(--line-2);
}
.btn-submit.secondary:hover { background: #F5F5F4; }

/* ---------------- 歷史 ---------------- */

.hist-list { display: flex; flex-direction: column; gap: 10px; }

.hist-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  overflow: hidden;
  box-shadow: var(--shadow);
}
.hist-head {
  padding: 15px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
}
.hist-head:hover { background: #FCFCFB; }
.hist-dates { flex: 1; min-width: 0; }
.hist-week { font-size: 15px; font-weight: 600; }
.hist-sub { font-size: 12.5px; color: var(--ink-3); margin-top: 2px; }
.hist-chev {
  width: 22px; height: 22px;
  color: var(--ink-3);
  transition: transform .2s;
  flex-shrink: 0;
}
.hist-card.open .hist-chev { transform: rotate(180deg); }

.hist-body {
  border-top: 1px solid var(--line);
  padding: 6px 16px 14px;
  background: #FCFCFB;
}
.hist-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
  font-size: 14px;
}
.hist-item:last-child { border-bottom: 0; }
.hist-item-id {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--brand);
  background: var(--brand-soft);
  padding: 1px 6px;
  border-radius: 4px;
  flex-shrink: 0;
}
.hist-item-title {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--ink-2);
}
.hist-item-amt { font-weight: 600; font-size: 13.5px; flex-shrink: 0; }

.win-tag {
  font-size: 12px;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 5px;
  flex-shrink: 0;
}
.win-tag.w-any   { background: #F5F5F4; color: var(--ink-2); }
.win-tag.w-half1 { background: var(--w-half1-bg); color: var(--w-half1); }
.win-tag.w-half2 { background: var(--w-half2-bg); color: var(--w-half2); }
.win-tag.w-full  { background: var(--w-full-bg);  color: var(--w-full); }

.exec-tag {
  font-size: 12px;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 5px;
  flex-shrink: 0;
}
.exec-tag.pending { background: #F5F5F4; color: var(--ink-3); }.exec-tag.running { background: #EFF6FF; color: #1D4ED8; }
.exec-tag.done    { background: var(--ok-soft); color: var(--ok); }
.exec-tag.paused  { background: #F5F5F4; color: var(--ink-2); }

/* ---------------- 空狀態 / 提示 ---------------- */

.empty {
  text-align: center;
  padding: 60px 20px;
  color: var(--ink-3);
  font-size: 14.5px;
  line-height: 1.7;
}

.notice {
  padding: 14px 16px;
  border-radius: var(--r);
  font-size: 14px;
  margin-bottom: 14px;
  line-height: 1.6;
}
.notice.warn   { background: var(--warn-soft); border: 1px solid #FDE68A; color: #92400E; }
.notice.info   { background: var(--brand-soft); border: 1px solid #CFE0E5; color: #164E5E; }
.notice.ok     { background: var(--ok-soft); border: 1px solid #BBF7D0; color: #166534; }
.notice strong { font-weight: 600; }

/* ---------------- 大圖預覽 ---------------- */

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(12,10,9,.94);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  flex-direction: column;
  gap: 14px;
}
/**
 * 大圖＝原圖本身。
 * Excel 抽出的原圖寬 356–526px，這裡以它的原始像素顯示，不放大。
 * 只在螢幕放不下時才等比縮，永遠不會拉伸變模糊。
 */
.lb-frame {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  max-width: 94vw;
  min-height: 120px;
}
.lightbox img {
  max-width: 94vw;
  max-height: calc(100vh - 150px);
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 8px;
  opacity: 0;
  transition: opacity .18s;
  display: block;
}
.lightbox img.ready { opacity: 1; }

.lb-loading {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  color: #D6D3D1;
  min-height: 200px;
}

.lb-count {
  font-size: 13px;
  color: #A8A29E;
  margin-left: 4px;
  font-variant-numeric: tabular-nums;
}
.lightbox-bar {
  display: flex;
  gap: 8px;
  align-items: center;
}
.lightbox-bar button {
  padding: 9px 16px;
  font-size: 14px;
  color: #fff;
  background: rgba(255,255,255,.14);
  border-radius: var(--r-sm);
}
.lightbox-bar button:hover { background: rgba(255,255,255,.24); }
.lightbox-cap { color: #D6D3D1; font-size: 13.5px; text-align: center; max-width: 94vw; line-height: 1.5; }

/* ---------------- Toast ---------------- */

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(88px + env(safe-area-inset-bottom, 0px));
  transform: translateX(-50%) translateY(16px);
  z-index: 120;
  background: #1C1917;
  color: #FAFAF9;
  font-size: 14px;
  padding: 11px 18px;
  border-radius: 999px;
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s, transform .2s;
  max-width: calc(100% - 40px);
  text-align: center;
  box-shadow: 0 8px 24px rgba(0,0,0,.18);
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ---------------- 載入 ---------------- */

.skeleton {
  background: linear-gradient(90deg, #F1F0ED 25%, #E8E7E3 37%, #F1F0ED 63%);
  background-size: 400% 100%;
  animation: shimmer 1.4s ease infinite;
  border-radius: var(--r);
  height: 96px;
}
@keyframes shimmer { 0% { background-position: 100% 50%; } 100% { background-position: 0 50%; } }

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}

/* 極窄屏微調 */
@media (max-width: 360px) {
  .post-card { grid-template-columns: 84px 1fr; gap: 10px; }
  .post-thumb { width: 84px; }
  .pick-btn { font-size: 13.5px; }
  .aud-quick { padding-left: 0; }
}

/* 歷史記錄內的受眾小字 */
.aud-inline {
  display: block;
  font-size: 12px;
  color: var(--brand);
  margin-top: 2px;
  white-space: normal;
}

/* 舊資料用了已移除的時段選項 */
.win-legacy {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  padding: 9px 11px;
  font-size: 13px;
  color: var(--warn);
  background: var(--warn-soft);
  border: 1px solid #FDE68A;
  border-radius: var(--r-sm);
}
.win-legacy strong { font-weight: 600; }
.win-legacy button {
  margin-left: auto;
  padding: 7px 11px;
  min-height: 34px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--warn);
  background: #fff;
  border: 1px solid #FCD9A8;
  border-radius: 6px;
}

/* ══════════ 精簡版：已加入後只用一行搞定 ══════════ */

/* 「加入 / 移除」小按鈕，與「投過 N 週」同一行 */
.pick-mini {
  margin-left: auto;
  padding: 7px 14px;
  min-height: 34px;
  font-size: 13px;
  font-weight: 600;
  color: var(--brand);
  background: var(--brand-soft);
  border: 1px solid #CFE0E5;
  border-radius: 999px;
  white-space: nowrap;
  flex-shrink: 0;
}
.pick-mini:hover { background: #DCEAEE; }
.pick-mini.on {
  color: var(--ink-2);
  background: #F5F5F4;
  border-color: var(--line-2);
}
.pick-mini.on:hover { color: var(--danger); background: var(--danger-soft); border-color: #FECACA; }

/* 時段 + 預算 同一行 */
.one-row {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-top: 8px;
}
.win-mini {
  display: flex;
  gap: 4px;
  flex: 1;
  min-width: 0;
}
.wbtn {
  flex: 1;
  min-height: 40px;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-2);
  background: #FAFAF9;
  border: 1px solid var(--line);
  border-radius: 8px;
  white-space: nowrap;
}
.wbtn:active { transform: scale(.97); }
.wbtn.on.w-half1 { background: var(--w-half1-bg); border-color: #FCA5A5; color: var(--w-half1); }
.wbtn.on.w-half2 { background: var(--w-half2-bg); border-color: #C4B5FD; color: var(--w-half2); }

.bud-mini {
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 0 8px;
  height: 40px;
  background: #fff;
  border: 1px solid var(--line-2);
  border-radius: 8px;
  flex-shrink: 0;
}
.bud-mini span { font-size: 13px; color: var(--ink-3); }
.bud-in {
  width: 46px;
  padding: 0;
  font-size: 15px;
  font-weight: 700;
  text-align: right;
  border: 0;
  background: transparent;
}
.bud-in:focus { outline: none; }

/* 受眾：一行文字連結 */
.aud-link {
  display: flex;
  align-items: center;
  gap: 6px;
  width: 100%;
  min-height: 38px;
  margin-top: 7px;
  padding: 6px 2px;
  font-size: 12.5px;
  color: var(--ink-3);
  text-align: left;
}
.aud-link.has { color: var(--brand); font-weight: 600; }
.aud-link .caret { margin-left: auto; font-size: 12px; }

/* 整張單的備註 */
.camp-note-input {
  width: 100%;
  margin-top: 6px;
  padding: 8px 12px;
  font-size: 13.5px;
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  background: #FAFAF9;
}
.camp-note-input:focus {
  outline: none;
  border-color: var(--brand);
  background: #fff;
}
.camp-note {
  margin-top: 11px;
  padding: 10px 13px;
  font-size: 13.5px;
  line-height: 1.5;
  color: var(--ink-2);
  background: var(--brand-soft);
  border-radius: var(--r-sm);
}
.camp-note b { font-weight: 600; color: var(--brand); }

/* 縮圖：可辨識就好，大圖交俾燈箱（點開＝原圖原始像素） */
.post-card { padding: 11px; grid-template-columns: 96px 1fr; gap: 11px; }
.thumb-col { width: 96px; display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.post-thumb { width: 100%; }
.post-title { margin-bottom: 3px; }
.post-meta { margin-bottom: 8px; }

@media (max-width: 360px) {
  .wbtn { font-size: 12px; }
  .bud-in { width: 40px; }
}

/* 出街時間的小標題行 */
.row-label {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-top: 6px;
  font-size: 12px;
  color: var(--ink-3);
}
.row-label .win-hint { margin-left: auto; color: var(--ink-3); }

/* 平板：略為放大，仍然單欄 */
@media (min-width: 600px) {
  .post-card { grid-template-columns: 104px 1fr; gap: 12px; }
  .thumb-col { width: 104px; }
}

/**
 * 桌面：客戶主要在電腦落單，呢度先係主場。
 * 容器 1240px、兩欄、縮圖 112px（2026-11-11 用戶定案；點開先係大圖）。
 */
@media (min-width: 1000px) {
  .page { padding: 16px 22px; }

  .post-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
  }

  .post-card {
    grid-template-columns: 112px 1fr;
    gap: 13px;
    padding: 12px;
  }
  .thumb-col { width: 112px; }

  .post-id { font-size: 13px; }
  .post-title { font-size: 14.5px; -webkit-line-clamp: 3; }
  .post-meta { font-size: 12.5px; }
  .pick-mini { font-size: 13px; padding: 6px 13px; min-height: 32px; }

  .wbtn { font-size: 13.5px; min-height: 40px; }
  .bud-mini { height: 40px; }
  .bud-in { font-size: 15px; width: 54px; }
  .aud-link { font-size: 13px; min-height: 38px; }

  .week-card { padding: 14px 18px; }
  .week-dates { font-size: 17px; }
  .wk-hint { font-size: 13px; }
  .camp-note-input { font-size: 14px; padding: 10px 13px; }

  .hist-item { font-size: 14.5px; }
  .hist-week { font-size: 16px; }
}

/* 週次卡（桌面）：唔再用三欄 grid —— 單欄直排＋緊湊間距，備註同按鈕同行 */
@media (min-width: 1000px) {
  .week-card {
    padding: 10px 16px;
    margin-bottom: 10px;
  }
  .week-meta { margin-top: 6px; }
  .week-actions { margin-top: 8px; }

  .hist-list { gap: 12px; }
  .hist-head { padding: 16px 20px; }
  .hist-item { padding: 11px 0; }
}

/* 桌面縮圖統一 112px（用戶 2026-11-11 定案：先做 112 睇效果） */
@media (min-width: 1240px) {
  .post-card { grid-template-columns: 112px 1fr; }
  .thumb-col { width: 112px; }
}
@media (min-width: 1600px) {
  .post-card { grid-template-columns: 112px 1fr; }
  .thumb-col { width: 112px; }
  .post-title { font-size: 15px; }
}

/* 縮圖角上一個小放大提示，讓客戶知道可以點開看大圖 */
.post-thumb::after {
  content: "⤢";
  position: absolute;
  right: 4px;
  bottom: 4px;
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  color: #fff;
  background: rgba(28, 25, 23, .55);
  border-radius: 5px;
  pointer-events: none;
}
.post-thumb.no-img::after { content: none; }

/* 素材庫的解析度標示 */
.img-dim {
  display: inline-block;
  margin-left: 8px;
  font-size: 12px;
  color: var(--ink-3);
}

/* 週次卡下方的「下星期 星期一 11/16 起」 */
.week-sub {
  font-size: 12px;
  color: var(--ink-3);
  margin-top: 1px;
  line-height: 1.3;
}

/* 「同上個禮拜一樣」按鈕 */
.prev-btn {
  margin-top: 10px;
  border: 1px dashed var(--line-2);
  color: var(--brand);
  font-weight: 600;
}
.prev-btn:hover { background: var(--brand-soft); border-color: var(--brand); }

/* 時段按鈕帶日期後字較長，稍微收窄字距 */
.wbtn { letter-spacing: -0.01em; }

/* 「下週仲未開單」提示 */
.next-hint {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 18px;
  margin-bottom: 12px;
  background: #FFFBEB;
  border: 1px solid #FDE68A;
  border-radius: var(--r-lg);
}
.next-hint > div { flex: 1; min-width: 0; }
.next-hint strong {
  display: block;
  font-size: 14.5px;
  font-weight: 600;
  color: #92400E;
}
.next-hint span {
  display: block;
  font-size: 13px;
  color: #B45309;
  margin-top: 3px;
  line-height: 1.5;
}
.next-hint button {
  flex-shrink: 0;
  padding: 10px 18px;
  min-height: 42px;
  font-size: 14px;
  font-weight: 600;
  color: #fff;
  background: #B45309;
  border-radius: var(--r-sm);
  white-space: nowrap;
}
.next-hint button:hover { background: #92400E; }

@media (max-width: 480px) {
  .next-hint { flex-direction: column; align-items: stretch; gap: 10px; padding: 13px 15px; }
  .next-hint button { width: 100%; }
}

/* ══════════ 每週落單節奏（星期四～六落單，投下個禮拜）══════════ */

/* 橫幅：本週完全沒安排（橙色提醒，不用紅色 —— 紅色會嚇到長者） */
.next-hint.danger {
  background: #FFF7ED;
  border-color: #FED7AA;
}
.next-hint.danger strong { color: #9A3412; }
.next-hint.danger span { color: #C2410C; }
.next-hint.danger button { background: #C2410C; }
.next-hint.danger button:hover { background: #9A3412; }

/* 預算獨立一行 */
.bud-row {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 8px;
}
.bud-label {
  font-size: 12px;
  color: var(--ink-3);
  flex-shrink: 0;
}
.bud-row .bud-mini {
  height: 42px;
  padding: 0 10px;
  gap: 3px;
}
.bud-row .cur { font-size: 14px; color: var(--ink-2); font-weight: 600; }
.bud-row .bud-in { width: 58px; font-size: 17px; }
.bud-last {
  margin-left: auto;
  padding: 7px 11px;
  min-height: 34px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--brand);
  background: var(--brand-soft);
  border-radius: 999px;
  white-space: nowrap;
  flex-shrink: 0;
}
.bud-last:hover { background: #DCEAEE; }

/* ══════════ 投手：整週清單（不分批）══════════ */

/* 投手頁的「出街時段」一行，放在 notice 裡 */
.post-list + .notice,
.notice .span-note {
  color: var(--ink-3);
}

@media (max-width: 380px) {
  /* 窄屏放唔落三個元素，讓「以往 $80」落到第二行右邊，
     讀起來像輸入框下面的註解，不會擠爆 */
  .bud-row { flex-wrap: wrap; row-gap: 6px; }
  .bud-last { margin-left: auto; }
}

/* ══════════ 入口：投新廣告 / 睇最近 ══════════ */

.welcome {
  padding: 8px 0 24px;
}

.welcome-q {
  font-size: 19px;
  font-weight: 700;
  color: var(--ink);
  margin: 4px 0 16px;
  padding-left: 2px;
}

.wcard {
  display: block;
  width: 100%;
  text-align: left;
  padding: 18px 20px;
  margin-bottom: 12px;
  background: #fff;
  border: 1.5px solid var(--line);
  border-radius: var(--r-lg);
  transition: border-color .15s, box-shadow .15s, transform .12s;
  cursor: pointer;
}
.wcard:hover:not(:disabled) {
  border-color: var(--brand);
  box-shadow: 0 4px 16px rgba(31, 78, 95, .09);
}
.wcard:active:not(:disabled) { transform: scale(.995); }
.wcard:disabled { opacity: .5; cursor: not-allowed; }

/* 「投新廣告」是主要動作，用品牌色描邊強調 */
.wcard-new {
  border-color: var(--brand);
  background: linear-gradient(180deg, #FBFDFE 0%, #fff 60%);
}
.wcard-new .wcard-icon { background: var(--brand); color: #fff; }
.wcard-view .wcard-icon { background: #F5F5F4; color: var(--ink-2); }

.wcard-top {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}
.wcard-icon {
  width: 30px;
  height: 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  border-radius: 9px;
  flex-shrink: 0;
}
.wcard-title {
  font-size: 16.5px;
  font-weight: 700;
  color: var(--ink);
}

/* 日期範圍：客戶最需要看清的一行 */
.wcard-range {
  font-size: 14px;
  line-height: 1.55;
  color: var(--ink-2);
  font-variant-numeric: tabular-nums;
  margin-bottom: 12px;
}

.wcard-foot {
  display: flex;
  align-items: center;
  gap: 10px;
}
.wcard-go {
  margin-left: auto;
  font-size: 13.5px;
  font-weight: 700;
  color: var(--brand);
  white-space: nowrap;
}

.welcome-note {
  margin-top: 18px;
  font-size: 12.5px;
  line-height: 1.7;
  color: var(--ink-3);
  padding-left: 2px;
}

/* 桌面：兩張卡並排，一眼看齊 */
@media (min-width: 700px) {
  .welcome {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0 16px;
    align-items: start;
  }
  .welcome-q { grid-column: 1 / -1; }
  .welcome-note { grid-column: 1 / -1; }
  .wcard { margin-bottom: 0; }
}

/* 頂欄「返回」按鈕 */
#btnBackHome {
  font-weight: 600;
  color: var(--brand);
}

/* ══════════════ 2026-11-11 新增：記住電腦／排序／新貼文／刪除／⭐ ══════════════ */

/* 登入頁「記住這部電腦」 */
.remember-row {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 13px;
  color: var(--ink-2);
  cursor: pointer;
  margin: 2px 0 10px;
  user-select: none;
}
.remember-row input[type="checkbox"] {
  width: 16px; height: 16px;
  accent-color: var(--brand);
  cursor: pointer;
}

/* 排序下拉 */
.sort-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 8px 2px 10px;
  font-size: 13px;
  color: var(--ink-3);
}
.sort-sel {
  font-size: 13.5px;
  padding: 5px 8px;
  min-height: 32px;
  border: 1px solid var(--line-2);
  border-radius: 7px;
  background: #fff;
  color: var(--ink);
}

/* 卡上動作群（⭐／刪除／加入） */
.post-actions {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  flex-shrink: 0;
}
.star-mini {
  background: none;
  border: 0;
  cursor: pointer;
  font-size: 15px;
  min-height: 30px;
  padding: 2px 5px;
  filter: grayscale(1);
  opacity: .45;
  transition: opacity .15s, filter .15s;
}
.star-mini:hover { opacity: .8; }
.star-mini.on { filter: none; opacity: 1; }

/* ══════════════ 2026-11-11 第二輪：⭐右上角／刪除貼文喺縮圖下／新貼文彈窗 ══════════════ */

/* 卡頭：⭐ 推去最右 */
.post-head { align-items: center; }
.post-head .star-mini {
  margin-left: auto;
  font-size: 16px;
  padding: 2px 4px;
}
/* 素材庫卡頭有「投過 N 週」，⭐都要貼右 */
.post-head .star-mini:last-child { margin-left: auto; }

/* 縮圖欄：縮圖下面跟「修改｜刪除」 */
.thumb-btns {
  display: flex;
  gap: 6px;
  width: 100%;
}
.thumb-col .edit-post,
.thumb-col .del-post {
  flex: 1;
  min-width: 0;
  font-size: 12px;
  color: var(--ink-3);
  background: #FAFAF9;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 5px 0;
  min-height: 26px;
  cursor: pointer;
  text-align: center;
  white-space: nowrap;
}
.thumb-col .edit-post:hover { color: var(--brand); border-color: var(--brand); background: #F0F7F5; }
.thumb-col .del-post:hover { color: #B91C1C; border-color: #FCA5A5; background: #FEF2F2; }

/* 新貼文彈窗 */
.modal {
  position: fixed;
  inset: 0;
  z-index: 120;
  background: rgba(12,10,9,.55);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.modal.hidden { display: none; }
.modal-box {
  background: #fff;
  border-radius: 12px;
  width: 100%;
  max-width: 420px;
  box-shadow: 0 18px 50px rgba(0,0,0,.28);
  overflow: hidden;
}
.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: #F7F6F4;
  border-bottom: 1px solid var(--line);
}
.modal-title { font-size: 15px; font-weight: 700; }
/* 右上角 × 關閉掣（唔會儲存） */
.modal-x {
  width: 30px;
  height: 30px;
  flex: 0 0 30px;
  font-size: 17px;
  line-height: 1;
  color: var(--ink-2);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 7px;
  cursor: pointer;
  padding: 0;
}
.modal-x:hover { color: #B91C1C; border-color: #FCA5A5; background: #FEF2F2; }
.modal-body { padding: 14px 16px 6px; display: grid; gap: 11px; }
.modal-label {
  display: grid;
  gap: 5px;
  font-size: 12.5px;
  color: var(--ink-2);
}
.modal-label b { color: #B91C1C; }
.modal-label input[type="text"],
.modal-label input[type="url"],
.modal-label textarea {
  padding: 10px 12px;
  font-size: 14px;
  border: 1px solid var(--line-2);
  border-radius: 8px;
  background: #fff;
}
.modal-label textarea {
  resize: vertical;
  min-height: 64px;
  line-height: 1.5;
  font-family: inherit;
}
.modal-label input:focus,
.modal-label textarea:focus { outline: none; border-color: var(--brand); }
.modal-label input[type="file"] { font-size: 12.5px; color: var(--ink-2); }

/* 彈窗現有截圖預覽（修改嗰陣顯示） */
.np-img-prev {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 6px;
  background: #FAFAF9;
  text-align: center;
}
.np-img-prev img {
  max-height: 120px;
  max-width: 100%;
  border-radius: 6px;
  display: inline-block;
}

/* 彈窗底部：儲存／取消（一樣大） */
.modal-foot {
  display: flex;
  gap: 10px;
  padding: 12px 16px 16px;
  background: #F7F6F4;
  border-top: 1px solid var(--line);
}
.modal-btn {
  flex: 1;
  min-height: 42px;
  font-size: 14.5px;
  border-radius: 8px;
  border: 1px solid var(--line-2);
  background: #fff;
  color: var(--ink-2);
  cursor: pointer;
}
.modal-btn:hover { border-color: var(--brand); color: var(--brand); }
.modal-btn.primary {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
  font-weight: 600;
}
.modal-btn.primary:hover { filter: brightness(1.08); color: #fff; }
.modal-btn.danger {
  background: #DC2626;
  border-color: #DC2626;
  color: #fff;
  font-weight: 600;
}
.modal-btn.danger:hover { filter: brightness(1.08); color: #fff; }

/* ══════════════ 第三輪：清除已揀 ＋ 刪除確認彈窗 ══════════════ */

/* 「清除」按鈕（同上個禮拜一樣 旁邊） */
.clear-btn {
  margin-left: 6px;
}
.clear-btn:hover { color: #B91C1C; border-color: #FCA5A5; background: #FEF2F2; }

/* 刪除確認彈窗（版面同其他彈窗統一：modal-foot 兩掣） */
.del-msg {
  font-size: 14.5px;
  line-height: 1.55;
  color: var(--ink);
  display: grid;
  gap: 6px;
}
.del-msg b { color: #B91C1C; word-break: break-all; }
.del-sub { font-size: 12.5px; color: var(--ink-3); }

/* 貼文卡備註：標題下面一行細灰字，過長截斷 */
.post-note {
  margin-top: 2px;
  font-size: 12.5px;
  line-height: 1.45;
  color: var(--ink-3);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ══════════════ 2026-11-12 第四輪：🔗開貼文／排序方向／排序凍結／新增高亮 ══════════════ */

/* 卡頭 🔗 開 Facebook 貼文（新分頁）；冇 ⭐ 嘅卡頭自動貼右 */
.post-head .link-mini {
  font-size: 14px;
  line-height: 1;
  text-decoration: none;
  padding: 2px 4px;
  opacity: .75;
  transition: opacity .15s;
}
.post-head .link-mini:hover { opacity: 1; }
.post-head .link-mini:last-child { margin-left: auto; }

/* 排序方向切換掣（↑ 由小到大／↓ 由大到小） */
.sort-dir {
  font-size: 14px;
  min-height: 32px;
  min-width: 34px;
  padding: 5px 8px;
  border: 1px solid var(--line-2);
  border-radius: 7px;
  background: #fff;
  color: var(--ink);
  cursor: pointer;
  font-weight: 600;
  line-height: 1;
}
.sort-dir:hover { border-color: var(--brand); color: var(--brand); }

/* 新增貼文後：新卡高亮閃兩下，一眼就見到 */
@keyframes cardFlash {
  0%, 100% { background-color: var(--card, #fff); }
  25%, 75% { background-color: #FFF3D6; }
}
.post-card.flash {
  animation: cardFlash .8s ease-in-out 3;
  outline: 2px solid #F59E0B;
  outline-offset: -2px;
  border-radius: inherit;
}
