/* ========================================
   ALPHA 炼金协议 - 主样式
   暗黑科技风 | 紫色/蓝青渐变 | 玻璃拟态
   ======================================== */

/* CSS 变量 */
:root {
  --alpha-bg: #0A0A0A;
  --alpha-bg-card: #0D0D0D;
  --alpha-bg-card2: #080808;
  --alpha-border: #1F1F1F;
  --alpha-border-light: #2A2A2A;
  --alpha-accent: #7C3AED;
  --alpha-accent-light: #A855F7;
  --alpha-accent-glow: rgba(124, 58, 237, 0.3);
  --alpha-cyan: #00F0FF;
  --alpha-cyan-glow: rgba(0, 240, 255, 0.2);
  --alpha-green: #10B981;
  --alpha-green-glow: rgba(16, 185, 129, 0.3);
  --alpha-gold: #F0B90B;
  --alpha-gold-glow: rgba(240, 185, 11, 0.3);
  --alpha-text: #E0E0E0;
  --alpha-text-muted: #888;
  --alpha-text-dim: #555;
  --alpha-font: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --alpha-font-mono: 'SF Mono', 'Fira Code', 'Cascadia Code', 'JetBrains Mono', monospace;
}

/* 全局样式 */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--alpha-font);
  background: var(--alpha-bg);
  color: var(--alpha-text);
  min-height: 100vh;
  overflow-x: hidden;
  line-height: 1.5;
}

a {
  color: inherit;
  text-decoration: none;
}

img {
  max-width: 100%;
  height: auto;
}

/* ===== 排版 ===== */
.text-xs { font-size: 0.75rem; }
.text-sm { font-size: 0.875rem; }
.text-base { font-size: 1rem; }
.text-lg { font-size: 1.125rem; }
.text-xl { font-size: 1.25rem; }
.text-2xl { font-size: 1.5rem; }
.text-3xl { font-size: 1.875rem; }

.font-mono { font-family: var(--alpha-font-mono); }
.font-black { font-weight: 900; }
.font-bold { font-weight: 700; }
.uppercase { text-transform: uppercase; }
.tracking-wider { letter-spacing: 0.05em; }
.tracking-widest { letter-spacing: 0.1em; }
.tabular-nums { font-variant-numeric: tabular-nums; }
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-left { text-align: left; }

/* ===== 布局 ===== */
.flex { display: flex; }
.flex-col { flex-direction: column; }
.flex-1 { flex: 1; }
.flex-wrap { flex-wrap: wrap; }
.items-center { align-items: center; }
.items-start { align-items: flex-start; }
.items-end { align-items: flex-end; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.gap-1 { gap: 0.25rem; }
.gap-2 { gap: 0.5rem; }
.gap-3 { gap: 0.75rem; }
.gap-4 { gap: 1rem; }
.gap-6 { gap: 1.5rem; }
.gap-8 { gap: 2rem; }

.w-full { width: 100%; }
.w-max { width: max-content; }
.h-full { height: 100%; }
.min-h-screen { min-height: 100vh; }

.relative { position: relative; }
.absolute { position: absolute; }
.fixed { position: fixed; }
.inset-0 { top: 0; right: 0; bottom: 0; left: 0; }
.z-0 { z-index: 0; }
.z-10 { z-index: 10; }
.z-50 { z-index: 50; }
.z-100 { z-index: 100; }

.px-4 { padding-left: 1rem; padding-right: 1rem; }
.px-6 { padding-left: 1.5rem; padding-right: 1.5rem; }
.px-8 { padding-left: 2rem; padding-right: 2rem; }
.py-2 { padding-top: 0.5rem; padding-bottom: 0.5rem; }
.py-3 { padding-top: 0.75rem; padding-bottom: 0.75rem; }
.py-4 { padding-top: 1rem; padding-bottom: 1rem; }
.py-5 { padding-top: 1.25rem; padding-bottom: 1.25rem; }
.py-6 { padding-top: 1.5rem; padding-bottom: 1.5rem; }
.py-8 { padding-top: 2rem; padding-bottom: 2rem; }
.py-16 { padding-top: 4rem; padding-bottom: 4rem; }
.p-4 { padding: 1rem; }
.p-5 { padding: 1.25rem; }
.p-6 { padding: 1.5rem; }

.mx-auto { margin-left: auto; margin-right: auto; }
.mt-2 { margin-top: 0.5rem; }
.mt-4 { margin-top: 1rem; }
.mt-6 { margin-top: 1.5rem; }
.mt-8 { margin-top: 2rem; }
.mt-12 { margin-top: 3rem; }
.mt-16 { margin-top: 4rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-4 { margin-bottom: 1rem; }
.mb-6 { margin-bottom: 1.5rem; }
.mb-8 { margin-bottom: 2rem; }

.hidden { display: none; }
.block { display: block; }
.inline-block { display: inline-block; }
.inline-flex { display: inline-flex; }
.shrink-0 { flex-shrink: 0; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.overflow-hidden { overflow: hidden; }
.whitespace-nowrap { white-space: nowrap; }
.break-words { word-break: break-word; }

/* ===== 容器 ===== */
.container {
  max-width: 1280px;
  margin: 0 auto;
}

/* ===== 裁剪效果（切角） ===== */
.clip-angle {
  clip-path: polygon(8px 0%, 100% 0%, 100% calc(100% - 8px), calc(100% - 8px) 100%, 0% 100%, 0% 8px);
}

.clip-angle-sm {
  clip-path: polygon(5px 0%, 100% 0%, 100% calc(100% - 5px), calc(100% - 5px) 100%, 0% 100%, 0% 5px);
}

.clip-angle-lg {
  clip-path: polygon(12px 0%, 100% 0%, 100% calc(100% - 12px), calc(100% - 12px) 100%, 0% 100%, 0% 12px);
}

/* ===== 按钮 ===== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-weight: 900;
  text-transform: uppercase;
  cursor: pointer;
  border: 2px solid transparent;
  transition: all 0.2s ease;
  white-space: nowrap;
  font-size: 0.75rem;
  letter-spacing: 0.1em;
}

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

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

/* 主按钮 - 紫色渐变 */
.btn-primary {
  background: linear-gradient(135deg, #7C3AED, #A855F7);
  color: #FFF;
  border-color: #7C3AED;
  box-shadow: 0 0 20px rgba(124, 58, 237, 0.3);
}

.btn-primary:hover:not(:disabled) {
  box-shadow: 0 0 30px rgba(124, 58, 237, 0.5);
  filter: brightness(1.1);
}

/* 绿色按钮 - 收益/领取 */
.btn-success {
  background: linear-gradient(90deg, #10B981, #34D399);
  color: #FFF;
  border-color: #10B981;
  box-shadow: 0 0 20px rgba(16, 185, 129, 0.3);
}

.btn-success:hover:not(:disabled) {
  box-shadow: 0 0 30px rgba(16, 185, 129, 0.5);
  filter: brightness(1.1);
}

/* 幽灵按钮 */
.btn-ghost {
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(12px);
  border: 2px solid var(--alpha-border);
  color: var(--alpha-text);
}

.btn-ghost:hover:not(:disabled) {
  border-color: var(--alpha-accent);
  color: var(--alpha-accent-light);
}

/* 连接钱包按钮 */
.btn-connect {
  background: var(--alpha-accent);
  color: #FFF;
  border: 2px solid var(--alpha-accent);
  box-shadow: 0 0 20px rgba(124, 58, 237, 0.3);
  animation: pulse-glow 2s ease-in-out infinite;
}

.btn-connect:hover:not(:disabled) {
  box-shadow: 0 0 30px rgba(124, 58, 237, 0.5);
  filter: brightness(1.15);
}

@keyframes pulse-glow {
  0%, 100% { box-shadow: 0 0 20px rgba(124, 58, 237, 0.3); }
  50% { box-shadow: 0 0 30px rgba(124, 58, 237, 0.5); }
}

/* 尺寸 */
.btn-sm { height: 2.25rem; padding: 0 1rem; font-size: 0.7rem; }
.btn-md { height: 2.75rem; padding: 0 1.5rem; font-size: 0.75rem; }
.btn-lg { height: 3.25rem; padding: 0 2rem; font-size: 0.85rem; }

/* ===== 卡片 ===== */
.card {
  background: var(--alpha-bg-card);
  border: 1px solid var(--alpha-border);
}

.card-glow {
  background: var(--alpha-bg-card);
  border: 1px solid var(--alpha-border);
  box-shadow: 0 0 30px rgba(124, 58, 237, 0.05);
}

.card-glass {
  background: rgba(13, 13, 13, 0.8);
  backdrop-filter: blur(16px);
  border: 1px solid rgba(124, 58, 237, 0.15);
}

/* 嵌套边框效果 */
.card-framed {
  background: var(--alpha-border);
  padding: 1px;
}

.card-framed > .card-inner {
  background: var(--alpha-bg-card);
  padding: 1.25rem;
}

/* 信息行 */
.info-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.625rem 1rem;
  border-bottom: 1px solid var(--alpha-border);
}

.info-row:last-child {
  border-bottom: none;
}

.info-label {
  font-size: 0.75rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: #BBB;
}

.info-value {
  font-size: 0.75rem;
  font-weight: 900;
  font-family: var(--alpha-font-mono);
  font-variant-numeric: tabular-nums;
  color: #FFF;
}

/* ===== 输入框 ===== */
.input-group {
  position: relative;
}

.input-group input {
  width: 100%;
  height: 3.5rem;
  background: var(--alpha-bg-card2);
  border: 1px solid var(--alpha-border);
  padding: 0 1.25rem;
  font-size: 1.5rem;
  font-weight: 900;
  font-family: var(--alpha-font-mono);
  font-variant-numeric: tabular-nums;
  color: var(--alpha-text);
  outline: none;
  transition: border-color 0.2s;
}

.input-group input:focus {
  border-color: rgba(124, 58, 237, 0.4);
}

.input-group input::placeholder {
  color: #222;
}

.input-max-btn {
  position: absolute;
  right: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  padding: 0.25rem 0.75rem;
  background: rgba(124, 58, 237, 0.1);
  border: 1px solid rgba(124, 58, 237, 0.2);
  color: var(--alpha-accent-light);
  font-size: 0.7rem;
  font-weight: 900;
  text-transform: uppercase;
  cursor: pointer;
  transition: all 0.2s;
}

.input-max-btn:hover {
  background: rgba(124, 58, 237, 0.2);
}

/* 快速金额按钮 */
.amount-btn {
  flex: 1;
  padding: 0.6rem 0;
  font-size: 0.75rem;
  font-weight: 900;
  font-family: var(--alpha-font-mono);
  border: 1px solid var(--alpha-border);
  background: transparent;
  color: #DDD;
  cursor: pointer;
  transition: all 0.2s;
}

.amount-btn:hover {
  border-color: rgba(124, 58, 237, 0.3);
  background: rgba(124, 58, 237, 0.05);
  color: var(--alpha-accent-light);
}

.amount-btn.active {
  border-color: var(--alpha-accent);
  background: rgba(124, 58, 237, 0.1);
  color: var(--alpha-accent-light);
}

/* ===== 进度条 ===== */
.progress-bar {
  width: 100%;
  height: 6px;
  background: var(--alpha-border);
  border-radius: 3px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--alpha-accent), var(--alpha-cyan));
  border-radius: 3px;
  transition: width 0.5s ease;
}

/* ===== 顶栏 ===== */
.header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 100;
  background: transparent;
  transition: all 0.3s ease;
}

.header.scrolled {
  background: rgba(10, 10, 10, 0.95);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--alpha-border);
}

.header-inner {
  max-width: 1280px;
  margin: 0 auto;
  height: 5rem;
  padding: 0 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* Logo */
.logo {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.logo-icon {
  width: 3rem;
  height: 3rem;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--alpha-bg-card);
  border: 2px solid var(--alpha-border);
  clip-path: polygon(15% 0%, 100% 0%, 100% 85%, 85% 100%, 0% 100%, 0% 15%);
  transition: all 0.3s;
}

.logo:hover .logo-icon {
  border-color: var(--alpha-accent);
}

.logo-text {
  font-size: 1.75rem;
  font-weight: 900;
  color: #FFF;
  letter-spacing: -0.02em;
  line-height: 1;
  text-shadow: 2px 2px 0 var(--alpha-accent), -1px -1px 0 rgba(0, 240, 255, 0.33);
  transition: all 0.3s;
}

.logo:hover .logo-text {
  text-shadow: 4px 4px 0 var(--alpha-accent);
}

/* ===== Hero ===== */
.hero {
  position: relative;
  width: 100%;
  min-height: 90vh;
  display: flex;
  align-items: center;
  overflow: hidden;
}

.hero-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
}

.hero-bg img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

.hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(10, 10, 10, 0.7), rgba(10, 10, 10, 0.3));
}

.hero-content {
  position: relative;
  z-index: 10;
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 1.5rem;
  width: 100%;
}

.hero-grid {
  display: flex;
  flex-direction: column;
  gap: 3rem;
  padding: 6rem 0 4rem;
}

@media (min-width: 1024px) {
  .hero-grid {
    flex-direction: row;
    align-items: center;
    padding: 8rem 0 5rem;
  }
}

.hero-left {
  flex: 1;
  text-align: center;
}

@media (min-width: 1024px) {
  .hero-left {
    text-align: left;
  }
}

.hero-title {
  font-weight: 900;
  text-transform: uppercase;
  color: #FFF;
  line-height: 1.2;
}

.hero-title .accent {
  color: var(--alpha-accent-light);
  text-shadow: 0 0 20px rgba(124, 58, 237, 0.5);
  display: block;
  margin: 0.5rem 0;
}

.hero-subtitle {
  color: var(--alpha-text-muted);
  font-weight: 700;
  font-family: var(--alpha-font-mono);
  max-width: 500px;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.8);
  margin-top: 1rem;
}

.hero-actions {
  display: flex;
  gap: 1rem;
  margin-top: 2rem;
  justify-content: center;
}

@media (min-width: 640px) {
  .hero-actions {
    justify-content: flex-start;
  }
}

/* 质押面板 */
.stake-panel {
  flex: 1;
  max-width: 480px;
  margin: 0 auto;
}

/* ===== 运营面板 ===== */
.stake-card {
  background: var(--alpha-bg-card);
  border: 1px solid var(--alpha-border);
  padding: 1.5rem;
}

.stake-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
}

.stake-header h3 {
  font-size: 0.8rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: var(--alpha-cyan);
}

/* ===== 跑马灯 ===== */
.marquee {
  overflow: hidden;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  padding: 1rem 0;
}

.marquee-inner {
  display: flex;
  width: max-content;
  animation: marquee-scroll 40s linear infinite;
}

.marquee-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0 2rem;
  font-weight: 900;
  text-transform: uppercase;
  white-space: nowrap;
  font-size: 1.1rem;
  color: var(--alpha-text-muted);
}

.marquee-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
}

@keyframes marquee-scroll {
  0% { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

/* ===== 底部 ===== */
.footer {
  background: var(--alpha-bg);
  border-top: 1px solid var(--alpha-border-light);
  padding: 3rem 1.5rem;
  text-align: center;
}

.footer-logo {
  font-size: 1.5rem;
  font-weight: 900;
  color: #FFF;
  letter-spacing: 0.1em;
  margin-bottom: 0.5rem;
}

.footer-text {
  font-size: 0.75rem;
  color: var(--alpha-text-muted);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

/* ===== 响应式 ===== */
@media (max-width: 639px) {
  .hide-mobile { display: none !important; }
  .hero-title { font-size: 1.5rem; }
  .hero-title .accent { font-size: 1.3rem; }
  .stake-panel { max-width: 100%; }
  .header-inner { height: 4rem; padding: 0 1rem; }
  .logo-text { font-size: 1.3rem; }
}

@media (min-width: 640px) and (max-width: 1023px) {
  .hide-tablet { display: none !important; }
  .hero-title { font-size: 2rem; }
  .hero-title .accent { font-size: 1.8rem; }
}

@media (min-width: 1024px) {
  .hide-desktop { display: none !important; }
  .hero-title { font-size: 3rem; }
  .hero-title .accent { font-size: 2.5rem; }
}

/* ===== 动画 ===== */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.animate-fade-in {
  animation: fadeIn 0.5s ease forwards;
}

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

.loading-spinner {
  width: 20px;
  height: 20px;
  border: 2px solid rgba(255, 255, 255, 0.1);
  border-top-color: var(--alpha-accent-light);
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

/* ===== 工具类 ===== */
.text-accent { color: var(--alpha-accent-light); }
.text-cyan { color: var(--alpha-cyan); }
.text-green { color: var(--alpha-green); }
.text-gold { color: var(--alpha-gold); }
.text-muted { color: var(--alpha-text-muted); }
.text-dim { color: var(--alpha-text-dim); }

.bg-accent { background: var(--alpha-accent); }
.border-accent { border-color: var(--alpha-accent); }

/* Neon text shadow */
.text-neon {
  text-shadow: 2px 2px 0 var(--alpha-accent), -1px -1px 0 rgba(0, 240, 255, 0.33);
}

/* 连接钱包 modal */
.wallet-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  z-index: 200;
  display: none;
  align-items: center;
  justify-content: center;
}

.wallet-modal-overlay.active {
  display: flex;
}

.wallet-modal {
  background: #1A1B1F;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 24px;
  padding: 1.5rem;
  width: 90%;
  max-width: 400px;
  max-height: 90vh;
  overflow-y: auto;
}

.wallet-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.wallet-modal-header h2 {
  font-size: 1.1rem;
  font-weight: 700;
  color: #FFF;
}

.wallet-close-btn {
  background: rgba(255, 255, 255, 0.08);
  border: none;
  color: rgba(224, 232, 255, 0.6);
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
}

.wallet-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.wallet-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem;
  background: rgba(224, 232, 255, 0.05);
  border: 1px solid transparent;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.2s;
  color: #FFF;
}

.wallet-item:hover {
  background: rgba(224, 232, 255, 0.1);
  border-color: rgba(124, 58, 237, 0.3);
}

.wallet-item img {
  width: 2rem;
  height: 2rem;
  border-radius: 8px;
}

.wallet-item .name {
  font-weight: 600;
  font-size: 0.9rem;
}

/* ===== 通知/Toast ===== */
.toast {
  position: fixed;
  top: 1.5rem;
  right: 1.5rem;
  z-index: 300;
  padding: 0.75rem 1.25rem;
  border-radius: 8px;
  font-size: 0.85rem;
  font-weight: 600;
  display: none;
  max-width: 360px;
}

.toast.show { display: block; }
.toast.success { background: rgba(16, 185, 129, 0.9); color: #FFF; }
.toast.error { background: rgba(239, 68, 68, 0.9); color: #FFF; }
.toast.info { background: rgba(124, 58, 237, 0.9); color: #FFF; }

/* ===== 订单卡片 ===== */
.order-card {
  background: var(--alpha-bg-card);
  border: 1px solid var(--alpha-border);
  margin-bottom: 0.75rem;
}

.order-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--alpha-border);
}

.status-badge {
  padding: 0.15rem 0.5rem;
  font-size: 0.65rem;
  font-weight: 900;
  text-transform: uppercase;
  border-radius: 2px;
}

.status-active { background: rgba(16, 185, 129, 0.15); color: var(--alpha-green); border: 1px solid rgba(16, 185, 129, 0.2); }
.status-pending { background: rgba(240, 185, 11, 0.15); color: var(--alpha-gold); border: 1px solid rgba(240, 185, 11, 0.2); }
.status-expired { background: rgba(239, 68, 68, 0.15); color: #EF4444; border: 1px solid rgba(239, 68, 68, 0.2); }
