:root {
  --cyan: #55e9ff;
  --ink: #dff8ff;
}

* { box-sizing: border-box; }

html { min-width: 1100px; color-scheme: dark; }

body {
  margin: 0;
  min-height: 100vh;
  overflow-x: auto;
  color: var(--ink);
  /* background: #020b17 url("https://bing.ee123.net/img") center / cover fixed no-repeat; */
  background: #020b17 url("background.webp") center / cover fixed no-repeat;
  font-family: "Segoe UI", "Microsoft YaHei UI", "PingFang SC", Arial, sans-serif;
  letter-spacing: .02em;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background: linear-gradient(180deg, rgba(1, 8, 19, .3), rgba(2, 11, 23, .16) 42%, rgba(1, 10, 21, .68));
}

.scene { position: fixed; inset: 0; z-index: -1; overflow: hidden; pointer-events: none; }
.aurora { position: absolute; width: 42vw; height: 42vw; border-radius: 50%; filter: blur(100px); opacity: .1; }
.aurora-one { left: -13vw; top: -16vw; background: #0f72ff; }
.aurora-two { right: -18vw; top: 2vw; background: #00d9ff; }

.grid-horizon {
  position: absolute;
  left: 0; right: 0; bottom: 0; height: 22%;
  opacity: .1;
  background-image: linear-gradient(rgba(75, 205, 255, .35) 1px, transparent 1px), linear-gradient(90deg, rgba(75, 205, 255, .35) 1px, transparent 1px);
  background-size: 52px 30px;
  mask-image: linear-gradient(transparent, #000);
}

.app-shell { width: min(1500px, calc(100% - 90px)); margin: 0 auto; padding: 32px 0 96px; }

.hero {
  min-height: 100px;
  display: flex;
  justify-content: center;
  align-items: center;
  position: relative;
}

.hero-title { text-align: center; }
.hero-title h1 {
  margin: 0;
  font-size: 32px;
  font-weight: 600;
  letter-spacing: .08em;
  text-shadow: 0 3px 20px #000;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
  line-height: 1.4;
  flex-wrap: wrap;
}
.hero-title h1 .crac-logo {
  height: 70px;
  width: auto;
  flex-shrink: 0;
  opacity: 1;
  filter: drop-shadow(0 0 8px rgba(85, 233, 255, 0.15));
}
.hero-title h1 .title-text {
  display: flex;
  flex-direction: column;
  align-items: center;
}
.hero-title h1 .title-text small {
  font-size: 16px;
  font-weight: 400;
  letter-spacing: .15em;
  color: #7ca0b7;
  text-shadow: 0 2px 12px rgba(0,0,0,.6);
}

@keyframes pulse { 50% { opacity: .3; } }

/* ===== 日志面板：完全透明，无背景 ===== */
.log-panel {
  margin-top: 24px;
  overflow: visible;
  border: none;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  backdrop-filter: none;
}
.log-panel::before {
  display: none;
}

/* ===== 面板头部：透明，只保留布局 ===== */
.panel-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 0 12px 0;
  border-bottom: none;
  background: transparent;
}
.panel-head-left {
  flex: 1;
}
.panel-head .title-row {
  display: flex;
  align-items: baseline;
  justify-content: flex-start;
  width: 100%;
  padding-left: 0;
}

/* ===== "▼ QSO 通联日志" 按钮：保留小色块 ===== */
.panel-head .title-row .title-log {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 38px;
  padding: 0 16px;
  border: 1px solid rgba(85, 233, 255, 0.2);
  border-radius: 6px;
  color: var(--cyan);
  background: rgba(2, 14, 29, 0.5);
  font: 500 13px inherit;
  letter-spacing: .08em;
  cursor: pointer;
  transition: .25s ease;
  white-space: nowrap;
}
.panel-head .title-row .title-log:hover {
  background: rgba(85, 233, 255, 0.08);
  border-color: rgba(85, 233, 255, 0.4);
}
.panel-head .title-row .title-log .btn-icon {
  display: inline-block;
  transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  font-size: 11px;
}
.panel-head .title-row .title-log.expanded .btn-icon {
  transform: rotate(180deg);
}

/* ===== 右侧操作区 ===== */
.panel-head-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

/* ===== 搜索框：保留小色块 ===== */
.search-box {
  width: 320px;
  height: 38px;
  padding: 0 12px 0 14px;
  display: flex;
  align-items: center;
  border: 1px solid rgba(99, 218, 255, 0.15);
  border-radius: 6px;
  background: rgba(2, 14, 29, 0.5);
  transition: .25s ease;
}
.search-box:focus-within {
  border-color: rgba(83, 229, 255, 0.4);
  box-shadow: 0 0 0 3px rgba(66, 221, 255, 0.05);
}
.search-box svg {
  width: 16px;
  fill: none;
  stroke: #5cb9d0;
  stroke-width: 1.7;
}
.search-box input {
  min-width: 0;
  flex: 1;
  height: 100%;
  margin-left: 10px;
  border: 0;
  outline: 0;
  color: #dffbff;
  background: transparent;
  font: 12px inherit;
}
.search-box input::placeholder { color: #577b8d; }
.search-box kbd {
  padding: 3px 5px;
  border: 1px solid rgba(118, 206, 230, .12);
  border-radius: 4px;
  color: #4e7486;
  background: rgba(80, 155, 180, 0.06);
  font: 7px Consolas, monospace;
  letter-spacing: .12em;
}

/* ===== 日志折叠容器 ===== */
.log-container {
  overflow: hidden;
  transition: max-height 0.6s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.5s ease;
  max-height: 2000px;
  opacity: 1;
}
.log-container.collapsed {
  max-height: 0;
  opacity: 0;
}

/* ===== 表格区域：半透明背景保证可读性 ===== */
.table-frame {
  min-height: 420px;
  position: relative;
  padding: 8px 0;
  background: rgba(2, 14, 29, 0.65);
  border-radius: 8px;
  margin-top: 4px;
}

table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}

thead { background: rgba(8, 45, 70, 0.3); }

th {
  height: 60px;
  padding: 0 12px;
  color: #91d9e8;
  font-size: 19px;
  font-weight: 600;
  text-align: center;
  letter-spacing: .06em;
  border-bottom: 1px solid rgba(109, 220, 255, 0.08);
}
th small {
  display: block;
  margin-top: 3px;
  color: #436c7d;
  font: 12px Consolas, monospace;
  letter-spacing: .10em;
}

th:first-child, td:first-child { padding-left: 20px; width: 14.28%; }
th:nth-child(2) { width: 14.28%; }
th:nth-child(3) { width: 14.28%; }
th:nth-child(4) { width: 14.28%; }
th:nth-child(5) { width: 14.28%; }
th:nth-child(6) { width: 14.28%; }
th:last-child, td:last-child { padding-right: 20px; width: 14.28%; }

td {
  height: 48px;
  padding: 0 12px;
  border-bottom: 1px solid rgba(109, 220, 255, 0.05);
  color: #b5ccd9;
  font-size: 18px;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: .18s ease;
}

tbody tr { transition: .18s ease; }
tbody tr:hover { background: rgba(32, 177, 225, 0.08); }
tbody tr:hover td { color: #d6f6ff; }

.time-cell { font-family: Consolas, monospace; color: #8aacbe; }
.call-cell {
  color: #86e9fb;
  font: 600 16px Consolas, monospace;
  letter-spacing: .08em;
  text-shadow: 0 0 9px rgba(70, 222, 255, 0.15);
}

.band-pill, .mode-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 56px;
  padding: 4px 12px;
  border: 1px solid rgba(79, 211, 243, 0.12);
  border-radius: 4px;
  color: #74bdd0;
  background: rgba(62, 181, 220, 0.04);
  font: 13px Consolas, monospace;
  text-align: center;
}
.mode-pill {
  color: #b4a7ff;
  border-color: rgba(151, 125, 255, 0.12);
  background: rgba(122, 100, 255, 0.04);
}
.rst { color: #71e3ad; font: 15px Consolas, monospace; }

.empty-state {
  position: absolute;
  inset: 53px 0 0;
  display: grid;
  place-content: center;
  justify-items: center;
  color: #5d8394;
  background: rgba(2, 15, 29, 0.2);
}
.empty-state[hidden] { display: none; }
.empty-state span { font-size: 36px; color: #4ccfe9; }
.empty-state strong { margin-top: 8px; font-weight: 500; }
.empty-state small { margin-top: 6px; color: #486879; }

.panel-footer {
  min-height: 54px;
  padding: 8px 0 0 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid rgba(109, 220, 255, 0.06);
  background: rgba(2, 14, 29, 0.65);
  border-radius: 0 0 8px 8px;
  margin-top: 0;
}
.panel-footer p { color: #526f80; font-size: 12px; }
.panel-footer p strong { color: #7ccfe0; font: 500 12px Consolas, monospace; }

.pagination { display: flex; align-items: center; gap: 8px; }
.pagination button {
  height: 32px;
  min-width: 74px;
  padding: 0 12px;
  display: inline-flex;
  justify-content: center;
  align-items: center;
  gap: 5px;
  border: 1px solid rgba(91, 205, 237, 0.12);
  border-radius: 5px;
  color: #739bab;
  background: rgba(30, 100, 128, 0.06);
  font: 11px inherit;
  cursor: pointer;
  transition: .2s ease;
}
.pagination button:hover:not(:disabled) {
  color: #bff8ff;
  border-color: rgba(77, 224, 255, 0.35);
  background: rgba(39, 164, 202, 0.1);
  box-shadow: 0 0 15px rgba(48, 199, 237, 0.06);
}
.pagination button:disabled { opacity: .3; cursor: not-allowed; }
.pagination button svg { width: 13px; fill: none; stroke: currentColor; stroke-width: 1.7; }
.pagination span {
  min-width: 72px;
  height: 32px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(91, 219, 250, 0.15);
  border-radius: 5px;
  color: #a8eff8;
  background: rgba(41, 178, 216, 0.06);
  font: 12px Consolas, monospace;
  box-shadow: inset 0 0 17px rgba(41, 190, 228, 0.03);
}

.site-footer {
  position: fixed;
  z-index: 10;
  bottom: 0;
  left: 0;
  right: 0;
  height: 48px;
  display: grid;
  place-items: center;
}
.site-footer .footer-content {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  color: #628495;
  font-size: 15px;
  letter-spacing: .08em;
}
.site-footer .footer-content .footer-dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #31f2ba;
  box-shadow: 0 0 10px #31f2ba;
  animation: pulse 2s ease-in-out infinite;
  flex-shrink: 0;
}
.site-footer .footer-content a {
  color: var(--cyan);
  text-decoration: none;
  transition: color .2s ease, text-shadow .2s ease;
}
.site-footer .footer-content a:hover {
  color: #8ff4ff;
  text-shadow: 0 0 12px rgba(85, 233, 255, 0.4);
  text-decoration: underline;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; }
}

/* ===== 手机适配 ===== */
@media (max-width: 768px) {
  /* 去掉固定宽度限制 */
  html { min-width: auto; }

  /* 容器自适应 */
  .app-shell {
    width: calc(100% - 20px);
    padding: 16px 0 80px;
  }

  /* 头部改为上下排列 */
  .hero {
    display: flex;
    flex-direction: column;
    gap: 12px;
    min-height: auto;
    padding: 12px 0;
  }

  /* 标题文字缩小 */
  .hero-title h1 {
    font-size: 20px;
    gap: 10px;
  }
  .hero-title h1 .crac-logo {
    height: 40px;
  }
  .hero-title h1 .title-text small {
    font-size: 11px;
  }

  /* 面板头部：按钮和搜索框换行 */
  .panel-head {
    flex-wrap: wrap;
    gap: 10px;
  }
  .panel-head .title-row {
    padding-left: 0;
  }
  .panel-head .title-row .title-log {
    font-size: 12px;
    height: 34px;
    padding: 0 12px;
  }

  /* 搜索框占满宽度 */
  .search-box {
    width: 100%;
  }

  /* 表格字体缩小，支持横向滚动 */
  .table-frame {
    overflow-x: auto;
    padding: 4px 0;
  }
  table {
    min-width: 700px;
  }
  th {
    font-size: 14px;
    height: 44px;
    padding: 0 8px;
  }
  th small {
    font-size: 9px;
  }
  td {
    font-size: 13px;
    height: 36px;
    padding: 0 8px;
  }
  .call-cell {
    font-size: 13px;
  }
  .band-pill, .mode-pill {
    font-size: 10px;
    padding: 2px 8px;
    min-width: 40px;
  }
  .rst {
    font-size: 12px;
  }

  /* 底部版权信息 */
  .site-footer {
    height: 56px;
    padding: 0 12px;
  }
  .site-footer .footer-content {
    font-size: 11px;
    flex-wrap: wrap;
    gap: 6px;
    text-align: center;
  }
}

/* ===== 星星背景 ===== */
.stars {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}

.stars span {
  position: absolute;
  width: 2px;
  height: 2px;
  background: white;
  border-radius: 50%;
  animation: blink 3s infinite;
}

@keyframes blink {
  0%, 100% {
    opacity: 0.2;
    transform: scale(0.8);
  }
  50% {
    opacity: 1;
    transform: scale(1.8);
  }
}