/* 新功能提示(public/whats-new.js):功能名稱右上方的黃色小星星(會閃)、說明小窗、最近更新、平台管理卡。
 * 長相是負責人 2026-10-30 拍板定案的(規則見 docs/whats-new.md「規則」,tests/whats-new.test.js 鎖住),不要改。
 * 星星:跟訂單頁的紅點同一種提示方式,但用星形,不會跟圓形的連線 / 故障燈號搞混;不放字(「新」「改版」的字只在說明小窗與最近更新裡,字從 data-label 來)。
 *   標籤本身是透明的點擊區,星星用 ::after 畫(clip-path 十字形四角亮星,像 ✦),貼在文字右上角:左右用負邊距,幾乎不佔寬度、不把按鈕撐開;
 *   點一下看說明。掛上去不會改到旁邊按鈕、標題的文字內容。深色底(頂列、下拉選單)用亮黃,淺色底用深一點的金;系統設定「減少動態效果」時不閃。 */
:root {
  --wn-star: #f59f00; --wn-star-dk: #ffd43b;
  --wn-tag-bg: #fff6d6; --wn-tag-fg: #8a5a00; --wn-tag-line: #f3d98a;
  --wn-soft: #fff6d6; --wn-soft-ink: #7a5000; --wn-soft-line: #f0dca0;
}
.wn-badge {
  display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto; position: relative; top: -0.55em;
  width: 18px; height: 18px; margin: 0 -11px 0 -6px; vertical-align: middle; cursor: pointer; z-index: 1;
}
.wn-badge::after {
  content: ''; width: 8px; height: 8px; background: var(--wn-star);
  -webkit-clip-path: polygon(50% 0%, 61% 39%, 100% 50%, 61% 61%, 50% 100%, 39% 61%, 0% 50%, 39% 39%);
  clip-path: polygon(50% 0%, 61% 39%, 100% 50%, 61% 61%, 50% 100%, 39% 61%, 0% 50%, 39% 39%);
  animation: wn-blink 1.6s ease-in-out infinite;
}
/* 貼在哪裡不在這裡一處一處寫:whats-new.js 的 findAnchor 找名稱、layoutPass 實量後對準右上角(flex 間距也是讀實際值扣回來) */
/* 超過「一個畫面最多亮幾顆」的先藏起來 */
.wn-badge.wn-over { display: none; }
#topbar .wn-badge::after { background: var(--wn-star-dk); }
#nav button.active .wn-badge::after { background: #fff3bf; }
@keyframes wn-blink { 0%, 100% { opacity: 1; transform: scale(1); } 50% { opacity: .4; transform: scale(.75); } }
@media (prefers-reduced-motion: reduce) { .wn-badge::after { animation: none; } }
.wn-badge:focus-visible { outline: 2px solid var(--wn-star); outline-offset: 0; border-radius: 4px; }
/* 下拉選單那顆鈕上的星星只是提示「裡面有新的」,點了照常打開選單 */
.wn-badge.wn-trigger { cursor: inherit; }
/* 說明小窗、最近更新、平台管理卡裡的「新」「改版」小字 */
.wn-chip {
  display: inline-flex; align-items: center; flex: 0 0 auto; height: 18px; padding: 0 6px; border-radius: 4px; box-sizing: border-box;
  background: var(--wn-tag-bg); color: var(--wn-tag-fg); border: 1px solid var(--wn-tag-line); font-size: 11px; font-weight: 600; line-height: 1; white-space: nowrap;
}
.wn-chip::after { content: attr(data-label); }

/* 說明小窗 */
.wn-pop { position: fixed; z-index: 1200; width: 300px; max-width: calc(100vw - 16px); box-sizing: border-box;
  background: #fff; color: #1c2333; border: 1px solid var(--wn-soft-line); border-radius: 12px; box-shadow: 0 12px 32px rgba(20,16,70,.22);
  padding: 12px 14px; font-size: 14px; line-height: 1.55; max-height: calc(100vh - 16px); overflow-y: auto; -webkit-overflow-scrolling: touch; }
.wn-pop-it + .wn-pop-it { border-top: 1px solid #ecebf5; margin-top: 10px; padding-top: 10px; }
.wn-pop-h { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 15px; }
.wn-pop-t { margin-top: 4px; }
.wn-pop-p { margin-top: 2px; color: #6b7385; font-size: 13px; }
.wn-pop-a { display: flex; justify-content: flex-end; align-items: center; margin-top: 12px; }
.wn-pop-a > * + * { margin-left: 8px; }
.wn-learn { display: inline-flex; align-items: center; min-height: 36px; padding: 0 10px; border-radius: 8px; color: var(--wn-soft-ink); background: var(--wn-soft); text-decoration: none; font-weight: 600; font-size: 13px; }
.wn-pop .wn-ok { min-height: 36px; }

/* 最近更新 */
.wn-list { margin-top: 6px; }
.wn-row { padding: 12px 0; border-top: 1px solid #ecebf5; }
.wn-row:first-child { border-top: 0; }
.wn-row-h { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; font-weight: 700; font-size: 15px; }
.wn-row-d { color: #6b7385; font-size: 12px; font-weight: 400; }
.wn-row-t { margin-top: 4px; font-size: 14px; line-height: 1.6; }
.wn-row-p { margin-top: 2px; color: #6b7385; font-size: 13px; }
.wn-row .wn-learn { margin-top: 6px; }
.wn-empty { color: #6b7385; padding: 12px 0; }

/* 平台管理 → 平台設定 → 新功能提示 */
.wn-adm-it { border: 1px solid #e3e6ec; border-radius: 10px; padding: 10px 12px; margin-top: 10px; }
.wn-adm-h { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.wn-adm-h b { font-size: 15px; }
.wn-adm-m { color: #6b7385; font-size: 12px; margin-top: 2px; }
.wn-adm-it label { display: block; margin-top: 8px; font-size: 13px; color: #4a5266; }
.wn-adm-it input[type="text"], .wn-adm-it textarea { width: 100%; box-sizing: border-box; margin-top: 2px; }
.wn-adm-it textarea { min-height: 60px; resize: vertical; }
.wn-adm-it label.wn-adm-off { display: flex; align-items: center; gap: 8px; min-height: 44px; }
.wn-adm-it.is-off { background: #fafafc; }
