/* 跨境电商物流工具箱 — 官网样式（与 APP.py COLORS 对齐） */

:root {
  --primary: #8b5cf6;
  --secondary: #ec4899;
  --accent: #f97316;
  --success: #10b981;
  --info: #06b6d4;
  --warning: #fbbf24;
  --danger: #ef4444;
  --dark: #1e1b4b;
  --bg-light: #faf5ff;
  --card-border: #e9d5ff;
  --text-muted: #6b7280;
  --shadow: 0 4px 24px rgba(139, 92, 246, 0.12);
  --radius: 16px;
  --nav-h: 64px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: "Microsoft YaHei", "PingFang SC", "Segoe UI", sans-serif;
  color: var(--dark);
  background: var(--bg-light);
  line-height: 1.6;
}

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

a:hover {
  text-decoration: underline;
}

/* 顶栏 */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  height: var(--nav-h);
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--card-border);
}

.nav-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 24px;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--dark);
  text-decoration: none;
}

.brand:hover {
  text-decoration: none;
}

.brand-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
}

.nav-links {
  display: flex;
  gap: 24px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav-links a {
  color: var(--dark);
  font-size: 0.95rem;
  text-decoration: none;
}

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

/* 顶栏右侧：登录 / 注册 / 下载等同组排列，避免 space-between 拉得过开 */
.nav-auth {
  display: flex;
  align-items: center;
  flex-shrink: 0;
  gap: 0.5rem;
}

.nav-auth .btn {
  padding: 8px 16px;
  font-size: 0.9rem;
  white-space: nowrap;
}

/* 顶栏用户菜单（对齐 ipa.store 头像下拉） */
.site-header .header-info {
  position: relative;
}

.site-header .head-avatar {
  position: relative;
}

.site-header .avatar-trigger {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: none;
  background: transparent;
  cursor: pointer;
  line-height: 0;
}

.site-header .avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  border: 3px solid #e9d5ff;
  box-sizing: border-box;
  user-select: none;
  flex-shrink: 0;
}

.site-header .avatar-default {
  background: linear-gradient(135deg, var(--primary), var(--secondary));
}

.site-header .avatar-36 {
  width: 36px;
  height: 36px;
  font-size: 0.95rem;
}

.site-header .avatar-50 {
  width: 50px;
  height: 50px;
  font-size: 1.25rem;
  flex-shrink: 0;
}

.site-header .head-avatar .user-tab {
  display: none;
  position: absolute;
  width: 330px;
  top: 100%;
  right: 0;
  padding-top: 12px;
  margin-top: 4px;
  z-index: 120;
}

.site-header .head-avatar:hover .user-tab,
.site-header .head-avatar.is-open .user-tab {
  display: block;
}

.site-header .user-tab-warpper {
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 12px 48px rgba(6, 10, 38, 0.18);
}

.site-header .user-info {
  position: relative;
  background: #f4faff;
  padding: 20px;
  z-index: 1;
}

.site-header .user-info::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  opacity: 0.35;
  background: linear-gradient(44deg, #ddd6fe 48%, #f4faff 91%);
  width: 60px;
  height: 76px;
  border-radius: 0 0 100% 0;
  pointer-events: none;
}

.site-header .user-info::after {
  content: "";
  position: absolute;
  right: 0;
  bottom: 0;
  opacity: 0.4;
  background: linear-gradient(43deg, #ddd6fe 1%, #f4faff);
  width: 100px;
  height: 57px;
  border-radius: 100% 0 0 0;
  pointer-events: none;
}

.site-header .base-info {
  position: relative;
  display: flex;
  align-items: center;
  z-index: 1;
}

.site-header .base-info .other {
  padding: 4px 0 4px 14px;
  min-width: 0;
}

.site-header .username-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.site-header .username {
  font-weight: 700;
  font-size: 16px;
  color: #333;
}

.site-header .type {
  padding: 3px 8px;
  border-radius: 6px;
  background: linear-gradient(90deg, #fee7b0, #e7c469);
  color: #4e2d03;
  font-size: 11px;
  font-style: normal;
  font-weight: 600;
  white-space: nowrap;
}

.site-header .user-status-tag {
  display: inline-block;
  margin-top: 6px;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  background: rgba(139, 92, 246, 0.12);
  color: var(--primary);
}

.site-header .account-tip {
  position: relative;
  z-index: 1;
  text-align: left;
  background: #fff;
  border-radius: 8px;
  padding: 10px 12px;
  margin: 13px 0;
  font-size: 12px;
  color: #707c86;
  line-height: 1.5;
}

.site-header .account-tip-text {
  margin: 0;
}

.site-header .user-options {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 10px;
}

.site-header .user-options .option {
  width: auto;
  min-width: 0;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 8px 6px;
  line-height: 1.25;
  min-height: 36px;
  text-align: center;
  text-decoration: none;
  font-size: 13px;
  font-weight: 600;
  border-radius: 6px;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.site-header .user-options .option:hover {
  text-decoration: none;
  transform: translateY(-1px);
}

.site-header .option-1 {
  background: #fff;
  box-shadow: 0 8px 24px -10px rgba(0, 0, 0, 0.18);
  color: #030303 !important;
}

.site-header .option-membership {
  background: linear-gradient(135deg, #fee7b0 0%, #e7c469 100%);
  box-shadow: 0 8px 24px -10px rgba(231, 196, 105, 0.65);
  color: #4e2d03 !important;
}

.site-header .option-membership:hover {
  box-shadow: 0 10px 28px -8px rgba(231, 196, 105, 0.75);
}

.site-header .option-2 {
  background: var(--primary);
  box-shadow: 0 8px 24px -10px rgba(139, 92, 246, 0.45);
  color: #fff !important;
}

.site-header .more-options {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 4px;
  padding: 14px 12px;
  margin-top: 4px;
  background: #fff;
  border-radius: 8px;
  font-size: 12px;
}

.site-header .more-options .option {
  padding: 6px 4px;
  text-align: center;
  color: #6b7280;
  text-decoration: none;
  border-radius: 4px;
  transition: color 0.15s ease, background 0.15s ease;
}

.site-header .more-options .option:hover {
  color: var(--primary);
  background: rgba(139, 92, 246, 0.08);
  text-decoration: none;
}

.site-header .more-options .option-logout {
  color: #dc2626;
}

.site-header .more-options .option-logout:hover {
  color: #b91c1c;
  background: rgba(220, 38, 38, 0.08);
}

/* 管理员时「管理」占一格，网格自动换行 */
.site-header .more-options:has(.option:nth-child(5)) {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 24px;
  border-radius: 12px;
  font-weight: 600;
  font-size: 0.95rem;
  border: none;
  cursor: pointer;
  text-decoration: none;
  transition: transform 0.15s, box-shadow 0.15s;
}

.btn:hover {
  text-decoration: none;
  transform: translateY(-1px);
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  color: #fff;
  box-shadow: 0 4px 16px rgba(139, 92, 246, 0.35);
}

.btn-outline {
  background: #fff;
  color: var(--primary);
  border: 2px solid var(--primary);
}

/* 主内容区偏移顶栏 */
main {
  padding-top: var(--nav-h);
}

/* Hero */
.hero {
  max-width: 1100px;
  margin: 0 auto;
  padding: 48px 24px 64px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
  align-items: center;
}

.hero-badge {
  display: inline-block;
  padding: 6px 14px;
  background: rgba(139, 92, 246, 0.12);
  color: var(--primary);
  border-radius: 999px;
  font-size: 0.85rem;
  margin-bottom: 16px;
}

.hero h1 {
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  line-height: 1.25;
  margin: 0 0 12px;
}

.hero-slogan {
  font-size: 1.15rem;
  color: var(--secondary);
  font-weight: 600;
  margin-bottom: 16px;
}

.hero-desc {
  color: var(--text-muted);
  margin-bottom: 28px;
  max-width: 480px;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.hero-visual {
  /* 浅色渐变，与全站紫色主色协调 */
  background: linear-gradient(145deg, #f0fdfa 0%, #e0f2fe 48%, #ede9fe 100%);
  border: 1px solid rgba(139, 92, 246, 0.12);
  border-radius: var(--radius);
  padding: 32px;
  color: var(--dark);
  box-shadow: 0 8px 32px rgba(139, 92, 246, 0.1);
  min-height: 280px;
}

.hero-visual h3 {
  margin: 0 0 20px;
  font-size: 1rem;
  color: var(--text-muted);
  font-weight: 600;
}

.tool-grid-mini {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

.tool-pill {
  background: rgba(255, 255, 255, 0.88);
  border: 1px solid rgba(139, 92, 246, 0.14);
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 0.8rem;
  color: var(--dark);
}

/* 统计条 */
.stats-bar {
  max-width: 1100px;
  margin: 0 auto 48px;
  padding: 0 24px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}

.stat-card {
  background: #fff;
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  padding: 20px;
  text-align: center;
  box-shadow: var(--shadow);
}

.stat-card strong {
  display: block;
  font-size: 1.75rem;
  color: var(--primary);
}

.stat-card span {
  font-size: 0.9rem;
  color: var(--text-muted);
}

/* 通用区块 */
.section {
  max-width: 1100px;
  margin: 0 auto;
  padding: 48px 24px;
}

.section-title {
  text-align: center;
  margin-bottom: 8px;
  font-size: 1.75rem;
}

.section-sub {
  text-align: center;
  color: var(--text-muted);
  margin: 0 auto 40px;
  max-width: 560px;
}

/* 功能卡片（5 个分类框整体居中，末行不足时亦居中） */
.features-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 20px;
}

.feature-card {
  flex: 1 1 300px;
  max-width: 320px;
  background: #fff;
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow);
}

.feature-card h3 {
  margin: 0 0 12px;
  font-size: 1.1rem;
}

.feature-card .cat-tag {
  display: inline-block;
  font-size: 0.75rem;
  padding: 2px 8px;
  border-radius: 6px;
  margin-bottom: 12px;
}

.cat-make { background: #fef3c7; color: #b45309; }
.cat-check { background: #d1fae5; color: #047857; }
.cat-assist { background: #ede9fe; color: #6d28d9; }
.cat-unique { background: #f3f4f6; color: #4b5563; }
.cat-api { background: #cffafe; color: #0e7490; }

.feature-card ul {
  margin: 0;
  padding-left: 1.2em;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.feature-card li {
  margin-bottom: 6px;
}

.badge-db {
  font-size: 0.7rem;
  background: #fee2e2;
  color: #b91c1c;
  padding: 1px 6px;
  border-radius: 4px;
  margin-left: 4px;
}

/* 物流商 */
.integrations {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: center;
  margin-bottom: 24px;
}

.chip {
  background: #fff;
  border: 1px solid var(--card-border);
  padding: 10px 20px;
  border-radius: 999px;
  font-weight: 600;
}

/* 流程 */
.workflow-steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

.step {
  text-align: center;
  padding: 24px;
  background: #fff;
  border-radius: var(--radius);
  border: 1px solid var(--card-border);
}

.step-num {
  width: 40px;
  height: 40px;
  line-height: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  color: #fff;
  font-weight: 700;
  margin: 0 auto 12px;
}

/* 下载区 */
.download-box {
  background: #fff;
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  padding: 40px;
  text-align: center;
  box-shadow: var(--shadow);
}

.version-line {
  font-size: 1.25rem;
  margin-bottom: 8px;
}

.version-line #latest-version {
  color: var(--primary);
  font-weight: 700;
}

.requirements {
  text-align: left;
  max-width: 480px;
  margin: 24px auto 0;
  font-size: 0.9rem;
  color: var(--text-muted);
}

/* FAQ */
.faq-item {
  background: #fff;
  border: 1px solid var(--card-border);
  border-radius: 12px;
  padding: 16px 20px;
  margin-bottom: 12px;
}

.faq-item h4 {
  margin: 0 0 8px;
  font-size: 1rem;
}

.faq-item p {
  margin: 0;
  font-size: 0.9rem;
  color: var(--text-muted);
}

/* 页脚 */
.site-footer {
  background: var(--dark);
  color: rgba(255, 255, 255, 0.75);
  padding: 40px 24px;
  margin-top: 48px;
  text-align: center;
  font-size: 0.9rem;
}

.site-footer a {
  color: #c4b5fd;
}

.site-footer-icp {
  margin: 10px 0 0;
  font-size: 0.85rem;
}

/* 响应式 */
@media (max-width: 768px) {
  .nav-links {
    display: none;
  }

  .site-header .head-avatar .user-tab {
    width: min(330px, calc(100vw - 32px));
    right: -8px;
  }

  .site-header .user-options {
    grid-template-columns: 1fr;
  }

  .site-header .user-options .option {
    font-size: 14px;
    min-height: 40px;
  }

  .site-header .more-options {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .hero {
    grid-template-columns: 1fr;
  }

  .stats-bar {
    grid-template-columns: repeat(2, 1fr);
  }

  .workflow-steps {
    grid-template-columns: 1fr;
  }

  .feature-card {
    max-width: 100%;
    flex: 1 1 100%;
  }
}


/* ---------------------------------------------------------------------- */
/* 全站通用提示框（覆盖原来仅在 account.css 中定义的版本）                  */
/* ---------------------------------------------------------------------- */

.alert-pending {
  background: #fffbeb;
  border: 1px solid #fbbf24;
  color: #92400e;
  padding: 1rem;
  border-radius: 12px;
  margin-bottom: 1rem;
}

.alert-error {
  background: #fef2f2;
  border: 1px solid #fca5a5;
  color: #991b1b;
  padding: 0.75rem 1rem;
  border-radius: 8px;
  margin-bottom: 1rem;
}

/* 成功提示（绿色，由 JS 转为居中悬浮 Toast） */
.alert-success {
  background: #ecfdf5;
  border: 1px solid #6ee7b7;
  color: #065f46;
  padding: 1rem;
  border-radius: 12px;
  margin-bottom: 1rem;
}

/* ---------------------------------------------------------------------- */
/* 全站悬浮 Toast（成功/失败提示，页面正中，3 秒后消失）                   */
/* ---------------------------------------------------------------------- */

.site-flash-toast {
  position: fixed;
  top: 50%;
  left: 50%;
  z-index: 10050;
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: min(360px, calc(100vw - 40px));
  padding: 12px 18px;
  border-radius: 12px;
  box-shadow: 0 12px 32px rgba(15, 23, 42, 0.14), 0 2px 8px rgba(15, 23, 42, 0.08);
  font-size: 14px;
  font-weight: 500;
  line-height: 1.45;
  pointer-events: none;
  transform: translate(-50%, -50%);
  animation: site-flash-in 0.35s ease;
  transition: opacity 0.35s ease, transform 0.35s ease;
}

.site-flash-toast--ok {
  background: #ecfdf5;
  border: 1px solid #6ee7b7;
  color: #065f46;
}

.site-flash-toast--error {
  background: #fef2f2;
  border: 1px solid #fca5a5;
  color: #991b1b;
}

.site-flash-toast-icon {
  flex: 0 0 22px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  font-size: 13px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}

.site-flash-toast--ok .site-flash-toast-icon {
  background: #10b981;
  color: #fff;
}

.site-flash-toast--error .site-flash-toast-icon {
  background: #ef4444;
  color: #fff;
}

.site-flash-toast.is-dismissed {
  opacity: 0;
  transform: translate(-50%, calc(-50% - 10px));
  pointer-events: none;
}

@keyframes site-flash-in {
  from {
    opacity: 0;
    transform: translate(-50%, calc(-50% - 18px));
  }
  to {
    opacity: 1;
    transform: translate(-50%, -50%);
  }
}

@media (max-width: 640px) {
  .site-flash-toast {
    max-width: calc(100vw - 32px);
  }
}
