* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background-color: #f4f6f9;
  color: #333;
}

/* 헤더 */
.header {
  background-color: #00a495;
  color: white;
  padding: 1rem 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

.logo-area {
  display: flex;
  align-items: center;
  gap: 8px;
}

.logo-area h1 {
  font-size: 1.5rem;
  cursor: pointer;
}

.site-name-btn {
  background: transparent;
  border: none;
  color: white;
  font-size: 0.8rem;
  cursor: pointer;
  opacity: 0.7;
}

.create-btn {
  background-color: rgba(255, 255, 255, 0.2);
  color: white;
  border: 1px solid rgba(255, 255, 255, 0.5);
  padding: 5px 10px;
  border-radius: 4px;
  font-size: 0.85rem;
  font-weight: bold;
  cursor: pointer;
  margin-left: 5px;
}

.search-box {
  display: flex;
  gap: 5px;
}

.search-box input {
  padding: 6px 12px;
  border: none;
  border-radius: 4px;
  outline: none;
}

.search-box button {
  padding: 6px 12px;
  background-color: #00796b;
  color: white;
  border: none;
  border-radius: 4px;
  cursor: pointer;
}

/* 메인 레이아웃 (좌측 목록 + 우측 문서) */
.container {
  max-width: 1000px;
  margin: 20px auto;
  padding: 0 15px;
  display: flex;
  gap: 20px;
}

/* 사이드바 문서 목록 */
.sidebar {
  width: 220px;
  background: white;
  border-radius: 8px;
  padding: 15px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
  flex-shrink: 0;
  max-height: 80vh;
  overflow-y: auto;
}

.sidebar h3 {
  font-size: 1rem;
  color: #00a495;
  border-bottom: 2px solid #00a495;
  padding-bottom: 8px;
  margin-bottom: 10px;
}

.sidebar ul {
  list-style: none;
}

.sidebar li {
  padding: 8px 10px;
  margin-bottom: 4px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.95rem;
  word-break: break-all;
}

.sidebar li:hover {
  background-color: #e6f6f4;
  color: #00a495;
}

.sidebar li.active {
  background-color: #00a495;
  color: white;
  font-weight: bold;
}

/* 본문 영역 */
.wiki-card {
  flex-grow: 1;
  background: white;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
  padding: 20px;
}

.wiki-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 2px solid #00a495;
  padding-bottom: 10px;
  margin-bottom: 20px;
  flex-wrap: wrap;
  gap: 10px;
}

.title-area {
  display: flex;
  align-items: center;
  gap: 8px;
}

.rename-btn, .delete-btn {
  background-color: #f0f0f0;
  border: 1px solid #ccc;
  color: #555;
  padding: 3px 6px;
  border-radius: 4px;
  font-size: 0.75rem;
  cursor: pointer;
}

.delete-btn:hover {
  background-color: #ffebee;
  color: #d32f2f;
  border-color: #ffcdd2;
}

.actions .btn {
  padding: 6px 14px;
  border: 1px solid #00a495;
  background: white;
  color: #00a495;
  border-radius: 4px;
  cursor: pointer;
  margin-left: 5px;
}

.actions .btn.active {
  background: #00a495;
  color: white;
}

/* 탭 전환 */
.tab-content {
  display: none;
}

.tab-content.active {
  display: block;
}

.content-area {
  line-height: 1.7;
  font-size: 1.05rem;
  min-height: 200px;
  white-space: pre-wrap;
}

.wiki-link {
  color: #00a495;
  font-weight: bold;
  text-decoration: none;
  border-bottom: 1px dashed #00a495;
}

textarea {
  width: 100%;
  height: 250px;
  padding: 12px;
  border: 1px solid #ccc;
  border-radius: 4px;
  font-size: 1rem;
  resize: vertical;
  margin-bottom: 10px;
  outline: none;
}

.save-btn {
  background: #00a495;
  color: white;
  border: none;
  padding: 10px 20px;
  border-radius: 4px;
  cursor: pointer;
}

/* 모바일 화면 대응 */
@media (max-width: 600px) {
  .container {
    flex-direction: column;
  }
  .sidebar {
    width: 100%;
    max-height: 150px;
  }
}
