:root {
  --bg: #06101d;
  --panel: rgba(10, 21, 37, 0.72);
  --panel-strong: rgba(9, 20, 35, 0.92);
  --stroke: rgba(0, 210, 255, 0.30);
  --text: #f7fbff;
  --muted: #8aa4b8;
  --accent: #00d2ff;
  --accent2: #55ffcf;
  --danger: #ff6680;
  --shadow: 0 28px 90px rgba(0, 0, 0, 0.42);
  --radius: 26px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", "PingFang SC", "Noto Sans CJK SC", Arial, sans-serif;
}
* { box-sizing: border-box; }
html, body { width: 100%; height: 100%; margin: 0; overflow: hidden; background: var(--bg); color: var(--text); }
button, input, select { font: inherit; }
button { cursor: pointer; border: 0; font-family: inherit; }
.background-layer { position: fixed; inset: 0; background:
  radial-gradient(circle at 12% 15%, rgba(0, 210, 255, .22), transparent 30%),
  radial-gradient(circle at 82% 8%, rgba(85, 255, 207, .14), transparent 25%),
  radial-gradient(circle at 50% 96%, rgba(53, 73, 255, .23), transparent 35%),
  linear-gradient(135deg, #050b14 0%, #07182a 46%, #03070d 100%); }
.background-layer:after { content: ""; position: absolute; inset: 0; background-image: linear-gradient(rgba(255,255,255,.035) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.026) 1px, transparent 1px); background-size: 52px 52px; mask-image: linear-gradient(to bottom, rgba(0,0,0,.9), rgba(0,0,0,.25)); }
.app-shell { position: relative; height: 100%; padding: 2.2vh 2.2vw; display: flex; flex-direction: column; gap: 2vh; }
.topbar { height: 10vh; display: flex; align-items: center; justify-content: space-between; }
.eyebrow { color: var(--accent2); letter-spacing: .18em; text-transform: uppercase; font-size: clamp(10px, .9vw, 14px); font-weight: 700; }
h1 { margin: .25rem 0 0; font-size: clamp(34px, 4vw, 68px); line-height: .9; letter-spacing: -.05em; }
h1 span { color: var(--accent); font-weight: 500; }
.top-actions { display: flex; align-items: center; gap: 14px; }
.status-pill { display: inline-flex; align-items: center; gap: 10px; padding: 12px 16px; border: 1px solid var(--stroke); border-radius: 999px; background: rgba(255,255,255,.055); backdrop-filter: blur(22px); color: #dff9ff; font-weight: 700; }
.dot { width: 10px; height: 10px; border-radius: 50%; background: var(--accent2); box-shadow: 0 0 18px var(--accent2); }
.workspace { flex: 1; min-height: 0; display: grid; grid-template-columns: 34% 1fr; gap: 1.4vw; }
.glass-card { border: 1px solid var(--stroke); border-radius: var(--radius); background: linear-gradient(145deg, rgba(13, 30, 52, .82), rgba(7, 16, 29, .64)); box-shadow: var(--shadow); backdrop-filter: blur(26px); }
.left-panel { padding: 2.1vh 1.6vw; display: flex; flex-direction: column; min-width: 0; }
.section-title, .card-head, .settings-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.section-title span, .card-head h2, .settings-header h2 { margin: 0; font-size: clamp(17px, 1.35vw, 25px); letter-spacing: -.03em; }
.section-title small, .card-head p, .settings-header p { display: block; margin-top: 4px; color: var(--muted); font-size: clamp(11px, .82vw, 14px); }
.mode-badge { padding: 8px 12px; border-radius: 999px; color: #06121b; background: linear-gradient(135deg, var(--accent), var(--accent2)); font-weight: 900; letter-spacing: .08em; font-size: 12px; box-shadow: 0 10px 28px rgba(0,210,255,.22); transition: transform .18s ease, filter .18s ease; }
.mode-badge:hover { transform: translateY(-1px); filter: brightness(1.1); }
.mode-badge:active { transform: translateY(0); }
.qr-outer { width: min(44vh, 20.5vw); height: min(44vh, 20.5vw); align-self: center; margin: 2.2vh 0 1.5vh; padding: 18px; border-radius: 28px; background: #f7fbff; box-shadow: 0 30px 70px rgba(0,0,0,.38), 0 0 0 9px rgba(255,255,255,.04); display: grid; place-items: center; }
.qr-outer img { width: 100%; height: 100%; object-fit: contain; display: block; }
.form-grid { display: grid; grid-template-columns: 1.15fr .85fr; gap: 14px; }
.field { display: flex; flex-direction: column; gap: 8px; color: var(--muted); font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: .08em; }
.field input, .setting-input, .setting-select { width: 100%; color: var(--text); background: rgba(255,255,255,.075); border: 1px solid rgba(255,255,255,.13); outline: 0; border-radius: 16px; padding: 14px 14px; transition: .2s ease; }
.field input { font-size: clamp(20px, 1.45vw, 28px); font-weight: 850; letter-spacing: -.03em; padding: 16px 16px; }
.field input:focus, .setting-input:focus, .setting-select:focus { border-color: var(--accent); box-shadow: 0 0 0 4px rgba(0, 210, 255, .10); }
.setting-input[type="color"] { height: 52px; padding: 6px; cursor: pointer; }
.primary-button, .ghost-button, .icon-button { color: #04111a; background: linear-gradient(135deg, var(--accent), var(--accent2)); border-radius: 16px; padding: 14px 18px; font-weight: 900; letter-spacing: -.01em; box-shadow: 0 12px 32px rgba(0,210,255,.22); transition: transform .18s ease, filter .18s ease; }
.primary-button:hover, .ghost-button:hover, .icon-button:hover { transform: translateY(-1px); filter: brightness(1.08); }
.primary-button.small { padding: 12px 16px; }
.primary-button.scan { margin-top: 1.8vh; font-size: clamp(16px, 1.3vw, 22px); min-height: 58px; }
.primary-button.hidden { display: none; }
.primary-button.scan.is-sending { pointer-events: none; filter: brightness(1.18); }
.primary-button.scan.is-sending::after { content: ' · LIVE FLOW'; letter-spacing: .08em; animation: scanBlink 1s infinite ease-in-out; }
@keyframes scanBlink { 50% { opacity: .35; } }
.ghost-button { color: var(--text); background: rgba(255,255,255,.07); box-shadow: none; border: 1px solid rgba(255,255,255,.1); }
.icon-button { width: 46px; height: 46px; padding: 0; display: grid; place-items: center; font-size: 22px; }
.qr-note { margin-top: auto; color: var(--muted); font-size: clamp(11px, .86vw, 14px); line-height: 1.45; border-top: 1px solid rgba(255,255,255,.1); padding-top: 1.5vh; }
.qr-note strong { color: var(--text); }
.right-panel { min-height: 0; display: grid; grid-template-rows: minmax(220px, 31%) minmax(230px, 31%) minmax(210px, 1fr); gap: 1.2vh; }
.right-panel article { min-height: 0; padding: 1.7vh 1.35vw; position: relative; overflow: hidden; }
.compact { align-items: center; }
.device-orb { width: 54px; height: 54px; border-radius: 50%; background: radial-gradient(circle, rgba(85,255,207,.95), rgba(0,210,255,.12) 58%, transparent 62%); display: grid; place-items: center; animation: orb 2.4s infinite ease-in-out; }
.device-orb span { width: 15px; height: 15px; border-radius: 50%; background: #fff; box-shadow: 0 0 20px #fff; }
@keyframes orb { 50% { transform: scale(1.08); filter: brightness(1.18); } }
.device-status-layout { margin-top: 1.05vh; display: grid; grid-template-columns: minmax(0, 1fr) minmax(210px, 16.8vw); gap: 1vw; align-items: stretch; height: calc(100% - 66px); }
.status-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: .82vh .72vw; min-height: 0; }
.status-grid div, .payment-meta div { padding: .82vh .78vw; border-radius: 16px; background: rgba(255,255,255,.055); border: 1px solid rgba(255,255,255,.09); min-width: 0; }
.status-grid small, .payment-meta small { display: block; color: var(--muted); font-size: clamp(9px, .66vw, 12px); text-transform: uppercase; letter-spacing: .08em; margin-bottom: 5px; }
.status-grid strong, .payment-meta strong { display: block; color: var(--text); font-size: clamp(12px, .92vw, 16px); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.device-simulator { position: relative; min-height: 0; border-radius: 26px; padding: 13px; background: linear-gradient(145deg, rgba(1, 8, 16, .97), rgba(16, 34, 52, .95)); border: 1px solid rgba(255,255,255,.14); box-shadow: inset 0 0 0 1px rgba(255,255,255,.045), 0 18px 48px rgba(0,0,0,.32); overflow: hidden; }
.device-simulator::before { content: ''; position: absolute; inset: 0; background: radial-gradient(circle at 50% 36%, rgba(0,210,255,.16), transparent 46%), radial-gradient(circle at 50% 0%, rgba(85,255,207,.10), transparent 42%); pointer-events: none; }
.speaker-simulator { display: grid; grid-template-rows: auto auto minmax(0, 1fr) auto auto; gap: .7vh; }
.speaker-brand { position: relative; z-index: 2; color: var(--text); font-size: clamp(11px, .78vw, 14px); font-weight: 950; letter-spacing: .08em; text-transform: uppercase; text-align: center; }
.speaker-indicators { position: relative; z-index: 2; display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.speaker-indicators span { display: flex; align-items: center; justify-content: center; gap: 4px; border-radius: 999px; padding: 6px 6px; background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.10); color: var(--text); font-size: clamp(8px, .54vw, 10px); font-weight: 900; text-transform: uppercase; letter-spacing: .06em; white-space: nowrap; }
.speaker-indicators i { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 12px var(--accent); flex: 0 0 auto; }
.speaker-body { position: relative; z-index: 1; display: grid; place-items: center; min-height: 96px; }
.speaker-ring { position: relative; width: min(8.6vw, 112px); aspect-ratio: 1; border-radius: 50%; display: grid; place-items: center; background: radial-gradient(circle, rgba(0,18,28,.98) 0 49%, rgba(0,210,255,.14) 50% 61%, rgba(255,255,255,.08) 62% 66%, rgba(0,210,255,.16) 67% 72%, rgba(0,0,0,.38) 73%); border: 1px solid rgba(85,255,207,.28); box-shadow: inset 0 0 28px rgba(0,0,0,.8), 0 0 30px rgba(0,210,255,.16); }
.speaker-ring::before { content: ''; position: absolute; inset: 8%; border-radius: 50%; border: 1px solid rgba(255,255,255,.12); box-shadow: inset 0 0 22px rgba(0,0,0,.8); }
.speaker-grille-main { position: relative; z-index: 1; width: 58%; height: 58%; display: grid; grid-template-columns: repeat(5, 1fr); grid-template-rows: repeat(5, 1fr); gap: 4px; place-items: center; }
.speaker-grille-main span { width: 4px; height: 4px; border-radius: 50%; background: rgba(230,248,255,.34); box-shadow: 0 0 8px rgba(0,210,255,.18); }
.speaker-wave { position: absolute; width: min(8.6vw, 112px); aspect-ratio: 1; border-radius: 50%; border: 1px solid rgba(0,210,255,.0); opacity: 0; }
.device-simulator.live .speaker-ring { box-shadow: inset 0 0 28px rgba(0,0,0,.8), 0 0 38px rgba(0,210,255,.30); }
.device-simulator.sound .speaker-ring { animation: speakerPulse 1s ease-in-out infinite; border-color: rgba(85,255,207,.70); }
.device-simulator.sound .speaker-wave { animation: speakerWave 1.2s ease-out infinite; }
.device-simulator.sound .wave-two { animation-delay: .38s; }
.device-simulator.sound .speaker-indicators i { animation: simLed 1s ease-in-out infinite; }
@keyframes simLed { 50% { transform: scale(1.35); filter: brightness(1.35); } }
@keyframes speakerPulse { 0%, 100% { transform: scale(1); filter: brightness(1); } 45% { transform: scale(1.045); filter: brightness(1.3); } }
@keyframes speakerWave { 0% { transform: scale(.82); opacity: .50; border-color: rgba(85,255,207,.55); } 100% { transform: scale(1.42); opacity: 0; border-color: rgba(0,210,255,0); } }
.speaker-state { position: relative; z-index: 2; color: var(--accent2); font-size: clamp(10px, .68vw, 12px); font-weight: 950; text-align: center; text-transform: uppercase; letter-spacing: .08em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.speaker-last { position: relative; z-index: 2; color: var(--muted); font-size: clamp(8px, .55vw, 10px); text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.speaker-last b { color: var(--text); font-weight: 900; }
.device-simulator.sound { box-shadow: inset 0 0 0 1px rgba(85,255,207,.18), 0 0 44px rgba(0,210,255,.22), 0 18px 48px rgba(0,0,0,.32); }
.amount-display { font-size: clamp(24px, 2.4vw, 42px); color: var(--accent2); font-weight: 900; letter-spacing: -.05em; }
.flow { display: grid; grid-template-columns: 1fr 22px 1fr 22px 1fr 22px 1fr; align-items: center; gap: 10px; margin: 1.35vh 0; }
.flow-step { min-height: 78px; border-radius: 22px; background: rgba(255,255,255,.05); border: 1px solid rgba(255,255,255,.1); display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 10px; text-align: center; color: var(--muted); transition: .28s ease; }
.flow-step span { width: 14px; height: 14px; border-radius: 50%; background: rgba(255,255,255,.3); transition: .28s ease; }
.flow-step.active { color: var(--text); border-color: var(--accent); background: linear-gradient(145deg, rgba(0,210,255,.18), rgba(85,255,207,.08)); box-shadow: 0 0 38px rgba(0,210,255,.15); transform: translateY(-2px); animation: flowTriplePulse 1.62s ease-in-out both; }
.flow-step.active span { background: var(--accent2); box-shadow: 0 0 22px var(--accent2); animation: flowDotTriplePulse 1.62s ease-in-out both; }
@keyframes flowTriplePulse { 0%, 100% { filter: brightness(1); box-shadow: 0 0 30px rgba(0,210,255,.12); } 10%, 38%, 66% { filter: brightness(1.28); box-shadow: 0 0 46px rgba(0,210,255,.28), inset 0 0 18px rgba(85,255,207,.10); } 22%, 50%, 78% { filter: brightness(1.02); box-shadow: 0 0 28px rgba(0,210,255,.14); } }
@keyframes flowDotTriplePulse { 0%, 100% { transform: scale(1); } 10%, 38%, 66% { transform: scale(1.28); } 22%, 50%, 78% { transform: scale(1); } }
.flow-line { height: 2px; background: linear-gradient(90deg, rgba(255,255,255,.12), rgba(0,210,255,.7)); }
.payment-meta { display: grid; grid-template-columns: 1fr 1fr; gap: 1vw; }
.speaker { position: absolute; right: 1.2vw; bottom: 1.1vh; width: 72px; height: 72px; border-radius: 50%; display: grid; place-items: center; opacity: .4; }
.speaker i { position: absolute; border: 2px solid var(--accent); border-radius: 50%; inset: 24px; opacity: 0; }
.speaker.pulse { opacity: 1; }
.speaker.pulse i { animation: pulse 1.1s ease-out forwards; }
.speaker.pulse i:nth-child(2) { animation-delay: .15s; }
.speaker.pulse i:nth-child(3) { animation-delay: .3s; }
@keyframes pulse { from { opacity: .9; transform: scale(.2); } to { opacity: 0; transform: scale(2.8); } }
.timeline-grid { height: calc(100% - 48px); display: grid; grid-template-columns: 1fr 1fr; gap: 7px; overflow: hidden; align-content: start; }
.timeline-item { border: 1px solid rgba(255,255,255,.09); background: rgba(255,255,255,.045); border-radius: 14px; padding: 6px 9px; animation: slideIn .25s ease both; min-height: 48px; }
.timeline-item b { display: flex; justify-content: space-between; gap: 8px; font-size: clamp(11px, .78vw, 13px); color: var(--text); }
.timeline-item span { color: var(--accent2); }
.timeline-item small { display: block; color: var(--muted); margin-top: 3px; font-size: clamp(9px, .66vw, 11px); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@keyframes slideIn { from { opacity: 0; transform: translateY(8px); } }
.settings-modal { position: fixed; inset: 0; z-index: 50; background: rgba(0,0,0,.58); display: none; place-items: center; padding: 3vh 3vw; }
.settings-modal.open { display: grid; }
.settings-panel { width: min(1100px, 92vw); height: min(760px, 88vh); padding: 24px; display: flex; flex-direction: column; }
.settings-body { min-height: 0; flex: 1; display: grid; grid-template-columns: 220px 1fr; gap: 20px; margin-top: 18px; }
.tabs { display: flex; flex-direction: column; gap: 8px; }
.tab-button { color: var(--muted); text-align: left; padding: 13px 14px; border-radius: 14px; background: rgba(255,255,255,.045); border: 1px solid transparent; }
.tab-button.active { color: var(--text); border-color: var(--accent); background: rgba(0,210,255,.12); }
.tab-content { min-height: 0; overflow-y: auto; padding-right: 6px; }
.settings-section { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.setting-card { border: 1px solid rgba(255,255,255,.1); background: rgba(255,255,255,.045); border-radius: 18px; padding: 16px; }
.setting-card.full { grid-column: 1 / -1; }
.setting-card h3 { margin: 0 0 12px; font-size: 18px; }
.setting-card p { color: var(--muted); line-height: 1.45; }
.toggle-row { display: flex; gap: 10px; flex-wrap: wrap; }
.coming-soon { display: inline-block; padding: 5px 9px; border-radius: 999px; color: #06121b; background: #b8c4cf; font-size: 11px; font-weight: 900; }
@media (max-aspect-ratio: 4/3) { .workspace { grid-template-columns: 1fr; overflow-y: auto; } body { overflow: auto; } .right-panel { grid-template-rows: auto; } .device-status-layout { grid-template-columns: 1fr; height: auto; } .device-simulator { min-height: 210px; } }

.switch-row { display: flex; align-items: center; gap: 12px; color: var(--text); font-weight: 850; letter-spacing: .01em; }
.switch-row input { width: 20px; height: 20px; accent-color: var(--accent); }
