:root {
  --brand: #ff7a1a;
  --brand-dark: #e85f00;
  --bg: #fff7ef;
  --card: #ffffff;
  --text: #2b2b2b;
  --muted: #8a8a8a;
  --line: #ffe2cc;
  --shadow: 0 6px 20px rgba(255, 122, 26, 0.12);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.topbar {
  background: linear-gradient(135deg, var(--brand), #ff9d4d);
  padding: 16px 20px;
  box-shadow: var(--shadow);
}
.brand { display: flex; align-items: center; gap: 14px; max-width: 960px; margin: 0 auto; }
.logo img { display: block; width: 52px; height: 52px; border-radius: 50%; border: 2px solid rgba(255,255,255,0.9); box-shadow: 0 2px 8px rgba(0,0,0,0.18); }
.brand-text h1 { margin: 0; font-size: 24px; color: #fff; letter-spacing: 2px; }
.brand-text p { margin: 2px 0 0; font-size: 13px; color: #fff3e8; }

.container { max-width: 960px; margin: 0 auto; padding: 24px 16px 48px; flex: 1 0 auto; }

.search-hero { text-align: center; margin: 28px 0 12px; }
.search-box {
  display: flex; gap: 10px; max-width: 640px; margin: 0 auto;
  background: var(--card); padding: 10px; border-radius: 16px; box-shadow: var(--shadow);
}
.search-box input {
  flex: 1; border: none; outline: none; font-size: 18px; padding: 22px 18px; border-radius: 10px; background: #fffaf4;
}
.search-box button {
  border: none; cursor: pointer; background: var(--brand); color: #fff; font-size: 16px; font-weight: 700;
  padding: 10px 26px; border-radius: 10px; transition: background .2s;
}
.search-box button:hover { background: var(--brand-dark); }
.search-tip { text-align: center; margin: 14px auto 0; max-width: 720px; color: var(--brand-dark); font-size: 14px; font-weight: 600; letter-spacing: .3px; }

.search-box button:disabled { opacity: .6; cursor: not-allowed; }
.hint { color: var(--muted); font-size: 13px; margin-top: 12px; }

/* 工具栏：模式切换 + 屏蔽词 */
.toolbar {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: center;
  gap: 10px 14px; max-width: 720px; margin: 14px auto 0;
}
.mode-btn {
  border: 1px solid var(--brand); background: #fff; color: var(--brand-dark);
  font-size: 13px; font-weight: 700; padding: 7px 16px; border-radius: 20px; cursor: pointer; transition: background .2s;
}
.mode-btn:hover { background: var(--line); }
.mode-btn.direct { background: var(--brand); color: #fff; }
.block-box { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.block-box input {
  border: 1px solid var(--line); outline: none; font-size: 13px; padding: 6px 12px; border-radius: 18px; background: #fffaf4; min-width: 200px;
}
.block-box > button {
  border: none; cursor: pointer; background: var(--brand-dark); color: #fff; font-size: 13px; font-weight: 600;
  padding: 6px 16px; border-radius: 18px; transition: background .2s;
}
.block-box > button:hover { background: #c85000; }
.block-tags { display: inline-flex; flex-wrap: wrap; gap: 6px; }
.block-tag {
  font-size: 12px; color: #fff; background: #d93434; padding: 3px 10px; border-radius: 12px; cursor: pointer; user-select: none;
}
.block-tag:hover { background: #b92525; }

/* 网盘筛选 */
.disk-filter {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: center;
  gap: 6px 10px; max-width: 760px; margin: 14px auto 0;
  padding: 8px 12px; background: #fffaf4; border: 1px solid var(--line); border-radius: 14px;
}
.disk-filter[hidden] { display: none; }
.df-label { font-size: 13px; font-weight: 700; color: var(--brand-dark); }
.disk-chips { display: inline-flex; flex-wrap: wrap; gap: 6px 10px; }
.chip {
  display: inline-flex; align-items: center; gap: 3px; font-size: 13px; color: var(--text);
  background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 3px 10px; cursor: pointer; user-select: none;
  transition: background .15s, border-color .15s;
}
.chip:hover { background: var(--line); }
.chip input { margin: 0; cursor: pointer; }

.status { text-align: center; padding: 14px; color: var(--muted); }
.status.error { color: #d9480f; }

.results .total { font-size: 14px; color: var(--muted); margin: 8px 4px 18px; }
.group { margin-bottom: 26px; }
.group-title {
  display: inline-flex; align-items: center; gap: 8px; font-size: 15px; font-weight: 700;
  background: var(--line); color: var(--brand-dark); padding: 4px 14px; border-radius: 20px; margin-bottom: 12px;
}
/* 网盘分组标题：置顶标 + 检测本组 */
.group-title { position: relative; }
.group-title .pin {
  background: var(--brand); color: #fff; font-size: 11px; font-weight: 700;
  padding: 1px 8px; border-radius: 10px; margin-left: 4px;
}
.group-check {
  margin-left: auto; border: 1px solid var(--brand); background: #fff; color: var(--brand-dark);
  font-size: 12px; font-weight: 600; padding: 3px 12px; border-radius: 14px; cursor: pointer; transition: background .2s;
}
.group-check:hover { background: var(--line); }

/* 横条布局：卡片纵向堆叠，单条横向 */
.cards { display: flex; flex-direction: column; gap: 10px; }
.card {
  background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 12px 16px;
  box-shadow: 0 2px 8px rgba(255, 122, 26, 0.06);
  display: flex; flex-direction: row; align-items: center; gap: 14px;
}
.card .card-left { flex: 1; min-width: 0; }
.card .name { font-weight: 600; font-size: 15px; word-break: break-all; }
.card .meta { font-size: 12px; color: var(--muted); display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: 4px; }
.card .pwd { color: var(--brand-dark); font-weight: 600; }
.card .actions { flex: 0 0 auto; margin-left: auto; }
.card .save-btn {
  display: inline-block; text-decoration: none; background: var(--brand); color: #fff; font-size: 13px; font-weight: 600;
  padding: 8px 18px; border-radius: 8px; transition: background .2s; white-space: nowrap;
}
.card .save-btn:hover { background: var(--brand-dark); }

.empty { text-align: center; color: var(--muted); padding: 40px 0; }

/* 分页 */
.pager { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 8px; margin: 28px 0 8px; }
.page-btn {
  min-width: 38px; height: 36px; padding: 0 12px; border: 1px solid var(--line); background: #fff; color: var(--text);
  font-size: 14px; border-radius: 10px; cursor: pointer; transition: background .15s, border-color .15s, color .15s;
}
.page-btn:hover:not(:disabled) { background: var(--line); border-color: var(--brand); }
.page-btn.active { background: var(--brand); color: #fff; border-color: var(--brand); font-weight: 700; }
.page-btn:disabled { opacity: .45; cursor: not-allowed; }
.page-ellipsis { color: var(--muted); padding: 0 4px; }
.page-info { font-size: 13px; color: var(--muted); margin-left: 6px; }

/* 搜索结果统计提示 */
.results .total .tip { color: #c98a00; font-weight: 600; }

/* 卡片工具行：状态徽章 + 检测按钮 */
.tool-row { display: flex; align-items: center; gap: 10px; flex: 0 0 auto; }
.badge { font-size: 12px; padding: 2px 10px; border-radius: 12px; background: #f1f1f1; color: #888; white-space: nowrap; }
.badge.ok { background: #e7f8ec; color: #1a8a3c; }
.badge.bad { background: #fde8e8; color: #d93434; }
.badge.warn { background: #fff5e0; color: #b9820b; }
.badge.checking { background: #eef3ff; color: #3a6edb; }
.badge.skip { background: #eef0f2; color: #6b7280; }

/* 回到顶部按钮 */
.to-top {
  position: fixed; right: 20px; bottom: 28px; z-index: 50;
  width: 44px; height: 44px; border-radius: 50%;
  border: none; cursor: pointer; background: var(--brand); color: #fff;
  font-size: 22px; line-height: 1; box-shadow: var(--shadow);
  opacity: 0; pointer-events: none; transition: opacity .25s, background .2s;
}
.to-top.show { opacity: 1; pointer-events: auto; }
.to-top:hover { background: var(--brand-dark); }
.detect-btn {
  border: 1px solid var(--line); background: #fffaf4; color: var(--brand-dark);
  font-size: 12px; padding: 3px 10px; border-radius: 8px; cursor: pointer; transition: background .2s; white-space: nowrap;
}
.detect-btn:hover { background: var(--line); }

/* 转存按钮（含提取码时强调） */
.card .save-btn.has-pwd { background: #1a8a3c; }
.card .save-btn.has-pwd:hover { background: #147030; }

/* 轻提示 toast */
.toast {
  position: fixed; left: 50%; bottom: 40px; transform: translateX(-50%) translateY(20px);
  background: rgba(40,40,40,.92); color: #fff; font-size: 14px; padding: 10px 18px; border-radius: 10px;
  opacity: 0; pointer-events: none; transition: opacity .25s, transform .25s; z-index: 99;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

.footer { text-align: left; color: var(--muted); font-size: 12px; padding: 24px 20px; border-top: 1px solid var(--line); line-height: 1.8; flex-shrink: 0; }
.footer .disclaimer-list { max-width: 880px; margin: 0 auto 14px; padding-left: 22px; color: #5b6472; }
.footer .disclaimer-list li { margin: 4px 0; }
.footer .disclaimer-list a { color: var(--brand-dark); text-decoration: none; }
.footer .disclaimer-list a:hover { text-decoration: underline; }

@media (max-width: 640px) {
  .search-box { flex-direction: column; }
  .search-box button { width: 100%; }
  .card { flex-direction: column; align-items: stretch; gap: 10px; }
  .card .actions { margin-left: 0; }
  .card .save-btn { width: 100%; text-align: center; }
}
