:root {
  color-scheme: dark;
  --bg: #061014;
  --surface: #0b171b;
  --surface-2: #0f1d22;
  --surface-3: #14272b;
  --ink: #eefaf6;
  --muted: #8ca6a1;
  --line: #20383b;
  --line-strong: #315155;
  --blue: #35e0c1;
  --blue-deep: #18bfa8;
  --blue-soft: rgba(53, 224, 193, .1);
  --lime: #b8ef69;
  --amber: #ffb45e;
  --danger: #ff7180;
  --shadow: 0 18px 50px rgba(0, 0, 0, .28);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { min-width: 320px; background: var(--bg); }
body {
  margin: 0;
  min-width: 320px;
  color: var(--ink);
  background-color: var(--bg);
  background-image:
    linear-gradient(rgba(53, 224, 193, .035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(53, 224, 193, .035) 1px, transparent 1px);
  background-size: 40px 40px;
  font-family: Inter, "Microsoft YaHei", "PingFang SC", system-ui, sans-serif;
  letter-spacing: 0;
}
body::before { content: ""; position: fixed; z-index: -1; inset: 0 0 auto; height: 2px; background: linear-gradient(90deg, transparent, var(--blue), var(--lime), transparent); opacity: .8; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .45; }
h1, h2, h3, p { margin: 0; }
a { color: inherit; }
.app-shell { width: min(1180px, calc(100% - 32px)); margin: 0 auto; }

.topbar { display: flex; align-items: center; justify-content: space-between; gap: 24px; padding: 28px 0 20px; }
.brand { display: flex; align-items: center; gap: 14px; min-width: 0; }
.brand-mark { display: block; width: 46px; height: 46px; flex: 0 0 46px; overflow: hidden; border: 1px solid rgba(67,211,255,.55); border-radius: 10px; background: #061044; box-shadow: 0 0 22px rgba(39,180,255,.25); }
.brand-mark img { display: block; width: 100%; height: 100%; object-fit: cover; }
h1 { font-size: 28px; line-height: 1.2; font-weight: 760; }
.brand p { margin-top: 4px; color: var(--muted); font-size: 13px; }
.topbar-actions { display: flex; align-items: center; gap: 9px; }
.user-chip { display: inline-flex; align-items: center; gap: 8px; min-height: 38px; padding: 0 12px; border: 1px solid var(--line); border-radius: 5px; color: #b8cbc7; background: rgba(11,23,27,.92); font-size: 12px; }
.user-chip svg { width: 15px; color: var(--blue); }
.icon-button { display: grid; place-items: center; width: 38px; height: 38px; padding: 0; border: 1px solid var(--line); border-radius: 5px; color: #a7bcb8; background: var(--surface); text-decoration: none; transition: .18s ease; }
.icon-button svg { width: 17px; }
.icon-button:hover { color: var(--blue); border-color: var(--blue); box-shadow: 0 0 16px rgba(53,224,193,.1); }

main { display: grid; gap: 16px; padding-bottom: 34px; }
.workspace, .results-section { position: relative; overflow: hidden; padding: 24px; border: 1px solid var(--line); border-radius: 7px; background: rgba(11,23,27,.96); box-shadow: var(--shadow); }
.workspace::before, .results-section::before { content: ""; position: absolute; top: 0; left: 24px; width: 72px; height: 2px; background: var(--blue); box-shadow: 0 0 14px rgba(53,224,193,.55); }
.results-section::before { background: var(--lime); box-shadow: 0 0 14px rgba(184,239,105,.45); }
.section-heading, .results-head { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 22px; }
.section-kicker { display: block; margin-bottom: 5px; color: var(--blue); font: 700 10px/1.2 Consolas, "SFMono-Regular", monospace; letter-spacing: 1.8px; }
.results-section .section-kicker { color: var(--lime); }
h2 { font-size: 19px; font-weight: 720; }
.text-button { display: inline-flex; align-items: center; gap: 7px; min-height: 34px; padding: 0 5px; border: 0; color: var(--muted); background: transparent; }
.text-button:hover { color: var(--blue); }
.text-button svg { width: 15px; }

.filter-grid { display: grid; grid-template-columns: 1.2fr .8fr 1.35fr; gap: 20px 18px; }
.field-wide { grid-column: span 2; }
.field label { display: flex; align-items: center; gap: 7px; margin-bottom: 8px; color: #c9d9d5; font-size: 12px; font-weight: 680; }
.field label svg { width: 14px; color: var(--blue); }
input, select, textarea { width: 100%; min-width: 0; border: 1px solid var(--line-strong); border-radius: 5px; outline: 0; color: var(--ink); background: #081317; }
input { min-height: 42px; padding: 0 12px; }
input::placeholder, textarea::placeholder { color: #56706c; }
input:focus, select:focus, textarea:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(53,224,193,.09), 0 0 18px rgba(53,224,193,.06); }
small { display: block; margin-top: 7px; color: #6e8883; font-size: 11px; }
.date-row, .input-action, .stepper { display: flex; align-items: center; gap: 8px; }
.date-row span { color: #607b76; font-size: 11px; }
.segmented, .mode-switch { display: flex; gap: 5px; margin-top: 8px; overflow-x: auto; scrollbar-width: none; }
.segmented button, .mode-switch button { min-height: 34px; padding: 0 12px; white-space: nowrap; border: 1px solid var(--line); border-radius: 4px; color: #8fa8a3; background: #0b171b; font-size: 11px; transition: .18s ease; }
.segmented button:hover, .mode-switch button:hover { color: #d8ebe7; border-color: var(--line-strong); }
.segmented button.active, .mode-switch button.active { color: var(--blue); border-color: rgba(53,224,193,.52); background: var(--blue-soft); box-shadow: inset 0 -2px 0 var(--blue); font-weight: 700; }

.secondary-button, .primary-button, .copy-button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 42px; padding: 0 17px; border-radius: 5px; font-weight: 700; transition: .18s ease; }
.input-action .secondary-button { min-width: 82px; white-space: nowrap; }
.secondary-button { border: 1px solid var(--line-strong); color: #bed0cc; background: var(--surface-2); text-decoration: none; }
.secondary-button:hover { color: var(--blue); border-color: var(--blue); }
.primary-button { border: 1px solid var(--blue); color: #03110e; background: var(--blue); box-shadow: 0 0 22px rgba(53,224,193,.18); }
.primary-button:hover { border-color: #6af0d7; background: #6af0d7; box-shadow: 0 0 28px rgba(53,224,193,.28); }
.primary-button svg, .secondary-button svg, .copy-button svg { width: 16px; }
.stepper { gap: 0; }
.stepper input { border-radius: 0; text-align: center; appearance: textfield; }
.stepper button { display: grid; place-items: center; width: 42px; height: 42px; flex: 0 0 42px; border: 1px solid var(--line-strong); color: #a9bfba; background: var(--surface-2); }
.stepper button:first-child { border-radius: 5px 0 0 5px; }
.stepper button:last-child { border-radius: 0 5px 5px 0; }
.stepper button:hover { color: var(--blue); }
.stepper svg { width: 15px; }
.mode-switch { margin-top: 0; }

.action-row { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-top: 24px; padding-top: 20px; border-top: 1px solid var(--line); }
.action-row p { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: 12px; }
.action-row p svg { width: 15px; color: var(--lime); }
.action-row strong { color: var(--lime); font: 700 13px Consolas, monospace; }
.tip-band { display: flex; gap: 12px; margin-top: 18px; padding: 14px 15px; border: 1px solid #294642; border-radius: 5px; background: rgba(22,55,48,.38); }
.tip-icon { display: grid; place-items: center; width: 34px; height: 34px; flex: 0 0 34px; border: 1px solid rgba(184,239,105,.25); border-radius: 5px; color: var(--lime); background: rgba(184,239,105,.08); }
.tip-icon svg { width: 17px; }
.tip-band strong { color: #d8e9e5; font-size: 13px; }
.tip-band p { margin-top: 3px; color: #819b96; font-size: 12px; line-height: 1.6; }

.results-head { margin-bottom: 15px; }
.results-head > div > p { margin-top: 5px; color: var(--muted); font-size: 12px; }
.bulk-bar { display: flex; align-items: center; gap: 14px; min-height: 50px; margin: 0 -24px 16px; padding: 0 24px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); background: #091418; }
.check-control { display: flex; align-items: center; gap: 7px; font-size: 12px; }
.check-control input, .result-check input { width: 16px; min-height: 16px; accent-color: var(--blue); }
.selection-count { flex: 1; color: var(--muted); font-size: 12px; }
.selection-count strong { color: var(--lime); }
.copy-button { min-height: 36px; padding: 0 12px; border: 1px solid rgba(184,239,105,.38); color: var(--lime); background: rgba(184,239,105,.08); }
.copy-button:hover { border-color: var(--lime); background: rgba(184,239,105,.13); }
.copy-button span { min-width: 20px; padding: 2px 6px; border-radius: 10px; color: #071007; background: var(--lime); font-size: 10px; }
.empty-state { display: grid; justify-items: center; padding: 54px 20px 62px; text-align: center; }
.empty-state[hidden] { display: none !important; }
.empty-state > span { display: grid; place-items: center; width: 54px; height: 54px; border: 1px solid rgba(53,224,193,.35); border-radius: 6px; color: var(--blue); background: var(--blue-soft); box-shadow: 0 0 24px rgba(53,224,193,.08); }
.empty-state svg { width: 24px; }
.empty-state h3 { margin-top: 15px; font-size: 15px; }
.empty-state p { margin-top: 7px; color: #6f8984; font-size: 12px; }
.result-list { display: grid; gap: 9px; }
.result-card { position: relative; display: grid; grid-template-columns: auto 1fr auto; gap: 13px; align-items: start; padding: 16px 17px; border: 1px solid var(--line); border-radius: 5px; background: var(--surface-2); transition: border-color .18s, transform .18s, box-shadow .18s; }
.result-card::before { content: ""; position: absolute; inset: 10px auto 10px 0; width: 2px; background: var(--blue); opacity: .45; }
.result-card:hover { transform: translateY(-1px); border-color: #365a5b; box-shadow: 0 10px 26px rgba(0,0,0,.2), 0 0 18px rgba(53,224,193,.04); }
.result-check { padding-top: 3px; }
.result-main { min-width: 0; }
.result-title-row { display: flex; align-items: center; gap: 9px; min-width: 0; }
.result-index { display: grid; place-items: center; min-width: 24px; height: 24px; padding: 0 6px; border: 1px solid var(--line); border-radius: 3px; color: #85a09b; background: #091418; font: 11px Consolas, monospace; }
.result-title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #e7f3f0; font-size: 14px; font-weight: 720; }
.super-tag { padding: 3px 7px; border: 1px solid rgba(255,180,94,.32); border-radius: 3px; color: var(--amber); background: rgba(255,180,94,.08); font-size: 9px; font-weight: 800; }
.meta-row { display: flex; flex-wrap: wrap; gap: 8px 16px; margin-top: 11px; color: #7f9994; font-size: 11px; }
.meta-row span { display: inline-flex; align-items: center; gap: 5px; }
.meta-row svg { width: 13px; color: #5e7d78; }
.open-link { display: inline-flex; align-items: center; gap: 5px; margin-top: 12px; color: var(--blue); text-decoration: none; font-size: 11px; font-weight: 700; }
.open-link:hover { color: #71f2dc; }
.open-link svg { width: 12px; }
.likes { padding-top: 2px; color: var(--lime); font: 800 15px Consolas, monospace; white-space: nowrap; }
.likes small { display: inline; margin: 0 0 0 3px; color: #708a85; font: 500 9px system-ui, sans-serif; }
.toast { position: fixed; z-index: 20; left: 50%; bottom: 24px; transform: translate(-50%, 20px); max-width: calc(100% - 32px); padding: 11px 15px; border: 1px solid #37605c; border-radius: 5px; color: #dff8f2; background: #10231f; box-shadow: 0 12px 34px rgba(0,0,0,.34); opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; font-size: 12px; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.spin { animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

@media (max-width: 820px) {
  .filter-grid { grid-template-columns: 1fr 1fr; }
  .field-wide { grid-column: 1 / -1; }
  .filter-grid .field:last-child { grid-column: 1 / -1; }
}
@media (max-width: 600px) {
  .app-shell { width: min(100% - 20px, 1180px); }
  .topbar { align-items: flex-start; padding-top: 20px; }
  h1 { font-size: 23px; }
  .brand p { max-width: 210px; }
  .user-chip { max-width: 132px; }
  .user-chip span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .workspace, .results-section { padding: 18px; }
  .workspace::before, .results-section::before { left: 18px; }
  .filter-grid { grid-template-columns: 1fr; }
  .field-wide, .filter-grid .field:last-child { grid-column: auto; }
  .date-row { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); }
  .mode-switch { display: grid; grid-template-columns: 1fr; }
  .action-row { align-items: stretch; flex-direction: column; }
  .primary-button { width: 100%; }
  .bulk-bar { margin-left: -18px; margin-right: -18px; padding: 8px 18px; flex-wrap: wrap; }
  .selection-count { order: 3; width: 100%; flex-basis: 100%; }
  .copy-button { margin-left: auto; }
  .result-card { grid-template-columns: auto minmax(0, 1fr); }
  .likes { grid-column: 2; grid-row: 2; padding-top: 0; }
}
