/* ==========================================================================
   All Apps page apps.css
   Desktop 1081-1920 / Mobile <1080. Replicates Figma node 624:1324.
   ========================================================================== */

.apps-page {
  padding: 28px 0 121px;
}

/* ----------------------------- Breadcrumb ----------------------------- */
.crumb {
  font-size: 16px;
  color: var(--t-400);
  display: flex;
  align-items: center;
  gap: 2px;
  margin-bottom: 30px;
}

.crumb a {
  color: var(--t-400);
  transition: color .15s;
}

.crumb a:hover {
  color: var(--orange);
}

.crumb span {
  color: var(--t-800);
}

/* ----------------------------- Filter panel ----------------------------- */
.filter-panel {
  background: #fff;
  border-radius: var(--r-card);
  padding: 42px 36px 34px;
}

/* Search bar */
.search-bar {
  display: flex;
  align-items: center;
  gap: 35px;
}

.search-field {
  position: relative;
  flex: 1;
  height: 70px;
  border: 1px solid #ddd;
  border-radius: 84px;
  display: flex;
  align-items: center;
}

.search-input {
  flex: 1;
  border: none;
  background: transparent;
  outline: none;
  padding: 0 180px 0 39px;
  font-size: 16px;
  color: var(--t-900);
}

.search-input::placeholder {
  color: var(--t-400);
}

.search-go {
  position: absolute;
  right: 4px;
  /* x; */
  top: 3px;
  width: 160px;
  height: 64px;
  border-radius: 84px;
  background: var(--orange);
  color: #fff;
  font-size: 20px;
  transition: filter .18s ease;
}

.search-go:hover {
  filter: brightness(1.06);
}

.filter-go {
  width: 160px;
  height: 64px;
  border-radius: 84px;
  flex-shrink: 0;
  background: #000;
  color: #fff;
  font-size: 20px;
  transition: filter .18s ease;
}

.filter-go:hover {
  filter: brightness(1.3);
}

/* Filter group */
.filter-group {
  margin-top: 35px;
}

.filter-group:first-of-type {
  margin-top: 53px;
}

.filter-label {
  position: relative;
  padding-left: 18px;
  font-weight: 900;
  font-size: 20px;
  color: var(--t-900);
  line-height: 1.5;
}

.filter-label::before {
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: clamp(2px, 0.53vw, 5.73px);
  height: 30px;
  background: var(--orange);
  border-radius: 2px;
}

.filter-chips {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 12px;
}

.fchip {
  font-family: var(--font-mi);
  font-size: 16px;
  color: #908d93;
  background: transparent;
  border-radius: 60px;
  height: 42px;
  padding: 0 20px;
  line-height: 1;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all .15s;
}

.fchip.active {
  background: var(--orange);
  color: #fff;
}

/* 「更多 N ▾ / 收起 ▲」折叠开关：橙色文字，读作操作而非筛选项（仅新增样式，不改原 chip 视觉） */
.fchip-toggle {
  color: var(--orange);
  cursor: pointer;
}

.fchip:not(.active):hover {
  color: var(--orange);
}

.desktop-prefix {
  display: none;
}

/* ----------------------------- Result count + compare + list (same white card) ----------------------------- */
.list-card {
  background: #fff;
  border-radius: var(--r-card);
  margin-top: 24px;
  padding: 42px 36px 26px;
}

.result-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.result-count {
  font-size: 16px;
  color: var(--t-400);
}

.result-count b {
  font-weight: 700;
  color: var(--t-600);
}

.compare-bar {
  display: flex;
  align-items: center;
  gap: 28px;
}

.compare-hint {
  font-size: 16px;
  color: var(--t-400);
}

.compare-btn {
  background: #000;
  color: #fff;
  font-size: 16px;
  height: 44px;
  padding: 0 30px;
  border-radius: 84px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: filter .18s ease;
}

.compare-btn:hover {
  filter: brightness(1.3);
}

/* ----------------------------- App list ----------------------------- */
.app-list {
  margin-top: 38px;
}

.app-row {
  display: flex;
  align-items: center;
  gap: 25px;
  min-height: 158px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--line-1);
}

.app-row:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.app-icon {
  width: 96px;
  height: 96px;
  flex-shrink: 0;
  border: 1px solid var(--line-1);
  border-radius: var(--r-sm);
  overflow: hidden;
}

.app-icon img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.app-info {
  flex: 1;
  min-width: 0;
}

.app-name {
  font-weight: 500;
  font-size: 20px;
  color: var(--t-700);
}

.app-sub {
  font-weight: 300;
  font-size: 16px;
  color: var(--t-600);
  margin-top: 14px;
}

.app-tags {
  display: flex;
  gap: 10px;
  margin-top: 14px;
}

.atag {
  background: #f6f6f6;
  color: var(--rank-x);
  font-family: var(--font-mi);
  font-size: 14px;
  border-radius: 60px;
  padding: 5px 16px;
  white-space: nowrap;
}

.app-dl,
.app-rate {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
  font-size: 16px;
  color: var(--t-400);
}

.app-dl {
  width: 110px;
}

.app-rate {
  width: 70px;
}

.ic-dl {
  width: 17px;
  height: 20px;
  flex-shrink: 0;
  background: #1296db;
  -webkit-mask: url('../img/apps/apps-download.svg') center / contain no-repeat;
  mask: url('../img/apps/apps-download.svg') center / contain no-repeat;
}

.ic-star {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  background: var(--orange);
  -webkit-mask: url('../img/common/star-a.svg') center / contain no-repeat;
  mask: url('../img/common/star-a.svg') center / contain no-repeat;
}

.app-act {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-shrink: 0;
}

.app-btn {
  font-family: var(--font-sc);
  font-size: 16px;
  padding: 12px 30px;
  line-height: 1;
}

/* ==========================================================================
   Responsive - mobile (<1080)
   ========================================================================== */
@media (max-width: 1080px) {
  .apps-page {
    padding: clamp(18px, 4.72vw, 51px) 0 16px;
  }

  .crumb {
    font-size: clamp(10px, 2.59vw, 28px);
    margin-bottom: clamp(17px, 4.54vw, 49px);
  }

  /* Filter panel */
  .filter-panel {
    border-radius: var(--r-card);
    padding: clamp(17px, 4.54vw, 49px) clamp(11px, 2.96vw, 32px) clamp(23px, 6vw, 64.8px);
  }

  .search-bar {
    gap: clamp(6px, 1.67vw, 18px);
  }

  .search-field {
    height: 42px;
    min-width: 0;
    flex: 1 1 0;
  }

  .search-input {
    padding: 0 82px 0 15px;
    font-size: clamp(10px, 2.59vw, 28px);
    min-width: 0;
    width: 100%;
    color: #999999;
  }

  .search-go {
    width: clamp(67px, 17.78vw, 192px);
    height: clamp(29px, 7.78vw, 84px);
    top: clamp(4px, 0.46vw, 5px);
    right: clamp(2px, 0.46vw, 5px);
    font-size: clamp(10px, 2.59vw, 28px);
  }

  .filter-go {
    width: clamp(67px, 17.78vw, 192px);
    height: clamp(29px, 7.78vw, 84px);
    font-size: clamp(10px, 2.59vw, 28px);
  }

  .filter-group {
    margin-top: clamp(24px, 6.28vw, 67.87px);
  }

  .filter-group:first-of-type {
    margin-top: 18px;
  }

  .filter-label {
    font-size: clamp(13px, 3.33vw, 36px);
    padding-left: clamp(9px, 2.39vw, 25.8px);
  }

  .filter-label::before {
    height: clamp(15px, 3.98vw, 43px);
  }

  /* Filter chips scroll horizontally */
  .filter-chips {
    flex-wrap: nowrap;
    overflow-x: auto;
    gap: clamp(2px, 0.66vw, 7.17px);
    margin-top: clamp(10px, 2.6vw, 28.13px);
    -ms-overflow-style: none;
    scrollbar-width: none;
    padding-bottom: 2px;
    background: #FAFAFA;
    border-radius: clamp(14px, 3.65vw, 39.42px);
    width: 100%;
  }

  .filter-chips::-webkit-scrollbar {
    display: none;
  }

  /* 可折叠组（监管/特色）：移动端改为换行折叠（配合「更多」），不再横滑 */
  .filter-chips[data-collapsible] {
    flex-wrap: wrap;
    overflow-x: visible;
  }

  .fchip {
    font-size: clamp(10px, 2.59vw, 28px);
    height: 28px;
    padding: 0 clamp(13px, 3.39vw, 36.57px);
    flex-shrink: 0;
  }

  .filter-panel .filter-group:nth-of-type(4) .filter-chips {
    gap: clamp(2px, 0.66vw, 7.17px);
    display: flex;
    justify-content: flex-start;
  }

  /* 特色 chip 宽度按内容自适应（移除原固定宽度+padding:0，避免动态标签被截断；保留 base .fchip 的药丸样式） */

  /* List white card: compact padding */
  .list-card {
    margin-top: clamp(10px, 2.78vw, 30px);
    padding: clamp(13px, 3.52vw, 38px) clamp(18px, 4.81vw, 52px) clamp(11px, 3.06vw, 33px) clamp(11px, 3.06vw, 33px);
    border-radius: clamp(8px, 2.22vw, 24px);
  }

  /* Result count + compare: keep on one line (same row as in the design) */
  .result-bar {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 0;
    margin-top: 0;
    flex-wrap: nowrap;
  }

  .result-count {
    font-size: clamp(8px, 2.22vw, 24px);
    flex-shrink: 0;
  }

  .compare-bar {
    gap: clamp(16px, 4.26vw, 46px);
    min-width: 0;
    justify-content: flex-end;
  }

  .compare-hint {
    font-size: clamp(8px, 2.22vw, 24px);
    color: var(--t-400);
    white-space: nowrap;
    flex: 0 0 auto;
  }

  .compare-btn {
    height: clamp(26px, 7.04vw, 76px);
    padding: 0 16px;
    font-size: clamp(8px, 2.22vw, 24px);
    flex-shrink: 0;
    width: clamp(74px, 19.81vw, 214px);
  }

  /* App list: name + downloads + rating on one line, subtitle/tags below, buttons stacked vertically on the right (per design) */
  .app-list {
    margin-top: 0;
    padding: 0;
  }

  .app-row {
    height: auto;
    min-height: 90px;
    gap: 8px;
    padding: 8px 0;
    flex-wrap: nowrap;
    align-items: center;
  }

  .app-icon {
    width: 58px;
    height: 58px;
    order: 1;
  }

  .app-info {
    flex: 0 0 74px;
    min-width: 0;
    order: 2;
  }

  .app-name {
    font-size: clamp(13px, 3.33vw, 36px);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .app-sub {
    font-size: clamp(10px, 2.59vw, 28px);
    margin-top: clamp(6px, 1.67vw, 18px);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    width: min(190px, calc(100vw - 220px));
  }

  .app-tags {
    gap: 5px;
    margin-top: clamp(6px, 1.67vw, 18px);
    flex-wrap: nowrap;
    overflow: hidden;
    width: min(190px, calc(100vw - 220px));
  }

  .atag {
    font-size: 9px;
    padding: 2px 8px;
    flex-shrink: 0;
  }

  /* Downloads / rating: top-aligned, following the name line on the right */
  .app-dl,
  .app-rate {
    width: auto;
    font-size: clamp(8px, 2.22vw, 24px);
    align-self: flex-start;
    gap: 3px;
    flex-shrink: 0;
    margin-top: 13px;
  }

  .app-dl {
    order: 3;
  }

  .app-rate {
    order: 4;
    font-size: clamp(8px, 2.22vw, 24px);
  }

  .ic-dl {
    width: 10px;
    height: 12px;
  }

  .ic-star {
    width: 10px;
    height: 10px;
  }

  /* Action buttons: stacked vertically on the right */
  .app-act {
    order: 5;
    flex-direction: column;
    gap: clamp(5px, 1.3vw, 14px);
    flex-shrink: 0;
    margin-left: auto;
    align-self: center;
    align-items: stretch;
  }

  .app-btn {
    font-size: clamp(10px, 2.59vw, 28px);
    padding: 6px 13px;
    text-align: center;
    min-width: 52px;
  }
}

@media (min-width: 1081px) {
  .apps-page {
    padding-bottom: 121px;
  }

  .filter-panel {
    padding: 49px 36px 54px 36px;
  }

  .search-bar+.filter-group {
    margin-top: 43px;
  }

  .filter-group+.filter-group {
    margin-top: 40px;
  }

  .filter-group+.filter-group+.filter-group {
    margin-top: 51px;
  }

  .filter-chips {
    display: flex;
    flex-wrap: wrap;
    width: 100%;
    min-height: 55px;
    align-items: center;
    gap: 5px;
    margin-top: 26px;
    padding: 6px;
    background: var(--bg-soft);
    border-radius: 81px;
  }

  .filter-chips .fchip {
    height: 42px;
    padding: 0 18px;
    min-width: 88px;          /* 贴近原始固定宽度的下限：短标签仍是宽 pill，够多即换行→出现「更多」 */
  }

  .desktop-prefix {
    display: inline;
  }

  /* 各组按位置写死的 chip 宽度 + 选中项 90px 已移除：chip 现为动态/改名内容，宽度交给内容自适应 */

  .result-bar {
    transform: translateY(5px);
  }

  .compare-bar {
    gap: 20px;
  }

  .compare-btn {
    width: 114px;
    padding: 0;
  }

  .search-go {
    top: 2px;
  }

  .list-card {
    padding-bottom: 8px;
  }

  .app-row {
    align-items: flex-start;
    min-height: 0;
    padding-bottom: 30px;
    margin-top: 34px;
  }

  .app-row:last-child {
    min-height: 126px;
    padding-bottom: 0;
  }

  .app-info {
    flex: 0 0 436px;
    padding-top: 5px;
  }

  .app-name {
    line-height: 23px;
  }

  .app-sub {
    margin-top: 6px;
    line-height: 19px;
  }

  .app-tags {
    margin-top: 11px;
  }

  .atag {
    display: inline-flex;
    align-items: center;
    height: 27px;
    padding: 0 16px;
  }

  .app-dl,
  .app-rate {
    margin-top: 31px;
  }

  .app-act {
    gap: 20px;
    margin-top: 16px;
    margin-left: 68px;
  }

  .app-btn {
    width: 114px;
    height: 48px;
    padding: 0;
  }

  .app-icon img {
    transform: scale(1.16);
  }
}

@media (max-width: 560px) {
  .app-row {
    gap: clamp(12px, 3.24vw, 35px);
    padding: clamp(16px, 4.26vw, 46px) 0;
  }

  .app-icon {
    width: 58px;
    height: 58px;
  }

  /* Compact name line: shrink downloads/rating but keep text (the design still shows it at this width) */
  .app-dl,
  .app-rate {
    gap: clamp(3px, 0.74vw, 8px);
  }

  .ic-dl {
    width: 10px;
    height: 12px;
  }

  .ic-star {
    width: 10px;
    height: 10px;
  }

  .app-act {
    gap: clamp(5px, 1.3vw, 14px);
  }

  .app-btn {
    padding: 6px 13px;
    font-size: clamp(10px, 2.59vw, 28px);
    width: clamp(74px, 19.81vw, 214px);
    height: clamp(25px, 6.67vw, 72px);
  }

  .atag {
    font-size: clamp(7px, 1.85vw, 20px);
    padding: clamp(2px, 0.46vw, 5px) clamp(6px, 1.48vw, 16px);
  }
}

/* ==========================================================================
   平台对比：卡片「对比」勾选 + 弹窗（沿用站内 token：橙色 / 圆角 / 药丸 / 灰线）
   ========================================================================== */
/* 弹窗内：平台选择列表 */
.cmp-body { flex: 1; min-height: 0; display: flex; flex-direction: column; overflow: hidden; }
.cmp-pick { padding: 18px 28px 16px; border-bottom: 1px solid var(--line-1); }
.cmp-pick-hint { font-size: 15px; color: var(--t-600); margin-bottom: 12px; }
.cmp-count { color: var(--orange); font-weight: 700; }
.cmp-pick-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 10px;
  max-height: 230px;
  overflow: auto;
}
.cmp-pick-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border: 1px solid var(--line-1);
  border-radius: var(--r-sm);
  cursor: pointer;
  transition: all .15s;
}
.cmp-pick-item:hover { border-color: var(--orange-soft); }
.cmp-pick-item.is-on { border-color: var(--orange); background: var(--bg-soft); }
.cmp-pick-item input { width: 16px; height: 16px; margin: 0; flex-shrink: 0; accent-color: var(--orange); cursor: pointer; }
.cmp-pick-ico { width: 34px; height: 34px; flex-shrink: 0; border: 1px solid var(--line-1); border-radius: 8px; overflow: hidden; }
.cmp-pick-ico img { width: 100%; height: 100%; object-fit: cover; }
.cmp-pick-name { font-size: 14px; color: var(--t-700); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cmp-empty { padding: 44px 0; text-align: center; color: var(--t-400); font-size: 15px; }
.cmp-table[hidden] { display: none; }

.cmp-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.cmp-modal[hidden] { display: none; }
.cmp-mask { position: absolute; inset: 0; background: rgba(0, 0, 0, .5); }
.cmp-dialog {
  position: relative;
  width: 100%;
  max-width: 920px;
  max-height: 86vh;
  display: flex;
  flex-direction: column;
  background: var(--bg-white);
  border-radius: var(--r-card);
  box-shadow: var(--shadow-card);
  overflow: hidden;
}
.cmp-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 22px 28px;
  border-bottom: 1px solid var(--line-1);
}
.cmp-title {
  display: flex;
  align-items: center;
  font-family: var(--font-sc);
  font-weight: 700;
  font-size: 22px;
  color: var(--t-900);
}
.cmp-title::before {
  content: "";
  width: 5px;
  height: 20px;
  margin-right: 12px;
  background: var(--orange);
  border-radius: 2px;
}
.cmp-close {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  font-size: 24px;
  line-height: 1;
  color: var(--t-400);
  background: var(--bg-soft);
  transition: all .15s;
}
.cmp-close:hover { background: var(--orange); color: #fff; }
.cmp-scroll { flex: 1; min-height: 0; overflow: auto; padding: 6px 28px 28px; }

.cmp-table { width: 100%; border-collapse: collapse; table-layout: fixed; }
.cmp-table th,
.cmp-table td {
  padding: 16px 14px;
  text-align: center;
  vertical-align: middle;
  border-bottom: 1px solid var(--line-1);
}
.cmp-table tr:last-child th,
.cmp-table tr:last-child td { border-bottom: none; }
.cmp-dim {
  width: 92px;
  text-align: left;
  font-family: var(--font-mi);
  font-weight: 400;
  font-size: 15px;
  color: var(--t-400);
  white-space: nowrap;
}
.cmp-appicon {
  width: 60px;
  height: 60px;
  margin: 0 auto 10px;
  border: 1px solid var(--line-1);
  border-radius: var(--r-sm);
  overflow: hidden;
}
.cmp-appicon img { width: 100%; height: 100%; object-fit: cover; }
.cmp-appname {
  font-family: var(--font-sc);
  font-weight: 500;
  font-size: 17px;
  color: var(--t-800);
  line-height: 1.3;
}
.cmp-val { font-family: var(--font-mi); font-size: 16px; color: var(--t-700); }
.cmp-val .ic-star { display: inline-block; vertical-align: -2px; margin-right: 4px; }
.cmp-muted { color: var(--t-300); }
.cmp-pills { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; }
.cmp-pill {
  background: var(--bg-tag);
  color: var(--rank-x);
  font-family: var(--font-mi);
  font-size: 13px;
  border-radius: var(--r-pill);
  padding: 4px 12px;
  white-space: nowrap;
}
.cmp-dl { font-family: var(--font-sc); font-size: 15px; padding: 9px 26px; }

@media (max-width: 1080px) {
  .cmp-pick { padding: 14px 16px 12px; }
  .cmp-pick-hint { font-size: 13px; margin-bottom: 10px; }
  .cmp-pick-list { grid-template-columns: 1fr 1fr; gap: 8px; max-height: 38vh; }
  .cmp-pick-item { padding: 6px 9px; gap: 7px; }
  .cmp-pick-ico { width: 28px; height: 28px; }
  .cmp-pick-name { font-size: 12px; }
  .cmp-empty { padding: 28px 0; font-size: 13px; }
  .cmp-modal { padding: 12px; }
  .cmp-head { padding: 15px 16px; }
  .cmp-title { font-size: 17px; }
  .cmp-title::before { height: 16px; margin-right: 8px; }
  .cmp-close { width: 30px; height: 30px; font-size: 20px; }
  .cmp-scroll { padding: 4px 12px 16px; }
  .cmp-table th, .cmp-table td { padding: 11px 7px; }
  .cmp-dim { width: 56px; font-size: 12px; }
  .cmp-appicon { width: 42px; height: 42px; margin-bottom: 7px; }
  .cmp-appname { font-size: 13px; }
  .cmp-val { font-size: 13px; }
  .cmp-pill { font-size: 11px; padding: 3px 9px; }
  .cmp-dl { font-size: 12px; padding: 7px 14px; }
}
