/* ==========================================================================
   业务样式：布局、品牌、表格、状态徽章、模态、Toast
   ========================================================================== */

.container {
  max-width: 1180px;
  margin: 0 auto;
  padding: 36px 28px 64px;
  display: flex;
  flex-direction: column;
  gap: 22px;
}

/* ---- 品牌头部 ---- */
.brand {
  padding: 26px 30px;
}

.brand-inner {
  display: flex;
  align-items: center;
  gap: 18px;
}

.brand-mark {
  width: 56px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 16px;
  background: linear-gradient(
    135deg,
    rgba(120, 180, 255, 0.35),
    rgba(160, 130, 255, 0.35)
  );
  border: 1px solid rgba(180, 210, 255, 0.4);
  color: #ffffff;
  box-shadow: 0 6px 24px rgba(120, 180, 255, 0.3);
  flex-shrink: 0;
}

.brand-text h1 {
  font-size: 22px;
  background: linear-gradient(135deg, #ffffff, #c4d4ff 70%, #c4a8ff);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.brand-tagline {
  margin: 6px 0 0;
  font-size: 13.5px;
  color: var(--text-secondary);
}

.brand-privacy {
  color: var(--color-success);
  font-weight: 500;
}

/* ---- 通用面板 ---- */
.panel {
  padding: 22px 24px;
}

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

.panel-header h2 {
  font-size: 17px;
  font-weight: 600;
}

.panel-hint {
  font-size: 12.5px;
  color: var(--text-tertiary);
}

.meta-text {
  font-size: 12.5px;
  color: var(--text-tertiary);
}

/* ---- 输入面板 ---- */
.format-hint {
  font-size: 12.5px;
  color: var(--text-secondary);
  margin: 0 0 10px;
  padding: 8px 12px;
  background: rgba(255, 255, 255, 0.025);
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.input-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-top: 14px;
  flex-wrap: wrap;
}

.input-buttons {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* ---- 结果面板 ---- */
.results-toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.table-wrapper {
  overflow-x: auto;
  border-radius: var(--radius-md);
  border: 1px solid rgba(255, 255, 255, 0.05);
  background: rgba(255, 255, 255, 0.018);
}

.empty-state {
  padding: 40px 20px;
  text-align: center;
  color: var(--text-tertiary);
  font-size: 13.5px;
  margin: 0;
}

.results-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
}

.results-table thead th {
  position: sticky;
  top: 0;
  background: rgba(20, 28, 56, 0.85);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  font-weight: 500;
  font-size: 12.5px;
  color: var(--text-secondary);
  text-align: left;
  padding: 12px 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  white-space: nowrap;
}

.results-table tbody td {
  padding: 11px 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  vertical-align: middle;
  color: var(--text-primary);
  white-space: nowrap;
}

.results-table tbody tr {
  transition: background var(--duration-fast) var(--ease-smooth);
}

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

.results-table tbody tr:last-child td {
  border-bottom: none;
}

.col-email {
  font-family: var(--font-mono);
  font-size: 13px;
  max-width: 240px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.col-error {
  white-space: normal;
  max-width: 280px;
  font-size: 12.5px;
  color: var(--text-secondary);
}

.col-actions {
  display: flex;
  gap: 6px;
  flex-wrap: nowrap;
}

.col-time,
.col-expires {
  font-size: 12px;
  color: var(--text-tertiary);
}

/* ---- 状态徽章 ---- */
.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 500;
  border: 1px solid currentColor;
  background: rgba(255, 255, 255, 0.04);
}

.status-badge::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 6px currentColor;
}

.status-badge.status-ok {
  color: var(--color-success);
}

.status-badge.status-unregistered {
  color: var(--color-warning);
}

.status-badge.status-banned {
  color: var(--color-danger);
}

.status-badge.status-otp_timeout {
  color: var(--color-orange);
}

.status-badge.status-bad_credentials {
  color: var(--color-neutral);
}

.status-badge.status-risk_blocked {
  color: var(--color-purple);
}

.status-badge.status-error {
  color: var(--color-neutral);
}

.status-badge.status-pending {
  color: var(--color-primary);
}

.status-badge.status-pending::before {
  animation: pulse-dot 1.4s var(--ease-smooth) infinite;
}

@keyframes pulse-dot {
  0%,
  100% {
    opacity: 1;
    transform: scale(1);
  }
  50% {
    opacity: 0.5;
    transform: scale(0.6);
  }
}

/* ---- Plan 标签 ---- */
.plan-tag {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 6px;
  font-size: 11.5px;
  font-weight: 500;
  background: rgba(120, 180, 255, 0.12);
  border: 1px solid rgba(120, 180, 255, 0.25);
  color: var(--color-primary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.plan-tag.plan-plus,
.plan-tag.plan-pro,
.plan-tag.plan-team,
.plan-tag.plan-enterprise {
  background: linear-gradient(
    135deg,
    rgba(120, 180, 255, 0.25),
    rgba(196, 168, 255, 0.25)
  );
  border-color: rgba(196, 168, 255, 0.45);
  color: #ffffff;
  box-shadow: 0 0 12px rgba(120, 180, 255, 0.2);
}

.plan-tag.plan-free {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.15);
  color: var(--text-secondary);
}

/* ---- 行操作按钮 ---- */
.row-btn {
  padding: 5px 10px;
  font-size: 12px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 6px;
  color: var(--text-secondary);
  transition: all var(--duration-fast) var(--ease-smooth);
}

.row-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.18);
  color: var(--text-primary);
}

.row-btn.row-btn-danger:hover {
  border-color: rgba(255, 122, 133, 0.45);
  color: var(--color-danger);
}

/* ---- 模态 ---- */
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(5, 8, 22, 0.55);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  animation: fade-in var(--duration-mid) var(--ease-smooth);
}

@keyframes fade-in {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.modal {
  width: 100%;
  max-width: 460px;
  padding: 24px 26px;
  animation: modal-pop var(--duration-mid) var(--ease-out);
}

@keyframes modal-pop {
  from {
    opacity: 0;
    transform: translateY(8px) scale(0.97);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.modal-header h3 {
  font-size: 16px;
}

.modal-close {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-size: 22px;
  line-height: 1;
  width: 28px;
  height: 28px;
  border-radius: 6px;
  transition: all var(--duration-fast) var(--ease-smooth);
}

.modal-close:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-primary);
}

.modal-body {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.field-label {
  font-size: 12.5px;
  color: var(--text-secondary);
  font-weight: 500;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 6px;
}

/* ---- Toast ---- */
.toast {
  position: fixed;
  bottom: 32px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  padding: 11px 22px;
  background: rgba(20, 28, 56, 0.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--glass-border);
  border-radius: 999px;
  color: var(--text-primary);
  font-size: 13px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.45);
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--duration-mid) var(--ease-smooth),
    transform var(--duration-mid) var(--ease-smooth);
  z-index: 200;
}

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

.toast.toast-error {
  border-color: rgba(255, 122, 133, 0.45);
}

.toast.toast-success {
  border-color: rgba(95, 212, 157, 0.45);
}

/* ---- 页脚 ---- */
.footer {
  text-align: center;
  color: var(--text-tertiary);
  font-size: 12px;
  margin-top: 12px;
  padding: 12px 8px;
}

/* ---- 响应式 ---- */
@media (max-width: 768px) {
  .container {
    padding: 22px 16px 48px;
  }

  .brand {
    padding: 20px 22px;
  }

  .brand-inner {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }

  .panel {
    padding: 18px 18px;
  }

  .panel-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }

  .input-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .input-buttons {
    width: 100%;
    justify-content: flex-end;
  }

  .results-table {
    font-size: 12.5px;
  }

  .results-table thead th,
  .results-table tbody td {
    padding: 9px 10px;
  }

  .col-email {
    max-width: 160px;
  }
}

/* ==========================================================================
   动效细节增强（Task 10）
   ========================================================================== */

/* 表格行渐入 */
.results-table tbody tr {
  animation: row-enter 320ms var(--ease-out) backwards;
}

.results-table tbody tr:nth-child(1) { animation-delay: 0ms; }
.results-table tbody tr:nth-child(2) { animation-delay: 30ms; }
.results-table tbody tr:nth-child(3) { animation-delay: 60ms; }
.results-table tbody tr:nth-child(4) { animation-delay: 90ms; }
.results-table tbody tr:nth-child(5) { animation-delay: 120ms; }
.results-table tbody tr:nth-child(6) { animation-delay: 150ms; }
.results-table tbody tr:nth-child(7) { animation-delay: 180ms; }
.results-table tbody tr:nth-child(8) { animation-delay: 210ms; }
.results-table tbody tr:nth-child(n+9) { animation-delay: 240ms; }

@keyframes row-enter {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* pending 行整体呼吸 */
.results-table tbody tr:has(.status-pending) {
  background: linear-gradient(
    90deg,
    rgba(120, 180, 255, 0.0) 0%,
    rgba(120, 180, 255, 0.05) 50%,
    rgba(120, 180, 255, 0.0) 100%
  );
  background-size: 200% 100%;
  animation: row-shimmer 1.8s linear infinite;
}

@keyframes row-shimmer {
  0% {
    background-position: 200% 0;
  }
  100% {
    background-position: -200% 0;
  }
}

/* 状态徽章颜色光晕（hover 时增强） */
.status-badge {
  transition: all var(--duration-fast) var(--ease-smooth);
}

.results-table tbody tr:hover .status-badge {
  filter: brightness(1.1);
}

/* 编辑模态：玻璃边框微高光环 */
.modal.glass-card {
  box-shadow:
    0 28px 64px rgba(0, 0, 0, 0.6),
    inset 0 1px 0 rgba(255, 255, 255, 0.16),
    0 0 32px rgba(120, 180, 255, 0.18);
}

/* 输入框容器视觉补正 */
.format-hint code {
  background: rgba(120, 180, 255, 0.12);
  border: 1px solid rgba(120, 180, 255, 0.2);
  color: var(--color-primary);
}

/* 主按钮 disabled 时去掉霓虹 */
.glass-btn-primary:disabled {
  box-shadow: none;
}

/* 文本域获得焦点时玻璃感更明显 */
.glass-textarea:focus {
  background: rgba(255, 255, 255, 0.045);
}

/* 工具栏小按钮 hover 微弧 */
.glass-btn-small:hover {
  letter-spacing: 0.04em;
}

/* 行操作按钮 active 缩放 */
.row-btn:active {
  transform: scale(0.96);
}

/* 品牌图标呼吸光晕 */
.brand-mark {
  animation: brand-pulse 4.5s var(--ease-smooth) infinite;
}

@keyframes brand-pulse {
  0%,
  100% {
    box-shadow: 0 6px 24px rgba(120, 180, 255, 0.3);
  }
  50% {
    box-shadow: 0 8px 32px rgba(120, 180, 255, 0.45),
      0 0 0 4px rgba(120, 180, 255, 0.06);
  }
}

/* 链接/可点元素细节聚焦圈 */
:focus-visible {
  outline: 2px solid rgba(120, 180, 255, 0.55);
  outline-offset: 2px;
  border-radius: 4px;
}

/* Toast 出场更柔和 */
.toast {
  transition: opacity var(--duration-mid) var(--ease-out),
    transform var(--duration-mid) var(--ease-out);
}
