:root {
  --ink: #17211f;
  --muted: #64716d;
  --line: #dfe6e3;
  --paper: #fff;
  --soft: #f4f7f6;
  --green: #13745a;
  --green-dark: #0b5743;
  --mint: #e2f5ee;
  --mint-strong: #c9eadf;
  --blue: #285d8f;
  --gold: #c98b3c;
  --danger: #a83b39;
  --shadow: 0 18px 55px rgba(25, 48, 41, .09);
  --shadow-soft: 0 8px 30px rgba(25, 48, 41, .07);
  --radius: 16px;
}

* { box-sizing: border-box; }
html { color-scheme: light; scroll-behavior: smooth; }
body { margin: 0; color: var(--ink); background: #f7f9f8; font-family: Inter, "PingFang SC", "Microsoft YaHei", system-ui, sans-serif; line-height: 1.65; -webkit-font-smoothing: antialiased; }
a { color: var(--green); text-decoration: none; }
a:hover { color: var(--green-dark); }
button, input, select, textarea { font: inherit; }
button, .button { cursor: pointer; }
.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; }
.container { width: min(1180px, calc(100% - 40px)); margin: 0 auto; }
.container.narrow { width: min(980px, calc(100% - 40px)); }
.muted { color: var(--muted); }

.site-header { height: 70px; border-bottom: 1px solid rgba(220, 229, 225, .82); background: rgba(255,255,255,.94); position: sticky; top: 0; z-index: 30; backdrop-filter: blur(16px); box-shadow: 0 2px 16px rgba(25, 48, 41, .035); }
.nav-wrap { width: min(1240px, calc(100% - 40px)); height: 100%; margin: 0 auto; display: flex; align-items: center; gap: 40px; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); font-size: 18px; font-weight: 750; letter-spacing: -.02em; }
.brand-mark { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 11px; color: white; background: linear-gradient(145deg, #198468, #0c5b46); box-shadow: 0 7px 16px rgba(19, 116, 90, .22); font-family: Georgia, serif; font-size: 22px; }
.brand-copy { display: flex; flex-direction: column; line-height: 1.08; }
.brand-copy small { margin-top: 4px; color: #89938f; font-size: 9px; font-weight: 650; letter-spacing: .08em; }
.main-nav { display: flex; gap: 28px; height: 100%; align-items: center; }
.main-nav a { height: 100%; display: grid; place-items: center; color: #485650; font-size: 14px; position: relative; }
.main-nav a.active, .main-nav a:hover { color: var(--green); }
.main-nav a.active::after { content: ""; position: absolute; height: 2px; left: 0; right: 0; bottom: 0; background: var(--green); }
.account-nav { margin-left: auto; display: flex; gap: 16px; align-items: center; font-size: 14px; }
.account-nav form, .paper-actions form { display: inline; margin: 0; }
.username { color: var(--muted); }

.button { display: inline-flex; justify-content: center; align-items: center; min-height: 44px; padding: 10px 20px; border: 1px solid var(--green); border-radius: 11px; color: white; background: var(--green); font-weight: 680; box-shadow: 0 5px 12px rgba(19, 116, 90, .12); transition: .16s ease; }
.button:hover { color: white; background: var(--green-dark); border-color: var(--green-dark); transform: translateY(-1px); }
.button.secondary { color: var(--green); background: white; border-color: var(--line); }
.button.secondary:hover { background: var(--soft); color: var(--green-dark); }
.button.small { min-height: 36px; padding: 6px 15px; }
.button.full { width: 100%; }
.button.danger-soft { color: var(--danger); border-color: #ecd2d1; background: #fff7f7; }
.link-button { padding: 0; color: var(--green); border: 0; background: none; }
.link-button:hover { color: var(--green-dark); text-decoration: underline; }

.flash { width: min(760px, calc(100% - 40px)); margin: 16px auto -4px; padding: 12px 16px; border-radius: 10px; background: #eef5f2; border: 1px solid #d4e7df; color: var(--green-dark); }
.flash-warning { background: #fff8e9; border-color: #f0deb8; color: #75551d; }
.flash-success { background: #edf9f4; }

.hero { overflow: hidden; background: radial-gradient(circle at 76% 35%, rgba(111, 187, 155, .22), transparent 28%), linear-gradient(135deg, #f8fbf9 0%, #eef6f2 100%); border-bottom: 1px solid var(--line); }
.hero-inner { width: min(980px, calc(100% - 40px)); margin: 0 auto; padding: 92px 0 86px; text-align: center; }
.eyebrow { display: block; margin-bottom: 13px; color: var(--green); font-size: 12px; font-weight: 800; letter-spacing: .16em; }
.hero h1 { margin: 0; font-family: Georgia, "Songti SC", serif; font-weight: 500; font-size: clamp(42px, 6vw, 70px); line-height: 1.15; letter-spacing: -.045em; }
.hero h1 span { color: var(--green); }
.hero > div > p { margin: 22px auto 30px; color: var(--muted); font-size: 18px; }
.hero-search { max-width: 750px; margin: 0 auto; padding: 8px; display: flex; gap: 8px; background: white; border: 1px solid #d4e1dc; border-radius: 15px; box-shadow: var(--shadow); }
.hero-search input { min-width: 0; flex: 1; padding: 11px 15px; border: 0; outline: 0; background: transparent; }
.hero-search button { padding: 11px 24px; border: 0; border-radius: 10px; color: white; background: var(--green); font-weight: 700; }
.hero-stats { margin-top: 27px; display: flex; justify-content: center; gap: 34px; color: var(--muted); font-size: 13px; }
.hero-stats strong { color: var(--ink); }

.section { padding: 78px 0; }
.section.compact { padding-top: 42px; }
.section-muted { background: var(--soft); border-top: 1px solid var(--line); }
.section-heading { margin-bottom: 30px; display: flex; justify-content: space-between; align-items: end; }
.section-heading h2 { margin: 0; font-family: Georgia, "Songti SC", serif; font-size: 34px; font-weight: 500; }
.section-heading .eyebrow { margin-bottom: 6px; }
.conference-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.conference-card { min-height: 150px; padding: 22px; color: var(--ink); border: 1px solid var(--line); border-radius: 16px; background: white; box-shadow: 0 3px 16px rgba(25, 48, 41, .035); transition: .18s ease; }
.conference-card:hover { color: var(--ink); border-color: #a8cabc; box-shadow: var(--shadow); transform: translateY(-3px); }
.conference-card span { display: block; min-height: 42px; font-size: 17px; font-weight: 750; }
.conference-card strong { margin-right: 5px; color: var(--green); font-family: Georgia, serif; font-size: 24px; }
.conference-card small { color: var(--muted); }
.conference-card .conference-category { display: block; margin-bottom: 8px; color: #8b9692; font-size: 10px; font-weight: 700; letter-spacing: .04em; }
.paper-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.paper-card, .paper-row { background: white; border: 1px solid var(--line); border-radius: 16px; box-shadow: 0 3px 18px rgba(25, 48, 41, .035); }
.paper-card { padding: 24px; transition: border-color .18s ease, transform .18s ease, box-shadow .18s ease; }
.paper-card:hover { transform: translateY(-2px); border-color: #b9d5cb; box-shadow: var(--shadow-soft); }
.paper-card h3 { margin: 12px 0 8px; font-size: 18px; line-height: 1.45; }
.paper-card h3 a, .paper-row h2 a { color: var(--ink); }
.paper-card h3 a:hover, .paper-row h2 a:hover { color: var(--green); }
.paper-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; color: var(--muted); font-size: 12px; }
.badge { padding: 4px 9px; border: 1px solid #cfebe1; border-radius: 7px; color: var(--green-dark); background: var(--mint); font-weight: 750; }
.authors { color: #53625c; font-size: 13px; }
.abstract-clamp { display: -webkit-box; overflow: hidden; color: var(--muted); font-size: 14px; -webkit-line-clamp: 3; -webkit-box-orient: vertical; }
.paper-actions { display: flex; flex-wrap: wrap; gap: 18px; align-items: center; margin-top: 16px; font-size: 13px; font-weight: 650; }

.page-head { padding: 52px 0 43px; background: radial-gradient(circle at 75% 0, rgba(45, 145, 112, .1), transparent 28%), linear-gradient(135deg, #fbfcfb, #edf5f1); border-bottom: 1px solid var(--line); }
.page-head h1 { margin: 0; font-family: Georgia, "Songti SC", serif; font-size: 42px; font-weight: 500; }
.page-head p { margin-bottom: 0; color: var(--muted); }
.search-layout, .library-layout { padding: 36px 0 80px; display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 34px; align-items: start; }
.filter-panel { position: sticky; top: 100px; padding: 21px; background: white; border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow-soft); }
.field { margin-bottom: 17px; }
.field label, .new-collection label { display: block; margin-bottom: 6px; font-size: 13px; font-weight: 700; }
.field small { display: block; margin-top: 5px; color: var(--muted); font-size: 12px; }
input, select, textarea { width: 100%; padding: 10px 12px; color: var(--ink); border: 1px solid #cfdad5; border-radius: 9px; background: white; outline: none; }
input:focus, select:focus, textarea:focus { border-color: var(--green); box-shadow: 0 0 0 3px rgba(23, 107, 82, .1); }
textarea { resize: vertical; }
.reset-link { display: block; margin-top: 12px; text-align: center; font-size: 13px; }
.results-head { min-height: 45px; padding-bottom: 16px; display: flex; justify-content: space-between; align-items: center; color: var(--muted); border-bottom: 1px solid var(--line); font-size: 13px; }
.results-head strong { color: var(--ink); font-size: 18px; }
.results-head div span { margin-left: 8px; }
.paper-list { display: grid; gap: 14px; margin-top: 18px; }
.paper-row { padding: 23px 25px; }
.paper-row h2 { margin: 10px 0 6px; font-size: 19px; line-height: 1.45; }
.paper-row .abstract-clamp { -webkit-line-clamp: 2; }
.pagination { margin-top: 28px; display: flex; align-items: center; justify-content: center; gap: 24px; }
.pagination span { color: var(--muted); font-size: 13px; }
.empty-state { padding: 80px 25px; text-align: center; border: 1px dashed #cbd9d3; border-radius: 14px; background: #fbfcfb; }
.empty-state h2 { margin: 0; }
.empty-state p { margin-bottom: 22px; color: var(--muted); }

.detail-layout { padding: 55px 0 90px; display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 58px; align-items: start; }
.back-link { display: inline-block; margin-bottom: 35px; font-size: 13px; }
.detail-meta { margin-bottom: 17px; }
.paper-detail h1 { margin: 0; font-family: Georgia, "Songti SC", serif; font-size: clamp(32px, 4vw, 48px); line-height: 1.22; font-weight: 500; letter-spacing: -.025em; }
.detail-authors { margin: 20px 0 5px; font-size: 16px; }
.institutions { margin: 0; color: var(--muted); font-size: 13px; }
.primary-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 28px; }
.source-note { color: var(--muted); font-size: 12px; }
.detail-section { margin-top: 48px; padding-top: 30px; border-top: 1px solid var(--line); }
.detail-section h2 { margin: 0 0 18px; font-family: Georgia, "Songti SC", serif; font-size: 26px; font-weight: 500; }
.abstract-full { font-family: Georgia, "Songti SC", serif; font-size: 17px; line-height: 1.95; }
.facts dl { margin: 0; }
.facts dl div { display: grid; grid-template-columns: 100px 1fr; padding: 12px 0; border-bottom: 1px solid #edf1ef; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; }
.workspace-panel { position: sticky; top: 100px; overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius); background: var(--soft); box-shadow: var(--shadow); }
.workspace-block { padding: 21px; border-bottom: 1px solid var(--line); }
.workspace-block:last-child { border-bottom: 0; }
.workspace-block h2 { margin: 0 0 12px; font-size: 15px; }
.workspace-block select { margin-bottom: 10px; }
.private-hint { margin-top: -6px; color: var(--muted); font-size: 11px; }
.workspace-block textarea { margin-bottom: 9px; background: white; font-size: 13px; }
.login-prompt { padding: 30px 24px; text-align: center; }
.login-prompt h2 { margin: 0; }
.login-prompt p { color: var(--muted); font-size: 14px; }
.login-prompt .button { margin: 12px 0; }
.login-prompt > a:last-child { font-size: 12px; }

.auth-page { min-height: calc(100vh - 145px); padding: 70px 20px; display: grid; place-items: start center; background: linear-gradient(135deg, #f5f9f7, #e9f3ee); }
.auth-card { width: min(460px, 100%); padding: 36px; border: 1px solid var(--line); border-radius: 20px; background: white; box-shadow: var(--shadow); }
.auth-card h1 { margin: 0; font-family: Georgia, "Songti SC", serif; font-size: 31px; font-weight: 500; }
.auth-card > p { color: var(--muted); font-size: 14px; }
.auth-card form { margin-top: 24px; }
.form-error { margin-bottom: 16px; padding: 10px 12px; color: #843230; background: #fff1f1; border: 1px solid #efd0cf; border-radius: 8px; font-size: 13px; }
.auth-switch { margin: 20px 0 0; text-align: center; }

.collection-panel h2 { margin: 0 0 12px; font-size: 16px; }
.collection-panel .tag-heading { margin-top: 24px; padding-top: 18px; border-top: 1px solid var(--line); }
.collection-link { display: block; margin: 3px -8px; padding: 7px 9px; border-radius: 7px; color: #485750; font-size: 13px; }
.collection-link.active { color: var(--green-dark); background: var(--mint); font-weight: 700; }
.new-collection { margin-top: 22px; padding-top: 20px; border-top: 1px solid var(--line); }
.new-collection input { margin-bottom: 8px; }
.history-list { max-width: 900px; margin-inline: auto; }

.error-page { min-height: calc(100vh - 145px); padding: 100px 20px; display: grid; place-items: start center; text-align: center; background: var(--soft); }
.error-page h1 { margin: 0; font-family: Georgia, serif; font-size: 45px; font-weight: 500; }
.error-page p { margin-bottom: 25px; color: var(--muted); }
.site-footer { min-height: 150px; padding: 36px max(20px, calc((100% - 1180px) / 2)); display: flex; justify-content: space-between; align-items: center; color: #b8c8c1; background: linear-gradient(145deg, #10231d, #173029); }
.site-footer p { margin: 5px 0 0; font-size: 12px; }
.site-footer a { color: #d9eee5; }

/* Search experience */
[hidden] { display: none !important; }
.search-hero { padding: 48px 0 34px; background: radial-gradient(circle at 82% -10%, rgba(45, 145, 112, .17), transparent 35%), linear-gradient(180deg, #f8fbfa 0%, #f2f7f5 100%); border-bottom: 1px solid var(--line); }
.search-hero-copy { margin-bottom: 24px; }
.search-hero-copy .eyebrow { margin-bottom: 7px; }
.search-hero-copy h1 { margin: 0; font-family: Georgia, "Songti SC", serif; font-size: clamp(34px, 4vw, 47px); font-weight: 500; letter-spacing: -.035em; }
.search-hero-copy p { margin: 7px 0 0; color: var(--muted); font-size: 14px; }
.search-console { position: relative; z-index: 10; padding: 12px; border: 1px solid #d9e4e0; border-radius: 18px; background: rgba(255,255,255,.96); box-shadow: 0 18px 46px rgba(25, 57, 45, .09); }
.search-query-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px; }
.search-input-wrap { min-height: 54px; padding: 0 14px; display: flex; align-items: center; gap: 11px; border: 1px solid #cfdcd7; border-radius: 12px; background: #fbfcfc; transition: border-color .15s ease, box-shadow .15s ease; }
.search-input-wrap:focus-within { border-color: var(--green); background: white; box-shadow: 0 0 0 4px rgba(19, 116, 90, .09); }
.search-input-wrap input { min-width: 0; height: 52px; padding: 0; border: 0; background: transparent; box-shadow: none; font-size: 15px; }
.search-input-wrap input:focus { box-shadow: none; }
.search-icon { flex: 0 0 auto; width: 16px; height: 16px; border: 2px solid #72807b; border-radius: 50%; position: relative; }
.search-icon::after { content: ""; position: absolute; width: 6px; height: 2px; right: -5px; bottom: -2px; border-radius: 2px; background: #72807b; transform: rotate(45deg); }
.input-clear { display: grid; place-items: center; width: 26px; height: 26px; color: #76827e; border-radius: 50%; background: #eef2f0; font-size: 19px; line-height: 1; }
.input-clear:hover { color: var(--ink); background: #e1e8e5; }
.search-submit { min-width: 126px; min-height: 54px; font-size: 15px; }
.filter-toolbar { margin-top: 11px; padding: 12px 4px 2px; display: grid; grid-template-columns: minmax(235px, .8fr) minmax(440px, 1.6fr) auto; gap: 20px; align-items: end; border-top: 1px solid #edf1ef; }
.filter-section { min-width: 0; margin: 0; padding: 0; border: 0; }
.filter-label { display: block; margin-bottom: 7px; color: #697671; font-size: 11px; font-weight: 750; letter-spacing: .04em; }
.source-picker { position: relative; }
.source-picker summary { height: 42px; padding: 0 12px; display: flex; align-items: center; gap: 8px; color: var(--ink); border: 1px solid #cfdad6; border-radius: 10px; background: white; cursor: pointer; list-style: none; font-size: 13px; font-weight: 680; user-select: none; }
.source-picker summary::-webkit-details-marker { display: none; }
.source-picker summary:hover, .source-picker[open] summary { border-color: #91bbae; box-shadow: 0 0 0 3px rgba(19, 116, 90, .07); }
.selection-count { margin-left: auto; color: var(--green); font-size: 11px; font-weight: 700; }
.chevron { width: 7px; height: 7px; margin: -3px 2px 0 3px; border-right: 1.5px solid #64716d; border-bottom: 1.5px solid #64716d; transform: rotate(45deg); transition: transform .15s ease; }
.source-picker[open] .chevron { margin-top: 3px; transform: rotate(225deg); }
.source-popover { position: absolute; left: 0; top: calc(100% + 9px); width: min(570px, calc(100vw - 40px)); overflow: hidden; border: 1px solid #d4e0dc; border-radius: 15px; background: white; box-shadow: 0 22px 60px rgba(19, 45, 37, .18); }
.source-popover-head { padding: 13px; display: flex; align-items: center; gap: 10px; border-bottom: 1px solid #e7eeeb; background: #fafcfb; }
.source-search { min-height: 39px; padding: 0 12px; display: flex; flex: 1; align-items: center; gap: 10px; border: 1px solid #d4dfdb; border-radius: 9px; background: white; }
.source-search .search-icon { width: 13px; height: 13px; border-width: 1.5px; }
.source-search input { min-width: 0; padding: 7px 0; border: 0; box-shadow: none; font-size: 12px; }
.source-search input:focus { box-shadow: none; }
.text-button, .reset-button { color: var(--green); border: 0; background: none; font-size: 12px; font-weight: 650; white-space: nowrap; }
.text-button:hover, .reset-button:hover { color: var(--green-dark); text-decoration: underline; }
.source-groups { max-height: 390px; padding: 4px 13px 12px; overflow-y: auto; scrollbar-width: thin; scrollbar-color: #bdcbc6 transparent; }
.source-group { padding: 12px 0 8px; border-bottom: 1px solid #edf1ef; }
.source-group:last-of-type { border-bottom: 0; }
.source-group h2 { margin: 0 0 7px; color: #7c8884; font-size: 10px; font-weight: 750; letter-spacing: .08em; }
.source-options { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px 7px; }
.source-option { min-width: 0; padding: 8px 9px; display: flex; align-items: center; gap: 8px; border-radius: 8px; cursor: pointer; transition: background .12s ease; }
.source-option:hover { background: #f0f7f4; }
.source-option input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.custom-check { width: 17px; height: 17px; flex: 0 0 auto; display: grid; place-items: center; border: 1.5px solid #b8c6c1; border-radius: 5px; background: white; }
.source-option input:checked + .custom-check { border-color: var(--green); background: var(--green); }
.source-option input:checked + .custom-check::after { content: ""; width: 7px; height: 4px; margin-top: -2px; border-left: 2px solid white; border-bottom: 2px solid white; transform: rotate(-45deg); }
.source-option input:focus-visible + .custom-check { outline: 3px solid rgba(19,116,90,.14); outline-offset: 2px; }
.source-name { min-width: 0; overflow: hidden; color: #34413d; font-size: 12px; font-weight: 650; text-overflow: ellipsis; white-space: nowrap; }
.source-count { margin-left: auto; color: #909b97; font-size: 10px; }
.source-empty { padding: 35px 10px 25px; text-align: center; color: var(--muted); font-size: 13px; }
.source-popover-foot { min-height: 58px; padding: 9px 13px; display: flex; justify-content: space-between; align-items: center; border-top: 1px solid #e4ebe8; background: #f8faf9; color: var(--muted); font-size: 11px; }
.source-popover-foot .button { min-height: 35px; padding: 5px 15px; font-size: 12px; }
.segmented-control { min-height: 42px; padding: 3px; display: flex; gap: 2px; overflow-x: auto; border: 1px solid #d6e0dc; border-radius: 10px; background: #f3f6f5; scrollbar-width: none; }
.segmented-control::-webkit-scrollbar { display: none; }
.segmented-control label { flex: 1 0 auto; cursor: pointer; }
.segmented-control input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.segmented-control span { height: 34px; padding: 0 10px; display: grid; place-items: center; color: #67736f; border-radius: 7px; font-size: 11px; font-weight: 650; white-space: nowrap; }
.segmented-control label:hover span { color: var(--ink); background: rgba(255,255,255,.7); }
.segmented-control input:checked + span { color: var(--green-dark); background: white; box-shadow: 0 2px 7px rgba(24, 53, 44, .09); }
.segmented-control input:focus-visible + span { outline: 3px solid rgba(19,116,90,.13); }
.filter-actions { min-height: 42px; display: flex; align-items: center; gap: 10px; }
.filter-apply { min-height: 42px; padding: 8px 15px; border-color: #c9d7d2; box-shadow: none; font-size: 12px; white-space: nowrap; }
.results-page { max-width: 1080px; padding-top: 28px; padding-bottom: 80px; }
.active-filters { min-height: 39px; margin-bottom: 15px; display: flex; flex-wrap: wrap; align-items: center; gap: 7px; color: #7c8884; font-size: 11px; }
.filter-chip { padding: 5px 9px; display: inline-flex; align-items: center; gap: 5px; color: var(--green-dark); border: 1px solid #cde6dd; border-radius: 999px; background: #ecf8f3; font-size: 11px; font-weight: 650; }
.filter-chip:hover { color: #0a4939; border-color: #afd7c8; background: #e1f3eb; }
.filter-chip span { color: #789188; font-size: 14px; line-height: 1; }
.results-head.modern { min-height: 59px; padding: 0 2px 15px; }
.result-kicker { display: block; margin-bottom: 2px; color: #8b9692; font-size: 9px; font-weight: 800; letter-spacing: .12em; }
.results-head.modern strong { margin-right: 4px; font-family: Georgia, "Songti SC", serif; font-size: 23px; font-weight: 600; }
.result-query { margin-left: 9px; color: var(--muted); }
.page-position { padding: 5px 10px; border-radius: 999px; background: #edf2f0; color: #73807b; }
.result-card { position: relative; transition: transform .16s ease, border-color .16s ease, box-shadow .16s ease; }
.result-card:hover { transform: translateY(-2px); border-color: #b8d4ca; box-shadow: var(--shadow-soft); }
.result-card h2 { max-width: 920px; margin-top: 11px; font-size: 20px; letter-spacing: -.012em; }
.result-card .authors { margin: 8px 0; }
.result-card .abstract-clamp { margin: 10px 0; color: #63706c; line-height: 1.75; }
.meta-item { color: #83908b; }
.action-primary { padding: 6px 11px; border-radius: 8px; background: #edf7f3; }
.bookmark-button { padding: 3px 0; display: inline-flex; align-items: center; gap: 4px; color: #56645f; border: 0; background: none; font-size: 12px; font-weight: 650; }
.bookmark-button:hover, .bookmark-button.saved { color: #b24b52; }
.bookmark-button span { font-size: 16px; }
.page-button { min-width: 103px; padding: 8px 13px; text-align: center; border: 1px solid #d4dfdb; border-radius: 9px; background: white; font-size: 12px; font-weight: 650; }
.page-button:hover { border-color: #abcfc2; background: #f2f8f5; }
.page-button.disabled { color: #aab3b0; background: #f4f6f5; cursor: default; }
.empty-icon { width: 54px; height: 54px; margin: 0 auto 16px; display: grid; place-items: center; color: var(--green); border-radius: 50%; background: var(--mint); font-size: 28px; }

@media (max-width: 900px) {
  .conference-grid { grid-template-columns: repeat(2, 1fr); }
  .search-layout, .library-layout { grid-template-columns: 1fr; }
  .filter-panel { position: static; }
  .detail-layout { grid-template-columns: 1fr; gap: 35px; }
  .workspace-panel { position: static; }
  .filter-toolbar { grid-template-columns: minmax(220px, .8fr) minmax(0, 1.4fr); }
  .filter-actions { grid-column: 1 / -1; justify-content: flex-end; }
}

@media (max-width: 680px) {
  .site-header { height: auto; }
  .nav-wrap { min-height: 64px; width: calc(100% - 24px); gap: 15px; flex-wrap: wrap; padding: 10px 0; }
  .brand { flex: 1; }
  .brand-copy small { display: none; }
  .main-nav { order: 3; width: 100%; height: 38px; gap: 24px; border-top: 1px solid var(--line); }
  .main-nav a { height: 45px; }
  .username { display: none; }
  .hero-inner { padding: 62px 0; }
  .hero h1 { font-size: 42px; }
  .hero-search { display: block; }
  .hero-search button { width: 100%; margin-top: 6px; }
  .hero-stats { gap: 12px; flex-wrap: wrap; }
  .conference-grid, .paper-grid { grid-template-columns: 1fr; }
  .section { padding: 55px 0; }
  .section-heading { align-items: start; gap: 12px; }
  .section-heading h2 { font-size: 28px; }
  .page-head h1 { font-size: 35px; }
  .paper-row { padding: 19px; }
  .detail-layout { padding-top: 35px; }
  .paper-detail h1 { font-size: 32px; }
  .facts dl div { grid-template-columns: 75px 1fr; }
  .auth-card { padding: 28px 22px; }
  .site-footer { align-items: start; gap: 20px; flex-direction: column; }
  .search-hero { padding: 33px 0 25px; }
  .search-hero-copy { margin-bottom: 17px; }
  .search-hero-copy h1 { font-size: 34px; }
  .search-hero-copy p { font-size: 13px; }
  .search-console { margin-inline: -5px; padding: 8px; border-radius: 15px; }
  .search-query-row { grid-template-columns: 1fr; }
  .search-submit { min-height: 46px; }
  .filter-toolbar { padding: 11px 2px 2px; grid-template-columns: 1fr; gap: 12px; }
  .filter-actions { grid-column: auto; justify-content: stretch; }
  .filter-apply { flex: 1; }
  .source-popover { position: fixed; left: 12px; right: 12px; top: 88px; width: auto; max-height: calc(100vh - 110px); }
  .source-groups { max-height: calc(100vh - 260px); }
  .source-options { grid-template-columns: 1fr; }
  .segmented-control label { flex: 0 0 auto; }
  .segmented-control span { padding-inline: 13px; }
  .results-page { width: calc(100% - 24px); padding-top: 20px; }
  .active-filters { margin-bottom: 10px; }
  .results-head.modern { align-items: flex-end; }
  .result-query { display: block; margin: 1px 0 0; }
  .page-position { white-space: nowrap; }
  .result-card { padding: 20px 18px; }
  .result-card h2 { font-size: 18px; }
  .pagination { gap: 8px; justify-content: space-between; }
  .pagination > span:not(.page-button) { display: none; }
}

/* Refined academic directory UI */
:root {
  --ink: #172033;
  --muted: #74819a;
  --line: #e3e8f1;
  --soft: #f5f7fb;
  --green: #5b5ce2;
  --green-dark: #4946c9;
  --mint: #f0efff;
  --mint-strong: #e2e0ff;
  --shadow: 0 16px 42px rgba(33, 44, 78, .08);
  --shadow-soft: 0 8px 26px rgba(33, 44, 78, .06);
}
body { background: #f5f7fb; }
.site-header { height: 64px; border-color: #e8ebf1; background: rgba(255,255,255,.94); box-shadow: none; }
.nav-wrap { width: min(1152px, calc(100% - 40px)); gap: 34px; }
.brand-mark { width: 34px; height: 34px; border-radius: 10px; background: linear-gradient(145deg, #6d66f4, #5250d7); box-shadow: 0 6px 15px rgba(91, 92, 226, .24); font-size: 20px; }
.brand-copy small { display: none; }
.main-nav { height: auto; gap: 4px; }
.main-nav a { height: 36px; padding: 0 14px; border-radius: 8px; color: #68748b; }
.main-nav a.active, .main-nav a:hover { color: var(--green); background: #f2f1ff; }
.main-nav a.active::after { display: none; }
.button { border-color: var(--green); background: linear-gradient(135deg, #625ee9, #534ee0); box-shadow: 0 4px 12px rgba(91, 92, 226, .18); }
.button:hover { border-color: var(--green-dark); background: linear-gradient(135deg, #5551dd, #4945cc); }
.button.secondary { color: #59657b; border-color: #e1e6ef; background: #f1f4f8; box-shadow: none; }
.button.secondary:hover { color: #343e52; border-color: #d6dce7; background: #e9edf3; }
.link-button, a { color: var(--green); }
a:hover, .link-button:hover { color: var(--green-dark); }
.hero { background: radial-gradient(circle at 76% 35%, rgba(107, 99, 246, .15), transparent 28%), linear-gradient(135deg, #fafaff 0%, #f3f2ff 100%); }
.hero h1 span { color: var(--green); }
.page-head { background: radial-gradient(circle at 75% 0, rgba(107, 99, 246, .1), transparent 28%), linear-gradient(135deg, #fdfdff, #f4f3ff); }
.auth-page { background: linear-gradient(135deg, #f8f8ff, #efeeff); }
.conference-card:hover, .paper-card:hover { border-color: #cbc8f7; }
.badge { color: #504ac9; border-color: #dedbff; background: #f0efff; }
.filter-chip { color: #514bd0; border-color: #dcd9ff; background: #f2f1ff; }
.filter-chip:hover { color: #403bb5; border-color: #cac6ff; background: #eae8ff; }
.site-footer { color: #8792a7; border-top: 1px solid #e4e8f0; background: white; }
.site-footer strong { color: #263047; }
.site-footer a { color: var(--green); }

.paper-directory { min-height: calc(100vh - 64px); padding: 32px 0 80px; background: #f5f7fb; }
.directory-container { width: min(1152px, calc(100% - 40px)); }
.directory-header { margin-bottom: 22px; display: flex; align-items: center; gap: 13px; }
.directory-icon { width: 42px; height: 42px; flex: 0 0 auto; display: grid; place-items: center; border-radius: 12px; background: linear-gradient(145deg, #eeedff, #e5e3ff); }
.directory-icon .search-icon { width: 17px; height: 17px; border-color: #625ee9; }
.directory-icon .search-icon::after { background: #625ee9; }
.directory-header h1 { margin: 0; color: #172033; font-size: 26px; line-height: 1.25; letter-spacing: -.025em; }
.directory-header p { margin: 5px 0 0; color: #7b879c; font-size: 13px; }
.directory-filter-card { position: relative; z-index: 12; padding: 20px; border: 1px solid #dfe5ef; border-radius: 15px; background: white; }
.directory-filter-grid { display: grid; grid-template-columns: minmax(300px, 2fr) minmax(190px, 1fr) minmax(150px, .85fr) 88px; gap: 12px; }
.directory-search-field, .directory-select summary, .directory-year-select { height: 46px; display: flex; align-items: center; border: 1px solid #dbe2ed; border-radius: 10px; background: white; transition: border-color .15s ease, box-shadow .15s ease; }
.directory-search-field:focus-within, .directory-select[open] summary, .directory-select summary:hover, .directory-year-select:focus-within { border-color: #aaa8f4; box-shadow: 0 0 0 3px rgba(91, 92, 226, .08); }
.directory-search-field { padding: 0 14px; gap: 11px; }
.directory-search-field .search-icon, .source-search .search-icon { width: 14px; height: 14px; border-width: 1.5px; border-color: #8a96aa; }
.directory-search-field .search-icon::after, .source-search .search-icon::after { background: #8a96aa; }
.directory-search-field input { min-width: 0; height: 44px; padding: 0; border: 0; background: transparent; box-shadow: none; color: #303a50; font-size: 13px; }
.directory-search-field input:focus { box-shadow: none; }
.directory-search-field input::placeholder { color: #9ca7b8; }
.directory-select { position: relative; }
.directory-select summary { height: 46px; padding: 0 13px; border-color: #dbe2ed; color: #465168; font-weight: 520; }
.directory-select .summary-label { font-size: 13px; }
.directory-select .selection-count { margin-left: auto; color: #6a65db; font-size: 11px; font-weight: 650; }
.directory-select .chevron, .directory-year-select .chevron { border-color: #8793a7; }
.directory-year-select { position: relative; }
.directory-year-select select { height: 44px; padding: 0 38px 0 13px; appearance: none; border: 0; background: transparent; box-shadow: none; color: #465168; cursor: pointer; font-size: 13px; }
.directory-year-select select:focus { box-shadow: none; }
.directory-year-select .chevron { position: absolute; right: 15px; top: 17px; pointer-events: none; }
.directory-search-button { min-width: 88px; min-height: 46px; padding: 8px 18px; border-radius: 10px; }
.directory-filter-foot { min-height: 30px; margin-top: 13px; padding-top: 13px; display: flex; justify-content: space-between; align-items: center; border-top: 1px solid #edf0f5; }
.filter-foot-copy { display: flex; align-items: center; gap: 7px; color: #929caf; font-size: 11px; }
.filter-dot { width: 6px; height: 6px; border-radius: 50%; background: #7772ec; box-shadow: 0 0 0 4px #efeeff; }
.filter-foot-actions { display: flex; align-items: center; gap: 10px; }
.reset-button { color: #6d788c; font-size: 12px; }
.reset-button:hover { color: #4c566b; }
.directory-active-filters { margin: 14px 1px 5px; }
.directory-active-filters > span:first-child { color: #8b96a8; }
.source-popover { width: min(560px, calc(100vw - 40px)); border-color: #dfe4ee; box-shadow: 0 22px 60px rgba(34, 43, 75, .17); }
.source-popover-head, .source-popover-foot { background: #fafbfe; }
.source-option:hover { background: #f5f4ff; }
.source-option input:checked + .custom-check { border-color: var(--green); background: var(--green); }
.source-name { color: #3e485d; }

.directory-results { margin-top: 16px; }
.directory-results-head { min-height: 43px; padding: 0 2px 11px; display: flex; justify-content: space-between; align-items: center; color: #8490a3; font-size: 12px; }
.directory-results-head strong { margin-right: 5px; color: #172033; font-size: 18px; }
.directory-results-head .result-query { margin-left: 8px; }
.directory-paper-list { margin-top: 0; gap: 14px; }
.directory-paper-card { padding: 20px 24px 0; overflow: hidden; border: 1px solid #e2e7ef; border-radius: 14px; background: white; transition: border-color .16s ease, box-shadow .16s ease; }
.directory-paper-card:hover { border-color: #d2d7eb; box-shadow: 0 9px 25px rgba(42, 51, 83, .055); }
.paper-title-line { display: flex; align-items: flex-start; gap: 10px; }
.paper-title-line h2 { min-width: 0; margin: 0; color: #192238; font-size: 16px; font-weight: 740; line-height: 1.45; letter-spacing: -.008em; }
.paper-title-line h2 a { color: inherit; }
.paper-title-line h2 a:hover { color: var(--green); }
.pdf-available { flex: 0 0 auto; margin-top: 1px; padding: 2px 8px; color: #16866e; border-radius: 999px; background: #e8f7f2; font-size: 10px; font-weight: 750; }
.pdf-available:hover { color: #0e6a56; background: #d9f1e9; }
.paper-taxonomy { margin: 4px 0 0; overflow: hidden; color: #7e8ba1; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.directory-paper-card .authors { margin: 7px 0 0; overflow: hidden; color: #8a9bb7; font-size: 11.5px; text-overflow: ellipsis; white-space: nowrap; }
.paper-summary { margin: 10px 0 12px; display: -webkit-box; overflow: hidden; color: #60708b; font-size: 12.5px; line-height: 1.75; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.paper-card-footer { min-height: 54px; padding: 10px 0; display: flex; justify-content: space-between; align-items: center; gap: 16px; border-top: 1px solid #edf0f4; }
.paper-labels { min-width: 0; display: flex; align-items: center; gap: 6px; overflow: hidden; }
.venue-label, .topic-label { max-width: 210px; padding: 3px 9px; overflow: hidden; border-radius: 7px; font-size: 10px; font-weight: 680; line-height: 1.45; text-overflow: ellipsis; white-space: nowrap; }
.venue-label { flex: 0 0 auto; color: #d44779; background: #ffedf4; }
.topic-label { color: #5754c9; background: #efefff; }
.topic-label:nth-of-type(3) { color: #28749b; background: #e9f6fb; }
.paper-utility-actions { flex: 0 0 auto; display: flex; align-items: center; gap: 14px; }
.paper-utility-actions a, .paper-utility-actions .bookmark-button { padding: 0; display: inline-flex; align-items: center; gap: 4px; color: #91a0b6; background: transparent; font-size: 10.5px; font-weight: 550; }
.paper-utility-actions a:hover { color: var(--green); }
.paper-utility-actions .bookmark-button:hover, .paper-utility-actions .bookmark-button.saved { color: #d14c7d; }
.directory-pagination { margin-top: 25px; }
.page-button { border-color: #dfe4ed; color: #69758b; box-shadow: none; }
.page-button:hover { border-color: #c9c8f5; background: #f4f3ff; }
.directory-empty { border-color: #dfe4ee; background: white; }
.empty-icon { color: var(--green); background: #eeedff; }

@media (max-width: 860px) {
  .directory-filter-grid { grid-template-columns: minmax(0, 1fr) minmax(180px, .65fr); }
  .directory-year-select { grid-column: 1; }
  .directory-search-button { grid-column: 2; grid-row: 2; }
}

@media (max-width: 680px) {
  .site-header { height: auto; }
  .main-nav { background: white; }
  .main-nav a { height: 40px; padding-inline: 10px; }
  .paper-directory { padding: 24px 0 55px; }
  .directory-container { width: calc(100% - 24px); }
  .directory-header { align-items: flex-start; }
  .directory-icon { width: 38px; height: 38px; }
  .directory-header h1 { font-size: 22px; }
  .directory-header p { font-size: 12px; }
  .directory-filter-card { padding: 12px; border-radius: 13px; }
  .directory-filter-grid { grid-template-columns: 1fr; gap: 9px; }
  .directory-year-select, .directory-search-button { grid-column: auto; grid-row: auto; }
  .directory-search-button { min-height: 44px; }
  .directory-filter-foot { align-items: flex-start; gap: 10px; }
  .filter-foot-copy { max-width: 240px; line-height: 1.5; }
  .source-popover { top: 82px; }
  .directory-results-head { align-items: flex-end; }
  .directory-paper-card { padding: 17px 16px 0; border-radius: 12px; }
  .paper-title-line { display: block; }
  .paper-title-line h2 { font-size: 15px; }
  .pdf-available { display: inline-block; margin-top: 7px; }
  .paper-taxonomy { white-space: normal; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 1; }
  .paper-summary { font-size: 12px; -webkit-line-clamp: 3; }
  .paper-card-footer { align-items: flex-start; flex-direction: column; gap: 9px; }
  .paper-labels { width: 100%; }
  .paper-utility-actions { width: 100%; justify-content: flex-end; }
  .venue-label, .topic-label { max-width: 150px; }
}
