:root {
  color-scheme: light;
  --ink: #1f2933;
  --muted: #65758b;
  --line: #d9e0ea;
  --bg: #f5f7fb;
  --panel: #ffffff;
  --blue: #1f6feb;
  --green: #0f8b6f;
  --red: #cf3d3d;
  --shadow: 0 12px 30px rgba(30, 41, 59, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Segoe UI", "Apple SD Gothic Neo", "Malgun Gothic", sans-serif;
  background: var(--bg);
  color: var(--ink);
}

a {
  color: inherit;
  text-decoration: none;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 5vw;
  background: rgba(255, 255, 255, 0.92);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(12px);
}

.brand {
  font-weight: 800;
}

.topbar nav {
  display: flex;
  gap: 14px;
  color: var(--muted);
  font-size: 14px;
}

main {
  width: min(1180px, 90vw);
  margin: 0 auto;
  padding: 34px 0 64px;
}

.hero,
.login-panel,
.viewer-head,
.admin-head {
  display: flex;
  justify-content: space-between;
  gap: 28px;
  align-items: center;
  padding: 38px;
  background: linear-gradient(135deg, #ffffff 0%, #eef6f3 100%);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--green);
  font-weight: 800;
  letter-spacing: 0;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 12px;
  font-size: clamp(32px, 5vw, 52px);
  line-height: 1.05;
  letter-spacing: 0;
}

h2 {
  margin-bottom: 0;
  font-size: 24px;
}

h3 {
  margin-bottom: 8px;
}

.lead {
  color: var(--muted);
  font-size: 18px;
  line-height: 1.6;
  margin-bottom: 0;
}

.quick-actions,
.card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.quick-actions a,
.card-actions a,
button,
.primary {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  min-height: 42px;
  padding: 0 16px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  font-weight: 700;
  cursor: pointer;
}

.quick-actions a:first-child,
.primary,
button {
  background: var(--blue);
  color: #fff;
  border-color: var(--blue);
}

.section {
  margin-top: 34px;
}

.section-title {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 12px;
  margin-bottom: 16px;
}

.section-title span,
small,
.admin-row span {
  color: var(--muted);
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 16px;
}

.card,
.panel,
.admin-row,
.link-row {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.card {
  padding: 20px;
}

.card p,
.link-row span {
  color: var(--muted);
  line-height: 1.55;
}

.file-badge {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  margin-bottom: 18px;
  border-radius: 6px;
  background: #e8f1ff;
  color: var(--blue);
  font-weight: 900;
}

.video-grid iframe,
.video-placeholder {
  width: 100%;
  aspect-ratio: 16 / 9;
  margin-bottom: 16px;
  border: 0;
  border-radius: 6px;
  background: #182230;
  color: #fff;
}

.video-placeholder {
  display: grid;
  place-items: center;
  font-weight: 800;
}

.link-list,
.admin-list {
  display: grid;
  gap: 10px;
}

.link-row,
.admin-row {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 18px;
}

.link-row {
  flex-direction: column;
}

.empty {
  padding: 24px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  color: var(--muted);
  background: #fff;
}

.login-panel {
  margin-top: 9vh;
}

.login-form {
  width: min(360px, 100%);
  display: grid;
  gap: 12px;
  padding: 22px;
  border-radius: 8px;
  background: #fff;
  border: 1px solid var(--line);
}

label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-weight: 700;
}

input,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 11px 12px;
  font: inherit;
  color: var(--ink);
  background: #fff;
}

.error {
  margin: 0;
  color: var(--red);
  font-weight: 700;
}

.pdf-viewer {
  width: 100%;
  height: 78vh;
  margin-top: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.admin-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 16px;
  margin-top: 24px;
}

.panel {
  display: grid;
  gap: 13px;
  padding: 20px;
}

.check {
  grid-template-columns: auto 1fr;
  align-items: center;
}

.check input {
  width: auto;
}

.admin-row {
  align-items: center;
}

.admin-row div {
  display: grid;
  gap: 4px;
}

.danger {
  background: #fff;
  color: var(--red);
  border-color: #f0b8b8;
}

@media (max-width: 760px) {
  .topbar,
  .hero,
  .login-panel,
  .viewer-head,
  .admin-head,
  .link-row,
  .admin-row {
    flex-direction: column;
    align-items: stretch;
  }

  .hero,
  .login-panel,
  .viewer-head,
  .admin-head {
    padding: 24px;
  }

  .quick-actions a,
  .card-actions a,
  button {
    width: 100%;
  }
}

.card-actions a:not(.primary),
.quick-actions a:not(:first-child) {
  color: var(--ink);
  background: #fff;
}

.card-actions .primary,
.quick-actions a:first-child {
  color: #fff;
}

.card-actions .open-pdf {
  min-width: 96px;
  background: var(--blue) !important;
  border-color: var(--blue) !important;
  color: #fff !important;
}

.card-actions .open-pdf:visited,
.card-actions .open-pdf:hover,
.card-actions .open-pdf:focus {
  color: #fff !important;
}

/* Main material room: quick scanning for on-site presentations. */
main {
  width: min(1280px, 92vw);
  padding-top: 24px;
}

.hero {
  min-height: 148px;
  padding: 28px 32px;
  background: linear-gradient(110deg, #ffffff 0%, #f2f8f6 100%);
}

.hero h1 {
  margin: 0;
  font-size: clamp(34px, 4vw, 48px);
}

.quick-actions {
  gap: 8px;
}

.quick-actions a {
  min-height: 44px;
  min-width: 132px;
}

.section {
  margin-top: 28px;
}

.section-title {
  margin-bottom: 12px;
}

.pdf-grid {
  grid-template-columns: 1fr;
}

.pdf-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 18px;
  padding: 18px 22px;
}

.pdf-card .file-badge {
  margin: 0;
}

.pdf-copy h3 {
  margin: 0 0 6px;
  font-size: 20px;
}

.pdf-card .card-actions {
  justify-content: flex-end;
}

.video-card {
  display: grid;
  align-content: start;
  gap: 14px;
}

.video-card iframe,
.video-card .video-placeholder,
.video-card h3 {
  margin: 0;
}

.video-card h3 {
  min-height: 28px;
  font-size: 19px;
}

.video-card .primary {
  justify-self: start;
}

.link-list {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.link-row {
  min-height: 104px;
  justify-content: space-between;
  padding: 18px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.link-row:hover {
  border-color: #aac8ee;
  box-shadow: 0 10px 24px rgba(30, 79, 130, 0.1);
}

.link-row strong {
  font-size: 18px;
}

.link-action {
  color: var(--blue) !important;
  font-weight: 800;
}

@media (max-width: 760px) {
  .hero {
    min-height: 0;
    padding: 24px;
  }

  .quick-actions a {
    min-width: 0;
  }

  .pdf-card {
    grid-template-columns: auto 1fr;
    align-items: start;
  }

  .pdf-card .card-actions {
    grid-column: 1 / -1;
    justify-content: stretch;
  }

  .link-list {
    grid-template-columns: 1fr;
  }
}

/* University masthead and compact material navigation. */
.topbar {
  min-height: 72px;
  padding: 12px 4vw;
}

.brand {
  display: grid;
  gap: 3px;
  line-height: 1;
}

.brand-ko {
  color: #173b68;
  font-size: 18px;
  font-weight: 900;
}

.brand-en {
  color: #527296;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.topbar nav {
  align-items: center;
  gap: 4px;
}

.topbar nav a {
  padding: 8px 10px;
  border-radius: 5px;
  font-weight: 750;
}

.topbar nav a:hover {
  background: #edf4fb;
  color: #1f5f9f;
}

main {
  padding-top: 28px;
}

@media (max-width: 760px) {
  .topbar {
    align-items: flex-start;
    gap: 12px;
  }

  .topbar nav {
    flex-wrap: wrap;
    justify-content: flex-end;
  }

  .brand-ko { font-size: 16px; }
  .brand-en { font-size: 10px; }
}

.admin-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.admin-actions form { margin: 0; }

.admin-actions button {
  min-height: 36px;
  padding: 0 12px;
}

.order-button {
  color: var(--ink);
  background: #f6f8fb;
  border-color: #d6e0eb;
}

.order-button:disabled {
  cursor: not-allowed;
  opacity: 0.42;
}

@media (max-width: 760px) {
  .admin-actions {
    width: 100%;
  }

  .admin-actions form {
    flex: 1;
  }

  .admin-actions button {
    width: 100%;
  }
}

.upload-status {
  min-height: 22px;
  margin: 0;
  color: var(--muted);
  font-weight: 700;
}

/* Download is the primary PDF action for field operation. */
.card-actions .open-pdf,
.card-actions .open-pdf:visited,
.card-actions .open-pdf:hover,
.card-actions .open-pdf:focus {
  background: #fff !important;
  border-color: var(--line) !important;
  color: var(--ink) !important;
}

.card-actions .download-pdf,
.card-actions .download-pdf:visited,
.card-actions .download-pdf:hover,
.card-actions .download-pdf:focus {
  min-width: 96px;
  background: var(--blue) !important;
  border-color: var(--blue) !important;
  color: #fff !important;
}
