:root {
  --bg: #f4f6f8;
  --surface: #ffffff;
  --border: #dbe1e8;
  --text: #1f2933;
  --muted: #6b7784;
  --accent: #0f766e;
  --accent-soft: #e6f3f1;
  --row-hover: #f0f6f5;
  --row-active: #e2f0ee;
  --shadow: 0 1px 2px rgba(16, 24, 40, 0.06), 0 1px 3px rgba(16, 24, 40, 0.08);
}

* { box-sizing: border-box; }

html, body {
  height: 100%;
  margin: 0;
}

body {
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--text);
  font-family: "Segoe UI", system-ui, -apple-system, "PingFang TC", "Microsoft JhengHei",
    "Noto Sans TC", sans-serif;
  font-size: 15px;
  line-height: 1.5;
}

.app-bar {
  display: flex;
  align-items: baseline;
  gap: 0.75rem;
  padding: 0.85rem 1.25rem;
  background: var(--accent);
  color: #fff;
  box-shadow: var(--shadow);
}

.app-title {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 650;
  letter-spacing: 0.02em;
}

.app-subtitle {
  font-size: 0.8rem;
  opacity: 0.85;
}

.repo-link {
  margin-left: auto;
  padding: 0.22rem 0.7rem;
  font-size: 0.8rem;
  font-weight: 600;
  color: #fff;
  text-decoration: none;
  background: rgba(255, 255, 255, 0.16);
  border: 1px solid rgba(255, 255, 255, 0.42);
  border-radius: 999px;
  white-space: nowrap;
}

.repo-link:hover { background: rgba(255, 255, 255, 0.28); }

.app-foot {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.6rem;
  align-items: center;
  padding: 0.5rem 1.25rem;
  font-size: 0.75rem;
  color: var(--muted);
  background: var(--surface);
  border-top: 1px solid var(--border);
}

.app-foot a { color: var(--accent); text-decoration: none; }
.app-foot a:hover { text-decoration: underline; }
.foot-sep { opacity: 0.6; }

.search-bar {
  display: flex;
  gap: 0.6rem;
  padding: 0.9rem 1.25rem 0.4rem;
}

.search-input {
  flex: 1;
  padding: 0.6rem 0.85rem;
  font-size: 1rem;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  outline: none;
}

.search-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.search-btn {
  padding: 0.6rem 1.4rem;
  font-size: 1rem;
  font-weight: 600;
  color: #fff;
  background: var(--accent);
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: filter 0.15s ease;
}

.search-btn:hover:not(:disabled) { filter: brightness(1.08); }
.search-btn:active:not(:disabled) { filter: brightness(0.95); }

.search-input:disabled,
.search-btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.status {
  margin: 0;
  padding: 0.15rem 1.25rem 0.6rem;
  font-size: 0.85rem;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.panes {
  flex: 1;
  display: grid;
  grid-template-columns: minmax(280px, 42%) 1fr;
  gap: 0;
  min-height: 0;
  padding: 0 1.25rem 1.25rem;
}

.list-pane {
  display: flex;
  flex-direction: column;
  min-height: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-right: none;
  border-radius: 10px 0 0 10px;
  overflow: hidden;
}

.results {
  flex: 1;
  margin: 0;
  padding: 0;
  list-style: none;
  overflow-y: auto;
  min-height: 0;
}

.result-item {
  padding: 0.6rem 0.9rem;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: background 0.1s ease;
}

.result-item:hover { background: var(--row-hover); }
.result-item.active { background: var(--row-active); box-shadow: inset 3px 0 0 var(--accent); }

.result-title {
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.result-sub {
  font-size: 0.82rem;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.empty-hint {
  padding: 1.5rem 1rem;
  text-align: center;
  color: var(--muted);
  font-size: 0.9rem;
  margin: 0;
}

.detail-pane {
  min-height: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 0 10px 10px 0;
  overflow: hidden;
}

.detail {
  height: 100%;
  overflow-y: auto;
  padding: 1.25rem 1.4rem;
}

.detail-placeholder {
  color: var(--muted);
  text-align: center;
  margin-top: 3rem;
}

.detail-header {
  margin-bottom: 1.1rem;
  padding-bottom: 0.9rem;
  border-bottom: 2px solid var(--accent-soft);
}

.detail-name-cn {
  margin: 0;
  font-size: 1.35rem;
  font-weight: 700;
  line-height: 1.3;
  word-break: break-word;
}

.detail-name-en {
  margin: 0.3rem 0 0;
  font-size: 0.95rem;
  color: var(--muted);
  word-break: break-word;
}

.field-card {
  margin-bottom: 0.7rem;
  padding: 0.7rem 0.9rem;
  background: #fafbfc;
  border: 1px solid var(--border);
  border-radius: 8px;
}

.field-label {
  display: block;
  margin-bottom: 0.25rem;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  color: var(--accent);
  text-transform: uppercase;
}

.field-value {
  margin: 0;
  white-space: pre-wrap;
  word-break: break-word;
  user-select: text;
}

.field-value.empty { color: var(--muted); }

@media (max-width: 760px) {
  .panes {
    grid-template-columns: 1fr;
    grid-template-rows: minmax(180px, 40vh) 1fr;
  }
  .list-pane {
    border-right: 1px solid var(--border);
    border-radius: 10px 10px 0 0;
  }
  .detail-pane {
    border-radius: 0 0 10px 10px;
  }
}
