/* csh.css */

:root {
  --bg: #f9fafb;
  --bg2: #ffffff;
  --text: #111827;
  --muted: #6b7280;
  --card: #ffffff;
  --border: #d1d5db;
  --accent: #2563eb;
  --accent-soft: #1d4ed8;
}

body.dark {
  --bg: #020617;
  --bg2: #0f172a;
  --text: #e5e7eb;
  --muted: #9ca3af;
  --card: #0b1220;
  --border: #1f2937;
  --accent: #3b82f6;
  --accent-soft: #1d4ed8;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
  transition: background .25s, color .25s;
}

.wrap {
  max-width: 720px;
  margin: 0 auto;
  padding: 20px 16px 40px;
  position: relative;
}

/* 모드 버튼 */
#modeToggle {
  position: absolute;
  right: 16px;
  top: 16px;
  padding: 6px 10px;
  background: var(--card);
  border-radius: 8px;
  border: 1px solid var(--border);
  cursor: pointer;
  font-size: 12px;
  color: var(--text);
}

/* 로고 */
.logo {
  font-size: 26px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-align: center;
  margin-bottom: 4px;
}
.logo span.mark {
  color: var(--accent);
}
.logo-sub {
  text-align: center;
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 14px;
}

/* 상단 제목/설명 */
h1 {
  text-align: center;
  font-size: 18px;
  margin: 4px 0 8px;
  color: var(--text);
}

.subtitle {
  text-align: center;
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 18px;
  line-height: 1.5;
}

.section-title {
  font-size: 15px;
  margin: 18px 0 6px;
  font-weight: 700;
}

.section-caption {
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 10px;
  line-height: 1.5;
}

/* 페이지 간 이동 링크 */
.nav-link {
  display: block;
  width: 100%;
  text-align: center;
  padding: 12px;
  margin: 0 auto 18px;
  background: linear-gradient(135deg, var(--accent), var(--accent-soft));
  color: #fff;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

.nav-link:hover {
  opacity: 0.96;
}

/* 카드 공통 */
.card {
  background: var(--card);
  border-radius: 12px;
  padding: 14px 14px 16px;
  border: 1px solid var(--border);
  box-shadow: 0 2px 8px rgba(0,0,0,0.05);
  margin-bottom: 14px;
}

.card h2 {
  font-size: 15px;
  margin: 0 0 6px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.badge {
  font-size: 10px;
  padding: 2px 6px;
  border-radius: 999px;
  border: 1px solid rgba(37, 99, 235, 0.4);
  color: var(--accent-soft);
  background: rgba(37, 99, 235, 0.1);
}

.desc {
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 6px;
  line-height: 1.5;
}

/* 폼 요소 */
label {
  display: block;
  margin-top: 8px;
  font-size: 13px;
  font-weight: 600;
}

input,
textarea,
select {
  width: 100%;
  margin-top: 3px;
  padding: 7px 10px;
  font-size: 14px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg2);
  color: var(--text);
  outline: none;
}

input:focus,
textarea:focus,
select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px rgba(37,99,235,0.25);
}

textarea {
  resize: vertical;
  min-height: 80px;
}

/* 버튼 */
button {
  margin-top: 10px;
  padding: 8px 13px;
  font-size: 13px;
  font-weight: 600;
  border-radius: 999px;
  border: none;
  background: linear-gradient(135deg, var(--accent), var(--accent-soft));
  color: #fff;
  cursor: pointer;
}

button:active {
  transform: translateY(1px);
}

/* 결과 박스 */
.result {
  margin-top: 9px;
  padding: 9px 10px;
  border-radius: 8px;
  background: var(--bg2);
  border: 1px solid var(--border);
  line-height: 1.6;
  font-size: 13px;
}

/* 처음에는 숨기고 싶은 경우 JS에서 display 제어 */
.result.hidden {
  display: none;
}

/* 그리드 */
.grid-2 {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
}

/* 양쪽 동일 비율 (index 계산기 등) */
.grid-2.equal {
  /* mobile: 1열, desktop: 2열 */
}
@media (min-width: 800px) {
  .grid-2.equal {
    grid-template-columns: 1fr 1fr;
  }
}

/* 좌우 1.3 : 1 비율 (case 입력/결과) */
.grid-2.two-wide {
  /* mobile: 1열 */
}
@media (min-width: 800px) {
  .grid-2.two-wide {
    grid-template-columns: 1.3fr 1fr;
  }
}

/* 리스트, 푸터 */
ul {
  padding-left: 18px;
  margin: 4px 0 0;
  font-size: 12px;
  color: var(--muted);
}

footer {
  margin-top: 18px;
  font-size: 11px;
  color: var(--muted);
  text-align: center;
  line-height: 1.5;
}
