/* ══════════════════════════════════════════════════════════════════
   系統主題：深色科技（全站共用一份）
   - 只定義外觀（顏色、字體、間距、圓角、光暈）；不含任何流程邏輯
   - 四個頁面（店長／老闆／我的損益／廠商）都 link 這一份
   - 魚群動畫：純 CSS，尊重系統「減少動態」設定
   ══════════════════════════════════════════════════════════════════ */

:root{
  --bg:#0a0b0d;          --surface:#131518;    --surface2:#191c21;
  --line:#262a31;        --line2:#31363f;
  --text:#f4f5f7;        --muted:#8b93a1;      --muted2:#6f7784;
  --accent:#6d5cff;      --accent2:#22d3ee;
  --ok:#4ade80;          --warn:#fbbf24;       --danger:#f87171;
  --mono:"SF Mono",ui-monospace,SFMono-Regular,Menlo,monospace;
  --blue:var(--accent);  --green:var(--ok);    --red:var(--danger);   --gray:var(--muted); /* 舊名相容 */
}

*{ box-sizing:border-box; -webkit-tap-highlight-color:transparent; }

body{
  margin:0; padding:16px 14px 34px; font-size:18px; line-height:1.5; color:var(--text);
  font-family:-apple-system,"PingFang TC","Heiti TC","Noto Sans TC",sans-serif;
  background:
    radial-gradient(120% 60% at 12% 0%, rgba(109,92,255,.16), transparent 58%),
    radial-gradient(100% 55% at 100% 100%, rgba(34,211,238,.12), transparent 60%),
    linear-gradient(180deg,#0b0c10,#0a0b0d 45%,#0c1116);
  background-attachment:fixed; min-height:100vh;
}
h1{ font-size:22px; margin:4px 0 2px; }
h2{ font-size:19px; margin:0 0 8px; }
.sub{ color:var(--muted); font-size:15px; margin-bottom:14px; }
.hint{ color:var(--muted2); font-size:14px; margin-top:6px; line-height:1.55; }

/* ── 卡片 ─────────────────────────────────────────────── */
.card{
  background:linear-gradient(180deg,rgba(255,255,255,.05),rgba(255,255,255,.022));
  border:1px solid var(--line); border-radius:16px; padding:14px; margin-bottom:12px;
  box-shadow:0 8px 26px rgba(0,0,0,.35); backdrop-filter:blur(6px);
}

/* 卡片內的分區面板（魚貨／凍貨那種） */
.panel{ background:rgba(255,255,255,.035); border:1px solid var(--line);
        border-radius:14px; padding:12px; }

/* ── 表單 ─────────────────────────────────────────────── */
label{ display:block; font-size:15px; color:#c6ccd6; margin:10px 0 4px; }
select,input,textarea{
  width:100%; font-size:18px; padding:12px; border-radius:12px; font-family:inherit;
  background:#0e1014; border:1px solid var(--line2); color:var(--text);
}
textarea{ font-size:16px; padding:11px; min-height:78px; line-height:1.6; }
select{ appearance:none; background-image:linear-gradient(45deg,transparent 50%,var(--muted) 50%),
        linear-gradient(135deg,var(--muted) 50%,transparent 50%);
        background-position:calc(100% - 20px) 22px, calc(100% - 14px) 22px;
        background-size:6px 6px,6px 6px; background-repeat:no-repeat; }
input:focus,select:focus,textarea:focus{ outline:0; border-color:var(--accent);
  box-shadow:0 0 0 3px rgba(109,92,255,.18); }
input[type=number],input[inputmode=numeric]{ font-family:var(--mono); text-align:right; }

/* 檔案選擇框（原生是白色，在深色頁很突兀） */
input[type=file]{ padding:10px; font-size:15px; color:var(--muted); background:rgba(255,255,255,.04);
                  border:1px dashed var(--line2); }
input[type=file]::file-selector-button{ font-family:inherit; font-size:14px; margin-right:10px;
  padding:7px 12px; border-radius:9px; border:1px solid var(--line2); color:#d7dbe2;
  background:rgba(255,255,255,.07); cursor:pointer; }
/* 日期欄位：頁面明明是深色，卻一直沒告訴瀏覽器「我是深色頁」→ 點開的原生日曆用淺色主題＋藍色標記，
   「今天」和「你選的」都亮藍色，看起來像兩天都被選中（Kevin 2026-10-02 回報）。
   2026-10-02 三種都試過：①沒宣告 ②declared dark（日曆變深色）③accent-color 想在深色裡把「選中」換紅——手機的
   Chrome 都不買單（仍是一片藍）。**Kevin 最新決定：改回預設的淺色日曆**（白底黑字、選中＝藍色實心圓、
   今天只有一圈框），最不容易跟深色頁面混淆。要給手機看的話務必宣告 color-scheme:light，否則深色模式手機又變深。 */
input[type=date]{ font-family:var(--mono); color-scheme:light; }
/* 日曆圖示：強制淺色後 icon 會變黑，在深色欄位上會看不到 → 反白回來 */
input[type=date]::-webkit-calendar-picker-indicator{ filter:invert(1); opacity:.85; cursor:pointer; }

/* 支出：一行一筆（金額＋刪掉） */
.expRow{ display:flex; flex-direction:column; gap:7px; padding:11px; margin-bottom:10px;
         border:1px solid var(--line); border-radius:14px; background:rgba(255,255,255,.03); }
.expRow .row{ display:flex; gap:8px; align-items:center; }
.expRow .row .expAmt{ flex:1; }
.expRow .expAmt[readonly]{ background:rgba(255,255,255,.06); color:#9aa3ad; }
.expRow .expFix{ font-size:12.5px; color:var(--muted); margin-top:-3px; }
.xbtn{ flex:0 0 auto; width:46px; height:46px; border-radius:12px; font-size:15px; cursor:pointer;
       border:1px solid rgba(248,113,113,.35); background:rgba(248,113,113,.10); color:#fca5a5; }
.xbtn:active{ transform:scale(.96); }

/* ── 按鈕 ─────────────────────────────────────────────── */
button{ font-size:18px; padding:14px; border-radius:13px; border:0; width:100%;
        font-weight:600; font-family:inherit; cursor:pointer; }
.btn-main{ background:linear-gradient(135deg,var(--accent),var(--accent2)); color:#fff;
           box-shadow:0 10px 24px rgba(109,92,255,.30); }
.btn-green{ background:linear-gradient(135deg,#22c55e,#4ade80); color:#042711;
            box-shadow:0 10px 24px rgba(74,222,128,.22); }
.btn-ghost{ background:rgba(255,255,255,.06); color:#d7dbe2; border:1px solid var(--line2); }
.btn-sm{ font-size:16px; padding:11px; }
button:disabled{ opacity:.55; }

/* ── 版面小工具 ───────────────────────────────────────── */
.row{ display:flex; gap:10px; }
.row > *{ flex:1; }
.hidden{ display:none !important; }
.head{ display:flex; justify-content:space-between; align-items:baseline; margin-bottom:6px; }
.who{ display:flex; justify-content:space-between; align-items:center; font-size:14px; color:var(--muted); }
.cat{ font-size:15px; color:#c6ccd6; margin:12px 0 2px; }
.linkbtn{ background:none; border:0; color:var(--muted); font-size:14px; width:auto;
          text-decoration:underline; padding:4px; cursor:pointer; }

/* ── 明細列 ───────────────────────────────────────────── */
.item{ display:flex; justify-content:space-between; align-items:center; padding:12px 0;
       border-bottom:1px solid rgba(255,255,255,.07); font-size:17px; }
.item:last-child{ border-bottom:0; }
.qty{ color:var(--muted); font-size:15px; }
.del{ color:var(--danger); background:none; border:0; font-size:15px; width:auto; padding:6px 4px; }
.ln{ display:flex; justify-content:space-between; padding:7px 0 7px 10px;
     border-bottom:1px dashed rgba(255,255,255,.07); font-size:17px; }
.ln:last-child{ border-bottom:0; }
.ln span{ color:var(--muted); font-size:16px; }
.total{ font-size:18px; font-weight:700; margin-top:10px; font-family:var(--mono); }
.entry{ display:flex; justify-content:space-between; align-items:center; gap:10px; padding:10px 0;
        border-bottom:1px solid rgba(255,255,255,.07); }
.entry:last-child{ border-bottom:0; }
.entry .t{ font-size:16px; }
.entry .s{ color:var(--muted); font-size:14px; }

/* ── 狀態訊息 ─────────────────────────────────────────── */
.ok{ background:rgba(74,222,128,.12); color:#86efac; border:1px solid rgba(74,222,128,.28);
     border-radius:12px; padding:10px 12px; font-weight:600; font-size:16px; }
.err{ background:rgba(248,113,113,.12); color:#fca5a5; border:1px solid rgba(248,113,113,.30);
      border-radius:12px; padding:10px 12px; font-size:16px; }
.warn{ background:rgba(251,191,36,.10); border:1px solid rgba(251,191,36,.28); border-radius:12px;
       padding:12px; font-size:15px; color:#fcd77a; line-height:1.6; }
.accMsg{ border-radius:12px; padding:10px 12px; font-size:16px; font-weight:600; margin:10px 0; }
.accMsg.ok{ background:rgba(74,222,128,.12); color:#86efac; border:1px solid rgba(74,222,128,.28); }
.accMsg.err{ background:rgba(248,113,113,.12); color:#fca5a5; border:1px solid rgba(248,113,113,.30); }

/* ── 分頁籤 ───────────────────────────────────────────── */
.tabs{ display:flex; gap:7px; margin:10px 0 12px; }
.tabs > *{ flex:1; text-align:center; font-size:14px; font-weight:600; padding:11px 3px;
  border-radius:13px; background:rgba(255,255,255,.05); border:1px solid var(--line);
  color:#b9c0cb; text-decoration:none; display:block; white-space:nowrap; overflow:hidden; cursor:pointer; }
.tabs > .on{ background:linear-gradient(135deg,var(--accent),var(--accent2)); border-color:transparent;
             color:#fff; box-shadow:0 6px 18px rgba(109,92,255,.28); }

/* ── 照片 ─────────────────────────────────────────────── */
.thumbs{ display:flex; flex-wrap:wrap; gap:8px; margin-top:10px; }
.thumb{ position:relative; width:88px; height:88px; border-radius:12px; overflow:hidden;
        border:1px solid var(--line2); background:#0e1014; }
.thumb img{ width:100%; height:100%; object-fit:cover; display:block; }
.thumb .rm{ position:absolute; top:2px; right:2px; width:auto; padding:2px 8px; font-size:13px;
            line-height:1.2; background:rgba(0,0,0,.65);  /* cjk-ok：縮圖右上角的 ✕ 小按鈕（單行） */ color:#fff; border-radius:8px; }
.phlink{ display:inline-block; text-decoration:none; background:rgba(255,255,255,.07);
         border:1px solid var(--line2); border-radius:8px; padding:2px 8px; font-size:14px;
         color:#a5b4fc; margin-left:6px; }

/* ── 每日匯報／現金結餘 ───────────────────────────────── */
.repSub{ font-size:15px; color:#c6ccd6; margin:4px 0 2px; font-weight:700; }
.cashbox{ background:linear-gradient(180deg,rgba(74,222,128,.10),rgba(74,222,128,.04));
          border:1px solid rgba(74,222,128,.32); border-radius:14px; padding:12px; margin:14px 0 4px; }
.cashbox .lbl{ font-size:15px; color:#b9c0cb; }
.cashbox .val{ font-size:29px; font-weight:800; color:var(--ok); margin:2px 0 4px;
               letter-spacing:.5px; font-family:var(--mono); }  /* cjk-ok：等寬字體的金額數字，數字加字距是對的 */
.cashbox .val.neg{ color:var(--danger); }
.cashbox .hint{ font-size:13px; line-height:1.5; }

/* ── 魚群（純 CSS；裝飾用，不影響操作） ────────────────── */
.mia-bg{ position:fixed; inset:0; pointer-events:none; z-index:0; overflow:hidden; }
.mia-bg + *{ position:relative; z-index:1; }
.mia-fish{ position:absolute; opacity:.18; filter:drop-shadow(0 0 12px rgba(34,211,238,.35)); }
.mia-fish .tail{ transform-origin:24px 30px; animation:mia-wag 1.1s ease-in-out infinite; }
.mia-fish.f1{ top:10%;  width:92px;  animation:mia-swim 30s linear infinite; }
.mia-fish.f2{ top:42%;  width:62px;  animation:mia-swim 44s linear infinite -14s; }
.mia-fish.f3{ top:72%;  width:44px;  animation:mia-swim 56s linear infinite -30s; }
.mia-bub{ position:absolute; border-radius:50%; border:1px solid rgba(255,255,255,.16);
          animation:mia-rise linear infinite; }
@keyframes mia-swim{ from{ left:-22%; } to{ left:112%; } }
@keyframes mia-wag{ 0%,100%{ transform:rotate(-9deg); } 50%{ transform:rotate(9deg); } }
@keyframes mia-rise{ from{ transform:translateY(0); opacity:.5; } to{ transform:translateY(-80vh); opacity:0; } }

@media (prefers-reduced-motion:reduce){
  .mia-fish,.mia-bub{ display:none !important; }
  *{ animation:none !important; transition:none !important; }
}

/* 「本月我填的」收合成一張卡片：摺疊標題列（點一下展開） */
details.card > summary.accSummary{
  cursor:pointer; list-style:none; display:flex; align-items:center;
  justify-content:space-between; gap:10px; margin:0;
}
details.card > summary.accSummary::-webkit-details-marker{ display:none }
details.card > summary.accSummary .accTitle{ font-size:17px; font-weight:700 }
details.card > summary.accSummary .accSumText{ font-size:13px; color:var(--sub) }
details.card > summary.accSummary::after{ content:"▾"; color:var(--sub); font-size:14px }
details.card[open] > summary.accSummary::after{ content:"▴" }

/* 擋下儲存的提示彈窗：置中、大字、一定要按掉 */
.mia-modal{ position:fixed; inset:0; z-index:9999; background:rgba(0,0,0,.72);
  display:flex; align-items:center; justify-content:center; padding:22px; }
.mia-modal.hidden{ display:none }
.mia-modal-box{ width:100%; max-width:340px; background:var(--card,#141a20);
  border:1px solid var(--line,#2a3340); border-radius:16px; padding:20px 18px; text-align:center; }
.mia-modal-icon{ font-size:30px; line-height:1 }
.mia-modal-text{ margin:10px 0 16px; font-size:17px; line-height:1.6; white-space:pre-wrap }
.mia-modal-box .btn-green{ width:100% }
