* {
  box-sizing: border-box;
}

:root {
  color-scheme: light;
  --ink: #ece8dc;
  --p95: rgba(20, 19, 16, 0.95);
  --p82: rgba(20, 19, 16, 0.82);
  --p60: rgba(20, 19, 16, 0.60);
  --p38: rgba(20, 19, 16, 0.38);
  --p20: rgba(20, 19, 16, 0.20);
  --p12: rgba(20, 19, 16, 0.12);
  --p07: rgba(20, 19, 16, 0.07);
  --border: rgba(20, 19, 16, 0.18);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "PingFang SC", "Helvetica Neue", sans-serif;
}

body {
  min-height: 100svh;
  margin: 0;
  overflow: hidden;
  background:
    radial-gradient(ellipse 75% 50% at 10% 8%, rgba(20, 19, 16, 0.045) 0%, transparent 55%),
    radial-gradient(ellipse 50% 70% at 90% 90%, rgba(20, 19, 16, 0.035) 0%, transparent 55%),
    var(--ink);
  color: var(--p95);
  -webkit-font-smoothing: antialiased;
}

body::before {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  content: "";
  background-image: repeating-linear-gradient(
    90deg,
    rgba(20, 19, 16, 0.035) 0,
    rgba(20, 19, 16, 0.035) 1px,
    transparent 1px,
    transparent calc(100vw / 6)
  );
}

.shell {
  position: relative;
  z-index: 1;
  width: 100vw;
  height: 100svh;
  padding: 12px;
}

.top-strip {
  position: fixed;
  z-index: 3;
  left: 18px;
  right: 18px;
  bottom: 7px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  pointer-events: none;
  color: var(--p60);
  font-size: 11px;
  font-weight: 500;
  opacity: 0.58;
}

.status-pill {
  min-width: 84px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--p82);
  text-align: center;
}

.dashboard-grid {
  display: grid;
  height: calc(100svh - 24px);
  grid-template-columns: repeat(6, minmax(0, 1fr));
  grid-template-rows: repeat(6, minmax(0, 1fr));
  gap: 10px;
}

.market-lane {
  display: contents;
}

.widget,
.quote-card {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 11px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.34) 0%, rgba(20, 19, 16, 0.035) 55%, rgba(255, 255, 255, 0.18) 100%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.38),
    inset 0 -1px 0 rgba(20, 19, 16, 0.08);
}

.widget::after,
.quote-card::after {
  position: absolute;
  top: 0;
  left: 10%;
  right: 10%;
  height: 1px;
  pointer-events: none;
  content: "";
  background: linear-gradient(90deg, transparent, rgba(20, 19, 16, 0.18), transparent);
}

.hero,
.quote-card {
  padding: 16px;
}

.weather-widget {
  grid-column: 1 / 4;
  grid-row: 1 / 3;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 8px;
}

.calendar-widget {
  grid-column: 4 / 7;
  grid-row: 1 / 3;
  display: grid;
  grid-template-columns: minmax(118px, 0.78fr) minmax(0, 1.72fr);
  grid-template-rows: auto 1fr;
  column-gap: 16px;
  row-gap: 7px;
}

.clock-widget {
  grid-column: 3 / 5;
  grid-row: 3 / 5;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px;
}

.quote-card.large[data-symbol="BRK.B"] {
  grid-column: 5 / 7;
  grid-row: 3 / 5;
}

.quote-card.large[data-symbol="3033.HK"] {
  grid-column: 1 / 3;
  grid-row: 3 / 5;
}

.quote-card.large[data-symbol="3416.HK"] {
  grid-column: 1 / 3;
  grid-row: 5 / 7;
}

.side-lane .quote-card[data-symbol="长光辰芯"] {
  grid-column: 3 / 4;
  grid-row: 5 / 6;
}

.side-lane .quote-card[data-symbol="QQQ"] {
  grid-column: 4 / 5;
  grid-row: 5 / 6;
}

.side-lane .quote-card[data-symbol="SPY"] {
  grid-column: 5 / 6;
  grid-row: 5 / 6;
}

.side-lane .quote-card[data-symbol="SSE"] {
  grid-column: 6 / 7;
  grid-row: 5 / 6;
}

.side-lane .quote-card[data-symbol="DXY"] {
  grid-column: 3 / 4;
  grid-row: 6 / 7;
}

.side-lane .quote-card[data-symbol="VIX"] {
  grid-column: 4 / 5;
  grid-row: 6 / 7;
}

.side-lane .quote-card[data-symbol="GOOG"] {
  grid-column: 5 / 6;
  grid-row: 6 / 7;
}

.side-lane .quote-card[data-symbol="VT"] {
  grid-column: 6 / 7;
  grid-row: 6 / 7;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--p60);
  font-size: 12px;
  font-weight: 650;
  letter-spacing: 0.04em;
}

h1,
h2,
p {
  margin: 0;
}

.clock-copy {
  display: none;
}

#clock-text {
  font-size: 15px;
  font-weight: 300;
  letter-spacing: 0.2em;
  color: var(--p95);
  font-variant-numeric: tabular-nums;
  text-align: center;
}

.analog-clock {
  position: relative;
  width: 92%;
  max-width: 206px;
  aspect-ratio: 1;
  border: 2px solid rgba(20, 19, 16, 0.52);
  border-radius: 50%;
  background:
    radial-gradient(circle at 50% 50%, rgba(20, 19, 16, 0.08) 0 3px, transparent 4px),
    radial-gradient(circle at 50% 50%, transparent 0 60%, rgba(20, 19, 16, 0.04) 61% 70%, transparent 71%),
    rgba(255, 255, 255, 0.08);
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.34),
    inset 0 0 0 7px rgba(20, 19, 16, 0.035),
    inset 0 0 0 12px rgba(255, 255, 255, 0.12);
}

.analog-clock::before {
  position: absolute;
  inset: 18px;
  border: 1px solid rgba(20, 19, 16, 0.18);
  border-radius: 50%;
  content: "";
}

.clock-num {
  position: absolute;
  z-index: 1;
  color: var(--p82);
  font-size: 16px;
  font-weight: 650;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  transform: translate(-50%, -50%);
}

.n12 { left: 50%; top: 14%; }
.n1 { left: 68%; top: 19%; }
.n2 { left: 81%; top: 32%; }
.n3 { left: 86%; top: 50%; }
.n4 { left: 81%; top: 68%; }
.n5 { left: 68%; top: 81%; }
.n6 { left: 50%; top: 86%; }
.n7 { left: 32%; top: 81%; }
.n8 { left: 19%; top: 68%; }
.n9 { left: 14%; top: 50%; }
.n10 { left: 19%; top: 32%; }
.n11 { left: 32%; top: 19%; }

.tick,
.hand,
.clock-pin {
  position: absolute;
}

.tick {
  background: rgba(20, 19, 16, 0.42);
}

.t12,
.t6 {
  left: 50%;
  width: 2px;
  height: 12px;
  transform: translateX(-50%);
}

.t12 {
  top: 22px;
}

.t6 {
  bottom: 22px;
}

.t3,
.t9 {
  top: 50%;
  width: 12px;
  height: 2px;
  transform: translateY(-50%);
}

.t3 {
  right: 22px;
}

.t9 {
  left: 22px;
}

.hand {
  left: 50%;
  bottom: 50%;
  border-radius: 99px;
  background: rgba(20, 19, 16, 0.86);
  transform-origin: 50% 100%;
}

.hour-hand {
  width: 5px;
  height: 29%;
}

.minute-hand {
  width: 3px;
  height: 41%;
  background: rgba(20, 19, 16, 0.72);
}

.second-hand {
  width: 1px;
  height: 43%;
  background: rgba(20, 19, 16, 0.32);
}

.clock-pin {
  left: 50%;
  top: 50%;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(20, 19, 16, 0.88);
  transform: translate(-50%, -50%);
}

.sub-metric {
  display: none;
  gap: 10px;
  color: var(--p60);
  font-size: 10px;
  letter-spacing: 0.08em;
}

.weather-core {
  display: flex;
  align-items: flex-start;
  gap: 7px;
}

#weather-temp {
  font-size: 64px;
  font-weight: 200;
  line-height: 1;
  letter-spacing: -0.04em;
}

.degree {
  margin-top: 10px;
  color: var(--p60);
  font-size: 18px;
}

.weather-meta {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: var(--p82);
  font-size: 14px;
}

.forecast-list {
  display: flex;
  gap: 5px;
  padding-top: 10px;
  margin-top: 8px;
  border-top: 1px solid var(--p12);
}

.forecast-day {
  display: grid;
  flex: 1;
  gap: 2px;
  text-align: center;
  color: var(--p60);
  font-size: 10px;
  font-weight: 500;
}

.forecast-mark {
  color: var(--p95);
  font-size: 12px;
}

.date-row {
  display: flex;
  grid-column: 1;
  grid-row: 2;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  gap: 6px;
  min-width: 0;
  margin-bottom: 0;
}

#day-number {
  font-size: 64px;
  line-height: 0.92;
  font-weight: 650;
}

#weekday {
  font-size: 24px;
  font-weight: 600;
}

#month-year {
  color: var(--p60);
  font-size: 13px;
}

.holiday-strip {
  display: flex;
  grid-column: 2;
  grid-row: 1;
  min-width: 0;
  min-height: 18px;
  gap: 6px;
  margin-bottom: 0;
  overflow: hidden;
}

.holiday-pill {
  max-width: 100%;
  padding: 2px 7px;
  border: 1px solid rgba(20, 19, 16, 0.58);
  border-radius: 999px;
  background: rgba(20, 19, 16, 0.86);
  color: rgba(250, 248, 239, 0.94);
  font-size: 10px;
  font-weight: 650;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mini-calendar {
  display: grid;
  grid-column: 2;
  grid-row: 2;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 2px;
  min-height: 0;
  align-content: stretch;
}

.calendar-head {
  display: grid;
  min-height: 15px;
  place-items: center;
  color: var(--p60);
  font-size: 9px;
  font-weight: 700;
}

.calendar-head.weekend-head {
  color: var(--p95);
}

.calendar-cell {
  display: grid;
  min-height: 0;
  place-items: center;
  border-radius: 5px;
  color: var(--p82);
  font-size: 10px;
  line-height: 1.2;
}

.calendar-cell.weekend {
  background:
    repeating-linear-gradient(
      -45deg,
      rgba(20, 19, 16, 0.10) 0,
      rgba(20, 19, 16, 0.10) 2px,
      rgba(255, 255, 255, 0.10) 2px,
      rgba(255, 255, 255, 0.10) 5px
    );
  color: var(--p95);
  font-weight: 650;
}

.calendar-cell.today {
  background: rgba(255, 255, 255, 0.52);
  color: var(--p95);
  font-weight: 700;
  box-shadow: inset 0 0 0 2px var(--p95);
}

.calendar-cell.holiday {
  background: var(--p95);
  color: rgba(250, 248, 239, 0.96);
  font-weight: 750;
  box-shadow: inset 0 0 0 1px rgba(250, 248, 239, 0.26);
}

.calendar-cell.today.holiday {
  box-shadow:
    inset 0 0 0 2px rgba(250, 248, 239, 0.92),
    0 0 0 1px var(--p95);
}

.calendar-cell small {
  display: block;
  margin-top: -2px;
  font-size: 6px;
  font-weight: 700;
  line-height: 1;
  opacity: 0.72;
}

.quote-card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 6px;
}

.quote-card.large {
  padding: 16px;
}

.quote-top,
.quote-bottom {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.symbol {
  overflow: hidden;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.large .symbol {
  font-size: 16px;
}

.name,
.market,
.quote-extra {
  color: var(--p60);
  font-size: 8px;
  letter-spacing: 0.03em;
}

.price {
  color: var(--p95);
  font-size: 22px;
  font-weight: 400;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.large .price {
  font-size: 34px;
  font-weight: 200;
  letter-spacing: -0.02em;
}

.day-range {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 5px;
  color: var(--p82);
  font-size: 11px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  line-height: 1;
}

.day-range span {
  padding-right: 6px;
  border-right: 1px solid var(--p20);
}

.day-range span:last-child {
  padding-right: 0;
  border-right: 0;
}

.quote-card.large .day-range {
  font-size: 12px;
}

.day-range.compact-us {
  gap: 4px;
  margin-top: 4px;
  font-size: 10px;
}

.range52 {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 6px;
  color: var(--p60);
  font-size: 9px;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
}

.quote-card.large .range52 {
  font-size: 10px;
}

.no-data .price {
  color: var(--p60);
  font-size: 18px;
}

.change {
  min-width: 66px;
  padding: 4px 8px;
  border: 1px solid var(--p20);
  border-radius: 999px;
  color: var(--p82);
  text-align: center;
  font-size: 12px;
  font-weight: 700;
}

.large .change,
.quote-card.large[data-symbol="3033.HK"] .change,
.quote-card.large[data-symbol="3416.HK"] .change {
  min-width: 76px;
  font-size: 13px;
}

.trend-chart {
  display: block;
  width: 100%;
  flex: 1;
  min-height: 44px;
  margin-top: 8px;
}

.trend-baseline {
  fill: none;
  stroke: rgba(20, 19, 16, 0.12);
  stroke-width: 1;
  vector-effect: non-scaling-stroke;
}

.trend-line {
  fill: none;
  stroke: rgba(20, 19, 16, 0.60);
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.5;
  vector-effect: non-scaling-stroke;
}

.trend-line.down {
  stroke-dasharray: none;
}

.trend-empty {
  flex: 1;
  min-height: 44px;
  color: var(--p38);
  font-size: 10px;
}

.side-lane .quote-card {
  padding: 12px 13px;
}

.side-lane .quote-bottom {
  align-items: flex-end;
}

.side-lane .name,
.side-lane .market,
.side-lane .quote-extra {
  display: none;
}

@media (orientation: portrait) and (min-width: 761px) and (max-width: 900px) {
  .dashboard-grid {
    grid-template-columns: repeat(6, minmax(0, 1fr));
    grid-template-rows: repeat(8, minmax(0, 1fr));
  }

  .weather-widget {
    grid-column: 1 / 4;
    grid-row: 1 / 3;
  }

  .calendar-widget {
    grid-column: 4 / 7;
    grid-row: 1 / 3;
  }

  .quote-card.large[data-symbol="3033.HK"] {
    grid-column: 1 / 3;
    grid-row: 3 / 5;
  }

  .clock-widget {
    grid-column: 3 / 5;
    grid-row: 3 / 5;
  }

  .quote-card.large[data-symbol="BRK.B"] {
    grid-column: 5 / 7;
    grid-row: 3 / 5;
  }

  .quote-card.large[data-symbol="3416.HK"] {
    grid-column: 1 / 3;
    grid-row: 5 / 7;
  }

  .side-lane .quote-card[data-symbol="QQQ"] {
    grid-column: 3 / 4;
    grid-row: 5 / 6;
  }

  .side-lane .quote-card[data-symbol="SPY"] {
    grid-column: 4 / 5;
    grid-row: 5 / 6;
  }

.side-lane .quote-card[data-symbol="SSE"] {
    grid-column: 5 / 7;
    grid-row: 5 / 6;
  }

  .side-lane .quote-card[data-symbol="DXY"] {
    grid-column: 3 / 4;
    grid-row: 6 / 7;
  }

  .side-lane .quote-card[data-symbol="VIX"] {
    grid-column: 4 / 5;
    grid-row: 6 / 7;
  }

  .side-lane .quote-card[data-symbol="长光辰芯"] {
    grid-column: 5 / 7;
    grid-row: 6 / 7;
  }

  .side-lane .quote-card[data-symbol="GOOG"] {
    grid-column: 1 / 4;
    grid-row: 7 / 8;
  }

  .side-lane .quote-card[data-symbol="VT"] {
    grid-column: 4 / 7;
    grid-row: 7 / 8;
  }
}

@media (max-width: 760px) {
  body {
    overflow: auto;
  }

  .shell {
    height: auto;
  }

  .dashboard-grid {
    height: auto;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-template-rows: none;
    grid-auto-rows: minmax(120px, auto);
  }

  .weather-widget,
  .calendar-widget,
  .clock-widget,
  .quote-card.large,
  .side-lane .quote-card[data-symbol="GOOG"] {
    grid-column: span 2;
    grid-row: auto;
  }

  .side-lane .quote-card {
    grid-column: span 1;
    grid-row: auto;
  }
}
