:root {
  color-scheme: light;
  --bg: #f6f7fb;
  --surface: #ffffff;
  --surface-soft: #f0f2f8;
  --text: #182033;
  --muted: #75809a;
  --line: #e7eaf1;
  --accent: #4f46e5;
  --accent-soft: #ecebff;
  --shadow: 0 12px 35px rgba(41, 49, 75, .08);
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #11131a;
  --surface: #191c26;
  --surface-soft: #232735;
  --text: #f4f6fb;
  --muted: #9ca6bb;
  --line: #2d3343;
  --accent: #9892ff;
  --accent-soft: #2d2c52;
  --shadow: 0 12px 35px rgba(0, 0, 0, .22);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; min-width: 320px; background: var(--bg); color: var(--text); font: 15px/1.55 -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif; }
button, input { font: inherit; }
button { cursor: pointer; }
.app-shell { min-height: 100vh; display: flex; }
.sidebar { width: 252px; min-height: 100vh; position: sticky; top: 0; align-self: flex-start; display: flex; flex-direction: column; padding: 28px 16px 18px; border-right: 1px solid var(--line); background: var(--surface); }
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); font-size: 19px; font-weight: 750; text-decoration: none; padding: 0 8px; }
.brand-mark { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 9px; background: linear-gradient(135deg, #675cff, #3d38c9); color: white; font-size: 16px; }
.brand-note { margin: 8px 8px 24px; color: var(--muted); font-size: 12px; }
.source-nav { display: grid; gap: 3px; overflow: auto; padding: 1px 0 14px; }
.source-row { display: flex; align-items: center; gap: 2px; border-radius: 9px; }.source-row:hover { background: var(--surface-soft); }.source-row:has(.active) { background: var(--accent-soft); }
.source-button { appearance: none; display: flex; width: 100%; align-items: center; gap: 10px; padding: 9px 10px; border: 0; border-radius: 9px; background: transparent; color: var(--muted); text-align: left; transition: .16s ease; }
.source-button:hover { background: var(--surface-soft); color: var(--text); }
.source-button.active { background: var(--accent-soft); color: var(--accent); font-weight: 650; }
.source-icon { flex: 0 0 auto; display: grid; place-items: center; width: 22px; height: 22px; border-radius: 7px; background: var(--surface-soft); font-size: 12px; font-weight: 700; }
.source-button.active .source-icon { background: var(--surface); }
.remove-source { flex: 0 0 auto; width: 27px; height: 27px; margin-right: 5px; border: 0; border-radius: 7px; background: transparent; color: var(--muted); font-size: 18px; line-height: 1; opacity: .55; }.remove-source:hover { background: var(--surface); color: #df4d58; opacity: 1; }
.manage-button { margin-top: 4px; padding: 10px; border: 1px dashed #b9b5f6; border-radius: 9px; background: transparent; color: var(--accent); font-weight: 650; }
.sidebar-footer { margin-top: auto; padding: 20px 8px 0; color: var(--muted); font-size: 12px; }
.main-content { width: min(100%, 1120px); margin: 0 auto; padding: 42px 42px 64px; }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.eyebrow { margin: 0 0 3px; color: var(--accent); font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
h1, h2 { margin: 0; letter-spacing: -.02em; } h1 { font-size: 30px; line-height: 1.25; } h2 { font-size: 23px; }
.top-actions { display: flex; align-items: center; gap: 9px; }
.icon-button, .menu-button { display: grid; place-items: center; width: 38px; height: 38px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); color: var(--text); font-size: 20px; }
.menu-button { display: none; }
.refresh-button, .primary-button { border: 0; border-radius: 10px; padding: 9px 15px; background: var(--accent); color: white; font-weight: 700; box-shadow: 0 5px 12px rgba(79, 70, 229, .2); }
.intro-panel { display: flex; justify-content: space-between; gap: 16px; margin: 34px 0 18px; padding: 19px 21px; border-radius: 15px; background: linear-gradient(110deg, var(--accent-soft), var(--surface)); border: 1px solid var(--line); }
.welcome { margin: 0; font-weight: 750; font-size: 17px; }.subtle, .updated { margin: 3px 0 0; color: var(--muted); }.updated { align-self: center; font-size: 13px; white-space: nowrap; }
.search-box { display: flex; align-items: center; gap: 10px; padding: 0 14px; height: 46px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); color: var(--muted); box-shadow: var(--shadow); }
.search-box:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }.search-box input { min-width: 0; flex: 1; border: 0; outline: 0; background: transparent; color: var(--text); }.search-box kbd { padding: 1px 6px; border: 1px solid var(--line); border-radius: 4px; color: var(--muted); font-size: 11px; }
.list-area { margin-top: 20px; }.hot-list { margin: 0; padding: 0; list-style: none; background: var(--surface); border: 1px solid var(--line); border-radius: 15px; overflow: hidden; box-shadow: var(--shadow); }.hot-item { display: grid; grid-template-columns: 38px minmax(0, 1fr) auto; gap: 14px; align-items: start; padding: 17px 18px; border-bottom: 1px solid var(--line); }.hot-item:last-child { border-bottom: 0; }.rank { color: var(--muted); font: 700 16px/1.7 ui-monospace, SFMono-Regular, Menlo, monospace; }.hot-item:nth-child(1) .rank { color: #ef5252; }.hot-item:nth-child(2) .rank { color: #e68a35; }.hot-item:nth-child(3) .rank { color: #d6a533; }.item-link { color: var(--text); font-size: 16px; font-weight: 680; line-height: 1.45; text-decoration: none; }.item-link:hover { color: var(--accent); }.item-desc { display: -webkit-box; margin: 5px 0 0; overflow: hidden; color: var(--muted); font-size: 13px; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }.hot-value { max-width: 105px; padding-top: 3px; color: var(--muted); font-size: 12px; white-space: nowrap; }.loading-state, .empty-state { display: flex; justify-content: center; align-items: center; min-height: 220px; color: var(--muted); }.spinner { width: 17px; height: 17px; margin-right: 9px; border: 2px solid var(--line); border-top-color: var(--accent); border-radius: 50%; animation: spin .75s linear infinite; } @keyframes spin { to { transform: rotate(360deg); } }
.modal-backdrop { position: fixed; z-index: 10; inset: 0; display: grid; place-items: center; padding: 22px; background: rgba(12, 15, 24, .52); }.modal { width: min(650px, 100%); max-height: min(760px, 92vh); display: flex; flex-direction: column; padding: 24px; border: 1px solid var(--line); border-radius: 17px; background: var(--surface); box-shadow: 0 25px 75px rgba(0,0,0,.35); }.modal-header { display: flex; justify-content: space-between; align-items: start; }.modal-search { width: 100%; margin: 20px 0 9px; padding: 11px 13px; border: 1px solid var(--line); border-radius: 9px; outline: none; background: var(--bg); color: var(--text); }.selection-count { margin: 0 0 10px; color: var(--muted); font-size: 13px; }.source-picker { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px; overflow: auto; padding: 2px; }.picker-option { display: flex; align-items: center; gap: 9px; padding: 9px; border: 1px solid var(--line); border-radius: 9px; color: var(--text); }.picker-option:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }.picker-option input { accent-color: var(--accent); }.modal-actions { display: flex; justify-content: flex-end; gap: 9px; margin-top: 20px; }.secondary-button { border: 1px solid var(--line); border-radius: 10px; padding: 9px 14px; background: transparent; color: var(--text); font-weight: 650; }
@media (max-width: 760px) { .sidebar { position: fixed; z-index: 8; width: 270px; transform: translateX(-105%); transition: transform .2s ease; box-shadow: var(--shadow); }.sidebar.open { transform: translateX(0); }.main-content { padding: 23px 16px 42px; }.menu-button { display: grid; } h1 { font-size: 24px; }.intro-panel { margin-top: 25px; }.updated { display: none; }.hot-item { grid-template-columns: 29px minmax(0, 1fr); gap: 9px; padding: 15px 13px; }.hot-value { grid-column: 2; padding: 0; }.source-picker { grid-template-columns: 1fr; }.remove-source { opacity: .9; } }
