* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  background: #f1f5f9;
  color: #0f172a;
  height: 100vh;
  overflow: hidden;
  padding: 50px;
}

/* ── 整体布局 ── */
.app {
  display: flex;
  height: calc(100vh - 100px);
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid #e2e8f0;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.06);
}

/* ── 左侧面板 ── */
.panel-left {
  width: 380px;
  flex-shrink: 0;
  background: #ffffff;
  border-right: 1px solid #e2e8f0;
  height: 100%;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  padding: 20px;
  gap: 16px;
}

.panel-left::-webkit-scrollbar {
  width: 4px;
}
.panel-left::-webkit-scrollbar-thumb {
  background: #e2e8f0;
  border-radius: 4px;
}

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 16px;
  border-bottom: 1px solid #f1f5f9;
  flex-shrink: 0;
}

.panel-title {
  font-size: 14px;
  font-weight: 700;
  color: #0f172a;
  letter-spacing: 0.2px;
}

/* ── 状态 ── */
.status-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: #94a3b8;
}

.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #cbd5e1;
  transition: background 0.3s;
  flex-shrink: 0;
}

.status-dot.active {
  background: #22c55e;
  box-shadow: 0 0 5px rgba(34, 197, 94, 0.5);
  animation: pulse 1.5s infinite;
}

.status-dot.error {
  background: #ef4444;
}

@keyframes pulse {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.4;
  }
}

/* ── Token 输入 ── */
.token-section {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.token-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.7px;
  color: #94a3b8;
  display: flex;
  align-items: center;
  gap: 6px;
}

.auto-fill-badge {
  display: inline-flex;
  align-items: center;
  font-size: 10px;
  font-weight: 500;
  background: rgba(34, 197, 94, 0.1);
  color: #16a34a;
  border: 1px solid rgba(34, 197, 94, 0.2);
  padding: 1px 6px;
  border-radius: 3px;
  text-transform: none;
  letter-spacing: 0;
}

.token-input {
  width: 100%;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  padding: 9px 12px;
  font-size: 13px;
  color: #0f172a;
  outline: none;
  font-family: "Courier New", monospace;
  letter-spacing: 0.4px;
  transition:
    border-color 0.2s,
    box-shadow 0.2s;
}

.token-input::placeholder {
  color: #cbd5e1;
  font-family: "Segoe UI", sans-serif;
  letter-spacing: normal;
}

.token-input:focus {
  border-color: #f97316;
  box-shadow: 0 0 0 3px rgba(249, 115, 22, 0.1);
}

.token-input.valid {
  border-color: rgba(34, 197, 94, 0.6);
}

.token-input.invalid {
  border-color: rgba(239, 68, 68, 0.6);
}

.token-hint {
  font-size: 11px;
  color: #94a3b8;
  min-height: 16px;
  line-height: 1.4;
}

.token-hint.success {
  color: #16a34a;
}
.token-hint.error {
  color: #ef4444;
}

.btn-confirm-token {
  width: 100%;
  padding: 9px;
  border-radius: 6px;
  border: none;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  background: #f97316;
  color: #fff;
  transition: background 0.15s;
}

.btn-confirm-token:hover {
  background: #ea580c;
}

/* ── 分隔线 ── */
.divider {
  border: none;
  border-top: 1px solid #f1f5f9;
  flex-shrink: 0;
}

/* ── 进度条 ── */
.progress-bar-wrap {
  height: 2px;
  background: #f1f5f9;
  border-radius: 2px;
  overflow: hidden;
  flex-shrink: 0;
}

.progress-bar {
  height: 100%;
  background: #f97316;
  border-radius: 2px;
  width: 0%;
  transition: width 0.1s linear;
}

/* ── 控制按钮 ── */
.controls {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 12px;
  border-radius: 6px;
  border: none;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s;
  outline: none;
  width: 100%;
}

.btn-primary {
  background: #f97316;
  color: #fff;
}

.btn-primary:hover {
  background: #ea580c;
}

.btn-danger {
  background: #fff1f0;
  color: #dc2626;
  border: 1px solid #fecaca;
}

.btn-danger:hover {
  background: #fee2e2;
}

.btn-secondary {
  background: #f8fafc;
  color: #64748b;
  border: 1px solid #e2e8f0;
}

.btn-secondary:hover {
  background: #f1f5f9;
  color: #0f172a;
}

.btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

/* ── 轮询间隔 ── */
.interval-wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
  color: #94a3b8;
}

.interval-wrap select {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  color: #0f172a;
  border-radius: 4px;
  padding: 4px 8px;
  font-size: 12px;
  outline: none;
  cursor: pointer;
}

/* ── 等待提示 ── */
.monitor-tip {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 7px;
  background: #fff7ed;
  border: 1px solid #fed7aa;
}

.monitor-tip[hidden] {
  display: none;
}

.monitor-tip.is-visible {
  animation: tipReveal 0.3s ease;
}

.monitor-tip.is-priority {
  background: #fff7ed;
  border-color: #fb923c;
}

.monitor-tip-icon {
  flex-shrink: 0;
  width: 22px;
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.monitor-tip-bubble {
  position: relative;
  width: 20px;
  height: 14px;
  border-radius: 8px;
  background: #f97316;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 2px;
  animation: tipBubbleFloat 2.8s ease-in-out infinite;
}

.monitor-tip-bubble::after {
  content: "";
  position: absolute;
  left: 4px;
  bottom: -4px;
  width: 6px;
  height: 6px;
  background: #f97316;
  border-radius: 1px 0 4px 0;
  transform: rotate(28deg);
}

.monitor-tip-dot {
  width: 2.5px;
  height: 2.5px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.9);
  animation: tipDotBlink 1.4s ease-in-out infinite;
}

.monitor-tip-dot:nth-child(2) {
  animation-delay: 0.18s;
}
.monitor-tip-dot:nth-child(3) {
  animation-delay: 0.36s;
}

.monitor-tip-text {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

.monitor-tip-label {
  font-size: 10px;
  font-weight: 600;
  color: #ea580c;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.monitor-tip-copy {
  color: #7c3f00;
  font-size: 12px;
  line-height: 1.45;
  word-break: break-word;
  white-space: normal;
}

.monitor-tip-copy.is-animating {
  animation: tipCopySwap 0.4s ease;
}

/* ── 右侧面板 ── */
.panel-right {
  flex: 1;
  height: 100%;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  background: #f8fafc;
}

/* ── 最新验证码 ── */
.latest-sms {
  display: none;
  padding: 28px 32px 24px;
  border-bottom: 1px solid #e2e8f0;
  background: #ffffff;
  flex-shrink: 0;
}

.latest-sms.show {
  display: block;
  animation: fadeIn 0.3s ease;
}

.latest-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: #f97316;
  margin-bottom: 12px;
}

.latest-code {
  font-size: 56px;
  font-weight: 700;
  letter-spacing: 10px;
  color: #0f172a;
  font-family: "Courier New", monospace;
  cursor: pointer;
  user-select: all;
  line-height: 1;
  margin-bottom: 8px;
  transition: color 0.2s;
}

.latest-code:hover {
  color: #f97316;
}

.copy-tip {
  font-size: 11px;
  color: #cbd5e1;
  margin-bottom: 8px;
}

.latest-meta {
  font-size: 12px;
  color: #94a3b8;
  display: flex;
  gap: 16px;
}

/* ── 列表区 ── */
.list-area {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding: 16px 24px 20px;
}

.list-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
  flex-shrink: 0;
}

.list-title {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.7px;
  color: #94a3b8;
}

.list-count {
  font-size: 11px;
  color: #94a3b8;
  background: #e2e8f0;
  padding: 2px 8px;
  border-radius: 4px;
}

.sms-list {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.sms-list::-webkit-scrollbar {
  width: 4px;
}
.sms-list::-webkit-scrollbar-thumb {
  background: #e2e8f0;
  border-radius: 4px;
}

.sms-item {
  background: #ffffff;
  border: 1px solid #f1f5f9;
  border-radius: 6px;
  padding: 8px 12px;
  transition: border-color 0.15s;
  flex-shrink: 0;
}

.sms-item:hover {
  border-color: #e2e8f0;
}

.sms-item.new-item {
  border-color: #fed7aa;
  background: #fff7ed;
}

.sms-item-top {
  margin-bottom: 3px;
}

.sms-time {
  font-size: 11px;
  color: #94a3b8;
}

.sms-content {
  font-size: 12px;
  color: #475569;
  line-height: 1.5;
  word-break: break-all;
}

.sms-code-inline {
  display: inline-block;
  background: rgba(249, 115, 22, 0.1);
  color: #ea580c;
  font-weight: 700;
  font-family: "Courier New", monospace;
  padding: 0 5px;
  border-radius: 3px;
  font-size: 13px;
  cursor: pointer;
}

.sms-code-inline:hover {
  background: rgba(249, 115, 22, 0.2);
}

/* ── 空状态 ── */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex: 1;
  min-height: 160px;
  color: #cbd5e1;
  text-align: center;
}

.empty-state .empty-icon {
  font-size: 30px;
  margin-bottom: 10px;
  opacity: 0.5;
}

.empty-state p {
  font-size: 12px;
}

/* ── Toast ── */
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(8px);
  color: #fff;
  padding: 8px 20px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 500;
  opacity: 0;
  pointer-events: none;
  transition: all 0.25s;
  z-index: 9999;
  white-space: nowrap;
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ── Animations ── */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(-4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

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

@keyframes tipBubbleFloat {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-1px);
  }
}

@keyframes tipDotBlink {
  0%,
  100% {
    opacity: 0.4;
  }
  50% {
    opacity: 1;
  }
}

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

/* ── Mobile ── */
@media (max-width: 640px) {
  body {
    overflow: auto;
    height: auto;
    padding: 8px;
  }
  .app {
    flex-direction: column;
    height: auto;
    border-radius: 8px;
  }
  .panel-left {
    width: 100%;
    height: auto;
    border-right: none;
    border-bottom: 1px solid #e2e8f0;
  }
  .panel-right {
    height: auto;
  }
  .latest-code {
    font-size: 38px;
    letter-spacing: 6px;
  }
  .list-area {
    padding: 16px;
    min-height: 300px;
  }
}
