/* AI 글짓기 연습 스타일 — calculator 계열(블루 팔레트)과 톤 일치, 모바일 우선 반응형 */
* { margin: 0; padding: 0; box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Malgun Gothic', sans-serif;
  background: #f5f7fa;
  color: #2c3e50;
  line-height: 1.6;
  padding-bottom: 130px;
  overflow-x: hidden;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 8px;
  background: #2c3e50;
  color: #fff;
  padding: 8px 14px;
  border-radius: 6px;
  z-index: 1000;
  text-decoration: none;
}
.skip-link:focus { left: 12px; }

/* ---- 상단 헤더 ---- */
.site-header {
  background: linear-gradient(135deg, #2C3E50, #3498DB);
  color: #fff;
  padding: 24px 16px 36px;
  text-align: center;
}
.site-header .eyebrow {
  font-size: 12px;
  letter-spacing: 0.04em;
  opacity: 0.85;
  margin-bottom: 4px;
}
.site-header h1 {
  font-size: 25px;
  font-weight: 800;
  margin-bottom: 8px;
}
.site-header .subtitle {
  font-size: 14px;
  opacity: 0.94;
  max-width: 640px;
  margin: 0 auto;
}
.site-header nav {
  margin-top: 14px;
  font-size: 13px;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px 14px;
}
.site-header nav a {
  color: #d6eaf8;
  text-decoration: none;
}
.site-header nav a:hover { text-decoration: underline; }

/* ---- 컨테이너 및 공통 섹션 ---- */
.container {
  max-width: 880px;
  margin: 0 auto;
  padding: 18px 14px;
}

.section-title {
  font-size: 18px;
  font-weight: 700;
  color: #2C3E50;
  border-left: 4px solid #3498DB;
  padding-left: 12px;
  margin: 28px 0 12px;
}

.panel-card {
  background: #fff;
  border-radius: 12px;
  padding: 18px 16px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.07);
  margin-bottom: 16px;
  border: 1px solid #e5ebf0;
}
.panel-card--hero {
  margin-top: -28px;
}

/* ---- 4단계 학습 안내 배너 ---- */
.step-guide {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  list-style: none;
  margin-bottom: 4px;
}
.step-guide li {
  background: #f0f6fc;
  color: #2c3e50;
  border: 1px solid #cfe3f5;
  border-radius: 8px;
  padding: 9px 10px;
  font-size: 13px;
  font-weight: 600;
  text-align: center;
}
.step-guide li.is-active {
  background: #3498DB;
  color: #fff;
  border-color: #2980B9;
}
.step-guide li.is-done {
  background: #eafaf1;
  color: #1e8449;
  border-color: #a9dfbf;
}

/* ---- 수준·주제·방식 선택 ---- */
.config-group {
  margin-top: 16px;
}
.config-group-label {
  display: block;
  font-size: 14px;
  font-weight: 700;
  color: #2C3E50;
  margin-bottom: 8px;
}

.level-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}
.level-card {
  position: relative;
  display: block;
  border: 2px solid #dfe7ed;
  border-radius: 10px;
  padding: 12px 14px;
  cursor: pointer;
  background: #fafcfe;
  transition: border-color 0.15s, background 0.15s;
}
.level-card:hover {
  border-color: #85c1e9;
}
.level-card input[type="radio"] {
  margin-right: 6px;
  accent-color: #3498DB;
}
.level-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}
.level-card-title {
  font-size: 15px;
  font-weight: 700;
  color: #2C3E50;
}
.level-card-range {
  font-size: 12px;
  color: #2980B9;
  background: #ebf5fb;
  padding: 2px 8px;
  border-radius: 12px;
  font-weight: 600;
}
.level-card ul {
  padding-left: 18px;
  font-size: 12.5px;
  color: #555;
}
.level-card li { margin: 2px 0; }

.config-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
  margin-top: 14px;
}

.select-input,
.text-input {
  width: 100%;
  font-size: 15px;
  padding: 10px 12px;
  border: 1.5px solid #cbd6e0;
  border-radius: 8px;
  background: #fff;
  color: #2c3e50;
  font-family: inherit;
}
.select-input:focus,
.text-input:focus,
.textarea-input:focus {
  outline: none;
  border-color: #3498DB;
  box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.16);
}

.mode-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
}
.mode-option {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 12px;
  border: 1px solid #d8e2ea;
  border-radius: 8px;
  background: #fafcfe;
  font-size: 13.5px;
  cursor: pointer;
}
.mode-option input[type="radio"] {
  accent-color: #3498DB;
}

/* ---- 버튼 공통 ---- */
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-family: inherit;
  font-size: 14px;
  font-weight: 700;
  padding: 10px 16px;
  min-height: 44px;
  border-radius: 8px;
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.15s, border-color 0.15s;
}
.button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}
.button.primary {
  background: #3498DB;
  color: #fff;
}
.button.primary:hover:not(:disabled) {
  background: #2980B9;
}
.button.secondary {
  background: #ebf5fb;
  color: #2980B9;
  border-color: #aed6f1;
}
.button.secondary:hover:not(:disabled) {
  background: #d6eaf8;
}
.button.ghost {
  background: #fff;
  color: #2c3e50;
  border-color: #cbd6e0;
}
.button.ghost:hover:not(:disabled) {
  background: #f4f7f9;
}
.button.danger {
  background: #fdedec;
  color: #c0392b;
  border-color: #f5b7b1;
}
.button.danger:hover:not(:disabled) {
  background: #fadbd8;
}
.button.small {
  min-height: 36px;
  padding: 6px 12px;
  font-size: 13px;
}

/* ---- 5. AI 출제 문제 카드 ---- */
.prompt-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 12px;
}
.prompt-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 14px;
  font-size: 12px;
  font-weight: 700;
  background: #ebf5fb;
  color: #2980B9;
}
.badge--accent {
  background: #2C3E50;
  color: #fff;
}

.prompt-topic-box {
  background: #f8fbfe;
  border-left: 4px solid #3498DB;
  border-radius: 8px;
  padding: 14px;
  margin-bottom: 14px;
}
.prompt-topic-label {
  font-size: 12px;
  font-weight: 700;
  color: #2980B9;
  margin-bottom: 4px;
}
.prompt-topic-title {
  font-size: 18px;
  font-weight: 800;
  color: #2C3E50;
  margin-bottom: 6px;
  overflow-wrap: anywhere;
}
.prompt-background {
  font-size: 14px;
  color: #445566;
}

.prompt-details-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  margin-bottom: 12px;
}
.prompt-subbox {
  background: #fafbfc;
  border: 1px solid #e5ebf0;
  border-radius: 8px;
  padding: 12px 14px;
}
.prompt-subbox h3 {
  font-size: 14px;
  color: #2C3E50;
  margin-bottom: 6px;
}
.prompt-subbox ol,
.prompt-subbox ul {
  padding-left: 18px;
  font-size: 13.5px;
  color: #3d4f60;
}
.prompt-subbox li { margin: 4px 0; }

.prompt-mission-bar {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  background: #fef9e7;
  border: 1px solid #f9e79f;
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 13.5px;
  color: #7d6608;
  margin-bottom: 12px;
}

.keywords-wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 6px;
}
.keyword-chip {
  border: 1px solid #aed6f1;
  background: #ebf5fb;
  color: #2980B9;
  border-radius: 16px;
  padding: 5px 12px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}
.keyword-chip:hover { background: #d6eaf8; }
.keyword-chip.is-used {
  background: #1e8449;
  border-color: #1e8449;
  color: #fff;
}

.example-box {
  background: #f4f9f5;
  border: 1px solid #c8e6c9;
  border-radius: 8px;
  padding: 12px 14px;
  margin-top: 10px;
  font-size: 13.5px;
  color: #2e5136;
}
.example-box h3 {
  font-size: 14px;
  margin-bottom: 4px;
  color: #1e8449;
}

/* ---- 6. 글쓰기 편집 영역 ---- */
.field-block {
  margin-bottom: 12px;
}
.field-block label {
  display: block;
  font-size: 14px;
  font-weight: 700;
  color: #2C3E50;
  margin-bottom: 6px;
}
.field-hint {
  font-size: 12px;
  color: #6c7a89;
  font-weight: 400;
  margin-left: 6px;
}

.textarea-input {
  width: 100%;
  font-family: inherit;
  font-size: 15.5px;
  line-height: 1.75;
  padding: 12px 14px;
  border: 1.5px solid #cbd6e0;
  border-radius: 10px;
  resize: vertical;
  color: #2c3e50;
  background: #fff;
}
.textarea-input--notes {
  min-height: 76px;
  font-size: 14px;
  background: #fcfdfe;
}
.textarea-input--main {
  min-height: 220px;
}

.editor-meter {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 10px 12px;
  margin-bottom: 12px;
}
.editor-stats-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px;
  font-size: 13px;
  color: #445566;
  margin-bottom: 6px;
}
.editor-stats-row strong {
  color: #2980B9;
}
.length-progress-track {
  width: 100%;
  height: 8px;
  background: #e2e8f0;
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 6px;
}
.length-progress-fill {
  height: 100%;
  width: 0%;
  background: #3498DB;
  transition: width 0.2s ease;
}
.length-progress-fill.is-good {
  background: #1e8449;
}
.length-guide-text {
  font-size: 12.5px;
  color: #556677;
}

.editor-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}
.editor-actions .button.primary {
  flex: 1 1 200px;
}

.editor-status {
  min-height: 22px;
  font-size: 13.5px;
  margin-top: 10px;
  font-weight: 600;
}
.editor-status.is-ok { color: #1e8449; }
.editor-status.is-error { color: #c0392b; }

.preview-panel {
  margin-top: 14px;
  background: #fcfdfe;
  border: 1.5px solid #3498DB;
  border-radius: 10px;
  padding: 14px 16px;
}
.preview-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}
.preview-meta {
  font-size: 12.5px;
  color: #667788;
  margin-bottom: 8px;
}
.preview-body {
  white-space: pre-wrap;
  word-break: break-word;
  background: #fff;
  border: 1px solid #e5ebf0;
  border-radius: 8px;
  padding: 12px;
  font-size: 15px;
  line-height: 1.75;
}

/* ---- 8. AI 평가 결과 화면 (8개 카드 순서) ---- */
.result-card {
  background: #fff;
  border-radius: 12px;
  padding: 18px 16px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.06);
  margin-bottom: 14px;
  border: 1px solid #e5ebf0;
}
.result-card-kicker {
  font-size: 12px;
  font-weight: 700;
  color: #2980B9;
  margin-bottom: 4px;
}
.result-card h3 {
  font-size: 17px;
  color: #2C3E50;
  margin-bottom: 10px;
}

.score-summary-box {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: linear-gradient(135deg, #f4f9fd, #ebf5fb);
  border: 1px solid #cbe3f6;
  border-radius: 10px;
  padding: 16px;
}
.total-score-number {
  font-size: 28px;
  font-weight: 800;
  color: #2C3E50;
}
.total-score-grade {
  display: inline-block;
  margin-left: 8px;
  padding: 4px 12px;
  border-radius: 16px;
  background: #3498DB;
  color: #fff;
  font-size: 14px;
  font-weight: 700;
}
.score-completeness {
  font-size: 14px;
  color: #34495e;
  margin-top: 6px;
}

.score-bar-row {
  margin-bottom: 10px;
}
.score-bar-head {
  display: flex;
  justify-content: space-between;
  font-size: 13.5px;
  margin-bottom: 4px;
}
.score-bar-track {
  width: 100%;
  height: 10px;
  background: #edf2f7;
  border-radius: 5px;
  overflow: hidden;
}
.score-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #3498DB, #2980B9);
  border-radius: 5px;
}

.detail-eval-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  margin-top: 12px;
}
.detail-eval-card {
  background: #fafcfe;
  border: 1px solid #e1e9f0;
  border-radius: 8px;
  padding: 12px 14px;
}
.detail-eval-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}
.detail-eval-top h4 {
  font-size: 15px;
  color: #2C3E50;
}
.detail-score-pill {
  background: #ebf5fb;
  color: #2980B9;
  font-weight: 700;
  font-size: 12.5px;
  padding: 2px 10px;
  border-radius: 12px;
}
.detail-eval-dl dt {
  font-size: 12px;
  font-weight: 700;
  color: #556677;
  margin-top: 6px;
}
.detail-eval-dl dd {
  font-size: 13.5px;
  color: #2c3e50;
  margin-left: 0;
}

.feedback-list {
  padding-left: 20px;
  font-size: 14px;
}
.feedback-list li {
  margin: 6px 0;
}
.result-card--good {
  border-left: 4px solid #1e8449;
}
.result-card--improve {
  border-left: 4px solid #d68910;
}

/* ---- 문장별 첨삭 테이블 ---- */
.table-wrap {
  width: 100%;
  overflow-x: auto;
}
.correction-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
}
.correction-table th,
.correction-table td {
  border: 1px solid #dfe6ec;
  padding: 10px 12px;
  text-align: left;
  vertical-align: top;
  overflow-wrap: anywhere;
}
.correction-table th {
  background: #f2f7fb;
  color: #2C3E50;
  font-weight: 700;
}
.correction-table .cell-original {
  color: #666;
}
.correction-table .cell-improved {
  color: #1e8449;
  font-weight: 700;
  background: #f9fdfb;
}

@media (max-width: 600px) {
  .correction-table thead {
    display: none;
  }
  .correction-table,
  .correction-table tbody,
  .correction-table tr,
  .correction-table td {
    display: block;
    width: 100%;
  }
  .correction-table tr {
    margin-bottom: 10px;
    border: 1px solid #d5e0ea;
    border-radius: 8px;
    overflow: hidden;
  }
  .correction-table td {
    border: none;
    border-bottom: 1px solid #eef2f6;
  }
  .correction-table td::before {
    content: attr(data-label);
    display: block;
    font-size: 11.5px;
    font-weight: 700;
    color: #2980B9;
    margin-bottom: 2px;
  }
}

/* ---- 원본 vs 모범 답안 비교 ---- */
.compare-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}
.compare-box {
  background: #f8fafc;
  border: 1px solid #dfe7ef;
  border-radius: 8px;
  padding: 12px 14px;
}
.compare-box--model {
  background: #f4fbf7;
  border-color: #b7e1c7;
}
.compare-box h4 {
  font-size: 14px;
  color: #2C3E50;
  margin-bottom: 6px;
}
.compare-text {
  white-space: pre-wrap;
  word-break: break-word;
  font-size: 14.5px;
  line-height: 1.75;
  color: #2c3e50;
}

.next-guide-dl dt {
  font-size: 12.5px;
  font-weight: 700;
  color: #2980B9;
  margin-top: 8px;
}
.next-guide-dl dd {
  font-size: 14px;
  color: #2c3e50;
  margin-bottom: 6px;
}
.next-recommend-box {
  margin-top: 12px;
  background: #ebf5fb;
  border: 1px solid #aed6f1;
  border-radius: 8px;
  padding: 12px 14px;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}

/* ---- 9. 학습 기록 및 진도 통계 ---- */
.storage-notice {
  font-size: 12.5px;
  color: #556677;
  background: #f0f6fc;
  border: 1px solid #d4e6f1;
  border-radius: 8px;
  padding: 10px 12px;
  margin-bottom: 12px;
}
.stats-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin-bottom: 14px;
}
.stat-card {
  background: #fafcfe;
  border: 1px solid #e1e8f0;
  border-radius: 8px;
  padding: 10px 12px;
}
.stat-card span {
  display: block;
  font-size: 12px;
  color: #667788;
}
.stat-card strong {
  display: block;
  font-size: 15px;
  color: #2C3E50;
  margin-top: 2px;
  overflow-wrap: anywhere;
}
.stat-card--wide {
  grid-column: span 2;
}

.history-list {
  list-style: none;
}
.history-empty {
  font-size: 13.5px;
  color: #778899;
  padding: 12px 0;
}
.history-item {
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 12px 14px;
  margin-bottom: 8px;
  background: #fff;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}
.history-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 10px;
  font-size: 12px;
  color: #667788;
  margin-bottom: 4px;
}
.history-score {
  color: #2980B9;
}
.history-title {
  font-size: 14.5px;
  color: #2C3E50;
  margin-bottom: 2px;
}
.history-excerpt {
  font-size: 13px;
  color: #556677;
  overflow-wrap: anywhere;
}
.history-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

/* ---- 광고 영역 ---- */
.ad-wrap {
  margin: 18px 0;
  display: flex;
  justify-content: center;
  min-height: 0;
}

/* ---- 10. 하단 안내 및 FAQ ---- */
.info-card {
  background: #fff;
  border-radius: 10px;
  padding: 16px 18px;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
  margin-bottom: 12px;
  font-size: 14px;
  border: 1px solid #e6ecf1;
}
.info-card h3 {
  font-size: 15px;
  color: #2C3E50;
  margin-bottom: 6px;
}
.info-card ol,
.info-card ul {
  padding-left: 20px;
}
.info-card li {
  margin: 5px 0;
}
.faq-details {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 12px 14px;
  margin-bottom: 8px;
}
.faq-details summary {
  font-weight: 700;
  font-size: 14.5px;
  color: #2C3E50;
  cursor: pointer;
}
.faq-details p {
  margin-top: 8px;
  font-size: 13.5px;
  color: #445566;
}

.tools-nav {
  margin: 26px 0 8px;
  font-size: 14px;
}
.tools-nav h2 {
  font-size: 15px;
  color: #2C3E50;
  margin-bottom: 6px;
}
.tools-nav ul {
  padding-left: 20px;
}
.tools-nav li {
  margin: 4px 0;
}
.tools-nav a {
  color: #2980B9;
}

.site-footer {
  text-align: center;
  font-size: 12px;
  color: #778899;
  padding: 24px 16px 8px;
}
.site-footer a {
  color: #2980B9;
  text-decoration: none;
}

@media (min-width: 768px) {
  body { padding-bottom: 120px; }
  .step-guide { grid-template-columns: repeat(4, 1fr); }
  .level-grid { grid-template-columns: repeat(3, 1fr); }
  .config-row { grid-template-columns: 1fr 1fr; }
  .mode-grid { grid-template-columns: repeat(2, 1fr); }
  .prompt-details-grid { grid-template-columns: 1fr 1fr; }
  .detail-eval-grid { grid-template-columns: repeat(2, 1fr); }
  .compare-grid { grid-template-columns: 1fr 1fr; }
  .stats-grid { grid-template-columns: repeat(4, 1fr); }
}
