:root {
  --bg: #f4f5f1;
  --surface: #ffffff;
  --text: #121814;
  --muted: #5f6672;
  --line: rgba(18, 24, 20, 0.12);
  --line-soft: rgba(18, 24, 20, 0.08);
  --green: #99df50;
  --green-ink: #173a05;
  --radius-xl: 24px;
  --radius-lg: 16px;
  --radius-md: 12px;
  --shadow-1: 0 8px 24px rgba(15, 23, 42, 0.05);
  --shadow-2: 0 4px 14px rgba(15, 23, 42, 0.04);
}

/* shiyufont — 本地部署，避免 CDN 不稳定 */
@font-face {
  font-family: "shiyufont";
  font-weight: 400;
  src: url("/assets/vendor/shiyufont.woff2") format("woff2"),
       url("/assets/vendor/shiyufont.woff") format("woff");
  font-display: swap;
}

.font-shiyu {
  font-family: "shiyufont";
  font-variation-settings: normal; /* Chrome 140 以下版本需要 */
}


* { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
body {
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.58;
  font-weight: 400;
  letter-spacing: -0.003em;
}

a { color: inherit; text-decoration: none; }
code {
  background: rgba(0, 0, 0, 0.05);
  border-radius: 6px;
  padding: 2px 6px;
  font-size: 0.84em;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, monospace;
}

.container {
  width: min(1180px, calc(100% - 88px));
  margin: 0 auto;
}

.header { padding: 32px 0 20px; }
.header-inner {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 24px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}
.brand-logo {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  object-fit: contain;
}
.brand-text {
  font-size: 24px;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.main-nav {
  justify-self: center;
  display: inline-flex;
  align-items: center;
  gap: 18px;
}
.main-nav a {
  font-size: 14px;
  font-weight: 400;
  letter-spacing: -0.01em;
  color: #5f6672;
  padding: 5px 1px;
  border-bottom: 2px solid transparent;
  transition: color .16s ease;
}
.main-nav a:hover,
.main-nav a.active {
  color: #111827;
  border-bottom-color: #16a34a;
}

.header-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.btn {
  border-radius: 999px;
  border: 1px solid transparent;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: -0.01em;
  padding: 7px 12px;
  transition: transform .16s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn-ghost {
  background: var(--surface);
  border-color: var(--line);
}
.btn-primary {
  background: var(--green);
  color: var(--green-ink);
}

.hero { padding: 24px 0 64px; }
.hero-inner {
  display: grid;
  grid-template-columns: 1.04fr .96fr;
  gap: 40px;
  align-items: center;
}

.hero-left h1 {
  font-size: clamp(38px, 4.8vw, 54px);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: .95;
  color: #021304;
}
.hero-left p {
  margin-top: 16px;
  color: #46505e;
  max-width: 560px;
  font-size: clamp(14px, 1.08vw, 17px);
  line-height: 1.7;
  font-weight: 400;
  letter-spacing: -0.006em;
}

.search-box {
  margin-top: 24px;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 10px;
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-1);
  border-radius: 18px;
  padding: 8px 8px 8px 12px;
}
.search-icon { color: #75808e; }
.search-box input {
  border: none;
  outline: none;
  background: transparent;
  font-size: 15px;
  font-weight: 400;
  letter-spacing: -0.01em;
  color: #111827;
}
.search-box input::placeholder { color: #7b8390; }
.search-box button {
  border: none;
  border-radius: 14px;
  background: var(--green);
  color: var(--green-ink);
  font-size: 14px;
  font-weight: 600;
  padding: 8px 12px;
  cursor: pointer;
}

.quick-tabs {
  margin-top: 14px;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.tab {
  border: 1px solid #d6dbe3;
  background: transparent;
  color: #2b3442;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: -0.01em;
  padding: 6px 11px;
  cursor: pointer;
  transition: all .16s ease;
}
.tab:hover { border-color: #badcc1; background: #f7faf6; }
.tab.active { border-color: #bbe7c4; background: #f0fdf4; }

.hero-right {
  position: relative;
  min-height: 500px;
  border-radius: 24px;
  background: radial-gradient(circle at 50% 62%, #edf3e5 0%, #f4f6f1 72%);
  overflow: hidden;
  border: 1px solid rgba(15, 21, 17, 0.04);
}
.ring {
  position: absolute;
  left: 50%;
  top: 80%;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  border: 1px solid rgba(22, 163, 74, 0.10);
}
.ring-1 { width: 116%; height: 116%; }
.ring-2 { width: 92%; height: 92%; }
.ring-3 { width: 70%; height: 70%; }
.ring-4 { width: 50%; height: 50%; }

.hero-dot {
  position: absolute;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.12);
}
.dot-1 { left: 8%; top: 24%; background: #63d38c; }
.dot-2 { left: 90%; top: 24%; background: #f2c94c; }
.dot-3 { left: 84%; top: 50%; background: #2ec5f2; }
.dot-4 { left: 67%; top: 86%; background: #63d38c; }
.dot-5 { left: 1%; top: 67%; background: #63d38c; }

.hero-icon-card {
  position: absolute;
  width: 76px;
  height: 76px;
  border-radius: 20px;
  background: #fff;
  border: 1px solid rgba(15, 23, 42, 0.08);
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.10);
  display: grid;
  place-items: center;
}

.hero-icon-card svg {
  display: block;
}

.pos-1 { left: 42%; top: 6%; }
.pos-2 { left: 67%; top: 12%; }
.pos-3 { left: 16%; top: 22%; }
.pos-4 { left: 30%; top: 36%; }
.pos-5 { left: 48%; top: 24%; }
.pos-6 { left: 67%; top: 36%; }
.pos-7 { left: 80%; top: 52%; }
.pos-8 { left: 49%; top: 52%; }
.pos-9 { left: 8%; top: 50%; }
.pos-10 { left: 66%; top: 75%; }

@media (max-width: 1180px) {
  .hero-icon-card {
    width: 62px;
    height: 62px;
    border-radius: 16px;
  }

  .hero-icon-card svg {
    transform: scale(.9);
  }
}

.apps-section { padding: 56px 0 56px; }
.apps-meta {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 16px;
}
.apps-meta span {
  color: #5f6672;
  font-size: 12px;
  font-weight: 500;
}

.app-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 16px;
}
.app-card {
  position: relative;
  border-radius: var(--radius-lg);
  border: 1px solid var(--line-soft);
  background: var(--surface);
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.04);
  padding: 14px 14px 16px;
  transition: box-shadow .16s ease, border-color .16s ease;
  overflow: hidden;
}
.app-card:hover {
  border-color: rgba(18, 24, 20, 0.16);
  box-shadow: 0 5px 14px rgba(15, 23, 42, 0.06);
}

.app-icon-wrap {
  width: 30px;
  height: 30px;
  display: inline-grid;
  place-items: center;
  margin-bottom: 10px;
}

.app-decor {
  position: absolute;
  right: -26px;
  top: -26px;
  width: 78px;
  height: 78px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(153, 223, 80, 0.12), rgba(153, 223, 80, 0));
  pointer-events: none;
}

.app-name {
  font-size: 14px;
  font-weight: 500;
  letter-spacing: -0.01em;
  line-height: 1.35;
  margin-right: 8px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 38px;
}
.app-desc {
  margin-top: 8px;
  min-height: 58px;
  color: #66707d;
  font-size: 12px;
  line-height: 1.62;
  font-weight: 400;
  letter-spacing: -0.004em;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-right: 6px;
}

.app-hit {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  z-index: 2;
}

.empty {
  grid-column: 1 / -1;
  border: 1px dashed #cbd5e1;
  border-radius: var(--radius-lg);
  color: #64748b;
  text-align: center;
  padding: 34px;
  font-size: 13px;
}

.footer {
  padding: 20px 0 20px;
}
.footer-inner {
  border-top: 1px solid var(--line);
  padding-top: 14px;
  color: #6b7280;
  font-size: 11px;
  font-weight: 400;
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

@media (max-width: 980px) {
  .container { width: min(1180px, calc(100% - 44px)); }

  .header-inner {
    grid-template-columns: auto 1fr auto;
    gap: 12px;
  }

  .main-nav { gap: 14px; }
  .main-nav a { font-size: 13px; }

  .hero-inner {
    grid-template-columns: 1fr;
    gap: 26px;
  }

  .hero-right { min-height: 300px; }

  .hero-dot {
    width: 8px;
    height: 8px;
  }

  .hero-icon-card {
    width: 62px;
    height: 62px;
    border-radius: 16px;
  }

  .hero-icon-card svg {
    transform: scale(.9);
  }

  .app-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

/* ============================================================
   移动端 — 专业原生 App 级体验
   参考：iOS App Store 搜索页、iOS 设置列表、Notion Mobile
   ============================================================ */
@media (max-width: 768px) {
  :root {
    --tab-bar-h: 56px;
  }

  html {
    overflow-x: hidden;
    overscroll-behavior: none;
    -webkit-overflow-scrolling: touch;
  }
  body {
    -webkit-tap-highlight-color: transparent;
    -webkit-touch-callout: none;
    overscroll-behavior-y: none;
    padding-bottom: var(--tab-bar-h);
  }

  /* ---- 导航栏 — iOS 风格大标题导航 ---- */
  .header {
    position: sticky;
    top: 0;
    z-index: 100;
    padding: 0;
    background: rgba(244, 245, 241, .92);
    -webkit-backdrop-filter: saturate(2) blur(20px);
    backdrop-filter: saturate(2) blur(20px);
    border-bottom: .5px solid rgba(0, 0, 0, .06);
  }
  .header-inner {
    grid-template-columns: auto 1fr auto;
    gap: 0;
    padding: 14px 20px 14px;
    max-width: 100%;
    align-items: center;
  }
  .brand-logo { width: 34px; height: 34px; border-radius: 9px; }
  .brand-text {
    font-size: 20px;
    font-weight: 700;
    letter-spacing: -.01em;
  }
  .main-nav { display: none; }

  /* 语言切换按钮 — 固定在右侧 */
  .header-actions {
    display: flex;
    justify-content: flex-end;
    min-width: 48px;
  }
  .header-actions .btn-primary { display: none !important; }
  .header-actions .btn-ghost {
    font-size: 12px;
    font-weight: 600;
    padding: 7px 16px;
    border-radius: 8px;
    color: var(--text);
    border-color: var(--line);
    background: rgba(255,255,255,.75);
    box-shadow: 0 1px 3px rgba(0,0,0,.04);
    transition: all .15s ease;
    white-space: nowrap;
    letter-spacing: .02em;
  }
  .header-actions .btn-ghost:hover {
    background: rgba(255,255,255,.9);
    transform: translateY(-1px);
  }
  .header-actions .btn-ghost:active {
    background: rgba(0,0,0,.05);
    transform: scale(.95);
  }

  /* ---- Hero — 搜索优先，保留关键信息 ---- */
  .hero {
    padding: 24px 0 28px;
    min-height: 0;
  }
  .hero-inner {
    padding: 0;
    gap: 0;
  }

  /* 标题 — 允许两行显示，避免截断 */
  .hero-left h1 {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    font-size: 28px;
    line-height: 1.22;
    letter-spacing: -.025em;
    font-weight: 700;
    color: #111;
    padding: 0;
    white-space: normal;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  /* 描述文字 — 显示一行，增加与搜索框的间距 */
  .hero-left p {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;  /* 英文可能需要两行 */
    margin-top: 12px;       /* 增加标题和描述的间距 */
    margin-bottom: 4px;     /* 增加描述和搜索框的间距 */
    color: #5f6672;
    font-size: 15px;
    line-height: 1.48;
    font-weight: 400;
  }

  /* 英文模式下的额外间距优化 */
  html[lang="en"] .hero-left h1,
  :root:has([lang="en"]) .hero-left h1 {
    -webkit-line-clamp: 2;
    line-height: 1.2;
  }

  html[lang="en"] .hero-left p,
  :root:has([lang="en"]) .hero-left p {
    margin-top: 14px;      /* 英文模式下更大的间距 */
    margin-bottom: 6px;
    font-size: 14.5px;
    -webkit-line-clamp: 2;  /* 英文描述允许两行 */
  }

  html[lang="en"] .search-box,
  :root:has([lang="en"]) .search-box {
    margin-top: 20px;      /* 英文模式下搜索框下移更多 */
  }

  /* 搜索框 — iOS Spotlight 风格圆角搜索框 */
  .search-box {
    margin-top: 16px;
    padding: 0 16px 0 16px;
    gap: 10px;
    border-radius: 13px;
    height: 50px;
    grid-template-columns: auto 1fr;
    background: var(--surface);
    border: 1px solid var(--line);
    box-shadow: 0 1px 4px rgba(0,0,0,.05), 0 2px 8px rgba(0,0,0,.03);
    transition: all .25s ease;
  }
  .search-box:focus-within {
    border-color: var(--green);
    box-shadow: 0 0 0 3px rgba(153, 223, 80, .12), 0 2px 8px rgba(0,0,0,.06);
    transform: translateY(-1px);
  }
  .search-icon {
    flex-shrink: 0;
    opacity: .5;
    width: 20px;
    height: 20px;
  }
  .search-box input {
    font-size: 17px;  /* 17px 防止 iOS 自动缩放 */
    padding: 0 4px;
    font-weight: 400;
    caret-color: var(--green);
  }
  .search-box input::placeholder {
    color: #9ca3af;
    font-size: 16px;
  }
  .search-box button { display: none; }

  /* Chips — iOS Segmented Control 风格（水平滚动） */
  .quick-tabs {
    margin-top: 14px;
    gap: 0;
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding: 2px 0 4px;
  }
  .quick-tabs::-webkit-scrollbar { display: none; }
  .tab {
    flex-shrink: 0;
    font-size: 14px;
    font-weight: 500;
    padding: 8px 18px;
    border-radius: 20px;
    border: 1.5px solid transparent;
    background: transparent;
    color: #8e959f;
    transition: all .2s ease;
    white-space: nowrap;
  }
  .tab:hover {
    background: rgba(0, 0, 0, .02);
  }
  .tab:active { transform: scale(.94); }
  .tab.active {
    background: var(--surface);
    color: var(--text);
    border-color: var(--line);
    box-shadow: 0 2px 6px rgba(0,0,0,.08);
    font-weight: 600;
  }

  /* 隐藏右侧装饰图 */
  .hero-right { display: none !important; }

  /* ---- 应用列表 — iOS 设置列表风格 + 卡片分组 ---- */
  .apps-section {
    padding: 24px 0 0;
  }
  .apps-meta {
    margin-bottom: 12px;
    padding: 0 4px;
  }
  .apps-meta span {
    font-size: 13px;
    color: #8e959f;
    font-weight: 500;
    letter-spacing: .01em;
    text-transform: uppercase;
  }

  .app-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  /* 列表卡片 — 圆角白底卡片，内部用分隔线 */
  .app-card {
    display: grid;
    grid-template-columns: 56px 1fr auto;
    grid-template-rows: auto auto;
    gap: 0 14px;
    padding: 16px 18px;
    border-radius: 16px;
    border: .5px solid var(--line-soft);
    background: var(--surface);
    box-shadow: 0 1px 4px rgba(0,0,0,.04), 0 2px 6px rgba(0,0,0,.03);
    transition: all .18s cubic-bezier(.25, .46, .45, .94);
    position: relative;
    overflow: hidden;
  }
  .app-card::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at 50% 0%, rgba(153, 223, 80, .08), transparent 70%);
    opacity: 0;
    transition: opacity .2s ease;
    pointer-events: none;
  }
  .app-card:active {
    transform: scale(.98);
    background: #fafbfa;
    box-shadow: 0 4px 12px rgba(0,0,0,.08);
  }
  .app-card:active::before {
    opacity: 1;
  }
  .app-card:hover {
    border-color: rgba(18, 24, 20, 0.12);
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(0,0,0,.06);
  }

  /* 图标 — 更大的 App Icon 风格 */
  .app-icon-wrap {
    width: 56px;
    height: 56px;
    margin-bottom: 0;
    grid-row: 1 / 3;
    align-self: center;
    border-radius: 14px;
    background: linear-gradient(145deg, #f8f9f7, #fff);
    box-shadow: 0 2px 10px rgba(0,0,0,.09), inset 0 .5px 0 rgba(255,255,255,.8);
    place-items: center;
    overflow: hidden;
    transition: transform .2s ease;
  }
  .app-icon-wrap svg { width: 30px; height: 30px; }
  .app-card:active .app-icon-wrap {
    transform: scale(.95);
  }

  /* 名称 — 粗体主文字 */
  .app-name {
    font-size: 16px;
    font-weight: 600;
    min-height: auto;
    line-height: 1.35;
    align-self: end;
    padding-top: 2px;
    letter-spacing: -.008em;
    color: #111;
    -webkit-line-clamp: 1;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }

  /* 描述 — 副标题灰字 */
  .app-desc {
    grid-column: 2;
    font-size: 13px;
    min-height: auto;
    margin-top: 4px;
    line-height: 1.4;
    -webkit-line-clamp: 2;
    color: #8c969d;
    font-weight: 400;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }

  /* 右侧箭头指示器 */
  .app-hit::after {
    content: '';
    display: block;
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    width: 7px;
    height: 12px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='7' height='12' viewBox='0 0 7 12'%3E%3Cpath d='M1 1l5 5-5 5' stroke='%23c5ccd3' fill='none' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    pointer-events: none;
    transition: transform .2s ease;
  }
  .app-card:active .app-hit::after {
    transform: translateY(-50%) translateX(2px);
  }
  .app-decor { display: none; }

  /* 分类标签 — 行内小标签 */
  .app-cat {
    display: inline-block;
    font-size: 11px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 6px;
    margin-left: 8px;
    vertical-align: middle;
    line-height: 1.7;
    letter-spacing: .01em;
  }

  .empty {
    border: none;
    background: var(--surface);
    border-radius: 16px;
    padding: 48px 24px;
    font-size: 15px;
    color: #8c969d;
    box-shadow: 0 1px 4px rgba(0,0,0,.04);
    text-align: center;
  }

  /* ---- 底部导航栏 — iOS Tab Bar 风格 ---- */
  .mobile-tab-bar {
    display: flex;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 200;
    height: var(--tab-bar-h);
    background: rgba(250, 251, 250, .94);
    -webkit-backdrop-filter: saturate(1.8) blur(24px);
    backdrop-filter: saturate(1.8) blur(24px);
    border-top: .5px solid rgba(0, 0, 0, .07);
    justify-content: space-around;
    align-items: center;
    padding-bottom: env(safe-area-inset-bottom, 0);
    padding-top: 4px;
  }
  .tab-bar-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    color: #a1aab5;
    font-size: 10px;
    font-weight: 500;
    padding: 6px 0 5px;
    min-width: 64px;
    transition: color .18s ease;
    -webkit-user-select: none;
    user-select: none;
    position: relative;
  }
  .tab-bar-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%) scaleX(0);
    width: 24px;
    height: 3px;
    background: var(--text);
    border-radius: 0 0 3px 3px;
    transition: transform .2s ease;
  }
  .tab-bar-item.active::before {
    transform: translateX(-50%) scaleX(1);
  }
  .tab-bar-item:active { transform: scale(.88); }
  .tab-bar-item.active { color: var(--text); }
  .tab-bar-item.active svg { stroke: var(--text); fill: var(--text); }
  .tab-bar-item svg { transition: all .18s ease; }

  /* Footer — 极简 */
  .footer {
    padding: 32px 0 12px;
  }
  .footer-inner {
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 4px;
    font-size: 11px;
    color: #b0b8bf;
  }

  /* 滚动优化 */
  * {
    -webkit-tap-highlight-color: transparent;
  }

  /* 输入框聚焦时防止页面放大 */
  input, textarea, select {
    font-size: 16px;
  }
}

/* 小屏手机优化 (iPhone SE 等) */
@media (max-width: 480px) {
  .container { width: calc(100% - 28px); }
  .header-inner { padding: 12px 16px 12px; }
  .brand-logo { width: 32px; height: 32px; border-radius: 8px; }
  .brand-text { font-size: 18px; }

  /* 语言切换按钮紧凑版 */
  .header-actions .btn-ghost {
    font-size: 11px;
    padding: 6px 13px;
    border-radius: 7px;
  }

  .hero { padding: 20px 0 24px; }

  /* 标题稍小 */
  .hero-left h1 {
    font-size: 26px;
    line-height: 1.2;
    -webkit-line-clamp: 2;
  }

  /* 描述文字 — 更小 */
  .hero-left p {
    font-size: 14px;
    margin-top: 10px;
    margin-bottom: 4px;
    -webkit-line-clamp: 1;
  }

  /* 英文模式 */
  html[lang="en"] .hero-left p,
  :root:has([lang="en"]) .hero-left p {
    margin-top: 12px;
    margin-bottom: 6px;
    font-size: 13.5px;
    -webkit-line-clamp: 2;
  }

  html[lang="en"] .search-box,
  :root:has([lang="en"]) .search-box {
    margin-top: 18px;
  }

  /* 搜索框紧凑 */
  .search-box {
    height: 46px;
    border-radius: 12px;
    margin-top: 14px;
    padding-left: 15px;
    padding-right: 15px;
  }
  .search-box input {
    font-size: 16px;
  }
  .search-box input::placeholder {
    font-size: 15px;
  }
  .search-icon {
    width: 18px;
    height: 18px;
  }

  /* Tab 紧凑 */
  .quick-tabs {
    margin-top: 12px;
  }
  .tab {
    font-size: 13px;
    padding: 7px 15px;
    border-radius: 18px;
  }

  /* 应用列表 */
  .apps-section { padding: 20px 0 0; }
  .app-grid { gap: 10px; }

  .app-card {
    padding: 14px 16px;
    border-radius: 14px;
    gap: 0 12px;
  }

  .app-icon-wrap {
    width: 52px;
    height: 52px;
    border-radius: 13px;
  }
  .app-icon-wrap svg { width: 28px; height: 28px; }

  .app-name { font-size: 15px; }
  .app-desc {
    font-size: 12px;
    line-height: 1.38;
    -webkit-line-clamp: 2;
  }

  .app-cat {
    font-size: 10px;
    padding: 1px 7px;
    border-radius: 5px;
  }

  /* 底部导航栏 */
  .tab-bar-item {
    min-width: 56px;
    padding: 5px 0 4px;
  }

  .empty {
    padding: 40px 20px;
    font-size: 14px;
  }
}

/* 超小屏手机 (iPhone SE 第一代等) */
@media (max-width: 375px) {
  .container { width: calc(100% - 24px); }
  .header-inner { padding: 10px 14px 10px; }
  .brand-logo { width: 30px; height: 30px; }
  .brand-text { font-size: 17px; }

  /* 语言切换按钮更紧凑 */
  .header-actions .btn-ghost {
    font-size: 11px;
    padding: 5px 11px;
    border-radius: 6px;
  }

  .hero-left h1 {
    font-size: 24px;
  }

  .hero-left p {
    font-size: 13px;
    margin-top: 8px;
    margin-bottom: 3px;
  }

  /* 英文模式 */
  html[lang="en"] .hero-left h1,
  :root:has([lang="en"]) .hero-left h1 {
    font-size: 23px;
    line-height: 1.18;
  }

  html[lang="en"] .hero-left p,
  :root:has([lang="en"]) .hero-left p {
    margin-top: 10px;
    margin-bottom: 5px;
    font-size: 12.5px;
    -webkit-line-clamp: 2;
  }

  html[lang="en"] .search-box,
  :root:has([lang="en"]) .search-box {
    margin-top: 16px;
  }

  .search-box {
    height: 44px;
    border-radius: 11px;
    padding-left: 14px;
    padding-right: 14px;
  }

  .search-box input {
    font-size: 15px;
  }

  .tab {
    font-size: 12px;
    padding: 6px 13px;
    border-radius: 16px;
  }

  .app-card {
    padding: 12px 14px;
    gap: 0 10px;
  }

  .app-icon-wrap {
    width: 48px;
    height: 48px;
    border-radius: 12px;
  }
  .app-icon-wrap svg { width: 26px; height: 26px; }

  .app-name { font-size: 14px; }
  .app-desc { font-size: 11px; }
}

/* 桌面端隐藏底部栏 */
@media (min-width: 769px) {
  .mobile-tab-bar { display: none; }
}

/* 横屏模式优化 */
@media (max-width: 768px) and (orientation: landscape) {
  :root {
    --tab-bar-h: 48px;
  }

  .header-inner { padding: 8px 18px; }
  .brand-logo { width: 28px; height: 28px; }
  .brand-text { font-size: 17px; }

  /* 语言切换按钮横屏紧凑 */
  .header-actions .btn-ghost {
    font-size: 11px;
    padding: 5px 12px;
  }

  .hero { padding: 12px 0 16px; }
  .hero-left h1 {
    font-size: 24px;
    -webkit-line-clamp: 1;
    white-space: nowrap;
  }

  .hero-left p {
    display: none;
  }

  .search-box {
    height: 40px;
    margin-top: 10px;
    border-radius: 11px;
  }

  /* 英文模式横屏 */
  html[lang="en"] .hero-left h1,
  :root:has([lang="en"]) .hero-left h1 {
    font-size: 22px;
  }

  .quick-tabs { margin-top: 8px; }
  .tab {
    font-size: 13px;
    padding: 6px 14px;
  }

  .apps-section { padding: 16px 0 0; }
  .app-card {
    padding: 12px 16px;
    grid-template-columns: 44px 1fr auto;
  }
  .app-icon-wrap {
    width: 44px;
    height: 44px;
    border-radius: 12px;
  }
  .app-icon-wrap svg { width: 24px; height: 24px; }
  .app-name { font-size: 14px; }
  .app-desc { font-size: 12px; -webkit-line-clamp: 1; }

  .mobile-tab-bar {
    height: var(--tab-bar-h);
  }
  .tab-bar-item {
    min-width: 50px;
    gap: 2px;
    padding: 4px 0 3px;
  }
  .tab-bar-item span { font-size: 9px; }
}

/* iPad 及大屏设备优化 */
@media (min-width: 769px) and (max-width: 1024px) {
  .hero-right {
    min-height: 380px;
  }

  .hero-icon-card {
    width: 68px;
    height: 68px;
    border-radius: 18px;
  }

  .app-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
  }

  .app-card {
    padding: 16px;
  }
}

/* iPhone X+ 安全区 */
@supports (padding-bottom: env(safe-area-inset-bottom)) {
  @media (max-width: 768px) {
    .footer { padding-bottom: calc(28px + env(safe-area-inset-bottom)); }
  }
}
