/* 有道翻译 — 官方网站 */

:root {
  --primary: #4C5FFF;
  --primary-dark: #3A46E0;
  --primary-light: #EEF0FF;
  --ai-grad: linear-gradient(270deg, #816FF1 0%, #6663F7 55%, #7583FF 100%);
  --gold-grad: linear-gradient(270deg, #FFD8B7 0%, #FFE2C1 100%);

  --text-primary: #1A1A2E;
  --text-secondary: #6B7280;
  --text-tertiary: #9CA3AF;

  --border: #E7E8EF;
  --bg: #FFFFFF;
  --bg-soft: #F7F8FC;
  --bg-sidebar: #FBFBFD;

  --radius-sm: 6px;
  --radius-md: 12px;
  --radius-lg: 18px;
  --radius-pill: 60px;

  --shadow-sm: 0 1px 2px rgba(16, 24, 40, 0.06);
  --shadow-md: 0 6px 20px rgba(16, 24, 40, 0.08);
  --shadow-card: 0 2px 14px rgba(76, 95, 255, 0.08);

  --font: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei",
    "Segoe UI", Roboto, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font);
  color: var(--text-primary);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
a { text-decoration: none; color: inherit; }
button { font-family: inherit; cursor: pointer; }
ul { list-style: none; margin: 0; padding: 0; }
img, svg { display: block; }

.app-shell {
  display: flex;
  min-height: 100vh;
}

/* ---------- Sidebar ---------- */
.sidebar {
  width: 128px;
  flex-shrink: 0;
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border);
  padding: 20px 0 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  margin-bottom: 22px;
  padding: 0 8px;
}
.brand-mark {
  width: 34px;
  height: 34px;
}
.brand-word {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.5px;
  color: var(--text-primary);
}
.nav {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 0 10px;
}
.nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  padding: 10px 4px;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  transition: background .15s, color .15s;
}
.nav-item svg { width: 20px; height: 20px; }
.nav-item span { font-size: 11px; line-height: 1.2; }
.nav-item:hover { background: var(--primary-light); color: var(--primary); }
.nav-item.active { background: var(--primary-light); color: var(--primary); font-weight: 600; }

/* ---------- Main ---------- */
.main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 28px;
  border-bottom: 1px solid var(--border);
}
.tabs {
  display: flex;
  gap: 28px;
}
.tab {
  font-size: 15px;
  color: var(--text-secondary);
  padding-bottom: 4px;
  border-bottom: 2px solid transparent;
}
.tab.active {
  color: var(--text-primary);
  font-weight: 600;
  border-bottom-color: var(--primary);
}
.top-actions {
  display: flex;
  align-items: center;
  gap: 18px;
}
.top-link {
  font-size: 13px;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 5px;
}
.top-link svg { width: 15px; height: 15px; }
.btn-vip {
  background: var(--gold-grad);
  color: #7A4A12;
  font-size: 13px;
  font-weight: 600;
  padding: 8px 18px;
  border-radius: var(--radius-pill);
  border: none;
  display: flex;
  align-items: center;
  gap: 4px;
}

.promo-strip {
  background: linear-gradient(90deg, #FFF3E9 0%, #FFEAE0 100%);
  color: #B5540C;
  font-size: 13px;
  text-align: center;
  padding: 8px 12px;
}
.promo-strip b { font-weight: 700; }

.content {
  flex: 1;
  padding: 28px;
  max-width: 1120px;
  width: 100%;
  margin: 0 auto;
}

/* ---------- Translate box ---------- */
.translate-box {
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  overflow: hidden;
  background: var(--bg);
}
.translate-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
}
.pane {
  padding: 18px 22px;
  min-height: 260px;
  display: flex;
  flex-direction: column;
}
.pane-source { border-right: 1px solid var(--border); }
.pane-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}
.lang-select {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  color: var(--text-primary);
  font-weight: 500;
}
.lang-select svg { width: 14px; height: 14px; color: var(--text-tertiary); }
.pane-textarea {
  flex: 1;
  border: none;
  outline: none;
  resize: none;
  font-size: 16px;
  line-height: 1.6;
  color: var(--text-primary);
  font-family: inherit;
}
.pane-textarea::placeholder { color: var(--text-tertiary); }
.pane-result {
  flex: 1;
  font-size: 16px;
  line-height: 1.6;
  color: var(--text-primary);
}
.pane-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 14px;
  margin-top: 14px;
  border-top: 1px solid var(--border);
}
.pane-tools {
  display: flex;
  align-items: center;
  gap: 14px;
  color: var(--text-tertiary);
}
.pane-tools svg { width: 17px; height: 17px; }
.char-count { font-size: 12px; color: var(--text-tertiary); }
.btn-ai-polish {
  background: var(--ai-grad);
  color: #fff;
  font-size: 13px;
  font-weight: 500;
  border: none;
  border-radius: var(--radius-sm);
  padding: 7px 14px;
  display: flex;
  align-items: center;
  gap: 5px;
}

/* ---------- Feature grid ---------- */
.section-title {
  font-size: 18px;
  font-weight: 700;
  margin: 40px 0 16px;
}
.feature-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
}
.feature-card {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 18px;
  display: flex;
  gap: 12px;
  align-items: flex-start;
  transition: box-shadow .15s, transform .15s;
}
.feature-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
.feature-icon {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: var(--primary-light);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.feature-icon svg { width: 20px; height: 20px; }
.feature-name { font-size: 14px; font-weight: 600; margin-bottom: 4px; }
.feature-desc { font-size: 12px; color: var(--text-secondary); line-height: 1.5; }

/* ---------- Upload panel (document page) ---------- */
.upload-panel {
  border: 1.5px dashed var(--border);
  border-radius: var(--radius-lg);
  padding: 48px 24px;
  text-align: center;
  background: var(--bg-soft);
}
.upload-icon {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  background: var(--primary-light);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 14px;
}
.upload-icon svg { width: 26px; height: 26px; }
.upload-title { font-size: 15px; font-weight: 600; margin-bottom: 4px; }
.upload-sub { font-size: 13px; color: var(--text-secondary); margin-bottom: 18px; }
.btn-primary {
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  padding: 10px 22px;
  font-size: 14px;
  font-weight: 600;
}
.filetype-row {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-top: 20px;
}
.filetype-chip {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  color: var(--text-secondary);
}

/* ---------- Generic page ---------- */
.page-header { margin-bottom: 24px; }
.page-title { font-size: 22px; font-weight: 700; margin: 0 0 6px; }
.page-sub { font-size: 14px; color: var(--text-secondary); margin: 0; }

.card {
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  background: var(--bg);
  box-shadow: var(--shadow-sm);
}

.plan-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-top: 20px;
}
.plan-card {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 22px 18px;
  text-align: center;
}
.plan-card.featured {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px var(--primary-light);
  position: relative;
}
.plan-badge {
  position: absolute;
  top: -11px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--gold-grad);
  color: #7A4A12;
  font-size: 11px;
  font-weight: 700;
  padding: 3px 12px;
  border-radius: var(--radius-pill);
}
.plan-name { font-size: 14px; color: var(--text-secondary); margin-bottom: 8px; }
.plan-price { font-size: 28px; font-weight: 800; margin-bottom: 2px; }
.plan-price span { font-size: 13px; font-weight: 400; color: var(--text-tertiary); }
.plan-desc { font-size: 12px; color: var(--text-tertiary); margin-bottom: 16px; }

.download-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  margin-top: 20px;
}
.download-card {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 24px;
  text-align: center;
}
.download-icon {
  width: 46px;
  height: 46px;
  border-radius: 12px;
  background: var(--primary-light);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 12px;
}
.version-badge {
  position: fixed;
  bottom: 18px;
  right: 18px;
  background: var(--text-primary);
  color: #fff;
  font-size: 12px;
  padding: 8px 14px;
  border-radius: var(--radius-pill);
  display: flex;
  align-items: center;
  gap: 8px;
  box-shadow: var(--shadow-md);
  z-index: 20;
}
.version-badge a { color: #C9CFFF; font-weight: 600; }

@media (max-width: 900px) {
  .translate-grid { grid-template-columns: 1fr; }
  .pane-source { border-right: none; border-bottom: 1px solid var(--border); }
  .feature-grid { grid-template-columns: repeat(2, 1fr); }
  .plan-grid, .download-grid { grid-template-columns: 1fr; }
}

.brand-logo {
  height: 22px;
  width: auto;
  aspect-ratio: 1280 / 285;
  display: block;
  max-width: none;
  object-fit: contain;
}

/* ---------- Download-first hero ---------- */
.download-hero {
  border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 32px;
  background: linear-gradient(135deg, var(--primary-light) 0%, #fff 70%);
  margin-bottom: 32px;
}
.download-hero-eyebrow { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 700; color: var(--primary); background: #fff; padding: 5px 12px; border-radius: var(--radius-pill); margin-bottom: 12px; box-shadow: var(--shadow-sm); }
.download-hero h1 { font-size: 24px; font-weight: 800; margin: 0 0 10px; line-height: 1.35; }
.download-hero-sub { font-size: 13.5px; color: var(--text-secondary); line-height: 1.7; margin: 0 0 20px; max-width: 440px; }
.app-badge-row { display: flex; flex-wrap: wrap; gap: 10px; }
.btn-app {
  display: inline-flex; align-items: center; gap: 8px; background: var(--text-primary); color: #fff;
  padding: 10px 18px; border-radius: 10px; font-size: 13px; font-weight: 600;
}
.btn-app svg { width: 16px; height: 16px; }
.btn-app.secondary { background: #fff; color: var(--text-primary); border: 1px solid var(--border); }

/* ---------- Compare table ---------- */
.compare-table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius-md); margin-bottom: 32px; }
.compare-table { width: 100%; border-collapse: collapse; font-size: 13px; min-width: 560px; }
.compare-table th, .compare-table td { padding: 13px 16px; text-align: left; border-bottom: 1px solid var(--border); }
.compare-table th { background: var(--bg-soft); font-weight: 700; color: var(--text-primary); }
.compare-table td { color: var(--text-secondary); }
.compare-table tr:last-child td { border-bottom: none; }
.compare-table td a { color: var(--primary); font-weight: 600; }
.compare-table .tag { display: inline-block; font-size: 10.5px; font-weight: 700; color: var(--primary); background: var(--primary-light); padding: 2px 7px; border-radius: var(--radius-pill); margin-left: 6px; }

/* ---------- Scenario grid ---------- */
.scenario-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; margin-bottom: 32px; }
.scenario-card { border: 1px solid var(--border); border-radius: var(--radius-md); padding: 20px; }
.scenario-card .scenario-tag { font-size: 10.5px; font-weight: 700; color: var(--primary); background: var(--primary-light); padding: 3px 9px; border-radius: var(--radius-pill); display: inline-block; margin-bottom: 10px; }
.scenario-card h3 { font-size: 14px; font-weight: 700; margin: 0 0 6px; }
.scenario-card p { font-size: 12.5px; color: var(--text-secondary); line-height: 1.7; margin: 0; }

/* ---------- Reason grid ---------- */
.reason-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin-bottom: 32px;
}

/* ---------- Secondary / lite translate ---------- */
.lite-translate { margin-bottom: 32px; }
.lite-translate-label {
  display: flex; align-items: center; justify-content: space-between; font-size: 12.5px; color: var(--text-tertiary); margin-bottom: 8px;
}
.lite-translate-label a { color: var(--primary); font-weight: 600; }
.translate-box.compact .pane { min-height: 120px; padding: 14px 18px; }
.translate-box.compact { opacity: .97; }

/* ===========================================================
   移动端响应式适配 (Mobile Responsiveness)
=========================================================== */
@media (max-width: 768px) {
  .app-shell {
    flex-direction: column;
    min-height: 100vh;
  }

  /* 顶部移动端品牌条 */
  .sidebar {
    width: 100%;
    height: auto;
    padding: 10px 16px;
    background: #ffffff;
    border-right: none;
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
  }
  .sidebar .brand {
    margin-bottom: 0;
    padding: 0;
    display: flex;
    flex-direction: row;
    align-items: center;
    flex-shrink: 0;
    min-width: 116px;
    min-height: 26px;
    gap: 8px;
  }
  .sidebar .brand-logo {
    height: 26px;
    width: auto;
    aspect-ratio: 1280 / 285;
    max-width: none;
    display: block;
  }

  /* 移动端 App 风格底部吸底固定导航栏 */
  .sidebar .nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    width: 100%;
    height: 56px;
    background: #ffffff;
    border-top: 1px solid var(--border);
    box-shadow: 0 -3px 12px rgba(0, 0, 0, 0.06);
    flex-direction: row;
    justify-content: space-around;
    align-items: center;
    padding: 2px 4px;
    z-index: 999;
  }
  .sidebar .nav-item {
    flex: 1;
    padding: 6px 2px;
    gap: 3px;
    border-radius: 6px;
  }
  .sidebar .nav-item svg {
    width: 19px;
    height: 19px;
  }
  .sidebar .nav-item span {
    font-size: 10.5px;
    white-space: nowrap;
  }
  .sidebar .nav-item:nth-child(6) {
    display: none;
  }

  /* 主体内容与防遮挡边距 */
  .main {
    width: 100%;
    min-width: 0;
    padding-bottom: 74px;
  }

  /* 顶部二级导航：横向滑动友好 */
  .topbar {
    padding: 10px 14px;
    background: var(--bg-soft);
    border-bottom: 1px solid var(--border);
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }
  .topbar .tabs {
    width: 100%;
    overflow-x: auto;
    white-space: nowrap;
    -webkit-overflow-scrolling: touch;
    gap: 16px;
    padding-bottom: 4px;
  }
  .topbar .tabs::-webkit-scrollbar {
    display: none;
  }
  .topbar .tab {
    font-size: 13.5px;
    flex-shrink: 0;
  }
  .topbar .top-actions {
    display: none;
  }

  /* 页面内边距收缩 */
  .content {
    padding: 16px 14px;
  }

  /* 下载英雄横幅 */
  .download-hero {
    padding: 20px 16px;
    margin-bottom: 20px;
    border-radius: var(--radius-md);
  }
  .download-hero h1 {
    font-size: 19px;
    line-height: 1.35;
    margin-bottom: 8px;
  }
  .download-hero-sub {
    font-size: 12.5px;
    margin-bottom: 14px;
  }
  .app-badge-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
  }
  .btn-app {
    flex: 1 1 calc(50% - 6px);
    min-width: 125px;
    padding: 9px 12px;
    font-size: 12px;
    justify-content: center;
  }
  .btn-app.secondary {
    flex: 1 1 100%;
  }

  /* 翻译框响应式垂直堆叠 */
  .translate-box {
    border-radius: var(--radius-md);
  }
  .translate-grid {
    grid-template-columns: 1fr !important;
  }
  .pane-source {
    border-right: none !important;
    border-bottom: 1px solid var(--border) !important;
  }
  .pane {
    padding: 14px 16px;
    min-height: 140px;
  }
  .pane-textarea {
    font-size: 15px;
    min-height: 90px;
  }
  .pane-result {
    font-size: 15px;
    min-height: 70px;
  }

  /* 网格组件单列化 */
  .reason-grid {
    grid-template-columns: 1fr !important;
    gap: 10px !important;
    margin-bottom: 24px !important;
  }
  .feature-grid {
    grid-template-columns: 1fr !important;
    gap: 10px !important;
    margin-bottom: 24px !important;
  }
  .feature-card {
    padding: 14px 16px;
  }
  .scenario-grid {
    grid-template-columns: 1fr !important;
    gap: 10px !important;
    margin-bottom: 24px !important;
  }
  .scenario-card {
    padding: 16px;
  }

  /* 对比表格支持水平横滑 */
  .compare-table-wrap {
    margin-bottom: 24px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  .compare-table {
    min-width: 440px;
    font-size: 12px;
  }
  .compare-table th, .compare-table td {
    padding: 10px 12px;
  }

  /* VIP 会员卡片单列 */
  .plan-grid {
    grid-template-columns: 1fr !important;
    gap: 14px !important;
  }
  .plan-card {
    padding: 22px 18px;
  }
  .plan-price {
    font-size: 28px;
  }

  /* 更新日志卡片单列 */
  .article-grid {
    grid-template-columns: 1fr !important;
    gap: 14px !important;
  }
  .article-card {
    padding: 18px 16px;
  }

  /* 客户端一览单列 */
  .download-grid {
    grid-template-columns: 1fr !important;
    gap: 14px !important;
  }

  /* 文档翻译上传面板 */
  .upload-panel {
    padding: 28px 16px;
  }
  .filetype-row {
    flex-wrap: wrap;
    justify-content: center;
    gap: 6px;
  }
  .upload-title {
    font-size: 15px;
  }

  /* 页面页脚底部增加安全距离 */
  footer {
    padding: 18px 14px 80px !important;
    flex-direction: column;
    align-items: flex-start;
    gap: 8px !important;
  }
}

@media (max-width: 480px) {
  .download-hero h1 {
    font-size: 17px;
  }
  .btn-app {
    flex: 1 1 100%;
  }
  .section-title {
    font-size: 16px;
    margin: 20px 0 10px;
  }
}
