:root {
  --orange: #ef5218;
  --orange-soft: #fff2e9;
  --coffee: #ead8c8;
  --coffee-text: #805a43;
  --surface: #fff;
  --bg: #f8f6f2;
  --text: #251f1b;
  --muted: #756b64;
  --line: #e7dfd8;
  --red: #cf4338;
  --green: #39835a;
  --shadow: 0 12px 36px rgba(76, 46, 28, 0.14);
  --choice-pill-radius: 999px;
  font-family:
    -apple-system, BlinkMacSystemFont, "PingFang HK", "Noto Sans TC",
    "Microsoft JhengHei", sans-serif;
  color: var(--text);
}
:root[data-theme="warm"]{--orange:#ef5218;--orange-soft:#fff2e9;--bg:#f8f6f2;--text:#251f1b;--line:#e7dfd8}
:root[data-theme="tea"]{--orange:#845d45;--orange-soft:#f5eee8;--bg:#f7f4f0;--text:#2d211b;--line:#e2d8cf}
:root[data-theme="sprout"]{--orange:#34755e;--orange-soft:#eaf4ef;--bg:#f3f7f4;--text:#17251f;--line:#d7e3dc}
:root[data-theme="purple"]{--orange:#755d86;--orange-soft:#f1edf4;--bg:#f7f4f8;--text:#281f2d;--line:#e1d9e5}
:root[data-theme="sunset"]{--orange:#a95048;--orange-soft:#f8ecea;--bg:#f8f4f2;--text:#2e1e1c;--line:#e6d7d3}
:root[data-theme="mist"]{--orange:#4d6477;--orange-soft:#edf2f5;--bg:#f4f6f7;--text:#1c252c;--line:#d8e0e5}
* {
  box-sizing: border-box;
}
html,
body {
  margin: 0;
  width: 1280px;
  height: 800px;
  min-height: 0;
  overflow: hidden;
  background: var(--bg);
}
#app{width:1280px;height:800px;min-height:0;overflow:hidden}
button,
input,
select,
textarea {
  font: inherit;
}
button {
  cursor: pointer;
}
.app {
  width: 1280px;
  height: 800px;
  display: flex;
  flex-direction: column;
  background: var(--bg);
}
.topbar {
  height: 78px;
  display: flex;
  align-items: center;
  padding: 0 28px;
  gap: 18px;
  background: #fff;
  border-bottom: 1px solid var(--line);
  flex: none;
}
.brand {
  font-size: 25px;
  font-weight: 950;
  color: var(--orange);
}
.serial small {
  display: block;
  color: var(--muted);
}
.serial strong {
  font-size: 20px;
}
.spacer {
  flex: 1;
}
.top-btn {
  min-height: 48px;
  padding: 10px 15px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: #fff;
  font-weight: 850;
}
.top-btn.active {
  background: #fff5ef;
  border-color: #d7b8a6;
  color: #8d4d2c;
}
.badge {
  display: inline-grid;
  place-items: center;
  min-width: 27px;
  height: 27px;
  border-radius: 999px;
  background: var(--orange);
  color: #fff;
  font-size: 13px;
}
.workspace {
  flex: 1;
  min-height: 0;
  padding: 16px 20px;
}
.bottom-nav {
  height: 76px;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 10px;
  padding: 7px 16px;
  background: #fff;
  border-top: 1px solid var(--line);
  flex: none;
}
.bottom-nav button {
  position: relative;
  border: 1px solid transparent;
  background: #fff;
  font-weight: 850;
  font-size: 17px;
}
.shell-nav-button{display:grid;grid-template-rows:25px auto;place-content:center;place-items:center;gap:2px;min-width:0;padding:5px 12px;border-radius:var(--choice-pill-radius)}
.shell-nav-button.active{background:var(--orange-soft);border-color:color-mix(in srgb,var(--orange) 44%,white);color:var(--orange);box-shadow:0 3px 12px color-mix(in srgb,var(--orange) 15%,transparent)}
.shell-nav-icon{width:25px;height:25px;display:block}
.shell-nav-badge{position:absolute;top:3px;left:calc(50% + 10px);min-width:20px;height:20px;padding:0 5px;display:grid;place-items:center;border-radius:999px;background:var(--red);color:#fff;font-size:11px}

/* 所有文字式單選／篩選控制共用同一套膠囊語言；內容卡仍保留卡片選中框。 */
:is(
  .top-btn,
  .category-page > button,
  .category-search,
  .categories > button,
  .segmented > button,
  .channels > button,
  .payments > button,
  .option-grid > button,
  .option-chips > button,
  .source-picker > button,
  .tabs > button,
  .status-filter > button,
  .mode-choice,
  .issue-quick > button,
  .method-grid > button,
  .theme
) {
  border-radius: var(--choice-pill-radius) !important;
}
:is(
  .top-btn,
  .category-page > button,
  .category-search,
  .categories > button,
  .segmented > button,
  .channels > button,
  .payments > button,
  .option-grid > button,
  .option-chips > button,
  .source-picker > button,
  .tabs > button,
  .status-filter > button,
  .mode-choice,
  .issue-quick > button,
  .method-grid > button,
  .theme
).active {
  background: var(--orange-soft) !important;
  border-color: color-mix(in srgb,var(--orange) 56%,white) !important;
  color: var(--orange) !important;
  box-shadow: 0 3px 11px color-mix(in srgb,var(--orange) 14%,transparent);
}
.global-statusbar{height:78px;min-height:78px}
.shell-brand{display:flex;align-items:center;gap:9px;white-space:nowrap}.shell-brand-mark{width:38px;height:38px;display:grid;place-items:center;border-radius:50%;background:var(--orange);color:#fff;font-size:19px}.shell-brand strong{font-size:25px}
.shell-terminal,.shell-context,.shell-operation{min-height:38px;display:inline-flex;align-items:center;padding:0 12px;border:1px solid var(--line);border-radius:999px;background:#fff;font-weight:850;white-space:nowrap}.shell-terminal{background:var(--orange-soft);color:var(--orange)}.shell-operation{gap:8px}.shell-operation i{width:10px;height:10px;border-radius:50%;background:var(--green)}.shell-operation.offline i{background:var(--red)}
.shell-last-order{display:grid;gap:1px;min-width:92px}.shell-last-order small{color:var(--muted);font-size:12px}.shell-last-order strong{font-size:20px}.shell-actions{display:flex;align-items:center;gap:10px;min-width:0}
.page-statusbar{height:64px;display:flex;align-items:center;gap:14px;padding:8px 28px;background:#fff;border-bottom:1px solid var(--line);flex:none}
.panel {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 16px;
  overflow: hidden;
}
.btn {
  min-height: 48px;
  padding: 10px 15px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: #fff;
  font-weight: 850;
}
.btn.primary {
  background: var(--orange);
  border-color: var(--orange);
  color: #fff;
}
.btn.danger {
  background: #b84d42;
  border-color: #b84d42;
  color: #fff;
}
.btn:disabled {
  opacity: 0.4;
}
.overlay-scrim {
  position: fixed;
  inset: 0;
  border: 0;
  background: rgba(246, 242, 238, 0.52);
  -webkit-backdrop-filter: blur(12px) saturate(0.82);
  backdrop-filter: blur(12px) saturate(0.82);
  z-index: 80;
  cursor: default;
  touch-action: none;
}
.anchored-popover {
  position: fixed;
  z-index: 81;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 15px;
  box-shadow: var(--shadow);
  padding: 14px;
  max-height: 520px;
  overflow: auto;
}
.anchored-popover header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}
.anchored-popover h2,
.anchored-popover h3 {
  margin: 0;
}
.anchored-card{overflow:visible}
.anchored-card::before{content:"";position:absolute;width:16px;height:16px;background:#fff;border-left:1px solid var(--line);border-top:1px solid var(--line);transform:rotate(45deg);z-index:-1}
.anchored-card[data-arrow-side="top"]::before{top:-9px;left:var(--anchor-x,50%);margin-left:-8px}
.anchored-card[data-arrow-side="right"]::before{right:-9px;top:var(--anchor-y,50%);margin-top:-8px;transform:rotate(135deg)}
.anchored-card[data-arrow-side="bottom"]::before{bottom:-9px;left:var(--anchor-x,50%);margin-left:-8px;transform:rotate(225deg)}
.anchored-card[data-arrow-side="left"]::before{left:-9px;top:var(--anchor-y,50%);margin-top:-8px;transform:rotate(-45deg)}
.close {
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 9px;
  background: #f4f0ec;
}
.chips {
  display: flex;
  gap: 7px;
  flex-wrap: wrap;
}
.chips button {
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #fff;
  padding: 8px 11px;
  font-weight: 800;
}
.chips button.active {
  background: var(--orange-soft);
  border-color: var(--orange);
  color: #9a4f2a;
}
.stepper {
  display: grid;
  grid-template-columns: 58px 1fr 58px;
  align-items: center;
  margin-top: 12px;
  border: 1px solid var(--line);
  border-radius: 11px;
  overflow: hidden;
}
.stepper button {
  height: 54px;
  border: 0;
  background: #fff4ec;
  color: #9b4e28;
  font-size: 28px;
  font-weight: 950;
}
.stepper strong {
  text-align: center;
  font-size: 25px;
}
.toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  transform: translateX(-50%);
  padding: 13px 20px;
  border-radius: 11px;
  background: #222;
  color: #fff;
  z-index: 120;
  opacity: 0;
  pointer-events: none;
  transition: 0.18s;
}
.toast.show {
  opacity: 1;
}
.image-shell {
  position: relative;
  display: grid;
  place-items: center;
  overflow: hidden;
  background: linear-gradient(145deg, #fff6ee, #eadbce);
}
.image-shell img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.image-fallback {
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  color: #966f58;
  font-weight: 850;
}

/* 全局觸控及轉場：短、清楚、適合高峰操作。 */
:root{--shadow-soft:0 4px 16px rgba(76,46,28,.08);--shadow-press:0 2px 7px rgba(76,46,28,.11);--radius-control:12px;--radius-card:18px;--motion-standard:cubic-bezier(.22,1,.36,1)}
button{-webkit-tap-highlight-color:transparent;touch-action:manipulation;transition:transform .16s var(--motion-standard),box-shadow .18s ease,background-color .18s ease,border-color .18s ease,color .18s ease,opacity .18s ease}
button:active:not(:disabled){transform:translateY(1px) scale(.975);box-shadow:var(--shadow-press)}
button:disabled{cursor:not-allowed;opacity:.42}
button:focus-visible,input:focus-visible,select:focus-visible,textarea:focus-visible{outline:3px solid color-mix(in srgb,var(--orange) 28%,transparent);outline-offset:2px;border-color:var(--orange)}
input,select,textarea{transition:border-color .18s ease,box-shadow .18s ease,background-color .18s ease}
.dialog-scrim,.modal-scrim,.overlay-scrim{animation:mf-scrim-in .2s ease-out both}
.detail-dialog,.confirm-dialog,.modal-card,.confirm-card,.anchored-popover{animation:mf-dialog-in .26s var(--motion-standard) both;transform-origin:50% 55%}
.side-panel,.pending-review-panel{animation:mf-drawer-in .28s var(--motion-standard) both}
@keyframes mf-scrim-in{from{opacity:0}to{opacity:1}}
@keyframes mf-dialog-in{from{opacity:0;transform:translateY(14px) scale(.985)}to{opacity:1;transform:translateY(0) scale(1)}}
@keyframes mf-drawer-in{from{opacity:0;transform:translateX(28px)}to{opacity:1;transform:translateX(0)}}
@media (hover:hover){button:not(:disabled):hover{filter:saturate(1.04);box-shadow:var(--shadow-soft)}}
@media (prefers-reduced-motion: reduce){*,*::before,*::after{scroll-behavior:auto!important;animation-duration:.01ms!important;animation-iteration-count:1!important;transition-duration:.01ms!important}button:not(:disabled):active{transform:none}}
