/* ─────────────────────────────────────────────────
   履约通 Settlement Connect — V33 Teal 设计系统
   MC-Revolution V33.1 配色范式
   品牌主色: #5DC4B3 (Teal-500)
   主色浅:   #7DD4C7 (Teal-400)
   主色深:   #3D8F83 (Teal-700)
   强调色:   #49A89A (Teal-600)
   ───────────────────────────────────────────────── */

/* ── CSS Design Tokens ── */
:root {
  /* V33 Teal Brand */
  --color-primary: #5DC4B3;
  --color-primary-light: #7DD4C7;
  --color-primary-dark: #3D8F83;
  --color-accent: #49A89A;

  /* Functional */
  --color-cyan: #32ADE6;
  --color-emerald: #34C759;
  --color-amber: #FF9F0A;
  --color-rose: #FF375F;

  /* Text */
  --text-primary: #1d1d1f;
  --text-secondary: #6e6e73;
  --text-tertiary: #86868b;

  /* Background */
  --bg-page: #f5f5f7;
  --bg-card: rgba(255,255,255,0.65);

  /* Border */
  --border-default: rgba(0,0,0,0.06);
  --border-input: rgba(0,0,0,0.12);

  /* Shadow */
  --shadow-sm: 0 1px 3px rgba(0,0,0,.06), 0 2px 8px rgba(0,0,0,.04);
  --shadow-md: 0 2px 4px rgba(0,0,0,.04), 0 8px 24px rgba(0,0,0,.06);

  /* Radius */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;
  --radius-2xl: 24px;

  /* Gradients */
  --gradient-primary: linear-gradient(135deg, #5DC4B3 0%, #49A89A 100%);
  --gradient-cyber: linear-gradient(135deg, #0a2e2a 0%, #0f3d36 50%, #164e47 100%);
  --gradient-neon: linear-gradient(135deg, #32ade6 0%, #5DC4B3 40%, #49A89A 70%, #3D8F83 100%);
  --gradient-aurora: linear-gradient(135deg, #0a2e2a 0%, #0f3d36 25%, #0c3530 50%, #164e47 75%, #1a6b5f 100%);
}

/* ── Base Reset ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; scroll-behavior: smooth; }
body { font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'SF Pro Text', 'Helvetica Neue', 'PingFang SC', 'Noto Sans SC', sans-serif; color: var(--text-primary); background: var(--bg-page); line-height: 1.5; }

/* ── Transitions 280ms ── */
a, button, input, select, .sc-transition { transition: all 280ms cubic-bezier(0.25, 0.1, 0.25, 1); }

/* ── Glassmorphism ── */
.glass { background: rgba(255, 255, 255, 0.72); backdrop-filter: blur(20px) saturate(180%); -webkit-backdrop-filter: blur(20px) saturate(180%); }
.glass-card { background: var(--bg-card); backdrop-filter: blur(16px) saturate(160%); -webkit-backdrop-filter: blur(16px) saturate(160%); border: 1px solid rgba(255, 255, 255, 0.45); border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); }
.glass-card:hover { box-shadow: var(--shadow-md); transform: translateY(-1px); }

/* ── Navbar (56px fixed, glassmorphism, bottom divider) ── */
.sc-navbar { position: fixed; top: 0; left: 0; right: 0; z-index: 100; height: 56px; display: flex; align-items: center; padding: 0 24px; background: rgba(255, 255, 255, 0.72); backdrop-filter: blur(20px) saturate(180%); -webkit-backdrop-filter: blur(20px) saturate(180%); border-bottom: 0.5px solid rgba(0, 0, 0, 0.09); }
.sc-navbar-inner { width: 100%; max-width: 1280px; margin: 0 auto; display: flex; align-items: center; justify-content: space-between; }

/* ══════════════════════════════════════════════════
   Footer — V33 Aurora Teal 渐变
   ══════════════════════════════════════════════════ */
.sc-footer {
  background: var(--gradient-aurora);
  color: rgba(255, 255, 255, 0.7);
  padding: 40px 24px 24px;
  position: relative;
  overflow: hidden;
}
.sc-footer::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -20%;
  width: 140%;
  height: 200%;
  background:
    radial-gradient(ellipse at 30% 50%, rgba(93,196,179,0.15) 0%, transparent 60%),
    radial-gradient(ellipse at 70% 30%, rgba(125,212,199,0.10) 0%, transparent 50%);
  pointer-events: none;
  animation: aurora 12s ease-in-out infinite alternate;
}
@keyframes aurora { 0% { transform: translate(0, 0) rotate(0deg); } 100% { transform: translate(2%, -3%) rotate(1deg); } }

/* ── Content wrapper ── */
.sc-content { max-width: 1280px; margin: 0 auto; padding: 80px 24px 40px; min-height: calc(100vh - 140px); }

/* ── Brand colors ── */
.sc-brand { color: var(--color-primary); }
.sc-brand-bg { background-color: var(--color-primary); }
.sc-brand-bg-light { background-color: rgba(93, 196, 179, 0.1); }

/* ── StatusBadge ── */
.badge { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 100px; font-size: 12px; font-weight: 500; line-height: 1.4; }
.badge::before { content: ''; width: 6px; height: 6px; border-radius: 50%; flex-shrink: 0; }
.badge-active { background: rgba(93, 196, 179, 0.12); color: #3a9e8f; }
.badge-active::before { background: #5DC4B3; }
.badge-pending { background: rgba(255, 159, 10, 0.12); color: #c78520; }
.badge-pending::before { background: #FF9F0A; }
.badge-completed { background: rgba(52, 199, 89, 0.12); color: #248a3d; }
.badge-completed::before { background: #34C759; }
.badge-failed { background: rgba(255, 55, 95, 0.12); color: #d70015; }
.badge-failed::before { background: #FF375F; }
.badge-frozen { background: rgba(50, 173, 230, 0.12); color: #2196c8; }
.badge-frozen::before { background: #32ADE6; }
.badge-closed { background: rgba(142, 142, 147, 0.12); color: #6e6e73; }
.badge-closed::before { background: #8e8e93; }
.badge-matched { background: rgba(52, 199, 89, 0.12); color: #248a3d; }
.badge-matched::before { background: #34C759; }
.badge-unmatched { background: rgba(255, 149, 0, 0.12); color: #c25700; }
.badge-unmatched::before { background: #FF9500; }
.badge-partial { background: rgba(93, 196, 179, 0.12); color: #3D8F83; }
.badge-partial::before { background: #49A89A; }
.badge-exception { background: rgba(255, 55, 95, 0.12); color: #d70015; }
.badge-exception::before { background: #FF375F; }

/* ── DataTable ── */
.sc-table-wrap { overflow-x: auto; border-radius: var(--radius-md); border: 0.5px solid var(--border-default); }
.sc-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.sc-table thead { background: rgba(0,0,0,0.02); }
.sc-table th { padding: 12px 16px; text-align: left; font-weight: 600; font-size: 12px; text-transform: uppercase; letter-spacing: 0.03em; color: var(--text-secondary); border-bottom: 0.5px solid rgba(0,0,0,0.08); white-space: nowrap; cursor: pointer; user-select: none; }
.sc-table th:hover { color: var(--text-primary); }
.sc-table th .sort-icon { display: inline-block; margin-left: 4px; opacity: 0.4; transition: opacity 280ms, transform 280ms; }
.sc-table th.sorted .sort-icon { opacity: 1; color: var(--color-primary); }
.sc-table th.sorted.desc .sort-icon { transform: rotate(180deg); }
.sc-table td { padding: 12px 16px; border-bottom: 0.5px solid rgba(0,0,0,0.04); vertical-align: middle; }
.sc-table tbody tr { transition: background 280ms; }
.sc-table tbody tr:hover { background: rgba(93, 196, 179, 0.04); }
.sc-table tbody tr:last-child td { border-bottom: none; }

/* ── Pagination ── */
.sc-pagination { display: flex; align-items: center; justify-content: space-between; padding: 12px 16px; font-size: 13px; color: var(--text-secondary); flex-wrap: wrap; gap: 8px; }
.sc-pagination button { display: inline-flex; align-items: center; justify-content: center; min-width: 32px; height: 32px; padding: 0 10px; border: 0.5px solid rgba(0,0,0,0.1); border-radius: var(--radius-sm); background: white; color: var(--text-primary); font-size: 13px; cursor: pointer; transition: all 280ms; }
.sc-pagination button:hover:not(:disabled) { border-color: var(--color-primary); color: var(--color-primary); }
.sc-pagination button:disabled { opacity: 0.35; cursor: not-allowed; }
.sc-pagination button.active { background: var(--color-primary); color: white; border-color: var(--color-primary); }

/* ── FilterBar ── */
.sc-filter-bar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 16px 0; }
.sc-filter-bar select, .sc-filter-bar input { height: 36px; padding: 0 12px; border: 0.5px solid var(--border-input); border-radius: var(--radius-sm); background: white; font-size: 13px; color: var(--text-primary); outline: none; transition: border-color 280ms, box-shadow 280ms; font-family: inherit; }
.sc-filter-bar select:focus, .sc-filter-bar input:focus { border-color: var(--color-primary); box-shadow: 0 0 0 3px rgba(93, 196, 179, 0.15); }
.sc-filter-bar input { min-width: 200px; }
.sc-btn { display: inline-flex; align-items: center; gap: 6px; height: 36px; padding: 0 16px; border: none; border-radius: var(--radius-sm); font-size: 13px; font-weight: 500; cursor: pointer; transition: all 280ms; font-family: inherit; }
.sc-btn-primary { background: var(--gradient-primary); color: white; }
.sc-btn-primary:hover { box-shadow: 0 2px 12px rgba(93,196,179,0.35); transform: translateY(-0.5px); }
.sc-btn-secondary { background: rgba(0,0,0,0.04); color: var(--text-primary); border: 0.5px solid rgba(0,0,0,0.1); }
.sc-btn-secondary:hover { background: rgba(0,0,0,0.08); }
.sc-btn-ghost { background: transparent; color: var(--color-primary); }
.sc-btn-ghost:hover { background: rgba(93,196,179,0.08); }
.sc-btn-danger { background: rgba(255,55,95,0.1); color: #d70015; }
.sc-btn-danger:hover { background: rgba(255,55,95,0.18); }

/* ── Modal ── */
.sc-modal-overlay { position: fixed; inset: 0; z-index: 200; background: rgba(0,0,0,0.4); backdrop-filter: blur(4px); display: flex; align-items: center; justify-content: center; opacity: 0; pointer-events: none; transition: opacity 280ms; }
.sc-modal-overlay.open { opacity: 1; pointer-events: auto; }
.sc-modal { background: white; border-radius: var(--radius-lg); box-shadow: 0 24px 80px rgba(0,0,0,0.16); max-width: 520px; width: 90%; max-height: 85vh; overflow: hidden; transform: scale(0.96) translateY(8px); transition: transform 280ms; }
.sc-modal-overlay.open .sc-modal { transform: scale(1) translateY(0); }
.sc-modal-header { display: flex; align-items: center; justify-content: space-between; padding: 20px 24px 16px; border-bottom: 0.5px solid var(--border-default); }
.sc-modal-header h3 { font-size: 17px; font-weight: 600; }
.sc-modal-close { width: 28px; height: 28px; border-radius: 50%; border: none; background: rgba(0,0,0,0.06); cursor: pointer; display: flex; align-items: center; justify-content: center; font-size: 14px; color: var(--text-secondary); transition: all 280ms; }
.sc-modal-close:hover { background: rgba(0,0,0,0.12); }
.sc-modal-body { padding: 20px 24px; overflow-y: auto; max-height: 60vh; }
.sc-modal-footer { display: flex; align-items: center; justify-content: flex-end; gap: 10px; padding: 16px 24px 20px; border-top: 0.5px solid var(--border-default); }

/* ── Drawer ── */
.sc-drawer-overlay { position: fixed; inset: 0; z-index: 200; background: rgba(0,0,0,0.4); backdrop-filter: blur(4px); opacity: 0; pointer-events: none; transition: opacity 280ms; }
.sc-drawer-overlay.open { opacity: 1; pointer-events: auto; }
.sc-drawer { position: fixed; top: 0; right: 0; bottom: 0; z-index: 201; width: min(540px, 90vw); background: white; box-shadow: -8px 0 40px rgba(0,0,0,0.12); transform: translateX(100%); transition: transform 280ms cubic-bezier(0.25, 0.1, 0.25, 1); display: flex; flex-direction: column; }
.sc-drawer-overlay.open + .sc-drawer, .sc-drawer.open { transform: translateX(0); }
.sc-drawer-header { display: flex; align-items: center; justify-content: space-between; padding: 20px 24px; border-bottom: 0.5px solid var(--border-default); flex-shrink: 0; }
.sc-drawer-header h3 { font-size: 17px; font-weight: 600; }
.sc-drawer-body { flex: 1; overflow-y: auto; padding: 24px; }
.sc-drawer-footer { padding: 16px 24px; border-top: 0.5px solid var(--border-default); flex-shrink: 0; }

/* ── Toast ── */
.sc-toast-container { position: fixed; top: 72px; right: 24px; z-index: 300; display: flex; flex-direction: column; gap: 8px; pointer-events: none; }
.sc-toast { display: flex; align-items: center; gap: 10px; padding: 12px 20px; border-radius: var(--radius-md); font-size: 14px; font-weight: 500; box-shadow: 0 4px 24px rgba(0,0,0,0.12); pointer-events: auto; transform: translateX(120%); transition: transform 280ms; background: white; }
.sc-toast.show { transform: translateX(0); }
.sc-toast-success { border-left: 3px solid #34C759; }
.sc-toast-error { border-left: 3px solid #FF375F; }
.sc-toast-warning { border-left: 3px solid #FF9F0A; }
.sc-toast-info { border-left: 3px solid var(--color-primary); color: var(--color-primary); }

/* ── Stats Card ── */
.stat-card { padding: 20px; }
.stat-value { font-size: 28px; font-weight: 700; letter-spacing: -0.02em; color: var(--text-primary); }
.stat-label { font-size: 13px; color: var(--text-secondary); margin-top: 4px; }
.stat-icon { width: 40px; height: 40px; border-radius: 10px; display: flex; align-items: center; justify-content: center; font-size: 18px; }

/* ── Progress Bar ── */
.sc-progress { height: 6px; background: rgba(0,0,0,0.06); border-radius: 3px; overflow: hidden; }
.sc-progress-bar { height: 100%; border-radius: 3px; transition: width 600ms cubic-bezier(0.25, 0.1, 0.25, 1); }

/* ── Loading Skeleton ── */
.skeleton { background: linear-gradient(90deg, rgba(0,0,0,0.06) 25%, rgba(0,0,0,0.04) 50%, rgba(0,0,0,0.06) 75%); background-size: 200% 100%; animation: shimmer 1.5s infinite; border-radius: var(--radius-sm); }
@keyframes shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }

/* ── Empty State ── */
.sc-empty { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 60px 24px; text-align: center; }
.sc-empty-icon { width: 80px; height: 80px; border-radius: var(--radius-xl); background: rgba(93,196,179,0.08); display: flex; align-items: center; justify-content: center; font-size: 32px; margin-bottom: 16px; }

/* ── Error State ── */
.sc-error { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 60px 24px; text-align: center; }

/* ── Responsive ── */
@media (max-width: 768px) {
  .sc-content { padding: 72px 16px 24px; }
  .sc-navbar { padding: 0 16px; }
  .stat-value { font-size: 22px; }
  .sc-drawer { width: 100vw; }
  .sc-table { font-size: 13px; }
  .sc-table th, .sc-table td { padding: 10px 12px; }
}

/* ── Focus visible for keyboard users ── */
:focus-visible { outline: 2px solid var(--color-primary); outline-offset: 2px; border-radius: 4px; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible { outline: 2px solid var(--color-primary); outline-offset: 2px; }

/* ── Skip to content link for a11y ── */
.skip-link { position: absolute; top: -100%; left: 16px; z-index: 999; padding: 8px 16px; background: var(--color-primary); color: white; border-radius: var(--radius-sm); font-size: 14px; text-decoration: none; }
.skip-link:focus { top: 8px; }

/* ── Info pairs ── */
.info-pair { display: flex; justify-content: space-between; padding: 10px 0; border-bottom: 0.5px solid rgba(0,0,0,0.04); font-size: 14px; }
.info-pair:last-child { border-bottom: none; }
.info-label { color: var(--text-secondary); }
.info-value { color: var(--text-primary); font-weight: 500; text-align: right; }

/* ── Nav links ── */
.nav-link { font-size: 14px; font-weight: 500; color: var(--text-secondary); text-decoration: none; padding: 6px 12px; border-radius: 6px; }
.nav-link:hover { color: var(--text-primary); background: rgba(0,0,0,0.04); }
.nav-link.active { color: var(--color-primary); }

/* ── Tab bar ── */
.sc-tabs { display: flex; gap: 4px; border-bottom: 0.5px solid rgba(0,0,0,0.08); margin-bottom: 24px; }
.sc-tab { padding: 10px 16px; font-size: 14px; font-weight: 500; color: var(--text-secondary); border: none; background: none; cursor: pointer; border-bottom: 2px solid transparent; transition: all 280ms; }
.sc-tab:hover { color: var(--text-primary); }
.sc-tab.active { color: var(--color-primary); border-bottom-color: var(--color-primary); }


/* ══════════════════════════════════════════════════
   V33 Login Page — 暗色 Teal 背景 + 白色卡片
   对标合约通 Contract Connect v33 登录页
   ══════════════════════════════════════════════════ */

.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  background: linear-gradient(135deg, #0a2e2a 0%, #0f3d36 30%, #164e47 60%, #0a2e2a 100%);
  font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'SF Pro Text', 'Helvetica Neue', 'PingFang SC', 'Noto Sans SC', sans-serif;
}

/* 暗色背景层 */
.login-bg {
  position: fixed;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}

/* 网格线 — 微妙的 Teal 网格 */
.login-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(93,196,179,0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(93,196,179,0.04) 1px, transparent 1px);
  background-size: 60px 60px;
  opacity: 0.6;
}

/* 光晕球 — 柔和的 Teal 径向渐变 */
.login-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(100px);
  animation: orbFloat 10s ease-in-out infinite;
}
.login-orb-1 {
  top: -10%;
  right: -8%;
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, rgba(93,196,179,0.18) 0%, rgba(73,168,154,0.06) 50%, transparent 70%);
  animation-duration: 12s;
}
.login-orb-2 {
  bottom: -15%;
  left: -12%;
  width: 550px;
  height: 550px;
  background: radial-gradient(circle, rgba(73,168,154,0.15) 0%, rgba(61,143,131,0.05) 50%, transparent 70%);
  animation-duration: 16s;
  animation-delay: -5s;
}
.login-orb-3 {
  top: 35%;
  left: 55%;
  width: 250px;
  height: 250px;
  background: radial-gradient(circle, rgba(125,212,199,0.12) 0%, transparent 60%);
  animation-duration: 14s;
  animation-delay: -3s;
}
@keyframes orbFloat {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33% { transform: translate(15px, -25px) scale(1.03); }
  66% { transform: translate(-10px, 15px) scale(0.97); }
}

/* Logo 脉冲光晕 */
.login-logo-pulse {
  display: inline-flex;
  position: relative;
}
.login-logo-pulse::before {
  content: '';
  position: absolute;
  inset: -12px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(93,196,179,0.35) 0%, transparent 70%);
  animation: logoPulse 4s ease-in-out infinite;
}
@keyframes logoPulse {
  0%, 100% { opacity: 0.3; transform: scale(1); }
  50% { opacity: 0.7; transform: scale(1.12); }
}

/* ── 白色登录卡片 (对标合约通) ── */
.login-white-card {
  background: white;
  border-radius: 20px;
  padding: 32px 28px;
  box-shadow:
    0 8px 40px rgba(0,0,0,0.15),
    0 2px 8px rgba(0,0,0,0.06);
  position: relative;
  overflow: hidden;
}
.login-white-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, #5DC4B3, #49A89A, #7DD4C7);
  border-radius: 20px 20px 0 0;
}

/* ── 表单输入框 (白色卡片内) ── */
.login-form-input {
  width: 100%;
  height: 48px;
  padding: 0 16px;
  border-radius: 12px;
  border: 1.5px solid #e5e7eb;
  background: #fafafa;
  color: #1d1d1f;
  font-size: 14px;
  outline: none;
  transition: all 280ms;
  font-family: inherit;
}
.login-form-input::placeholder {
  color: #9ca3af;
}
.login-form-input:focus {
  border-color: #5DC4B3;
  background: white;
  box-shadow: 0 0 0 3px rgba(93,196,179,0.12);
}

/* ── 登录提交按钮 (Teal渐变, 大圆角) ── */
.login-btn-submit {
  width: 100%;
  height: 48px;
  border: none;
  border-radius: 12px;
  background: linear-gradient(135deg, #5DC4B3 0%, #49A89A 100%);
  color: white;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: all 280ms;
  font-family: inherit;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 20px;
}
.login-btn-submit:hover {
  box-shadow: 0 4px 16px rgba(93,196,179,0.35);
  transform: translateY(-1px);
}
.login-btn-submit:active {
  transform: scale(0.98);
}

/* ── Demo 账号卡片 (白色卡片内) ── */
.login-demo-card {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1.5px solid #f0f0f0;
  background: #fafafa;
  cursor: pointer;
  transition: all 280ms;
  font-family: inherit;
}
.login-demo-card:hover {
  border-color: #5DC4B3;
  background: rgba(93,196,179,0.04);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(93,196,179,0.12);
}

/* ── 粒子动画 ── */
.login-particles { position: fixed; inset: 0; pointer-events: none; overflow: hidden; }
.login-particle {
  position: absolute;
  width: 2px;
  height: 2px;
  border-radius: 50%;
  background: rgba(93,196,179,0.35);
  animation: particleFloat linear infinite;
}
.login-particle:nth-child(2n) { background: rgba(73,168,154,0.25); width: 3px; height: 3px; }
.login-particle:nth-child(3n) { background: rgba(125,212,199,0.3); width: 2px; height: 2px; }
@keyframes particleFloat {
  0% { transform: translateY(100vh) rotate(0deg); opacity: 0; }
  10% { opacity: 1; }
  90% { opacity: 1; }
  100% { transform: translateY(-100vh) rotate(720deg); opacity: 0; }
}

/* Login responsive */
@media (max-width: 480px) {
  .login-white-card { padding: 24px 20px; border-radius: 16px; }
  .login-orb-1 { width: 300px; height: 300px; }
  .login-orb-2 { width: 350px; height: 350px; }
}
