@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

:root {
  --primary: #3B82F6;
  --primary-hover: #2563EB;
  --primary-soft: rgba(59, 130, 246, 0.1);
  --success: #10B981;
  --success-soft: #D1FAE5;
  --warning: #F59E0B;
  --warning-soft: #FEF3C7;
  --error: #EF4444;
  --error-soft: #FEE2E2;
  --text-main: #1E293B;
  --text-sub: #64748B;
  --text-placeholder: #94A3B8;
  --bg-body: #F1F5F9;
  --glass-bg: rgba(255, 255, 255, 0.75);
  --glass-border: rgba(255, 255, 255, 0.6);
  --glass-shadow: 0 8px 32px rgba(31, 38, 135, 0.07);
  --border: #E2E8F0;
  --ease-out: cubic-bezier(0.215, 0.61, 0.355, 1);
}

*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'PingFang SC', 'Microsoft YaHei', sans-serif;
  background-color: var(--bg-body);
  background-image:
    radial-gradient(at 0% 0%, rgba(59, 130, 246, 0.12) 0px, transparent 50%),
    radial-gradient(at 100% 0%, rgba(16, 185, 129, 0.08) 0px, transparent 50%),
    radial-gradient(at 100% 100%, rgba(245, 158, 11, 0.06) 0px, transparent 50%);
  background-attachment: fixed;
  color: var(--text-main);
  line-height: 1.6;
  min-height: 100vh;
}

a {
  color: var(--primary);
  text-decoration: none;
}

a:hover { text-decoration: underline; }

button { cursor: pointer; border: none; outline: none; font-family: inherit; }
input, textarea, select { outline: none; font-family: inherit; }
ul, ol { list-style: none; }

/* ===== 毛玻璃卡片 ===== */
.card {
  background: var(--glass-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--glass-border);
  box-shadow: var(--glass-shadow);
  border-radius: 16px;
}

/* ===== 按钮 ===== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 18px;
  border-radius: 10px;
  font-weight: 600;
  font-size: 0.875rem;
  transition: all 0.2s var(--ease-out);
  border: none;
  cursor: pointer;
  white-space: nowrap;
}

.btn:active { transform: scale(0.97); }

.btn-primary {
  background: linear-gradient(135deg, #3B82F6, #2563EB);
  color: #fff;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.25);
}

.btn-primary:hover {
  box-shadow: 0 6px 16px rgba(37, 99, 235, 0.35);
  transform: translateY(-1px);
}

.btn-outline {
  background: transparent;
  border: 1px solid #CBD5E1;
  color: var(--text-main);
}

.btn-outline:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: var(--primary-soft);
}

.btn-ghost {
  background: transparent;
  color: var(--text-sub);
  padding: 6px 10px;
  border-radius: 8px;
}

.btn-ghost:hover {
  background: rgba(0,0,0,0.04);
  color: var(--text-main);
}

.btn-danger {
  background: var(--error);
  color: #fff;
}

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

.btn-sm { padding: 6px 12px; font-size: 0.8125rem; }

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.loading-spinner {
  width: 14px;
  height: 14px;
  border: 2px solid rgba(255,255,255,0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  display: inline-block;
}

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

/* ===== 输入框 ===== */
.input-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.input-group label {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text-main);
  margin-left: 2px;
}

.input-wrap {
  position: relative;
}

.input-wrap input,
.input-wrap textarea,
.input-wrap select {
  width: 100%;
  padding: 11px 14px 11px 40px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 10px;
  font-size: 0.875rem;
  color: var(--text-main);
  transition: all 0.2s;
  box-shadow: 0 1px 2px rgba(0,0,0,0.02);
}

.input-wrap input:focus,
.input-wrap textarea:focus,
.input-wrap select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-soft);
}

.input-wrap input::placeholder,
.input-wrap textarea::placeholder {
  color: var(--text-placeholder);
}

.input-wrap .input-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-placeholder);
  font-size: 1.05rem;
  pointer-events: none;
  transition: color 0.2s;
}

.input-wrap input:focus ~ .input-icon {
  color: var(--primary);
}

.input-action {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--text-sub);
  padding: 4px;
  cursor: pointer;
  border-radius: 6px;
}

.input-action:hover { color: var(--primary); background: var(--primary-soft); }

/* 无图标输入框 */
.input-plain {
  width: 100%;
  padding: 10px 14px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 10px;
  font-size: 0.875rem;
  color: var(--text-main);
  transition: all 0.2s;
}

.input-plain:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-soft);
  outline: none;
}

textarea.input-plain {
  resize: vertical;
  min-height: 80px;
  line-height: 1.6;
  font-family: inherit;
}

/* ===== 状态标签 ===== */
.tag {
  padding: 4px 10px;
  border-radius: 8px;
  font-size: 0.75rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
}

.tag-success { background: var(--success-soft); color: #059669; }
.tag-error { background: var(--error-soft); color: #DC2626; }
.tag-gray { background: #F1F5F9; color: var(--text-sub); }
.tag-warning { background: var(--warning-soft); color: #D97706; }

/* ===== 弹窗 ===== */
.overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.35);
  backdrop-filter: blur(4px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  opacity: 0;
  visibility: hidden;
  transition: all 0.25s var(--ease-out);
}

.overlay.active { opacity: 1; visibility: visible; }

.modal {
  background: #fff;
  width: 100%;
  max-width: 420px;
  max-height: 90vh;
  overflow-y: auto;
  border-radius: 20px;
  box-shadow: 0 20px 40px rgba(0,0,0,0.12);
  transform: scale(0.95) translateY(10px);
  transition: all 0.25s var(--ease-out);
}

.overlay.active .modal { transform: scale(1) translateY(0); }

.modal-header {
  padding: 18px 20px;
  border-bottom: 1px solid #F1F5F9;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-header h3 {
  font-size: 1.05rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 6px;
}

.modal-close {
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  background: none;
  border: none;
  color: var(--text-sub);
  cursor: pointer;
}

.modal-close:hover { background: #F1F5F9; color: var(--text-main); }

.modal-body { padding: 20px; }

.modal-footer {
  padding: 0 20px 20px;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

/* ===== Toast ===== */
.toast-container {
  position: fixed;
  top: 16px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 2000;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  width: 90%;
  max-width: 380px;
  pointer-events: none;
}

.toast {
  padding: 12px 18px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
  font-size: 0.875rem;
  animation: toastIn 0.35s var(--ease-out);
  width: 100%;
  pointer-events: auto;
  border: none;
  position: relative;
  overflow: hidden;
}

.toast::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 14px;
  filter: blur(20px);
  opacity: 0.35;
  z-index: -1;
}

.toast-success {
  background: rgba(16, 185, 129, 0.12);
  color: #059669;
  box-shadow: 0 8px 24px rgba(16, 185, 129, 0.15);
}
.toast-success::before { background: var(--success); }

.toast-error {
  background: rgba(239, 68, 68, 0.12);
  color: #DC2626;
  box-shadow: 0 8px 24px rgba(239, 68, 68, 0.15);
}
.toast-error::before { background: var(--error); }

.toast-warning {
  background: rgba(245, 158, 11, 0.12);
  color: #D97706;
  box-shadow: 0 8px 24px rgba(245, 158, 11, 0.15);
}
.toast-warning::before { background: var(--warning); }

.toast-info {
  background: rgba(59, 130, 246, 0.12);
  color: #2563EB;
  box-shadow: 0 8px 24px rgba(59, 130, 246, 0.15);
}
.toast-info::before { background: var(--primary); }

.toast-icon { font-size: 1.15rem; flex-shrink: 0; }
.toast-success .toast-icon { color: #059669; }
.toast-error .toast-icon { color: #DC2626; }
.toast-warning .toast-icon { color: #D97706; }
.toast-info .toast-icon { color: #2563EB; }

@keyframes toastIn {
  from { opacity: 0; transform: translateY(-12px) scale(0.95); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.toast.removing {
  animation: toastOut 0.25s var(--ease-out) forwards;
}

@keyframes toastOut {
  to { opacity: 0; transform: translateY(-12px) scale(0.95); }
}


/* ===== 空状态 ===== */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 48px 20px;
  color: var(--text-sub);
}

.empty-state .empty-icon {
  font-size: 2.5rem;
  opacity: 0.3;
  margin-bottom: 12px;
}

/* ===== 绑定步骤 ===== */
.bind-step { display: none; }
.bind-step.active { display: block; }

/* ===== 全局响应式 ===== */
@media (max-width: 480px) {
  html { font-size: 14px; }

  .card { border-radius: 14px; }

  .modal {
    max-width: none;
    border-radius: 16px;
    margin: 8px;
  }

  .modal-header { padding: 16px; }
  .modal-body { padding: 16px; }
  .modal-footer { padding: 0 16px 16px; }

  .btn { padding: 10px 14px; font-size: 0.8125rem; }
}
