:root {
  --navy: #0b2545; --navy2: #13315c; --blue: #1b4b8a; --sky: #5fa8ff;
  --bg: #eef2f8; --panel: #fff; --ink: #1c2533; --muted: #6b7a90; --line: #dfe5ee;
  --ok: #1a7f37; --err: #c62828; --warn-bg: #ffd600; --warn-ink: #b71c1c; --survey: #ad1457;
}
* { box-sizing: border-box; }
body { margin: 0; font: 14px/1.5 "Noto Sans TC", system-ui, -apple-system, sans-serif; background: var(--bg); color: var(--ink); }
header.top { background: linear-gradient(90deg, var(--navy), var(--navy2) 60%, var(--blue)); color: #fff; padding: 12px 20px; display: flex; align-items: center; gap: 12px; }
header.top h1 { font-size: 17px; margin: 0; letter-spacing: .5px; }
header.top .sub { font-size: 12px; color: #b9c9e4; }
header.top .sp { flex: 1; }
header.top button { background: rgba(255,255,255,.12); color: #fff; border: 1px solid rgba(255,255,255,.25); border-radius: 6px; padding: 5px 10px; cursor: pointer; font: inherit; }
main { max-width: 1280px; margin: 0 auto; padding: 16px; display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 16px; align-items: start; }
@media (max-width: 900px) { main { grid-template-columns: minmax(0, 1fr); } }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 14px; }
.card h2 { font-size: 14px; margin: 0 0 10px; color: var(--navy2); }
.side { display: flex; flex-direction: column; gap: 12px; position: sticky; top: 12px; }
input, select, textarea, button { font: inherit; }
input[type=text], input[type=email], input[type=password], select, textarea { border: 1px solid #c9d3e1; border-radius: 6px; padding: 6px 8px; background: #fff; color: var(--ink); width: 100%; }
label.row { display: flex; align-items: center; gap: 6px; }
.btn { border: 0; border-radius: 8px; padding: 9px 12px; font-weight: 700; cursor: pointer; background: var(--navy); color: #fff; width: 100%; }
.btn.alt { background: #fff; color: var(--navy); border: 1px solid var(--navy); }
.btn.small { width: auto; padding: 4px 10px; font-weight: 500; font-size: 12px; }
.btn:disabled { opacity: .45; cursor: default; }
.filters { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 10px; }
.filters select { width: auto; min-width: 150px; }
.status { color: var(--muted); font-size: 12px; margin-bottom: 6px; }
.item { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 10px; align-items: center; border: 1px solid var(--line); border-radius: 8px; padding: 9px 10px; margin-top: 8px; background: #fff; }
.item:hover { border-color: var(--blue); background: #f6f9fe; }
.item.off { opacity: .55; }
.item .survey { display: flex; flex-direction: column; align-items: center; font-size: 11px; color: var(--survey); cursor: pointer; }
.item .meta { display: flex; flex-wrap: wrap; gap: 4px 8px; align-items: center; font-size: 12px; color: var(--muted); }
.item .t { font-weight: 700; margin-top: 2px; cursor: pointer; }
.item .t:hover { color: var(--blue); text-decoration: underline; }
.chip { white-space: nowrap; font-size: 11px; border-radius: 4px; padding: 0 6px; }
.chip.ok { color: var(--ok); }
.chip.todo { background: var(--warn-bg); color: var(--warn-ink); font-weight: 700; outline: 1px solid #f57f17; }
.tag { font-size: 11px; border-radius: 4px; padding: 0 6px; }
.tag.center { background: #e3f2fd; color: #1565c0; } .tag.survey { background: #fde7f3; color: var(--survey); }
.tag.made { color: var(--ok); } .tag.long { background: #ffebee; color: var(--err); }
.dos { display: flex; gap: 10px; padding-left: 10px; border-left: 1px solid var(--line); }
.dos label { display: flex; flex-direction: column; align-items: center; font-size: 11px; color: var(--navy2); cursor: pointer; }
.edit { grid-column: 1 / -1; border-top: 1px dashed var(--line); padding-top: 8px; display: grid; gap: 6px; }
.edit small { color: var(--muted); float: right; } .edit small.over { color: var(--err); font-weight: 700; }
.edit img { max-width: 220px; max-height: 140px; border-radius: 6px; background: #f3f5f9; }
.steps { display: grid; gap: 6px; }
.steps label { display: flex; gap: 6px; align-items: flex-start; }
.steps .subopt { padding-left: 18px; color: var(--muted); }
.hint { color: var(--muted); font-size: 12px; margin: 6px 0 0; }
#log { font: 12px/1.6 ui-monospace, Menlo, monospace; background: #0b1626; color: #cfe1ff; border-radius: 8px; padding: 10px; max-height: 320px; overflow: auto; white-space: pre-wrap; }
#log .step { color: #8cc2ff; font-weight: 700; } #log .ok { color: #7ee2a8; } #log .err { color: #ff8a80; }
.gosu-state { font-size: 13px; margin-bottom: 8px; }
.gosu-state.on { color: var(--ok); } .gosu-state.off { color: var(--err); }
.grid2 { display: grid; gap: 6px; }
footer { text-align: center; color: var(--muted); font-size: 12px; padding: 16px; }
footer a { color: var(--blue); }
.empty { color: var(--muted); text-align: center; padding: 24px 0; }
#shot { max-width: 100%; border-radius: 6px; border: 1px solid var(--line); margin-top: 8px; }
/* 登入頁 */
.login-wrap { min-height: 100vh; display: grid; place-items: center; background: radial-gradient(circle at 30% 20%, #1b4b8a, #0b2545 60%, #06152a); }
.login { width: min(360px, calc(100vw - 32px)); background: #fff; border-radius: 12px; padding: 24px; box-shadow: 0 20px 60px rgba(0,0,0,.35); display: grid; gap: 10px; }
.login h1 { margin: 0; font-size: 18px; color: var(--navy); }
.login .err { color: var(--err); font-size: 13px; min-height: 18px; }
.steps .when input[type=date] { width: auto; flex: 1; border: 1px solid #c9d3e1; border-radius: 6px; padding: 4px 6px; font: inherit; }
.steps .test { color: var(--survey); }

/* 自動上架、日曆 */
.auto-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.auto-head h2 { margin: 0; }
.switch { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; font-weight: 700; }
.switch input { appearance: none; width: 38px; height: 22px; border-radius: 11px; background: #c9d3e1; position: relative; cursor: pointer; transition: background .15s; margin: 0; }
.switch input::after { content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: left .15s; }
.switch input:checked { background: var(--ok); }
.switch input:checked::after { left: 19px; }
.cal-wrap { display: grid; grid-template-columns: 340px minmax(0, 1fr); gap: 16px; margin-top: 10px; align-items: start; }
@media (max-width: 720px) { .cal-wrap { grid-template-columns: minmax(0, 1fr); } }
.cal-nav { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }
.cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 3px; }
.cal-grid .dow { text-align: center; font-size: 11px; color: var(--muted); }
.cal-grid .d { min-height: 44px; border: 1px solid var(--line); border-radius: 6px; padding: 2px 4px; font-size: 12px; background: #fff; text-align: left; display: flex; flex-direction: column; color: var(--ink); }
.cal-grid .d.blank { border: 0; background: none; }
.cal-grid .d.today { outline: 2px solid var(--sky); }
.cal-grid .d.has { cursor: pointer; }
.cal-grid .d.has:hover { border-color: var(--blue); }
.cal-grid .d.sel { box-shadow: inset 0 0 0 2px var(--navy); }
.cal-grid .d .n { font-size: 10px; color: var(--muted); margin-top: auto; line-height: 1.2; }
.cal-grid .d.part { background: #fff8e1; }
.cal-grid .d.done { background: #e8f5e9; }
.cal-grid .d.early { box-shadow: inset 0 0 0 2px #7b1fa2; }
.cal-grid .d.early .n::before { content: "提早 "; color: #7b1fa2; font-weight: 700; }
.cal-grid .d:disabled { cursor: default; }
.daybox:not(:empty) { border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; margin-bottom: 12px; }
.daybox-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; }
.daybox-head h3 { margin: 0; }
.daylist { list-style: none; padding: 0; margin: 8px 0 0; }
.daylist li { padding: 6px 0; border-top: 1px solid var(--line); }
.daylist .t { font-weight: 600; }
.daylist .meta { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; margin-top: 3px; }
.early-btn { background: #7b1fa2; color: #fff; }
.early-tag { margin-left: 8px; font-size: 12px; color: #7b1fa2; font-weight: 700; }
.cal-legend { display: flex; gap: 10px; margin-top: 6px; font-size: 11px; color: var(--muted); }
.lg::before { content: ""; display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 4px; vertical-align: -1px; border: 1px solid var(--line); }
.lg.done::before { background: #e8f5e9; } .lg.part::before { background: #fff8e1; } .lg.early::before { box-shadow: inset 0 0 0 2px #7b1fa2; }
.next { font-size: 12px; }
.next h3 { font-size: 13px; margin: 0 0 6px; color: var(--navy2); }
.next ul { margin: 0 0 8px; padding-left: 18px; }
.next .err { color: var(--err); }
.prog { display: inline-flex; gap: 3px; }
.prog span { font-size: 11px; border-radius: 4px; padding: 0 5px; background: #eef1f5; color: var(--muted); }
.prog span.y { background: #e8f5e9; color: var(--ok); font-weight: 700; }
.tag.newsletter { background: #fff3e0; color: #e65100; }
#earlyWrap { color: #7b1fa2; }
[hidden] { display: none !important; }
.filters label.row:has(#day) { min-width: 0; max-width: 100%; } .filters #day { min-width: 0; max-width: 100%; flex: 1; }
