.android-page {
  --android-bg: #edf3f7;
  --android-surface: rgba(255, 255, 255, .78);
  --android-ink: #182331;
  --android-muted: #687789;
  --android-line: #d9e3ea;
  --android-accent: #315bff;
  background:
    radial-gradient(circle at 84% 10%, rgba(219, 232, 255, .78), transparent 28%),
    linear-gradient(145deg, #f4f7fa 0%, var(--android-bg) 52%, #e9f0f5 100%);
}

.android-modal-open { overflow: hidden; }

.android-shell {
  width: min(1480px, calc(100% - 32px));
  grid-template-columns: 132px minmax(0, 1fr) 248px;
  gap: 20px;
}

.android-rail {
  padding: 24px 12px 18px;
  background: rgba(255, 255, 255, .74);
  border-right: 1px solid rgba(206, 218, 227, .82);
  box-shadow: 10px 0 32px rgba(45, 69, 89, .04);
}

.rail-brand { gap: 9px; color: var(--android-ink); }
.rail-logo { width: 56px; height: 56px; border-radius: 18px; box-shadow: 0 8px 18px rgba(43, 74, 105, .12); }
.rail-home { margin: 24px 0 15px; font-size: 12px; }
.rail-nav { gap: 7px; }
.rail-platform { min-height: 44px; display: grid; place-items: center; border-radius: 12px; color: var(--android-muted); font-size: 12px; }
.rail-platform:hover, .rail-platform.is-active { background: #e9efff; color: var(--android-accent); font-weight: 700; }
.rail-community { min-height: 42px; border-radius: 12px; border-color: #b8c9ff; color: var(--android-accent); background: rgba(255, 255, 255, .82); }

.android-main { padding: 24px 0 72px; }
.android-header { min-height: 178px; padding: 26px 8px 24px; align-items: center; }
.android-header h1 { margin: 9px 0 12px; color: var(--android-ink); font-size: clamp(52px, 5vw, 76px); letter-spacing: -.07em; }
.android-header > div:first-child > p:last-child { max-width: 560px; color: var(--android-muted); }
.android-search-wrap { width: min(310px, 100%); }
.android-search-wrap label { margin-bottom: 9px; color: var(--android-muted); }
.android-search-wrap input { height: 48px; border-radius: 13px; border-color: #cdd9e3; background: rgba(255, 255, 255, .9); }

.android-directory {
  padding: 25px;
  border: 1px solid rgba(255, 255, 255, .9);
  border-radius: 24px;
  background: var(--android-surface);
  box-shadow: 0 20px 44px rgba(42, 65, 84, .08);
  backdrop-filter: blur(16px);
}

.directory-heading { padding-bottom: 20px; border-bottom-color: var(--android-line); }
.directory-heading h2 { margin-bottom: 6px; color: var(--android-ink); font-size: 24px; }
.directory-heading p, .directory-heading > span { color: var(--android-muted); }

.android-grid {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  padding-top: 20px;
}

.android-tile {
  min-height: 168px;
  padding: 18px;
  display: flex;
  flex-direction: column;
  border: 1px solid var(--android-line);
  border-radius: 16px;
  background: linear-gradient(145deg, #ffffff 0%, #f7fafc 100%);
  box-shadow: 0 8px 18px rgba(50, 75, 95, .06);
  cursor: pointer;
  outline: none;
  transition: transform .2s ease, border-color .2s ease, box-shadow .2s ease;
}

.android-tile:hover, .android-tile:focus-visible {
  transform: translateY(-3px);
  border-color: #afc0ff;
  box-shadow: 0 16px 30px rgba(50, 75, 95, .13);
}

.tile-top { align-items: flex-start; }
.tile-top img { width: 54px; height: 54px; border-radius: 15px; box-shadow: 0 5px 12px rgba(42, 64, 81, .12); }
.tile-top span { padding: 5px 8px; border: 1px solid #e0e7ef; border-radius: 999px; background: #f7f9fc; color: var(--android-muted); font-size: 10px; }
.tile-content { min-width: 0; flex: 1; }
.android-tile h3 { margin: 15px 0 7px; color: var(--android-ink); font-size: 16px; }
.android-tile p { height: auto; min-height: 38px; margin: 0; color: var(--android-muted); font-size: 12px; line-height: 1.6; -webkit-line-clamp: 2; }
.tile-footer { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-top: 15px; padding-top: 12px; border-top: 1px solid #e7edf2; }
.tile-date { margin: 0; color: #94a2ae; font-size: 10px; }
.tile-hint { color: var(--android-accent); font-size: 11px; font-weight: 700; white-space: nowrap; }
.tile-downloads { display: none; }

.directory-empty { padding: 90px 20px; }
.directory-empty strong { color: var(--android-ink); }
.directory-empty p { color: var(--android-muted); }

.latest-panel {
  min-height: 0;
  margin-top: 72px;
  padding: 20px;
  border: 1px solid rgba(210, 222, 231, .9);
  border-radius: 20px;
  background: rgba(255, 255, 255, .82);
  box-shadow: 0 16px 32px rgba(45, 69, 89, .07);
}

.latest-heading { padding-bottom: 15px; border-bottom-color: var(--android-line); }
.latest-heading h2 { color: var(--android-ink); font-size: 19px; }
.latest-heading span { background: #e9efff; color: var(--android-accent); }
.latest-list { gap: 6px; padding: 13px 0 16px; }
.latest-item {
  width: 100%;
  display: flex;
  gap: 10px;
  align-items: center;
  padding: 9px;
  border: 0;
  border-radius: 11px;
  background: transparent;
  color: inherit;
  text-align: left;
}
.latest-item:hover, .latest-item:focus-visible { background: #f0f4f8; outline: none; }
.latest-item img { width: 36px; height: 36px; border-radius: 10px; }
.latest-item strong { max-width: 150px; color: var(--android-ink); font-size: 12px; }
.latest-item small { color: var(--android-muted); }
.latest-back { padding-top: 14px; border-top-color: var(--android-line); color: var(--android-accent); }

.android-modal[hidden] { display: none; }
.android-modal { position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; padding: 24px; }
.android-modal-backdrop { position: absolute; inset: 0; background: rgba(15, 26, 39, .58); backdrop-filter: blur(6px); }
.android-detail-card {
  position: relative;
  width: min(430px, calc(100vw - 32px));
  max-height: calc(100vh - 48px);
  overflow: visible;
  padding: 70px 24px 24px;
  border: 1px solid rgba(255, 255, 255, .88);
  border-radius: 24px;
  background: linear-gradient(145deg, #eefbff 0%, #f9fff9 100%);
  box-shadow: 0 28px 80px rgba(7, 18, 31, .3);
  animation: android-detail-in .22s ease-out both;
}
.detail-logo { position: absolute; top: -42px; left: 50%; width: 82px; height: 82px; transform: translateX(-50%); border: 4px solid rgba(255, 255, 255, .96); border-radius: 23px; object-fit: cover; box-shadow: 0 11px 24px rgba(27, 58, 75, .2); }
.android-modal-close { position: absolute; top: 16px; right: 16px; min-width: 48px; min-height: 40px; padding: 8px 11px; border: 1px solid #c8d8df; border-radius: 10px; background: rgba(255, 255, 255, .74); color: var(--android-ink); font-size: 12px; }
.android-modal-close:hover, .android-modal-close:focus-visible { border-color: #9fb2ff; color: var(--android-accent); outline: none; }
.detail-body { max-height: calc(100vh - 160px); overflow: auto; text-align: center; }
.detail-category { display: inline-flex; padding: 5px 9px; border-radius: 999px; background: rgba(255, 255, 255, .72); color: var(--android-muted); font-size: 11px; }
.detail-body h2 { margin: 12px 0 8px; color: var(--android-ink); font-size: 28px; }
.detail-body > p { margin: 0 auto; max-width: 340px; color: var(--android-muted); font-size: 13px; line-height: 1.75; }
.detail-meta { margin-top: 12px; color: #8999a5; font-size: 11px; }
.detail-download-section { margin-top: 24px; text-align: left; }
.detail-section-title { margin-bottom: 10px; color: var(--android-ink); font-size: 13px; font-weight: 800; }
.detail-downloads { display: grid; gap: 8px; }
.detail-download { min-height: 50px; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 14px; border-radius: 13px; color: #fff; font-size: 13px; font-weight: 800; box-shadow: 0 8px 16px rgba(30, 55, 78, .12); transition: transform .2s ease, filter .2s ease; }
.detail-download:hover, .detail-download:focus-visible { transform: translateY(-2px); filter: brightness(.96); outline: none; }
.detail-download small { font-size: 11px; font-weight: 700; opacity: .88; }
.detail-download.drive-quark { background: #315bff; }
.detail-download.drive-baidu { background: #2d8cff; }
.detail-download.drive-uc { background: #ef8a2d; }
.detail-download.drive-thunder { background: #5d62dc; }
.detail-download.drive-lanzou { background: #16a36e; }
.detail-empty { margin: 0; padding: 14px; border: 1px dashed #c7d5df; border-radius: 12px; color: var(--android-muted); font-size: 12px; text-align: center; }

@keyframes android-detail-in {
  from { opacity: 0; transform: translateY(10px) scale(.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@media (prefers-reduced-motion: reduce) {
  .android-tile, .detail-download, .android-detail-card { transition: none; animation: none; }
}

@media (max-width: 1180px) {
  .android-shell { grid-template-columns: 96px minmax(0, 1fr); }
  .latest-panel { grid-column: 2; margin: 0 0 52px; position: static; }
  .latest-list { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 800px) {
  .android-shell { width: 100%; display: block; }
  .android-rail { min-height: auto; padding: 13px 16px; display: grid; grid-template-columns: auto 1fr auto; gap: 15px; align-items: center; position: static; border-right: 0; border-bottom: 1px solid var(--android-line); }
  .rail-brand { flex-direction: row; gap: 8px; }
  .rail-logo { width: 40px; height: 40px; border-radius: 12px; }
  .rail-home { margin: 0; }
  .rail-nav { display: flex; overflow-x: auto; gap: 5px; grid-column: 1 / -1; order: 3; padding-bottom: 2px; }
  .rail-platform { min-width: 84px; }
  .rail-community { width: auto; min-height: 40px; padding: 0 12px; margin: 0; }
  .android-main { padding: 18px 14px 40px; }
  .android-header { min-height: 0; padding: 15px 0 25px; display: block; }
  .android-search-wrap { width: 100%; margin-top: 20px; }
  .android-directory { padding: 17px; border-radius: 20px; }
  .android-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .latest-panel { margin: 0 14px 40px; }
  .latest-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 520px) {
  .android-grid { grid-template-columns: 1fr; }
  .latest-list { grid-template-columns: 1fr; }
  .android-tile { min-height: 176px; }
  .android-modal { padding: 16px; }
  .android-detail-card { width: min(430px, calc(100vw - 24px)); max-height: calc(100vh - 32px); padding-inline: 18px; }
}
