:root {
  color-scheme: light;
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Noto Sans SC", sans-serif;
  color: #222820;
  background: #f5f3ed;
  --ink: #222820;
  --muted: #605f55;
  --sage: #405a48;
  --cream: #fffdfa;
  --line: #e8e3d8;
  --focus: #806224;
}

*, *::before, *::after { box-sizing: border-box; }
body {
  margin: 0;
  min-height: 100vh;
  min-height: 100svh;
  background: radial-gradient(ellipse at 50% 0%, #faf7ee 0, #f5f3ed 66%);
  -webkit-text-size-adjust: 100%;
}

[hidden] { display: none !important; }
h1, h2, p, dl, dd { margin: 0; }
input, button { font: inherit; }

.dashboard {
  max-width: 540px;
  margin: 0 auto;
  padding: clamp(28px, 8vh, 78px) 22px max(28px, env(safe-area-inset-bottom));
}

.page-heading {
  display: flex;
  align-items: center;
  gap: 15px;
  margin-bottom: 24px;
}

.brand-mark {
  display: grid;
  justify-items: center;
  align-content: center;
  gap: 4px;
  flex: 0 0 49px;
  height: 49px;
  background: #e9d9ae;
  border: 1px solid #e2cc98;
  border-radius: 15px;
}

.brand-mark::before, .brand-mark::after {
  content: "";
  height: 6px;
  border-radius: 2px;
  background: #6f5322;
  transform: skewX(-16deg);
}

.brand-mark::before { width: 17px; }
.brand-mark::after { width: 25px; }

.page-heading h1 {
  font-size: 27px;
  line-height: 1.22;
  letter-spacing: -0.025em;
  font-weight: 720;
}

.page-heading p {
  margin-top: 5px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.quote-card {
  position: relative;
  overflow: hidden;
  isolation: isolate;
  padding: clamp(22px, 6vw, 30px);
  color: #f8f2e4;
  border: 1px solid #323c33;
  border-radius: 23px;
  background: linear-gradient(135deg, #263229 0%, #1c2420 100%);
  box-shadow: 0 11px 26px #22282021;
}

.quote-card::before {
  content: "";
  position: absolute;
  z-index: -1;
  top: -145px;
  right: -88px;
  width: 270px;
  height: 270px;
  border: 1px solid #f9e4af27;
  border-radius: 50%;
  box-shadow: 0 0 0 24px #f9e4af09, 0 0 0 49px #f9e4af07;
  pointer-events: none;
}

.quote-heading, .rule-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.quote-heading h2 {
  color: #e4dfcf;
  font-size: 14px;
  font-weight: 580;
}

.quote-status, .rule-status {
  flex: none;
  border-radius: 999px;
  padding: 5px 10px;
  font-size: 12px;
  font-weight: 580;
  line-height: 1.3;
}

.quote-status {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: #ded8c4;
  background: #ede4c81a;
}

.quote-status::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}

.quote-status[data-status="live"] { color: #bef0c7; }
.quote-status[data-status="closed"] { color: #ded8c4; }
.quote-status[data-status="auction"],
.quote-status[data-status="stale"] { color: #f9d394; }
.quote-status[data-status="offline"], .quote-status[data-status="disconnected"] { color: #f8c6b6; }

.quote-price {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 9px;
  margin: 15px 0 21px;
  line-height: 1.04;
}

#current-price {
  color: #f6dc9b;
  font-size: clamp(41px, 12.5vw, 73px);
  font-weight: 570;
  letter-spacing: -0.055em;
  font-variant-numeric: lining-nums tabular-nums;
  overflow-wrap: anywhere;
}

.quote-unit { color: #f0e9d6; font-size: 14px; }

.quote-details {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 15px;
  border-top: 1px solid #ece4c530;
  padding-top: 15px;
}

.quote-details dt { color: #cfccbf; font-size: 12px; }
.quote-details dd {
  margin-top: 5px;
  color: #fff8e8;
  font-size: 13px;
  line-height: 1.4;
  font-variant-numeric: tabular-nums;
}

.quote-details a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: 3px; }
.quote-details a:focus-visible { outline-color: #f6dc9b; }

.market-hours {
  margin-top: 15px;
  padding-top: 13px;
  border-top: 1px solid #ece4c530;
}

.market-hours h3 { margin: 0 0 10px; color: #e4dfcf; font-size: 13px; font-weight: 650; }
.market-hour-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 12px; }
.market-hour-list dt { color: #cfccbf; font-size: 12px; }
.market-hour-list dd { margin-top: 3px; font-size: 13px; font-variant-numeric: tabular-nums; }
.market-hours p { margin-top: 10px; color: #cfccbf; font-size: 12px; line-height: 1.5; }
.market-hours a { color: inherit; text-underline-offset: 3px; }
.market-hours a:focus-visible { outline-color: #f6dc9b; }

.rule-card, .trend-card, .reference-card {
  margin-top: 17px;
  padding: clamp(20px, 5.8vw, 28px);
  border: 1px solid var(--line);
  border-radius: 23px;
  background: var(--cream);
  box-shadow: 0 8px 20px #30241109;
}

.trend-card {
  padding-top: 17px;
  padding-bottom: 14px;
}

.trend-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 9px;
  margin-bottom: 12px;
}

.trend-heading h2 { font-size: 17px; line-height: 1.35; font-weight: 680; }
.trend-heading p { color: var(--muted); font-size: 12px; }

.reference-card { padding-top: 17px; padding-bottom: 14px; }
.reference-heading { display: flex; align-items: baseline; justify-content: space-between; flex-wrap: wrap; gap: 6px 10px; }
.reference-heading h2 { font-size: 17px; font-weight: 680; }
.reference-heading a { color: var(--muted); font-size: 12px; text-underline-offset: 3px; }
.reference-quotes { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-top: 12px; }
.reference-quotes dt, .reference-date { color: var(--muted); font-size: 12px; }
.reference-quotes dd { margin-top: 3px; font-size: 17px; font-variant-numeric: tabular-nums; }
.reference-date { margin-top: 8px; }

.trend-plot { position: relative; height: 168px; }
.trend-message { color: var(--muted); font-size: 13px; line-height: 1.5; }
.trend-plot[hidden] + .trend-message {
  display: grid;
  place-items: center;
  min-height: 140px;
  border-radius: 12px;
  background: #fbfaf6;
}

.trend-plot:not([hidden]) + .trend-message { margin-top: 6px; }

.rule-heading h2 { font-size: 19px; line-height: 1.35; font-weight: 680; }

.rule-status { color: #5e5749; background: #f1ede3; }
.rule-status[data-status="armed"] { color: #365440; background: #e7eee5; }
.rule-status[data-status="triggered"] { color: #714d17; background: #f7ecd0; }

#rule-form { margin-top: 19px; }
#rule-form label, .login-card label { display: block; margin-bottom: 8px; font-size: 13px; font-weight: 640; }
.advance-setting { margin-top: 14px; }

.login-dashboard { max-width: 430px; }
.login-card .target-field + label { margin-top: 16px; }
.login-card .target-field input { font-size: 16px; }

.session-actions { margin-left: auto; }
.session-actions button {
  min-height: 36px;
  padding: 5px 11px;
  border-radius: 9px;
  white-space: nowrap;
  cursor: pointer;
  font-size: 12px;
}

.target-field {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 14px;
  min-height: 54px;
  border: 1px solid #ded9ce;
  border-radius: 12px;
  background: #fbfaf6;
}

.target-field:focus-within {
  border-color: var(--focus);
  box-shadow: 0 0 0 2px #80622425;
}

.target-field:has(input[aria-invalid="true"]) { border-color: #a43c2b; }

.target-field input {
  width: 100%;
  min-width: 0;
  padding: 11px 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--ink);
  font-size: 21px;
  font-variant-numeric: tabular-nums;
}

.target-field input::placeholder { color: #6c685d; font-size: 15px; }
.target-field span { color: var(--muted); flex: none; font-size: 13px; }
.rule-description, .form-message { margin-top: 8px; font-size: 13px; line-height: 1.5; }
.rule-description { color: var(--muted); }
.form-message { color: #9c3628; }

.rule-actions { display: flex; gap: 9px; margin-top: 16px; }

.rule-actions button {
  min-height: 46px;
  border-radius: 11px;
  padding: 9px 15px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 650;
}

.button-primary {
  flex: 1;
  color: #fffdf4;
  border: 1px solid var(--sage);
  background: var(--sage);
}

.button-primary:not(:disabled):hover { background: #344b3b; }
.button-secondary { color: #3a4239; border: 1px solid #dddacc; background: #fcfaf4; }
.button-secondary:not(:disabled):hover { background: #f1efe5; }
.rule-actions button:disabled { opacity: 0.55; cursor: default; }
button:focus-visible, a:focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; }

.notification {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  margin-top: 17px;
  border-top: 1px solid var(--line);
  padding-top: 13px;
  color: #4e5b50;
  font-size: 13px;
  line-height: 1.4;
}

.wechat-mark {
  position: relative;
  flex: 0 0 15px;
  height: 12px;
  margin-top: 2px;
  border: 1.4px solid #67766a;
  border-radius: 4px;
}

.wechat-mark::after {
  content: "";
  position: absolute;
  bottom: -3px;
  left: 3px;
  width: 5px;
  height: 5px;
  border-left: 1.4px solid #67766a;
  transform: skewY(-34deg);
}

.notification-detail { margin-top: 4px; color: var(--muted); font-size: 12px; }

@media (max-width: 380px) {
  .dashboard { padding-inline: 15px; }
  .quote-details { gap: 10px; }
}
