:root {
  --bg: #f7f7f5;
  --surface: #ffffff;
  --border: #e2e2df;
  --text: #1c1c1a;
  --text-dim: #6b6b66;
  --accent: #2b6cb0;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "PingFang TC", "Microsoft JhengHei", sans-serif;
}

.page {
  max-width: 640px;
  margin: 0 auto;
  padding: 32px 20px 80px;
}

h1 {
  font-size: 26px;
  margin: 0 0 4px;
}

.subtitle {
  color: var(--text-dim);
  font-size: 13px;
  margin: 0 0 24px;
}

.disclaimer {
  background: #fff7e6;
  border: 1px solid #f0d999;
  color: #7a5c00;
  font-size: 12px;
  padding: 10px 12px;
  border-radius: 8px;
  margin-bottom: 20px;
  line-height: 1.5;
}

#search-input {
  width: 100%;
  font-size: 18px;
  padding: 14px 16px;
  border: 2px solid var(--border);
  border-radius: 14px;
  background: var(--surface);
  color: var(--text);
}

#search-input:focus {
  outline: none;
  border-color: var(--accent);
}

#hint {
  font-size: 13px;
  color: var(--text-dim);
  margin: 14px 0 4px;
  line-height: 1.5;
}

#top-pick-label {
  font-size: 15px;
  font-weight: 700;
  margin: 4px 0 8px;
}

#top-pick-label[hidden] {
  display: none;
}

#results {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* ---- 卡片視覺（彩色，像真的卡片而不是文件列） ---- */

.card-visual {
  border-radius: 18px;
  color: #fff;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.16);
  position: relative;
  overflow: hidden;
}

.card-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.card-featured {
  padding: 22px 22px;
  transform: scale(1);
  animation: pop-in 0.18s ease-out;
}

.card-compact {
  padding: 12px 14px;
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.14);
}

.card-compact.card-expandable {
  padding-bottom: 26px;
}

@keyframes pop-in {
  from { transform: scale(0.96); opacity: 0.5; }
  to { transform: scale(1); opacity: 1; }
}

.card-icon {
  flex-shrink: 0;
  filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.25));
  line-height: 1;
}

.card-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.card-bank {
  font-size: 12px;
  opacity: 0.85;
}

.card-featured .card-name {
  font-size: 21px;
  font-weight: 800;
}

.card-compact .card-name {
  font-size: 15px;
  font-weight: 700;
}

.card-meta {
  margin-top: 4px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.badge {
  display: inline-block;
  font-size: 11px;
  padding: 2px 9px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.35);
  background: rgba(255, 255, 255, 0.18);
  color: #fff;
}

.badge-category {
  font-weight: 600;
}

.badge-switch {
  background: #ffcc00;
  color: #1c1c1a;
  border-color: #ffcc00;
  font-weight: 700;
}

.badge-pending {
  opacity: 0.75;
}

.badge-guess {
  background: rgba(255, 255, 255, 0.28);
}

.badge-unclear {
  background: rgba(255, 100, 100, 0.35);
}

.badge-verified {
  background: rgba(120, 255, 170, 0.3);
}

.alt-label {
  font-size: 12px;
  color: var(--text-dim);
  margin: 6px 0 0;
}

.alt-wrap {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.toolbar {
  margin-top: 32px;
  border-top: 1px solid var(--border);
  padding-top: 16px;
}

#toggle-all {
  font-size: 14px;
  font-weight: 600;
  padding: 10px 16px;
  border-radius: 10px;
  border: none;
  background: var(--accent);
  color: #fff;
  cursor: pointer;
}

#all-cards-section[hidden] {
  display: none;
}

.bank-group {
  margin-top: 18px;
}

.bank-group h3 {
  font-size: 13px;
  color: var(--text-dim);
  margin: 0 0 8px;
}

.card-expandable {
  cursor: pointer;
}

.card-expandable::after {
  content: '▾ 點看細節';
  position: absolute;
  right: 14px;
  bottom: 10px;
  font-size: 10px;
  opacity: 0.75;
}

.card-open::after {
  content: '▴ 收合';
}

.detail-panel {
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.3);
  font-size: 13px;
  line-height: 1.6;
}

.detail-panel[hidden] {
  display: none;
}

.detail-panel p {
  margin: 4px 0;
}

.detail-note {
  background: rgba(255, 255, 255, 0.18);
  border-radius: 8px;
  padding: 6px 8px;
}

.detail-source a {
  color: #fff;
  text-decoration: underline;
}

.detail-empty {
  opacity: 0.8;
}

.detail-field {
  margin: 10px 0;
}

.detail-field-label {
  display: block;
  font-size: 12px;
  font-weight: 700;
  opacity: 0.85;
  margin-bottom: 3px;
}

.detail-field-list {
  margin: 0;
  padding-left: 18px;
}

.detail-field-list li {
  margin: 2px 0;
}

.detail-field-secondary {
  font-size: 12px;
  opacity: 0.75;
}

.detail-field-secondary .detail-field-label {
  font-size: 11px;
}

.detail-highlight {
  background: rgba(255, 255, 255, 0.92);
  color: #1c1c1a;
  font-weight: 800;
  padding: 1px 6px;
  border-radius: 5px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.35);
}

.detail-field-secondary .detail-highlight {
  font-size: 11px;
  padding: 0 5px;
}
