:root {
  color-scheme: light;
  --ink: #17202c;
  --muted: #667085;
  --line: #d7e0e4;
  --paper: #f3f7f5;
  --panel: rgba(255, 255, 255, .92);
  --green: #0f765e;
  --green-dark: #0b4e43;
  --gold: #bd7a18;
  --red: #b42318;
  --blue: #255c8e;
  --shadow: 0 20px 60px rgba(18, 38, 63, .13);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    linear-gradient(135deg, rgba(15, 118, 94, .10), rgba(189, 122, 24, .08)),
    linear-gradient(180deg, #f7fbf8 0%, #eef3f1 100%);
  color: var(--ink);
  font-family: "Microsoft YaHei", "PingFang SC", Arial, sans-serif;
}

.app-shell {
  width: min(1220px, calc(100% - 32px));
  margin: 0 auto;
  padding: 26px 0 34px;
}

.topbar,
.brand,
.official-board,
.panel-head,
.hero-meta,
.notice {
  display: flex;
  align-items: center;
}

.topbar {
  display: grid;
  grid-template-columns: minmax(300px, .78fr) minmax(560px, 1.22fr);
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
}

.brand {
  display: grid;
  gap: 8px;
}

.brand-main {
  display: flex;
  align-items: center;
  gap: 14px;
}

.brand-mark {
  position: relative;
  overflow: hidden;
  display: grid;
  width: 56px;
  height: 56px;
  place-items: center;
  border-radius: 8px;
  background: linear-gradient(135deg, #a32619, #c63a24 54%, #8f1d14);
  color: #fff;
  font-size: 23px;
  font-weight: 900;
  box-shadow: 0 14px 30px rgba(163, 38, 25, .26);
}

.brand-mark::after {
  content: "";
  position: absolute;
  inset: 8px -18px auto -12px;
  height: 22px;
  background: linear-gradient(100deg, transparent, rgba(255, 235, 218, .34), rgba(255, 255, 255, .08), transparent);
  filter: blur(4px);
  transform: rotate(-11deg);
}

.eyebrow,
h1,
h2,
p {
  margin: 0;
}

.eyebrow {
  margin-left: 70px;
  margin-bottom: 0;
  color: var(--green);
  font-size: 14px;
  font-weight: 800;
}

h1 {
  font-size: 34px;
  letter-spacing: 0;
}

h2 {
  font-size: 18px;
  letter-spacing: 0;
}

.official-board {
  display: grid;
  grid-template-columns: minmax(210px, .95fr) 1px minmax(260px, 1.05fr);
  align-items: center;
  justify-content: stretch;
  gap: 24px;
  min-height: 86px;
  padding: 16px 24px;
  border: 2px solid rgba(15, 118, 94, .22);
  border-radius: 8px;
  background: rgba(255, 255, 255, .74);
  box-shadow: 0 12px 34px rgba(18, 38, 63, .08);
  text-align: left;
}

.official-unit {
  display: grid;
  gap: 6px;
  justify-items: center;
  text-align: center;
}

.official-unit span {
  display: block;
  color: var(--muted);
  font-size: 15px;
  font-weight: 800;
}

.official-unit strong {
  display: block;
  color: var(--green-dark);
  font-size: 42px;
  line-height: 1;
  font-weight: 900;
  white-space: nowrap;
  text-align: center;
}

.official-divider {
  width: 1px;
  height: 54px;
  background: linear-gradient(180deg, transparent, rgba(15, 118, 94, .35), transparent);
}

.clock-unit {
  text-align: center;
}

.clock-unit span {
  font-size: 16px;
}

.clock-unit strong {
  font-size: 40px;
  font-variant-numeric: tabular-nums;
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(330px, .72fr);
  gap: 16px;
  margin-bottom: 16px;
}

.hero-card,
.panel,
.stat-card,
.notice {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.hero-card {
  position: relative;
  min-height: 350px;
  overflow: hidden;
  padding: 30px;
  background:
    linear-gradient(135deg, rgba(11, 78, 67, .96), rgba(19, 97, 112, .92)),
    #0b4e43;
  color: #fff;
}

.hero-card::after {
  content: "";
  position: absolute;
  inset: auto -80px -120px auto;
  width: 310px;
  height: 310px;
  border: 1px solid rgba(255, 255, 255, .18);
  border-radius: 50%;
}

.hero-meta {
  position: relative;
  z-index: 1;
  justify-content: space-between;
  gap: 14px;
}

.hero-meta span {
  color: rgba(255, 255, 255, .78);
  font-size: 15px;
  font-weight: 800;
}

.combo {
  position: relative;
  z-index: 1;
  margin: 22px 0 16px;
  color: #fff4d8;
  font-size: clamp(92px, 12vw, 152px);
  line-height: .88;
  font-weight: 900;
  letter-spacing: 0;
  text-shadow: 0 12px 34px rgba(0, 0, 0, .18);
}

.hero-card p {
  position: relative;
  z-index: 1;
  max-width: 760px;
  color: rgba(255, 255, 255, .88);
  font-size: 18px;
  line-height: 1.75;
}

.hero-actions {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-top: 26px;
}

.hero-actions div,
.stat-card {
  padding: 18px;
  border-radius: 8px;
  background: rgba(255, 255, 255, .12);
}

.hero-actions small,
.stat-card span,
.panel-head span {
  display: block;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.hero-actions small {
  color: rgba(255, 255, 255, .70);
}

.hero-actions strong {
  display: block;
  margin-top: 8px;
  color: #fff;
  font-size: 26px;
}

.side-stack {
  display: grid;
  gap: 16px;
}

.stat-card {
  min-height: 164px;
  background: rgba(255, 255, 255, .90);
}

.stat-card.latest strong,
.publish-card strong {
  display: block;
  margin-top: 12px;
  color: var(--red);
  font-size: 38px;
  line-height: 1.1;
}

.publish-card strong {
  color: var(--green-dark);
  font-variant-numeric: tabular-nums;
}

.stat-card.latest p,
.publish-card p {
  margin-top: 10px;
  color: var(--muted);
  font-weight: 700;
}

.sync-button {
  margin-top: 14px;
  height: 34px;
  padding: 0 13px;
  border: 0;
  border-radius: 8px;
  background: var(--green);
  color: #fff;
  cursor: pointer;
  font: inherit;
  font-weight: 800;
}

.sync-button:disabled {
  cursor: wait;
  opacity: .68;
}

.publish-card small {
  display: inline-block;
  margin-top: 12px;
  padding: 7px 10px;
  border-radius: 8px;
  background: rgba(15, 118, 94, .10);
  color: var(--green-dark);
  font-weight: 900;
  font-variant-numeric: tabular-nums;
}

.workbench,
.content-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(360px, .8fr);
  gap: 16px;
  margin-bottom: 16px;
}

.content-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.panel {
  min-height: 210px;
  padding: 22px;
}

.panel-wide {
  grid-column: span 1;
}

.content-grid .panel-wide {
  grid-column: 1 / -1;
}

.panel-head {
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.number-list,
.dan-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.num-chip,
.dan-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 76px;
  height: 42px;
  padding: 0 14px;
  border: 1px solid #ccd8dc;
  border-radius: 8px;
  background: #f8fbfb;
  color: var(--blue);
  font-size: 20px;
  font-weight: 900;
}

.number-list.compact .num-chip {
  min-width: 72px;
  color: var(--green);
}

.dan-chip {
  min-width: 0;
  height: 58px;
  justify-content: center;
  align-items: center;
  flex-direction: column;
  text-align: center;
  color: var(--ink);
  font-size: 15px;
  line-height: 1.1;
}

.dan-chip b {
  display: block;
  color: var(--gold);
  font-size: 28px;
  line-height: 1;
}

.dan-chip span {
  display: block;
  width: 100%;
  text-align: center;
}

.dan-card {
  min-height: 216px;
  padding: 18px;
  display: grid;
  grid-template-rows: auto 1fr;
}

.card-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}

.card-title-row small {
  color: var(--green);
  font-weight: 800;
}

.dan-card .dan-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-content: center;
  align-items: center;
  gap: 10px;
  height: 100%;
}

.dan-card .dan-chip {
  flex: 0 1 calc((100% - 20px) / 3);
}

.draw-table {
  display: grid;
  gap: 10px;
}

.draw-row,
.query-hit,
.history-row {
  display: grid;
  grid-template-columns: 112px 1fr auto;
  align-items: center;
  gap: 14px;
  min-height: 54px;
  padding: 12px 14px;
  border: 1px solid #dde6ea;
  border-radius: 8px;
  background: #fbfdfd;
}

.draw-row strong,
.query-hit strong,
.history-row strong {
  color: var(--red);
  font-size: 24px;
  letter-spacing: 0;
}

.draw-row span,
.query-hit span,
.history-row span {
  color: var(--muted);
  font-weight: 700;
}

.query-panel {
  min-height: 460px;
}

.history-table {
  display: grid;
  gap: 10px;
}

.history-row {
  grid-template-columns: 126px 1fr 120px 120px;
}

.history-row strong.hit {
  color: var(--green);
}

.history-empty {
  padding: 16px;
  border: 1px solid #dde6ea;
  border-radius: 8px;
  background: #fbfdfd;
  color: var(--muted);
  font-weight: 700;
}

.query-box {
  display: grid;
  grid-template-columns: 1fr 86px;
  gap: 10px;
}

.query-box input,
.query-box button {
  height: 44px;
  border-radius: 8px;
  font: inherit;
}

.query-box input {
  width: 100%;
  border: 1px solid #cbd7dc;
  padding: 0 13px;
  background: #fff;
  color: var(--ink);
  outline: none;
}

.query-box input:focus {
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(15, 118, 94, .12);
}

.query-box button {
  border: 0;
  background: var(--green);
  color: #fff;
  cursor: pointer;
  font-weight: 800;
}

.query-result {
  margin-top: 14px;
  color: #344054;
  line-height: 1.65;
}

.calendar-card {
  margin-top: 18px;
  padding: 14px;
  border: 1px solid #dde6ea;
  border-radius: 8px;
  background: #fbfdfd;
}

.calendar-head {
  display: grid;
  grid-template-columns: 36px 1fr 36px;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}

.calendar-head strong {
  color: var(--green-dark);
  text-align: center;
  font-size: 18px;
}

.calendar-head button {
  width: 36px;
  height: 34px;
  border: 1px solid #cbd7dc;
  border-radius: 8px;
  background: #fff;
  color: var(--green-dark);
  cursor: pointer;
  font-size: 22px;
  line-height: 1;
  font-weight: 900;
}

.calendar-week,
.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 6px;
}

.calendar-week {
  margin-bottom: 6px;
}

.calendar-week span {
  color: var(--muted);
  text-align: center;
  font-size: 12px;
  font-weight: 900;
}

.calendar-day {
  min-height: 58px;
  padding: 7px 6px;
  border: 1px solid #e2eaed;
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  font-weight: 800;
}

.calendar-day.empty {
  background: transparent;
  border-color: transparent;
}

.calendar-day.has-draw {
  cursor: pointer;
  border-color: rgba(15, 118, 94, .26);
  background: rgba(15, 118, 94, .055);
}

.calendar-day.today {
  outline: 2px solid rgba(189, 122, 24, .42);
}

.calendar-day b {
  display: block;
  font-size: 13px;
}

.calendar-day strong {
  display: block;
  margin-top: 7px;
  color: var(--red);
  text-align: right;
  font-size: 17px;
}

.calendar-day small {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  text-align: right;
  font-size: 10px;
  font-weight: 800;
}

.summary-list {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin: 0;
}

.summary-list div {
  min-height: 104px;
  padding: 16px;
  border: 1px solid #dde6ea;
  border-radius: 8px;
  background: #fbfdfd;
}

.summary-list dt {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.summary-list dd {
  margin: 8px 0 0;
  color: #344054;
  line-height: 1.65;
}

.stoploss-note {
  margin: 0 0 16px;
  color: var(--muted);
  font-weight: 700;
  line-height: 1.6;
}

.stoploss-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.stoploss-grid label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.stoploss-grid input {
  height: 40px;
  border: 1px solid #cbd7dc;
  border-radius: 8px;
  padding: 0 12px;
  background: #fff;
  color: var(--ink);
  font: inherit;
  outline: none;
}

.stoploss-grid input:focus {
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(15, 118, 94, .12);
}

.stoploss-result {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.stoploss-result div {
  padding: 14px;
  border: 1px solid #dde6ea;
  border-radius: 8px;
  background: #fbfdfd;
  text-align: center;
}

.stoploss-result small {
  display: block;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.stoploss-result strong {
  display: block;
  margin-top: 8px;
  color: var(--green-dark);
  font-size: 22px;
}

.stoploss-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.sl-status {
  padding: 8px 14px;
  border-radius: 8px;
  font-weight: 900;
}

.sl-status.sl-ok {
  background: rgba(15, 118, 94, .10);
  color: var(--green-dark);
}

.sl-status.sl-stop {
  background: rgba(180, 35, 24, .10);
  color: var(--red);
}

.stoploss-footer button {
  height: 38px;
  padding: 0 16px;
  border: 1px solid #cbd7dc;
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  cursor: pointer;
  font-weight: 800;
}

.notice {
  gap: 12px;
  padding: 16px 18px;
  box-shadow: none;
  align-items: flex-start;
}

.notice strong {
  color: var(--red);
  white-space: nowrap;
}

.notice span {
  color: #344054;
  line-height: 1.6;
}

@media (max-width: 920px) {
  .app-shell {
    width: min(100% - 20px, 1220px);
    padding: 18px 0;
  }

  .topbar,
  .hero-grid,
  .workbench,
  .content-grid,
  .summary-list,
  .notice {
    display: block;
  }

  .official-board,
  .panel,
  .stat-card {
    margin-top: 12px;
  }

  .brand {
    align-items: flex-start;
  }

  .eyebrow {
    margin-left: 70px;
  }

  .official-board {
    min-height: 78px;
    grid-template-columns: 1fr;
    gap: 12px;
    text-align: center;
  }

  .official-divider {
    display: none;
  }

  .official-unit,
  .clock-unit {
    text-align: center;
  }

  .official-unit strong,
  .clock-unit strong {
    font-size: 34px;
  }

  .hero-card {
    padding: 22px;
  }

  .hero-actions {
    grid-template-columns: 1fr;
  }

  .draw-row,
  .query-hit,
  .history-row {
    grid-template-columns: 1fr;
  }

  .dan-card .dan-grid {
    justify-content: center;
  }

  .stoploss-grid,
  .stoploss-result {
    grid-template-columns: 1fr;
  }

  .calendar-day {
    min-height: 52px;
    padding: 6px 5px;
  }

  .calendar-day strong {
    font-size: 14px;
  }
}
