.cp-root {
  --cp-bg: #ffffff;
  --cp-soft: #f6f7f8;
  --cp-surface: #ffffff;
  --cp-ink: #30343b;
  --cp-muted: #626873;
  --cp-border: #dfe2e6;
  --cp-active: #eceef1;
  --cp-error: #91342d;
  box-sizing: border-box;
  width: 100%;
  max-width: 1400px;
  margin: 0 auto;
  padding: 48px 32px 64px;
  background: var(--cp-bg);
  color: var(--cp-ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  font-size: 16px;
  line-height: 1.6;
  color-scheme: light;
  text-align: left;
  overflow-wrap: anywhere;
}
.cp-root *, .cp-root *::before, .cp-root *::after { box-sizing: border-box; }
.cp-root [hidden] { display: none !important; }
.cp-root p { margin: 0 0 12px; }
.cp-root h1, .cp-root h2, .cp-root h3 { color: var(--cp-ink); }
.cp-root button, .cp-root input { font: inherit; }
.cp-header { margin-bottom: 24px; }
.cp-eyebrow { color: var(--cp-muted); font-size: 13px; font-weight: 600; letter-spacing: .06em; }
.cp-title { margin: 0 0 12px; font-size: clamp(28px, 3vw, 38px); line-height: 1.25; font-weight: 650; letter-spacing: -.035em; }
.cp-description { color: var(--cp-muted); max-width: 780px; }
.cp-note { margin: 0 0 24px; padding: 16px 20px; border: 1px solid var(--cp-border); border-radius: 10px; background: var(--cp-surface); color: var(--cp-muted); font-size: 14px; }
.cp-note p:last-child { margin-bottom: 0; }
.cp-card { min-width: 0; margin-bottom: 24px; padding: 28px; border: 1px solid var(--cp-border); border-radius: 12px; background: var(--cp-surface); box-shadow: none; }
.cp-section-title { margin: 0 0 20px; font-size: 20px; line-height: 1.4; font-weight: 650; }
.cp-subtitle { margin: 24px 0 12px; font-size: 17px; font-weight: 650; }
.cp-help { color: var(--cp-muted); font-size: 14px; }
.cp-form { margin: 0; }
.cp-stock-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; margin: 24px 0; }
.cp-field { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.cp-label { display: block; margin-bottom: 7px; font-size: 14px; font-weight: 600; color: var(--cp-ink); }
.cp-field .cp-label { margin-bottom: 0; }
.cp-root .cp-input { width: 100%; min-height: 44px; margin: 0; padding: 10px 12px; border: 1px solid var(--cp-border); border-radius: 7px; background: var(--cp-surface); color: var(--cp-ink); box-shadow: none; }
.cp-root .cp-button, .cp-root .cp-picker-trigger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 44px;
  max-width: 100%;
  margin: 0;
  padding: 10px 16px;
  border: 1px solid var(--cp-border);
  border-radius: 7px;
  background: var(--cp-surface);
  color: var(--cp-ink);
  font-size: 14px;
  line-height: 1.5;
  font-weight: 600;
  text-align: center;
  cursor: pointer;
  box-shadow: none;
  transition: background-color 140ms ease, border-color 140ms ease;
}
.cp-root .cp-button:hover:not(:disabled), .cp-root .cp-picker-trigger:hover { background: var(--cp-soft); border-color: #a7adb6; }
.cp-root .cp-button[aria-pressed="true"] { background: var(--cp-active); border-color: var(--cp-ink); }
.cp-root .cp-button:disabled { cursor: not-allowed; color: #737a84; background: var(--cp-soft); }
.cp-root .cp-primary { padding: 12px 24px; background: var(--cp-ink); color: #ffffff; border-color: var(--cp-ink); font-size: 16px; }
.cp-root .cp-primary:hover:not(:disabled) { background: #464c55; border-color: #464c55; }
.cp-root :is(button, input, summary, a, [tabindex]):focus-visible { outline: 2px solid #424954; outline-offset: 3px; }
.cp-segment, .cp-choice-grid, .cp-actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.cp-choice-grid { margin-bottom: 14px; }
.cp-count-area { padding-top: 12px; }
.cp-count-field { max-width: 330px; margin-bottom: 12px; }
.cp-count-area .cp-help { margin-top: 12px; }
.cp-target-area { max-width: 680px; }
.cp-target-area .cp-help { margin-top: 14px; }
.cp-target-area .cp-segment { margin-bottom: 16px; }
.cp-individual-goal { margin-top: 12px; }
.cp-add-panel { margin-top: 16px; padding: 18px; border: 1px solid var(--cp-border); border-radius: 9px; background: var(--cp-soft); }
.cp-inline-fields { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; margin: 14px 0; }
.cp-group-list { display: grid; gap: 12px; margin-top: 16px; }
.cp-group-entry { padding: 16px; border: 1px solid var(--cp-border); border-radius: 9px; background: var(--cp-surface); }
.cp-group-summary { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.cp-group-summary strong { min-width: 0; font-size: 14px; font-weight: 650; }
.cp-group-entry .cp-field { max-width: 420px; margin-top: 14px; }
.cp-picker:focus-within { z-index: 31; }
.cp-uniform { display: flex; align-items: flex-end; flex-wrap: wrap; gap: 12px; margin: 20px 0; }
.cp-uniform .cp-picker { width: min(100%, 420px); }
.cp-actions + .cp-help { margin-top: 12px; }
.cp-groups { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); align-items: start; gap: 20px; margin-top: 20px; }
.cp-group { min-width: 0; margin: 0; padding: 16px; border: 1px solid var(--cp-border); border-radius: 9px; background: var(--cp-surface); }
.cp-group-title { padding: 0 6px; font-size: 14px; font-weight: 650; }
.cp-gem + .cp-gem { margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--cp-border); }
.cp-check { display: flex; align-items: center; gap: 10px; min-height: 44px; margin-bottom: 4px; color: var(--cp-ink); font-size: 14px; font-weight: 600; cursor: pointer; }
.cp-root .cp-check input { flex: 0 0 auto; width: 18px; height: 18px; margin: 0; accent-color: var(--cp-ink); }
.cp-picker { position: relative; min-width: 0; }
.cp-root .cp-picker-trigger { display: flex; justify-content: space-between; width: 100%; padding: 10px 12px; font-weight: 400; text-align: left; }
.cp-chevron { flex: 0 0 auto; width: 7px; height: 7px; margin: 0 3px 4px 6px; border-right: 1.5px solid var(--cp-muted); border-bottom: 1.5px solid var(--cp-muted); transform: rotate(45deg); }
.cp-picker-panel { position: absolute; top: 100%; left: 0; z-index: 30; width: 100%; max-height: min(320px, 48vh); overflow-y: auto; overscroll-behavior: contain; padding: 6px; margin-top: 5px; border: 1px solid #b9bec6; border-radius: 8px; background: var(--cp-surface); box-shadow: 0 8px 24px #30343b14; scroll-padding: 8px; }
.cp-root .cp-option { display: block; width: 100%; min-height: 44px; padding: 10px 8px; margin: 0; border: 1px solid transparent; border-radius: 5px; background: var(--cp-surface); color: var(--cp-ink); font-size: 14px; line-height: 1.5; font-weight: 400; text-align: left; cursor: pointer; }
.cp-root .cp-option:hover, .cp-root .cp-option[aria-selected="true"] { background: var(--cp-active); }
.cp-root .cp-option:focus-visible { outline-offset: -2px; }
.cp-details { min-width: 0; margin-top: 20px; border-top: 1px solid var(--cp-border); }
.cp-details > summary { display: list-item; min-height: 44px; padding: 14px 0; color: var(--cp-ink); font-size: 14px; font-weight: 600; cursor: pointer; }
.cp-order-list { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin: 0; padding: 0; list-style: none; }
.cp-order-item { display: flex; align-items: center; gap: 8px; padding: 8px; border: 1px solid var(--cp-border); border-radius: 7px; }
.cp-order-item > span { flex: 1; min-width: 0; font-size: 14px; }
.cp-root .cp-order-item .cp-button { flex: 0 0 auto; padding: 8px 10px; font-size: 13px; }
.cp-submit-area { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 20px; margin: 0 0 24px; }
.cp-submit-area .cp-help { flex: 1 1 280px; margin: 0; }
.cp-error { width: 100%; color: var(--cp-error); font-size: 14px; }
.cp-error:empty { display: none; }
.cp-results { scroll-margin-top: 24px; }
.cp-result-summary { font-size: 17px; font-weight: 600; }
.cp-table-wrap { width: 100%; max-width: 100%; overflow-x: auto; margin: 16px 0; border: 1px solid var(--cp-border); border-radius: 7px; overscroll-behavior-x: contain; }
.cp-table { width: 100%; margin: 0; border-collapse: collapse; background: var(--cp-surface); color: var(--cp-ink); font-size: 14px; text-align: left; }
.cp-table th, .cp-table td { padding: 12px 14px; border: 0; border-bottom: 1px solid var(--cp-border); vertical-align: top; min-width: 112px; font-variant-numeric: tabular-nums; }
.cp-table th { background: var(--cp-soft); color: var(--cp-muted); font-weight: 600; white-space: nowrap; }
.cp-table tbody tr:last-child td { border-bottom: 0; }
.cp-table tbody tr:hover td { background: var(--cp-soft); }
.cp-table td { line-height: 1.6; }
.cp-table td:nth-child(2), .cp-table td:nth-child(3) { min-width: 150px; }
.cp-source-link { display: inline-block; min-height: 44px; padding: 10px 0; margin-bottom: 8px; color: var(--cp-ink); text-decoration: underline; text-underline-offset: 4px; }
.cp-loading { padding: 24px; color: var(--cp-muted); }
.cp-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: 1100px) {
  .cp-groups, .cp-order-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
  .cp-root { padding: 24px 16px 40px; }
  .cp-header { margin-bottom: 20px; }
  .cp-card { padding: 20px 16px; margin-bottom: 20px; }
  .cp-note { padding: 14px 16px; margin-bottom: 20px; }
  .cp-stock-grid { grid-template-columns: 1fr; gap: 14px; }
  .cp-inline-fields { grid-template-columns: 1fr; gap: 12px; }
  .cp-group-summary { align-items: flex-start; flex-direction: column; gap: 10px; }
  .cp-groups, .cp-order-list { grid-template-columns: 1fr; gap: 14px; }
  .cp-choice-grid { display: grid; grid-template-columns: 1fr; }
  .cp-uniform { align-items: stretch; }
  .cp-uniform > .cp-picker, .cp-uniform > .cp-button { width: 100%; }
  .cp-count-field { max-width: none; }
  .cp-section-title { font-size: 18px; }
  .cp-submit-area > .cp-primary { width: 100%; }
  .cp-picker-panel { max-height: min(280px, 44vh); }
  .cp-table th, .cp-table td { padding: 10px 12px; }
}
@media (prefers-reduced-motion: reduce) {
  .cp-root .cp-button, .cp-root .cp-picker-trigger { transition: none; }
}
