:root {
  color-scheme: light;
  --bg: #faf8f3;
  --surface: #ffffff;
  --text: #24211c;
  --muted: #888176;
  --line: #ece7de;
  --brand: #c8a05a;
  --brand-dark: #7a5a24;
  --hold: #6c7890;
  --drop: #9b665c;
  --shadow: 0 20px 70px rgba(61, 48, 27, 0.08);
  font-family: "HarmonyOS Sans SC", "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--bg);
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--text);
  background:
    radial-gradient(circle at 12% 8%, rgba(200, 160, 90, 0.12), transparent 28rem),
    var(--bg);
}

button {
  font: inherit;
}

input {
  font: inherit;
}

.page-shell {
  width: min(100%, 760px);
  min-height: 100vh;
  margin: 0 auto;
  padding: max(22px, env(safe-area-inset-top)) 20px max(24px, env(safe-area-inset-bottom));
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: 24px;
}

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  width: fit-content;
  font-size: 18px;
  font-weight: 750;
  letter-spacing: 0.02em;
}

.brand-icon {
  width: 30px;
  height: 30px;
  object-fit: contain;
}

.main-card {
  align-self: center;
  min-height: 420px;
  padding: clamp(26px, 6vw, 52px);
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid rgba(236, 231, 222, 0.9);
  border-radius: 28px;
  box-shadow: var(--shadow);
}

.state-centered {
  min-height: 350px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.state[hidden] {
  display: none;
}

.eyebrow,
.label {
  margin: 0 0 8px;
  color: var(--brand-dark);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

h1,
h2,
p {
  overflow-wrap: anywhere;
}

h1 {
  margin: 0;
  font-size: clamp(24px, 5vw, 34px);
  line-height: 1.3;
}

h2 {
  margin: 0;
  font-size: clamp(21px, 4vw, 28px);
  line-height: 1.4;
}

.muted {
  color: var(--muted);
  line-height: 1.75;
}

.state-icon {
  width: 62px;
  height: 62px;
  margin-bottom: 20px;
  object-fit: contain;
}

.state-icon-muted {
  filter: grayscale(1);
  opacity: 0.55;
}

.requester-row {
  display: flex;
  align-items: center;
  gap: 16px;
  margin: 12px 0 28px;
}

.requester-row .muted {
  margin: 5px 0 0;
  font-size: 14px;
}

.avatar {
  flex: 0 0 auto;
  width: 52px;
  height: 52px;
  background: rgba(200, 160, 90, 0.18);
  border-radius: 50%;
  object-fit: contain;
  padding: 4px;
}

.product-card {
  padding: 22px;
  background: var(--bg);
  border-radius: 20px;
}

.price {
  margin: 10px 0 0;
  color: var(--brand-dark);
  font-size: 26px;
  font-weight: 760;
}

.reason {
  margin-top: 20px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.reason p:last-child {
  margin: 0;
  line-height: 1.65;
}

.guidance {
  display: flex;
  flex-direction: column;
  gap: 5px;
  margin: 22px 2px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.65;
}

.guidance strong {
  color: var(--text);
}

.actions {
  display: grid;
  gap: 12px;
}

.decision,
.retry-button,
.dialog-actions button {
  min-height: 52px;
  border: 0;
  border-radius: 16px;
  cursor: pointer;
  transition: transform 140ms ease, opacity 140ms ease, box-shadow 140ms ease;
}

.decision {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  padding: 15px 18px;
  color: #fff;
  text-align: left;
}

.decision span {
  font-size: 17px;
  font-weight: 720;
}

.decision small {
  margin-top: 4px;
  opacity: 0.84;
}

.decision-approve {
  background: var(--brand);
}

.decision-hold {
  background: var(--hold);
}

.decision-drop {
  color: #6e4038;
  background: #f3e5e1;
}

.decision:hover,
.retry-button:hover,
.dialog-actions button:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 22px rgba(39, 32, 22, 0.12);
}

.decision:active,
.retry-button:active,
.dialog-actions button:active {
  transform: translateY(0);
}

.decision:disabled,
.dialog-actions button:disabled {
  cursor: wait;
  opacity: 0.55;
}

.privacy-note,
.closing {
  margin: 18px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
  text-align: center;
}

.retry-button {
  margin-top: 10px;
  padding: 0 24px;
  color: #fff;
  background: var(--brand);
}

.text-button {
  padding: 8px 0;
  color: var(--brand-dark);
  background: transparent;
  border: 0;
  cursor: pointer;
}

.header-link {
  min-height: 38px;
  padding: 0 15px;
  color: var(--brand-dark);
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid var(--line);
  border-radius: 999px;
  cursor: pointer;
}

.center-link {
  margin-top: 10px;
}

.login-heading {
  margin: 26px 0;
  text-align: center;
}

.login-heading .state-icon {
  margin-bottom: 12px;
}

.field-label {
  display: block;
  margin: 16px 0 8px;
  color: var(--text);
  font-size: 14px;
  font-weight: 650;
}

.field-input {
  width: 100%;
  height: 52px;
  padding: 0 16px;
  color: var(--text);
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 14px;
  outline: none;
}

.field-input:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(200, 160, 90, 0.14);
}

.code-input {
  letter-spacing: 0.22em;
}

.primary-button {
  width: 100%;
  min-height: 52px;
  margin-top: 14px;
  color: #fff;
  background: var(--brand);
  border: 0;
  border-radius: 16px;
  cursor: pointer;
}

.primary-button:disabled {
  cursor: wait;
  opacity: 0.55;
}

.form-feedback {
  min-height: 24px;
  margin: 14px 0 0;
  color: var(--brand-dark);
  font-size: 13px;
  text-align: center;
}

.form-feedback-error {
  color: #8d4038;
}

.dashboard-heading,
.record-head,
.setting-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.dashboard-heading {
  align-items: flex-start;
  margin-bottom: 30px;
}

.dashboard-heading .muted {
  margin: 6px 0 0;
  font-size: 14px;
}

.dashboard-section + .dashboard-section {
  margin-top: 30px;
}

.dashboard-section > h2 {
  margin-bottom: 14px;
  font-size: 19px;
}

.record-list {
  display: grid;
  gap: 12px;
}

.record-card {
  padding: 18px;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 18px;
}

.record-head strong {
  font-size: 16px;
}

.status-badge {
  flex: 0 0 auto;
  padding: 4px 9px;
  color: var(--brand-dark);
  background: rgba(200, 160, 90, 0.15);
  border-radius: 999px;
  font-size: 12px;
}

.setting-row {
  min-height: 44px;
  color: var(--muted);
  font-size: 14px;
  cursor: pointer;
}

.setting-row input {
  width: 20px;
  height: 20px;
  accent-color: var(--brand);
}

.danger-button {
  width: 100%;
  min-height: 42px;
  margin-top: 10px;
  color: #82483f;
  background: #f3e5e1;
  border: 0;
  border-radius: 13px;
  cursor: pointer;
}

.record-meta,
.empty-record {
  margin: 8px 0 0;
  font-size: 13px;
  line-height: 1.6;
}

.empty-record {
  padding: 20px;
  text-align: center;
  background: var(--bg);
  border-radius: 16px;
}

.spinner {
  width: 34px;
  height: 34px;
  border: 3px solid rgba(200, 160, 90, 0.2);
  border-top-color: var(--brand);
  border-radius: 50%;
  animation: spin 800ms linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

footer {
  display: flex;
  justify-content: center;
  gap: 7px;
  color: var(--muted);
  font-size: 12px;
}

.confirm-dialog {
  width: min(calc(100% - 40px), 460px);
  padding: 26px;
  color: var(--text);
  background: var(--surface);
  border: 0;
  border-radius: 22px;
  box-shadow: 0 30px 100px rgba(30, 24, 15, 0.25);
}

.confirm-dialog::backdrop {
  background: rgba(34, 30, 24, 0.42);
  backdrop-filter: blur(3px);
}

.confirm-dialog h2 {
  margin-bottom: 10px;
}

.dialog-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 22px;
}

.dialog-cancel {
  color: var(--text);
  background: #f1eee8;
}

.dialog-confirm {
  color: #fff;
  background: var(--brand);
}

@media (max-width: 560px) {
  .page-shell {
    padding-left: 12px;
    padding-right: 12px;
    gap: 16px;
  }

  .main-card {
    padding: 24px 18px;
    border-radius: 22px;
  }

  .requester-row {
    align-items: flex-start;
  }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
