/* =========================
   기본 레이아웃
========================= */
body {
    background: #f8fafc;
    color: #222;

    max-width: 900px;
    margin: 0 auto;
    padding: 40px;
}

h2 {
    margin-top: 30px;
    margin-bottom: 15px;
    font-size: 24px;
}

hr {
    margin: 40px 0;
    border: none;
    border-top: 1px solid #ddd;
}

/* =========================
   텍스트 영역
========================= */
textarea {
    font-family: 'Pretendard', sans-serif;
    font-size: 20px;
    font-weight: 500;
    line-height: 1.5;

    width: 100%;
    max-width: 800px;

    padding: 15px;

    border: 1px solid #d1d5db;
    border-radius: 10px;

    resize: vertical;
    background: white;
}

textarea:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 5px rgba(37,99,235,0.3);
}

/* =========================
   레이아웃 구조
========================= */
#container {
    display: flex;
    gap: 30px;
    align-items: flex-start;
}

#word1 {
    padding-top: 10px;
}

#word2 {
    position: relative;
}

/* =========================
   버튼 기본 스타일
========================= */
button {
    background: #2563eb;
    color: white;

    border: none;
    border-radius: 8px;

    padding: 10px 18px;
    margin-right: 8px;

    font-size: 15px;
    cursor: pointer;

    transition: 0.2s;
}

button:hover {
    background: #1d4ed8;
}

button:active {
    transform: scale(0.98);
}

button:disabled {
    opacity: .5;
    cursor: not-allowed;
}

/* =========================
   파일 업로드
========================= */
#audioFile {
    font-size: 15px;
    color: #333;
}

#audioFile::file-selector-button {
    background: #2563eb;
    color: white;

    border: none;
    border-radius: 8px;

    padding: 10px 18px;
    margin-right: 8px;

    font-size: 15px;
    cursor: pointer;

    transition: 0.2s;
}

#audioFile::file-selector-button:hover {
    background: #1d4ed8;
}

#audioFile::file-selector-button:active {
    transform: scale(0.97);
}

/* =========================
   고정 페이지 버튼 (안정화)
========================= */
#addPageBtn,
#removePageBtn {
    position: fixed;
    right: 20px;

    width: 50px;
    height: 50px;

    border: none;
    border-radius: 8px;
    padding-left: 16px;

    font-size: 15px;
    cursor: pointer;

    box-shadow: 0 3px 10px rgba(0,0,0,0.2);

    z-index: 1000;
    transition: 0.2s;
}

#addPageBtn {
    top: 50px;
    background: #2563eb;
    color: white;
}

#removePageBtn {
    top: 110px;
    background: #2563eb;
    color: white;
}

#addPageBtn:hover {
    background: #43a047;
    transform: scale(1.08);
}

#removePageBtn:hover {
    background: #dc2626;
    transform: scale(1.08);
}

/* =========================
   버튼 그룹
========================= */
#buttonRow {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 10px;
}

/* =========================
   오디오 UI
========================= */
#fileName {
    display: flex;
    align-items: center;
    gap: 10px;
}

#audioUI {
    display: flex;
    align-items: center;
}

/* =========================
   페이지 네비게이션
========================= */
#pageList {
    margin-top: 20px;
    text-align: center;
}

.pageNumber {
    display: inline-block;
    margin: 5px;
    padding: 6px 12px;

    border: 1px solid #2563eb;
    border-radius: 8px;

    cursor: pointer;
    color: #2563eb;
    font-weight: bold;
}

.pageNumber:hover {
    background: #2563eb;
    color: white;
}

.pageNumber.active {
    background: #2563eb;
    color: white;
}

/* =========================
   시스템 메시지
========================= */
#systemMessage {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);

    background: rgba(0,0,0,0.8);
    color: white;

    padding: 12px 20px;
    border-radius: 10px;

    display: none;
    z-index: 9999;
}

/* =========================
   텍스트 스타일
========================= */
input {
    font-size: 20px;
    font-weight: 600;
}

.count-text {
    font-size: 14px;
    font-weight: normal;
    color: #2196f3;
}

/* =========================
   제목 고정
========================= */
#memorization {
    position: fixed;
    top: 10px;
    left: 20px;

    margin: 0;
    color: #1d4ed8;
    cursor: pointer;
}

/* =========================
   결과 영역
========================= */
#result {
    margin-top: 30px;

    padding: 20px;

    background: white;
    border-radius: 12px;

    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}