:root {
  --bg: #f6f7fb;
  --card: #ffffff;
  --line: #e6e8ef;
  --text: #111827;
  --muted: #6b7280;
  --brand: #d7a24a;
  --accent: #2563eb;
  --radius: 16px;
}

* {
  box-sizing: border-box;
}
body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans KR",
    sans-serif;
  /*background: var(--bg);*/
  color: var(--text);
}

/* 레이아웃 */
.container {
  max-width: var(--wrap);
  margin: 28px auto;
  padding: 0 16px 60px;
}
.page-title {
  margin: 6px 0 18px;
  text-align: center;
  font-size: 28px;
  font-weight: 900;
}

/* 카드 */
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 8px 30px rgba(17, 24, 39, 0.06);
  padding: 18px;
}

.topbar {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}

/* 검색 */
.search {
  display: flex;
  gap: 8px;
  align-items: center;
}
.search input {
  width: 320px;
  padding: 12px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  outline: none;
  background: #fff;
}
.search input:focus {
  border-color: rgba(37, 99, 235, 0.35);
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.1);
}
.search button {
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  cursor: pointer;
  transition: 0.15s ease;
}
.search button:hover {
  background: #f3f4f6;
  transform: translateY(-1px);
}

/* 버튼 */
.primary-btn {
  border: none;
  background: var(--accent);
  color: #fff;
  font-weight: 900;
  padding: 12px 14px;
  border-radius: 14px;
  cursor: pointer;
  transition: 0.15s ease;
}
.primary-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 24px rgba(37, 99, 235, 0.18);
}
.ghost-btn {
  border: 1px solid var(--line);
  background: #fff;
  color: #111;
  font-weight: 900;
  padding: 12px 14px;
  border-radius: 14px;
  cursor: pointer;
}

/* ✅ 리스트(아코디언 카드) */
.list {
  list-style: none;
  padding: 14px 0 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.item {
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fff;
  overflow: hidden;
  transition: 0.15s ease;
}
.item:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 24px rgba(17, 24, 39, 0.08);
  border-color: rgba(37, 99, 235, 0.25);
}

.item-head {
  width: 100%;
  border: none;
  background: transparent;
  cursor: pointer;
  padding: 14px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  text-align: left;
}

.left {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}
.badge {
  font-weight: 900;
  font-size: 12px;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(215, 162, 74, 0.15);
  color: #8a5a12;
  border: 1px solid rgba(215, 162, 74, 0.25);
  white-space: nowrap;
}
.title {
  font-weight: 900;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.meta {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
}

.state {
  font-weight: 900;
  font-size: 12px;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: #fff;
}
.state.wait {
  color: #b45309;
  border-color: rgba(180, 83, 9, 0.25);
  background: rgba(180, 83, 9, 0.08);
}
.state.done {
  color: #047857;
  border-color: rgba(4, 120, 87, 0.25);
  background: rgba(4, 120, 87, 0.08);
}

.chev {
  font-weight: 900;
  color: var(--muted);
  transition: transform 0.15s ease;
}

.item-body {
  display: none;
  padding: 0 14px 14px;
}
.item.open .item-body {
  display: block;
}
.item.open .chev {
  transform: rotate(180deg);
}

.section {
  border-top: 1px dashed var(--line);
  padding-top: 12px;
  margin-top: 8px;
}
.section-title {
  font-weight: 900;
  margin-bottom: 8px;
}
.text {
  color: #374151;
  line-height: 1.7;
  white-space: pre-wrap;
}

/* 페이지네이션 */
.paging {
  margin-top: 16px;
  display: flex;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
  user-select: none;
}
.page-btn {
  min-width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  cursor: pointer;
  font-weight: 900;
  color: #111;
  transition: 0.15s ease;
}
.page-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 18px rgba(17, 24, 39, 0.06);
}
.page-btn.active {
  background: rgba(37, 99, 235, 0.1);
  border-color: rgba(37, 99, 235, 0.25);
  color: var(--accent);
}

/* 모달 */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(17, 24, 39, 0.45);
  z-index: 50;
}
.modal {
  position: fixed;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: min(560px, calc(100% - 32px));
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: 0 20px 60px rgba(17, 24, 39, 0.2);
  z-index: 60;
}
.hidden {
  display: none;
}

.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 14px;
  border-bottom: 1px solid var(--line);
}
.modal-title {
  font-weight: 900;
}
.icon-btn {
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 12px;
  width: 36px;
  height: 36px;
  cursor: pointer;
}

.form {
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.label {
  font-weight: 900;
  font-size: 12px;
  color: var(--muted);
}

input[type="text"],
select,
textarea {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px;
  outline: none;
  font: inherit;
}
textarea {
  resize: vertical;
}

input[type="text"]:focus,
select:focus,
textarea:focus {
  border-color: rgba(37, 99, 235, 0.35);
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.1);
}

.check {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-weight: 700;
}

.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding-top: 6px;
}

@media (max-width: 520px) {
  .page-title {
    font-size: 22px;
  }
  .search input {
    width: 220px;
  }
}
.writer {
  font-weight: 900;
  color: #374151;
}

/* ✅ 첨부파일 UI */
.hint {
  font-size: 12px;
  color: var(--muted);
  font-weight: 700;
}

.file-preview {
  margin-top: 10px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}

.preview-item {
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
  background: #fff;
  padding: 8px;
}

.preview-thumb {
  width: 100%;
  aspect-ratio: 4/3;
  background: #f3f4f6;
  border-radius: 12px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.preview-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.preview-name {
  margin-top: 8px;
  font-size: 12px;
  color: #374151;
  font-weight: 800;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.preview-actions {
  margin-top: 8px;
  display: flex;
  justify-content: flex-end;
}

.small-btn {
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 12px;
  padding: 6px 10px;
  font-weight: 900;
  cursor: pointer;
}

.attach-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 6px;
}

.attach-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: #fff;
  font-size: 12px;
  font-weight: 900;
  color: #374151;
}

.attach-chip a {
  color: var(--accent);
  text-decoration: none;
  font-weight: 900;
}

.form-msg {
  font-size: 12px;
  font-weight: 900;
  color: #b91c1c;
  min-height: 16px;
}

@media (max-width: 520px) {
  .file-preview {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* ✅ 첨부파일 UI */
.hint {
  font-size: 12px;
  color: var(--muted);
  font-weight: 700;
}

.file-preview {
  margin-top: 10px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}

.preview-item {
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
  background: #fff;
  padding: 8px;
}

.preview-thumb {
  width: 100%;
  aspect-ratio: 4/3;
  background: #f3f4f6;
  border-radius: 12px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.preview-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.preview-name {
  margin-top: 8px;
  font-size: 12px;
  color: #374151;
  font-weight: 800;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.preview-actions {
  margin-top: 8px;
  display: flex;
  justify-content: flex-end;
}

.small-btn {
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 12px;
  padding: 6px 10px;
  font-weight: 900;
  cursor: pointer;
}

.attach-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 6px;
}

.attach-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: #fff;
  font-size: 12px;
  font-weight: 900;
  color: #374151;
}

.attach-chip a {
  color: var(--accent);
  text-decoration: none;
  font-weight: 900;
}

.form-msg {
  font-size: 12px;
  font-weight: 900;
  color: #b91c1c;
  min-height: 16px;
}

.writer {
  font-weight: 900;
  color: #374151;
}

/* ✅ 비공개 비밀번호 입력 영역 */
.secret-pass {
  border: 1px dashed var(--line);
  border-radius: 14px;
  padding: 12px;
  background: #fafafa;
}

@media (max-width: 520px) {
  .file-preview {
    grid-template-columns: repeat(2, 1fr);
  }
}
