/* ============================================================
   FX战士久留美 · 模拟器
   暗色交易终端 × 动画感的粉紫配色
   ============================================================ */

:root {
  --bg: #07070e;
  --bg-2: #0b0b16;
  --panel: #101020;
  --panel-2: #151529;
  --line: rgba(255, 255, 255, 0.07);
  --line-strong: rgba(255, 255, 255, 0.14);

  --pink: #ff4f9a;
  --pink-soft: #ff86b8;
  --violet: #8a6bff;
  --cyan: #4fd6ff;
  --gold: #ffcc66;

  /* 涨跌配色：红涨绿跌（国内 / 日本 K 线习惯） */
  --up: #ff5f7e;
  --down: #2ed3a0;
  --danger: #ff5b7f;
  --safe: #3ee0a0;
  --text: #ece9f8;
  --muted: #918caa;
  --dim: #635f7d;

  --radius: 16px;
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.45);
  --font: "Yu Gothic UI", "Yu Gothic", "Microsoft YaHei", "PingFang SC",
    "Hiragino Sans GB", sans-serif;
  --mono: "SF Mono", "Cascadia Mono", Consolas, "Roboto Mono", monospace;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
}

body {
  min-height: 100vh;
  font-family: var(--font);
  color: var(--text);
  background:
    radial-gradient(1100px 600px at 12% -10%, rgba(255, 79, 154, 0.16), transparent 60%),
    radial-gradient(900px 500px at 92% 0%, rgba(138, 107, 255, 0.16), transparent 55%),
    radial-gradient(1000px 700px at 60% 110%, rgba(79, 214, 255, 0.07), transparent 60%),
    var(--bg);
  overflow: hidden;
}

body::before {
  /* 极细网格，终端质感 */
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.022) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.022) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: radial-gradient(circle at 50% 40%, #000 30%, transparent 85%);
  z-index: 0;
}

#app {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  height: 100vh;
  padding: 14px 16px 8px;
  gap: 12px;
}

/* ==================== 顶栏 ==================== */

.topbar {
  display: flex;
  align-items: center;
  gap: 28px;
  padding: 10px 18px;
  border-radius: var(--radius);
  background: linear-gradient(120deg, rgba(20, 20, 38, 0.92), rgba(12, 12, 24, 0.86));
  border: 1px solid var(--line);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.35);
  backdrop-filter: blur(10px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

.brand-mark {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 13px;
  font-weight: 900;
  font-size: 19px;
  letter-spacing: -0.5px;
  color: #fff;
  background: linear-gradient(140deg, var(--pink), var(--violet));
  box-shadow: 0 8px 22px rgba(255, 79, 154, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.4);
  transform: rotate(-4deg);
}

.brand-text h1 {
  margin: 0;
  font-size: 17px;
  font-weight: 800;
  letter-spacing: 0.5px;
}

.brand-text p {
  margin: 2px 0 0;
  font-size: 9.5px;
  letter-spacing: 2.4px;
  color: var(--dim);
  text-transform: uppercase;
}

.brand-text p span {
  color: var(--pink-soft);
  opacity: 0.8;
}

.stats {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 6px;
  flex: 1;
  min-width: 0;
}

.stat {
  padding: 6px 12px;
  border-radius: 11px;
  border-left: 2px solid rgba(255, 255, 255, 0.08);
  min-width: 0;
}

.stat:first-child {
  border-left-color: var(--pink);
}

.stat:nth-child(2) {
  border-left-color: var(--cyan);
}

.stat:nth-child(3) {
  border-left-color: var(--violet);
}

.stat:nth-child(4) {
  border-left-color: var(--gold);
}

.stat-label {
  display: block;
  font-size: 10px;
  letter-spacing: 0.8px;
  color: var(--muted);
  white-space: nowrap;
}

.stat-value {
  display: block;
  margin-top: 2px;
  font-family: var(--mono);
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.3px;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.stat-sub {
  display: block;
  font-size: 9.5px;
  color: var(--dim);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.stat-target {
  border-left-color: rgba(255, 255, 255, 0.08);
}

.stat.danger {
  border-left-color: var(--danger);
  animation: ratioPulse 1.5s ease-in-out infinite;
}

@keyframes ratioPulse {
  0%,
  100% {
    background: transparent;
  }
  50% {
    background: rgba(255, 91, 127, 0.14);
  }
}

.target-bar {
  margin-top: 6px;
  height: 4px;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
}

.target-bar i {
  display: block;
  height: 100%;
  width: 1.5%;
  border-radius: 99px;
  background: linear-gradient(90deg, var(--pink), var(--gold));
  box-shadow: 0 0 10px rgba(255, 79, 154, 0.7);
  transition: width 0.5s ease;
}

/* ==================== 布局 ==================== */

.workspace {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 356px;
  gap: 12px;
}

.panel {
  background: linear-gradient(165deg, rgba(19, 19, 35, 0.96), rgba(11, 11, 22, 0.96));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  position: relative;
}

.chart-panel {
  display: flex;
  flex-direction: column;
  min-height: 0;
  padding: 12px 14px 10px;
  overflow: hidden;
}

/* ==================== 图表头部 ==================== */

.chart-head {
  display: flex;
  align-items: center;
  gap: 18px;
  flex-shrink: 0;
}

.pair-tabs {
  display: flex;
  gap: 6px;
  background: rgba(255, 255, 255, 0.035);
  padding: 4px;
  border-radius: 12px;
}

.pair-tab {
  display: flex;
  align-items: baseline;
  gap: 6px;
  padding: 6px 12px;
  border: none;
  border-radius: 9px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-family: var(--font);
  transition: 0.18s ease;
}

.pair-tab:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.05);
}

.pair-tab.active {
  background: linear-gradient(135deg, rgba(255, 79, 154, 0.22), rgba(138, 107, 255, 0.22));
  color: #fff;
  box-shadow: inset 0 0 0 1px rgba(255, 79, 154, 0.35);
}

.pt-code {
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.4px;
}

.pt-name {
  font-size: 10px;
  opacity: 0.7;
}

.quote-box {
  display: flex;
  align-items: baseline;
  gap: 10px;
}

.quote-price {
  font-family: var(--mono);
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.8px;
  font-variant-numeric: tabular-nums;
  text-shadow: 0 0 24px rgba(79, 214, 255, 0.25);
}

.quote-change {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--up);
}

.quote-change.down {
  color: var(--down);
}

.chart-tools {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 10px;
}

.speed-group {
  display: flex;
  gap: 2px;
  padding: 3px;
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.04);
}

.speed-group button {
  border: none;
  background: transparent;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 10.5px;
  padding: 4px 8px;
  border-radius: 6px;
  cursor: pointer;
  transition: 0.15s;
}

.speed-group button:hover {
  color: #fff;
}

.speed-group button.active {
  background: rgba(255, 79, 154, 0.24);
  color: #fff;
}

.clock {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--dim);
  min-width: 42px;
  text-align: right;
}

.clock.paused {
  color: var(--pink);
}

.btn-sound {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  padding: 0;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.04);
  color: var(--muted);
  cursor: pointer;
  transition: 0.15s;
}

.btn-sound svg {
  width: 15px;
  height: 15px;
}

.btn-sound:hover {
  color: #fff;
  border-color: var(--pink);
}

.btn-sound .slash {
  display: none;
}

.btn-sound.muted {
  color: var(--dim);
}

.btn-sound.muted .slash {
  display: block;
}

.btn-sound.muted .wave {
  display: none;
}

.chart-wrap {
  position: relative;
  flex: 1;
  min-height: 0;
  margin: 8px 0 4px;
}

#chart {
  width: 100%;
  height: 100%;
  display: block;
  border-radius: 10px;
  cursor: crosshair;
}

.chart-hint {
  position: absolute;
  right: 10px;
  bottom: 8px;
  font-size: 9.5px;
  color: var(--dim);
  opacity: 0.75;
  pointer-events: none;
  transition: opacity 0.4s;
}

/* ==================== 持仓 ==================== */

.positions-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 2px 6px;
  border-top: 1px solid var(--line);
  flex-shrink: 0;
}

.positions-head h2 {
  margin: 0;
  font-size: 11px;
  letter-spacing: 2px;
  color: var(--muted);
  font-weight: 600;
}

.positions-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 10px;
}

.pos-count {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--dim);
}

.btn-ghost {
  border: 1px solid var(--line-strong);
  background: transparent;
  color: var(--muted);
  font-size: 10.5px;
  padding: 4px 10px;
  border-radius: 7px;
  cursor: pointer;
  font-family: var(--font);
  transition: 0.15s;
}

.btn-ghost:hover {
  color: #fff;
  border-color: var(--pink);
  background: rgba(255, 79, 154, 0.12);
}

.positions-scroll {
  height: 156px;
  overflow: auto;
  flex-shrink: 0;
}

.positions-table {
  width: 100%;
  min-width: 640px;
  border-collapse: collapse;
  font-family: var(--mono);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}

.positions-table thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  text-align: left;
  font-family: var(--font);
  font-weight: 500;
  font-size: 9.5px;
  letter-spacing: 1px;
  color: var(--dim);
  padding: 6px 8px;
  background: #10101e;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}

.positions-table tbody td {
  padding: 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.035);
  white-space: nowrap;
}

.positions-table tbody tr:hover {
  background: rgba(255, 255, 255, 0.025);
}

.empty-row td {
  text-align: center;
  color: var(--dim);
  font-family: var(--font);
  font-size: 11px;
  padding: 30px 8px;
  white-space: normal;
}

.side-long {
  color: var(--up);
}

.side-short {
  color: var(--down);
}

.pl-up {
  color: var(--up);
}

.pl-down {
  color: var(--down);
}

.pips {
  display: block;
  margin-top: 1px;
  font-size: 9px;
  opacity: 0.72;
  font-weight: 500;
}

.stop-line {
  display: block;
  font-size: 9.5px;
  line-height: 1.5;
  opacity: 0.9;
}

.stop-line.sl {
  color: var(--danger);
}

.stop-line.tp {
  color: var(--safe);
}

.mini-btn {
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: transparent;
  color: var(--muted);
  font-size: 10px;
  padding: 3px 9px;
  border-radius: 6px;
  cursor: pointer;
  font-family: var(--font);
  transition: 0.15s;
}

.mini-btn:hover {
  color: #fff;
  border-color: var(--pink);
  background: rgba(255, 79, 154, 0.16);
}

.liquidating {
  animation: rowFade 0.5s ease forwards;
}

@keyframes rowFade {
  to {
    opacity: 0;
    transform: translateX(14px);
  }
}

/* ==================== 右侧栏 ==================== */

.side {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 0;
}

/* --- 角色卡 · 头像 --- */

.speaker-card {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 14px;
  flex-shrink: 0;
  overflow: hidden;
  background:
    radial-gradient(130px 130px at 10% 42%, rgba(255, 79, 154, 0.22), transparent 72%),
    linear-gradient(165deg, rgba(26, 18, 40, 0.98), rgba(14, 12, 26, 0.98));
  border: 1px solid rgba(255, 79, 154, 0.2);
  transition: border-color 0.4s ease, box-shadow 0.4s ease;
}

.speaker-card::after {
  content: "FX";
  position: absolute;
  right: -6px;
  bottom: -18px;
  z-index: 0;
  font-size: 76px;
  font-weight: 900;
  color: rgba(255, 255, 255, 0.03);
  letter-spacing: -4px;
  pointer-events: none;
}

/* --- 头像本体 --- */

.speaker-avatar {
  position: relative;
  z-index: 2;
  width: 86px;
  height: 86px;
  flex-shrink: 0;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: 21px;
  overflow: hidden;
  background: radial-gradient(circle at 50% 78%, rgba(255, 79, 154, 0.34), rgba(90, 40, 120, 0.12) 70%);
  cursor: pointer;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.42), 0 0 0 1px rgba(255, 79, 154, 0.1);
  transition: box-shadow 0.4s ease, border-color 0.4s ease, transform 0.12s ease-out;
}

.speaker-avatar:focus-visible {
  outline: 1px solid var(--pink);
  outline-offset: 2px;
}

.speaker-avatar img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 20%;
  transform: scale(1.16);
  transition: opacity 0.22s ease, filter 0.4s ease;
  animation: avatarSwap 0.34s ease;
  user-select: none;
}

.speaker-avatar.bounce {
  animation: portraitBounce 0.55s ease;
}

/* 开心：粉色 + 金色暖光 */
.speaker-card[data-mood="happy"] .speaker-avatar {
  border-color: rgba(255, 204, 102, 0.42);
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.42), 0 0 22px rgba(255, 79, 154, 0.34),
    0 0 40px rgba(255, 204, 102, 0.14);
}

/* 平静：紫蓝冷光 */
.speaker-card[data-mood="calm"] .speaker-avatar {
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.42), 0 0 20px rgba(138, 107, 255, 0.3);
}

/* 恐慌：红边 + 呼吸红光 + 轻微抖动 */
.speaker-card[data-mood="panic"] {
  border-color: rgba(255, 91, 127, 0.5);
  box-shadow: 0 0 0 1px rgba(255, 91, 127, 0.16), 0 0 30px rgba(255, 91, 127, 0.18);
}

.speaker-card[data-mood="panic"] .speaker-avatar {
  border-color: rgba(255, 91, 127, 0.62);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.42), 0 0 24px rgba(255, 91, 127, 0.45);
  animation: haloPulse 1.4s ease-in-out infinite;
}

.speaker-card[data-mood="panic"] .speaker-avatar img {
  filter: saturate(1.12) contrast(1.05);
  animation: avatarPanic 2.6s ease-in-out infinite;
}

.speaker-card[data-mood="calm"] .speaker-avatar img {
  filter: saturate(0.92) brightness(0.96);
}

/* 开心时的碎光 */
.speaker-avatar::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0;
  background:
    radial-gradient(circle at 20% 22%, rgba(255, 240, 190, 0.95) 0 1.6px, transparent 2.4px),
    radial-gradient(circle at 84% 34%, rgba(255, 200, 140, 0.85) 0 1.2px, transparent 2px),
    radial-gradient(circle at 66% 58%, rgba(255, 235, 180, 0.8) 0 1px, transparent 1.8px);
  transition: opacity 0.5s ease;
}

.speaker-card[data-mood="happy"] .speaker-avatar::after {
  opacity: 1;
  animation: sparkle 2.8s ease-in-out infinite;
}

@keyframes avatarSwap {
  0% {
    opacity: 0.25;
    transform: scale(1.45) rotate(-3deg);
  }
  100% {
    opacity: 1;
    transform: scale(1.16) rotate(0);
  }
}

@keyframes avatarPanic {
  0%,
  100% {
    transform: scale(1.16) translate(0, 0) rotate(0);
  }
  25% {
    transform: scale(1.17) translate(-1.5px, -1.5px) rotate(-0.5deg);
  }
  50% {
    transform: scale(1.16) translate(1.5px, 0) rotate(0.5deg);
  }
  75% {
    transform: scale(1.16) translate(-1px, -1px) rotate(-0.2deg);
  }
}

@keyframes portraitBounce {
  0% {
    transform: translateY(0) scale(1);
  }
  30% {
    transform: translateY(-8px) scale(1.02);
  }
  60% {
    transform: translateY(2px) scale(0.994);
  }
  100% {
    transform: translateY(0) scale(1);
  }
}

@keyframes haloPulse {
  0%,
  100% {
    opacity: 0.72;
  }
  50% {
    opacity: 1;
  }
}

@keyframes sparkle {
  0%,
  100% {
    opacity: 0.35;
  }
  50% {
    opacity: 1;
  }
}

/* --- 立绘互动特效 --- */

.portrait-fx {
  position: absolute;
  inset: 0;
  z-index: 4;
  overflow: hidden;
  pointer-events: none;
}

.fx-ring {
  position: absolute;
  width: 20px;
  height: 20px;
  margin: -10px 0 0 -10px;
  border-radius: 50%;
  border: 1.5px solid var(--pink);
  box-shadow: 0 0 12px rgba(255, 79, 154, 0.45);
  animation: fxRing 0.6s ease-out forwards;
}

.fx-ring.gold {
  border-color: var(--gold);
  box-shadow: 0 0 12px rgba(255, 204, 102, 0.5);
}

.fx-ring.red {
  border-color: var(--danger);
  box-shadow: 0 0 12px rgba(255, 91, 127, 0.5);
}

@keyframes fxRing {
  from {
    transform: scale(0.35);
    opacity: 0.95;
  }
  to {
    transform: scale(4.4);
    opacity: 0;
  }
}

.fx-bit {
  position: absolute;
  font-weight: 700;
  line-height: 1;
  text-shadow: 0 0 10px currentColor;
  animation: fxBit 0.95s cubic-bezier(0.15, 0.8, 0.3, 1) forwards;
}

@keyframes fxBit {
  0% {
    transform: translate(0, 0) scale(0.4) rotate(0);
    opacity: 0;
  }
  18% {
    opacity: 1;
  }
  100% {
    transform: translate(var(--dx), var(--dy)) scale(1.1) rotate(var(--rot));
    opacity: 0;
  }
}

.speaker-card.dizzy {
  animation: cardShake 0.55s ease-in-out;
}

.speaker-card.dizzy .speaker-avatar {
  animation: dizzyWobble 0.85s ease-in-out;
}

@keyframes cardShake {
  0%,
  100% {
    transform: translate(0, 0);
  }
  20% {
    transform: translate(-4px, 2px);
  }
  40% {
    transform: translate(4px, -2px);
  }
  60% {
    transform: translate(-3px, -1px);
  }
  80% {
    transform: translate(2px, 1px);
  }
}

@keyframes dizzyWobble {
  0% {
    transform: rotate(0);
  }
  15% {
    transform: rotate(-4deg);
  }
  35% {
    transform: rotate(3.5deg);
  }
  55% {
    transform: rotate(-2.5deg);
  }
  75% {
    transform: rotate(1.5deg);
  }
  100% {
    transform: rotate(0);
  }
}

.speaker-main {
  position: relative;
  z-index: 2;
  display: flex;
  flex: 1;
  flex-direction: column;
  min-width: 0;
}

.speaker-top {
  display: flex;
  align-items: baseline;
  gap: 8px;
  flex-wrap: wrap;
}

.speaker-name {
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.5px;
  color: #fff;
}

.speaker-tag {
  font-size: 9px;
  letter-spacing: 1px;
  color: var(--pink-soft);
  background: rgba(255, 79, 154, 0.12);
  border: 1px solid rgba(255, 79, 154, 0.25);
  padding: 2px 6px;
  border-radius: 5px;
  white-space: nowrap;
}

.speaker-line {
  margin: 6px 0 7px;
  font-size: 12px;
  line-height: 1.5;
  color: #ded9f0;
  min-height: 36px;
}

.speaker-line.flash {
  animation: lineIn 0.4s ease;
}

@keyframes lineIn {
  from {
    opacity: 0;
    transform: translateY(5px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.mood {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 0;
  font-size: 9.5px;
  color: var(--dim);
}

.portrait-tip {
  margin-top: 7px;
  font-size: 9px;
  letter-spacing: 0.3px;
  color: var(--dim);
}

.mood-bar {
  flex: 1;
  height: 4px;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
}

.mood-bar i {
  display: block;
  height: 100%;
  width: 60%;
  border-radius: 99px;
  background: linear-gradient(90deg, var(--violet), var(--pink), var(--gold));
  transition: width 0.6s ease, background 0.4s;
}

.mood b {
  font-family: var(--mono);
  color: var(--muted);
  font-size: 9.5px;
  min-width: 16px;
}

/* --- 下单面板 --- */

.ticket {
  padding: 14px;
  flex-shrink: 0;
}

.ticket-head {
  display: flex;
  align-items: center;
  margin-bottom: 10px;
}

.ticket-head h2 {
  margin: 0;
  font-size: 11px;
  letter-spacing: 2px;
  color: var(--muted);
  font-weight: 600;
}

.ticket-leverage {
  margin-left: auto;
  font-size: 10px;
  color: var(--dim);
}

.ticket-leverage b {
  font-family: var(--mono);
  color: var(--gold);
  font-size: 11px;
}

.ticket-quote {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  margin-bottom: 12px;
}

.ticket-quote > div {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 6px;
  padding: 7px 10px;
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid var(--line);
}

.ticket-quote span {
  font-size: 9.5px;
  color: var(--dim);
}

.ticket-quote b {
  font-family: var(--mono);
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}

.field-row {
  margin-bottom: 11px;
}

.field-row.two {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.field {
  display: block;
}

.field > span {
  display: flex;
  justify-content: space-between;
  font-size: 10px;
  color: var(--muted);
  margin-bottom: 5px;
}

.field em {
  font-style: normal;
  font-size: 9px;
  color: var(--dim);
}

.field input[type="number"] {
  width: 100%;
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid var(--line-strong);
  background: rgba(0, 0, 0, 0.3);
  color: var(--text);
  font-family: var(--mono);
  font-size: 13px;
  outline: none;
  transition: 0.15s;
}

.field input[type="number"]:focus {
  border-color: var(--pink);
  box-shadow: 0 0 0 3px rgba(255, 79, 154, 0.12);
}

.field input[type="range"] {
  width: 100%;
  height: 4px;
  margin: 10px 0 4px;
  appearance: none;
  border-radius: 99px;
  background: linear-gradient(90deg, var(--violet), var(--pink));
  outline: none;
}

.field input[type="range"]::-webkit-slider-thumb {
  appearance: none;
  width: 15px;
  height: 15px;
  border-radius: 50%;
  background: #fff;
  border: 3px solid var(--pink);
  box-shadow: 0 0 10px rgba(255, 79, 154, 0.7);
  cursor: pointer;
}

.lev-ticks {
  display: flex;
  justify-content: space-between;
  font-family: var(--mono);
  font-size: 8.5px;
  color: var(--dim);
  padding-right: 2px;
}

.quick-lots {
  display: flex;
  gap: 4px;
  margin-top: 6px;
}

.quick-lots button {
  flex: 1;
  padding: 4px 0;
  font-family: var(--mono);
  font-size: 10px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid transparent;
  border-radius: 6px;
  cursor: pointer;
  transition: 0.15s;
}

.quick-lots button:hover {
  color: #fff;
}

.quick-lots button.active {
  color: #fff;
  background: rgba(138, 107, 255, 0.22);
  border-color: rgba(138, 107, 255, 0.5);
}

.margin-preview {
  font-size: 10px;
  color: var(--dim);
  padding: 7px 9px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px dashed rgba(255, 255, 255, 0.1);
  margin-bottom: 11px;
  line-height: 1.5;
}

.margin-preview b {
  font-family: var(--mono);
  color: var(--gold);
  font-weight: 600;
}

.margin-preview.warn {
  color: var(--danger);
  border-color: rgba(255, 91, 127, 0.4);
  background: rgba(255, 91, 127, 0.07);
}

.margin-preview.warn b {
  color: var(--danger);
}

.order-buttons {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.btn-buy,
.btn-sell {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 11px 8px;
  border: none;
  border-radius: 11px;
  cursor: pointer;
  font-family: var(--font);
  color: #04120d;
  transition: transform 0.12s ease, box-shadow 0.2s ease, filter 0.2s;
  overflow: hidden;
}

.btn-buy {
  background: linear-gradient(135deg, #ff7f9e, #e63a68);
  color: #1a0209;
  box-shadow: 0 8px 22px rgba(255, 91, 127, 0.25);
}

.btn-sell {
  background: linear-gradient(135deg, #4df0b0, #23b98a);
  color: #04120d;
  box-shadow: 0 8px 22px rgba(62, 224, 160, 0.25);
}

.btn-buy:hover,
.btn-sell:hover {
  transform: translateY(-1px);
  filter: brightness(1.08);
}

.btn-buy:active,
.btn-sell:active {
  transform: translateY(1px) scale(0.99);
}

.btn-buy span,
.btn-sell span {
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: 0.6px;
}

.btn-buy em,
.btn-sell em {
  font-family: var(--mono);
  font-style: normal;
  font-size: 10px;
  opacity: 0.72;
}

.ticket-hint {
  margin: 8px 0 0;
  font-size: 9.5px;
  color: var(--dim);
  text-align: center;
  letter-spacing: 0.3px;
}

/* --- 事件流 --- */

.feed {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding: 12px 10px 8px 14px;
}

.feed-head {
  display: flex;
  align-items: center;
  padding-right: 6px;
  margin-bottom: 6px;
  flex-shrink: 0;
}

.feed-head h2 {
  margin: 0;
  font-size: 11px;
  letter-spacing: 2px;
  color: var(--muted);
  font-weight: 600;
}

#feed-count {
  margin-left: auto;
  font-family: var(--mono);
  font-size: 9.5px;
  color: var(--dim);
}

.feed-list {
  flex: 1;
  overflow-y: auto;
  padding-right: 6px;
  display: flex;
  flex-direction: column;
  gap: 7px;
  scrollbar-width: thin;
}

.feed-item {
  font-size: 11px;
  line-height: 1.55;
  padding: 7px 9px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.028);
  border-left: 2px solid rgba(255, 255, 255, 0.12);
  animation: feedIn 0.3s ease;
  color: #c9c4dd;
}

.feed-item .feed-time {
  font-family: var(--mono);
  font-size: 8.5px;
  color: var(--dim);
  margin-right: 6px;
}

.feed-item.news {
  border-left-color: var(--cyan);
  background: rgba(79, 214, 255, 0.05);
}

.feed-item.say {
  border-left-color: var(--pink);
  background: rgba(255, 79, 154, 0.055);
}

.feed-item.say b {
  color: var(--pink-soft);
  font-weight: 600;
  margin-right: 4px;
}

.feed-item.good {
  border-left-color: var(--up);
  background: rgba(255, 95, 126, 0.06);
}

.feed-item.bad {
  border-left-color: var(--danger);
  background: rgba(255, 91, 127, 0.07);
  color: #ffc9d4;
}

.feed-item.system {
  border-left-color: var(--gold);
  background: rgba(255, 204, 102, 0.05);
  color: #f0dfb8;
}

@keyframes feedIn {
  from {
    opacity: 0;
    transform: translateX(8px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* ==================== 底部 ==================== */

.footer {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 0 6px;
  font-size: 9.5px;
  color: var(--dim);
  flex-shrink: 0;
}

.footer-warn {
  color: rgba(255, 79, 154, 0.55);
  letter-spacing: 1px;
}

/* ==================== 弹窗 ==================== */

.modal-layer {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(4, 4, 10, 0.78);
  backdrop-filter: blur(8px);
}

.modal-layer.show {
  display: flex;
  animation: modalFade 0.3s ease;
}

@keyframes modalFade {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.modal {
  position: relative;
  display: flex;
  width: min(900px, 100%);
  max-height: min(92vh, 690px);
  border-radius: 22px;
  overflow: hidden;
  background:
    radial-gradient(500px 300px at 20% 0%, rgba(255, 79, 154, 0.16), transparent 65%),
    linear-gradient(160deg, #16142a, #0b0b16);
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 40px 120px rgba(0, 0, 0, 0.7), 0 0 0 1px rgba(255, 79, 154, 0.12);
  animation: modalPop 0.42s cubic-bezier(0.2, 1.2, 0.3, 1);
}

@keyframes modalPop {
  from {
    opacity: 0;
    transform: translateY(18px) scale(0.97);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.modal-art {
  width: 350px;
  flex-shrink: 0;
  align-self: stretch;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  position: relative;
  background:
    radial-gradient(240px 240px at 50% 60%, rgba(255, 79, 154, 0.18), transparent 70%);
  overflow: hidden;
}

.modal-art::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
  background-size: 26px 26px;
  mask-image: linear-gradient(to top, #000, transparent 85%);
}

.modal-art img {
  position: absolute;
  bottom: 0;
  left: 50%;
  height: 100%;
  width: auto;
  max-width: none;
  object-fit: contain;
  object-position: 50% 100%;
  filter: drop-shadow(0 18px 40px rgba(0, 0, 0, 0.55));
  animation: artFloat 5s ease-in-out infinite;
}

@keyframes artFloat {
  0%,
  100% {
    transform: translateX(-50%) translateY(0);
  }
  50% {
    transform: translateX(-50%) translateY(-8px);
  }
}

.modal-content {
  position: relative;
  flex: 1;
  min-width: 0;
  padding: 30px 32px 26px;
  overflow-y: auto;
}

.modal-stripe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 3px;
  background: repeating-linear-gradient(
    -45deg,
    var(--pink) 0 10px,
    #0b0b16 10px 20px
  );
  opacity: 0.85;
}

.modal-kicker {
  margin: 0 0 10px;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 3px;
  color: var(--pink);
  text-transform: uppercase;
}

.modal-title {
  margin: 0 0 16px;
  font-size: 27px;
  font-weight: 800;
  letter-spacing: 1px;
  line-height: 1.25;
  background: linear-gradient(120deg, #fff, var(--pink-soft) 70%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.modal-body p {
  margin: 0 0 10px;
  font-size: 12.5px;
  line-height: 1.7;
  color: #b9b3cd;
}

.modal-body strong {
  color: var(--gold);
  font-weight: 600;
}

.rule-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin: 16px 0;
}

.rule-grid > div {
  padding: 9px 12px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
}

.rule-grid b {
  font-size: 10px;
  font-weight: 500;
  color: var(--muted);
}

.rule-grid span {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--text);
}

.modal-tip {
  font-size: 11px !important;
  color: var(--dim) !important;
  border-left: 2px solid rgba(255, 79, 154, 0.35);
  padding-left: 10px;
  margin-top: 14px !important;
}

.modal-record {
  margin-top: 10px !important;
  padding-top: 9px;
  border-top: 1px dashed rgba(255, 255, 255, 0.1);
  font-family: var(--mono);
  font-size: 10px !important;
  color: var(--dim) !important;
  letter-spacing: 0.4px;
}

.modal-actions {
  display: flex;
  gap: 10px;
  margin-top: 18px;
}

.btn-primary {
  padding: 11px 28px;
  border: none;
  border-radius: 10px;
  font-family: var(--font);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 1px;
  color: #fff;
  cursor: pointer;
  background: linear-gradient(135deg, var(--pink), var(--violet));
  box-shadow: 0 10px 30px rgba(255, 79, 154, 0.35);
  transition: 0.18s;
}

.btn-primary:hover {
  transform: translateY(-2px);
  filter: brightness(1.08);
}

.btn-secondary {
  padding: 11px 22px;
  border-radius: 10px;
  border: 1px solid var(--line-strong);
  background: transparent;
  color: var(--muted);
  font-family: var(--font);
  font-size: 12px;
  cursor: pointer;
  transition: 0.18s;
}

.btn-secondary:hover {
  color: #fff;
  border-color: var(--pink);
}

/* 结算统计 */

.grade-row {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 4px 0 12px;
  padding: 12px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--line);
}

.grade-letter {
  width: 74px;
  height: 74px;
  flex-shrink: 0;
  display: grid;
  place-items: center;
  border-radius: 16px;
  font-family: var(--mono);
  font-size: 32px;
  font-weight: 800;
  letter-spacing: -1px;
  border: 2px solid currentColor;
  transform: rotate(-3deg);
  background: rgba(0, 0, 0, 0.25);
}

.grade-letter.wide {
  font-size: 14px;
  letter-spacing: 0.5px;
  line-height: 1.25;
  padding: 0 5px;
  text-align: center;
  word-break: break-all;
}

.tone-legend {
  color: #ffd66b;
  box-shadow: 0 0 28px rgba(255, 214, 107, 0.32), inset 0 0 22px rgba(255, 214, 107, 0.12);
}

.tone-s {
  color: #ffcc66;
  box-shadow: 0 0 24px rgba(255, 204, 102, 0.24), inset 0 0 20px rgba(255, 204, 102, 0.1);
}

.tone-a {
  color: var(--pink);
  box-shadow: 0 0 22px rgba(255, 79, 154, 0.24);
}

.tone-b {
  color: var(--violet);
}

.tone-c {
  color: var(--cyan);
}

.tone-d {
  color: var(--muted);
}

.tone-e {
  color: #7c7590;
}

.tone-f {
  color: var(--danger);
  box-shadow: 0 0 22px rgba(255, 91, 127, 0.2);
}

.grade-meta b {
  display: block;
  font-size: 14px;
  letter-spacing: 0.5px;
}

.grade-meta span {
  display: block;
  margin-top: 4px;
  font-size: 11.5px;
  line-height: 1.5;
  color: var(--muted);
}

.grade-new {
  display: inline-block;
  margin-top: 7px;
  padding: 2px 6px;
  font-size: 8.5px;
  font-style: normal;
  letter-spacing: 2px;
  color: var(--pink);
  border: 1px solid rgba(255, 79, 154, 0.45);
  border-radius: 4px;
}

.record-line {
  margin: -2px 0 10px;
  font-family: var(--mono);
  font-size: 9.5px;
  color: var(--dim);
}

.result-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin: 14px 0;
}

.result-grid > div {
  padding: 12px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid var(--line);
}

.result-grid b {
  display: block;
  font-size: 9.5px;
  font-weight: 500;
  color: var(--muted);
  letter-spacing: 1px;
  margin-bottom: 3px;
}

.result-grid span {
  font-family: var(--mono);
  font-size: 17px;
  font-weight: 700;
}

.result-quote {
  margin: 4px 0 0;
  padding: 12px 14px;
  border-radius: 10px;
  background: rgba(255, 79, 154, 0.08);
  border: 1px solid rgba(255, 79, 154, 0.25);
  font-size: 12.5px;
  line-height: 1.65;
  color: #f0d3e4;
}

/* ==================== 极端结局：血赚 / 血亏 ==================== */

.outcome-badge {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin: 0 0 12px;
  padding: 10px 14px;
  border-radius: 12px;
  animation: badgeIn 0.5s cubic-bezier(0.2, 1.2, 0.3, 1);
}

.outcome-badge b {
  font-size: 22px;
  font-weight: 900;
  letter-spacing: 6px;
}

.outcome-badge span {
  font-family: var(--mono);
  font-size: 11.5px;
  opacity: 0.85;
}

.outcome-badge.gold {
  color: #ffd98a;
  background: linear-gradient(100deg, rgba(255, 204, 102, 0.2), rgba(255, 79, 154, 0.1));
  border: 1px solid rgba(255, 204, 102, 0.5);
  box-shadow: 0 0 30px rgba(255, 204, 102, 0.2);
}

.outcome-badge.red {
  color: #ffb7c4;
  background: linear-gradient(100deg, rgba(255, 91, 127, 0.22), rgba(90, 20, 40, 0.1));
  border: 1px solid rgba(255, 91, 127, 0.5);
  box-shadow: 0 0 26px rgba(255, 91, 127, 0.16);
}

@keyframes badgeIn {
  from {
    opacity: 0;
    transform: translateY(-8px) scale(0.96);
  }
}

/* --- 血赚 --- */

.modal-layer.tier-jackpot .modal {
  border-color: rgba(255, 204, 102, 0.5);
  box-shadow:
    0 40px 120px rgba(0, 0, 0, 0.7),
    0 0 60px rgba(255, 204, 102, 0.24),
    0 0 0 1px rgba(255, 204, 102, 0.25);
}

.modal-layer.tier-jackpot .modal::before {
  content: "";
  position: absolute;
  inset: -60%;
  pointer-events: none;
  background: repeating-conic-gradient(
    from 0deg,
    rgba(255, 204, 102, 0.16) 0deg 1.5deg,
    transparent 1.5deg 13deg
  );
  -webkit-mask-image: radial-gradient(circle at 50% 50%, transparent 26%, #000 64%);
  mask-image: radial-gradient(circle at 50% 50%, transparent 26%, #000 64%);
  animation: jackpotRays 22s linear infinite;
}

@keyframes jackpotRays {
  to {
    transform: rotate(360deg);
  }
}

.modal-layer.tier-jackpot .modal-stripe {
  background: repeating-linear-gradient(-45deg, #ffcc66 0 10px, #0b0b16 10px 20px);
}

.modal-layer.tier-jackpot .modal-kicker {
  color: #ffcc66;
}

.modal-layer.tier-jackpot .modal-title {
  background: linear-gradient(110deg, #fff, #ffcc66 45%, #ff4f9a 90%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 6px 26px rgba(255, 204, 102, 0.35));
}

.modal-layer.tier-jackpot .grade-row {
  background: linear-gradient(100deg, rgba(255, 204, 102, 0.09), rgba(255, 204, 102, 0.02));
  border-color: rgba(255, 204, 102, 0.35);
}

.modal-layer.tier-jackpot .grade-letter {
  animation: jackpotPulse 1.8s ease-in-out infinite;
}

@keyframes jackpotPulse {
  0%,
  100% {
    box-shadow: 0 0 28px rgba(255, 214, 107, 0.32), inset 0 0 22px rgba(255, 214, 107, 0.12);
  }
  50% {
    box-shadow: 0 0 54px rgba(255, 214, 107, 0.62), inset 0 0 30px rgba(255, 214, 107, 0.2);
  }
}

/* --- 血亏 --- */

.modal-layer.tier-wipeout .modal {
  border-color: rgba(255, 91, 127, 0.55);
  box-shadow:
    0 40px 120px rgba(0, 0, 0, 0.78),
    0 0 70px rgba(255, 91, 127, 0.26),
    0 0 0 1px rgba(255, 91, 127, 0.3);
  animation: modalShake 0.55s cubic-bezier(0.36, 0.07, 0.19, 0.97);
}

.modal-layer.tier-wipeout .modal::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 3;
  pointer-events: none;
  background: radial-gradient(130% 130% at 50% 50%, transparent 42%, rgba(255, 26, 62, 0.24) 100%);
}

@keyframes modalShake {
  0% {
    transform: translate(0, 0) rotate(0);
  }
  20% {
    transform: translate(-7px, 3px) rotate(-0.4deg);
  }
  40% {
    transform: translate(6px, -3px) rotate(0.4deg);
  }
  60% {
    transform: translate(-4px, -2px) rotate(-0.2deg);
  }
  80% {
    transform: translate(3px, 2px) rotate(0.15deg);
  }
  100% {
    transform: translate(0, 0) rotate(0);
  }
}

.modal-layer.tier-wipeout .modal-stripe {
  background: repeating-linear-gradient(-45deg, #ff3b5c 0 10px, #0b0b16 10px 20px);
}

.modal-layer.tier-wipeout .modal-kicker {
  color: #ff8fa3;
}

.modal-layer.tier-wipeout .modal-title {
  background: none;
  -webkit-text-fill-color: #fff0f3;
  color: #fff0f3;
  animation: titleGlitch 3.2s steps(1) infinite;
}

@keyframes titleGlitch {
  0%,
  86%,
  100% {
    text-shadow: 0 0 0 transparent;
    transform: none;
  }
  88% {
    text-shadow: 2px 0 rgba(255, 91, 127, 0.8), -2px 0 rgba(79, 214, 255, 0.5);
    transform: translateX(1px);
  }
  91% {
    text-shadow: -3px 0 rgba(255, 91, 127, 0.75), 3px 0 rgba(79, 214, 255, 0.45);
    transform: translateX(-1px);
  }
  94% {
    text-shadow: 0 0 0 transparent;
    transform: none;
  }
}

.modal-layer.tier-wipeout .grade-row {
  background: rgba(255, 91, 127, 0.07);
  border-color: rgba(255, 91, 127, 0.35);
}

.modal-layer.tier-wipeout .grade-letter {
  animation: wipeoutWobble 2.4s ease-in-out infinite;
}

@keyframes wipeoutWobble {
  0%,
  100% {
    transform: rotate(-3deg);
  }
  50% {
    transform: rotate(2deg);
  }
}

.modal-layer.tier-wipeout .result-grid > div {
  border-color: rgba(255, 91, 127, 0.22);
  background: rgba(255, 91, 127, 0.05);
}

.modal-layer.tier-wipeout .modal-art::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(to top, rgba(255, 26, 62, 0.22), transparent 60%);
}

/* ==================== 全屏反馈 ==================== */

#flash-layer {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 45;
  opacity: 0;
  transition: opacity 0.5s ease;
}

#flash-layer.on {
  opacity: 1;
}

#flash-layer.danger {
  background: radial-gradient(circle at 50% 50%, transparent 35%, rgba(255, 30, 70, 0.35) 100%);
  animation: dangerPulse 1.4s ease-out;
}

#flash-layer.gain {
  background: radial-gradient(circle at 50% 80%, rgba(255, 95, 126, 0.18), transparent 60%);
}

@keyframes dangerPulse {
  0% {
    opacity: 0;
  }
  15% {
    opacity: 1;
  }
  100% {
    opacity: 0;
  }
}

.petal {
  position: fixed;
  top: -24px;
  width: 9px;
  height: 9px;
  background: linear-gradient(135deg, #ffb3cf, #ff5b95);
  border-radius: 100% 0 100% 0;
  pointer-events: none;
  z-index: 46;
  animation: petalFall linear forwards;
}

@keyframes petalFall {
  0% {
    transform: translateY(0) rotate(0) scale(1);
    opacity: 0.9;
  }
  100% {
    transform: translateY(108vh) translateX(var(--drift, 40px)) rotate(540deg) scale(0.7);
    opacity: 0;
  }
}

/* ==================== 滚动条 ==================== */

::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.12);
  border-radius: 99px;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 79, 154, 0.45);
}

/* ==================== 响应式 ==================== */

/* 矮屏笔记本：压缩头像与下单面板，保证成交按钮和事件流都留在首屏 */
@media (max-height: 840px) and (min-width: 1181px) {
  .speaker-card {
    padding: 10px 12px;
    gap: 10px;
  }

  .speaker-avatar {
    width: 68px;
    height: 68px;
    border-radius: 17px;
  }

  .speaker-line {
    min-height: 32px;
    margin: 4px 0 5px;
    font-size: 11px;
    line-height: 1.45;
  }

  .speaker-name {
    font-size: 13px;
  }

  .portrait-tip {
    display: none;
  }

  .ticket {
    padding: 11px;
  }

  .ticket-head {
    margin-bottom: 7px;
  }

  .ticket-quote {
    margin-bottom: 8px;
  }

  .ticket-quote > div {
    padding: 6px 9px;
  }

  .field-row {
    margin-bottom: 8px;
  }

  .field > span {
    margin-bottom: 4px;
  }

  .field input[type="range"] {
    margin: 6px 0 3px;
  }

  .margin-preview {
    padding: 6px 8px;
    margin-bottom: 8px;
  }

  .order-buttons .btn-buy,
  .order-buttons .btn-sell {
    padding: 9px 8px;
  }

  .ticket-hint {
    display: none;
  }
}

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

  #app {
    height: auto;
    min-height: 100vh;
  }

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

  .chart-panel {
    min-height: 540px;
  }

  .chart-wrap {
    min-height: 330px;
  }

  .side {
    display: grid;
    grid-template-columns: 1fr 1fr;
    align-items: start;
  }

  .feed {
    grid-column: 1 / -1;
    height: 260px;
  }

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

@media (max-width: 760px) {
  #app {
    padding: 10px;
  }

  .topbar {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
    padding: 12px 14px;
  }

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

  .stats {
    flex: 1 0 auto;
    width: 100%;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 4px;
  }

  .stat-value {
    font-size: 16px;
  }

  .chart-head {
    flex-wrap: wrap;
    gap: 10px;
  }

  .chart-hint {
    display: none;
  }

  .chart-tools {
    margin-left: 0;
  }

  .side {
    display: flex;
    align-items: stretch;
  }

  .speaker-card {
    padding: 12px;
  }

  .speaker-avatar {
    width: 78px;
    height: 78px;
  }

  .speaker-line {
    font-size: 12.5px;
  }

  .positions-scroll {
    height: 132px;
  }

  .positions-table {
    min-width: 0;
    font-size: 10px;
    table-layout: fixed;
  }

  .positions-table th:last-child,
  .positions-table td:last-child {
    text-align: right;
    padding-right: 6px;
  }

  .positions-table thead th,
  .positions-table tbody td {
    padding: 7px 4px;
  }

  .positions-table th:nth-child(3),
  .positions-table th:nth-child(4),
  .positions-table th:nth-child(5),
  .positions-table th:nth-child(6),
  .positions-table td:nth-child(3),
  .positions-table td:nth-child(4),
  .positions-table td:nth-child(5),
  .positions-table td:nth-child(6) {
    display: none;
  }

  .mini-btn {
    padding: 3px 7px;
    font-size: 9.5px;
  }

  .modal {
    flex-direction: column;
    max-height: 92vh;
  }

  .modal-art {
    width: 100%;
    height: 210px;
  }

  .rule-grid {
    gap: 6px;
  }

  .rule-grid > div {
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
    padding: 8px 10px;
  }

  .rule-grid b {
    white-space: nowrap;
  }

  .rule-grid span {
    font-size: 11.5px;
  }

  .modal-content {
    padding: 22px 20px;
  }

  .modal-title {
    font-size: 22px;
  }

  .outcome-badge {
    padding: 8px 11px;
    gap: 8px;
  }

  .outcome-badge b {
    font-size: 18px;
    letter-spacing: 4px;
  }

  .outcome-badge span {
    font-size: 10.5px;
  }

  .grade-letter {
    width: 62px;
    height: 62px;
    font-size: 26px;
  }

  .grade-letter.wide {
    font-size: 12px;
  }

  .result-grid span {
    font-size: 15px;
  }

  .footer {
    flex-direction: column;
    gap: 4px;
  }
}
