/* =========================================================
   无损音乐识别 · Apple 风格样式
   设计语言：#f5f5f7 灰底 + 白色圆角卡片、#0071e3 主蓝、
   SF Pro 字体栈、毛玻璃吸顶导航、发丝分隔线、980px 胶囊按钮
   ========================================================= */

:root {
  --bg: #f5f5f7;
  --card: #ffffff;
  --ink: #1d1d1f;
  --muted: #6e6e73;
  --line: #d2d2d7;
  --hairline: rgba(0, 0, 0, 0.08);
  --blue: #0071e3;
  --blue-hover: #0077ed;
  --blue-tint: #eaf2fd;
  --green: #34c759;
  --orange: #ff9500;
  --red: #ff3b30;
  --gray: #86868b;
  --radius: 18px;
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display",
    "Helvetica Neue", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: var(--font);
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

main {
  max-width: 860px;
  margin: 0 auto;
  padding: 0 22px 60px;
}

/* ---------------- 吸顶导航 ---------------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255, 255, 255, 0.82);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid var(--hairline);
}
.brand {
  max-width: 980px;
  margin: 0 auto;
  padding: 10px 22px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--ink);
  white-space: nowrap;
}
.brand-icon {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 8px;
  background: var(--blue);
  color: #fff;
  font-size: 14px;
}
.search-box {
  display: flex;
  flex: 1 1 340px;
  min-width: 240px;
  gap: 8px;
  position: relative;
}
.search-icon {
  position: absolute;
  left: 11px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--gray);
  pointer-events: none;
}
.search-box input {
  flex: 1 1 auto;
  min-width: 0;
  height: 34px;
  padding: 0 12px 0 32px;
  border: 1px solid transparent;
  border-radius: 9px;
  background: #ececef;
  font-family: var(--font);
  font-size: 14px;
  color: var(--ink);
  outline: none;
  transition: background 0.2s, border-color 0.2s, box-shadow 0.2s;
  -webkit-appearance: none;
  appearance: none;
}
.search-box input::placeholder { color: var(--gray); }
.search-box input:focus {
  background: #fff;
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(0, 113, 227, 0.16);
}
.search-box button {
  height: 34px;
  padding: 0 16px;
  border: none;
  border-radius: 980px;
  background: var(--blue);
  color: #fff;
  font-family: var(--font);
  font-size: 13.5px;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.2s;
}
.search-box button:hover { background: var(--blue-hover); }
.search-box button:disabled { background: #a9c8ef; cursor: default; }
.search-tip {
  flex: 1 1 100%;
  margin: 0;
  font-size: 11.5px;
  line-height: 1.5;
  color: var(--muted);
}
.search-tip.warn { color: var(--red); font-weight: 500; }
.search-tip:empty { display: none; }
.search-tip a { color: var(--blue); text-decoration: underline; }

/* ---------------- Hero ---------------- */
.hero {
  background: #fff;
  text-align: center;
  padding: 76px 22px 64px;
}
.hero h1 {
  margin: 0;
  font-size: 52px;
  font-weight: 700;
  letter-spacing: -0.022em;
  line-height: 1.1;
  color: var(--ink);
}
.hero p {
  margin: 16px auto 0;
  max-width: 620px;
  font-size: 19px;
  line-height: 1.55;
  color: var(--muted);
}
.hero-sub { font-size: 14px; margin-top: 10px; }
.hero-actions {
  margin-top: 24px;
  display: flex;
  justify-content: center;
  gap: 28px;
}
.hero-link {
  color: var(--blue);
  font-size: 15px;
  text-decoration: none;
}
.hero-link:hover { text-decoration: underline; }
.hero-link span { font-size: 13px; margin-left: 2px; }

/* ---------------- 搜索面板 ---------------- */
.search-panel {
  margin-top: 32px;
  background: var(--card);
  border: 1px solid var(--hairline);
  border-radius: var(--radius);
  padding: 20px 22px;
  scroll-margin-top: 86px;
}
.search-panel.hidden { display: none; }
.sp-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--hairline);
}
.sp-title { font-size: 17px; font-weight: 700; letter-spacing: -0.01em; }
.sp-actions { display: flex; gap: 16px; align-items: center; }
.sp-actions a {
  color: var(--blue);
  font-size: 13px;
  text-decoration: none;
  white-space: nowrap;
}
.sp-actions a:hover { text-decoration: underline; }
.sp-actions button {
  background: none;
  border: none;
  padding: 0;
  font-family: var(--font);
  font-size: 13px;
  color: var(--muted);
  cursor: pointer;
}
.sp-actions button:hover { color: var(--ink); }
.sp-body { display: flex; flex-direction: column; }
.sp-count { font-size: 12px; color: var(--muted); padding: 10px 0 6px; }
.sp-loading { padding: 36px 0; text-align: center; color: var(--muted); font-size: 14px; }
.sp-empty { padding: 12px 2px 4px; font-size: 14px; line-height: 1.7; }
.sp-empty p { margin: 6px 0; }
.sp-empty-reason { color: var(--red); font-size: 12.5px; }
.sp-empty-hint { color: var(--muted); font-size: 12.5px; }
.sp-empty code {
  background: #f0f0f2;
  border-radius: 4px;
  padding: 0 5px;
  font-size: 11.5px;
  color: var(--ink);
}
.sp-foot {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--hairline);
  font-size: 11.5px;
  line-height: 1.7;
  color: var(--muted);
}

/* ---------------- 底部搜索区 ---------------- */
.search-bottom {
  margin-top: 52px;
  padding-top: 40px;
  border-top: 1px solid var(--hairline);
}
.sb-head { text-align: center; margin-bottom: 20px; }
.sb-head h2 {
  margin: 0;
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -0.015em;
  color: var(--ink);
}
.sb-head p {
  margin: 10px auto 0;
  max-width: 560px;
  font-size: 14px;
  color: var(--muted);
  line-height: 1.6;
}
.pan-search-bottom {
  max-width: 620px;
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 16px;
}
.pan-search-bottom .search-box { flex: 1 1 340px; min-width: 240px; }
.pan-search-bottom .search-tip { flex: 1 1 100%; text-align: center; }

/* 搜索结果：文件夹卡片（Finder 列表风格，不发丝链接） */
.sr-item { padding: 10px 0; border-bottom: 1px solid var(--hairline); }
.sr-item:last-child { border-bottom: none; }
.sr-folder {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid var(--hairline);
  background: #fff;
  text-decoration: none;
  color: var(--ink);
  transition: border-color 0.2s, background 0.2s, box-shadow 0.2s;
}
.sr-folder:hover {
  border-color: rgba(0, 113, 227, 0.45);
  background: var(--blue-tint);
  box-shadow: 0 2px 12px rgba(0, 113, 227, 0.1);
}
.sr-folder-ic { flex: none; display: block; }
.sr-folder-name {
  flex: 1;
  min-width: 0;
  font-size: 14.5px;
  font-weight: 600;
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.sr-folder-cta {
  flex: none;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--blue);
  white-space: nowrap;
}
.sr-folder-cta::after { content: ' ›'; }
.sr-sub {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin: 8px 2px 0;
}
.sr-pwd {
  background: #fff8e6;
  border: 1px solid #f5e3b3;
  color: #8a6d1a;
  font-size: 12px;
  border-radius: 6px;
  padding: 1px 8px;
  white-space: nowrap;
}
.sr-copy {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--blue);
  border-radius: 980px;
  padding: 3px 13px;
  font-family: var(--font);
  font-size: 12.5px;
  cursor: pointer;
  white-space: nowrap;
  transition: border-color 0.2s, background 0.2s;
}
.sr-copy:hover { border-color: var(--blue); background: var(--blue-tint); }
.sr-snippet {
  margin: 8px 2px 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.7;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.sr-snippet mark, .sr-folder-name mark {
  background: #ffe885;
  color: inherit;
  border-radius: 3px;
  padding: 0 2px;
}

/* 加载更多（Apple 胶囊按钮） */
.sp-more {
  display: block;
  margin: 20px auto 6px;
  padding: 9px 28px;
  border: 1px solid var(--blue);
  background: var(--blue-tint);
  color: var(--blue);
  border-radius: 980px;
  font-family: var(--font);
  font-size: 14px;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}
.sp-more:hover { background: var(--blue); color: #fff; }
.sp-more:disabled { opacity: 0.6; cursor: default; }
/* ---------------- 上传区 ---------------- */
#uploader { margin-top: 36px; }
.drop {
  border-radius: var(--radius);
  background: var(--card);
  padding: 60px 24px;
  text-align: center;
  cursor: pointer;
  transition: box-shadow 0.25s, transform 0.25s;
}
.drop:hover, .drop.over {
  box-shadow: 0 0 0 4px rgba(0, 113, 227, 0.18);
}
.drop .icon { font-size: 40px; color: var(--blue); line-height: 1; }
.drop p { margin: 10px 0 0; font-size: 15px; color: var(--ink); }
.drop .hint { margin-top: 8px; color: var(--muted); font-size: 13px; }
.status {
  text-align: center;
  margin-top: 14px;
  color: var(--muted);
  font-size: 13.5px;
  min-height: 18px;
}
.status.error { color: var(--red); }

/* ---------------- 结果区 ---------------- */
.result.hidden { display: none; }

.batch-list {
  margin-top: 32px;
  background: var(--card);
  border-radius: var(--radius);
  padding: 14px 18px;
  overflow-x: auto;
}
.list-title { font-size: 12px; color: var(--muted); margin: 4px 0 10px; }
.list-empty { color: var(--muted); font-size: 13px; padding: 6px 2px; }
.list-head, .list-row {
  display: grid;
  grid-template-columns: 2fr 0.9fr 1fr 1fr 1fr 1.2fr;
  gap: 8px;
  align-items: center;
  min-width: 620px;
}
.list-head {
  font-size: 11px;
  color: var(--gray);
  padding: 2px 8px 8px;
  border-bottom: 1px solid var(--hairline);
}
.list-row {
  padding: 11px 8px;
  border-radius: 10px;
  cursor: pointer;
  font-size: 13.5px;
}
.list-row:hover { background: var(--bg); }
.list-row.sel { background: var(--blue-tint); }
.list-row .nm {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.pill {
  justify-self: start;
  padding: 3px 10px;
  border-radius: 980px;
  font-size: 11.5px;
  font-weight: 500;
  color: #fff;
  background: var(--gray);
}
.pill.lossless { background: var(--green); }
.pill.maybe { background: var(--orange); }
.pill.transcoded { background: var(--red); }
.pill.lossy { background: var(--gray); }

.verdict-card {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 24px;
  border-radius: var(--radius);
  background: var(--card);
  margin-top: 24px;
}
.verdict-badge {
  flex: 0 0 auto;
  width: 54px;
  height: 54px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 27px;
  font-weight: 700;
  color: #fff;
  background: var(--gray);
}
.verdict-card.lossless .verdict-badge { background: var(--green); }
.verdict-card.maybe .verdict-badge { background: var(--orange); }
.verdict-card.transcoded .verdict-badge { background: var(--red); }
.verdict-card.lossy .verdict-badge { background: var(--gray); }
.verdict-text h2 { margin: 0 0 5px; font-size: 21px; font-weight: 700; letter-spacing: -0.01em; }
.verdict-text p { margin: 0; color: var(--muted); font-size: 14px; line-height: 1.6; }

.meta-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px;
  margin-top: 20px;
}
.meta-item {
  background: var(--card);
  border-radius: 14px;
  padding: 13px 16px;
}
.meta-item span { display: block; color: var(--muted); font-size: 12px; }
.meta-item b { font-size: 16px; font-weight: 600; }

.player-wrap {
  margin-top: 24px;
  background: var(--card);
  border-radius: var(--radius);
  padding: 16px 18px;
}
.player-title { font-size: 12px; color: var(--muted); margin-bottom: 9px; }
#player { width: 100%; height: 40px; }

.spec-wrap {
  margin-top: 24px;
  background: var(--card);
  border-radius: var(--radius);
  padding: 18px;
}
.spec-title { font-size: 13px; color: var(--muted); margin-bottom: 12px; }
.spec-stage {
  position: relative;
  border-radius: 12px;
  overflow: hidden;
  line-height: 0;
}
#spec { width: 100%; display: block; background: #000; }
.spec-overlay {
  position: absolute;
  inset: 0;
  width: 100%;
  display: block;
  cursor: pointer;
  touch-action: none;
}
.spec-time {
  position: absolute;
  right: 8px;
  bottom: 6px;
  padding: 2px 8px;
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
  font-size: 11.5px;
  font-variant-numeric: tabular-nums;
  line-height: 1.6;
  pointer-events: none;
}
.spec-note { margin: 9px 2px 0; color: var(--muted); font-size: 12px; line-height: 1.6; }
.spec-note:empty { display: none; }

.readout { display: flex; gap: 12px; margin-top: 20px; }
.readout > div {
  flex: 1;
  background: var(--card);
  border-radius: 14px;
  padding: 15px 18px;
}
.readout span { display: block; color: var(--muted); font-size: 12px; }
.readout b { font-size: 19px; font-weight: 600; }

/* ---------------- 页脚（Apple 风格） ---------------- */
footer {
  background: var(--bg);
  border-top: 1px solid var(--hairline);
  margin-top: 48px;
}
.foot-grid {
  max-width: 860px;
  margin: 0 auto;
  padding: 30px 22px 10px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 24px;
}
.foot-col h4 { margin: 0 0 8px; font-size: 12px; font-weight: 600; color: var(--ink); }
.foot-col p { margin: 0; font-size: 12px; color: var(--muted); line-height: 1.75; }
.foot-col code {
  background: #ececef;
  border-radius: 4px;
  padding: 0 5px;
  font-size: 11px;
  color: var(--ink);
}
.foot-legal {
  max-width: 860px;
  margin: 0 auto;
  padding: 14px 22px 32px;
  font-size: 11px;
  color: var(--gray);
}
.foot-beian {
  max-width: 860px;
  margin: 0 auto;
  padding: 0 22px 8px;
  font-size: 11px;
  color: var(--gray);
  /* 用 flex 显式排成一行并居中；窄屏才允许换行，避免两条备案被随机断开 */
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 6px 14px;
}
.foot-beian a {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--gray);
  text-decoration: none;
  white-space: nowrap;
}
.foot-beian a:hover {
  color: var(--ink);
  text-decoration: underline;
}
/* 公安联网备案图标：与文字垂直居中，高度贴合 11px 字号 */
.foot-beian .gongan-beian img {
  display: block;
  height: 14px;
  width: auto;
}
/* 页脚访问次数：单独一行居中，弱化处理，不影响备案信息的视觉权重 */
.foot-visit {
  max-width: 860px;
  margin: 0 auto;
  padding: 0 22px 28px;
  font-size: 11px;
  color: var(--gray);
  text-align: center;
  letter-spacing: .2px;
}
.foot-visit span[hidden] { display: none; }

/* ---------------- 响应式 ---------------- */
@media (max-width: 640px) {
  .hero { padding: 52px 20px 44px; }
  .hero h1 { font-size: 34px; }
  .hero p { font-size: 16px; }
  .brand-name { display: none; }
  .drop { padding: 44px 18px; }
  .readout { flex-direction: column; }
}
