:root {
  --bg: #f4f6f9;
  --surface: #ffffff;
  --surface-subtle: #f8fafc;
  --border: #e2e8f0;
  --border-strong: #cbd5e1;
  --text: #0f172a;
  --text-muted: #64748b;
  --brand-red: #dc2626;
  --brand-red-hover: #b91c1c;
  --qa-amber: #0f766e;
  --qa-amber-hover: #115e59;
  --android-tint: #ecfdf5;
  --android-fg: #047857;
  --ios-tint: #eff6ff;
  --ios-fg: #1d4ed8;
  --radius-lg: 16px;
  --radius-md: 12px;
  --shadow-sm: 0 1px 3px rgba(15, 23, 42, 0.06);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Pretendard", "Noto Sans KR", sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

.container {
  max-width: 1160px;
  margin: 0 auto;
  padding: 0 20px;
}

.site-header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 20;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-top: 14px;
  padding-bottom: 14px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
}

.brand-logo {
  width: 46px;
  height: 46px;
  border-radius: 11px;
  border: 1px solid var(--border);
  object-fit: cover;
  flex-shrink: 0;
}

.eyebrow {
  display: block;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--brand-red);
}

.site-title {
  margin: 2px 0 0;
  font-size: 19px;
  font-weight: 700;
}

.btn-outline {
  background: var(--surface);
  border: 1px solid var(--border-strong);
  color: var(--text);
  padding: 8px 14px;
  border-radius: 9px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.btn-outline:hover {
  background: var(--surface-subtle);
  border-color: #94a3b8;
}

.main-content {
  padding-top: 22px;
  padding-bottom: 56px;
}

.notice-banner {
  padding: 12px 16px;
  border-radius: var(--radius-md);
  font-size: 13.5px;
  margin-bottom: 18px;
}

.notice-warn {
  background: #fffbeb;
  border: 1px solid #fde68a;
  color: #92400e;
}

.notice-warn code {
  background: rgba(217, 119, 6, 0.12);
  padding: 1px 5px;
  border-radius: 4px;
}

.toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 20px;
}

.filter-group {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.filter-chip {
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-muted);
  padding: 7px 14px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}

.filter-chip:hover {
  color: var(--text);
  border-color: var(--border-strong);
}

.filter-chip.is-active {
  background: var(--text);
  border-color: var(--text);
  color: #ffffff;
}

.summary-meta {
  font-size: 13px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 8px;
}

.device-pill {
  font-size: 11.5px;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 999px;
}

.pill-android {
  background: var(--android-tint);
  color: var(--android-fg);
}

.pill-ios {
  background: var(--ios-tint);
  color: var(--ios-fg);
}

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

@media (max-width: 900px) {
  .channel-grid {
    grid-template-columns: 1fr;
  }
}

.channel-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* display:flex 가 [hidden] 기본 스타일을 덮어쓰지 않도록 — 필터 탭이 이 속성으로 카드를 숨긴다. */
.channel-card[hidden] {
  display: none;
}

.channel-card.is-device-match {
  border-color: #94a3b8;
}

.channel-header {
  display: flex;
  align-items: center;
  gap: 14px;
}

.channel-icon {
  width: 60px;
  height: 60px;
  border-radius: 14px;
  border: 1px solid var(--border);
  object-fit: cover;
  flex-shrink: 0;
}

.channel-info {
  min-width: 0;
}

.channel-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 4px;
}

.platform-tag,
.region-tag,
.version-count-tag {
  font-size: 11px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 6px;
}

.tag-android {
  background: var(--android-tint);
  color: var(--android-fg);
}

.tag-ios {
  background: var(--ios-tint);
  color: var(--ios-fg);
}

.tag-kr,
.tag-cn {
  background: #f1f5f9;
  color: #334155;
}

.version-count-tag {
  background: transparent;
  color: var(--text-muted);
  font-weight: 600;
}

.channel-title {
  margin: 0;
  font-size: 18px;
  font-weight: 700;
}

.channel-sub {
  margin: 2px 0 0;
  font-size: 12.5px;
  color: var(--text-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.channel-sub code {
  font-size: 12px;
  color: #475569;
}

.latest-block {
  background: var(--surface-subtle);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 14px;
}

.version-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 12px;
}

.version-heading.is-compact {
  margin-bottom: 10px;
}

.version-label-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
}

.version-number {
  font-size: 16px;
  font-weight: 700;
}

.latest-pill {
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: 0.04em;
  background: #fee2e2;
  color: var(--brand-red);
  padding: 2px 7px;
  border-radius: 999px;
}

.version-date {
  font-size: 12px;
  color: var(--text-muted);
}

.env-pair {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

@media (max-width: 520px) {
  .env-pair {
    grid-template-columns: 1fr;
  }
}

.env-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 10px;
}

.env-card.is-empty {
  background: rgba(248, 250, 252, 0.7);
  border-style: dashed;
}

.env-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}

.env-badge {
  font-size: 11px;
  font-weight: 800;
  padding: 2px 8px;
  border-radius: 6px;
}

.badge-release {
  background: #fef2f2;
  color: var(--brand-red);
}

.badge-qa {
  background: #f0fdfa;
  color: var(--qa-amber);
}

.badge-muted {
  background: #e2e8f0;
  color: #64748b;
}

.env-meta {
  font-size: 11.5px;
  color: var(--text-muted);
}

.env-notes {
  margin: 0;
  font-size: 12.5px;
  color: #334155;
  background: #f8fafc;
  padding: 6px 8px;
  border-radius: 6px;
}

.env-actions {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.btn-download {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  font-size: 13.5px;
  font-weight: 700;
  padding: 10px 12px;
  border-radius: 8px;
  color: #ffffff;
  text-align: center;
  transition: background 0.15s ease;
}

.btn-release {
  background: var(--brand-red);
}

.btn-release:hover {
  background: var(--brand-red-hover);
}

.btn-qa {
  background: var(--qa-amber);
}

.btn-qa:hover {
  background: var(--qa-amber-hover);
}

.sub-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 11.5px;
}

.file-Hint {
  color: var(--text-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.link-secondary {
  color: #475569;
  text-decoration: underline;
  background: none;
  border: none;
  padding: 0;
  font-size: 11.5px;
  cursor: pointer;
  flex-shrink: 0;
}

.link-secondary:hover {
  color: var(--text);
}

.empty-slot-msg {
  font-size: 12.5px;
  color: #94a3b8;
  padding: 10px 0 4px;
  text-align: center;
}

.history-accordion {
  border-top: 1px solid var(--border);
  padding-top: 12px;
}

.history-summary {
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 13px;
  font-weight: 600;
  color: #334155;
  cursor: pointer;
  padding: 4px 2px;
}

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

.history-accordion[open] .chevron {
  transform: rotate(180deg);
}

.history-list {
  margin-top: 12px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.history-item {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px;
  background: var(--surface-subtle);
}

.channel-empty {
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius-md);
  padding: 24px 16px;
  text-align: center;
  background: var(--surface-subtle);
}

.empty-title {
  margin: 0 0 8px;
  font-size: 14px;
  color: var(--text-muted);
}

.empty-cli-hint {
  display: inline-block;
  font-size: 11.5px;
  color: #475569;
  background: #e2e8f0;
  padding: 4px 8px;
  border-radius: 6px;
  max-width: 100%;
  overflow-x: auto;
}

.qr-dialog {
  border: none;
  border-radius: 16px;
  padding: 0;
  max-width: 340px;
  width: calc(100% - 32px);
  box-shadow: 0 20px 40px rgba(15, 23, 42, 0.25);
}

.qr-dialog::backdrop {
  background: rgba(15, 23, 42, 0.45);
}

.qr-dialog-inner {
  padding: 20px;
  text-align: center;
}

.qr-dialog-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.qr-dialog-header h3 {
  margin: 0;
  font-size: 15px;
}

.btn-close {
  background: none;
  border: none;
  font-size: 22px;
  line-height: 1;
  color: var(--text-muted);
  cursor: pointer;
}

.qr-image-box {
  display: inline-flex;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #ffffff;
}

.qr-url-text {
  margin: 12px 0 0;
  font-size: 11.5px;
  color: var(--text-muted);
  word-break: break-all;
}
