/* 독서 사고 흐름 수집 시스템 — 메인 스타일. 모바일 우선. */

* { box-sizing: border-box; }

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Noto Sans KR', sans-serif;
    margin: 0; padding: 0; color: #222; background: #fafafa; line-height: 1.6;
}

.container { max-width: 960px; margin: 0 auto; padding: 1rem; }

h1 { font-size: 1.6rem; margin: 0.5rem 0; }
h2 { font-size: 1.2rem; margin: 1.5rem 0 0.5rem; color: #333; }

/* admin header */
.admin-header {
    display: flex; align-items: center; justify-content: space-between;
    border-bottom: 1px solid #ddd; padding-bottom: 0.5rem; margin-bottom: 1rem;
}
.admin-header .back { color: #555; text-decoration: none; font-size: 0.9rem; }
.admin-header .back:hover { text-decoration: underline; }

/* nav */
.admin-nav { margin: 1rem 0; }
.admin-nav a {
    display: inline-block; margin-right: 1rem; padding: 0.4rem 0.8rem;
    background: #2563eb; color: white; text-decoration: none; border-radius: 4px;
}
.admin-nav a:hover { background: #1d4ed8; }

/* flash messages */
.flash {
    padding: 0.6rem 1rem; margin: 0.5rem 0; border-radius: 4px; font-size: 0.95rem;
}
.flash-success { background: #ecfdf5; color: #065f46; border: 1px solid #6ee7b7; }
.flash-error { background: #fef2f2; color: #991b1b; border: 1px solid #fca5a5; }
.flash-message { background: #f0f9ff; color: #075985; border: 1px solid #93c5fd; }

/* form */
.form { display: flex; flex-direction: column; gap: 0.6rem; max-width: 720px; }
.form label { font-weight: 600; margin-top: 0.5rem; }
.form .req { color: #dc2626; }
.form .hint { font-size: 0.88rem; color: #555; margin: 0; }
.form input[type=text], .form input[type=password], .form select, .form textarea {
    padding: 0.5rem; border: 1px solid #cbd5e1; border-radius: 4px;
    font-size: 1rem; font-family: inherit;
}
.form textarea { resize: vertical; min-height: 120px; }
.form button {
    padding: 0.6rem 1.2rem; background: #2563eb; color: white;
    border: none; border-radius: 4px; font-size: 1rem; cursor: pointer;
    align-self: flex-start; margin-top: 0.5rem;
}
.form button:hover { background: #1d4ed8; }
.form button.primary { background: #16a34a; }
.form button.primary:hover { background: #15803d; }
.form button.link {
    background: transparent; color: #555; padding: 0; text-decoration: underline;
}
.inline { display: inline; }

/* 텍스트형 버튼 (로그아웃·삭제 등) */
button.link, .link {
    background: transparent; border: none; color: #2563eb;
    padding: 0; cursor: pointer; text-decoration: underline; font-size: inherit;
}
button.link.danger, .link.danger { color: #dc2626; }

/* tables */
table { width: 100%; border-collapse: collapse; margin: 1rem 0; }
th, td { padding: 0.5rem 0.6rem; border-bottom: 1px solid #e5e7eb; text-align: left; vertical-align: top; }
th { background: #f3f4f6; font-weight: 600; }

table.sentences td:first-child { width: 3rem; text-align: center; color: #6b7280; }
table.sentences td:nth-child(2) { width: 3rem; text-align: center; color: #6b7280; }
table.sentences td:last-child { width: 3rem; text-align: center; }
table.sentences textarea { width: 100%; border: 1px solid #cbd5e1; border-radius: 4px; padding: 0.4rem; font-family: inherit; font-size: 0.95rem; }

/* lists */
.passages, .sessions { list-style: none; padding: 0; }
.passages li, .sessions li {
    padding: 0.6rem 0; border-bottom: 1px solid #e5e7eb;
}
.passages li a, .sessions li a { color: #2563eb; text-decoration: none; font-weight: 500; }
.passages li a:hover { text-decoration: underline; }
.meta { font-size: 0.85rem; color: #6b7280; margin-left: 0.5rem; }

code { background: #f3f4f6; padding: 0.1rem 0.3rem; border-radius: 3px; font-size: 0.9rem; }

/* 세션 모니터 진척도 바 */
.progress {
    display: inline-block; width: 120px; height: 8px;
    background: #e5e7eb; border-radius: 4px; vertical-align: middle;
    overflow: hidden; margin-right: 0.4rem;
}
.progress-bar {
    height: 100%; background: #16a34a; border-radius: 4px;
    transition: width 0.3s;
}

/* read 페이지 추가 (T피드백) */
.progress-text .para-info { color: #9ca3af; font-size: 0.85rem; margin-left: 0.3rem; }
.optional { color: #9ca3af; font-size: 0.85rem; font-weight: normal; }
.unknown-input {
    width: 100%; padding: 0.5rem 0.7rem; border: 1px solid #cbd5e1;
    border-radius: 4px; font-size: 0.95rem; font-family: inherit;
    margin-bottom: 0.5rem;
}
.unknown-input:focus { border-color: #2563eb; outline: 2px solid #bfdbfe; }

/* 분석 페이지 */
.progress-table th { width: 200px; }
pre.cmd {
    background: #1f2937; color: #f9fafb; padding: 0.8rem 1rem;
    border-radius: 4px; font-family: 'Consolas', monospace; overflow-x: auto;
}
ol.howto, ol.steps { padding-left: 1.5rem; }
ol.howto li, ol.steps li { margin: 0.4rem 0; }

/* 인쇄 버튼 */
.link-button {
    padding: 0.4rem 1rem; background: #2563eb; color: white;
    border: none; border-radius: 4px; cursor: pointer; font-size: 0.95rem;
}
.link-button:hover { background: #1d4ed8; }

/* 학생 화면 */
.student-screen { max-width: 640px; margin: 0 auto; padding: 1rem; }
.student-screen h1 { font-size: 1.5rem; margin: 1rem 0; }
.student-screen p { font-size: 1.05rem; }
.student-screen .lead { font-size: 1.15rem; color: #111; }
.student-screen .step-indicator {
    color: #6b7280; font-size: 0.95rem; margin: 0 0 0.5rem;
}
.student-screen .error-message {
    background: #fef2f2; border: 1px solid #fca5a5; color: #991b1b;
    padding: 0.8rem; border-radius: 6px;
}

.intro-box {
    background: #f9fafb; border-left: 4px solid #2563eb;
    padding: 1rem 1.2rem; margin: 1rem 0; border-radius: 4px;
}
.intro-box p { margin: 0.4rem 0; }
.intro-box .warn { color: #b91c1c; font-weight: 600; }

.sentence-box {
    background: #f3f4f6; border-radius: 6px; padding: 1.2rem;
    font-size: 1.15rem; line-height: 1.7; margin: 1rem 0;
}

button.big { font-size: 1.1rem; padding: 0.8rem 1.5rem; }

/* 설문 fieldset */
.form fieldset {
    border: 1px solid #e5e7eb; border-radius: 4px;
    padding: 0.8rem 1rem; margin: 0.6rem 0;
}
.form legend { font-weight: 600; padding: 0 0.4rem; color: #111; }
.form .radio {
    display: inline-block; margin-right: 0.8rem; font-weight: normal;
    cursor: pointer; padding: 0.2rem 0;
}
.form .radio input { margin-right: 0.3rem; }
