:root {
  --ink: #fff;
  --muted: #c8d0e6;
  --accent: #9ab7ff;
  --bg: #050915;
  --bg2: #0b1330;
  --stroke: rgba(255, 255, 255, .14);
  --card: rgba(255, 255, 255, .05);
}

* { box-sizing: border-box; }

html, body {
  margin: 0; padding: 0; min-height: 100%;
  font-family: -apple-system, BlinkMacSystemFont, "Pretendard", "Apple SD Gothic Neo", sans-serif;
  background: radial-gradient(1200px 600px at 50% -10%, var(--bg2), var(--bg) 60%);
  color: var(--ink);
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

header.site {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 6%;
  background: rgba(5, 9, 21, .85);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--stroke);
}

header.site .brand {
  font-weight: 800; font-size: 20px; letter-spacing: .02em;
}
header.site .brand span { color: var(--accent); }

nav.menu { display: flex; gap: 6px; }
nav.menu a {
  color: var(--muted);
  padding: 8px 16px;
  border-radius: 10px;
  font-weight: 600;
  font-size: 15px;
}
nav.menu a:hover { color: var(--ink); text-decoration: none; background: var(--card); }
nav.menu a.active { color: var(--ink); background: rgba(154, 183, 255, .16); }

main { max-width: 900px; margin: 0 auto; padding: 48px 6% 80px; }
main.wide { max-width: 1280px; }

h1.page-title {
  font-size: clamp(28px, 4vw, 40px);
  font-weight: 800;
  margin: 0 0 8px;
}
h1.page-title.gradient-title {
  background: linear-gradient(135deg, #ffffff 0%, var(--accent) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
p.page-sub { color: var(--muted); margin: 0 0 36px; font-size: 16px; }

.card {
  background: var(--card);
  border: 1px solid var(--stroke);
  border-radius: 16px;
  padding: 20px 24px;
  margin-bottom: 16px;
}

/* --- 뉴스 검색/열 설정 툴바 --- */
.news-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 28px;
  padding: 14px 16px;
  border: 1px solid var(--stroke);
  border-radius: 16px;
  background: rgba(255, 255, 255, .03);
}

.news-search { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; flex: 1 1 420px; }
.news-search input {
  border-radius: 10px;
  border: 1px solid var(--stroke);
  background: rgba(255, 255, 255, .04);
  color: var(--ink);
  padding: 9px 12px;
  font-size: 14px;
  font-family: inherit;
}
.news-search input[type=text] { flex: 1 1 180px; min-width: 140px; }
.news-search input[type=date] { color-scheme: dark; }
.news-search .date-sep { color: var(--muted); font-size: 13px; }
.news-search button {
  padding: 9px 18px;
  border-radius: 10px;
  border: none;
  background: var(--accent);
  color: #061024;
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
}
.news-search button:hover { opacity: .9; }
.news-search button.ghost {
  background: transparent;
  border: 1px solid var(--stroke);
  color: var(--muted);
  font-weight: 600;
}
.news-search button.ghost:hover { color: var(--ink); border-color: var(--accent); }

.news-cols { display: flex; align-items: center; gap: 6px; }
.news-cols .cols-label { color: var(--muted); font-size: 13px; margin-right: 4px; }
.news-cols button {
  width: 32px; height: 32px;
  border-radius: 9px;
  border: 1px solid var(--stroke);
  background: transparent;
  color: var(--muted);
  font-weight: 700;
  font-size: 13px;
  cursor: pointer;
  transition: .15s;
}
.news-cols button:hover { color: var(--ink); border-color: var(--accent); }
.news-cols button.active { background: var(--accent); color: #061024; border-color: var(--accent); }

.news-status { color: var(--muted); font-size: 14px; margin-bottom: 16px; }

/* --- 뉴스 카드 그리드 --- */
.news-grid {
  --news-cols: 3;
  display: grid;
  grid-template-columns: repeat(var(--news-cols), 1fr);
  gap: 24px;
}

.news-card {
  display: flex;
  flex-direction: column;
  border-radius: 16px;
  border: 1px solid var(--stroke);
  background: var(--card);
  overflow: hidden;
  transition: .25s ease;
}
.news-card:hover {
  text-decoration: none;
  border-color: var(--accent);
  transform: translateY(-5px);
  box-shadow: 0 14px 30px rgba(0,0,0,.4), 0 0 22px rgba(154, 183, 255, .18);
}

.news-card-media {
  position: relative;
  aspect-ratio: 16 / 10;
  background: linear-gradient(160deg, #10193f, #050915) center/cover no-repeat;
  background-size: cover;
  background-position: center;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.news-card:hover .news-card-media { background-size: 112%; }
.news-card-fallback { font-size: 40px; opacity: .5; }

.news-card-media .badge {
  position: absolute;
  top: 12px; left: 12px;
  max-width: calc(100% - 24px);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  background: rgba(5, 9, 21, .75);
  color: var(--accent);
  border: 1px solid rgba(154, 183, 255, .35);
  padding: 4px 11px;
  border-radius: 12px;
  font-size: 11.5px;
  font-weight: 700;
  backdrop-filter: blur(4px);
}

.news-card-body { padding: 16px 18px 18px; display: flex; flex-direction: column; flex-grow: 1; }
.news-card-body .card-date { font-size: 12px; color: var(--muted); margin-bottom: 8px; }
.news-card-body .title {
  font-size: 16px; font-weight: 700; color: var(--ink);
  margin-bottom: 12px; line-height: 1.4;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical;
  overflow: hidden;
}
.news-card-body .meta { font-size: 12.5px; color: var(--muted); }
.news-card-body .read-more {
  margin-top: auto;
  font-size: 13px; font-weight: 600; color: var(--accent);
}

@media (max-width: 900px) {
  .news-grid { grid-template-columns: repeat(2, 1fr) !important; }
}
@media (max-width: 560px) {
  .news-grid { grid-template-columns: 1fr !important; }
  .news-toolbar { flex-direction: column; align-items: stretch; }
  .news-cols { justify-content: flex-end; }
}

.news-sentinel { display: flex; justify-content: center; padding: 36px 0; min-height: 1px; }
.spinner {
  width: 22px; height: 22px;
  border-radius: 50%;
  border: 3px solid var(--stroke);
  border-top-color: var(--accent);
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.news-end { text-align: center; color: var(--muted); font-size: 13px; padding: 20px 0; opacity: .6; }

.empty { color: var(--muted); padding: 24px 0; }

.faq-item { margin-bottom: 14px; border: 1px solid var(--stroke); border-radius: 14px; overflow: hidden; background: var(--card); }
.faq-q {
  padding: 16px 20px; font-weight: 700; cursor: pointer;
  display: flex; justify-content: space-between; align-items: center;
}
.faq-q .icon { color: var(--accent); font-weight: 400; transition: transform .15s; }
.faq-item[open] .faq-q .icon { transform: rotate(45deg); }
.faq-a { padding: 0 20px 18px; color: var(--muted); line-height: 1.7; }

.upload-box {
  border: 1px dashed var(--stroke);
  border-radius: 16px;
  padding: 28px;
  margin-bottom: 32px;
}
.upload-box label { display: block; font-size: 14px; color: var(--muted); margin-bottom: 6px; margin-top: 14px; }
.upload-box input[type=text], .upload-box input[type=password], .upload-box input[type=file], .upload-box textarea {
  width: 100%;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--stroke);
  background: rgba(255,255,255,.03);
  color: var(--ink);
  font-size: 14px;
  font-family: inherit;
}
.upload-box textarea { resize: vertical; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13px; }

.admin-bar { color: var(--muted); font-size: 14px; margin-bottom: 18px; }
.upload-box button {
  margin-top: 18px;
  padding: 12px 26px;
  border-radius: 12px;
  border: none;
  background: var(--accent);
  color: #061024;
  font-weight: 700;
  cursor: pointer;
  font-size: 15px;
}
.upload-box button:hover { opacity: .9; }

.flash { padding: 12px 16px; border-radius: 10px; margin-bottom: 20px; font-size: 14px; }
.flash.ok { background: rgba(120, 220, 150, .12); border: 1px solid rgba(120,220,150,.4); color: #b6f0c6; }
.flash.err { background: rgba(255, 120, 120, .12); border: 1px solid rgba(255,120,120,.4); color: #ffb6b6; }

.lecture-list a { display: block; padding: 14px 18px; border: 1px solid var(--stroke); border-radius: 12px; margin-bottom: 10px; background: var(--card); }
.lecture-list a:hover { text-decoration: none; border-color: var(--accent); }

footer.site {
  text-align: center; color: var(--muted); font-size: 13px;
  padding: 40px 6% 60px; opacity: .6;
}
