:root {
  color-scheme: light;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #202544;
  background: #f7f8fc;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
}

* { box-sizing: border-box; }
body { min-width: 320px; min-height: 100vh; margin: 0; }
a { color: inherit; text-decoration: none; }

.site-header {
  display: flex;
  height: 76px;
  align-items: center;
  justify-content: space-between;
  padding: 0 max(24px, calc((100vw - 1140px) / 2));
  border-bottom: 1px solid #e9ebf3;
  background: #fff;
}
.brand { display: inline-flex; align-items: center; gap: 11px; font-weight: 750; letter-spacing: -.03em; }
.brand-mark {
  display: grid; width: 38px; height: 38px; place-items: center;
  border-radius: 12px; color: #fff; background: #6259e8; font-size: 20px;
}
.admin-link {
  padding: 9px 14px; border: 1px solid #e5e6f0; border-radius: 10px;
  color: #505773; font-size: .9rem; font-weight: 650;
}
.admin-link:hover { border-color: #b8b4f5; color: #5148d5; }
.page { width: min(100% - 40px, 1140px); margin: 0 auto; }
.hero { padding: 66px 0 52px; text-align: center; }
.eyebrow { margin: 0 0 12px; color: #6259e8; font-size: .76rem; font-weight: 800; letter-spacing: .16em; }
.hero h1 { margin: 0 auto 14px; font-size: clamp(2.25rem, 6vw, 3.7rem); line-height: 1.08; letter-spacing: -.06em; }
.hero-copy { margin: 0 auto 25px; color: #6e7490; font-size: 1.03rem; line-height: 1.6; }
.search-form {
  display: flex; width: min(100%, 570px); gap: 9px; margin: 0 auto;
  padding: 6px; border: 1px solid #e2e4ef; border-radius: 14px; background: #fff;
  box-shadow: 0 8px 24px #252c520a;
}
.search-form input { width: 100%; min-width: 0; padding: 10px 12px; border: 0; outline: 0; color: #202544; background: transparent; font: inherit; }
.search-form:focus-within { border-color: #8e87ef; box-shadow: 0 0 0 3px #7770eb20; }
.search-form button {
  flex-shrink: 0; padding: 0 17px; border: 0; border-radius: 10px; color: #fff;
  background: #6259e8; font: inherit; font-weight: 700; cursor: pointer;
}
.search-form button:hover { background: #5148d5; }
.library-layout { display: grid; grid-template-columns: 235px minmax(0, 1fr); gap: 44px; padding-bottom: 70px; }
.subject-panel h2, .section-heading h2 { margin: 0; font-size: 1.08rem; letter-spacing: -.02em; }
.subject-list { display: grid; gap: 5px; margin-top: 15px; }
.subject-link { display: flex; min-height: 42px; align-items: center; justify-content: space-between; padding: 0 12px; border-radius: 9px; color: #626984; font-size: .93rem; }
.subject-link:hover, .subject-link.selected { color: #4d44cf; background: #eeedff; font-weight: 700; }
.subject-arrow { font-size: 1.25rem; }
.empty-small { color: #858ba1; font-size: .9rem; line-height: 1.5; }
.section-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 17px; }
.section-heading p { margin: 6px 0 0; color: #7a8098; font-size: .9rem; }
.count-pill { padding: 7px 10px; border-radius: 99px; color: #686f8a; background: #eceef6; font-size: .78rem; font-weight: 650; white-space: nowrap; }
.note-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.note-card { display: flex; min-height: 205px; flex-direction: column; padding: 20px; border: 1px solid #e8eaf2; border-radius: 15px; background: #fff; box-shadow: 0 5px 16px #252c5206; transition: transform 150ms, border-color 150ms, box-shadow 150ms; }
.note-card:hover { transform: translateY(-2px); border-color: #cbc8f9; box-shadow: 0 12px 25px #252c5210; }
.note-subject { color: #6259e8; font-size: .78rem; font-weight: 750; }
.note-card h3 { margin: 10px 0 7px; font-size: 1.12rem; letter-spacing: -.025em; }
.note-card p { margin: 0 0 16px; color: #6e7490; font-size: .9rem; line-height: 1.55; }
.read-link { display: flex; align-items: center; gap: 6px; margin-top: auto; color: #5148d5; font-size: .87rem; font-weight: 700; }
.empty-state { grid-column: 1 / -1; padding: 50px 24px; border: 1px dashed #d9dceb; border-radius: 15px; background: #fff; text-align: center; }
.empty-icon { color: #6259e8; font-size: 1.8rem; }
.empty-state h3 { margin: 10px 0 5px; }
.empty-state p { margin: 0; color: #747b94; line-height: 1.5; }
.pagination { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 22px; color: #737a94; font-size: .88rem; }
.pagination a, .back-link { color: #5148d5; font-weight: 650; }
.pagination a:hover, .back-link:hover { text-decoration: underline; }
.note-detail { max-width: 790px; margin: 54px auto 72px; }
.back-link { display: inline-block; margin-bottom: 18px; font-size: .92rem; }
.detail-card { padding: clamp(24px, 6vw, 48px); border: 1px solid #e8eaf2; border-radius: 20px; background: #fff; box-shadow: 0 14px 35px #252c520a; }
.detail-card h1 { margin: 12px 0 25px; font-size: clamp(1.9rem, 5vw, 2.7rem); letter-spacing: -.05em; line-height: 1.15; }
.note-content { color: #414864; font-size: 1.02rem; line-height: 1.85; overflow-wrap: anywhere; }
.note-content p { margin: 0 0 1.1em; }
.attachment-link { display: flex; max-width: 430px; align-items: center; gap: 14px; margin-top: 27px; padding: 15px 17px; border: 1px solid #e2e0fb; border-radius: 13px; color: #39319d; background: #f7f6ff; }
.attachment-link:hover { border-color: #aaa5f4; background: #f0efff; }
.attachment-icon { display: grid; width: 38px; height: 38px; flex: 0 0 auto; place-items: center; border-radius: 11px; color: #fff; background: #6259e8; font-size: 1.3rem; }
.attachment-link strong, .attachment-link small { display: block; }
.attachment-link small { margin-top: 4px; color: #747b94; overflow-wrap: anywhere; }
.updated { margin: 28px 0 0; padding-top: 17px; border-top: 1px solid #eceef5; color: #858ba1; font-size: .82rem; }
.bottom-back { margin: 18px 0 0; }
.site-footer { padding: 23px; border-top: 1px solid #e9ebf3; color: #7a8098; background: #fff; font-size: .85rem; text-align: center; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; clip-path: inset(50%); }

@media (max-width: 760px) {
  .hero { padding: 48px 0 38px; }
  .library-layout { grid-template-columns: 1fr; gap: 28px; }
  .subject-list { display: flex; flex-wrap: wrap; }
  .subject-link { min-height: 37px; padding: 0 10px; background: #fff; }
}
@media (max-width: 520px) {
  .site-header { height: 65px; padding: 0 18px; }
  .brand { gap: 8px; font-size: .93rem; }
  .brand-mark { width: 34px; height: 34px; }
  .page { width: min(100% - 32px, 1140px); }
  .hero { padding-top: 42px; }
  .hero-copy { font-size: .95rem; }
  .search-form button { padding: 0 12px; }
  .note-grid { grid-template-columns: 1fr; }
  .note-card { min-height: 185px; }
  .section-heading { align-items: flex-start; }
}
