:root {
  --ink: #1c2b31;
  --muted: #6d7d80;
  --line: #dfe8e5;
  --surface: #ffffff;
  --canvas: #f4f8f6;
  --teal: #158277;
  --teal-dark: #0d5d58;
  --mint: #e7f5f0;
  --coral: #c96b4c;
  --shadow: 0 12px 35px rgba(27, 57, 52, .07);
}

* { box-sizing: border-box; }
html { min-width: 320px; background: var(--canvas); }
body { margin: 0; color: var(--ink); background: var(--canvas); font: 14px/1.55 "Microsoft YaHei", "PingFang SC", Arial, sans-serif; }
button, input { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .55; }
code, pre { font-family: Consolas, "SFMono-Regular", monospace; }

.shell { width: min(1120px, 100%); margin: 0 auto; padding: 0 22px 48px; }
.topbar { height: 68px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); }
.brand-mark { color: var(--teal-dark); font-size: 17px; font-weight: 800; letter-spacing: .05em; }
.topbar-meta { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 12px; }
.environment-dot { width: 8px; height: 8px; border-radius: 50%; background: #51aa86; box-shadow: 0 0 0 4px #e0f1ea; }
.hero { display: flex; align-items: end; justify-content: space-between; gap: 28px; padding: 46px 0 32px; }
.eyebrow, .section-kicker { margin: 0; color: var(--teal); font-size: 10px; font-weight: 800; letter-spacing: .16em; }
h1, h2, p { margin: 0; }
h1 { margin-top: 9px; font-size: clamp(27px, 4vw, 42px); line-height: 1.1; letter-spacing: 0; }
h2 { font-size: 18px; line-height: 1.2; }
.hero-copy { margin-top: 12px; max-width: 620px; color: var(--muted); }
.config-chip { display: grid; gap: 4px; min-width: 240px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 6px; background: rgba(255,255,255,.65); color: var(--muted); font-size: 10px; }
.config-chip code { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ink); font-size: 11px; }
.grid { display: grid; grid-template-columns: minmax(280px, .8fr) minmax(400px, 1.2fr); gap: 18px; align-items: start; }
.success-layout { grid-template-columns: minmax(280px, .8fr) minmax(400px, 1.2fr); }
.panel { border: 1px solid var(--line); border-radius: 7px; background: var(--surface); box-shadow: var(--shadow); }
.auth-panel, .order-panel { padding: 22px; }
.panel-title { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 22px; }
.panel-title h2 { margin-top: 5px; }
.status-pill { display: inline-flex; align-items: center; min-height: 24px; padding: 3px 9px; border: 1px solid #c6ded8; border-radius: 999px; color: var(--teal-dark); background: var(--mint); font-size: 11px; font-weight: 700; white-space: nowrap; }
.status-pill.pending { border-color: #ecd9ad; color: #8c681f; background: #fff7e4; }
.status-pill.success { border-color: #b9dfcd; color: #18734f; background: #e9f7ef; }
.status-pill.danger { border-color: #efc7bb; color: #a44930; background: #fff0eb; }
.status-pill.muted { border-color: #d6dddd; color: #697777; background: #f3f6f6; }
.user-row { display: flex; align-items: center; gap: 12px; padding: 12px; border: 1px solid var(--line); background: #fbfdfc; }
.user-row img, .avatar-fallback { width: 42px; height: 42px; border-radius: 50%; object-fit: cover; }
.avatar-fallback { display: grid; place-items: center; color: #fff; background: var(--teal); font-weight: 800; }
.user-row strong, .user-row span { display: block; }
.user-row span { margin-top: 2px; color: var(--muted); font-size: 12px; }
.muted-copy { color: var(--muted); font-size: 13px; line-height: 1.7; }
.button-row { display: flex; flex-wrap: wrap; gap: 9px; margin-top: 18px; }
.button { min-height: 38px; padding: 8px 14px; border: 0; border-radius: 5px; font-weight: 700; transition: background .18s ease, transform .18s ease; }
.button.primary { color: #fff; background: var(--teal-dark); }
.button.primary:hover:not(:disabled) { background: #084a47; transform: translateY(-1px); }
.button.subtle { border: 1px solid #c9dcda; color: var(--teal-dark); background: #f4faf8; }
.button.subtle:hover:not(:disabled) { background: #e6f3ef; }
.button.text-button { min-height: auto; padding: 2px 0; color: var(--muted); background: transparent; font-size: 12px; }
.button.full { width: 100%; margin-top: 4px; }
.manual-login { margin-top: 24px; padding-top: 19px; border-top: 1px solid var(--line); }
.manual-login label { display: grid; gap: 6px; color: #526568; font-size: 12px; font-weight: 700; }
.manual-login small { display: block; margin-top: 7px; color: var(--muted); font-size: 11px; }
.input-row { display: flex; gap: 8px; margin-top: 6px; }
input { width: 100%; min-width: 0; padding: 9px 10px; border: 1px solid #cbdad7; border-radius: 4px; color: var(--ink); background: #fff; outline: none; }
input:focus { border-color: var(--teal); box-shadow: 0 0 0 3px rgba(21,130,119,.12); }
.input-row .button { flex: 0 0 auto; }
.business-order-list { display: grid; gap: 9px; margin-top: 18px; }
.business-order-option { width: 100%; padding: 13px 14px; border: 1px solid var(--line); border-radius: 5px; color: var(--ink); background: #fbfdfc; text-align: left; }
.business-order-option:hover { border-color: #9fcfc5; background: #f4faf8; }
.business-order-option.selected { border-color: var(--teal); background: var(--mint); box-shadow: 0 0 0 2px rgba(21,130,119,.1); }
.business-order-heading, .business-order-meta { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.business-order-heading strong { color: var(--teal-dark); font-size: 12px; }
.business-order-status { color: #8c681f; font-size: 11px; }
.business-order-subject { display: block; margin-top: 5px; font-weight: 700; }
.business-order-meta { margin-top: 7px; color: var(--muted); font-size: 11px; }
.business-order-meta strong { color: var(--coral); font-size: 15px; }
.business-order-description { display: block; margin-top: 7px; color: var(--muted); font-size: 11px; }
.selected-order-summary { display: grid; gap: 3px; margin-top: 14px; padding: 12px 13px; border-left: 3px solid var(--teal); background: #f4faf8; }
.selected-order-summary span, .selected-order-summary small { color: var(--muted); font-size: 11px; }
.selected-order-summary strong { font-size: 13px; }
.order-details { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 22px; }
.detail { min-width: 0; padding: 11px 12px; border: 1px solid var(--line); background: #fbfdfc; }
.detail.highlight { grid-column: 1 / -1; border-color: #b8dcd4; background: var(--mint); }
.detail span, .detail strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.detail span { color: var(--muted); font-size: 11px; }
.detail strong { margin-top: 3px; font-size: 12px; }
.status-text.success { color: #18734f; }
.status-text.pending { color: #8c681f; }
.status-text.danger { color: #a44930; }
.order-actions { margin-top: 14px; }
.payload-details { margin-top: 16px; border-top: 1px solid var(--line); padding-top: 12px; color: var(--muted); font-size: 12px; }
.payload-details summary { cursor: pointer; }
.payload-details pre { max-height: 180px; margin: 10px 0 0; overflow: auto; padding: 12px; color: #49615f; background: #f3f7f6; font-size: 11px; white-space: pre-wrap; word-break: break-all; }
.empty-state { padding: 24px 12px; border: 1px dashed #cbdad7; color: var(--muted); text-align: center; font-size: 13px; }
.empty-state.compact { padding: 12px; border: 0; text-align: left; }
.alert { display: flex; align-items: center; gap: 10px; margin-bottom: 18px; padding: 12px 14px; border: 1px solid #efc7bb; border-radius: 5px; color: #8d432f; background: #fff4ef; }
.alert strong { flex: 0 0 auto; }
.alert span { flex: 1; min-width: 0; }
.alert-close { border: 0; color: inherit; background: transparent; font-size: 20px; line-height: 1; }
.log-panel { margin-top: 18px; padding: 20px 22px; }
.log-panel .panel-title { margin-bottom: 8px; }
.logs { max-height: 260px; overflow: auto; }
.log-line { display: grid; grid-template-columns: 76px 42px minmax(130px, auto) 1fr; gap: 8px; align-items: baseline; padding: 8px 0; border-bottom: 1px solid #edf2f1; font-size: 12px; }
.log-line time { color: #94a2a2; font-size: 11px; }
.log-line code { min-width: 0; overflow: hidden; color: var(--muted); text-overflow: ellipsis; white-space: nowrap; font-size: 11px; }
.log-type { color: #8c681f; }
.log-type.success { color: #18734f; }
.log-type.danger { color: #a44930; }
.footer { padding: 24px 0 0; color: var(--muted); font-size: 11px; text-align: center; }

@media (max-width: 780px) {
  .shell { padding: 0 15px 36px; }
  .hero { display: block; padding: 34px 0 24px; }
  .config-chip { min-width: 0; margin-top: 18px; }
  .grid, .success-layout { grid-template-columns: 1fr; }
}

@media (max-width: 480px) {
  .topbar { height: 60px; }
  .topbar-meta { font-size: 11px; }
  h1 { font-size: 30px; }
  .auth-panel, .order-panel, .log-panel { padding: 17px; }
  .input-row { display: grid; grid-template-columns: 1fr; }
  .input-row .button { width: 100%; }
  .order-details { grid-template-columns: 1fr; }
  .detail.highlight { grid-column: auto; }
  .log-line { grid-template-columns: 62px 36px 1fr; }
  .log-line code { grid-column: 3; }
}
