
* { box-sizing: border-box; margin: 0; padding: 0; }
img { max-width: 100%; }
html { overflow-x: hidden; width: 100%; }
a { text-decoration: none; }
button, input { font: inherit; }

:root {
  --primary: #667eea;
  --primary-dark: #5a6fd8;
  --green: #28a745;
  --green-dark: #218838;
  --text: #333;
  --text-dim: #6c757d;
  --text-faint: #999;
  --bg-gradient: linear-gradient(135deg, #e0e7ff 0%, #f5f7fb 50%, #eef2ff 100%);
}

body {
  background-attachment: fixed;
  background-image: var(--bg-gradient);
  color: var(--text);
  font-family: "LXGW WenKai", sans-serif;
  min-height: 100vh;
  overflow-x: hidden;
}

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

.glass, .header, .model-card, .version-card, .versions-section,
.download-section, .download-info, .download-empty, .link-item,
.rom-detail-field, .rom-summary-row, .site-intro {
  backdrop-filter: blur(12px) saturate(1.3);
  -webkit-backdrop-filter: blur(12px) saturate(1.3);
  background: rgba(255, 255, 255, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.5);
  box-shadow: 0 8px 24px rgba(31, 38, 135, 0.08);
}

.site-intro {
  border-radius: 20px;
  margin-bottom: 28px;
  padding: 24px;
}
.site-intro .header {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
  background: none;
  border: none;
  box-shadow: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  padding: 0;
  margin: 0;
}
.logo-container { flex: 0 0 auto; }
.logo { display: block; height: 96px; width: 96px; }
.title-container { min-width: 0; }
.header h1 { font-size: 2.4rem; font-weight: 700; color: var(--text); margin-bottom: 8px; }
.header p { font-size: 1.1rem; line-height: 1.55; color: #555; }

.breadcrumb {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  font-size: 14px;
  gap: 0;
  margin-bottom: 16px;
  padding: 10px 20px;
  border-radius: 25px;
  backdrop-filter: blur(10px);
  background: rgba(255, 255, 255, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.5);
}
.breadcrumb a { color: #444; cursor: pointer; }
.breadcrumb a:hover { color: var(--primary); }
.breadcrumb-separator { margin: 0 10px; opacity: 0.5; color: #666; }

.model-browser { display: grid; gap: 16px; }
.selector-tier { min-width: 0; }
.models-grid {
  display: grid;
  gap: 20px;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 180px), 1fr));
  margin-bottom: 24px;
}
.brand-models-grid { grid-template-columns: repeat(auto-fill, minmax(min(100%, 180px), 1fr)); }
.brand-model-card {
  align-items: center;
  display: flex;
  flex-direction: column;
  gap: 14px;
  justify-content: center;
  min-height: 168px;
  text-align: center;
}
.brand-model-card .model-name { margin-bottom: 0; }
.brand-card-logo {
  display: block;
  height: 96px;
  width: 96px;
  object-fit: contain;
  margin: 0 auto;
}
.brand-card-logo-large { height: 116px; width: 116px; }
.brand-model-name { margin-bottom: 0; }

.model-card {
  border-radius: 15px;
  cursor: pointer;
  display: block;
  padding: 20px;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.model-card:hover {
  border-color: var(--primary);
  box-shadow: 0 16px 40px rgba(31, 38, 135, 0.14);
  transform: translateY(-4px);
}
.model-name {
  color: var(--text);
  display: block;
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 8px;
  word-break: break-word;
}
.model-description { color: #666; font-size: 0.9rem; }

.search-section { margin-bottom: 20px; }
.search-input {
  border: 2px solid rgba(102, 126, 234, 0.2);
  border-radius: 25px;
  color: var(--text);
  font-size: 16px;
  padding: 14px 20px;
  width: 100%;
  transition: all 0.3s ease;
  background: rgba(255, 255, 255, 0.5);
  backdrop-filter: blur(8px);
}
.search-input:focus {
  background: #fff;
  border-color: var(--primary);
  outline: none;
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.12);
}
.search-input::placeholder { color: var(--text-faint); }

.versions-section {
  border-radius: 20px;
  padding: 30px;
}
.versions-header {
  align-items: center;
  border-bottom: 2px solid rgba(0, 0, 0, 0.06);
  display: flex;
  justify-content: space-between;
  margin-bottom: 24px;
  padding-bottom: 16px;
}
.versions-title { color: var(--text); font-size: 1.6rem; font-weight: 700; word-break: break-word; }
.versions-grid { display: grid; gap: 14px; }

.version-card {
  align-items: center;
  border-left: 5px solid var(--primary);
  border-radius: 12px;
  display: flex;
  gap: 16px;
  justify-content: space-between;
  padding: 18px;
  transition: all 0.3s ease;
}
.version-card:hover { box-shadow: 0 10px 24px rgba(31, 38, 135, 0.14); transform: translateX(4px); }
.version-info { flex: 1; min-width: 0; }
.version-name {
  color: #495057;
  font-family: "Courier New", monospace;
  font-size: 1.05rem;
  font-weight: 700;
  margin-bottom: 5px;
  word-break: break-word;
}
.version-meta { color: var(--text-dim); font-size: 0.88rem; word-break: break-word; }
.version-meta-tags { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.rom-meta-line { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; color: #666; font-size: 0.9rem; }
.rom-meta-tag {
  align-items: center;
  background: rgba(255, 255, 255, 0.5);
  border: 1px solid rgba(102, 126, 234, 0.2);
  border-radius: 999px;
  color: #495057;
  display: inline-flex;
  font-size: 0.82rem;
  font-weight: 600;
  padding: 4px 10px;
  word-break: break-word;
}
.version-actions { align-items: center; display: flex; flex-shrink: 0; flex-wrap: wrap; gap: 10px; justify-content: flex-end; }

.download-button {
  align-items: center;
  background: linear-gradient(180deg, #34c759, #20a846);
  border: none;
  border-radius: 25px;
  box-shadow: 0 4px 10px rgba(40, 167, 69, 0.3);
  color: #fff;
  cursor: pointer;
  display: inline-flex;
  font-weight: 600;
  gap: 8px;
  justify-content: center;
  padding: 11px 22px;
  text-decoration: none;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.download-button:hover { box-shadow: 0 10px 24px rgba(40, 167, 69, 0.4); transform: translateY(-2px); color: #fff; }
.download-button:active { transform: translateY(0) scale(0.97); }

.rom-detail-grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); margin-bottom: 20px; }
.rom-detail-field { border-radius: 10px; padding: 12px 14px; }
.rom-detail-label { color: var(--text-dim); display: block; font-size: 0.8rem; font-weight: 700; margin-bottom: 5px; }
.rom-detail-value { color: #2f3439; display: block; font-weight: 700; word-break: break-word; }

.rom-summary-card { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 180px), 1fr)); }
.rom-summary-row { border-radius: 10px; padding: 12px 14px; }
.rom-summary-label { color: var(--text-dim); display: block; font-size: 0.8rem; font-weight: 700; margin-bottom: 5px; }
.rom-summary-value { color: #2f3439; display: block; font-weight: 700; word-break: break-word; }
.rom-version-value { align-items: center; display: flex; flex-wrap: wrap; gap: 8px; }

.download-section { border-radius: 20px; padding: 30px; }
.download-header { border-bottom: 2px solid rgba(0, 0, 0, 0.06); margin-bottom: 24px; padding-bottom: 16px; text-align: center; }
.download-title { color: var(--text); font-size: 1.8rem; font-weight: 700; margin-bottom: 8px; }
.download-info { border-radius: 12px; margin-bottom: 24px; padding: 18px; }
.download-info p { color: #495057; margin: 8px 0; word-break: break-word; }
.download-empty { border-radius: 12px; padding: 24px; text-align: center; }
.download-empty p { color: #495057; margin-bottom: 16px; }

.link-item {
  border-left: 5px solid var(--green);
  border-radius: 12px;
  display: grid;
  gap: 16px;
  padding: 20px;
}
.link-header { color: #155724; font-size: 1.1rem; font-weight: 700; }
.link-url { align-items: stretch; display: flex; gap: 10px; min-width: 0; }
.link-url a {
  color: #007bff;
  display: block;
  flex: 1;
  font-weight: 700;
  line-height: 1.55;
  min-width: 0;
  overflow-wrap: anywhere;
  word-break: break-word;
}
.link-url a:hover { opacity: 0.8; }
.copy-button {
  background: var(--green);
  border: none;
  border-radius: 6px;
  color: #fff;
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  padding: 10px 16px;
  white-space: nowrap;
  flex: 0 0 auto;
}
.copy-button:hover { background: var(--green-dark); }

.cl-body { color: #444; line-height: 1.7; }
.cl-body h4 { font-size: 1.1rem; color: var(--text); margin: 10px 0 6px; }
.cl-body h5 { font-size: 1rem; color: #495057; margin: 14px 0 6px; border-bottom: 1px solid rgba(0,0,0,0.06); padding-bottom: 4px; }
.cl-body ul { padding-left: 1.3rem; margin: 6px 0; }
.cl-body li { margin: 4px 0; }
.cl-body p { margin: 6px 0; }
.cl-body .cl-quote { color: #888; font-size: 0.88rem; }
.version-card .rom-meta-line ul { margin: 4px 0 0; padding-left: 1.1rem; }
.version-card .rom-meta-line li { font-size: 0.82rem; color: var(--text-dim); margin: 2px 0; }

.loading { align-items: center; display: flex; flex-direction: column; justify-content: center; padding: 60px; font-size: 1.2rem; }
.loading::before {
  animation: spin 1s ease-in-out infinite;
  border: 3px solid rgba(0, 0, 0, 0.2);
  border-radius: 50%;
  border-top-color: var(--text);
  content: "";
  display: inline-block;
  height: 30px;
  margin-bottom: 20px;
  width: 30px;
}
@keyframes spin { to { transform: rotate(1turn); } }
.error {
  align-items: center;
  background: linear-gradient(135deg, #f8d7da, #f5c6cb);
  border-left: 5px solid #dc3545;
  border-radius: 12px;
  color: #721c24;
  display: flex;
  margin-bottom: 20px;
  padding: 20px;
}
.empty-state { color: var(--text-dim); padding: 60px 20px; text-align: center; }

.toast-container {
  background-color: rgba(0, 0, 0, 0.75);
  border-radius: 25px;
  bottom: 30px;
  color: #fff;
  font-size: 0.95rem;
  left: 50%;
  max-width: calc(100vw - 32px);
  padding: 12px 25px;
  position: fixed;
  transform: translateX(-50%);
  z-index: 2000;
}

@media (max-width: 768px) {
  .container { padding: 10px; }
  .site-intro .header { gap: 12px; }
  .logo { height: 64px; width: 64px; }
  .header h1 { font-size: 1.7rem; }
  .models-grid { grid-template-columns: minmax(0, 1fr); }
  .version-card { align-items: flex-start; flex-direction: column; gap: 12px; padding: 16px; }
  .version-actions { justify-content: flex-start; width: 100%; }
  .link-url { flex-direction: column; }
  .versions-section, .download-section { padding: 16px; }
}

.cl-toggle {
  align-items: center;
  background: none;
  border: none;
  color: var(--primary);
  cursor: pointer;
  display: flex;
  font-size: 1.05rem;
  font-weight: 700;
  gap: 10px;
  padding: 0;
  width: 100%;
}
.cl-toggle-summary {
  color: var(--text-dim);
  flex: 1;
  font-size: 0.88rem;
  font-weight: 400;
  overflow: hidden;
  text-align: left;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.cl-arrow { font-size: 0.85rem; font-weight: 600; white-space: nowrap; }
.cl-collapsed {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
}

.rom-summary-card .cl-wrap {
  backdrop-filter: blur(5px) saturate(1.1) !important;
  -webkit-backdrop-filter: blur(5px) saturate(1.1) !important;
  background: linear-gradient(135deg, rgba(255,255,255,.25), rgba(255,255,255,.12)) !important;
  border: 1px solid rgba(255,255,255,.3) !important;
  border-radius: 10px;
  display: block;
  padding: 10px 14px;
}
.tag-latest {
  background: rgba(102, 126, 234, 0.85) !important;
  border-color: rgba(102, 126, 234, 0.9) !important;
  color: #fff !important;
}


/* 版本列表中的更新日志简略 */
.version-cl-preview {
  margin-top: 6px;
  font-size: 0.82rem;
  line-height: 1.5;
  color: var(--text-dim, #666);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
