:root {
  --red: #e0303e;
  --red-deep: #b91c2b;
  --orange: #f59e0b;
  --blue: #2f80ed;
  --cyan: #0ea5e9;
  --green: #16a34a;
  --gold: #c48a2c;
  --ink: #111827;
  --ink-soft: #334155;
  --muted: #687589;
  --subtle: #94a3b8;
  --line: rgba(203, 213, 225, 0.72);
  --line-soft: rgba(226, 232, 240, 0.72);
  --panel: rgba(255, 255, 255, 0.82);
  --panel-solid: #ffffff;
  --bg: #f4f6fa;
  --shadow: 0 22px 60px rgba(15, 23, 42, 0.08);
  --shadow-soft: 0 10px 26px rgba(15, 23, 42, 0.06);
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  background:
    radial-gradient(circle at 12% 10%, rgba(47, 128, 237, 0.12), transparent 30%),
    radial-gradient(circle at 78% 2%, rgba(224, 48, 62, 0.12), transparent 24%),
    linear-gradient(180deg, #f8fafc 0%, #f4f6fa 42%, #edf1f6 100%);
  overflow-x: hidden;
}

button,
input { font: inherit; }

button {
  border: 0;
  cursor: pointer;
}

button:disabled {
  cursor: progress;
  opacity: 0.72;
}

.ambient {
  position: fixed;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
}

.ambient::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(148, 163, 184, 0.12) 1px, transparent 1px),
    linear-gradient(90deg, rgba(148, 163, 184, 0.1) 1px, transparent 1px);
  background-size: 80px 80px;
  mask-image: linear-gradient(180deg, rgba(0,0,0,.42), transparent 62%);
}

.glow {
  position: absolute;
  border-radius: 999px;
  filter: blur(34px);
  opacity: 0.9;
}

.glow.red {
  width: 500px;
  height: 150px;
  right: -130px;
  top: 68px;
  background: rgba(224, 48, 62, 0.14);
  transform: rotate(-18deg);
  animation: floatRed 8s ease-in-out infinite;
}

.glow.blue {
  width: 360px;
  height: 116px;
  left: -120px;
  top: 140px;
  background: rgba(47, 128, 237, 0.14);
  transform: rotate(24deg);
  animation: floatBlue 9s ease-in-out infinite;
}

.glow.soft {
  width: 640px;
  height: 170px;
  left: 18%;
  top: 510px;
  background: rgba(14, 165, 233, 0.07);
  transform: rotate(8deg);
  animation: floatSoft 10s ease-in-out infinite;
}

@keyframes floatRed {
  50% { transform: translate(-38px, 24px) rotate(-12deg); opacity: 1; }
}

@keyframes floatBlue {
  50% { transform: translate(92px, 70px) rotate(20deg); opacity: 0.78; }
}

@keyframes floatSoft {
  50% { transform: translate(72px, -20px) rotate(4deg); opacity: 0.55; }
}

.app {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  padding: 34px 22px 104px;
}

.shell {
  width: min(1240px, 100%);
  margin: 0 auto;
}

.hero {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 22px;
  margin-bottom: 26px;
}

.hero-copy {
  min-width: 0;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  height: 26px;
  padding: 0 10px;
  border: 1px solid rgba(47, 128, 237, 0.16);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.66);
  color: #35639d;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: .02em;
  text-transform: uppercase;
}

.brand {
  display: flex;
  align-items: baseline;
  gap: 9px;
  margin-top: 12px;
  color: #0f172a;
  font-size: clamp(34px, 5vw, 58px);
  font-weight: 950;
  line-height: 1;
  letter-spacing: 0;
}

.master {
  position: relative;
  display: inline-block;
  background: linear-gradient(135deg, #9c6417 0%, #f7d67b 44%, #b37113 100%);
  -webkit-background-clip: text;
  color: transparent;
}

.master::after {
  content: "";
  position: absolute;
  inset: 8% -10%;
  width: 18px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .98), rgba(255, 239, 178, .72), transparent);
  transform: translateX(-130%) rotate(13deg);
  animation: masterSheen 4.2s ease-in-out infinite;
}

.master i {
  position: absolute;
  right: -22px;
  top: -15px;
  font-size: 18px;
  font-style: normal;
  color: #f3c764;
}

@keyframes masterSheen {
  0%, 60% { transform: translateX(-130%) rotate(13deg); opacity: 0; }
  72% { opacity: .95; }
  100% { transform: translateX(560%) rotate(13deg); opacity: 0; }
}

.hero p {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 15px;
  font-weight: 760;
}

.member-entry {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: max-content;
  height: 42px;
  padding: 0 15px;
  border: 1px solid rgba(196, 138, 44, 0.28);
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(255, 252, 242, 0.9), rgba(255, 255, 255, 0.7));
  color: #8a5b19;
  font-size: 14px;
  font-weight: 900;
  box-shadow: var(--shadow-soft);
}

.member-arrow {
  font-size: 20px;
  line-height: 1;
  transform: translateY(-1px);
}

.view { display: none; }
.view.active { display: block; }

.calc-layout {
  display: grid;
  grid-template-columns: 348px minmax(0, 1fr);
  gap: 24px;
  align-items: start;
}

.control-column {
  display: grid;
  gap: 18px;
  position: sticky;
  top: 24px;
}

.glass,
.favorite-card,
.quote-card,
.today-card,
.projection-card,
.review-card,
.dashboard-empty,
.square-item {
  border: 1px solid rgba(255, 255, 255, 0.76);
  border-radius: 20px;
  background: var(--panel);
  box-shadow: var(--shadow), inset 0 1px 0 rgba(255, 255, 255, .9);
  backdrop-filter: blur(20px) saturate(150%);
}

.search-card {
  padding: 18px;
}

.search-label {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 13px;
}

.search-label span {
  color: #0f172a;
  font-size: 18px;
  font-weight: 950;
}

.search-label small {
  color: var(--subtle);
  font-size: 12px;
  font-weight: 850;
}

.search-box {
  display: flex;
  align-items: center;
  gap: 11px;
  height: 54px;
  padding: 0 13px;
  border: 1px solid rgba(148, 163, 184, 0.28);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.86);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.96);
}

.search-box:focus-within {
  border-color: rgba(224, 48, 62, 0.42);
  box-shadow: 0 0 0 4px rgba(224, 48, 62, 0.08), inset 0 1px 0 rgba(255,255,255,.96);
}

.search-icon {
  position: relative;
  width: 20px;
  height: 20px;
  color: var(--red);
}

.search-icon::before {
  content: "";
  position: absolute;
  left: 1px;
  top: 1px;
  width: 12px;
  height: 12px;
  border: 2px solid currentColor;
  border-radius: 50%;
}

.search-icon::after {
  content: "";
  position: absolute;
  right: 2px;
  bottom: 2px;
  width: 8px;
  height: 2px;
  border-radius: 999px;
  background: currentColor;
  transform: rotate(45deg);
  transform-origin: center;
}

.search-box input {
  flex: 1;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--ink);
  font-size: 16px;
  font-weight: 820;
}

.search-box input::placeholder {
  color: #a4afbf;
}

.clear-btn {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(100, 116, 139, 0.1);
  color: #7c8797;
  font-size: 20px;
  line-height: 28px;
}

.primary-btn {
  width: 100%;
  height: 50px;
  margin-top: 16px;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--red) 0%, #ff674d 100%);
  color: #fff;
  font-size: 16px;
  font-weight: 950;
  box-shadow: 0 14px 28px rgba(224, 48, 62, 0.2);
}

.primary-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 18px 34px rgba(224, 48, 62, 0.24);
}

.suggestions {
  display: none;
  margin-top: 10px;
  border: 1px solid rgba(226, 232, 240, .88);
  border-radius: 14px;
  overflow: hidden;
  background: rgba(255,255,255,.94);
}

.suggestions.active { display: block; }

.suggestion {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 12px 13px;
  border-bottom: 1px solid rgba(226,232,240,.72);
  background: transparent;
  text-align: left;
}

.suggestion:hover {
  background: rgba(248, 250, 252, .92);
}

.suggestion:last-child { border-bottom: 0; }

.suggestion strong {
  display: block;
  color: var(--ink);
  font-size: 15px;
  font-weight: 920;
}

.suggestion small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-weight: 780;
}

.suggestion > span:last-child {
  color: var(--red);
  font-size: 12px;
  font-weight: 900;
}

.section-block,
.detail,
.section-head {
  margin-top: 0;
}

.favorite-card {
  padding: 16px;
}

.section-title-row,
.projection-head,
.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

h2 {
  margin: 0;
  color: #0f172a;
  font-size: 20px;
  font-weight: 950;
  letter-spacing: 0;
}

.section-title-row span,
.section-head p {
  margin: 0;
  color: var(--subtle);
  font-size: 12px;
  font-weight: 850;
}

.favorite-list {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.favorite-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 66px;
  padding: 12px 13px;
  border: 1px solid rgba(226, 232, 240, .78);
  border-radius: 15px;
  background: rgba(255, 255, 255, 0.78);
  text-align: left;
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.04);
}

.favorite-item:hover {
  border-color: rgba(224, 48, 62, .22);
  transform: translateY(-1px);
}

.favorite-name {
  display: block;
  color: #111827;
  font-size: 16px;
  font-weight: 900;
}

.favorite-meta {
  display: block;
  margin-top: 4px;
  color: #8793a5;
  font: 12px "SFMono-Regular", Consolas, monospace;
}

.favorite-risk {
  max-width: 116px;
  text-align: right;
  color: var(--red);
  font-size: 12px;
  font-weight: 900;
  line-height: 1.35;
}

.empty {
  color: var(--subtle);
  font-weight: 820;
}

.dashboard-empty {
  min-height: 414px;
  padding: 28px;
  display: grid;
  align-content: space-between;
  overflow: hidden;
  position: relative;
}

.dashboard-empty::before {
  content: "";
  position: absolute;
  right: -80px;
  top: -100px;
  width: 360px;
  height: 360px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(224,48,62,.12), transparent 64%);
}

.empty-kicker {
  display: inline-flex;
  height: 28px;
  align-items: center;
  padding: 0 10px;
  border-radius: 999px;
  background: rgba(47, 128, 237, .1);
  color: #2f67bd;
  font-size: 12px;
  font-weight: 950;
  letter-spacing: .06em;
}

.dashboard-empty h2 {
  max-width: 480px;
  margin-top: 16px;
  font-size: clamp(30px, 4vw, 52px);
  line-height: 1.08;
}

.dashboard-empty p {
  max-width: 560px;
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 16px;
  font-weight: 760;
  line-height: 1.7;
}

.empty-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  position: relative;
  z-index: 1;
}

.empty-metrics span {
  padding: 16px;
  border: 1px solid rgba(226,232,240,.72);
  border-radius: 18px;
  background: rgba(255,255,255,.72);
}

.empty-metrics b {
  display: block;
  color: var(--red);
  font-size: 32px;
  font-weight: 950;
  line-height: 1;
}

.empty-metrics small {
  display: block;
  margin-top: 8px;
  color: var(--muted);
  font-weight: 850;
}

.detail {
  display: grid;
  grid-template-columns: minmax(0, 1.04fr) minmax(350px, .96fr);
  gap: 18px;
  align-items: start;
}

.detail.hidden { display: none; }

.detail-route .app {
  padding-bottom: 42px;
}

.detail-route .control-column,
.detail-route #emptyDashboard,
.detail-route .tabbar {
  display: none;
}

.detail-route .calc-layout {
  display: block;
}

.detail-toolbar {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 4px;
  padding: 12px 14px;
  border: 1px solid rgba(255, 255, 255, .76);
  border-radius: 16px;
  background: rgba(255,255,255,.72);
  box-shadow: var(--shadow-soft), inset 0 1px 0 rgba(255,255,255,.92);
}

.detail-toolbar span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 850;
}

.route-loading {
  min-height: 320px;
  display: grid;
  place-items: center;
  gap: 14px;
  border: 1px solid rgba(255, 255, 255, .76);
  border-radius: 20px;
  background: rgba(255,255,255,.76);
  color: var(--muted);
  font-size: 18px;
  font-weight: 900;
  box-shadow: var(--shadow);
}

.quote-card {
  position: relative;
  padding: 24px;
  color: #fff;
  overflow: hidden;
  background:
    linear-gradient(135deg, rgba(15, 23, 42, 0.95), rgba(35, 47, 69, 0.92)),
    radial-gradient(circle at 90% 0%, rgba(224,48,62,.6), transparent 36%);
}

.quote-card::after {
  content: "";
  position: absolute;
  right: -70px;
  bottom: -120px;
  width: 300px;
  height: 300px;
  border-radius: 50%;
  background: rgba(255,255,255,.08);
}

.quote-card.tone-safe {
  background:
    linear-gradient(135deg, rgba(15, 38, 66, 0.96), rgba(26, 74, 112, .9)),
    radial-gradient(circle at 90% 0%, rgba(47, 128, 237, .5), transparent 36%);
}

.quote-card.tone-warning,
.quote-card.tone-monitor {
  background:
    linear-gradient(135deg, rgba(81, 51, 14, .96), rgba(145, 74, 18, .92)),
    radial-gradient(circle at 90% 0%, rgba(245, 158, 11, .64), transparent 38%);
}

.quote-card.tone-danger {
  background:
    linear-gradient(135deg, rgba(104, 19, 28, .98), rgba(198, 46, 48, .92)),
    radial-gradient(circle at 90% 0%, rgba(255, 120, 88, .72), transparent 36%);
}

.quote-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  position: relative;
  z-index: 1;
}

.quote-name {
  font-size: clamp(28px, 4vw, 46px);
  font-weight: 950;
  letter-spacing: 0;
}

.quote-code {
  margin-top: 7px;
  color: rgba(255,255,255,.68);
  font-weight: 780;
}

.quote-price {
  position: relative;
  z-index: 1;
  margin-top: 24px;
  font-size: clamp(50px, 7vw, 80px);
  font-weight: 950;
  line-height: 1;
  letter-spacing: -0.01em;
}

.quote-change {
  display: inline-flex;
  margin-left: 14px;
  padding: 8px 14px;
  border: 1px solid rgba(255,255,255,.2);
  border-radius: 999px;
  background: rgba(255,255,255,.12);
  color: rgba(255,255,255,.94);
  font-size: 20px;
  font-weight: 920;
  vertical-align: 12px;
}

.quote-grid {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 22px;
}

.quote-stat {
  padding: 13px 14px;
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 15px;
  background: rgba(255,255,255,.11);
}

.quote-stat small {
  display: block;
  color: rgba(255,255,255,.65);
  font-size: 12px;
  font-weight: 820;
}

.quote-stat strong {
  display: block;
  margin-top: 6px;
  color: #fff;
  font-size: 17px;
  font-weight: 920;
}

.today-card,
.projection-card,
.review-card {
  padding: 18px;
  margin-bottom: 16px;
}

.today-card {
  border-color: rgba(255,255,255,.82);
}

.today-card.tone-safe {
  background: linear-gradient(180deg, rgba(255,255,255,.9), rgba(245,249,255,.84));
}

.today-card.tone-warning,
.today-card.tone-monitor {
  background: linear-gradient(180deg, rgba(255,255,255,.92), rgba(255,249,236,.86));
}

.today-card.tone-danger {
  background: linear-gradient(180deg, rgba(255,255,255,.92), rgba(255,241,242,.88));
}

.rule-tabs {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 9px;
  margin: 15px 0 14px;
}

.rule-tab {
  min-height: 58px;
  padding: 9px 10px;
  border: 1px solid rgba(226,232,240,.88);
  border-radius: 15px;
  background: rgba(255,255,255,.72);
  color: #475569;
  font-weight: 920;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.88);
}

.rule-tab span,
.rule-tab small {
  display: block;
}

.rule-tab small {
  margin-top: 4px;
  color: var(--subtle);
  font-size: 11px;
  font-weight: 850;
}

.rule-tab.active {
  color: var(--red);
  border-color: rgba(224, 48, 62, .38);
  background: rgba(255, 255, 255, .96);
  box-shadow: 0 10px 22px rgba(224, 48, 62, .09), inset 0 3px 0 rgba(224, 48, 62, .52);
}

.rule-tab.active.tone-safe {
  color: #2563eb;
  border-color: rgba(47, 128, 237, .32);
  box-shadow: 0 10px 22px rgba(47, 128, 237, .08), inset 0 3px 0 rgba(47, 128, 237, .5);
}

.rule-tab.active.tone-warning,
.rule-tab.active.tone-monitor {
  color: #c26a08;
  border-color: rgba(245, 158, 11, .36);
  box-shadow: 0 10px 22px rgba(245, 158, 11, .08), inset 0 3px 0 rgba(245, 158, 11, .58);
}

.rule-panel {
  border: 1px solid rgba(226,232,240,.72);
  border-radius: 18px;
  padding: 17px;
  background: rgba(255,255,255,.72);
}

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

.rule-main h3 {
  margin: 9px 0 0;
  color: #334155;
  font-size: 14px;
  font-weight: 900;
}

.rule-space {
  color: var(--red);
  font-size: 30px;
  font-weight: 950;
  white-space: nowrap;
}

.tone-safe .rule-space { color: #2563eb; }
.tone-warning .rule-space,
.tone-monitor .rule-space { color: #d97706; }
.tone-danger .rule-space { color: var(--red-deep); }

.status-pill {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  background: rgba(224, 48, 62, .1);
  color: var(--red);
  font-size: 12px;
  font-weight: 950;
}

.tone-safe .status-pill {
  background: rgba(47, 128, 237, .1);
  color: #2563eb;
}

.tone-warning .status-pill,
.tone-monitor .status-pill {
  background: rgba(245, 158, 11, .14);
  color: #c26a08;
}

.tone-danger .status-pill {
  background: rgba(224, 48, 62, .12);
  color: var(--red-deep);
}

.rule-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 14px;
}

.mini-stat {
  padding: 11px 12px;
  border: 1px solid rgba(226,232,240,.66);
  border-radius: 14px;
  background: rgba(248,250,252,.86);
}

.mini-stat small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 820;
}

.mini-stat strong {
  display: block;
  margin-top: 5px;
  color: #111827;
  font-size: 18px;
  font-weight: 920;
}

.chart-wrap {
  height: 238px;
  margin-top: 15px;
  border: 1px solid rgba(226,232,240,.74);
  border-radius: 17px;
  background:
    linear-gradient(180deg, rgba(248,250,252,.94), rgba(255,255,255,.82)),
    radial-gradient(circle at 12% 8%, rgba(47,128,237,.08), transparent 36%);
  padding: 14px;
}

canvas {
  width: 100%;
  height: 100%;
  display: block;
}

.ghost-btn {
  height: 38px;
  padding: 0 14px;
  border: 1px solid rgba(226,232,240,.86);
  border-radius: 12px;
  background: rgba(255,255,255,.78);
  color: #334155;
  font-size: 13px;
  font-weight: 920;
}

.ghost-btn:hover {
  border-color: rgba(224, 48, 62, .3);
  color: var(--red);
}

.projection-table {
  display: grid;
  gap: 14px;
  margin-top: 15px;
}

.projection-day {
  border: 1px solid rgba(226,232,240,.8);
  border-radius: 17px;
  background: rgba(255,255,255,.74);
  box-shadow: 0 6px 16px rgba(15, 23, 42, 0.035);
  overflow: hidden;
}

.projection-day-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 12px 14px;
  background: rgba(248,250,252,.88);
}

.projection-day-head div {
  display: flex;
  align-items: baseline;
  gap: 9px;
}

.projection-day-head strong {
  color: #0f172a;
  font-size: 16px;
  font-weight: 950;
}

.projection-day-head small,
.projection-rule-header,
.projection-rule-row small {
  color: var(--subtle);
  font-weight: 820;
}

.projection-day-head > span {
  display: inline-flex;
  align-items: baseline;
  gap: 8px;
}

.projection-day-head b {
  color: #111827;
  font-size: 18px;
  font-weight: 950;
}

.projection-rule-table {
  display: grid;
  padding: 10px;
  gap: 7px;
}

.projection-rule-header,
.projection-rule-row {
  display: grid;
  grid-template-columns: 76px 1fr 1.08fr 1fr;
  gap: 8px;
  align-items: center;
}

.projection-rule-header {
  padding: 0 9px 2px;
  font-size: 11px;
  font-weight: 920;
}

.projection-rule-row {
  min-height: 42px;
  padding: 8px 9px;
  border: 1px solid rgba(226,232,240,.68);
  border-radius: 12px;
  background: rgba(255,255,255,.72);
  color: #334155;
  font-size: 13px;
  font-weight: 850;
}

.projection-rule-row.is-closest {
  border-color: rgba(47, 128, 237, .24);
  background: rgba(47, 128, 237, .07);
}

.projection-rule-row.tone-warning,
.projection-rule-row.tone-monitor {
  border-color: rgba(245, 158, 11, .28);
  background: rgba(245, 158, 11, .08);
}

.projection-rule-row.tone-danger {
  border-color: rgba(224, 48, 62, .26);
  background: rgba(224, 48, 62, .08);
}

.rule-type {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-width: 0;
}

.rule-type b {
  color: #111827;
  font-size: 13px;
  font-weight: 950;
}

.rule-type i {
  display: inline-flex;
  min-width: max-content;
  height: 18px;
  align-items: center;
  padding: 0 5px;
  border-radius: 999px;
  background: rgba(47, 128, 237, .12);
  color: #2563eb;
  font-size: 10px;
  font-style: normal;
  font-weight: 950;
}

.projection-rule-row span:nth-child(3) {
  border-radius: 12px;
  padding: 6px 7px;
  background: rgba(47, 128, 237, .08);
  color: #2563eb;
  font-weight: 950;
}

.projection-rule-row.tone-warning span:nth-child(3),
.projection-rule-row.tone-monitor span:nth-child(3) {
  background: rgba(245, 158, 11, .12);
  color: #bd6808;
}

.projection-rule-row.tone-danger span:nth-child(3) {
  background: rgba(224, 48, 62, .1);
  color: var(--red-deep);
}

.review-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 14px;
}

.review-head p {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 780;
  line-height: 1.55;
}

.review-legend {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
  min-width: 170px;
}

.review-legend span {
  display: inline-flex;
  align-items: center;
  height: 24px;
  padding: 0 8px;
  border-radius: 999px;
  background: rgba(100,116,139,.1);
  color: #64748b;
  font-size: 11px;
  font-weight: 900;
}

.review-legend .up { background: rgba(224,48,62,.1); color: var(--red); }
.review-legend .down { background: rgba(22,163,74,.1); color: #15803d; }
.review-legend .warn { background: rgba(47,128,237,.1); color: #2563eb; }
.review-legend .trigger { background: rgba(124,58,237,.1); color: #6d28d9; }

.review-kline-wrap {
  height: 310px;
  margin-top: 14px;
  border: 1px solid rgba(226,232,240,.74);
  border-radius: 17px;
  background:
    linear-gradient(180deg, rgba(248,250,252,.95), rgba(255,255,255,.86)),
    radial-gradient(circle at 16% 12%, rgba(47,128,237,.08), transparent 34%);
  padding: 10px;
}

.review-selected {
  min-height: 46px;
  display: grid;
  gap: 3px;
  margin-top: 10px;
  padding: 10px 12px;
  border: 1px solid rgba(226,232,240,.74);
  border-radius: 14px;
  background: rgba(255,255,255,.66);
  color: var(--muted);
  font-size: 12px;
  font-weight: 820;
  line-height: 1.45;
}

.review-selected b {
  color: #111827;
  font-size: 14px;
  font-weight: 950;
}

.review-selected span,
.review-selected em {
  display: block;
  font-style: normal;
}

.review-selected em {
  color: #2563eb;
  font-weight: 900;
}

.review-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin-top: 12px;
}

.review-stats span {
  min-width: 0;
  padding: 10px;
  border: 1px solid rgba(226,232,240,.74);
  border-radius: 13px;
  background: rgba(255,255,255,.68);
}

.review-stats b {
  display: block;
  color: #111827;
  font-size: 16px;
  font-weight: 950;
}

.review-stats small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 850;
  line-height: 1.35;
}

.review-stats em {
  display: block;
  margin-top: 2px;
  color: var(--subtle);
  font-style: normal;
}

.review-stats .severe b { color: #7c3aed; }
.review-stats .warning b { color: #d97706; }
.review-stats .ordinary b { color: #f59e0b; }

.section-head {
  margin-bottom: 16px;
}

#squareView {
  width: min(980px, 100%);
}

#squareView .section-head {
  padding: 18px;
  border: 1px solid rgba(255, 255, 255, 0.76);
  border-radius: 20px;
  background: rgba(255,255,255,.72);
  box-shadow: var(--shadow-soft), inset 0 1px 0 rgba(255,255,255,.92);
  backdrop-filter: blur(18px) saturate(145%);
}

.section-head > div {
  display: grid;
  gap: 5px;
}

.square-tabs {
  display: inline-flex;
  gap: 7px;
  padding: 5px;
  margin: 0 0 16px;
  border: 1px solid rgba(226,232,240,.78);
  border-radius: 16px;
  background: rgba(255,255,255,.64);
}

.square-tab {
  height: 38px;
  padding: 0 18px;
  border-radius: 12px;
  background: transparent;
  color: #64748b;
  font-size: 14px;
  font-weight: 920;
}

.square-tab.active {
  background: #111827;
  color: #fff;
  box-shadow: 0 10px 20px rgba(15, 23, 42, .12);
}

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

.square-list > .empty {
  min-height: 180px;
  display: grid;
  place-items: center;
  border: 1px dashed rgba(148, 163, 184, .42);
  border-radius: 20px;
  background: rgba(255,255,255,.56);
}

.square-item {
  display: grid;
  grid-template-columns: minmax(140px, 1fr) 76px 70px 96px 76px;
  gap: 12px;
  align-items: center;
  min-height: 76px;
  padding: 14px 16px;
  text-align: left;
}

.square-item:hover {
  transform: translateY(-1px);
  border-color: rgba(224, 48, 62, .22);
}

.square-name strong {
  display: block;
  color: #111827;
  font-size: 17px;
  font-weight: 920;
}

.square-name small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-weight: 760;
}

.square-item b {
  color: var(--red);
  font-size: 16px;
  font-weight: 950;
}

.tabbar {
  position: fixed;
  left: 50%;
  right: auto;
  bottom: 18px;
  z-index: 5;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 150px));
  width: min(360px, calc(100% - 28px));
  transform: translateX(-50%);
  padding: 6px;
  border: 1px solid rgba(226,232,240,.92);
  border-radius: 18px;
  background: rgba(255,255,255,.88);
  box-shadow: 0 18px 44px rgba(15,23,42,.12);
  backdrop-filter: blur(18px) saturate(150%);
}

.tab {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 46px;
  border-radius: 13px;
  background: transparent;
  color: #64748b;
  font-size: 13px;
  font-weight: 900;
}

.tab.active {
  background: #111827;
  color: #fff;
}

.tab-icon {
  position: relative;
  width: 24px;
  height: 22px;
}

.tab-icon.calc::before {
  content: "";
  position: absolute;
  inset: 1px 4px;
  border: 3px solid currentColor;
  border-radius: 5px;
}

.tab-icon.calc::after {
  content: "";
  position: absolute;
  left: 8px;
  right: 8px;
  top: 8px;
  bottom: 8px;
  box-shadow: -4px -4px 0 currentColor, 4px -4px 0 currentColor, -4px 5px 0 currentColor, 4px 5px 0 currentColor;
}

.tab-icon.square::before {
  content: "";
  position: absolute;
  inset: 4px;
  border: 3px solid currentColor;
  border-radius: 6px;
  transform: rotate(45deg);
}

.tab-icon.square::after {
  content: "";
  position: absolute;
  left: 9px;
  top: 9px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 92px;
  z-index: 20;
  transform: translateX(-50%);
  padding: 10px 14px;
  border-radius: 999px;
  background: rgba(15,23,42,.9);
  color: #fff;
  font-size: 14px;
  font-weight: 850;
  box-shadow: 0 12px 32px rgba(15,23,42,.18);
}

.hidden { display: none !important; }

.modal {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(15,23,42,.28);
  backdrop-filter: blur(12px);
}

.modal-card {
  position: relative;
  width: min(430px, 100%);
  border: 1px solid rgba(255,255,255,.82);
  border-radius: 24px;
  padding: 28px;
  background: rgba(255,255,255,.96);
  box-shadow: 0 30px 90px rgba(15,23,42,.2);
}

.modal-close {
  position: absolute;
  right: 14px;
  top: 12px;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: rgba(148,163,184,.12);
  color: #64748b;
}

.member-options {
  display: grid;
  gap: 10px;
  margin-top: 16px;
}

.member-option {
  padding: 15px;
  border: 1px solid rgba(196, 138, 44, .28);
  border-radius: 17px;
  background: linear-gradient(135deg, rgba(255,250,239,.94), rgba(255,255,255,.9));
  color: #7a4b14;
  font-weight: 950;
  text-align: left;
}

.member-option small {
  color: #8a6b3d;
  font-weight: 780;
}

@media (max-width: 1100px) {
  .calc-layout {
    grid-template-columns: 320px minmax(0, 1fr);
    gap: 18px;
  }

  .detail {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 820px) {
  .app {
    padding: 24px 14px 98px;
  }

  .hero {
    align-items: stretch;
    flex-direction: column;
    margin-bottom: 20px;
  }

  .member-entry {
    width: fit-content;
  }

  .calc-layout {
    display: block;
  }

  .control-column {
    position: static;
    display: grid;
    gap: 16px;
  }

  .dashboard-empty,
  .detail {
    margin-top: 16px;
  }

  .detail {
    display: block;
  }

  .quote-grid {
    grid-template-columns: 1fr 1fr;
  }

  .quote-price {
    font-size: 54px;
  }

  .quote-change {
    display: inline-flex;
    margin: 12px 0 0;
    vertical-align: 0;
  }

  .rule-main {
    align-items: flex-start;
    flex-direction: column;
  }

  .rule-space {
    font-size: 28px;
  }

  .projection-rule-header,
  .projection-rule-row {
    grid-template-columns: 58px 1fr 1fr;
  }

  .projection-rule-header span:nth-child(4),
  .projection-rule-row span:nth-child(4) {
    grid-column: 2 / 4;
  }

  .square-item {
    grid-template-columns: minmax(0, 1fr) 62px 56px;
  }

  .square-item span:nth-child(4),
  .square-item span:nth-child(5) {
    grid-column: auto;
  }

  .tabbar {
    left: 0;
    right: 0;
    bottom: 0;
    width: auto;
    transform: none;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    padding: 7px 0 calc(7px + env(safe-area-inset-bottom));
    border-right: 0;
    border-bottom: 0;
    border-left: 0;
    border-radius: 0;
  }

  .tab {
    height: 52px;
    flex-direction: column;
    gap: 4px;
    border-radius: 0;
    font-size: 12px;
  }

  .tab.active {
    background: transparent;
    color: var(--red);
  }
}

@media (max-width: 520px) {
  .brand {
    font-size: 39px;
  }

  .hero p {
    font-size: 14px;
  }

  .empty-metrics,
  .quote-grid,
  .rule-grid {
    grid-template-columns: 1fr;
  }

  .dashboard-empty {
    min-height: 360px;
    padding: 22px;
  }

  .quote-card,
  .today-card,
  .projection-card,
  .review-card,
  .favorite-card,
  .search-card {
    border-radius: 18px;
  }

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

/* 2026 web workspace alignment with the mini program */
:root {
  --red: #e23b45;
  --red-deep: #bf2835;
  --orange: #c99031;
  --gold: #b77c24;
  --ink: #202938;
  --ink-soft: #3f4a5b;
  --muted: #7f8998;
  --subtle: #a2aab6;
  --line: rgba(218, 223, 231, 0.92);
  --line-soft: rgba(229, 233, 239, 0.9);
  --panel: #ffffff;
  --bg: #f3f4f7;
  --shadow: 0 12px 30px rgba(25, 35, 55, 0.06);
  --shadow-soft: 0 7px 20px rgba(25, 35, 55, 0.045);
}

html,
body {
  background: var(--bg);
}

body {
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "PingFang SC", "Microsoft YaHei", sans-serif;
  background: #f3f4f7;
}

.app {
  padding: 22px 22px 106px;
}

.shell {
  width: min(1180px, 100%);
}

.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 18px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  width: auto;
  min-width: 0;
  margin: 0;
  padding: 0;
  background: transparent;
  color: var(--ink);
  font-size: 28px;
  font-weight: 900;
  line-height: 1;
  letter-spacing: 0;
}

.brand-word {
  color: var(--ink);
}

.brand .master {
  position: relative;
  background: none;
  color: var(--gold);
  -webkit-background-clip: initial;
}

.brand .master::after {
  display: none;
}

.master-spark {
  align-self: flex-start;
  margin: -8px 0 0 2px;
  color: #d7ad5a;
  font-size: 13px;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 9px;
}

.account-button,
.member-entry {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 38px;
  min-width: 0;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.9);
  color: var(--ink-soft);
  font-size: 12px;
  font-weight: 700;
  box-shadow: none;
}

.account-button:hover,
.member-entry:hover {
  border-color: rgba(226, 59, 69, 0.28);
  color: var(--red);
}

.member-entry {
  border-color: rgba(183, 124, 36, 0.24);
  background: #fffaf0;
  color: #855916;
}

.account-avatar {
  display: grid;
  place-items: center;
  width: 23px;
  height: 23px;
  overflow: hidden;
  border-radius: 50%;
  background: #eef1f5;
  color: #778293;
  font-size: 9px;
  font-weight: 800;
}

.account-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.member-arrow {
  font-size: 16px;
}

.ops-notice {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 42px;
  margin: 0 0 16px;
  padding: 8px 12px;
  border: 1px solid rgba(226, 59, 69, 0.12);
  border-radius: 12px;
  background: #fff8f8;
  color: #6f3035;
  text-align: left;
}

.notice-badge {
  flex: none;
  padding: 3px 7px;
  border-radius: 5px;
  background: var(--red);
  color: #fff;
  font-size: 10px;
  font-weight: 800;
}

.notice-text {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  color: #663b3e;
  font-size: 12px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.notice-action {
  flex: none;
  color: var(--red);
  font-size: 11px;
  font-weight: 800;
}

.glass,
.favorite-card,
.quote-card,
.today-card,
.projection-card,
.review-card,
.dashboard-empty,
.square-item,
.hot-surface,
.square-trend-card,
.monitor-card,
.activity-card {
  border: 1px solid rgba(255, 255, 255, 0.95);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: var(--shadow-soft);
  backdrop-filter: none;
}

.calc-layout {
  grid-template-columns: 318px minmax(0, 1fr);
  gap: 18px;
}

.control-column {
  top: 18px;
  gap: 14px;
}

.search-card,
.favorite-card,
.activity-card {
  padding: 15px;
}

.search-label {
  margin-bottom: 11px;
}

.search-label span {
  font-size: 17px;
}

.search-label small,
.section-title-row span {
  color: var(--subtle);
  font-size: 11px;
}

.search-box {
  height: 48px;
  border-color: #e3e7ed;
  border-radius: 11px;
  background: #fafbfc;
}

.search-box input {
  font-size: 15px;
  font-weight: 650;
}

.primary-btn {
  height: 46px;
  margin-top: 12px;
  border-radius: 11px;
  background: linear-gradient(135deg, #f04b52, #df2f3a);
  font-size: 15px;
  font-weight: 850;
  box-shadow: 0 9px 20px rgba(226, 59, 69, 0.17);
}

.suggestions {
  border-radius: 10px;
}

.favorite-list {
  gap: 8px;
  margin-top: 11px;
}

.favorite-item {
  min-height: 58px;
  padding: 10px 11px;
  border-color: #e7eaf0;
  border-radius: 10px;
  background: #fafbfc;
  box-shadow: none;
}

.favorite-name {
  font-size: 14px;
  font-weight: 800;
}

.favorite-meta {
  margin-top: 3px;
  font-size: 10px;
}

.favorite-risk {
  max-width: 104px;
  font-size: 10px;
}

.dashboard-empty {
  min-height: 430px;
  padding: 28px;
  background: #fff;
}

.dashboard-empty::before {
  right: -120px;
  top: -140px;
  width: 330px;
  height: 330px;
  background: radial-gradient(circle, rgba(226, 59, 69, 0.055), transparent 68%);
}

.empty-main {
  align-self: center;
  max-width: 560px;
}

.empty-mark {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border: 1px solid #e5e8ee;
  border-radius: 12px;
  background: #f7f8fa;
  color: var(--red);
}

.empty-mark svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.dashboard-empty h2 {
  margin-top: 17px;
  font-size: 25px;
  line-height: 1.25;
}

.dashboard-empty p {
  margin-top: 10px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 550;
  line-height: 1.7;
}

.empty-metrics {
  gap: 9px;
}

.empty-metrics span {
  padding: 13px;
  border-color: #e8ebf0;
  border-radius: 11px;
  background: #fafbfc;
}

.empty-metrics b {
  color: var(--ink);
  font-size: 18px;
}

.empty-metrics small {
  margin-top: 5px;
  font-size: 10px;
}

.activity-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.activity-head strong {
  display: block;
  color: var(--ink);
  font-size: 14px;
  font-weight: 850;
}

.activity-head small {
  display: block;
  margin-top: 3px;
  color: var(--subtle);
  font-size: 10px;
}

.activity-status {
  padding: 3px 7px;
  border-radius: 5px;
  background: #fff4e2;
  color: #9a681c;
  font-size: 9px;
  font-weight: 800;
}

.activity-card > p {
  margin: 11px 0 9px;
  color: #6f7886;
  font-size: 11px;
  font-weight: 650;
}

.activity-progress {
  height: 5px;
  overflow: hidden;
  border-radius: 999px;
  background: #eceff3;
}

.activity-progress i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #d8b566, #b77c24);
}

.activity-steps {
  display: flex;
  gap: 5px;
  margin-top: 8px;
  overflow-x: auto;
  scrollbar-width: none;
}

.activity-steps::-webkit-scrollbar {
  display: none;
}

.activity-steps span {
  flex: none;
  padding: 6px 7px;
  border: 1px solid #eceff3;
  border-radius: 7px;
  background: #fafbfc;
  color: #929aa7;
  font-size: 9px;
  line-height: 1.4;
}

.activity-steps span.reached {
  border-color: rgba(183, 124, 36, 0.22);
  background: #fff9ec;
  color: #8c611c;
}

.activity-steps b {
  display: block;
  margin-top: 2px;
  color: inherit;
  font-size: 9px;
}

.activity-login {
  width: 100%;
  height: 32px;
  margin-top: 10px;
  font-size: 10px;
}

.hot-view,
#squareView {
  width: min(1020px, 100%);
  margin: 0 auto;
}

.hot-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 14px;
}

.hot-heading h2 {
  font-size: 26px;
}

.hot-heading p,
.square-trend-head p,
.square-section-head p,
.monitor-sub {
  margin: 5px 0 0;
  color: var(--subtle);
  font-size: 12px;
  font-weight: 550;
}

.hot-date,
.square-trend-pill {
  padding: 6px 9px;
  border: 1px solid #e4e8ee;
  border-radius: 8px;
  background: #fff;
  color: #707a88;
  font-size: 10px;
  font-weight: 750;
}

.hot-surface {
  overflow: hidden;
  padding: 0;
}

.hot-list {
  display: grid;
}

.hot-item {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) 88px 76px 18px;
  gap: 10px;
  align-items: center;
  min-height: 67px;
  padding: 10px 15px;
  border: 0;
  border-bottom: 1px solid #eef0f4;
  background: transparent;
  color: var(--ink);
  text-align: left;
}

.hot-item:hover {
  background: #fafbfc;
}

.hot-item:last-of-type {
  border-bottom: 0;
}

.hot-rank {
  display: grid;
  place-items: center;
  width: 27px;
  height: 27px;
  border-radius: 8px;
  background: #f0f2f5;
  color: #717b89;
  font-size: 11px;
  font-weight: 850;
}

.hot-rank.top-1 {
  background: #fff0ee;
  color: #d9363e;
}

.hot-rank.top-2 {
  background: #fff6e9;
  color: #b7741d;
}

.hot-rank.top-3 {
  background: #fff9e8;
  color: #a68121;
}

.hot-copy strong,
.hot-copy small,
.hot-count b,
.hot-count small {
  display: block;
}

.hot-copy strong {
  font-size: 14px;
  font-weight: 800;
}

.hot-copy small {
  margin-top: 3px;
  color: var(--subtle);
  font: 10px "SFMono-Regular", Consolas, monospace;
}

.hot-change,
.square-change {
  font-size: 12px;
  font-weight: 800;
  text-align: right;
}

.up {
  color: #d9363e;
}

.down {
  color: #159957;
}

.flat {
  color: #7b8491;
}

.hot-count {
  text-align: right;
}

.hot-count b {
  color: #555f6e;
  font-size: 12px;
}

.hot-count small {
  margin-top: 2px;
  color: var(--subtle);
  font-size: 9px;
}

.hot-arrow {
  color: #aeb5bf;
  font-size: 20px;
}

.hot-unlock {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  min-height: 56px;
  padding: 10px 16px;
  border: 0;
  border-top: 1px solid #eef0f4;
  background: #fffaf2;
  color: #7f5a20;
  font-size: 11px;
  text-align: left;
}

.hot-unlock b {
  font-size: 11px;
}

.square-trend-card {
  padding: 16px;
  margin-bottom: 14px;
}

.square-trend-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}

.square-trend-head h2 {
  font-size: 18px;
}

.square-trend-values {
  display: flex;
  gap: 22px;
  margin-top: 12px;
}

.square-trend-values small,
.square-trend-values b {
  display: block;
}

.square-trend-values small {
  color: var(--subtle);
  font-size: 9px;
}

.square-trend-values b {
  margin-top: 2px;
  color: var(--red);
  font-size: 20px;
}

.square-trend-values span:last-child b {
  color: var(--gold);
}

.square-trend-chart {
  height: 138px;
  margin-top: 7px;
}

.square-section-head {
  padding: 0 2px;
  margin-bottom: 10px;
}

.square-section-head h2 {
  font-size: 18px;
}

.square-section-head .ghost-btn {
  height: 32px;
  font-size: 10px;
}

.square-tabs {
  display: flex;
  gap: 4px;
  width: 100%;
  padding: 4px;
  margin-bottom: 10px;
  border-radius: 11px;
  background: #e9ebef;
}

.square-tab {
  flex: 1;
  height: 34px;
  padding: 0 9px;
  border-radius: 8px;
  color: #7e8795;
  font-size: 11px;
  font-weight: 750;
}

.square-tab.active {
  background: #fff;
  color: var(--ink);
  box-shadow: 0 3px 9px rgba(25, 35, 55, 0.06);
}

.square-list {
  gap: 0;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.95);
  border-radius: 14px;
  background: #fff;
  box-shadow: var(--shadow-soft);
}

.square-head,
.square-item {
  display: grid;
  grid-template-columns: minmax(160px, 1.5fr) 86px 82px 98px 62px;
  gap: 10px;
  align-items: center;
}

.square-head {
  min-height: 36px;
  padding: 0 14px;
  background: #f7f8fa;
  color: #9ca4af;
  font-size: 9px;
  font-weight: 700;
}

.square-item {
  min-height: 70px;
  padding: 10px 14px;
  border: 0;
  border-top: 1px solid #eef0f4;
  border-radius: 0;
  background: #fff;
  box-shadow: none;
  text-align: left;
}

.square-item:hover {
  transform: none;
  background: #fafbfc;
}

.square-name strong,
.square-name small,
.square-space b,
.square-space small {
  display: block;
}

.square-name strong {
  font-size: 13px;
  font-weight: 800;
}

.square-name small {
  margin-top: 3px;
  color: var(--subtle);
  font-size: 9px;
}

.square-type {
  color: #596373;
  font-size: 10px;
  font-weight: 700;
}

.square-space b {
  color: var(--red);
  font-size: 12px;
}

.square-space small {
  margin-top: 2px;
  color: var(--subtle);
  font-size: 9px;
}

.square-status {
  justify-self: start;
  padding: 4px 7px;
  border-radius: 6px;
  background: #fff2f1;
  color: #c52935;
  font-size: 9px;
  font-weight: 800;
}

.square-item.watch .square-status {
  background: #f1f3f6;
  color: #7f8793;
}

.monitor-card {
  margin-top: 14px;
  padding: 15px;
}

.monitor-list {
  margin-top: 10px;
  overflow-x: auto;
}

.monitor-head,
.monitor-row {
  display: grid;
  grid-template-columns: minmax(170px, 1.4fr) 88px 108px 88px 52px;
  gap: 8px;
  align-items: center;
  min-width: 620px;
}

.monitor-head {
  min-height: 30px;
  padding: 0 9px;
  color: #a0a7b1;
  font-size: 9px;
}

.monitor-row {
  width: 100%;
  min-height: 58px;
  padding: 9px;
  border: 0;
  border-top: 1px solid #eef0f4;
  background: transparent;
  color: #5d6674;
  font-size: 10px;
  text-align: left;
}

.monitor-row:hover {
  background: #fafbfc;
}

.monitor-row strong,
.monitor-row small {
  display: block;
}

.monitor-row strong {
  color: var(--ink);
  font-size: 12px;
}

.monitor-row small {
  margin-top: 2px;
  color: var(--subtle);
  font-size: 9px;
}

.monitor-row .today {
  color: var(--red);
  font-weight: 800;
}

.list-empty {
  display: grid;
  place-items: center;
  min-height: 120px;
  color: var(--subtle);
  font-size: 12px;
  font-weight: 650;
}

.footer-actions {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin: 28px 0 0;
  color: #9da5b0;
  font-size: 10px;
}

.footer-actions button {
  padding: 0;
  background: transparent;
  color: #8f98a5;
  font-size: 10px;
}

.detail {
  grid-template-columns: minmax(0, 1.08fr) minmax(340px, 0.92fr);
  gap: 14px;
}

.detail-side {
  min-width: 0;
}

.detail-main-column {
  min-width: 0;
}

@media (min-width: 1101px) {
  .detail-side {
    position: sticky;
    top: 18px;
  }
}

.detail-toolbar {
  padding: 9px 11px;
  border-color: rgba(255, 255, 255, 0.95);
  border-radius: 12px;
  background: #fff;
}

.quote-card {
  padding: 20px;
  color: var(--ink);
  background: #fff;
}

.quote-card::after {
  display: none;
}

.quote-card.tone-safe,
.quote-card.tone-warning,
.quote-card.tone-monitor,
.quote-card.tone-danger {
  background: #fff;
}

.quote-name {
  font-size: 28px;
}

.quote-code {
  margin-top: 5px;
  color: var(--subtle);
  font-size: 11px;
}

.quote-price {
  margin-top: 20px;
  color: var(--red);
  font-size: 43px;
}

.quote-change {
  margin-left: 10px;
  padding: 5px 8px;
  border: 0;
  border-radius: 7px;
  background: #f1f3f6;
  color: #606a78;
  font-size: 12px;
  vertical-align: 6px;
}

.quote-grid {
  gap: 8px;
  margin-top: 18px;
}

.quote-stat {
  padding: 10px;
  border-color: #e8ebf0;
  border-radius: 9px;
  background: #f8f9fb;
}

.quote-stat small {
  color: var(--subtle);
  font-size: 9px;
}

.quote-stat strong {
  margin-top: 4px;
  color: var(--ink);
  font-size: 12px;
}

.today-card,
.projection-card,
.review-card {
  padding: 15px;
  margin-bottom: 13px;
}

.today-card.tone-safe,
.today-card.tone-warning,
.today-card.tone-monitor,
.today-card.tone-danger {
  background: #fff;
}

.rule-tabs {
  gap: 4px;
  margin: 12px 0;
  padding: 4px;
  border-radius: 10px;
  background: #e9ebef;
}

.rule-tab {
  min-height: 54px;
  padding: 7px 8px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  box-shadow: none;
}

.rule-tab span {
  color: #555f6d;
  font-size: 12px;
}

.rule-tab small {
  font-size: 9px;
}

.rule-tab.active,
.rule-tab.active.tone-safe,
.rule-tab.active.tone-warning,
.rule-tab.active.tone-monitor {
  background: #fff;
  color: var(--ink);
  box-shadow: 0 3px 9px rgba(25, 35, 55, 0.06);
}

.rule-tab.active span,
.rule-tab.active.tone-safe span,
.rule-tab.active.tone-warning span,
.rule-tab.active.tone-monitor span {
  color: var(--ink);
}

.rule-panel {
  padding: 13px;
  border-color: #e8ebf0;
  border-radius: 10px;
  background: #fafbfc;
}

.rule-space {
  font-size: 25px;
}

.rule-grid {
  gap: 7px;
  margin-top: 11px;
}

.mini-stat {
  padding: 9px;
  border-color: #e8ebf0;
  border-radius: 9px;
  background: #fff;
}

.mini-stat strong {
  font-size: 14px;
}

.chart-wrap {
  height: 220px;
  margin-top: 11px;
  border-color: #e8ebf0;
  border-radius: 10px;
  background: #fafbfc;
}

.projection-table {
  gap: 8px;
  margin-top: 11px;
}

.projection-day {
  border-color: #e9ecf1;
  border-radius: 10px;
  box-shadow: none;
}

.projection-day-head {
  padding: 10px 11px;
  background: #f8f9fb;
}

.projection-day-head strong {
  font-size: 13px;
}

.projection-day-head b {
  font-size: 14px;
}

.projection-rule-table {
  padding: 8px;
}

.projection-rule-row {
  min-height: 38px;
  border-radius: 8px;
}

.projection-toggle {
  width: 100%;
  height: 34px;
  border: 0;
  border-top: 1px solid #eef0f4;
  background: transparent;
  color: #9aa2ae;
  font-size: 10px;
  font-weight: 650;
}

.review-card {
  background: #fff;
}

.review-head h2 {
  font-size: 15px;
  font-weight: 650;
  color: #7c8592;
}

.review-kline-wrap {
  border-color: #e9ecf1;
  border-radius: 10px;
  background: #fafbfc;
}

.review-stats span {
  border-color: #e9ecf1;
  border-radius: 9px;
  background: #fafbfc;
}

.tabbar {
  grid-template-columns: repeat(3, minmax(0, 112px));
  width: min(360px, calc(100% - 28px));
  border-radius: 15px;
}

.tab {
  gap: 4px;
}

.tab svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.tab.active {
  background: #fff;
  color: var(--red);
  box-shadow: 0 5px 13px rgba(25, 35, 55, 0.07);
}

.modal-card {
  width: min(460px, 100%);
  padding: 24px;
  border-radius: 16px;
}

.modal-note {
  margin: 8px 0 14px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.65;
}

.modal-loading {
  padding: 32px 12px;
  color: var(--muted);
  font-size: 13px;
  text-align: center;
}

.login-qr,
.contact-qr {
  display: block;
  width: min(260px, 80%);
  margin: 12px auto 8px;
  border: 1px solid #edf0f4;
  border-radius: 12px;
  background: #fff;
}

.contact-qr {
  width: min(230px, 72%);
}

.login-status {
  padding: 8px 10px;
  border-radius: 8px;
  background: #f6f7f9;
  color: #77808e;
  font-size: 11px;
  text-align: center;
}

.modal-full-button {
  width: 100%;
  margin-top: 13px;
}

.member-plan-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 9px;
}

.member-plan {
  padding: 13px;
  border: 1px solid #e8ebf0;
  border-radius: 11px;
  background: #fafbfc;
}

.member-plan > span {
  color: #646f7e;
  font-size: 11px;
  font-weight: 750;
}

.member-plan strong {
  display: block;
  margin-top: 8px;
  color: var(--ink);
  font-size: 24px;
}

.member-plan strong small {
  color: var(--subtle);
  font-size: 10px;
}

.member-plan p {
  margin: 7px 0 0;
  color: var(--subtle);
  font-size: 10px;
  line-height: 1.5;
}

.member-plan.lifetime {
  border-color: rgba(183, 124, 36, 0.2);
  background: #fffaf2;
}

.member-plan.lifetime strong {
  color: #95661c;
}

.member-benefit-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 12px;
}

.member-benefit-list span {
  padding: 5px 7px;
  border-radius: 6px;
  background: #f3f5f8;
  color: #6f7885;
  font-size: 9px;
}

.member-mini-entry {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 13px;
  padding: 10px;
  border: 1px solid #eceff3;
  border-radius: 10px;
  background: #fafbfc;
}

.member-mini-entry img {
  width: 66px;
  height: 66px;
  object-fit: contain;
}

.member-mini-entry span {
  color: #77808d;
  font-size: 10px;
  line-height: 1.65;
}

@media (max-width: 820px) {
  .app {
    padding: 14px 12px 90px;
  }

  .app-header {
    margin-bottom: 13px;
  }

  .brand {
    font-size: 24px;
  }

  .header-actions {
    gap: 6px;
  }

  .account-button {
    width: 36px;
    padding: 0;
    justify-content: center;
  }

  .account-button > span:last-child {
    display: none;
  }

  .member-entry {
    height: 34px;
    padding: 0 9px;
    font-size: 10px;
  }

  .notice-action {
    display: none;
  }

  .calc-layout,
  .detail {
    display: block;
  }

  .control-column {
    gap: 12px;
  }

  .dashboard-empty,
  .detail {
    margin-top: 12px;
  }

  .dashboard-empty {
    min-height: 330px;
    padding: 22px;
  }

  .dashboard-empty h2 {
    font-size: 22px;
  }

  .empty-metrics {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .empty-metrics span {
    padding: 10px;
  }

  .empty-metrics b {
    font-size: 15px;
  }

  .hot-heading h2 {
    font-size: 22px;
  }

  .hot-item {
    grid-template-columns: 34px minmax(0, 1fr) 62px 46px;
    gap: 7px;
    padding: 9px 11px;
  }

  .hot-arrow {
    display: none;
  }

  .hot-change {
    font-size: 11px;
  }

  .hot-count small {
    display: none;
  }

  .hot-unlock {
    align-items: flex-start;
    flex-direction: column;
    gap: 3px;
  }

  .square-trend-chart {
    height: 124px;
  }

  .square-head {
    display: none;
  }

  .square-list {
    display: grid;
    gap: 8px;
    overflow: visible;
    border: 0;
    background: transparent;
    box-shadow: none;
  }

  .square-item {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 64px 56px;
    gap: 8px;
    min-height: 76px;
    padding: 12px;
    border: 1px solid #fff;
    border-radius: 12px;
    background: #fff;
    box-shadow: var(--shadow-soft);
  }

  .square-item .square-type,
  .square-item .square-status {
    display: none;
  }

  .square-space {
    text-align: right;
  }

  .monitor-card {
    padding: 13px;
  }

  .footer-actions {
    margin-top: 20px;
  }

  .detail-toolbar {
    margin-bottom: 10px;
  }

  .quote-card,
  .today-card,
  .projection-card,
  .review-card,
  .favorite-card,
  .search-card,
  .activity-card {
    border-radius: 12px;
  }

  .quote-card {
    padding: 17px;
  }

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

  .quote-price {
    font-size: 38px;
  }

  .quote-change {
    margin: 8px 0 0;
    vertical-align: 0;
  }

  .rule-tabs {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .projection-rule-header,
  .projection-rule-row {
    grid-template-columns: 58px 1fr 1fr;
  }

  .tabbar {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    width: 100%;
    bottom: 0;
    border-radius: 0;
    padding: 6px 8px calc(6px + env(safe-area-inset-bottom));
  }

  .tab {
    height: 48px;
  }

  .member-plan-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 520px) {
  .empty-metrics,
  .quote-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .empty-metrics span:last-child {
    grid-column: 1 / -1;
  }

  .square-tabs {
    display: flex;
  }

  .square-tab {
    padding: 0 5px;
    font-size: 10px;
  }

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