/* ─── 글살림 포털 — 종이/잉크 톤 ─── */
/* HTML hidden 속성 강제 우선 (display:flex 등이 덮어쓰지 않게) */
.gsp-wrap [hidden] { display: none !important; }

/* ─── 캠페인 배너 (CAMPAIGN_ACTIVE=true일 때만 출력됨) ─── */
.gsp-campaign-banner {
    display: flex; align-items: center; gap: 20px;
    padding: 20px 28px; margin: 0 0 24px;
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    border: 2px solid #d4951a; border-radius: 14px;
    box-shadow: 0 8px 24px -8px rgba(212, 149, 26, 0.3);
}
.gsp-campaign-icon { font-size: 44px; line-height: 1; }
.gsp-campaign-body { flex: 1; }
.gsp-campaign-body h2 {
    margin: 0 0 6px; font-size: 20px; color: #5a4a30;
}
.gsp-campaign-body p { margin: 0 0 10px; color: #5a4a30; font-size: 14px; }
.gsp-campaign-cta {
    display: inline-block; padding: 8px 16px;
    background: #5a4a30; color: #fff; text-decoration: none;
    border-radius: 6px; font-size: 13px; font-weight: 700;
}
.gsp-campaign-cta:hover { background: #1f1a14; color: #fff; }

/* ─── 동의 체크박스 (캠페인 활성 시) ─── */
.gsp-consent {
    background: #fffbf0;
    border: 1px dashed #d4c8a8;
    border-radius: 10px;
    padding: 16px 18px;
}
.gsp-consent-row {
    display: flex; align-items: flex-start; gap: 12px;
    cursor: pointer; margin-bottom: 0;
}
.gsp-consent-row input[type="checkbox"] {
    width: 18px; height: 18px; margin-top: 3px; flex-shrink: 0;
    accent-color: #8b6f3a;
}
.gsp-consent-row strong { color: #5a4a30; font-size: 14px; }
.gsp-consent-tag {
    display: inline-block; margin-left: 8px;
    padding: 2px 8px; font-size: 11px;
    background: #f5ecd9; color: #8a7c66;
    border-radius: 10px; font-weight: 600;
}
.gsp-consent-info { margin-top: 12px; font-size: 13px; }
.gsp-consent-info summary {
    cursor: pointer; color: #8b6f3a;
    font-weight: 600; list-style: none; padding: 4px 0;
}
.gsp-consent-info summary::-webkit-details-marker { display: none; }
.gsp-consent-info-body { padding: 12px 4px 4px; color: #5a4a30; }
.gsp-consent-info-body p { margin: 8px 0; }
.gsp-consent-info-body ul { margin: 6px 0 6px 18px; padding: 0; }
.gsp-consent-info-body li { margin: 3px 0; line-height: 1.6; }
.gsp-consent-warn {
    background: #fff4e0; border-left: 3px solid #d4951a;
    padding: 10px 14px; border-radius: 4px;
    font-size: 13px; margin-top: 10px;
}

.gsp-wrap {
    max-width: 960px;
    margin: 0 auto;
    padding: 40px 20px 80px;
    font-family: 'Noto Serif KR', 'Nanum Myeongjo', Georgia, serif;
    color: #2d2620;
    line-height: 1.7;
}

/* HERO */
.gsp-hero {
    text-align: center;
    padding: 60px 20px 40px;
}
.gsp-hero-mark {
    font-size: 56px;
    line-height: 1;
    margin-bottom: 20px;
    opacity: 0.85;
}
.gsp-hero-title {
    font-size: 64px;
    font-weight: 700;
    margin: 0 0 12px;
    letter-spacing: 8px;
    color: #1f1a14;
}
.gsp-hero-tag {
    font-size: 18px;
    color: #7c6f5e;
    margin: 0 0 32px;
    letter-spacing: 2px;
}
.gsp-hero-lead {
    font-size: 17px;
    color: #4a4034;
    max-width: 540px;
    margin: 0 auto;
}
.gsp-hero-lead strong { color: #1f1a14; }
.gsp-brand-link {
    display: inline-block;
    margin-top: 24px;
    padding: 8px 18px;
    background: #fffbf0;
    border: 1px solid #d4c8a8;
    border-radius: 24px;
    color: #5a4a30;
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.18s ease;
}
.gsp-brand-link:hover {
    background: #f5ecd9;
    border-color: #8b6f3a;
    color: #1f1a14;
}

/* SECTION */
.gsp-section-title {
    font-size: 26px;
    font-weight: 700;
    margin: 0 0 8px;
    color: #1f1a14;
}
.gsp-section-sub {
    color: #7c6f5e;
    margin: 0 0 28px;
}

/* BOOKS */
.gsp-books { padding: 60px 0 40px; border-top: 1px solid #e8e0d3; }
.gsp-book-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
}
.gsp-book-card {
    display: block;
    text-decoration: none;
    color: inherit;
    background: #faf6ee;
    border: 1px solid #e8e0d3;
    border-radius: 12px;
    overflow: hidden;
    transition: transform 0.18s ease, box-shadow 0.18s ease;
}
.gsp-book-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 24px -8px rgba(120, 95, 60, 0.25);
    color: inherit;
}
.gsp-book-cover { aspect-ratio: 3/4; background: #f0e8d8; }
.gsp-book-cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.gsp-book-cover-empty {
    display: flex; align-items: center; justify-content: center;
    font-size: 64px;
}
.gsp-book-meta { padding: 16px 18px 20px; }
.gsp-book-level { font-size: 12px; color: #7c6f5e; font-weight: 600; }
.gsp-book-title { font-size: 17px; margin: 8px 0 6px; color: #1f1a14; }
.gsp-book-subtitle { font-size: 13px; color: #7c6f5e; margin: 0; line-height: 1.5; }

/* RESTORE BOX */
.gsp-restore {
    margin-top: 60px;
    padding: 40px 36px;
    background: linear-gradient(180deg, #fdf9f0 0%, #f5ecd9 100%);
    border: 1px solid #e0d4ba;
    border-radius: 16px;
    box-shadow: 0 8px 32px -16px rgba(120, 95, 60, 0.2);
}
.gsp-restore-head { text-align: center; margin-bottom: 28px; }
.gsp-restore-head h2 {
    font-size: 28px; margin: 0 0 8px; color: #1f1a14;
}
.gsp-restore-head p { color: #7c6f5e; margin: 0; }

/* BYOK info */
.gsp-byok-info {
    background: #fffbf0;
    border: 1px dashed #d4c8a8;
    border-radius: 10px;
    padding: 12px 18px;
    margin-bottom: 24px;
    font-size: 14px;
}
.gsp-byok-info summary {
    cursor: pointer;
    font-weight: 600;
    color: #5a4a30;
    list-style: none;
}
.gsp-byok-info summary::-webkit-details-marker { display: none; }
.gsp-byok-info[open] summary { margin-bottom: 12px; }
.gsp-byok-info-body p { margin: 8px 0; }
.gsp-byok-info-body ul { margin: 8px 0 8px 20px; padding: 0; }
.gsp-byok-info-body li { margin: 4px 0; }
.gsp-byok-info-body a { color: #8b6f3a; text-decoration: underline; }
.gsp-byok-warn {
    background: #fff4e0; border-left: 3px solid #d4951a;
    padding: 8px 12px; border-radius: 4px; font-size: 13px;
}

/* FIELDS */
.gsp-field { margin-bottom: 22px; }
.gsp-field label {
    display: block; font-weight: 600; font-size: 14px;
    color: #4a4034; margin-bottom: 8px;
}
.gsp-field-hint {
    font-size: 12px; color: #8a7c66; margin: 6px 0 0;
}
.gsp-field input[type="password"],
.gsp-field input[type="text"],
.gsp-field textarea {
    width: 100%; padding: 12px 14px;
    border: 1px solid #d4c8a8; border-radius: 8px;
    background: #fff; font-size: 15px;
    font-family: inherit;
    box-sizing: border-box;
}
.gsp-field input:focus, .gsp-field textarea:focus {
    outline: none; border-color: #8b6f3a;
    box-shadow: 0 0 0 3px rgba(139, 111, 58, 0.15);
}

/* KEY ROW */
.gsp-key-row { display: flex; gap: 8px; }
.gsp-key-row input { flex: 1; }
.gsp-key-row button {
    width: 44px; padding: 0; border: 1px solid #d4c8a8;
    background: #fff; border-radius: 8px; cursor: pointer;
    font-size: 16px;
}
.gsp-key-row button:hover { background: #f5ecd9; }

/* DROP ZONE */
.gsp-drop {
    border: 2px dashed #c8b889; border-radius: 12px;
    padding: 32px 20px; text-align: center; cursor: pointer;
    background: #fffbf0; transition: all 0.18s ease;
    min-height: 160px;
    display: flex; align-items: center; justify-content: center;
}
.gsp-drop:hover, .gsp-drop.drag-over {
    border-color: #8b6f3a; background: #fff4e0;
}
.gsp-drop-icon { font-size: 48px; opacity: 0.7; margin-bottom: 8px; }
.gsp-drop-empty p { margin: 4px 0; color: #5a4a30; }
.gsp-drop-hint { font-size: 12px; color: #8a7c66; }
.gsp-drop-preview { width: 100%; }
.gsp-drop-preview img {
    max-width: 100%; max-height: 320px;
    border-radius: 8px; margin-bottom: 12px;
}

/* BUTTONS */
.gsp-btn-primary {
    display: block; width: 100%;
    padding: 16px; font-size: 17px; font-weight: 700;
    background: linear-gradient(180deg, #8b6f3a 0%, #5a4a30 100%);
    color: #fff; border: none; border-radius: 10px;
    cursor: pointer; transition: all 0.18s ease;
    font-family: inherit;
}
.gsp-btn-primary:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 6px 16px -4px rgba(90, 74, 48, 0.5);
}
.gsp-btn-primary:disabled {
    opacity: 0.4; cursor: not-allowed;
}
.gsp-btn-ghost {
    padding: 8px 14px; font-size: 13px;
    background: #fff; color: #5a4a30;
    border: 1px solid #d4c8a8; border-radius: 6px;
    cursor: pointer; font-family: inherit;
}
.gsp-btn-ghost:hover { background: #f5ecd9; }

/* PROGRESS */
.gsp-progress {
    display: flex; align-items: center; gap: 12px;
    padding: 16px 20px; margin-top: 16px;
    background: #fffbf0; border: 1px solid #d4c8a8; border-radius: 10px;
    color: #5a4a30;
}
.gsp-spinner {
    width: 20px; height: 20px;
    border: 2px solid #e0d4ba; border-top-color: #8b6f3a;
    border-radius: 50%; animation: gsp-spin 0.8s linear infinite;
}
@keyframes gsp-spin { to { transform: rotate(360deg); } }

/* RESULT */
.gsp-result {
    margin-top: 24px;
    padding: 24px 28px;
    background: #fff;
    border: 1px solid #d4c8a8; border-radius: 12px;
}
.gsp-result h3 { margin: 0 0 16px; color: #1f1a14; }
.gsp-result-text {
    white-space: pre-wrap;
    font-family: 'Noto Serif KR', 'Nanum Myeongjo', Georgia, serif;
    font-size: 16px; line-height: 1.9;
    color: #2d2620;
    background: #fffbf0;
    padding: 20px 24px;
    border-radius: 8px;
    border-left: 3px solid #8b6f3a;
    max-height: 500px;
    overflow-y: auto;
}
.gsp-result-actions {
    display: flex; gap: 8px; margin-top: 16px;
    flex-wrap: wrap;
}

/* ERROR */
.gsp-error {
    margin-top: 16px; padding: 14px 18px;
    background: #fef2f2; border: 1px solid #fca5a5;
    border-radius: 8px; color: #991b1b; font-size: 14px;
}

/* MOBILE */
@media (max-width: 720px) {
    .gsp-wrap { padding: 24px 14px 60px; }
    .gsp-hero { padding: 32px 12px 24px; }
    .gsp-hero-title { font-size: 44px; letter-spacing: 4px; }
    .gsp-hero-mark { font-size: 44px; }
    .gsp-hero-lead { font-size: 15px; }
    .gsp-book-grid { grid-template-columns: 1fr; }
    .gsp-restore { padding: 28px 20px; }
    .gsp-restore-head h2 { font-size: 22px; }
}
