* {
  box-sizing: border-box;
}

body {
  margin: 0;
  padding: 0;
  font-family: "Malgun Gothic", "Apple SD Gothic Neo", sans-serif;
  color: #222;
  background: #fafafa;
}

a {
  color: #036;
}

/* ---- 인증 페이지 (방문자 / 관리자 로그인) ---- */
.auth-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.auth-box {
  width: 100%;
  max-width: 360px;
  background: #fff;
  border: 1px solid #ddd;
  border-radius: 10px;
  padding: 28px 24px;
  text-align: center;
}

.auth-box h1 {
  font-size: 1.3rem;
  margin: 0 0 8px;
  color: #036;
}

.hint {
  color: #666;
  font-size: 0.9rem;
  margin-bottom: 18px;
}

.auth-box form {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.auth-box input[type="text"],
.auth-box input[type="password"] {
  padding: 12px;
  font-size: 1rem;
  border: 1px solid #ccc;
  border-radius: 6px;
  width: 100%;
}

.error {
  color: #c0392b;
  font-size: 0.9rem;
  margin-bottom: 10px;
}

.back-link {
  margin-top: 16px;
  font-size: 0.9rem;
}

/* ---- 상단바 ---- */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  background: #036;
  color: #fff;
}

.topbar-title {
  color: #fff;
  font-weight: bold;
  text-decoration: none;
  font-size: 1.05rem;
}

.logout-link {
  color: #cfe0f0;
  text-decoration: none;
  font-size: 0.9rem;
}

/* ---- 목록/검색 페이지 ---- */
.browse-page {
  max-width: 720px;
  margin: 0 auto;
  padding: 16px;
}

.search-form {
  display: flex;
  gap: 8px;
  margin-bottom: 20px;
}

.search-form input[type="text"] {
  flex: 1;
  padding: 10px 12px;
  font-size: 1rem;
  border: 1px solid #ccc;
  border-radius: 6px;
  min-width: 0;
}

.section-title {
  font-size: 1.05rem;
  color: #036;
  margin: 18px 0 10px;
}

.fs-toolbar {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.fs-nav-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  background: #fff;
  border: 1px solid #ccc;
  border-radius: 6px;
  color: #036;
  font-size: 1.05rem;
  text-decoration: none;
  cursor: pointer;
}

.fs-nav-btn:hover {
  background: #f0f4f6;
  border-color: #036;
}

.fs-nav-btn.disabled {
  color: #ccc;
  border-color: #eee;
  cursor: not-allowed;
  pointer-events: none;
}

.fs-current-folder {
  font-weight: bold;
  color: #036;
  margin-left: 6px;
  word-break: break-all;
}

.empty {
  color: #888;
  padding: 20px 0;
}

.item-list {
  list-style: none;
  margin: 0 0 16px;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px;
  background: #fff;
  border: 1px solid #e2e2e2;
  border-radius: 8px;
  flex-wrap: wrap;
}

.item-info {
  min-width: 0;
  flex: 1;
}

.item-name {
  font-weight: bold;
  word-break: break-all;
}

.item-link {
  display: block;
  text-decoration: none;
  color: inherit;
  cursor: pointer;
}

.item-link:hover .item-name {
  color: #036;
}

.item-meta {
  font-size: 0.82rem;
  color: #777;
  margin-top: 2px;
}

.item-desc {
  font-size: 0.85rem;
  color: #555;
  margin-top: 4px;
}

.btn {
  display: inline-block;
  padding: 10px 16px;
  min-height: 40px;
  line-height: 20px;
  background: #036;
  color: #fff !important;
  text-decoration: none;
  border: none;
  border-radius: 6px;
  font-weight: bold;
  text-align: center;
  white-space: nowrap;
  cursor: pointer;
  font-size: 0.95rem;
}

.btn:hover {
  background: #024;
}

.btn-secondary {
  background: #567;
}

.btn-secondary:hover {
  background: #456;
}

.btn-danger {
  background: #b0392b;
}

.btn-danger:hover {
  background: #922;
}

/* ---- 관리자 페이지: 폴더 생성 + 업로드 ---- */
.fs-inline-form {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.fs-inline-form input[type="text"] {
  flex: 1;
  min-width: 160px;
  padding: 10px 12px;
  font-size: 0.95rem;
  border: 1px solid #ccc;
  border-radius: 6px;
}

.fs-dropzone {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  border: 2px dashed #99b;
  border-radius: 8px;
  padding: 28px 16px;
  text-align: center;
  color: #567;
  background: #f7f9fb;
  cursor: pointer;
  margin-bottom: 20px;
  font-size: 0.95rem;
}

.fs-dropzone p {
  margin: 0;
}

.fs-dropzone-buttons {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: center;
}

.fs-dropzone:hover,
.fs-dropzone.dragover {
  background: #eaf1f7;
  border-color: #036;
  color: #036;
}

.fs-dropzone.uploading {
  cursor: default;
  opacity: 0.85;
}

.fs-upload-progress {
  margin: -12px 0 20px;
}

.fs-upload-progress-track {
  height: 10px;
  background: #e2e2e2;
  border-radius: 6px;
  overflow: hidden;
}

.fs-upload-progress-bar {
  height: 100%;
  width: 0%;
  background: #036;
  transition: width 0.15s ease;
}

.fs-upload-progress-text {
  margin-top: 6px;
  font-size: 0.85rem;
  color: #567;
  text-align: center;
}

@media (min-width: 600px) {
  .browse-page {
    padding: 24px;
  }
}
