/* ==========================================================================
   Google Design / Material 3 Flat Style System (Light & Dark Auto)
   ========================================================================== */

:root {
  color-scheme: light dark;

  --bg-page: #F8F9FA;
  --bg-surface: #FFFFFF;
  --bg-surface-alt: #F1F3F4;
  --bg-topbar: rgba(255, 255, 255, 0.92);
  --bg-backdrop: rgba(32, 33, 36, 0.48);

  --border-hairline: #DADCE0;
  --border-subtle: #E8EAED;
  --border-hover: #BDC1C6;

  --text-primary: #202124;
  --text-secondary: #5F6368;
  --text-muted: #80868B;

  --google-blue: #1A73E8;
  --google-blue-soft: #E8F0FE;
  --google-blue-hover: #D2E3FC;
  --google-blue-solid-hover: #1557B0;

  --google-green: #1E8E3E;
  --google-green-soft: #E6F4EA;

  --google-amber: #E37400;
  --google-amber-soft: #FEF7E0;
  --notice-border: #FDE293;
  --notice-text: #8A4B00;

  --google-red: #D93025;
  --google-red-border: #FAD2CF;

  --icon-star: #F9AB00;
  --icon-fork: #1A73E8;
  --icon-tag: #1E8E3E;

  --gen1-color: #1A73E8;
  --gen1-soft: #E8F0FE;
  --gen2-color: #1E8E3E;
  --gen2-soft: #E6F4EA;
  --gen3-color: #E37400;
  --gen3-soft: #FEF7E0;

  --skeleton-base: #FFFFFF;
  --skeleton-shine: #F1F3F4;

  --toast-bg: #303134;
  --toast-text: #FFFFFF;

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-pill: 9999px;

  --font-sans: 'Inter', 'Noto Sans SC', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg-page: #131314;
    --bg-surface: #1E1F20;
    --bg-surface-alt: #282A2C;
    --bg-topbar: rgba(19, 19, 20, 0.90);
    --bg-backdrop: rgba(0, 0, 0, 0.68);

    --border-hairline: #3C4043;
    --border-subtle: #2D2F31;
    --border-hover: #5F6368;

    --text-primary: #E8EAED;
    --text-secondary: #9AA0A6;
    --text-muted: #7F868D;

    --google-blue: #8AB4F8;
    --google-blue-soft: rgba(138, 180, 248, 0.16);
    --google-blue-hover: rgba(138, 180, 248, 0.25);
    --google-blue-solid-hover: #AECBFA;

    --google-green: #81C995;
    --google-green-soft: rgba(129, 201, 149, 0.16);

    --google-amber: #FDD663;
    --google-amber-soft: rgba(253, 214, 99, 0.15);
    --notice-border: rgba(253, 214, 99, 0.32);
    --notice-text: #FDD663;

    --google-red: #F28B82;
    --google-red-border: rgba(242, 139, 130, 0.35);

    --icon-star: #FDD663;
    --icon-fork: #8AB4F8;
    --icon-tag: #81C995;

    --gen1-color: #8AB4F8;
    --gen1-soft: rgba(138, 180, 248, 0.16);
    --gen2-color: #81C995;
    --gen2-soft: rgba(129, 201, 149, 0.16);
    --gen3-color: #FFB74D;
    --gen3-soft: rgba(255, 183, 77, 0.16);

    --skeleton-base: #1E1F20;
    --skeleton-shine: #282A2C;

    --toast-bg: #E8EAED;
    --toast-text: #202124;
  }
}

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

html,
body {
  margin: 0;
  padding: 0;
  background-color: var(--bg-page);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}

.tabular-nums {
  font-variant-numeric: tabular-nums;
}

.hidden {
  display: none !important;
}

.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ==========================================================================
   Generation Color Themes
   ========================================================================== */

.gen-1 {
  --gen-color: var(--gen1-color);
  --gen-soft: var(--gen1-soft);
}

.gen-2 {
  --gen-color: var(--gen2-color);
  --gen-soft: var(--gen2-soft);
}

.gen-3 {
  --gen-color: var(--gen3-color);
  --gen-soft: var(--gen3-soft);
}

/* ==========================================================================
   Top App Bar
   ========================================================================== */

.top-bar {
  position: sticky;
  top: 0;
  z-index: 30;
  background-color: var(--bg-topbar);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-subtle);
}

.top-bar-inner {
  min-height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-top: 8px;
  padding-bottom: 8px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.brand-logo-wrap {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: var(--bg-surface-alt);
  border: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  flex-shrink: 0;
}

.brand-logo {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.brand-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.brand-title {
  margin: 0;
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--text-primary);
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.brand-subtitle {
  font-size: 12px;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 12px;
  border-radius: var(--radius-pill);
  background: var(--bg-surface-alt);
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
}

.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--google-green);
  flex-shrink: 0;
}

.status-pill.is-loading .status-dot {
  background: var(--google-blue);
}

.status-pill.is-warning .status-dot {
  background: var(--google-amber);
}

/* ==========================================================================
   Buttons
   ========================================================================== */

button {
  font-family: inherit;
  cursor: pointer;
}

.btn-tonal {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 36px;
  padding: 0 16px;
  border: none;
  border-radius: var(--radius-pill);
  background-color: var(--google-blue-soft);
  color: var(--google-blue);
  font-size: 13px;
  font-weight: 500;
  transition: background-color 0.15s ease;
  white-space: nowrap;
}

.btn-tonal:hover:not(:disabled) {
  background-color: var(--google-blue-hover);
}

.btn-tonal:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 38px;
  padding: 0 20px;
  border: none;
  border-radius: var(--radius-pill);
  background-color: var(--google-blue);
  color: #FFFFFF;
  font-size: 13px;
  font-weight: 500;
  transition: background-color 0.15s ease;
}

@media (prefers-color-scheme: dark) {
  .btn-primary {
    color: #131314;
  }
}

.btn-primary:hover {
  background-color: var(--google-blue-solid-hover);
}

.btn-text {
  background: transparent;
  border: none;
  color: var(--google-blue);
  font-size: 13px;
  font-weight: 500;
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  transition: background-color 0.15s ease;
  white-space: nowrap;
}

.btn-text:hover {
  background-color: var(--google-blue-soft);
}

.btn-icon {
  width: 36px;
  height: 36px;
  border: none;
  border-radius: 50%;
  background: transparent;
  color: var(--text-secondary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.btn-icon:hover {
  background: var(--bg-surface-alt);
  color: var(--text-primary);
}

.is-spinning .icon-refresh {
  animation: spin 0.9s linear infinite;
}

@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

/* ==========================================================================
   Main Layout & Banners
   ========================================================================== */

.main-content {
  padding-top: 28px;
  padding-bottom: 48px;
}

.notice-banner {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 16px;
  margin-bottom: 20px;
  border-radius: var(--radius-md);
  background: var(--google-amber-soft);
  border: 1px solid var(--notice-border);
  color: var(--notice-text);
  font-size: 13px;
  line-height: 1.5;
}

.notice-icon {
  flex-shrink: 0;
  margin-top: 2px;
}

.error-panel {
  padding: 28px 24px;
  margin-bottom: 24px;
  border-radius: var(--radius-lg);
  background: var(--bg-surface);
  border: 1px solid var(--google-red-border);
  text-align: center;
}

.error-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--google-red);
  margin-bottom: 6px;
}

.error-message {
  margin: 0 0 16px;
  color: var(--text-secondary);
  font-size: 13px;
}

.section {
  margin-bottom: 36px;
}

.section-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.section-title {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--text-primary);
}

.section-desc {
  margin: 4px 0 0;
  font-size: 13px;
  color: var(--text-secondary);
}

.summary-chip,
.trend-meta {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-secondary);
  background: var(--bg-surface);
  border: 1px solid var(--border-hairline);
  padding: 5px 12px;
  border-radius: var(--radius-pill);
}

/* ==========================================================================
   Project Cards Grid (Gen 1 | Gen 2 | Gen 3)
   ========================================================================== */

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

.project-card {
  display: flex;
  flex-direction: column;
  background: var(--bg-surface);
  border: 1px solid var(--border-hairline);
  border-radius: var(--radius-lg);
  padding: 22px;
  transition: border-color 0.18s ease;
}

.project-card:hover {
  border-color: var(--border-hover);
}

.card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 14px;
}

.gen-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  font-size: 12px;
  font-weight: 600;
  background: var(--gen-soft);
  color: var(--gen-color);
}

.gen-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--gen-color);
}

.version-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: var(--radius-pill);
  background: var(--bg-surface-alt);
  color: var(--text-primary);
  font-size: 12px;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  max-width: 150px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.card-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 6px;
}

.card-title {
  margin: 0;
  font-size: 19px;
  font-weight: 600;
  letter-spacing: -0.015em;
  color: var(--text-primary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.icon-link {
  color: var(--text-muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  flex-shrink: 0;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.icon-link:hover {
  background: var(--bg-surface-alt);
  color: var(--text-primary);
}

.card-desc {
  margin: 0 0 18px;
  font-size: 13px;
  color: var(--text-secondary);
  min-height: 40px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* 主数据块：总下载量 */
.hero-metric {
  padding: 14px 16px;
  border-radius: var(--radius-md);
  background: var(--bg-page);
  border: 1px solid var(--border-subtle);
  margin-bottom: 12px;
}

.metric-label {
  font-size: 12px;
  color: var(--text-secondary);
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.metric-label-with-icon {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.metric-icon {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}

.metric-icon-download {
  color: var(--gen-color);
}

.metric-icon-star {
  color: var(--icon-star);
}

.metric-icon-fork {
  color: var(--icon-fork);
}

.metric-icon-tag {
  color: var(--icon-tag);
}

.hero-metric-value {
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text-primary);
  line-height: 1.15;
}

/* 次要三项指标：Star / Fork / 最新版（带 SVG 图标） */
.sub-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 20px;
}

.sub-metric-box {
  padding: 10px 10px;
  border-radius: var(--radius-sm);
  background: var(--bg-page);
  border: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.sub-metric-label {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  font-weight: 500;
  color: var(--text-secondary);
  white-space: nowrap;
}

.sub-metric-value {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sub-metric-version {
  font-size: 13px;
  line-height: 22px;
}

.card-footer {
  margin-top: auto;
  padding-top: 2px;
}

.btn-card-detail {
  width: 100%;
  height: 40px;
  border: 1px solid var(--border-hairline);
  border-radius: var(--radius-pill);
  background: var(--bg-surface);
  color: var(--text-primary);
  font-size: 13px;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.btn-card-detail:hover {
  background: var(--google-blue-soft);
  border-color: transparent;
  color: var(--google-blue);
}

/* 骨架屏 */
.skeleton-card {
  min-height: 320px;
  background: linear-gradient(90deg, var(--skeleton-base) 25%, var(--skeleton-shine) 50%, var(--skeleton-base) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.4s infinite;
}

@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ==========================================================================
   Charts Layout
   ========================================================================== */

.charts-layout {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
}

.chart-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-hairline);
  border-radius: var(--radius-lg);
  padding: 20px 22px;
  min-width: 0;
}

.chart-card-wide {
  grid-column: 1 / -1;
}

.chart-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.chart-title {
  margin: 0;
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
}

.chart-subtitle {
  font-size: 12px;
  color: var(--text-secondary);
}

.chart-tag {
  font-size: 11px;
  font-weight: 500;
  color: var(--text-secondary);
  background: var(--bg-surface-alt);
  padding: 3px 9px;
  border-radius: var(--radius-pill);
  flex-shrink: 0;
}

.chart-canvas-wrap {
  position: relative;
  height: 240px;
  width: 100%;
}

.chart-canvas-wide {
  height: 280px;
}

/* ==========================================================================
   Footer
   ========================================================================== */

.site-footer {
  border-top: 1px solid var(--border-subtle);
  background: var(--bg-surface);
  padding: 18px 0;
}

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-size: 12px;
  color: var(--text-muted);
  flex-wrap: wrap;
}

/* ==========================================================================
   Detail Modal (Fixed Internal Scrolling + Mobile Friendly)
   ========================================================================== */

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 60;
  background: var(--bg-backdrop);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal-surface {
  width: 100%;
  max-width: 880px;
  height: min(86vh, 820px);
  height: min(86dvh, 820px);
  background: var(--bg-surface);
  border-radius: 20px;
  border: 1px solid var(--border-hairline);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.modal-header {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 24px;
  border-bottom: 1px solid var(--border-subtle);
}

.modal-title-group {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  min-width: 0;
}

.modal-title {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
  color: var(--text-primary);
}

.modal-stats-bar {
  flex: 0 0 auto;
  display: flex;
  flex-wrap: wrap;
  gap: 12px 20px;
  padding: 12px 24px;
  background: var(--bg-page);
  border-bottom: 1px solid var(--border-subtle);
  font-size: 13px;
  color: var(--text-secondary);
}

.modal-stat-item {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.modal-stat-item strong {
  color: var(--text-primary);
  font-weight: 600;
}

.modal-toolbar {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 24px;
  border-bottom: 1px solid var(--border-subtle);
}

.search-box {
  flex: 1;
  max-width: 360px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 12px;
  height: 36px;
  border-radius: var(--radius-pill);
  background: var(--bg-surface-alt);
  color: var(--text-secondary);
}

.search-box input {
  width: 100%;
  border: none;
  background: transparent;
  outline: none;
  font-family: inherit;
  font-size: 13px;
  color: var(--text-primary);
}

/* 关键修复：使用 block 布局 + flex: 1 1 auto + min-height: 0，彻底杜绝子项被压缩堆叠 */
.modal-body {
  flex: 1 1 auto;
  min-height: 0;
  display: block;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  padding: 16px 24px 24px;
}

.release-item {
  display: block;
  margin-bottom: 12px;
  border: 1px solid var(--border-hairline);
  border-radius: var(--radius-md);
  background: var(--bg-surface);
}

.release-item:last-child {
  margin-bottom: 0;
}

.release-summary {
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  cursor: pointer;
  user-select: none;
  border-radius: var(--radius-md);
  transition: background-color 0.15s ease;
}

.release-summary::-webkit-details-marker {
  display: none;
}

.release-summary:hover {
  background: var(--bg-page);
}

.release-chevron {
  width: 16px;
  height: 16px;
  color: var(--text-muted);
  flex-shrink: 0;
  transition: transform 0.18s ease;
}

.release-item[open] .release-chevron {
  transform: rotate(90deg);
}

.release-left {
  display: flex;
  align-items: center;
  gap: 8px 10px;
  min-width: 0;
  flex-wrap: wrap;
}

.release-tag {
  display: inline-flex;
  align-items: center;
  padding: 2px 9px;
  border-radius: var(--radius-pill);
  background: var(--google-blue-soft);
  color: var(--google-blue);
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}

.release-tag.is-pre {
  background: var(--google-amber-soft);
  color: var(--google-amber);
}

.release-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  word-break: break-word;
}

.release-date {
  font-size: 12px;
  color: var(--text-muted);
  white-space: nowrap;
}

.release-right {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.release-dl-badge {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
}

.release-dl-badge span {
  font-weight: 400;
  color: var(--text-secondary);
  font-size: 12px;
  margin-left: 3px;
}

.assets-wrap {
  border-top: 1px solid var(--border-subtle);
  padding: 6px 16px 12px;
  background: var(--bg-page);
  border-bottom-left-radius: var(--radius-md);
  border-bottom-right-radius: var(--radius-md);
}

/* 响应式附件列表（桌面端横排对齐，移动端自然折行不挤压） */
.assets-list {
  display: flex;
  flex-direction: column;
}

.asset-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 84px 160px;
  align-items: center;
  gap: 12px;
  padding: 10px 4px;
  border-bottom: 1px solid var(--border-subtle);
}

.asset-row:last-child {
  border-bottom: none;
}

.asset-row-head {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-secondary);
  padding: 6px 4px 8px;
}

.asset-link {
  color: var(--text-primary);
  text-decoration: none;
  font-size: 13px;
  font-weight: 500;
  word-break: break-all;
  line-height: 1.4;
}

.asset-link:hover {
  color: var(--google-blue);
  text-decoration: underline;
}

.asset-size {
  font-size: 12px;
  color: var(--text-secondary);
  white-space: nowrap;
  text-align: right;
}

.asset-dl-wrap {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}

.asset-bar-track {
  width: 72px;
  height: 6px;
  border-radius: var(--radius-pill);
  background: var(--border-subtle);
  overflow: hidden;
  flex-shrink: 0;
}

.asset-bar-fill {
  height: 100%;
  border-radius: var(--radius-pill);
  background: var(--gen-color);
}

.asset-dl-num {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  min-width: 48px;
  text-align: right;
}

.empty-state {
  padding: 28px 16px;
  text-align: center;
  color: var(--text-secondary);
  font-size: 13px;
}

/* ==========================================================================
   Toast
   ========================================================================== */

.toast {
  position: fixed;
  bottom: max(24px, env(safe-area-inset-bottom));
  left: 50%;
  transform: translateX(-50%);
  z-index: 80;
  background: var(--toast-bg);
  color: var(--toast-text);
  padding: 10px 18px;
  border-radius: var(--radius-pill);
  font-size: 13px;
  font-weight: 500;
  max-width: calc(100vw - 32px);
  text-align: center;
}

/* ==========================================================================
   Responsive (Tablet & Mobile)
   ========================================================================== */

@media (max-width: 1024px) {
  .cards-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .charts-layout {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .chart-card-wide {
    grid-column: auto;
  }
}

@media (max-width: 640px) {
  .container {
    padding: 0 14px;
  }

  .top-bar-inner {
    min-height: 56px;
    gap: 8px;
  }

  .brand-logo-wrap {
    width: 34px;
    height: 34px;
  }

  .brand-title {
    font-size: 15px;
  }

  .brand-subtitle {
    display: none;
  }

  .status-pill {
    padding: 5px 9px;
    font-size: 11px;
    max-width: 138px;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .btn-tonal {
    height: 34px;
    padding: 0 10px;
  }

  .btn-tonal .btn-label {
    display: none;
  }

  .main-content {
    padding-top: 18px;
    padding-bottom: 32px;
  }

  .section {
    margin-bottom: 26px;
  }

  .section-title {
    font-size: 16px;
  }

  .section-desc {
    font-size: 12px;
  }

  .summary-chip,
  .trend-meta {
    width: 100%;
    text-align: center;
    font-size: 12px;
  }

  .project-card {
    padding: 16px;
    border-radius: 14px;
  }

  .card-title {
    font-size: 17px;
  }

  .card-desc {
    min-height: auto;
    margin-bottom: 14px;
  }

  .hero-metric {
    padding: 12px 14px;
  }

  .hero-metric-value {
    font-size: 24px;
  }

  .sub-metrics {
    gap: 6px;
    margin-bottom: 16px;
  }

  .sub-metric-box {
    padding: 8px 8px;
  }

  .sub-metric-value {
    font-size: 14px;
  }

  .chart-card {
    padding: 16px;
    border-radius: 14px;
  }

  .chart-canvas-wrap,
  .chart-canvas-wide {
    height: 220px;
  }

  /* 移动端详情弹窗：全屏抽屉体验，支持安全区 */
  .modal-backdrop {
    padding: 0;
  }

  .modal-surface {
    height: 100vh;
    height: 100dvh;
    max-height: none;
    border-radius: 0;
    border: none;
  }

  .modal-header {
    padding: 14px 16px;
    padding-top: max(14px, env(safe-area-inset-top));
  }

  .modal-title {
    font-size: 16px;
  }

  .modal-stats-bar {
    padding: 10px 16px;
    gap: 8px 14px;
    font-size: 12px;
  }

  .modal-toolbar {
    padding: 10px 16px;
  }

  .modal-body {
    padding: 12px 14px max(24px, env(safe-area-inset-bottom));
  }

  .release-summary {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
    padding: 12px 14px;
  }

  .release-right {
    width: 100%;
    justify-content: space-between;
    padding-left: 24px;
  }

  .assets-wrap {
    padding: 6px 12px 10px;
  }

  .asset-row-head {
    display: none;
  }

  .asset-row {
    grid-template-columns: 1fr auto;
    grid-template-rows: auto auto;
    gap: 4px 10px;
    padding: 10px 2px;
  }

  .asset-link {
    grid-column: 1 / -1;
    font-size: 13px;
  }

  .asset-size {
    text-align: left;
  }

  .asset-bar-track {
    width: 56px;
  }
}
