:root {
  color: #0b1f3a;
  font-family: "Noto Sans KR", Arial, sans-serif;
  background: #f5f8fc;
}

* { box-sizing: border-box; }

body { margin: 0; min-width: 320px; }

button, input { font: inherit; }

.archive-header {
  height: 76px;
  background: #fff;
  border-bottom: 1px solid #e8edf4;
}

.archive-header-inner {
  width: min(100% - 48px, 1400px);
  height: 100%;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.archive-brand { display: flex; align-items: center; gap: 10px; color: #0b1f3a; font-weight: 800; text-decoration: none; }
.archive-brand img { width: 56px; height: 42px; object-fit: contain; }
.home-link { color: #53647a; font-size: 14px; font-weight: 700; text-decoration: none; }
.home-link:hover, .home-link:focus-visible { color: #0868e8; }

main { min-height: calc(100vh - 176px); }

.archive-intro {
  padding: 62px 24px 44px;
  text-align: center;
  background: #fff;
}

.archive-intro p { margin: 0 0 8px; color: #0868e8; font-size: 13px; font-weight: 800; }
.archive-intro h1 { margin: 0; font-size: 40px; line-height: 1.2; letter-spacing: 0; }
.archive-intro span { display: block; margin-top: 14px; color: #607086; font-size: 15px; }

.archive-shell { width: min(100% - 48px, 1360px); margin: 0 auto; padding: 34px 0 64px; }
.archive-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 22px; }
.filter-list { display: flex; flex-wrap: wrap; gap: 8px; }
.filter-list button, .auth-open, .auth-status button {
  min-height: 42px;
  padding: 0 20px;
  border: 1px solid #dfe6ef;
  border-radius: 7px;
  background: #fff;
  color: #53647a;
  font-weight: 700;
  cursor: pointer;
}
.filter-list button.active { border-color: #0b1f3a; background: #0b1f3a; color: #fff; }
.auth-open { border-color: #0868e8; color: #0868e8; }
.auth-status { display: flex; align-items: center; gap: 12px; color: #087a4c; font-size: 14px; font-weight: 700; }
.auth-status button { min-height: 36px; padding: 0 14px; }

.message { margin: 0 0 14px; padding: 12px 16px; border-radius: 6px; font-size: 14px; }
.message.error { background: #fff0f0; color: #a62020; }
.message.success { background: #eaf8f1; color: #087a4c; }
.message.notice { background: #edf5ff; color: #075bbf; }

.auth-panel { display: none; grid-template-columns: auto minmax(180px, 320px) auto; align-items: center; gap: 12px; margin: 0 0 18px; padding: 18px; background: #fff; border: 1px solid #dfe6ef; }
.auth-panel.open { display: grid; }
.auth-panel label { font-size: 14px; font-weight: 700; }
.auth-panel input { height: 44px; padding: 0 12px; border: 1px solid #cfd8e5; border-radius: 5px; }
.auth-panel button { height: 44px; padding: 0 20px; border: 0; border-radius: 5px; background: #0868e8; color: #fff; font-weight: 800; cursor: pointer; }

.archive-table { overflow: hidden; border: 1px solid #e1e7ef; background: #fff; }
.archive-row { display: grid; grid-template-columns: 80px minmax(300px, 1fr) 130px 130px 110px; align-items: center; min-height: 94px; border-top: 1px solid #e8edf3; }
.archive-row:first-child { border-top: 0; }
.archive-row > * { padding: 18px 20px; }
.archive-row-head { min-height: 58px; background: #f3f6fa; color: #34465c; font-size: 13px; font-weight: 700; }
.item-number, time { color: #6e7d90; font-size: 14px; }
.item-copy strong { display: block; color: #0b1f3a; font-size: 16px; }
.item-copy p { margin: 6px 0 0; color: #718095; font-size: 13px; }
.item-category { color: #53647a; font-size: 14px; }
.download-link { display: inline-flex; justify-content: center; align-items: center; width: 76px; min-height: 38px; margin: 0 20px; padding: 0 12px; border-radius: 5px; background: #0868e8; color: #fff; font-size: 13px; font-weight: 800; text-decoration: none; }
.download-link.locked { background: #53647a; }

footer { min-height: 100px; padding: 24px max(24px, calc((100% - 1360px) / 2)); display: flex; align-items: center; justify-content: space-between; gap: 20px; background: #0b1f33; color: #fff; }
footer span { color: #aebccd; font-size: 14px; }
footer a { color: #fff; font-weight: 700; text-decoration: none; }

@media (max-width: 820px) {
  .archive-intro { padding: 44px 20px 34px; }
  .archive-intro h1 { font-size: 34px; }
  .archive-shell { width: min(100% - 28px, 1360px); padding-top: 24px; }
  .archive-toolbar { align-items: flex-start; flex-direction: column; }
  .auth-panel { grid-template-columns: 1fr; }
  .archive-row-head { display: none; }
  .archive-row { grid-template-columns: 48px 1fr auto; min-height: 112px; }
  .archive-row > * { padding: 14px 10px; }
  .item-category, .archive-row time { display: none; }
  .download-link { width: 72px; margin: 0 12px 0 0; }
  footer { align-items: flex-start; flex-direction: column; }
}

@media (max-width: 480px) {
  .archive-header-inner { width: min(100% - 28px, 1400px); }
  .archive-brand span { display: none; }
  .filter-list { display: grid; grid-template-columns: 1fr 1fr; width: 100%; }
  .filter-list button { padding: 0 12px; }
  .archive-row { grid-template-columns: 42px minmax(0, 1fr); padding-bottom: 12px; }
  .download-link { grid-column: 2; width: calc(100% - 10px); margin: 0 10px 0 0; }
}

.archive-row[hidden] { display: none !important; }

.archive-empty { margin: 0; padding: 40px 20px; border: 1px solid #e1e7ef; border-top: 0; background: #fff; color: #718095; text-align: center; }
.archive-empty[hidden] { display: none; }

.item-title-link { color: inherit; text-decoration: none; }
.item-title-link:hover { color: #0868e8; text-decoration: underline; }
.detail-content { background: #fff; border: 1px solid #e1e7ef; padding: 30px; }
.detail-content h2 { margin-top: 0; overflow-wrap: anywhere; }
.detail-meta { color: #607086; font-size: 14px; }
.detail-description { white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.9; margin: 24px 0; }
.detail-download { display: inline-flex; padding: 14px 24px; border-radius: 6px; background: #0868e8; color: #fff; text-decoration: none; font-weight: 700; }
@media(max-width:480px) { .detail-content { padding: 20px; } }

.detail-view { margin:8px 0 0 8px; background:#eef4ff; color:#0868e8; }
.detail-preview { margin-top:24px; }
.detail-preview img { display:block; max-width:100%; height:auto; margin:auto; }
.pdf-preview { width:100%; height:75vh; min-height:420px; border:1px solid #dfe6ef; }

.archive-folder-icon { display:block; width:64px; height:64px; margin:0 auto; }

.archive-intro .archive-title-button { display:inline-flex; align-items:center; gap:14px; padding:15px 28px; border:1px solid #bfd4f7; border-radius:18px; color:#075cc9; text-decoration:none; background:linear-gradient(135deg,#edf5ff,#dceaff); box-shadow:0 6px 18px #0868e820; font-size:28px; transition:transform .18s,box-shadow .18s; }
.archive-title-button .archive-folder-icon { width:40px; height:40px; margin:0; }
.archive-intro .archive-title-button span { margin:0; color:inherit; font-size:inherit; }
.archive-intro .archive-title-button .archive-title-arrow { font-size:22px; }
.archive-title-button:hover { transform:translateY(-3px); box-shadow:0 10px 24px #0868e838; }
.archive-title-button:active { transform:scale(.97); }
.archive-title-button:focus-visible { outline:3px solid #0868e8; outline-offset:5px; }
@media(prefers-reduced-motion:reduce) { .archive-intro .archive-title-button { transition:none; } }

.pdf-reader { padding:12px; background:#eef2f7; border:1px solid #dfe6ef; border-radius:8px; min-width:0; }
.pdf-toolbar { display:flex; align-items:center; justify-content:space-between; gap:8px; margin-bottom:12px; flex-wrap:wrap; font-size:14px; }
.pdf-toolbar button { padding:10px 12px; border:1px solid #bfd4f7; border-radius:6px; background:#fff; color:#075cc9; cursor:pointer; }
.pdf-toolbar button:disabled { opacity:.45; cursor:default; }
.pdf-reader canvas { display:block; max-width:100%; background:white; margin:auto; }
.pdf-reader canvas[hidden] { display:none; }
