:root {
  --ink: #17243b;
  --muted: #748199;
  --line: #e8edf5;
  --primary: #3267ee;
  --primary-dark: #2453ce;
  --soft-blue: #f3f7ff;
  --surface: #ffffff;
  --background: #f7f9fc;
  --shadow: 0 18px 50px rgba(36, 66, 115, 0.11);
}

* { box-sizing: border-box; }
body {
  margin: 0;
  color: var(--ink);
  background: var(--background);
  font-family: Inter, "PingFang SC", "Microsoft YaHei", sans-serif;
}
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
.hidden { display: none !important; }
.topbar {
  height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 max(24px, calc((100vw - 1180px) / 2));
  background: rgba(255,255,255,.94);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(12px);
}
.brand { display: flex; align-items: center; gap: 11px; color: var(--ink); text-decoration: none; font-size: 21px; font-weight: 800; }
.brand-mark { width: 36px; height: 36px; display: grid; place-items: center; color: #fff; border-radius: 11px; background: linear-gradient(135deg, #67a1ff, #3859ea); box-shadow: 0 8px 20px #4a74e64d; }
nav { display: flex; gap: 10px; }
.back-link { color: var(--primary); text-decoration: none; font-size: 14px; font-weight: 700; }
.nav-button { border: 0; color: var(--muted); background: transparent; padding: 10px 14px; border-radius: 10px; }
.nav-button.active { color: var(--primary); background: var(--soft-blue); font-weight: 700; }
.hero {
  min-height: 465px;
  padding: 92px 24px 70px;
  text-align: center;
  background:
    radial-gradient(circle at 15% 10%, rgba(77, 132, 255, .14), transparent 28%),
    radial-gradient(circle at 85% 5%, rgba(111, 90, 255, .12), transparent 25%),
    linear-gradient(#fff, #f8faff);
}
.eyebrow { margin-bottom: 12px; color: var(--primary); font-size: 13px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; }
h1 { margin: 0; font-size: clamp(36px, 5vw, 58px); letter-spacing: -.045em; }
.hero > p { margin: 18px auto 34px; max-width: 650px; color: var(--muted); line-height: 1.8; }
.search-box {
  width: min(850px, 100%);
  margin: auto;
  padding: 8px;
  display: grid;
  grid-template-columns: 42px 1fr 135px 122px;
  align-items: center;
  background: #fff;
  border: 1px solid #dfe7f5;
  border-radius: 18px;
  box-shadow: var(--shadow);
}
.simple-hero { min-height: 520px; padding-top: 120px; }
.simple-search-box { grid-template-columns: 42px 1fr 122px; }
.search-topbar { justify-content: flex-start; }
.search-icon { color: #9aa9c1; font-size: 28px; transform: rotate(-20deg); }
.search-box input, .search-box select { height: 48px; border: 0; outline: 0; color: var(--ink); background: transparent; }
.search-box select { padding-left: 14px; border-left: 1px solid var(--line); }
.search-box button, .panel button { border: 0; border-radius: 12px; color: #fff; background: var(--primary); font-weight: 700; transition: .2s; }
.search-box button { height: 48px; }
.search-box button:hover, .panel button:hover { background: var(--primary-dark); transform: translateY(-1px); }
.quick-search { margin-top: 20px; color: #a0aabc; font-size: 13px; }
.quick-search button { border: 0; color: #738098; background: transparent; }
.quick-search button:hover { color: var(--primary); }
.results-section, .admin-shell { width: min(1120px, calc(100% - 40px)); margin: 0 auto; padding: 42px 0 80px; }
.results-header { display: flex; align-items: flex-end; justify-content: space-between; margin-bottom: 20px; }
.results-header h2, .panel h2 { margin: 0 0 7px; }
.results-header p, .panel p, .admin-heading p { margin: 0; color: var(--muted); line-height: 1.7; }
.results-header select { padding: 10px 14px; border: 1px solid var(--line); border-radius: 10px; color: var(--ink); background: #fff; }
.result-list { display: grid; gap: 12px; }
.result-card { display: grid; grid-template-columns: 52px 1fr auto; gap: 18px; align-items: center; padding: 20px; background: #fff; border: 1px solid var(--line); border-radius: 16px; transition: .2s; }
.result-card:hover { border-color: #cad9fa; box-shadow: 0 12px 32px rgba(36, 66, 115, .08); transform: translateY(-2px); }
.file-icon { width: 52px; height: 52px; display: grid; place-items: center; border-radius: 14px; font-size: 23px; background: var(--soft-blue); }
.result-info h3 { margin: 0 0 9px; font-size: 16px; }
.result-meta { display: flex; flex-wrap: wrap; gap: 12px; color: var(--muted); font-size: 13px; }
.provider-dot { display: inline-block; width: 8px; height: 8px; margin-right: 5px; border-radius: 50%; }
.result-action { display: flex; gap: 10px; }
.result-action a, .copy-button { padding: 10px 15px; border-radius: 10px; font-size: 13px; text-decoration: none; }
.result-action a { color: #fff; background: var(--primary); }
.copy-button { border: 1px solid var(--line); color: var(--ink); background: #fff; }
.empty-state { padding: 64px 20px; text-align: center; color: var(--muted); background: #fff; border: 1px dashed #ccd6e7; border-radius: 16px; }
.admin-heading { margin: 16px 0 30px; }
.admin-heading h1 { font-size: 42px; margin-bottom: 12px; }
.panel { padding: 26px; background: #fff; border: 1px solid var(--line); border-radius: 18px; box-shadow: 0 8px 30px rgba(36,66,115,.06); }
.login-card { max-width: 540px; margin: 50px auto; }
.login-card form { display: flex; gap: 10px; margin-top: 20px; }
.panel input, .panel select, .panel textarea { width: 100%; padding: 12px 14px; border: 1px solid #dfe5ef; border-radius: 10px; outline: none; resize: vertical; }
.panel input:focus, .panel select:focus, .panel textarea:focus { border-color: #8eafff; box-shadow: 0 0 0 3px #edf3ff; }
.panel button { padding: 12px 18px; }
.login-card input { flex: 1; }
.admin-grid { display: grid; grid-template-columns: 1.2fr .8fr; gap: 22px; align-items: start; }
.panel-title { display: flex; justify-content: space-between; }
.count-badge { min-width: 34px; height: 34px; display: grid; place-items: center; color: var(--primary); background: var(--soft-blue); border-radius: 50%; font-weight: 800; }
.account-list { display: grid; gap: 11px; margin-top: 22px; }
.account-item { display: flex; justify-content: space-between; align-items: center; padding: 16px; border: 1px solid var(--line); border-radius: 13px; }
.account-main { display: flex; align-items: center; gap: 12px; }
.account-logo { width: 40px; height: 40px; display: grid; place-items: center; color: #fff; border-radius: 11px; font-weight: 800; }
.account-main strong, .account-main small { display: block; }
.account-main small { margin-top: 4px; color: var(--muted); }
.delete-account { border: 0 !important; padding: 8px !important; color: #e05656 !important; background: transparent !important; }
.bind-panel form { display: grid; gap: 17px; margin-top: 22px; }
.bind-panel label { display: grid; gap: 8px; font-size: 14px; font-weight: 700; }
.security-note { padding: 12px; color: #8b641a; background: #fff8e8; border-radius: 10px; font-size: 12px; line-height: 1.6; }
.toast { position: fixed; right: 24px; bottom: 24px; padding: 13px 18px; color: #fff; background: #1d2a3e; border-radius: 10px; opacity: 0; transform: translateY(10px); transition: .25s; pointer-events: none; }
.toast.show { opacity: 1; transform: none; }
code { padding: 2px 6px; color: var(--primary); background: var(--soft-blue); border-radius: 5px; }

@media (max-width: 760px) {
  .topbar { height: auto; padding: 14px 18px; }
  .brand { font-size: 18px; }
  .hero { padding-top: 65px; }
  .search-box { grid-template-columns: 38px 1fr; }
  .search-box select, .search-box button { grid-column: span 2; width: 100%; border-left: 0; }
  .simple-search-box { grid-template-columns: 38px 1fr; }
  .simple-search-box button { grid-column: span 2; }
  .search-box select { border-top: 1px solid var(--line); }
  .result-card { grid-template-columns: 44px 1fr; }
  .result-action { grid-column: span 2; }
  .admin-grid { grid-template-columns: 1fr; }
  .login-card form { flex-direction: column; }
  nav { gap: 0; }
}

/* Mobile-first public search experience */
.mobile-search-page { min-height: 100vh; color: #18213c; background: #f5f7ff; font-family: Inter, "PingFang SC", "Microsoft YaHei", sans-serif; }
.mobile-header { height: 64px; display: flex; align-items: center; justify-content: space-between; padding: 0 max(20px, env(safe-area-inset-right)) 0 max(20px, env(safe-area-inset-left)); background: #fff; }
.mobile-brand { display: flex; align-items: center; gap: 9px; color: #18213c; font-size: 19px; font-weight: 850; text-decoration: none; }.brand-orbit { width: 28px; height: 28px; display: grid; place-items: center; color: #fff; background: linear-gradient(145deg,#6258ff,#2a96ff); border-radius: 10px 10px 10px 3px; font-size: 13px; box-shadow: 0 6px 14px #536fff47; }.header-action,.text-button { border: 0; color: #5f6d8a; background: transparent; font-size: 13px; }
.mobile-main { width: min(760px, 100%); margin: auto; }.mobile-hero { padding: 54px 20px 40px; color: #fff; background: radial-gradient(circle at 84% 10%,#7766ff 0,transparent 30%),linear-gradient(135deg,#172254,#0c1436); }.hero-kicker { color: #a9c2ff; font-size: 11px; font-weight: 800; letter-spacing: .17em; }.mobile-hero h1 { margin: 15px 0 10px; font-size: clamp(30px, 8vw, 46px); letter-spacing: -.05em; }.mobile-hero p { margin: 0 0 25px; color: #bdc9e9; font-size: 14px; line-height: 1.7; }
.mobile-search-box { display: flex; gap: 8px; padding: 6px; background: #fff; border-radius: 16px; box-shadow: 0 16px 35px #02061d40; }.mobile-search-box input { width: 100%; min-width: 0; border: 0; outline: 0; padding: 0 12px; color: #17213d; background: transparent; font-size: 15px; }.mobile-search-box button,.solid-button { border: 0; border-radius: 11px; padding: 12px 18px; color: #fff; background: #4d69f6; font-weight: 750; }.quick-row { display: flex; align-items: center; gap: 7px; margin-top: 15px; color: #aebee9; font-size: 12px; }.quick-row button { border: 1px solid #ffffff2c; border-radius: 999px; padding: 5px 10px; color: #dce6ff; background: #ffffff12; }
.source-area,.mobile-results { padding: 25px 20px 0; }.section-label { display: flex; justify-content: space-between; color: #727f9b; font-size: 12px; font-weight: 750; }.section-label small { font-size: 11px; font-weight: 500; }.source-chips { display: flex; gap: 8px; overflow-x: auto; padding: 12px 0 3px; scrollbar-width: none; }.source-chip { flex: none; border: 1px solid #e1e6f4; border-radius: 999px; padding: 9px 13px; color: #62708e; background: #fff; font-size: 13px; }.source-chip small { margin-left: 3px; color: #9ca8c0; }.source-chip.active { border-color: #4d69f6; color: #fff; background: #4d69f6; }.source-chip.active small { color: #d8e0ff; }
.results-top { display: flex; align-items: end; justify-content: space-between; gap: 16px; }.results-top h2 { margin: 7px 0 0; font-size: 20px; }.results-top select { border: 0; border-radius: 9px; padding: 9px; color: #63708b; background: #e9edfa; font-size: 12px; }.mobile-result-list { display: grid; gap: 10px; padding: 17px 0 88px; }.mobile-result-card { display: grid; grid-template-columns: 42px 1fr; gap: 11px; padding: 15px; background: #fff; border: 1px solid #e7ebf7; border-radius: 15px; box-shadow: 0 6px 18px #33416b0b; }.resource-icon { width: 42px; height: 42px; display: grid; place-items: center; border-radius: 13px; color: #485ef0; background: #ecf0ff; font-size: 19px; }.resource-title { overflow: hidden; font-size: 15px; font-weight: 760; line-height: 1.4; text-overflow: ellipsis; white-space: nowrap; }.resource-source { display: flex; align-items: center; gap: 5px; margin-top: 7px; color: #667492; font-size: 12px; }.resource-source i { width: 6px; height: 6px; border-radius: 50%; background: #51bf94; }.resource-meta { margin-top: 4px; color: #a0abc0; font-size: 11px; }.resource-actions { grid-column: 1 / -1; display: flex; gap: 8px; }.resource-actions button,.resource-actions a { flex: 1; border: 1px solid #dfe5f5; border-radius: 9px; padding: 9px; color: #52627e; background: #fff; text-align: center; text-decoration: none; font-size: 12px; font-weight: 700; }.resource-actions a { border-color: #4d69f6; color: #fff; background: #4d69f6; }.empty-card,.loading-card { display: grid; gap: 7px; place-items: center; min-height: 160px; padding: 24px; color: #7e8aa3; background: #fff; border: 1px dashed #ccd5ec; border-radius: 15px; font-size: 13px; }.empty-card b { color: #52607c; font-size: 15px; }
.mobile-footer { display: grid; gap: 8px; padding: 25px 20px calc(25px + env(safe-area-inset-bottom)); text-align: center; color: #99a4b8; font-size: 11px; }.mobile-footer button { border: 0; color: #5165d4; background: transparent; font-size: 13px; font-weight: 750; }.sheet { width: min(540px, calc(100% - 32px)); border: 0; border-radius: 22px; padding: 25px; color: #273451; box-shadow: 0 24px 70px #111a3f42; }.sheet::backdrop { background: #0c143880; backdrop-filter: blur(3px); }.sheet-handle { width: 40px; height: 4px; margin: 0 auto 20px; border-radius: 999px; background: #d9dfec; }.sheet h2 { margin: 0 0 10px; font-size: 21px; }.sheet p,.sheet li { color: #74809a; font-size: 14px; line-height: 1.8; }.sheet ol { padding-left: 20px; }.sheet form { display: grid; gap: 10px; margin-top: 15px; }.sheet textarea,.sheet input { width: 100%; border: 1px solid #dfe5f4; border-radius: 11px; padding: 12px; outline: 0; resize: vertical; }.sheet textarea { min-height: 100px; }.sheet .text-button { display: block; width: 100%; margin-top: 13px; }.toast { left: 50%; right: auto; bottom: 26px; transform: translate(-50%,10px); border-radius: 999px; white-space: nowrap; }.toast.show { transform: translate(-50%,0); }
@media (min-width: 761px) { .mobile-header { padding-left: 36px; padding-right: 36px; }.mobile-hero { padding: 80px 64px 62px; border-radius: 0 0 36px 36px; }.source-area,.mobile-results { padding-left: 64px; padding-right: 64px; }.mobile-result-card { grid-template-columns: 48px 1fr auto; align-items: center; }.resource-actions { grid-column: auto; min-width: 140px; }.mobile-footer { padding-top: 36px; } }

/* Warm, high-saturation reading theme for the public bookshelf. */
.mobile-search-page { color: #482d2b; background: #fff1e8; }
.mobile-header { max-width: 900px; height: 68px; margin: 0 auto; background: transparent; }
.mobile-brand { color: #572f2b; font-size: 20px; }
.brand-orbit { width: 32px; height: 32px; border-radius: 11px 11px 11px 4px; background: linear-gradient(145deg, #ff8b4a, #f0525d); box-shadow: 0 8px 18px #f660514d; }
.header-action,.text-button { color: #bc5949; font-weight: 750; }
.mobile-main { width: min(900px, 100%); padding: 0 18px; }
.mobile-hero { margin-top: 5px; padding: 46px 32px 32px; color: #542f2d; border: 1px solid #ffd5c3; border-radius: 30px; overflow: hidden; background: radial-gradient(circle at 89% 14%, #ffbb72 0 8%, transparent 27%), radial-gradient(circle at 75% 100%, #ffccb8 0 5%, transparent 27%), linear-gradient(135deg, #fff8df, #ffd9c8); }
.hero-kicker { color: #dd6044; }
.mobile-hero h1 { margin-top: 13px; color: #5a302c; font-family: "Songti SC", "STSong", "PingFang SC", sans-serif; font-size: clamp(31px, 7vw, 47px); letter-spacing: -.055em; }
.mobile-hero p { color: #98655e; }
.mobile-search-box { display: flex !important; flex-direction: row; align-items: center; gap: 7px; padding: 6px; border: 1px solid #fffaf4; border-radius: 15px; box-shadow: 0 15px 30px #b55d3c2e; }
.mobile-search-box input { flex: 1; width: auto; min-width: 0; height: 44px; padding: 0 13px; }
.mobile-search-box button,.solid-button { flex: 0 0 auto; height: 44px; padding: 0 18px; border-radius: 10px; background: linear-gradient(135deg, #ff714d, #ed4d59); box-shadow: 0 7px 14px #e75b5540; }
.quick-row { color: #9c6359; }.quick-row button { border-color: #e9a18e; color: #a14d41; background: #fff7ee99; }
.source-area,.mobile-results { padding: 26px 6px 0; }.section-label { color: #966b65; }.source-chip { border-color: #f4c7b8; color: #a46258; background: #fffaf6; }.source-chip.active { border-color: #f36b52; background: #f36b52; }.source-chip.active small { color: #ffe2d8; }
.results-top h2 { color: #57302d; }.results-top select { color: #a35e52; background: #ffe1d2; }.mobile-result-card { border-color: #f4d8cb; border-radius: 17px; box-shadow: 0 8px 20px #9d4a2910; }.resource-icon { color: #e95c50; background: #ffe5d7; }.resource-source { color: #926e69; }.resource-source i { background: #f26d4f; }.resource-meta { color: #b59a95; }.resource-actions a { border-color: #f36b52; background: #f36b52; }.empty-card,.loading-card { border-color: #edbfaf; background: #fffaf6; }.mobile-footer button { color: #dc5e49; }
.external-search-card { display: grid; grid-template-columns: 46px 1fr auto; align-items: center; gap: 12px; padding: 17px; border: 1px solid #ffc99f; border-radius: 17px; color: #744238; background: linear-gradient(135deg, #fff9e3, #ffe0cf); box-shadow: 0 9px 21px #b75a2a14; }.external-search-card strong { font-size: 15px; }.external-search-card p { margin: 5px 0 0; color: #a06e64; font-size: 12px; }.external-search-icon { width: 46px; height: 46px; display: grid; place-items: center; border-radius: 15px; color: #fff; background: linear-gradient(135deg, #ff8b4a, #ee5555); font-size: 24px; }.external-search-card a { padding: 10px 12px; border-radius: 10px; color: #fff; background: #ed5a51; text-decoration: none; font-size: 12px; font-weight: 750; }
@media (max-width: 760px) { .mobile-header { padding: 0 21px; }.mobile-main { padding: 0 14px; }.mobile-hero { padding: 37px 20px 25px; border-radius: 24px; }.mobile-search-box { border-radius: 14px; }.mobile-search-box button { width: auto !important; grid-column: auto !important; }.external-search-card { grid-template-columns: 42px 1fr; }.external-search-card a { grid-column: 1 / -1; text-align: center; }.external-search-icon { width: 42px; height: 42px; } }
