/* Thư viện luận văn — visual language aligned with homepage-next (APTsmart).
   Token names mirror homepage-next/src/app/globals.css (RGB triplets) so a parent site can
   override them 1:1 when the two are integrated. */
:root {
  --c-primary: 21 38 126;
  --c-primary-dark: 14 26 90;
  --c-primary-deep: 15 28 92;
  --c-primary-night: 11 19 56;
  --c-primary-tint: 238 243 255;
  --c-accent: 229 46 46;
  --c-accent-dark: 197 31 31;
  --c-success: 5 150 105;
  --c-warn: 180 83 9;
  --c-page: 255 255 255;
  --c-surface: 255 255 255;
  --b-50: 239 246 255;
  --b-100: 219 234 254;
  --s-50: 248 250 252;
  --s-100: 241 245 249;
  --s-200: 226 232 240;
  --s-300: 203 213 225;
  --s-400: 148 163 184;
  --s-500: 100 116 139;
  --s-600: 71 85 105;
  --s-700: 51 65 85;
  --s-800: 30 41 59;
  --s-900: 15 23 42;
  --radius-scale: 1;
  --container-max: 80rem;
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;

  --navy: rgb(var(--c-primary));
  --navy-dark: rgb(var(--c-primary-dark));
  --navy-deep: rgb(var(--c-primary-deep));
  --navy-night: rgb(var(--c-primary-night));
  --red: rgb(var(--c-accent));
  --red-dark: rgb(var(--c-accent-dark));
  --r-lg: calc(.5rem * var(--radius-scale));
  --r-xl: calc(.75rem * var(--radius-scale));
  --r-2xl: calc(1rem * var(--radius-scale));
  --r-3xl: calc(1.5rem * var(--radius-scale));
  --shadow-sm: 0 1px 2px rgb(15 23 42 / .06);
  --shadow-card: 0 1px 3px rgb(15 23 42 / .06), 0 1px 2px rgb(15 23 42 / .04);
  --shadow-xl: 0 20px 25px -5px rgb(15 23 42 / .08), 0 8px 10px -6px rgb(15 23 42 / .06);
}

* { box-sizing: border-box; }
html { font-size: 16px; scroll-behavior: smooth; overflow-x: clip; }
body { margin: 0; color: rgb(var(--s-900)); background: rgb(var(--c-page)); font-family: var(--font-sans);
  line-height: 1.6; overflow-x: clip; min-width: 0; }
p, h1, h2, h3, h4, span, a, td, blockquote { overflow-wrap: break-word; }
a { color: var(--navy); }
svg.i { width: 1.1em; height: 1.1em; flex-shrink: 0; stroke: currentColor; fill: none; stroke-width: 2;
  stroke-linecap: round; stroke-linejoin: round; vertical-align: -0.15em; }
.sr, .skip:not(:focus) { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip:focus { position: fixed; top: 8px; left: 8px; z-index: 100; background: #fff; padding: 8px 12px; border-radius: var(--r-xl); }
:where(a, button, input, textarea, select, iframe):focus-visible { outline: 3px solid rgb(var(--c-primary) / .35); outline-offset: 3px; }
.container { max-width: var(--container-max); margin: 0 auto; padding: 0 1rem; }
@media (min-width: 640px) { .container { padding: 0 1.5rem; } }
@media (min-width: 1024px) { .container { padding: 0 2rem; } }

/* ---------- announcement bar + header (homepage-next chrome) ---------- */
.announce { background: linear-gradient(90deg, var(--navy-deep), var(--navy), var(--navy-deep)); color: #fff;
  font-size: 13px; font-weight: 500; }
.announce-row { display: flex; align-items: center; gap: .6rem; min-height: 36px; min-width: 0; }
.announce-lead { display: inline-flex; align-items: center; gap: .35rem; font-weight: 700; color: #fcd34d; white-space: nowrap; }
.announce-sub { color: rgb(var(--b-100)); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.announce-right { margin-left: auto; font-weight: 700; white-space: nowrap; }
.announce-right a { color: rgb(var(--b-100)); text-decoration: none; display: inline-flex; align-items: center; gap: .35rem; }
.announce-right a:hover { color: #fff; }
@media (max-width: 900px) { .announce-sub { display: none; } }

.site-header { position: sticky; top: 0; z-index: 40; background: rgb(var(--c-surface)); border-bottom: 1px solid rgb(var(--s-200));
  box-shadow: var(--shadow-sm); }
.header-row { display: flex; align-items: center; gap: .75rem; height: 84px; min-width: 0; }
.brand { display: flex; align-items: center; gap: .75rem; text-decoration: none; flex-shrink: 0; min-width: 0; border-radius: var(--r-xl); padding: 4px; }
.brand-mark { width: 48px; height: 48px; border-radius: var(--r-2xl); display: grid; place-items: center; color: #fff;
  background: linear-gradient(135deg, var(--navy), var(--navy-night)); box-shadow: 0 10px 20px -8px rgb(var(--c-primary) / .55); position: relative; }
.brand-mark svg.i { width: 26px; height: 26px; }
.brand-mark::after { content: ""; position: absolute; right: -3px; top: -3px; width: 12px; height: 12px; border-radius: 99px;
  background: var(--red); border: 2px solid #fff; }
.brand-text { border-left: 2px solid rgb(var(--s-200)); padding-left: .75rem; min-width: 0; }
.brand-name { display: block; font-size: 1.12rem; font-weight: 900; letter-spacing: -.01em; color: var(--navy); line-height: 1.2; white-space: nowrap; }
.brand-tag { display: block; font-size: .75rem; font-weight: 600; color: rgb(var(--s-500)); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#nav { flex: 1; display: flex; align-items: center; gap: .25rem; min-width: 0; }
.nav-links { display: flex; align-items: center; justify-content: center; gap: .25rem; flex: 1; min-width: 0; }
.nav-link { display: inline-flex; align-items: center; gap: .4rem; padding: .5rem .75rem; border-radius: var(--r-xl); font-size: 15px;
  font-weight: 700; color: rgb(var(--s-700)); text-decoration: none; white-space: nowrap; background: none; border: 0; cursor: pointer; font-family: inherit; }
.nav-link:hover, .nav-link.active { color: var(--navy); background: rgb(var(--b-50) / .8); }
.nav-cta { display: flex; align-items: center; gap: .6rem; flex-shrink: 0; }
.who { display: inline-flex; align-items: center; gap: .5rem; font-size: .85rem; color: rgb(var(--s-600)); font-weight: 600; white-space: nowrap; }
.who .avatar { width: 34px; height: 34px; border-radius: 99px; background: rgb(var(--c-primary-tint)); color: var(--navy);
  display: grid; place-items: center; font-weight: 900; }
.menu-toggle { display: none; margin-left: auto; width: 44px; height: 44px; border-radius: var(--r-xl); border: 0; background: none;
  color: rgb(var(--s-700)); cursor: pointer; align-items: center; justify-content: center; }
.menu-toggle:hover { background: rgb(var(--s-100)); }
.menu-toggle svg.i { width: 24px; height: 24px; }
@media (max-width: 1400px) {
  .brand-tag { display: none; }
  .brand-text { padding-left: .5rem; }
  .header-row { gap: .5rem; }
  .nav-links { gap: .2rem; }
  .nav-link { padding: .45rem .55rem; font-size: 14px; gap: .3rem; }
  .nav-cta { gap: .4rem; }
  .nav-cta .btn { padding: .5rem .8rem; font-size: 14px; }
  .who { font-size: .82rem; gap: .35rem; }
}
@media (max-width: 1180px) {
  .menu-toggle { display: inline-flex; }
  .header-row { height: 76px; }
  #nav { display: none; position: absolute; left: 0; right: 0; top: 100%; background: rgb(var(--c-surface)); border-bottom: 1px solid rgb(var(--s-200));
    box-shadow: var(--shadow-xl); flex-direction: column; align-items: stretch; padding: .75rem 1rem 1.25rem; gap: .5rem; max-height: calc(100dvh - 110px); overflow-y: auto; }
  #nav.open { display: flex; animation: fade-in 180ms ease-out both; }
  .nav-links { flex-direction: column; align-items: stretch; }
  .nav-link { padding: .75rem; font-size: 1rem; min-height: 44px; }
  .nav-cta { flex-direction: column; align-items: stretch; border-top: 1px solid rgb(var(--s-200)); padding-top: .75rem; }
  .nav-cta .btn { justify-content: center; }
  .who { justify-content: center; padding: .25rem 0; }
}
@media (max-width: 520px) { .brand-text { display: none; } }
@keyframes fade-in { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }

/* ---------- buttons, pills, chips ---------- */
.btn { display: inline-flex; align-items: center; gap: .5rem; padding: .65rem 1.1rem; border-radius: var(--r-xl); font: inherit;
  font-size: 15px; font-weight: 700; line-height: 1.2; cursor: pointer; text-decoration: none; white-space: nowrap; border: 1px solid transparent;
  transition: background-color .15s, color .15s, box-shadow .15s, transform .15s; min-height: 44px; }
.btn:disabled { opacity: .55; cursor: not-allowed; transform: none !important; }
.btn-primary { background: var(--navy); color: #fff; border-radius: var(--r-2xl); box-shadow: 0 20px 25px -5px rgb(30 27 75 / .25); font-weight: 900; }
.btn-primary:hover { background: var(--navy-dark); transform: scale(1.02); }
.btn-red { background: var(--red); color: #fff; box-shadow: 0 10px 20px -8px rgb(var(--c-accent) / .6); }
.btn-red:hover { background: var(--red-dark); }
.btn-outline { background: #fff; color: var(--navy); border: 2px solid var(--navy); }
.btn-outline:hover { background: rgb(var(--b-50)); }
.btn-soft { background: rgb(var(--s-100)); color: rgb(var(--s-700)); border-color: rgb(var(--s-200)); }
.btn-soft:hover { color: var(--navy); background: rgb(var(--b-50)); }
.btn-ghost { background: #fff; color: rgb(var(--s-700)); border-color: rgb(var(--s-200)); }
.btn-ghost:hover { color: var(--navy); border-color: rgb(var(--c-primary) / .35); }
.btn-ok { background: rgb(var(--c-success)); color: #fff; }
.btn-ok:hover { filter: brightness(.95); }
.btn-danger { background: #fff; color: var(--red); border-color: rgb(var(--c-accent) / .45); }
.btn-danger:hover { background: rgb(254 242 242); }
.btn-sm { padding: .4rem .8rem; font-size: .875rem; min-height: 36px; border-radius: var(--r-lg); }
.btn-block { width: 100%; justify-content: center; }

.pill { display: inline-flex; align-items: center; gap: .45rem; padding: .4rem .9rem; border-radius: 999px; background: #fff;
  border: 1px solid rgb(var(--s-200)); font-size: 13px; font-weight: 700; color: var(--navy); box-shadow: var(--shadow-sm); }
.pill svg.i { color: var(--red); }
.pill-red { background: rgb(254 242 242); border-color: rgb(254 202 202); color: var(--red); text-transform: uppercase; letter-spacing: .03em; font-size: 12.5px; }
.chips { display: flex; flex-wrap: wrap; gap: .5rem; }
.chip { display: inline-flex; align-items: center; gap: .4rem; padding: .5rem 1rem; border-radius: 999px; background: #fff;
  border: 1px solid rgb(var(--s-200)); color: rgb(var(--s-800)); font: inherit; font-size: 13.5px; font-weight: 700; cursor: pointer;
  text-decoration: none; box-shadow: var(--shadow-sm); }
.chip:hover { border-color: rgb(var(--c-primary) / .35); color: var(--navy); }
.chip.on { background: var(--navy); border-color: var(--navy); color: #fff; }
.chip .n { opacity: .65; font-weight: 600; }
.badge { display: inline-flex; align-items: center; gap: .3rem; font-size: 11.5px; font-weight: 800; padding: .2rem .6rem; border-radius: 999px;
  background: rgb(var(--s-100)); color: rgb(var(--s-600)); white-space: nowrap; letter-spacing: .01em; }
.badge.ok { background: rgb(236 253 245); color: rgb(var(--c-success)); }
.badge.warn { background: rgb(255 251 235); color: rgb(var(--c-warn)); }
.badge.bad { background: rgb(254 242 242); color: var(--red); }
.badge.info { background: rgb(var(--c-primary-tint)); color: var(--navy); }
.kicker { font-size: 12.5px; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; color: var(--red); }

/* ---------- hero ---------- */
.hero { background: radial-gradient(1200px 400px at 85% 0%, rgb(254 226 226 / .45), transparent 60%),
  linear-gradient(180deg, rgb(var(--b-50) / .75), rgb(255 255 255) 85%); border-bottom: 1px solid rgb(var(--s-200)); }
.hero-grid { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 3rem; align-items: center; padding: 4.5rem 0 4rem; }
.hero h1 { font-size: clamp(2.1rem, 4.6vw, 3.6rem); line-height: 1.08; letter-spacing: -.035em; font-weight: 900; color: rgb(var(--s-950, 2 6 23)); margin: 1.1rem 0 1.25rem; }
.hero h1 em { font-style: normal; color: var(--navy); }
.hero-lead { font-size: 1.12rem; color: rgb(var(--s-600)); line-height: 1.75; margin: 0 0 1.75rem; max-width: 40rem; }
.hero-lead strong { color: var(--navy); }
.hero-compact .hero-grid { grid-template-columns: 1fr; padding: 2.25rem 0 2rem; gap: 1rem; }
.hero-compact h1 { font-size: clamp(1.6rem, 3vw, 2.2rem); margin: .75rem 0 1rem; }
@media (max-width: 960px) { .hero-grid { grid-template-columns: 1fr; padding: 2.5rem 0; gap: 2rem; } }

.searchbar { display: grid; grid-template-columns: 1fr auto auto; gap: .5rem; padding: .5rem; background: #fff; border: 1px solid rgb(var(--s-200));
  border-radius: var(--r-2xl); box-shadow: var(--shadow-xl); }
.searchbar .field { display: flex; align-items: center; gap: .6rem; padding: 0 .75rem; color: rgb(var(--s-400)); min-width: 0; }
.searchbar input { border: 0; outline: 0; background: none; font: inherit; font-size: 1.02rem; color: rgb(var(--s-900)); width: 100%; min-height: 48px; padding: 0; }
.searchbar input:focus-visible { outline: none; }
.searchbar:focus-within { border-color: rgb(var(--c-primary) / .45); box-shadow: var(--shadow-xl), 0 0 0 4px rgb(var(--c-primary) / .1); }
.searchbar select { border: 1px solid rgb(var(--s-200)); background: rgb(var(--s-50)); border-radius: var(--r-xl); font: inherit; font-size: .9rem;
  font-weight: 700; color: rgb(var(--s-700)); padding: 0 .75rem; min-height: 48px; }
@media (max-width: 600px) { .searchbar { grid-template-columns: 1fr 1fr; } .searchbar .field { grid-column: 1 / -1; } }
.hint { font-size: .86rem; color: rgb(var(--s-500)); margin: .9rem 0 0; }
.quick { margin-top: 1.25rem; }
.quick-label { font-size: .8rem; font-weight: 800; color: rgb(var(--s-500)); text-transform: uppercase; letter-spacing: .05em; margin-bottom: .5rem; }

.panel { background: #fff; border: 1px solid rgb(var(--s-200)); border-radius: calc(2rem * var(--radius-scale)); padding: 1.75rem;
  box-shadow: 0 25px 50px -12px rgb(var(--c-primary) / .14); }
.panel-head { background: var(--navy); color: #fff; border-radius: var(--r-2xl); padding: 1.15rem 1.25rem; display: flex; justify-content: space-between;
  align-items: center; gap: 1rem; box-shadow: 0 12px 24px -12px rgb(var(--c-primary) / .8); }
.panel-head small { display: block; color: rgb(var(--b-100)); font-size: .85rem; }
.panel-head strong { display: block; font-size: 1.3rem; font-weight: 800; }
.panel-head svg.i { width: 38px; height: 38px; stroke-width: 1.5; }
.tiles { display: grid; grid-template-columns: 1fr 1fr; gap: .9rem; margin: 1.1rem 0; }
.tile { border: 1px solid rgb(var(--s-200)); border-radius: var(--r-2xl); padding: 1rem 1rem .95rem; background: #fff; }
.tile svg.i { color: var(--red); width: 20px; height: 20px; }
.tile .v { display: block; font-size: 1.3rem; font-weight: 900; color: rgb(var(--s-900)); margin-top: .65rem; line-height: 1.25; }
.tile .l { display: block; font-size: .78rem; color: rgb(var(--s-500)); margin-top: .25rem; }

/* ---------- sections, cards ---------- */
.section { padding: 4rem 0; }
.section-alt { background: rgb(var(--s-50)); border-top: 1px solid rgb(var(--s-200)); border-bottom: 1px solid rgb(var(--s-200)); }
.section-head { text-align: center; max-width: 46rem; margin: 0 auto 2.25rem; }
.section-head h2 { font-size: clamp(1.7rem, 3vw, 2.35rem); font-weight: 900; letter-spacing: -.025em; margin: .9rem 0 .6rem; color: rgb(var(--s-900)); line-height: 1.2; }
.section-head p { color: rgb(var(--s-600)); margin: 0; }
.section-head .chips { justify-content: center; margin-top: 1.75rem; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 2rem; }
@media (max-width: 1024px) { .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.25rem; } }
@media (max-width: 640px) { .grid-3 { grid-template-columns: 1fr; } }

.card { background: #fff; border: 1px solid rgb(var(--s-200)); border-radius: var(--r-2xl); box-shadow: var(--shadow-card); min-width: 0; max-width: 100%; box-sizing: border-box; }
.card-pad { padding: 1.5rem; }
.card + .card { margin-top: 1.25rem; }
.card h2 { font-size: 1.15rem; font-weight: 800; margin: 0 0 1rem; color: rgb(var(--s-900)); display: flex; align-items: center; gap: .5rem; }
.card h2 svg.i { color: var(--navy); }

.tcard { display: flex; flex-direction: column; overflow: hidden; transition: box-shadow .2s, transform .2s; border-radius: var(--r-3xl); }
.tcard:hover { box-shadow: var(--shadow-xl); transform: translateY(-2px); }
.tcard-cover { position: relative; height: 150px; padding: 1.1rem 1.25rem; color: #fff; display: flex; flex-direction: column; justify-content: space-between;
  background: radial-gradient(260px 160px at 100% 0%, rgb(var(--c-accent) / .45), transparent 70%), linear-gradient(135deg, var(--navy), var(--navy-night)); }
.tcard-cover.v1 { background: radial-gradient(260px 160px at 0% 100%, rgb(56 189 248 / .4), transparent 70%), linear-gradient(135deg, var(--navy-deep), var(--navy)); }
.tcard-cover.v2 { background: radial-gradient(260px 160px at 100% 100%, rgb(251 191 36 / .35), transparent 70%), linear-gradient(135deg, var(--navy-night), var(--navy-deep)); }
.tcard-cover .degree { align-self: flex-start; background: rgb(255 255 255 / .16); border: 1px solid rgb(255 255 255 / .25); color: #fff; }
.tcard-cover .cover-icon { position: absolute; right: 1.1rem; bottom: .9rem; opacity: .35; }
.tcard-cover .cover-icon svg.i { width: 56px; height: 56px; stroke-width: 1.4; }
.tcard-cover .faculty { font-weight: 800; font-size: .95rem; max-width: 80%; line-height: 1.3; }
.tcard-body { padding: 1.5rem 1.6rem 1.25rem; flex: 1; display: flex; flex-direction: column; }
.tcard-body h3, .result h3 { font-size: 1.2rem; line-height: 1.4; font-weight: 800; margin: .5rem 0 .6rem; color: rgb(var(--s-900)); }
.tcard-body h3 a, .result h3 a { color: inherit; text-decoration: none; }
.tcard-body h3 a:hover, .result h3 a:hover { color: var(--navy); }
.tcard-body p { color: rgb(var(--s-600)); font-size: .92rem; margin: 0; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.tcard-foot { display: flex; justify-content: space-between; align-items: center; gap: .75rem; padding: 1rem 1.6rem; border-top: 1px solid rgb(var(--s-100)); }
.meta { color: rgb(var(--s-500)); font-size: .85rem; display: inline-flex; align-items: center; gap: .35rem; flex-wrap: wrap; }
.more { color: var(--navy); font-weight: 800; font-size: .92rem; text-decoration: none; display: inline-flex; align-items: center; gap: .3rem; white-space: nowrap; }
.more:hover { text-decoration: underline; }

/* ---------- search results ---------- */
.layout { display: grid; grid-template-columns: 280px minmax(0, 1fr); gap: 2rem; padding: 2rem 0 4rem; }
@media (max-width: 900px) { .layout { grid-template-columns: 1fr; gap: 1.25rem; } }
.facets { padding: 1.25rem; align-self: start; position: sticky; top: 100px; }
@media (max-width: 900px) { .facets { position: static; } }
.facets-title { display: flex; align-items: center; gap: .5rem; font-weight: 900; color: rgb(var(--s-900)); margin-bottom: .25rem; }
.facets h3 { font-size: .78rem; font-weight: 800; text-transform: uppercase; letter-spacing: .05em; color: rgb(var(--s-500)); margin: 1.1rem 0 .4rem; }
.facet { display: flex; justify-content: space-between; align-items: center; gap: .5rem; width: 100%; text-align: left; background: none; border: 0;
  color: rgb(var(--s-700)); padding: .5rem .65rem; border-radius: var(--r-xl); cursor: pointer; font: inherit; font-size: .93rem; font-weight: 600; }
.facet:hover { background: rgb(var(--b-50) / .8); color: var(--navy); }
.facet.on { background: var(--navy); color: #fff; }
.facet .n { font-size: .78rem; font-weight: 800; background: rgb(var(--s-100)); color: rgb(var(--s-600)); border-radius: 99px; padding: .05rem .5rem; }
.facet.on .n { background: rgb(255 255 255 / .2); color: #fff; }
.years { display: grid; grid-template-columns: 1fr 1fr; gap: .5rem; }
.result-head { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; margin-bottom: 1rem; }
.result-head p { margin: 0; color: rgb(var(--s-600)); }
.result-head strong { color: rgb(var(--s-900)); }
.result { padding: 1.4rem 1.6rem; border-radius: var(--r-2xl); transition: box-shadow .2s, border-color .2s; }
.result:hover { box-shadow: var(--shadow-xl); border-color: rgb(var(--c-primary) / .2); }
.result + .result { margin-top: 1rem; }
.result-top { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; }
.result h3 { margin: .45rem 0 .35rem; }
.snippet { margin: .75rem 0 0; font-size: .95rem; color: rgb(var(--s-700)); line-height: 1.7; }
mark { background: rgb(254 240 138); color: inherit; padding: 0 .15em; border-radius: 4px; }
.banner { display: flex; gap: .6rem; align-items: flex-start; border: 1px solid rgb(253 230 138); background: rgb(255 251 235); color: rgb(146 64 14);
  padding: .8rem 1rem; border-radius: var(--r-xl); margin: 0 0 1rem; font-size: .93rem; }
.banner.bad { border-color: rgb(254 202 202); background: rgb(254 242 242); color: rgb(153 27 27); }
.pager { display: flex; gap: .6rem; justify-content: center; align-items: center; margin: 1.75rem 0 0; }
.empty { text-align: center; color: rgb(var(--s-500)); padding: 3rem 1rem; }
.empty-card { text-align: center; padding: 3rem 1.5rem; }
.empty-card svg.i { width: 44px; height: 44px; color: rgb(var(--s-300)); stroke-width: 1.5; }

/* ---------- detail ---------- */
.page { padding: 2rem 0 4rem; }
.crumbs { display: flex; gap: .4rem; align-items: center; flex-wrap: wrap; font-size: .88rem; color: rgb(var(--s-500)); margin-bottom: 1.25rem; }
.crumbs a { color: rgb(var(--s-600)); text-decoration: none; font-weight: 600; }
.crumbs a:hover { color: var(--navy); }
.detail-head { padding: 2rem; border-radius: var(--r-3xl); position: relative; overflow: hidden; }
.detail-head::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 6px; background: linear-gradient(90deg, var(--navy), var(--red)); }
.detail-head h1 { font-size: clamp(1.55rem, 3vw, 2.25rem); line-height: 1.2; font-weight: 900; letter-spacing: -.02em; margin: .9rem 0 .4rem; color: rgb(var(--s-900)); }
.detail-head .en { color: rgb(var(--s-500)); font-style: italic; margin: 0 0 1rem; }
.detail-grid { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 1.5rem; margin-top: 1.5rem; align-items: start; min-width: 0; }
.detail-grid > * { min-width: 0; max-width: 100%; }
.detail-main { min-width: 0; max-width: 100%; }
@media (max-width: 960px) { .detail-grid { grid-template-columns: minmax(0, 1fr); } }
dl.kv { display: grid; grid-template-columns: 1fr; gap: .1rem; margin: 0; }
dl.kv dt { font-size: .76rem; font-weight: 800; text-transform: uppercase; letter-spacing: .05em; color: rgb(var(--s-500)); margin-top: .8rem; }
dl.kv dt:first-child { margin-top: 0; }
dl.kv dd { margin: 0; font-weight: 600; color: rgb(var(--s-800)); }
.abstract { white-space: pre-wrap; color: rgb(var(--s-700)); line-height: 1.8; margin: 0; }
.files { display: grid; gap: .6rem; }
.file { display: flex; align-items: center; gap: .9rem; padding: .85rem 1rem; border: 1px solid rgb(var(--s-200)); border-radius: var(--r-xl); flex-wrap: wrap; }
.file-icon { width: 42px; height: 42px; border-radius: var(--r-xl); background: rgb(var(--c-primary-tint)); color: var(--navy); display: grid; place-items: center; flex-shrink: 0; }
.file-name { font-weight: 700; color: rgb(var(--s-900)); }
.file-info { flex: 1; min-width: 160px; }
.file-actions { display: flex; gap: .4rem; flex-wrap: wrap; }
.pdf { width: 100%; height: 78vh; border: 1px solid rgb(var(--s-200)); border-radius: var(--r-xl); background: #fff; margin-top: 1rem; }
.actions { display: flex; gap: .6rem; flex-wrap: wrap; }
.actions-col { display: grid; gap: .6rem; }
.related { list-style: none; margin: 0; padding: 0; display: grid; gap: .5rem; }
.related a { display: block; padding: .8rem 1rem; border: 1px solid rgb(var(--s-200)); border-radius: var(--r-xl); text-decoration: none; color: rgb(var(--s-800)); }
.related a:hover { border-color: rgb(var(--c-primary) / .3); background: rgb(var(--b-50) / .6); }
.related strong { display: block; font-size: .95rem; line-height: 1.4; }
.related span { font-size: .8rem; color: rgb(var(--s-500)); }
.notice { border-left: 4px solid var(--red); background: rgb(254 242 242); padding: .9rem 1.1rem; border-radius: var(--r-lg); color: rgb(127 29 29); margin-top: 1.25rem; }
.dup { border: 1px solid rgb(var(--s-200)); border-radius: var(--r-xl); padding: 1rem; margin-top: .8rem; }
.dup-head { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; }
.dup-head a { font-weight: 800; text-decoration: none; }
.pair { display: grid; grid-template-columns: 1fr 1fr; gap: .75rem; margin-top: .75rem; }
@media (max-width: 720px) { .pair { grid-template-columns: 1fr; } }
.pair small { display: block; color: rgb(var(--s-500)); font-weight: 700; margin-bottom: .3rem; }
.pair blockquote { margin: 0; padding: .75rem; background: rgb(var(--s-50)); border-radius: var(--r-lg); font-size: .86rem; color: rgb(var(--s-700));
  max-height: 260px; overflow: auto; }

/* ---------- forms, tables ---------- */
label { display: block; font-weight: 700; font-size: .88rem; margin: 1rem 0 .4rem; color: rgb(var(--s-700)); }
.req::after { content: " *"; color: var(--red); }
input, select, textarea { width: 100%; padding: .7rem .9rem; border: 1px solid rgb(var(--s-300)); border-radius: var(--r-xl); background: #fff;
  color: rgb(var(--s-900)); font: inherit; font-size: .97rem; min-height: 46px; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--navy); box-shadow: 0 0 0 4px rgb(var(--c-primary) / .12); }
input[aria-invalid="true"] { border-color: var(--red); }
textarea { min-height: 130px; resize: vertical; line-height: 1.6; }
input[type="file"] { padding: .55rem; background: rgb(var(--s-50)); }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 1.25rem; }
@media (max-width: 680px) { .form-grid { grid-template-columns: 1fr; } }
.full { grid-column: 1 / -1; }
.form-section { font-size: .78rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--red); margin: 1.75rem 0 0;
  padding-top: 1.25rem; border-top: 1px solid rgb(var(--s-100)); }
.form-section:first-child { margin-top: 0; padding-top: 0; border-top: 0; }
.person { display: grid; grid-template-columns: 2fr 1fr auto; gap: .5rem; margin-bottom: .5rem; }
.err { color: var(--red); font-size: .83rem; min-height: 1.1em; margin-top: .25rem; }
progress { width: 100%; height: 10px; margin-top: .6rem; accent-color: var(--navy); }
.form-actions { display: flex; gap: .75rem; flex-wrap: wrap; margin-top: 1.75rem; padding-top: 1.25rem; border-top: 1px solid rgb(var(--s-100)); }
.tbl-wrap { overflow-x: auto; }
table.tbl { width: 100%; border-collapse: collapse; font-size: .94rem; }
table.tbl th { text-align: left; font-size: .76rem; text-transform: uppercase; letter-spacing: .05em; color: rgb(var(--s-500)); font-weight: 800;
  padding: .75rem; border-bottom: 1px solid rgb(var(--s-200)); background: rgb(var(--s-50)); }
table.tbl td { padding: .85rem .75rem; border-bottom: 1px solid rgb(var(--s-100)); vertical-align: top; }
table.tbl td a { font-weight: 700; text-decoration: none; }
.row { display: flex; gap: .4rem; align-items: center; flex-wrap: wrap; }
.page-title { display: flex; justify-content: space-between; align-items: flex-end; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.5rem; }
.page-title h1 { font-size: clamp(1.6rem, 3vw, 2.2rem); font-weight: 900; letter-spacing: -.02em; margin: .6rem 0 0; }
.page-title p { margin: .3rem 0 0; color: rgb(var(--s-600)); }
.login-wrap { min-height: 60vh; display: grid; place-items: center; padding: 3rem 1rem; }
.login { width: 100%; max-width: 420px; padding: 2rem; border-radius: var(--r-3xl); }
.login h1 { font-size: 1.6rem; font-weight: 900; margin: .75rem 0 .25rem; }

/* ---------- stats ---------- */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 1rem; margin-bottom: 1.25rem; }
.stat { padding: 1.25rem 1.4rem; }
.stat .l { color: rgb(var(--s-500)); font-size: .85rem; font-weight: 700; display: flex; align-items: center; gap: .4rem; }
.stat .l svg.i { color: var(--red); }
.stat .v { font-size: 2.1rem; font-weight: 900; color: var(--navy); line-height: 1.2; margin-top: .3rem; }
.bars { display: grid; gap: .7rem; }
.bar { display: grid; grid-template-columns: minmax(110px, 32%) 1fr 44px; gap: .75rem; align-items: center; font-size: .92rem; font-weight: 600; }
.bar .track { background: rgb(var(--s-100)); border-radius: 99px; height: 12px; overflow: hidden; }
.bar .fill { background: linear-gradient(90deg, var(--navy), rgb(var(--c-primary) / .75)); height: 100%; border-radius: 99px; width: 0; }
.bar strong { text-align: right; color: rgb(var(--s-900)); }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1.25rem; }
@media (max-width: 800px) { .grid-2 { grid-template-columns: 1fr; } }
.grid-2 .card + .card { margin-top: 0; }

/* ---------- footer ---------- */
.site-footer { background: var(--navy-night); color: rgb(203 213 225); margin-top: 0; }
.footer-grid { display: grid; grid-template-columns: 1.3fr 1fr 1fr 1fr; gap: 2.5rem; padding: 4rem 0 3rem; }
@media (max-width: 900px) { .footer-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 560px) { .footer-grid { grid-template-columns: 1fr; gap: 2rem; } }
.footer-brand { display: flex; gap: .75rem; align-items: center; color: #fff; }
.footer-brand .brand-mark { width: 44px; height: 44px; background: #fff; color: var(--navy); box-shadow: none; }
.footer-brand .brand-mark::after { border-color: var(--navy-night); }
.footer-brand strong { font-size: 1.2rem; font-weight: 800; display: block; }
.footer-brand small { color: rgb(148 163 184); font-size: .75rem; }
.site-footer p { font-size: .92rem; line-height: 1.7; margin: 1.1rem 0 0; color: rgb(148 163 184); }
.site-footer h4 { color: #fff; font-size: .9rem; font-weight: 800; text-transform: uppercase; letter-spacing: .05em; margin: 0 0 1rem; }
.site-footer ul { list-style: none; margin: 0; padding: 0; display: grid; gap: .7rem; }
.site-footer a { color: rgb(var(--b-100)); text-decoration: none; font-size: .93rem; display: inline-flex; gap: .45rem; align-items: center; }
.site-footer a:hover { color: #fff; }
.site-footer li svg.i { color: rgb(52 211 153); }
.footer-bottom { border-top: 1px solid rgb(255 255 255 / .1); padding: 1.4rem 0 2rem; display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap;
  font-size: .85rem; color: rgb(148 163 184); }
.footer-bottom span { display: inline-flex; gap: .4rem; align-items: center; }
.footer-bottom svg.i { color: rgb(52 211 153); }

/* ---------- toasts ---------- */
.toasts { position: fixed; bottom: 1.25rem; right: 1.25rem; display: grid; gap: .6rem; z-index: 60; max-width: min(420px, calc(100vw - 2rem)); }
.toast { background: #fff; border: 1px solid rgb(var(--s-200)); border-left: 4px solid var(--navy); padding: .8rem 1rem; border-radius: var(--r-xl);
  box-shadow: var(--shadow-xl); font-size: .93rem; font-weight: 600; animation: fade-in 180ms ease-out both; }
.toast.bad { border-left-color: var(--red); }
.toast.ok { border-left-color: rgb(var(--c-success)); }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

/* ---------- misc ---------- */
.step-title { font-size: 1.1rem; font-weight: 800; margin: 1rem 0 .35rem; color: rgb(var(--s-900)); }
.step .file-icon { width: 48px; height: 48px; border-radius: var(--r-2xl); }
.step .file-icon svg.i { width: 22px; height: 22px; }
.chips.kw { margin-top: 1.1rem; }
.chips.kw .chip { font-size: 12.5px; padding: .35rem .8rem; }
.empty-card h1 { font-size: 1.4rem; margin: .75rem 0 1.25rem; }
.empty-card p { color: rgb(var(--s-600)); }
/* grids manage their own gaps; stacked-card spacing applies only in normal flow */
.grid-3 > .card + .card, .grid-2 > .card + .card, .stats > .card + .card, .layout > .card + .card { margin-top: 0; }
/* the search field lives inside the bordered .searchbar, which shows the focus ring */
.searchbar input, .searchbar input:focus { border: 0; box-shadow: none; padding: 0; min-height: 48px; }
main:focus { outline: none; } /* programmatic focus after navigation (screen-reader context), not a user focus ring */

/* ---------- embedded pdf page viewer ---------- */
.pdf-viewer-wrap {
  margin-top: 1rem;
  border: 1px solid rgb(var(--s-200));
  border-radius: var(--r-2xl);
  background: rgb(var(--s-100));
  overflow: hidden;
  max-width: 100%;
  min-width: 0;
}
.viewer-loading {
  padding: 2rem;
  text-align: center;
}
.viewer-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: .6rem 1rem;
  background: #fff;
  border-bottom: 1px solid rgb(var(--s-200));
  font-size: .9rem;
  font-weight: 700;
  color: rgb(var(--s-700));
}
.viewer-page-indicator {
  display: inline-flex;
  align-items: center;
  gap: .3rem;
  font-variant-numeric: tabular-nums;
}
.viewer-zoom-controls {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
}
.zoom-label {
  min-width: 44px;
  text-align: center;
  font-variant-numeric: tabular-nums;
  font-size: .85rem;
  color: rgb(var(--s-600));
}
.viewer-body-rel {
  position: relative;
  width: 100%;
}
.viewer-watermark {
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: .07;
  z-index: 10;
  background-repeat: repeat;
}
.viewer-pages-scroll {
  height: min(80vh, 1100px);
  max-height: min(80vh, 1100px);
  overflow-y: auto;
  overflow-x: hidden;
  padding: 1.5rem 1rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.5rem;
  background: rgb(var(--s-100));
  box-sizing: border-box;
  width: 100%;
  max-width: 100%;
  min-width: 0;
}
@media (max-width: 520px) {
  .viewer-pages-scroll {
    padding: 0.75rem 0.25rem;
    gap: 1rem;
    height: 70vh;
  }
  .page-box {
    max-width: 100% !important;
  }
}
.page-box {
  width: 100%;
  margin: 0 auto;
  background: #fff;
  border-radius: var(--r-md);
  box-shadow: 0 4px 6px -1px rgb(0 0 0 / .1), 0 2px 4px -2px rgb(0 0 0 / .1);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  box-sizing: border-box;
  flex-shrink: 0;
}
.page-stage {
  width: 100%;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #fafafa;
  overflow: hidden;
  box-sizing: border-box;
  flex-shrink: 0;
}
.page-skeleton {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  background: linear-gradient(90deg, #f8fafc 25%, #f1f5f9 50%, #f8fafc 75%);
  background-size: 200% 100%;
  animation: page-skeleton-shimmer 2s infinite linear;
  color: rgb(var(--s-500));
  font-size: 0.85rem;
  font-weight: 600;
  user-select: none;
  z-index: 1;
}
@keyframes page-skeleton-shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}
.page-spinner {
  width: 26px;
  height: 26px;
  border: 3px solid rgb(var(--s-200));
  border-top-color: var(--navy);
  border-radius: 50%;
  animation: page-spin 0.8s linear infinite;
}
@keyframes page-spin {
  to { transform: rotate(360deg); }
}
.page-error {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  background: #fff;
  color: var(--red);
  padding: 1rem;
  text-align: center;
  z-index: 2;
  box-sizing: border-box;
}
.page-error span {
  font-size: 0.9rem;
  font-weight: 600;
  color: rgb(var(--s-700));
}
.page-error svg.i {
  width: 28px;
  height: 28px;
  color: var(--red);
}
.page-error .btn-retry {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.85rem;
  padding: 0.35rem 0.75rem;
}
.page-img {
  /* Pinned to the reserved .page-stage box: never larger than the frame, never cropped. */
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  pointer-events: auto;
  user-select: none;
  -webkit-user-select: none;
  -webkit-user-drag: none;
}
.page-num-foot {
  padding: .4rem .75rem;
  font-size: .8rem;
  color: rgb(var(--s-400));
  background: #fff;
  width: 100%;
  text-align: center;
  border-top: 1px solid rgb(var(--s-100));
  box-sizing: border-box;
  flex-shrink: 0;
}
