:root { color-scheme: light; font-family: system-ui, -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif; color: #1f2933; background: #f5f7f8; }
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; }
a { color: #176b52; text-decoration: none; }
button, input, select { font: inherit; }
textarea { width: 100%; padding: 11px 12px; border: 1px solid #aebbb6; border-radius: 8px; background: #fff; resize: vertical; font: inherit; }
.topbar { min-height: 64px; padding: 0 24px; background: #fff; border-bottom: 1px solid #dfe5e2; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.brand { color: #153f34; font-weight: 700; }
.user-actions, .actions, .page-heading, .form-actions { display: flex; align-items: center; gap: 16px; }
.actions { flex-wrap: wrap; }
.page { max-width: 1120px; margin: 0 auto; padding: 32px 24px; }
h1 { margin-top: 0; color: #153f34; }
.auth-card, .form-card { max-width: 480px; margin: 48px auto; background: #fff; padding: 28px; border: 1px solid #dfe5e2; border-radius: 12px; }
.stack-form { display: grid; gap: 18px; }
.stack-form label, .stack-form > div { display: grid; gap: 8px; }
input, select { width: 100%; padding: 11px 12px; border: 1px solid #aebbb6; border-radius: 8px; background: #fff; }
.primary, .button { display: inline-flex; justify-content: center; border: 0; border-radius: 8px; padding: 11px 18px; background: #176b52; color: #fff; cursor: pointer; }
.link-button { border: 0; padding: 0; background: transparent; color: #176b52; cursor: pointer; }
.inline-form { display: inline; }
.muted { color: #66756f; }
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; }
.stats { max-width: 480px; margin-bottom: 20px; }
.stats strong { font-size: 28px; }
.nav-grid { margin-bottom: 28px; }
.card, .empty-state { display: grid; gap: 8px; padding: 22px; background: #fff; border: 1px solid #dfe5e2; border-radius: 10px; }
.todo-badge { display: inline-flex; align-items: center; justify-content: center; min-width: 24px; height: 24px; margin-left: 8px; padding: 0 7px; border-radius: 999px; background: #c62828; color: #fff; font-size: 14px; }
.todo-detail { color: #a12626; }
.stage-badge { display: inline-flex; align-items: center; min-height: 28px; padding: 3px 10px; border-radius: 999px; white-space: nowrap; font-weight: 600; }
.stage-attention { background: #fdecec; color: #a12626; }
.stage-progress { background: #fff2d8; color: #805500; }
.stage-done { background: #e5f4ec; color: #176b52; }
.stage-cancelled { background: #edf0ef; color: #66756f; }
.reviewed-link { display: inline-flex; padding: 4px 10px; border-radius: 999px; background: #edf0ef; color: #66756f; }
.card-list { display: grid; gap: 12px; }
.list-card { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 18px; background: #fff; border: 1px solid #dfe5e2; border-radius: 10px; color: inherit; }
.list-card p { margin: 8px 0 0; }
.tag, .status { display: inline-block; margin-left: 8px; padding: 4px 9px; border-radius: 999px; background: #e8f5ee; color: #176b52; }
.detail-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 16px; margin-bottom: 16px; }
.detail-actions { display: flex; justify-content: flex-end; gap: 12px; margin-top: 20px; }
.referral-qr { display: flex; flex-direction: column; align-items: flex-start; gap: 12px; margin-top: 20px; }
.referral-qr img { width: min(280px, 100%); height: auto; padding: 12px; background: #fff; border: 1px solid #d8e1dd; border-radius: 12px; }
.danger, .danger-button { color: #a12626; }
.danger-button { border: 1px solid #d8a5a5; border-radius: 8px; padding: 10px 16px; background: #fff; cursor: pointer; }
.wide-form { max-width: 620px; }
.summary { padding: 14px; background: #eef6f2; border-radius: 8px; }
.customer-summary { padding: 14px; background: #f3f6f5; border-radius: 8px; }
.customer-summary span, .customer-summary strong { display: block; }
pre { margin: 0; padding: 16px; white-space: pre-wrap; background: #f3f6f5; border-radius: 8px; font-family: inherit; }
.management-forms { margin-top: 16px; }
.quote-section { margin-top: 16px; }
.quote-actions { display: flex; gap: 8px; margin-top: 10px; }
.quote-actions .primary, .quote-actions .danger-button { padding: 8px 12px; }
#id_shipping_time { display: flex; flex-wrap: wrap; gap: 16px; }
#id_shipping_time > div label { display: flex; align-items: center; gap: 8px; }
#id_shipping_time input { width: auto; }
.muted-card { color: #75817d; }
.page-heading { justify-content: space-between; margin-bottom: 20px; }
.table-wrap { overflow-x: auto; background: #fff; border: 1px solid #dfe5e2; border-radius: 10px; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 14px 16px; text-align: left; border-bottom: 1px solid #e6ebe9; white-space: nowrap; }
.message { margin-bottom: 16px; padding: 12px 14px; border-radius: 8px; background: #e8f5ee; }
.message.error { background: #fdecec; color: #8a2525; }
.errorlist { margin: 0; color: #a12626; }
.form-actions { justify-content: flex-end; }
.address-page { max-width: 760px; margin: 0 auto; }
.recognition-card { display: grid; gap: 12px; padding: 22px; background: #fff; border: 1px solid #dfe5e2; border-radius: 12px; }
.recognition-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 10px; }
.secondary-button { border: 1px solid #176b52; background: #fff; color: #176b52; }
.recognition-tip, .recognition-status { margin: 0; }
.recognition-status.success { color: #176b52; }
.recognition-status.error { color: #a12626; }
.address-form { max-width: none; margin: 18px 0; }
.two-column-fields { display: grid !important; grid-template-columns: 1fr 1fr; gap: 14px !important; }
.region-fields { display: grid !important; grid-template-columns: repeat(3, 1fr); gap: 14px !important; }
.common-addresses { margin-top: 28px; }
.common-address-card { display: grid; gap: 6px; width: 100%; padding: 16px 18px; text-align: left; color: inherit; background: #fff; border: 1px solid #dfe5e2; border-radius: 10px; cursor: pointer; }
.common-address-card:hover { border-color: #176b52; }
.common-address-card span { color: #66756f; }
.order-create-page { max-width: 820px; }
.order-section { margin: 20px 0; }
.order-section h2, .order-section h3 { margin-top: 0; }
.order-section.form-card { max-width: none; }
.order-address-card { display: flex; align-items: flex-start; gap: 12px; padding: 16px 18px; background: #fff; border: 1px solid #dfe5e2; border-radius: 10px; cursor: pointer; }
.order-address-card:has(input:checked) { border-color: #176b52; background: #eef6f2; }
.order-address-card input { width: auto; margin-top: 4px; }
.order-address-card span { display: grid; gap: 5px; }
.order-address-card small { color: #66756f; }
.address-book-picker { margin-top: 22px; }
.address-book-picker > summary { width: 100%; list-style: none; }
.address-book-picker > summary::-webkit-details-marker { display: none; }
.address-book-picker[open] > summary { margin-bottom: 14px; }
.trial-page { max-width: 760px; }
.trial-heading { margin-bottom: 20px; }
.trial-quota { display: grid; gap: 6px; margin-bottom: 18px; padding: 16px 18px; border: 1px solid #e1b76b; border-radius: 10px; background: #fff7e6; color: #6e4b0f; }
.trial-form { gap: 14px; }
.trial-section { gap: 14px; }
.trial-section h2 { margin: 0; font-size: 20px; }
.choice-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.choice-list { display: grid; gap: 10px; }
.choice-grid label, .choice-list label, .check-row { display: flex !important; grid-template-columns: none !important; align-items: flex-start; gap: 10px !important; padding: 11px 12px; border: 1px solid #dfe5e2; border-radius: 8px; background: #fff; cursor: pointer; }
.choice-grid input, .choice-list input, .check-row input { width: auto; margin-top: 3px; }
.consent-section { font-size: 14px; }
.trial-submit { width: 100%; min-height: 48px; }
.trial-success { text-align: center; }
.trial-application-form { max-width: none; margin: 0; }
.document-upload-section { margin-top: 10px; padding: 24px; border: 1px solid #cbd8d3; border-radius: 12px; background: #f8fbfa; }
.document-upload-intro { margin: 0; }
.document-upload-options { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.document-upload-option { display: grid; align-content: start; gap: 10px; min-height: 150px; padding: 18px; border: 1px solid #d5dfdb; border-radius: 10px; background: #fff; }
.document-upload-option strong { font-size: 18px; color: #153f34; }
.document-upload-option input[type="file"] { margin-top: auto; padding: 12px; }
.document-camera-button { width: 100%; margin-top: auto; }
.camera-file-list { display: grid; gap: 6px; margin: 0; padding-left: 22px; color: #176b52; }
.document-upload-help { display: block; line-height: 1.7; }
.trial-status-card, .trial-documents-card { max-width: none; margin: 0 0 16px; }
.document-list { display: grid; gap: 10px; margin: 0; padding-left: 20px; }
.trial-review-documents { margin-bottom: 16px; }
.trial-review-documents .document-list { padding-left: 0; }
.document-item { display: block; padding: 10px 12px; border: 1px solid #dfe5e2; border-radius: 8px; }
.trial-review-form { max-width: none; margin: 16px 0 0; }
@media (max-width: 640px) {
  .topbar { padding: 12px 16px; align-items: flex-start; }
  .user-actions { align-items: flex-end; flex-direction: column; gap: 6px; }
  .page { padding: 24px 16px; }
  .auth-card, .form-card { margin: 20px 0; padding: 20px; }
  .page-heading { align-items: stretch; flex-direction: column; }
  .page-heading .button { width: 100%; }
  .two-column-fields, .region-fields { grid-template-columns: 1fr !important; }
  .recognition-actions .button, .recognition-actions .primary { flex: 1 1 140px; }
  .choice-grid { grid-template-columns: 1fr; }
  .document-upload-section { padding: 20px; }
  .document-upload-options { grid-template-columns: 1fr; }
  .document-upload-option { min-height: 140px; }
  .customer-list-table { overflow: visible; border: 0; background: transparent; }
  .customer-list-table table, .customer-list-table tbody, .customer-list-table tr, .customer-list-table td { display: block; width: 100%; }
  .customer-list-table thead { display: none; }
  .customer-list-table tr { margin-bottom: 14px; overflow: hidden; border: 1px solid #dfe5e2; border-radius: 10px; background: #fff; }
  .customer-list-table td { display: grid; grid-template-columns: 88px minmax(0, 1fr); gap: 10px; padding: 12px 14px; white-space: normal; overflow-wrap: anywhere; }
  .customer-list-table td::before { content: attr(data-label); color: #66756f; font-weight: 600; }
}

.document-text {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font-family: inherit;
}
