:root {
  color-scheme: dark;
  font-family: "Microsoft YaHei", "PingFang SC", Arial, sans-serif;
  background: #0f0b0b;
  color: #fff8e8;
}

* { box-sizing: border-box; }

html, body { min-height: 100%; }

body {
  margin: 0;
  min-width: 320px;
  min-height: 100svh;
  background: #0f0b0b;
}

.quote-board {
  width: min(100%, 520px);
  min-height: 100svh;
  margin: 0 auto;
  padding: max(14px, env(safe-area-inset-top)) 14px max(18px, env(safe-area-inset-bottom));
  background: #190d0d;
  border-inline: 1px solid #332525;
}

.brand-header {
  min-height: 128px;
  display: grid;
  justify-items: center;
  align-content: center;
  gap: 4px;
  padding-bottom: 10px;
  border-bottom: 1px solid #b88a42;
}

.brand-logo {
  display: block;
  width: min(78vw, 330px);
  max-width: 100%;
  height: auto;
  max-height: 108px;
  object-fit: contain;
}

.brand-header h1 {
  max-width: 100%;
  margin: 0;
  color: #fff4dc;
  font-size: 25px;
  line-height: 1.25;
  font-weight: 700;
  letter-spacing: 0;
  text-align: center;
  overflow-wrap: anywhere;
}

.market-bar {
  min-height: 54px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 2px;
}

.market-status {
  min-width: 76px;
  padding: 7px 10px;
  border: 1px solid #8f734c;
  border-radius: 4px;
  color: #f4dfb6;
  background: #2a211b;
  font-size: 14px;
  line-height: 1.2;
  text-align: center;
}

.status-open { color: #ffe39d; background: #4a3015; border-color: #b88a42; }
.status-closed { color: #eee5d6; background: #403b35; border-color: #8a8175; }
.status-network_error { color: #fff; background: #8b2424; border-color: #d98d7e; }

.clock {
  color: #fff3d4;
  font-size: 20px;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.price-grid {
  min-height: 318px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  align-content: start;
}

.price-card {
  min-width: 0;
  min-height: 94px;
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: 3px;
  padding: 10px 11px;
  border: 1px solid #8f6a35;
  border-radius: 6px;
  background: #251818;
  overflow: hidden;
}

.price-name {
  margin: 0;
  color: #e8d4ad;
  font-size: 14px;
  line-height: 1.25;
  font-weight: 600;
  overflow-wrap: anywhere;
}

.price-value {
  align-self: center;
  min-width: 0;
  color: #fff8e6;
  font-size: 34px;
  line-height: 1;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.price-unit {
  color: #a99b87;
  font-size: 11px;
  line-height: 1.2;
}

.price-up { animation: priceUp 1s ease-out; }
.price-down { animation: priceDown 1s ease-out; }

@keyframes priceUp {
  0% { background: #9e2929; border-color: #e69b82; }
  100% { background: #251818; border-color: #8f6a35; }
}

@keyframes priceDown {
  0% { background: #17623b; border-color: #7bc19b; }
  100% { background: #251818; border-color: #8f6a35; }
}

.error-panel {
  min-height: 318px;
  display: grid;
  place-content: center;
  gap: 10px;
  padding: 24px;
  border: 1px solid #8b3b35;
  border-radius: 6px;
  background: #2b1717;
  text-align: center;
}

.error-panel strong { font-size: 24px; color: #fff0df; }
.error-panel p { margin: 0; color: #d9c9bb; font-size: 15px; line-height: 1.6; }
.hidden { display: none !important; }

.quote-footer {
  min-height: 100px;
  margin-top: 10px;
  padding-top: 9px;
  border-top: 1px solid #57422e;
}

.quote-footer p { margin: 0; overflow-wrap: anywhere; }
.last-adjustment { color: #c7aa73; font-size: 12px; }
.notice { margin-top: 7px !important; color: #f1e0c3; font-size: 13px; line-height: 1.5; }
.contact { margin-top: 5px !important; color: #ae9f90; font-size: 12px; line-height: 1.45; }

@media (max-width: 379px) {
  .quote-board { padding-inline: 10px; }
  .brand-header { min-height: 118px; }
  .brand-logo { width: 270px; max-height: 96px; }
  .brand-header h1 { font-size: 22px; }
  .price-card { min-height: 90px; padding: 9px; }
  .price-value { font-size: 31px; }
}

@media (min-width: 521px) {
  body { padding-block: 20px; }
  .quote-board { min-height: calc(100svh - 40px); border: 1px solid #4a3730; }
}

@media (prefers-reduced-motion: reduce) {
  .price-up, .price-down { animation: none; }
}
