:root {
  --ink: #252b31;
  --muted: #7a8188;
  --line: #e2e5e8;
  --line-strong: #d2d7dc;
  --blue: #1769cf;
  --blue-dark: #1056aa;
  --green: #15804b;
  --red: #df4e43;
  --wash: #f6f7f8;
  font-family: Arial, "Microsoft YaHei", sans-serif;
  color: var(--ink);
  background: #fff;
  font-synthesis: none;
}

* { box-sizing: border-box; }
html { min-width: 320px; }
body { margin: 0; font-size: 13px; line-height: 1.45; }
a { color: var(--blue); text-decoration: none; }
a:hover { color: var(--blue-dark); text-decoration: underline; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible,
textarea:focus-visible, summary:focus-visible { outline: 2px solid #78abe9; outline-offset: 2px; }
.container { width: min(1080px, calc(100% - 40px)); margin-inline: auto; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.mono { font: 12px/1.6 Consolas, "SFMono-Regular", monospace; overflow-wrap: anywhere; }
.wrap { overflow-wrap: anywhere; }

.topbar { border-bottom: 1px solid var(--line); background: #fff; }
.header-inner { min-height: 68px; display: flex; align-items: center; gap: 18px; }
.brand { display: inline-flex; align-items: baseline; flex: none; color: #343a40; font-size: 27px; font-weight: 800; letter-spacing: -1.6px; line-height: 1; white-space: nowrap; }
.brand:hover { text-decoration: none; }
.brand span { color: var(--blue); font-weight: 600; }
.brand i { width: 6px; height: 6px; margin-left: 3px; border-radius: 50%; background: var(--red); }
.searchbox { display: flex; min-width: 0; flex: 1; border: 1px solid var(--line-strong); background: #fff; }
.searchbox:focus-within { border-color: #7aaee9; box-shadow: 0 0 0 2px #dfeeff; }
.searchbox input { min-width: 0; flex: 1; border: 0; outline: 0; padding: 9px 12px; background: transparent; color: var(--ink); }
.searchbox button, .filter-submit { border: 0; background: #287edc; color: #fff; padding: 9px 22px; white-space: nowrap; }
.searchbox button:hover { background: var(--blue-dark); }
.header-inner nav, .home-nav nav { display: flex; gap: 16px; white-space: nowrap; }
.header-inner nav a, .home-nav nav a { color: #5f6871; font-size: 12px; }

.filterbar { border-bottom: 1px solid var(--line); background: var(--wash); }
.filters { min-height: 42px; display: flex; align-items: center; gap: 7px 17px; padding-block: 6px; flex-wrap: wrap; }
.filters label { color: #666f77; font-size: 12px; white-space: nowrap; }
.filters select { max-width: 130px; margin-left: 2px; padding: 3px 2px; border: 0; background: transparent; color: #31383f; }
.filter-submit { margin-left: auto; padding: 5px 12px; border: 1px solid #bad1eb; background: #fff; color: var(--blue); }
.filter-submit:hover { background: #edf5ff; }

.results { padding-top: 13px; }
.results-caption { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; padding-bottom: 3px; }
.results-caption h1 { margin: 0; color: #666f77; font-size: 13px; font-weight: 400; }
.results-caption > span { flex: none; color: #92989e; font-size: 11px; }
.result { max-width: 930px; padding: 13px 0 12px; border-bottom: 1px solid #edf0f2; }
.result-heading { display: flex; align-items: baseline; gap: 7px; }
.result h2 { margin: 0; color: var(--blue); font-size: 16px; font-weight: 400; line-height: 1.38; overflow-wrap: anywhere; }
.type-tag { position: relative; top: -1px; flex: none; padding: 0 4px; border: 1px solid #cbd8e4; border-radius: 2px; color: #55728e; font-size: 10px; line-height: 17px; }
.file-preview { max-width: 850px; margin: 5px 0 2px; padding: 0; list-style: none; color: #747d85; font-size: 11px; }
.file-preview li { display: flex; gap: 5px; min-width: 0; line-height: 1.55; }
.file-preview li > span:nth-child(2) { min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.file-preview small { flex: none; color: #9aa0a6; font-size: 10px; }
.file-icon { flex: none; color: #8f969d; }
.more-files { display: inline-block; color: #8d969e; font-size: 10px; }
.result-meta { display: flex; flex-wrap: wrap; gap: 3px 15px; margin-top: 5px; color: #777f86; font-size: 11px; }
.result-meta b { margin-left: 3px; color: var(--green); font-weight: 400; }
.extension-text { max-width: 210px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; color: #9aa0a6; }
mark { color: var(--red); background: transparent; }

.pagination { display: flex; align-items: center; gap: 8px; font-size: 12px; }
.search-pagination { justify-content: center; margin: 36px 0 20px; font-size: 14px; gap: 12px; }
.page-numbers { display: flex; align-items: center; gap: 0; margin: 0; padding: 0; list-style: none; }
.page-numbers a, .page-numbers .current { display: grid; min-width: 31px; height: 31px; place-items: center; padding: 0 6px; border: 1px solid var(--line); border-left: 0; }
.page-numbers li:first-child a, .page-numbers li:first-child .current { border-left: 1px solid var(--line); border-radius: 3px 0 0 3px; }
.page-numbers li:last-child a, .page-numbers li:last-child .current { border-radius: 0 3px 3px 0; }
.page-numbers .current { border-color: #287edc; background: #287edc; color: #fff; }
.page-numbers .ellipsis { display: grid; min-width: 27px; height: 31px; place-items: center; color: #8d959c; }
.page-direction { min-height: 31px; display: inline-flex; align-items: center; gap: 4px; padding: 5px 8px; border: 1px solid var(--line); border-radius: 3px; }
.page-direction.disabled { color: #b3b8bd; background: #fafafa; }
.search-pagination .page-numbers a, .search-pagination .page-numbers .current { min-width: 32px; height: 36px; border: 0; border-radius: 0; background: transparent; }
.search-pagination .page-numbers .current { color: var(--ink); font-weight: 700; }
.search-pagination .page-direction { border: 0; background: transparent; white-space: nowrap; }
.search-pagination a:hover { text-decoration: underline; }
.search-pagination a:focus-visible { outline: 2px solid #287edc; outline-offset: 2px; }

.breadcrumb { display: flex; gap: 8px; margin-bottom: 8px; color: var(--muted); font-size: 11px; }
.detail { padding-top: 16px; }
.detail > h1 { margin: 0 0 12px; font-size: 20px; font-weight: 500; line-height: 1.4; overflow-wrap: anywhere; }
.panel { margin-bottom: 14px; overflow: hidden; border: 1px solid var(--line); }
.panel h2 { display: flex; align-items: center; gap: 8px; margin: 0; padding: 8px 12px; border-bottom: 1px solid var(--line); background: #f3f4f5; font-size: 13px; font-weight: 600; }
.panel h2 small { margin-left: auto; color: var(--muted); font-size: 10px; font-weight: 400; }
.facts { display: grid; grid-template-columns: 1fr 1fr; gap: 4px 30px; margin: 0; padding: 12px 14px; }
.facts > div { display: grid; grid-template-columns: 75px minmax(0, 1fr); align-items: baseline; min-width: 0; }
.facts dt { color: #6f777e; }
.facts dd { min-width: 0; margin: 0; }
.facts .accent { color: var(--green); }
.facts .full { grid-column: 1 / -1; }
.magnet-row { display: flex; align-items: center; justify-content: flex-start; gap: 8px; padding: 12px 14px; text-align: left; }
.magnet-row a { min-width: 0; text-align: left; }
.magnet-row button { flex: none; margin-left: auto; padding: 5px 10px; border: 1px solid #bcd2eb; background: #eef6ff; color: var(--blue); }
.magnet-row button:hover { background: #deedff; }
.copy-status { margin: -5px 14px 9px; color: var(--green); font-size: 11px; }
.file-table { padding: 0 14px 5px; }
.file-table-head, .file-row { display: grid; grid-template-columns: minmax(0, 1fr) 100px; gap: 15px; padding: 6px 2px; border-bottom: 1px solid #eef0f2; }
.file-table-head { color: #858c92; font-size: 10px; }
.file-row { color: #4e565d; font-size: 11px; }
.file-row span:first-child { overflow-wrap: anywhere; }
.file-row span:last-child, .file-table-head span:last-child { text-align: right; color: #858c92; white-space: nowrap; }
.file-row i { color: #91989e; font-style: normal; }
.panel > .pagination { margin: 12px 14px; }
.panel > .pagination a { padding: 5px 9px; border: 1px solid var(--line); }
.notice { margin: 10px 14px; padding: 7px 9px; background: #fff9e9; color: #82691f; font-size: 11px; }
.tip-panel p { margin: 0; padding: 11px 14px; color: #666f77; font-size: 11px; }
.empty { padding: 70px 0; text-align: center; color: var(--muted); }
.empty > span { font-size: 42px; }
.empty h1, .empty h2 { color: var(--ink); font-size: 18px; font-weight: 500; }

.footer { margin-top: 35px; padding-block: 18px; border-top: 1px solid var(--line); color: #8c9399; font-size: 11px; text-align: center; }
.footer p { display: flex; justify-content: center; flex-wrap: wrap; gap: 6px 18px; margin: 3px 0; }
.footer p:last-child { flex-wrap: nowrap; }
.footer p:last-child span { color: #59636b; font-weight: 700; }
.homepage { min-height: 100vh; display: flex; flex-direction: column; }
.homepage main { flex: 1; }
.home-nav { display: flex; justify-content: space-between; padding-top: 24px; color: var(--muted); font-size: 12px; }
.home-nav-start { display: flex; align-items: center; flex-wrap: wrap; gap: 12px 24px; }
.save-site { padding: 3px 0; background: transparent; color: #5f6871; border: 0; font: inherit; cursor: pointer; }
.save-site:hover { color: #2262c6; }
.save-site:focus-visible { outline: 2px solid #287ddd; outline-offset: 4px; }
.save-site-dialog { position: fixed; width: min(480px, calc(100% - 40px)); max-height: 85vh; box-sizing: border-box; padding: 24px; overflow: auto; border: 1px solid var(--line); border-radius: 10px; color: #303840; background: white; }
.save-site-dialog::backdrop { background: #15202b88; }
.save-site-dialog h2 { font-size: 20px; padding-right: 24px; }
.save-close { position: absolute; right: 14px; top: 10px; border: 0; background: transparent; font-size: 26px; color: #5f6871; cursor: pointer; }
.save-instructions p { padding: 10px 12px; line-height: 1.7; margin: 8px 0; font-size: 14px; background: #f7f8fa; border-radius: 6px; }
.save-instructions .device-current { background: #edf5ff; border-left: 3px solid #287ddd; }
.save-instructions kbd { padding: 1px 4px; border: 1px solid #d6dce3; border-radius: 3px; background: white; }
#install-site { padding: 9px 18px; color: white; background: #287ddd; border: 0; border-radius: 4px; cursor: pointer; }
.search-status { margin: 24px 0; padding: 24px; background: #f7f9fc; border: 1px solid var(--line); }
.search-stage { margin: 0 0 18px; font-size: 17px; font-weight: 500; }
.search-steps { display: flex; flex-wrap: wrap; gap: 10px 22px; list-style: none; padding: 0; margin: 0 0 16px; color: var(--muted); font-size: 12px; }
.search-steps li::before { content: '○'; margin-right: 6px; }
[data-search-phase="queued"] [data-phase="queued"],
[data-search-phase="matching"] [data-phase="matching"],
[data-search-phase="collecting"] [data-phase="collecting"] { color: #1769bd; font-weight: 600; }
[data-search-phase="matching"] [data-phase="queued"]::before,
[data-search-phase="collecting"] [data-phase="queued"]::before,
[data-search-phase="collecting"] [data-phase="matching"]::before { content: '✓'; color: #32845d; }
.search-activity { display: block; width: min(100%, 420px); height: 6px; accent-color: #287ddd; }
.search-clock { display: flex; align-items: baseline; flex-wrap: wrap; gap: 8px 24px; margin: 18px 0 10px; font-size: 14px; }
.search-clock strong { color: #1769bd; font-size: 26px; font-weight: 600; font-variant-numeric: tabular-nums; }
.search-clock [data-search-elapsed-text] { font-variant-numeric: tabular-nums; }
.search-progress [hidden] { display: none; }
@media (max-width: 600px) { .home-nav { flex-wrap: wrap; gap: 12px; } .home-nav-start { gap: 10px 16px; } }
.home-search { width: min(780px, calc(100% - 40px)); margin: clamp(90px, 18vh, 185px) auto 110px; text-align: center; }
.brand-large { justify-content: center; font-size: 64px; letter-spacing: -4px; }
.brand-large i { width: 10px; height: 10px; margin-left: 6px; }
.home-search > .brand { margin-bottom: 30px; }
.home-search h1 { margin: 17px 0 27px; color: #7b858e; font-size: 15px; font-weight: 400; letter-spacing: 3px; }
.searchbox-large { min-height: 49px; text-align: left; box-shadow: 0 3px 12px #172f4810; }
.searchbox-large input { font-size: 14px; }
.searchbox-large button { padding-inline: 26px; font-size: 14px; }
.search-symbol { padding: 9px 0 0 14px; color: #9ba4ac; font-size: 24px; }
.home-hints { display: flex; flex-wrap: wrap; justify-content: center; gap: 7px 15px; margin-top: 16px; font-size: 11px; }
.home-hints > span { color: #9ba2a8; }
.home-hints a { color: #69747e; }
.hot-searches { display: flex; flex-wrap: wrap; justify-content: center; gap: 7px 14px; margin-top: 13px; font-size: 11px; }
.hot-searches span { color: #9ba2a8; }
.hot-searches a { color: #55728e; }
.ad-slot { display: flex; justify-content: center; gap: 10px; margin: 12px 0; overflow: hidden; }
.ad-item { display: block; max-width: 100%; padding: 8px 12px; border: 1px solid #e3e7eb; background: #fafbfc; color: #66717b; font-size: 11px; text-align: center; }
.ad-item img { display: block; max-width: 100%; max-height: 120px; object-fit: contain; }
.ad-dialog { width: min(560px, calc(100% - 30px)); padding: 35px 18px 18px; border: 1px solid var(--line); border-radius: 4px; box-shadow: 0 15px 50px #0003; }
.ad-dialog::backdrop { background: #15202b88; }
.ad-dialog img { display: block; max-width: 100%; max-height: 60vh; margin: auto; }
.ad-dialog a { display: block; text-align: center; }
.ad-close { position: absolute; top: 5px; right: 8px; border: 0; background: transparent; color: #66717b; font-size: 23px; }

.admin-body { background: var(--wash); }
.admin-top { position: sticky; top: 0; z-index: 3; min-height: 58px; display: flex; align-items: center; gap: 15px; padding: 8px 22px; border-bottom: 1px solid var(--line); background: #fff; }
.admin-top .brand { font-size: 23px; }
.admin-top > span { color: var(--muted); }
.admin-top > a:nth-last-of-type(1) { margin-left: auto; }
.admin-top form { margin: 0; }
.admin-top button { padding: 5px 9px; border: 1px solid var(--line); background: #fff; color: #59636b; }
.admin-shell { min-height: calc(100vh - 58px); display: grid; grid-template-columns: 190px minmax(0, 1fr); }
.admin-nav { padding: 18px 12px; border-right: 1px solid var(--line); background: #fff; }
.admin-nav a { display: block; margin-bottom: 3px; padding: 9px 12px; border-radius: 3px; color: #59636b; }
.admin-nav a.active { background: #eaf3ff; color: var(--blue); font-weight: 600; }
.admin-main { min-width: 0; padding: 24px; }
.admin-heading { display: flex; justify-content: space-between; align-items: end; gap: 15px; margin-bottom: 15px; }
.admin-heading h1 { margin: 0; font-size: 22px; font-weight: 500; }
.admin-heading p { margin: 4px 0 0; color: var(--muted); }
.admin-notice { padding: 9px 12px; border: 1px solid #b8d8c7; background: #eef9f2; color: var(--green); }
.stat-grid { display: grid; grid-template-columns: repeat(4, minmax(130px, 1fr)); gap: 12px; margin-bottom: 14px; }
.stat-grid article { padding: 15px; border: 1px solid var(--line); background: #fff; }
.stat-grid span { display: block; color: var(--muted); font-size: 11px; }
.stat-grid strong { display: block; margin-top: 4px; font-size: 25px; font-weight: 500; }
.admin-panel { margin-bottom: 14px; padding: 15px; border: 1px solid var(--line); background: #fff; }
.admin-panel > h2 { margin: -15px -15px 14px; padding: 10px 14px; border-bottom: 1px solid var(--line); background: #fafbfc; font-size: 13px; }
.admin-columns { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.admin-columns.three-columns { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.pill-row { display: flex; flex-wrap: wrap; gap: 8px; }
.pill-row span, .status-tag { padding: 4px 7px; border: 1px solid #cfe0f1; background: #f1f7fd; color: #55728e; }
.status-tag.danger { border-color: #efcac6; background: #fff3f2; color: #a83a32; }
.kv-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.kv-grid div { display: flex; justify-content: space-between; padding: 8px; border-bottom: 1px solid var(--line); }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; background: #fff; }
th, td { padding: 8px; border-bottom: 1px solid #edf0f2; text-align: left; vertical-align: top; }
th { color: var(--muted); font-size: 11px; font-weight: 500; white-space: nowrap; }
td small { display: block; max-width: 430px; margin-top: 3px; overflow: hidden; color: var(--muted); font-size: 10px; text-overflow: ellipsis; }
td form { display: flex; gap: 4px; min-width: 250px; }
td input, td select { min-width: 70px; padding: 4px; border: 1px solid var(--line); }
td button, .admin-search button, .admin-form button, .batch-toolbar button, .button-link { padding: 5px 9px; border: 1px solid #bad1eb; background: #eef6ff; color: var(--blue); }
.danger-button { border-color: #efcac6 !important; background: #fff3f2 !important; color: #a83a32 !important; }
.admin-search { display: flex; }
.admin-search input { min-width: 280px; padding: 8px; border: 1px solid var(--line-strong); }
.admin-form { display: grid; gap: 12px; }
.grid-form { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.admin-form label { display: grid; gap: 4px; color: #626b73; }
.admin-form label small { color: var(--muted); font-size: 10px; }
.admin-form input, .admin-form select, .admin-form textarea { min-width: 0; padding: 8px; border: 1px solid var(--line-strong); background: #fff; }
.admin-form .wide, .admin-form fieldset.wide { grid-column: 1 / -1; }
.admin-form label.check { display: flex; align-items: center; gap: 5px; }
.admin-form label.check input { min-width: auto; }
.admin-form fieldset { display: flex; flex-wrap: wrap; gap: 12px 20px; border: 1px solid var(--line); }
.inline-form-list { display: grid; gap: 7px; }
.inline-form-list form { display: grid; grid-template-columns: minmax(150px, 1fr) minmax(160px, 1fr) auto auto auto; align-items: center; gap: 8px; padding-bottom: 7px; border-bottom: 1px solid var(--line); }
.inline-form-list code { color: var(--muted); }
.short-input { width: 70px; padding: 4px; border: 1px solid var(--line); }
.compact-form { min-width: 0; margin-bottom: 5px; }
.row-editor summary { color: var(--blue); cursor: pointer; }
.row-edit-form { min-width: 560px; margin-top: 8px; padding: 12px; border: 1px solid var(--line); background: var(--wash); }
.form-actions { display: flex; gap: 8px; }
.button-link { display: inline-flex; align-items: center; }
.batch-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.batch-toolbar select { min-width: 140px; padding: 5px; border: 1px solid var(--line-strong); background: #fff; }
.ranking { margin: 0; padding-left: 22px; }
.ranking li { padding: 5px; border-bottom: 1px solid var(--line); }
.ranking b { float: right; color: var(--green); }
.keyword-admin { max-width: 760px; }
.keyword-admin form { display: grid; grid-template-columns: 1fr 80px auto auto; align-items: center; gap: 8px; }
.login-page { min-height: 100vh; display: grid; place-items: center; background: var(--wash); }
.login-card { width: min(390px, calc(100% - 30px)); padding: 28px; border: 1px solid var(--line); background: #fff; box-shadow: 0 8px 30px #1a334b12; }
.login-card .brand-large { justify-content: flex-start; font-size: 37px; letter-spacing: -2px; }
.login-card h1 { margin: 20px 0; font-size: 18px; font-weight: 500; }
.login-card form, .login-card label { display: grid; gap: 7px; }
.login-card form { gap: 14px; }
.login-card input { padding: 10px; border: 1px solid var(--line-strong); }
.login-card button { padding: 10px; border: 0; background: var(--blue); color: #fff; }

@media (max-width: 760px) {
  .container { width: calc(100% - 24px); }
  .header-inner { min-height: auto; flex-wrap: wrap; gap: 10px 13px; padding-block: 11px; }
  .brand { font-size: 24px; }
  .header-inner nav { margin-left: auto; }
  .header-inner .searchbox { order: 3; flex-basis: 100%; }
  .filters { gap: 5px 8px; }
  .filters label { font-size: 10px; }
  .filters select { max-width: 105px; font-size: 11px; }
  .filter-submit { margin-left: 0; }
  .results-caption { align-items: flex-start; }
  .results-caption > span { font-size: 9px; }
  .result { padding-block: 12px; }
  .result h2 { font-size: 15px; }
  .result-meta { gap: 2px 10px; font-size: 10px; }
  .file-preview li > span:nth-child(2) { flex: 1; }
  .search-pagination { max-width: 100%; overflow-x: auto; padding-bottom: 5px; }
  .page-direction { font-size: 0; }
  .page-direction span { font-size: 18px; }
  .page-numbers a, .page-numbers .current { min-width: 29px; height: 29px; }
  .facts { grid-template-columns: 1fr; }
  .facts .full { grid-column: auto; }
  .detail > h1 { font-size: 17px; }
  .magnet-row { align-items: flex-start; flex-wrap: wrap; }
  .magnet-row a { width: calc(100% - 25px); }
  .magnet-row button { margin-left: 25px; }
  .file-table-head, .file-row { grid-template-columns: minmax(0, 1fr) 74px; gap: 8px; }
  .footer { flex-wrap: wrap; gap: 8px; font-size: 10px; }
  .admin-shell { grid-template-columns: 1fr; }
  .admin-nav { display: flex; overflow-x: auto; padding: 8px; border-right: 0; border-bottom: 1px solid var(--line); }
  .admin-nav a { flex: none; margin: 0; }
  .admin-main { padding: 14px 10px; }
  .stat-grid { grid-template-columns: 1fr 1fr; }
  .admin-columns { grid-template-columns: 1fr; }
  .admin-columns.three-columns { grid-template-columns: 1fr; }
  .grid-form { grid-template-columns: 1fr; }
  .admin-form .wide, .admin-form fieldset.wide { grid-column: auto; }
  .kv-grid { grid-template-columns: 1fr 1fr; }
  .inline-form-list form { grid-template-columns: 1fr auto; }
  .inline-form-list code { grid-column: 1 / -1; }
  .row-edit-form { min-width: 480px; }
  .home-nav { font-size: 11px; }
  .home-search { margin-top: 100px; }
  .brand-large { font-size: 54px; }
  .home-search > .brand { margin-bottom: 30px; }
.home-search h1 { font-size: 13px; }
}
