:root {
  color-scheme: light;
  --ink: #1c1b1a;
  --muted: #6f6b65;
  --paper: #f4f1eb;
  --panel: #fffdf9;
  --line: #ddd8cf;
  --accent: #f05a28;
  --accent-dark: #c94318;
  --green: #19764c;
  --shadow: 0 14px 44px rgba(45,36,27,.09);
}
* { box-sizing: border-box; }
html { font-size: 16px; scroll-behavior: smooth; }
body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  color: var(--ink);
  background: radial-gradient(circle at 88% 3%, rgba(240,90,40,.11), transparent 22rem), var(--paper);
  font-family: "Noto Sans TC", "PingFang TC", "Microsoft JhengHei", system-ui, sans-serif;
  line-height: 1.55;
}
button, input, textarea, select { font: inherit; }
button { cursor: pointer; }
.topbar {
  height: 68px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 30px;
  border-bottom: 1px solid var(--line);
  background: rgba(244,241,235,.9);
  backdrop-filter: blur(16px);
  position: sticky;
  top: 0;
  z-index: 20;
}
.brand { display: flex; align-items: center; gap: 11px; color: inherit; text-decoration: none; font-weight: 800; }
.brand-mark { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 10px; color: #fff; background: var(--ink); font-weight: 900; }
.topbar-actions { display: flex; align-items: center; gap: 12px; }
.mode-badge { display: inline-flex; align-items: center; gap: 8px; padding: 7px 11px; border: 1px solid var(--line); border-radius: 999px; background: var(--panel); color: var(--muted); font-size: .82rem; font-weight: 700; }
.mode-badge i { width: 8px; height: 8px; border-radius: 50%; background: #e7a21a; box-shadow: 0 0 0 4px rgba(231,162,26,.14); }
.ghost, .icon, .text-button { border: 0; background: transparent; color: var(--ink); font-weight: 750; }
.ghost { padding: 8px 10px; }
.workspace {
  width: min(1530px,100%);
  min-height: calc(100vh - 68px);
  margin: auto;
  display: grid;
  grid-template-columns: minmax(270px,.82fr) minmax(380px,1.08fr) minmax(360px,1fr);
}
.panel { padding: 30px; min-width: 0; }
.brief-panel, .editor-panel { border-right: 1px solid var(--line); }
.brief-panel { background: rgba(255,253,249,.48); }
.editor-panel { background: var(--panel); }
.preview-panel { background: #eeeae3; }
.section-head { display: flex; justify-content: space-between; align-items: start; gap: 16px; margin-bottom: 28px; }
.section-head.compact { align-items: center; margin-bottom: 20px; }
.eyebrow { margin: 0 0 5px; color: var(--accent-dark); font-size: .72rem; font-weight: 900; letter-spacing: .12em; }
h1, h2 { margin: 0; line-height: 1.2; letter-spacing: -.025em; }
h1 { font-size: clamp(1.65rem,2vw,2.15rem); }
h2 { font-size: 1.45rem; }
.pill { padding: 5px 10px; border: 1px solid var(--line); border-radius: 999px; color: var(--muted); font-size: .75rem; }
label, legend { display: block; margin-bottom: 7px; color: #48443f; font-size: .84rem; font-weight: 800; }
input, textarea, select {
  width: 100%;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--ink);
  background: #fff;
  outline: none;
  transition: border-color .18s, box-shadow .18s;
}
input:focus, textarea:focus, select:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(240,90,40,.13); }
textarea { resize: vertical; }
form > input, form > textarea, .two-cols, fieldset { margin-bottom: 18px; }
.two-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
fieldset { padding: 0; border: 0; }
.segmented { display: grid; grid-template-columns: repeat(3,1fr); padding: 4px; border: 1px solid var(--line); border-radius: 11px; background: #ebe7df; }
.segmented label { margin: 0; }
.segmented input { position: absolute; opacity: 0; pointer-events: none; }
.segmented span { display: block; padding: 7px 6px; border-radius: 7px; text-align: center; color: var(--muted); font-size: .8rem; }
.segmented input:checked + span { color: var(--ink); background: #fff; box-shadow: 0 2px 7px rgba(35,30,26,.1); }
.primary, .publish, .approval button { width: 100%; border: 0; border-radius: 10px; font-weight: 850; transition: transform .16s, background .16s; }
.primary { display: flex; justify-content: space-between; align-items: center; padding: 13px 15px; color: #fff; background: var(--ink); }
.primary:hover, .publish:hover:not(:disabled) { transform: translateY(-1px); }
.primary.loading span:first-child::after { content: "…"; }
.safety { display: flex; align-items: start; gap: 10px; margin-top: 18px; padding: 13px; border: 1px solid #cde6d8; border-radius: 10px; background: #e9f6ef; color: #335d49; font-size: .78rem; }
.safety b { flex: 0 0 auto; display: grid; place-items: center; width: 19px; height: 19px; border-radius: 50%; color: #fff; background: var(--green); font-size: .7rem; }
.icon { width: 35px; height: 35px; border: 1px solid var(--line); border-radius: 9px; font-size: 1.25rem; background: #fff; }
.tabs { display: flex; gap: 6px; margin-bottom: 13px; border-bottom: 1px solid var(--line); }
.tab { padding: 9px 12px; border: 0; border-bottom: 2px solid transparent; color: var(--muted); background: transparent; font-size: .85rem; font-weight: 800; }
.tab.active { border-color: var(--accent); color: var(--ink); }
.quality { display: flex; flex-wrap: wrap; gap: 8px 16px; margin-bottom: 11px; color: var(--muted); font-size: .74rem; }
.quality b { color: var(--green); }
.draft { min-height: 286px; border: 0; border-radius: 0; padding: 17px 2px; background: transparent; font-size: .98rem; line-height: 1.78; box-shadow: none !important; }
.quick { display: flex; flex-wrap: wrap; align-items: center; gap: 7px; padding-top: 13px; border-top: 1px solid var(--line); color: var(--muted); font-size: .76rem; }
.quick button { padding: 6px 9px; border: 1px solid var(--line); border-radius: 999px; background: #fff; color: #514c46; font-size: .76rem; }
.quick button:hover { border-color: var(--accent); color: var(--accent-dark); }
.image-brief { margin-top: 22px; padding: 15px; border: 1px solid var(--line); border-radius: 12px; background: #f8f5ef; }
.image-brief header { display: flex; justify-content: space-between; gap: 12px; align-items: start; }
.image-brief p:last-child { margin: 9px 0 0; color: var(--muted); font-size: .8rem; }
.text-button { padding: 4px 0; color: var(--accent-dark); font-size: .78rem; }
.approval { display: flex; justify-content: space-between; gap: 14px; align-items: center; margin-top: 18px; padding: 14px; border: 1px solid var(--line); border-radius: 12px; }
small { display: block; margin-bottom: 2px; color: var(--muted); font-size: .7rem; }
.approval button { width: auto; padding: 9px 13px; color: #fff; background: var(--accent); }
.approval.approved { border-color: #b8ddc8; background: #e9f6ef; }
.approval.approved button { color: var(--green); background: #fff; }
.facebook-card { overflow: hidden; border: 1px solid #dedbd5; border-radius: 14px; background: #fff; box-shadow: var(--shadow); }
.fb-head { display: flex; align-items: center; gap: 10px; padding: 15px; }
.avatar { width: 42px; height: 42px; display: grid; place-items: center; flex: 0 0 auto; border-radius: 50%; color: #fff; background: linear-gradient(145deg,#d75b2e,#6d321f); font-family: serif; font-weight: 900; }
.fb-head strong { display: block; font-size: .88rem; }
.fb-head p { margin: 2px 0 0; color: #737373; font-size: .72rem; }
.more { margin-left: auto; color: #777; letter-spacing: 2px; }
.fb-copy { display: -webkit-box; overflow: hidden; min-height: 75px; margin: 0; padding: 0 15px 13px; white-space: pre-wrap; -webkit-line-clamp: 4; -webkit-box-orient: vertical; font-size: .83rem; line-height: 1.55; }
.post-image { position: relative; aspect-ratio: 1; overflow: hidden; background: #b77654; }
.post-image img { width: 100%; height: 100%; display: block; object-fit: cover; transition: transform .35s, filter .35s; }
.post-image.refreshing img { transform: scale(1.035); filter: saturate(.75) brightness(.92); }
.post-image span { position: absolute; right: 11px; top: 11px; padding: 5px 8px; border-radius: 999px; color: #fff; background: rgba(18,17,16,.7); backdrop-filter: blur(7px); font-size: .67rem; font-weight: 800; }
.engagement, .fb-actions { display: flex; justify-content: space-between; padding: 9px 14px; color: #717171; font-size: .72rem; }
.fb-actions { border-top: 1px solid #eee; font-size: .78rem; font-weight: 750; }
.fb-actions span { flex: 1; text-align: center; }
.publish-box, .activity { margin-top: 17px; padding: 15px; border: 1px solid var(--line); border-radius: 12px; background: rgba(255,253,249,.8); }
.publish-row { display: flex; justify-content: space-between; align-items: center; margin-bottom: 13px; }
.switch { width: 44px; height: 25px; padding: 3px; border: 0; border-radius: 99px; background: #b7b1aa; }
.switch span { display: block; width: 19px; height: 19px; border-radius: 50%; background: #fff; transition: transform .2s; }
.switch.active { background: var(--ink); }
.switch.active span { transform: translateX(19px); }
.publish { padding: 12px; color: #fff; background: var(--accent); }
.publish:disabled { cursor: not-allowed; color: #a8a39d; background: #dfdbd4; }
.publish-box > p { margin: 7px 0 0; color: var(--muted); text-align: center; font-size: .72rem; }
.activity ol { margin: 10px 0 0; padding: 0; list-style: none; }
.activity li { display: flex; justify-content: space-between; gap: 12px; padding: 7px 0; border-top: 1px solid rgba(221,216,207,.75); color: #504b45; font-size: .75rem; }
.activity time { flex: 0 0 auto; color: var(--muted); }
.toast { position: fixed; left: 50%; bottom: 24px; z-index: 30; transform: translate(-50%,20px); padding: 11px 15px; border-radius: 9px; color: #fff; background: var(--ink); box-shadow: 0 10px 30px rgba(0,0,0,.2); opacity: 0; pointer-events: none; transition: .22s; font-size: .84rem; }
.toast.show { transform: translate(-50%,0); opacity: 1; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
@media (max-width: 1120px) {
  .workspace { grid-template-columns: minmax(280px,.82fr) minmax(410px,1.18fr); }
  .preview-panel { grid-column: 1/-1; display: grid; grid-template-columns: minmax(360px,520px) minmax(280px,1fr); gap: 18px; align-items: start; }
  .preview-heading { grid-column: 1/-1; margin-bottom: 0 !important; }
  .publish-box { margin-top: 0; }
}
@media (max-width: 760px) {
  .topbar { height: 62px; padding: 0 16px; }
  .mode-badge { display: none; }
  .workspace, .preview-panel { display: block; }
  .panel { padding: 24px 18px; border-right: 0; border-bottom: 1px solid var(--line); }
  .preview-heading { margin-bottom: 18px !important; }
  .facebook-card, .publish-box, .activity { max-width: 520px; margin-left: auto; margin-right: auto; }
}
@media (max-width: 430px) {
  .two-cols { grid-template-columns: 1fr; }
  .topbar-actions .ghost { font-size: .78rem; }
  .panel { padding-inline: 14px; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; } }
