/* ============ 设计变量 ============ */
:root {
  --color-bg: #ffffff;
  --color-bg-soft: #f7f8fb;
  --color-bg-dark: #0a0e27;
  --color-text: #1f2937;
  --color-text-soft: #6b7280;
  --color-text-light: #9ca3af;
  --color-border: #e5e7eb;
  --color-border-light: #f3f4f6;

  --color-primary: #3b82f6;
  --color-primary-dark: #2563eb;
  --color-primary-light: #dbeafe;
  --color-accent: #6366f1;
  --color-vip: #f59e0b;
  --color-vip-dark: #d97706;
  --color-success: #10b981;
  --color-danger: #ef4444;

  --gradient-primary: linear-gradient(135deg, #3b82f6 0%, #6366f1 50%, #8b5cf6 100%);
  --gradient-vip: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
  --gradient-dark: linear-gradient(135deg, #0a0e27 0%, #1e293b 100%);

  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.05);
  --shadow-md: 0 4px 12px rgba(15, 23, 42, 0.08);
  --shadow-lg: 0 12px 32px rgba(15, 23, 42, 0.12);
  --shadow-xl: 0 24px 48px rgba(15, 23, 42, 0.16);

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --radius-full: 999px;

  --container: 1200px;
  --header-h: 68px;

  --transition: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ============ 重置 ============ */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  scroll-behavior: smooth;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC',
    'Hiragino Sans GB', 'Microsoft YaHei', 'Helvetica Neue', Helvetica, Arial,
    sans-serif;
  font-size: 15px;
  line-height: 1.65;
  color: var(--color-text);
  background-color: var(--color-bg);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

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

a:hover {
  color: var(--color-primary);
}

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: none;
}

img {
  max-width: 100%;
  display: block;
}

ul,
ol {
  list-style: none;
}

input,
button,
select,
textarea {
  font-family: inherit;
  font-size: inherit;
}

/* ============ 布局工具 ============ */
.container {
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 24px;
}

.flex {
  display: flex;
}

.flex-center {
  display: flex;
  align-items: center;
  justify-content: center;
}

.gap-8 {
  gap: 8px;
}

.gap-12 {
  gap: 12px;
}

.gap-16 {
  gap: 16px;
}

main {
  flex: 1;
}

/* ============ 顶部导航 ============ */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background-color: rgba(255, 255, 255, 0.92);
  backdrop-filter: saturate(160%) blur(12px);
  -webkit-backdrop-filter: saturate(160%) blur(12px);
  border-bottom: 1px solid var(--color-border-light);
}

.site-header .container {
  height: var(--header-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 32px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 17px;
  color: var(--color-text);
  white-space: nowrap;
}

.brand-logo {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  background: var(--gradient-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 800;
  font-size: 16px;
  letter-spacing: -0.5px;
  box-shadow: var(--shadow-md);
}

.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.1;
}

.brand-text small {
  font-size: 11px;
  font-weight: 500;
  color: var(--color-text-light);
  letter-spacing: 1px;
}

.nav-list {
  display: flex;
  align-items: center;
  gap: 4px;
}

.nav-link {
  position: relative;
  display: inline-block;
  padding: 8px 14px;
  font-size: 14px;
  color: var(--color-text-soft);
  border-radius: var(--radius-sm);
  transition: all var(--transition);
}

.nav-link:hover {
  color: var(--color-text);
  background-color: var(--color-bg-soft);
}

.nav-link.active {
  color: var(--color-primary);
  background-color: var(--color-primary-light);
  font-weight: 500;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* ============ 按钮 ============ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 9px 20px;
  font-size: 14px;
  font-weight: 500;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--transition);
  white-space: nowrap;
  border: 1px solid transparent;
}

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

.btn-primary {
  background: var(--gradient-primary);
  color: #fff;
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.25);
}

.btn-primary:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(59, 130, 246, 0.35);
  color: #fff;
}

.btn-vip {
  background: var(--gradient-vip);
  color: #fff;
  box-shadow: 0 4px 12px rgba(245, 158, 11, 0.3);
}

.btn-vip:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(245, 158, 11, 0.4);
  color: #fff;
}

.btn-ghost {
  background: transparent;
  color: var(--color-text-soft);
  border-color: var(--color-border);
}

.btn-ghost:hover:not(:disabled) {
  color: var(--color-text);
  border-color: var(--color-text-soft);
  background-color: var(--color-bg-soft);
}

.btn-text {
  background: transparent;
  color: var(--color-primary);
  padding: 8px 14px;
}

.btn-text:hover:not(:disabled) {
  background-color: var(--color-primary-light);
}

.btn-block {
  width: 100%;
}

.btn-lg {
  padding: 13px 28px;
  font-size: 15px;
}

/* ============ 用户区域 ============ */
.user-area {
  display: flex;
  align-items: center;
  gap: 10px;
}

.user-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 4px 12px 4px 4px;
  background: var(--color-bg-soft);
  border-radius: var(--radius-full);
  font-size: 13px;
  color: var(--color-text);
  border: 1px solid var(--color-border-light);
  transition: all var(--transition);
}

.user-chip:hover {
  border-color: var(--color-primary);
  color: var(--color-text);
}

.user-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--gradient-primary);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 600;
  flex-shrink: 0;
}

.user-avatar.vip {
  background: var(--gradient-vip);
}

.vip-badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 2px 7px;
  background: var(--gradient-vip);
  color: #fff;
  font-size: 11px;
  font-weight: 600;
  border-radius: var(--radius-sm);
  letter-spacing: 0.5px;
}

/* ============ 标签 ============ */
.tag {
  display: inline-block;
  padding: 2px 8px;
  font-size: 11px;
  font-weight: 500;
  border-radius: var(--radius-sm);
  background: var(--color-bg-soft);
  color: var(--color-text-soft);
}

.tag-primary {
  background: var(--color-primary-light);
  color: var(--color-primary-dark);
}

.tag-vip {
  background: rgba(245, 158, 11, 0.1);
  color: var(--color-vip-dark);
}

.tag-hot {
  background: rgba(239, 68, 68, 0.1);
  color: var(--color-danger);
}

/* ============ 页脚 ============ */
.site-footer {
  margin-top: 80px;
  padding: 60px 0 32px;
  background: var(--gradient-dark);
  color: #cbd5e1;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.5fr repeat(3, 1fr);
  gap: 48px;
  padding-bottom: 40px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.footer-brand h3 {
  color: #fff;
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 12px;
}

.footer-brand p {
  font-size: 13px;
  line-height: 1.8;
  color: #94a3b8;
}

.footer-col h4 {
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 16px;
}

.footer-col ul {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.footer-col a,
.footer-col li {
  color: #94a3b8;
  font-size: 13px;
  transition: color var(--transition);
}

.footer-col a:hover {
  color: #fff;
}

.footer-bottom {
  padding-top: 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 12px;
  color: #64748b;
}

.footer-bottom a {
  color: #64748b;
}

.footer-bottom a:hover {
  color: #cbd5e1;
}

/* ============ Toast 提示 ============ */
.toast-container {
  position: fixed;
  top: 80px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}

.toast {
  padding: 12px 20px;
  background: rgba(15, 23, 42, 0.92);
  color: #fff;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  font-size: 13px;
  display: flex;
  align-items: center;
  gap: 8px;
  animation: toastIn 0.25s ease-out;
  min-width: 200px;
  justify-content: center;
}

.toast.success {
  background: rgba(16, 185, 129, 0.95);
}

.toast.error {
  background: rgba(239, 68, 68, 0.95);
}

.toast.warning {
  background: rgba(245, 158, 11, 0.95);
}

.toast.fadeout {
  animation: toastOut 0.25s ease-in forwards;
}

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

@keyframes toastOut {
  from {
    opacity: 1;
    transform: translateY(0);
  }
  to {
    opacity: 0;
    transform: translateY(-20px);
  }
}

/* ============ 弹窗 Modal ============ */
.modal-mask {
  position: fixed;
  inset: 0;
  z-index: 9000;
  background: rgba(15, 23, 42, 0.55);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: maskIn 0.2s ease-out;
}

.modal {
  background: #fff;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xl);
  width: 100%;
  max-width: 420px;
  overflow: hidden;
  animation: modalIn 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.modal-head {
  padding: 22px 24px 8px;
}

.modal-head h3 {
  font-size: 17px;
  font-weight: 600;
  color: var(--color-text);
}

.modal-body {
  padding: 12px 24px 24px;
  font-size: 14px;
  color: var(--color-text-soft);
  line-height: 1.7;
}

.modal-foot {
  padding: 12px 24px 20px;
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}

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

@keyframes modalIn {
  from {
    opacity: 0;
    transform: translateY(20px) scale(0.96);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* ============ 通用区块 ============ */
.section {
  padding: 60px 0;
}

.section-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin-bottom: 32px;
  flex-wrap: wrap;
  gap: 12px;
}

.section-title {
  font-size: 24px;
  font-weight: 700;
  color: var(--color-text);
  position: relative;
  padding-left: 14px;
}

.section-title::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 4px;
  height: 22px;
  border-radius: 2px;
  background: var(--gradient-primary);
}

.section-sub {
  color: var(--color-text-soft);
  font-size: 14px;
}

/* ============ 响应式 ============ */
@media (max-width: 900px) {
  .footer-grid {
    grid-template-columns: 1fr 1fr;
    gap: 32px;
  }

  .nav-list {
    display: none;
  }
}

@media (max-width: 640px) {
  :root {
    --header-h: 60px;
  }

  .container {
    padding: 0 16px;
  }

  .brand {
    font-size: 15px;
  }

  .brand-text small {
    display: none;
  }

  .footer-grid {
    grid-template-columns: 1fr;
    gap: 28px;
    padding-bottom: 28px;
  }

  .section {
    padding: 40px 0;
  }

  .section-title {
    font-size: 20px;
  }

  .header-actions .btn {
    padding: 7px 14px;
    font-size: 13px;
  }

  .user-chip span:not(.user-avatar):not(.vip-badge) {
    display: none;
  }
}
