/* ============================================
   手绘/插画融合主题 — Hand-drawn / Illustration
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=ZCOOL+KuaiLe&family=Ma+Shan+Zheng&family=ZCOOL+XiaoWei&family=Caveat:wght@400;700&display=swap');

:root {
    --primary: #e8734a;
    --primary-dark: #d4613a;
    --primary-light: #fce8e0;
    --secondary: #5b8a72;
    --secondary-light: #dceee5;
    --accent: #f4a261;
    --accent-light: #fef0e0;
    --warm-pink: #e76f7a;
    --warm-yellow: #f2cc6d;
    --warm-blue: #6ca6c9;
    --warm-purple: #9b8ec4;

    --text: #3d2c1e;
    --text-light: #6b5744;
    --text-muted: #a08b76;

    --bg: #fdf6ee;
    --bg-paper: #fef9f2;
    --white: #fffdf8;
    --card-bg: #fffdf8;
    --border: #d4c4a8;
    --border-light: #e8dcc8;

    --shadow-sketch: 3px 3px 0 rgba(61, 44, 30, 0.12);
    --shadow-hover: 5px 5px 0 rgba(61, 44, 30, 0.15);
    --shadow-soft: 0 2px 8px rgba(61, 44, 30, 0.08);

    --radius-sm: 4px 8px 6px 10px;
    --radius: 8px 12px 10px 14px;
    --radius-lg: 12px 20px 16px 24px;
    --radius-xl: 20px 30px 24px 36px;

    --font-handwrite: 'ZCOOL KuaiLe', 'Ma Shan Zheng', cursive;
    --font-body: 'ZCOOL XiaoWei', 'ZCOOL KuaiLe', serif;
    --font-english: 'Caveat', cursive;

    --doodle-stroke: #3d2c1e;
    --doodle-stroke-light: #b8a48c;

    --paper-url: url("data:image/svg+xml,%3Csvg width='100' height='100' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100' height='100' filter='url(%23n)' opacity='0.03'/%3E%3C/svg%3E");
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-body);
    color: var(--text);
    background: var(--bg);
    background-image:
        var(--paper-url),
        radial-gradient(circle, var(--border-light) 1px, transparent 1px);
    background-size: 100px 100px, 28px 28px;
    line-height: 1.7;
    -webkit-font-smoothing: antialiased;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

a {
    text-decoration: none;
    color: inherit;
}

img {
    max-width: 100%;
    height: auto;
}

/* ---- Doodle / Sketchy shared utilities ---- */
.sketchy-border {
    border: 2.5px solid var(--doodle-stroke);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sketch);
}

.sketchy-border-light {
    border: 2px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sketch);
}

/* Wavy underline for headings */
.doodle-underline {
    position: relative;
    display: inline-block;
}
.doodle-underline::after {
    content: '';
    position: absolute;
    bottom: -6px;
    left: 0;
    width: 100%;
    height: 8px;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 200 12'%3E%3Cpath d='M0 8 Q10 2, 20 8 T40 8 T60 8 T80 8 T100 8 T120 8 T140 8 T160 8 T180 8 T200 8' fill='none' stroke='%23e8734a' stroke-width='2.5' stroke-linecap='round'/%3E%3C/svg%3E") repeat-x;
    background-size: 100px 12px;
}

/* Doodle star decoration */
.doodle-star::before {
    content: '';
    display: inline-block;
    width: 20px;
    height: 20px;
    margin-right: 6px;
    vertical-align: middle;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 2 L14.5 9.5 L22 9.5 L16 14 L18 22 L12 17.5 L6 22 L8 14 L2 9.5 L9.5 9.5 Z' fill='none' stroke='%23f4a261' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") no-repeat center/contain;
}

/* ============================
   NAVBAR
   ============================ */
.navbar {
    background: var(--white);
    border-bottom: 2.5px solid var(--doodle-stroke);
    position: sticky;
    top: 0;
    z-index: 100;
    background-image: var(--paper-url);
}

.navbar .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 68px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 22px;
    font-weight: 400;
    font-family: var(--font-handwrite);
    color: var(--primary);
    position: relative;
}

.logo-icon {
    font-size: 28px;
    filter: drop-shadow(1px 1px 0 rgba(61,44,30,0.15));
}

.logo-text {
    position: relative;
}
.logo-text::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: -4px;
    right: -4px;
    height: 6px;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 8'%3E%3Cpath d='M0 5 Q5 1, 10 5 T20 5 T30 5 T40 5 T50 5 T60 5 T70 5 T80 5 T90 5 T100 5' fill='none' stroke='%23e8734a' stroke-width='2.5' stroke-linecap='round'/%3E%3C/svg%3E") repeat-x;
    background-size: 60px 8px;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 8px;
}

.nav-links a {
    font-size: 15px;
    font-family: var(--font-handwrite);
    color: var(--text-light);
    padding: 6px 14px;
    border-radius: 6px 10px 8px 12px;
    transition: all 0.25s;
    position: relative;
}

.nav-links a:hover {
    color: var(--primary);
    background: var(--primary-light);
}

.nav-links a.active {
    color: var(--white);
    background: var(--primary);
    border: 2px solid var(--primary-dark);
    box-shadow: 2px 2px 0 rgba(61,44,30,0.12);
}

.nav-auth {
    display: flex;
    align-items: center;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.user-avatar {
    width: 34px;
    height: 34px;
    border-radius: 50% 45% 55% 48%;
    object-fit: cover;
    border: 2px solid var(--border);
    box-shadow: 1px 1px 0 rgba(61,44,30,0.1);
}

.user-name {
    font-size: 14px;
    font-weight: 400;
    font-family: var(--font-handwrite);
}

.mobile-menu-btn {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 5px;
}

.mobile-menu-btn span {
    display: block;
    width: 24px;
    height: 2.5px;
    background: var(--text);
    border-radius: 2px;
    transition: all 0.2s;
}

/* ============================
   BUTTONS
   ============================ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 20px;
    border-radius: var(--radius);
    font-size: 15px;
    font-family: var(--font-handwrite);
    font-weight: 400;
    cursor: pointer;
    transition: all 0.2s;
    border: 2.5px solid transparent;
    position: relative;
}

.btn-primary {
    background: var(--primary);
    color: var(--white);
    border-color: var(--primary-dark);
    box-shadow: var(--shadow-sketch);
}
.btn-primary:hover {
    transform: translate(-1px, -2px);
    box-shadow: var(--shadow-hover);
    background: var(--primary-dark);
}

.btn-outline {
    background: transparent;
    border: 2.5px solid var(--border);
    color: var(--text);
    box-shadow: var(--shadow-sketch);
}
.btn-outline:hover {
    border-color: var(--primary);
    color: var(--primary);
    transform: translate(-1px, -2px);
    box-shadow: var(--shadow-hover);
}

.btn-secondary {
    background: var(--secondary);
    color: var(--white);
    border-color: #4a7560;
    box-shadow: var(--shadow-sketch);
}
.btn-secondary:hover {
    transform: translate(-1px, -2px);
    box-shadow: var(--shadow-hover);
}

.btn-sm {
    padding: 6px 14px;
    font-size: 13px;
}

.btn-lg {
    padding: 14px 28px;
    font-size: 17px;
}

.btn-block {
    width: 100%;
}

/* ============================
   HERO
   ============================ */
.hero {
    padding: 60px 0 80px;
    background:
        var(--paper-url),
        linear-gradient(170deg, var(--bg) 0%, var(--accent-light) 50%, var(--primary-light) 100%);
    border-bottom: 3px solid var(--border);
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: 20px;
    left: 30px;
    width: 60px;
    height: 60px;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 60 60'%3E%3Cpath d='M30 5 L35 25 L55 25 L38 37 L44 55 L30 44 L16 55 L22 37 L5 25 L25 25 Z' fill='none' stroke='%23f4a261' stroke-width='2' stroke-linecap='round' stroke-linejoin='round' opacity='0.4'/%3E%3C/svg%3E") no-repeat center/contain;
    animation: float-gentle 8s ease-in-out infinite;
}

.hero::after {
    content: '';
    position: absolute;
    bottom: 40px;
    right: 60px;
    width: 80px;
    height: 80px;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 80 80'%3E%3Ccircle cx='40' cy='40' r='30' fill='none' stroke='%235b8a72' stroke-width='2' stroke-dasharray='6 4' opacity='0.35'/%3E%3Ccircle cx='40' cy='40' r='18' fill='none' stroke='%23e8734a' stroke-width='2' opacity='0.25'/%3E%3C/svg%3E") no-repeat center/contain;
    animation: float-gentle 10s ease-in-out 2s infinite;
}

.hero .container {
    display: flex;
    align-items: center;
    gap: 60px;
    position: relative;
    z-index: 1;
}

.hero-content {
    flex: 1;
}

.hero-title {
    font-size: 44px;
    font-family: var(--font-handwrite);
    font-weight: 400;
    line-height: 1.3;
    margin-bottom: 20px;
    color: var(--text);
}

.highlight {
    color: var(--primary);
    position: relative;
    display: inline-block;
}
.highlight::after {
    content: '';
    position: absolute;
    bottom: 2px;
    left: -4px;
    right: -4px;
    height: 10px;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 200 12'%3E%3Cpath d='M0 8 Q10 2, 20 8 T40 8 T60 8 T80 8 T100 8 T120 8 T140 8 T160 8 T180 8 T200 8' fill='none' stroke='%23f4a261' stroke-width='3' stroke-linecap='round' opacity='0.6'/%3E%3C/svg%3E") repeat-x;
    background-size: 100px 12px;
    z-index: -1;
}

.hero-subtitle {
    font-size: 17px;
    color: var(--text-light);
    margin-bottom: 30px;
    font-family: var(--font-body);
    line-height: 1.8;
}

.hero-actions {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
}

.hero-image {
    flex: 1;
    display: flex;
    justify-content: center;
}

.hero-illustration {
    width: 300px;
    height: 400px;
    position: relative;
}

/* Hand-drawn book illustration */
.hero-book {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.hero-book-svg {
    width: 280px;
    height: 360px;
    filter: drop-shadow(4px 6px 0 rgba(61,44,30,0.12));
    animation: float-book 6s ease-in-out infinite;
}

/* Floating doodles around hero */
.hero-doodle {
    position: absolute;
    opacity: 0.5;
    animation: float-gentle 5s ease-in-out infinite;
}
.hero-doodle-1 { top: 10%; right: -10px; animation-delay: 0s; }
.hero-doodle-2 { bottom: 20%; left: -20px; animation-delay: 1.5s; }
.hero-doodle-3 { top: 40%; right: 20px; animation-delay: 3s; }

@keyframes float-book {
    0%, 100% { transform: translateY(0) rotate(-1deg); }
    50% { transform: translateY(-15px) rotate(1deg); }
}

@keyframes float-gentle {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    50% { transform: translateY(-12px) rotate(3deg); }
}

/* ============================
   SECTION TITLES
   ============================ */
.section-title {
    text-align: center;
    font-size: 30px;
    font-family: var(--font-handwrite);
    font-weight: 400;
    margin-bottom: 50px;
    color: var(--text);
    position: relative;
    display: inline-block;
    width: 100%;
}

.section-title::after {
    content: '';
    display: block;
    width: 120px;
    height: 10px;
    margin: 8px auto 0;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 120 10'%3E%3Cpath d='M0 6 Q6 2, 12 6 T24 6 T36 6 T48 6 T60 6 T72 6 T84 6 T96 6 T108 6 T120 6' fill='none' stroke='%23e8734a' stroke-width='2.5' stroke-linecap='round'/%3E%3C/svg%3E") no-repeat center/contain;
}

/* ============================
   FEATURES
   ============================ */
.features {
    padding: 80px 0;
    background:
        var(--paper-url),
        var(--white);
    border-bottom: 2px dashed var(--border-light);
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 28px;
}

.feature-card {
    text-align: center;
    padding: 32px 20px;
    border: 2.5px solid var(--border);
    border-radius: var(--radius-lg);
    background: var(--bg-paper);
    transition: all 0.3s;
    position: relative;
    box-shadow: var(--shadow-sketch);
}

.feature-card:nth-child(odd) {
    transform: rotate(-0.8deg);
}
.feature-card:nth-child(even) {
    transform: rotate(0.6deg);
}

.feature-card:hover {
    transform: translateY(-6px) rotate(0deg) !important;
    box-shadow: var(--shadow-hover);
    border-color: var(--primary);
}

/* Corner doodle decorations */
.feature-card::before {
    content: '';
    position: absolute;
    top: -8px;
    right: -8px;
    width: 24px;
    height: 24px;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 2 L14 9 L21 9 L15.5 13.5 L17.5 21 L12 16.5 L6.5 21 L8.5 13.5 L3 9 L10 9 Z' fill='%23f4a261' stroke='%23e8734a' stroke-width='1.5' opacity='0.6'/%3E%3C/svg%3E") no-repeat center/contain;
    opacity: 0;
    transition: opacity 0.3s;
}
.feature-card:hover::before {
    opacity: 1;
}

.feature-icon {
    font-size: 44px;
    margin-bottom: 16px;
    display: inline-block;
    filter: drop-shadow(2px 2px 0 rgba(61,44,30,0.1));
}

.feature-card h3 {
    font-size: 18px;
    font-family: var(--font-handwrite);
    margin-bottom: 10px;
    color: var(--text);
}

.feature-card p {
    font-size: 14px;
    color: var(--text-light);
    line-height: 1.7;
}

/* ============================
   HOW IT WORKS
   ============================ */
.how-it-works {
    padding: 80px 0;
    background:
        var(--paper-url),
        linear-gradient(180deg, var(--bg) 0%, var(--accent-light) 100%);
}

.steps {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 28px;
    position: relative;
}

/* Hand-drawn connecting line between steps */
.steps::before {
    content: '';
    position: absolute;
    top: 38px;
    left: 12%;
    right: 12%;
    height: 3px;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 800 6'%3E%3Cpath d='M0 3 Q10 1, 20 3 T40 3 T60 3 T80 3 T100 3 T120 3 T140 3 T160 3 T180 3 T200 3 T220 3 T240 3 T260 3 T280 3 T300 3 T320 3 T340 3 T360 3 T380 3 T400 3 T420 3 T440 3 T460 3 T480 3 T500 3 T520 3 T540 3 T560 3 T580 3 T600 3 T620 3 T640 3 T660 3 T680 3 T700 3 T720 3 T740 3 T760 3 T780 3 T800 3' fill='none' stroke='%23d4c4a8' stroke-width='2.5' stroke-linecap='round' stroke-dasharray='8 6'/%3E%3C/svg%3E") repeat-x center/contain;
    z-index: 0;
}

.step {
    text-align: center;
    position: relative;
    z-index: 1;
}

.step-number {
    width: 64px;
    height: 64px;
    background: var(--white);
    border: 3px solid var(--primary);
    color: var(--primary);
    border-radius: 50% 45% 55% 48%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 26px;
    font-family: var(--font-handwrite);
    font-weight: 400;
    margin: 0 auto 18px;
    box-shadow: var(--shadow-sketch);
    position: relative;
}

.step-number::after {
    content: '';
    position: absolute;
    bottom: -4px;
    right: -4px;
    width: 18px;
    height: 18px;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 18 18'%3E%3Cpath d='M3 9 Q6 3, 9 6 T15 9' fill='none' stroke='%23f4a261' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E") no-repeat center/contain;
}

.step h3 {
    font-size: 18px;
    font-family: var(--font-handwrite);
    margin-bottom: 8px;
    color: var(--text);
}

.step p {
    font-size: 14px;
    color: var(--text-light);
}

/* ============================
   STORY CARDS
   ============================ */
.stories-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 28px;
}

.story-card {
    background: var(--white);
    border: 2.5px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-sketch);
    transition: all 0.3s;
    display: block;
    position: relative;
}

.story-card:nth-child(3n+1) { transform: rotate(-0.5deg); }
.story-card:nth-child(3n+2) { transform: rotate(0.7deg); }
.story-card:nth-child(3n) { transform: rotate(-0.3deg); }

.story-card:hover {
    transform: translateY(-6px) rotate(0deg) !important;
    box-shadow: var(--shadow-hover);
    border-color: var(--primary);
}

.story-cover {
    position: relative;
    aspect-ratio: 3/4;
    overflow: hidden;
    background: linear-gradient(135deg, var(--accent-light) 0%, var(--primary-light) 100%);
    border-bottom: 2px dashed var(--border-light);
}

.story-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.placeholder-cover {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 64px;
    background:
        url("data:image/svg+xml,%3Csvg width='40' height='40' xmlns='http://www.w3.org/2000/svg'%3E%3Ccircle cx='20' cy='20' r='1.5' fill='%23d4c4a8' opacity='0.4'/%3E%3C/svg%3E") repeat,
        linear-gradient(135deg, var(--accent-light) 0%, var(--primary-light) 100%);
}

.story-status {
    position: absolute;
    top: 10px;
    right: 10px;
    padding: 4px 12px;
    border-radius: 8px 12px 6px 10px;
    font-size: 12px;
    font-family: var(--font-handwrite);
    border: 2px solid;
}

.status-completed {
    background: var(--secondary-light);
    color: var(--secondary);
    border-color: var(--secondary);
}

.status-generating_text,
.status-generating_media {
    background: #dff0ff;
    color: var(--warm-blue);
    border-color: var(--warm-blue);
}

.status-draft {
    background: rgba(255,253,248,0.9);
    color: var(--text-muted);
    border-color: var(--border);
}

.status-failed {
    background: #fde8ea;
    color: var(--warm-pink);
    border-color: var(--warm-pink);
}

.story-info {
    padding: 16px;
}

.story-info h3 {
    font-size: 16px;
    font-family: var(--font-handwrite);
    margin-bottom: 8px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    color: var(--text);
}

.story-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 13px;
    color: var(--text-muted);
    font-family: var(--font-body);
}

.story-author {
    display: flex;
    align-items: center;
    gap: 6px;
}

.avatar-sm {
    width: 20px;
    height: 20px;
    border-radius: 50% 45% 55% 48%;
    border: 1.5px solid var(--border);
}

.section-actions {
    text-align: center;
    margin-top: 40px;
}

/* ============================
   RECENT STORIES
   ============================ */
.recent-stories {
    padding: 80px 0;
    background:
        var(--paper-url),
        var(--white);
    border-top: 2px dashed var(--border-light);
    border-bottom: 2px dashed var(--border-light);
}

/* ============================
   FAQ
   ============================ */
.faq {
    padding: 80px 0;
    background:
        var(--paper-url),
        var(--bg);
}

.faq-list {
    max-width: 800px;
    margin: 0 auto;
}

.faq-item {
    background: var(--white);
    border: 2.5px solid var(--border);
    border-radius: var(--radius);
    margin-bottom: 14px;
    overflow: hidden;
    box-shadow: var(--shadow-sketch);
    transition: border-color 0.3s;
}

.faq-item:hover {
    border-color: var(--primary);
}

.faq-item.active {
    border-color: var(--primary);
}

.faq-question {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 22px;
    cursor: pointer;
    font-family: var(--font-handwrite);
    font-size: 16px;
    color: var(--text);
}

.faq-toggle {
    font-size: 22px;
    color: var(--primary);
    transition: transform 0.3s;
    font-family: var(--font-english);
    font-weight: 700;
}

.faq-item.active .faq-toggle {
    transform: rotate(45deg);
}

.faq-answer {
    padding: 0 22px;
    max-height: 0;
    overflow: hidden;
    transition: all 0.3s;
}

.faq-answer p {
    font-size: 15px;
    color: var(--text-light);
    line-height: 1.8;
}

.faq-item.active .faq-answer {
    padding: 0 22px 18px;
    max-height: 200px;
}

/* ============================
   FOOTER
   ============================ */
.footer {
    background:
        var(--paper-url),
        #2c1f14;
    color: #f5e6d3;
    padding: 60px 0 30px;
    border-top: 3px solid var(--doodle-stroke);
    position: relative;
}

.footer::before {
    content: '';
    position: absolute;
    top: -3px;
    left: 0;
    right: 0;
    height: 6px;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 400 6'%3E%3Cpath d='M0 3 Q5 1, 10 3 T20 3 T30 3 T40 3 T50 3 T60 3 T70 3 T80 3 T90 3 T100 3 T110 3 T120 3 T130 3 T140 3 T150 3 T160 3 T170 3 T180 3 T190 3 T200 3 T210 3 T220 3 T230 3 T240 3 T250 3 T260 3 T270 3 T280 3 T290 3 T300 3 T310 3 T320 3 T330 3 T340 3 T350 3 T360 3 T370 3 T380 3 T390 3 T400 3' fill='none' stroke='%23e8734a' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E") repeat-x;
    background-size: 200px 6px;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 40px;
    margin-bottom: 40px;
}

.footer-brand .logo {
    color: #f5e6d3;
    margin-bottom: 14px;
}
.footer-brand .logo-text::after {
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 8'%3E%3Cpath d='M0 5 Q5 1, 10 5 T20 5 T30 5 T40 5 T50 5 T60 5 T70 5 T80 5 T90 5 T100 5' fill='none' stroke='%23f4a261' stroke-width='2.5' stroke-linecap='round'/%3E%3C/svg%3E") repeat-x;
    background-size: 60px 8px;
}

.footer-desc {
    color: rgba(245,230,211,0.7);
    font-size: 14px;
    line-height: 1.7;
}

.footer-links h4 {
    font-size: 17px;
    font-family: var(--font-handwrite);
    margin-bottom: 18px;
    color: #f5e6d3;
    position: relative;
    display: inline-block;
}
.footer-links h4::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 100%;
    height: 5px;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 60 6'%3E%3Cpath d='M0 4 Q3 1, 6 4 T12 4 T18 4 T24 4 T30 4 T36 4 T42 4 T48 4 T54 4 T60 4' fill='none' stroke='%23e8734a' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E") repeat-x;
    background-size: 40px 6px;
}

.footer-links a {
    display: block;
    color: rgba(245,230,211,0.65);
    font-size: 14px;
    margin-bottom: 10px;
    transition: all 0.2s;
    padding: 2px 0;
}

.footer-links a:hover {
    color: #f5e6d3;
    padding-left: 8px;
}

.footer-bottom {
    border-top: 2px dashed rgba(245,230,211,0.15);
    padding-top: 24px;
    text-align: center;
    color: rgba(245,230,211,0.4);
    font-size: 14px;
}

/* ============================
   PAGE HEADER
   ============================ */
.page-header {
    text-align: center;
    padding: 44px 0 30px;
}

.page-header h1 {
    font-size: 32px;
    font-family: var(--font-handwrite);
    font-weight: 400;
    margin-bottom: 10px;
    color: var(--text);
    position: relative;
    display: inline-block;
}
.page-header h1::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 10%;
    right: 10%;
    height: 8px;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 200 10'%3E%3Cpath d='M0 6 Q5 2, 10 6 T20 6 T30 6 T40 6 T50 6 T60 6 T70 6 T80 6 T90 6 T100 6 T110 6 T120 6 T130 6 T140 6 T150 6 T160 6 T170 6 T180 6 T190 6 T200 6' fill='none' stroke='%23e8734a' stroke-width='2.5' stroke-linecap='round'/%3E%3C/svg%3E") repeat-x;
    background-size: 100px 10px;
}

.page-header p {
    color: var(--text-light);
    font-size: 15px;
}

/* ============================
   CATEGORY FILTER
   ============================ */
.category-filter {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 30px;
    justify-content: center;
}

.category-tag {
    padding: 8px 18px;
    background: var(--white);
    border: 2px solid var(--border);
    border-radius: 8px 12px 6px 10px;
    font-size: 14px;
    font-family: var(--font-handwrite);
    box-shadow: 2px 2px 0 rgba(61,44,30,0.08);
    transition: all 0.2s;
    cursor: pointer;
}

.category-tag:hover,
.category-tag.active {
    background: var(--primary);
    color: var(--white);
    border-color: var(--primary-dark);
    box-shadow: 3px 3px 0 rgba(61,44,30,0.12);
}

.list-container {
    padding-bottom: 40px;
}

/* ============================
   EMPTY STATE
   ============================ */
.empty-state {
    text-align: center;
    padding: 80px 20px;
    background:
        var(--paper-url),
        var(--white);
    border: 2.5px dashed var(--border);
    border-radius: var(--radius-xl);
}

.empty-icon {
    font-size: 64px;
    margin-bottom: 20px;
    display: inline-block;
    animation: float-gentle 4s ease-in-out infinite;
}

.empty-state h3 {
    font-size: 24px;
    font-family: var(--font-handwrite);
    margin-bottom: 10px;
    color: var(--text);
}

.empty-state p {
    color: var(--text-light);
    margin-bottom: 24px;
}

/* ============================
   PAGINATION
   ============================ */
.pagination {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 40px;
}

.page-btn {
    padding: 8px 16px;
    background: var(--white);
    border: 2px solid var(--border);
    border-radius: 6px 10px 8px 12px;
    font-size: 14px;
    font-family: var(--font-handwrite);
    box-shadow: 2px 2px 0 rgba(61,44,30,0.08);
    transition: all 0.2s;
    cursor: pointer;
}

.page-btn:hover,
.page-btn.active {
    background: var(--primary);
    color: var(--white);
    border-color: var(--primary-dark);
}

.page-btn.dots {
    background: none;
    border: none;
    box-shadow: none;
}

/* ============================
   MY STORIES — DELETE BTN
   ============================ */
.story-card-wrapper {
    position: relative;
}

.delete-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 30px;
    height: 30px;
    background: var(--warm-pink);
    color: var(--white);
    border: 2px solid #c95a64;
    border-radius: 50% 45% 55% 48%;
    font-size: 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.2s;
    z-index: 2;
    box-shadow: 2px 2px 0 rgba(61,44,30,0.15);
    font-family: var(--font-handwrite);
}

.story-card-wrapper:hover .delete-btn {
    opacity: 1;
}

/* ============================
   CREATE FORM
   ============================ */
.create-container {
    max-width: 800px;
    margin: 0 auto;
    padding-bottom: 60px;
}

.create-form {
    background:
        var(--paper-url),
        var(--white);
    padding: 32px;
    border: 2.5px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sketch);
}

.form-group {
    margin-bottom: 22px;
}

.form-group label {
    display: block;
    font-size: 15px;
    font-family: var(--font-handwrite);
    margin-bottom: 8px;
    color: var(--text);
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px 16px;
    border: 2.5px solid var(--border);
    border-radius: 6px 10px 8px 12px;
    font-size: 15px;
    font-family: var(--font-body);
    background: var(--bg-paper);
    color: var(--text);
    transition: all 0.2s;
    box-shadow: inset 1px 1px 0 rgba(61,44,30,0.05);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: inset 1px 1px 0 rgba(61,44,30,0.05), 0 0 0 3px rgba(232,115,74,0.15);
    background: var(--white);
}

.form-group textarea {
    resize: vertical;
}

.form-group select {
    cursor: pointer;
}

/* ============================
   CREATE PROGRESS
   ============================ */
.create-progress {
    background:
        var(--paper-url),
        var(--white);
    padding: 40px;
    border: 2.5px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sketch);
    text-align: center;
}

.progress-header {
    margin-bottom: 30px;
}

.progress-header h2 {
    font-family: var(--font-handwrite);
    margin-bottom: 10px;
    color: var(--text);
}

.progress-bar-container {
    margin-bottom: 30px;
}

.progress-bar {
    height: 14px;
    background: var(--border-light);
    border-radius: 4px 8px 6px 10px;
    overflow: hidden;
    margin-bottom: 10px;
    border: 2px solid var(--border);
}

.progress-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary) 0%, var(--accent) 100%);
    border-radius: 3px 6px 4px 8px;
    transition: width 0.5s ease;
    width: 0;
}

.progress-text {
    font-size: 14px;
    color: var(--text-muted);
    font-family: var(--font-handwrite);
}

.progress-steps {
    display: flex;
    justify-content: center;
    gap: 30px;
}

.progress-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    opacity: 0.4;
    transition: all 0.3s;
}

.progress-step.active,
.progress-step.completed {
    opacity: 1;
}

.step-icon {
    font-size: 32px;
    filter: drop-shadow(1px 1px 0 rgba(61,44,30,0.1));
}

.step-text {
    font-size: 13px;
    color: var(--text-light);
    font-family: var(--font-handwrite);
}

/* ============================
   CREATE PREVIEW
   ============================ */
.create-preview {
    background:
        var(--paper-url),
        var(--white);
    padding: 32px;
    border: 2.5px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sketch);
}

.preview-header {
    text-align: center;
    margin-bottom: 30px;
}

.preview-header h2 {
    font-family: var(--font-handwrite);
    margin-bottom: 10px;
    color: var(--text);
}

.preview-header p {
    color: var(--text-light);
}

.pages-preview {
    display: grid;
    gap: 16px;
    margin-bottom: 30px;
}

.page-card {
    background: var(--bg);
    padding: 20px;
    border: 2px dashed var(--border);
    border-radius: var(--radius);
    position: relative;
}

.page-card::before {
    content: '';
    position: absolute;
    top: 8px;
    left: 8px;
    width: 16px;
    height: 16px;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M2 12 L6 4 L10 10 L14 2' fill='none' stroke='%23d4c4a8' stroke-width='1.5' stroke-linecap='round'/%3E%3C/svg%3E") no-repeat center/contain;
    opacity: 0.4;
}

.page-number {
    font-size: 14px;
    font-family: var(--font-handwrite);
    font-weight: 400;
    color: var(--primary);
    margin-bottom: 10px;
}

.page-content {
    font-size: 15px;
    line-height: 1.9;
    color: var(--text);
}

.preview-actions {
    display: flex;
    gap: 16px;
    justify-content: center;
}

/* ============================
   ERROR PAGE
   ============================ */
.error-page {
    text-align: center;
    padding: 100px 20px;
}

.error-icon {
    font-size: 80px;
    margin-bottom: 20px;
    display: inline-block;
    animation: float-gentle 5s ease-in-out infinite;
}

.error-page h1 {
    font-size: 64px;
    font-family: var(--font-handwrite);
    margin-bottom: 10px;
    color: var(--text);
}

.error-page p {
    font-size: 18px;
    color: var(--text-light);
    margin-bottom: 30px;
    font-family: var(--font-body);
}

/* ============================
   MY CONTAINER
   ============================ */
.my-container {
    padding-bottom: 40px;
}

/* ============================
   DETAIL VIEWER — Hand-drawn overlay tweaks
   ============================ */
.viewer-header .back-btn {
    font-family: var(--font-handwrite);
    font-size: 15px;
    background: rgba(255,253,248,0.15);
    padding: 6px 14px;
    border-radius: 6px 10px 8px 12px;
    border: 1.5px solid rgba(255,253,248,0.3);
}

.viewer-header h1 {
    font-family: var(--font-handwrite);
    font-size: 20px;
}

.slide-content {
    background: rgba(255,253,248,0.12);
    border: 1.5px solid rgba(255,253,248,0.2);
    border-radius: var(--radius-lg);
    backdrop-filter: blur(12px);
}

.slide-text {
    font-family: var(--font-body);
    font-size: 18px;
    line-height: 1.9;
}

.slide-placeholder {
    border: 3px solid rgba(255,253,248,0.3);
    border-radius: var(--radius-xl);
    background:
        url("data:image/svg+xml,%3Csvg width='30' height='30' xmlns='http://www.w3.org/2000/svg'%3E%3Ccircle cx='15' cy='15' r='1.5' fill='%23fff' opacity='0.08'/%3E%3C/svg%3E") repeat,
        linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.slide-image {
    border: 3px solid rgba(255,253,248,0.25);
    border-radius: var(--radius-lg);
}

.audio-btn {
    font-family: var(--font-handwrite);
    border: 2px solid rgba(255,253,248,0.3);
    border-radius: 8px 14px 10px 16px;
}

.page-indicator {
    font-family: var(--font-handwrite);
    border: 1.5px solid rgba(255,253,248,0.2);
}

/* ============================
   TOAST
   ============================ */
.toast {
    font-family: var(--font-handwrite);
    border: 2px solid rgba(61,44,30,0.2);
    box-shadow: var(--shadow-sketch);
}

/* ============================
   SCROLLBAR
   ============================ */
::-webkit-scrollbar {
    width: 10px;
}
::-webkit-scrollbar-track {
    background: var(--bg);
}
::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 5px 8px 5px 8px;
    border: 2px solid var(--bg);
}
::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* ============================
   RESPONSIVE
   ============================ */
@media (max-width: 768px) {
    .mobile-menu-btn {
        display: flex;
    }

    .nav-links {
        display: none;
        position: absolute;
        top: 68px;
        left: 0;
        right: 0;
        background: var(--white);
        flex-direction: column;
        padding: 20px;
        border-bottom: 2.5px solid var(--doodle-stroke);
        box-shadow: var(--shadow-sketch);
    }

    .nav-links.active {
        display: flex;
    }

    .nav-auth {
        display: none;
    }

    .nav-links.active + .nav-auth {
        display: flex;
        position: absolute;
        top: calc(68px + 200px);
        left: 0;
        right: 0;
        background: var(--white);
        padding: 20px;
        border-bottom: 2.5px solid var(--doodle-stroke);
        box-shadow: var(--shadow-sketch);
    }

    .hero .container {
        flex-direction: column;
        text-align: center;
    }

    .hero-title {
        font-size: 32px;
    }

    .hero-actions {
        justify-content: center;
    }

    .hero-image {
        display: none;
    }

    .hero::before,
    .hero::after {
        display: none;
    }

    .features-grid,
    .steps {
        grid-template-columns: repeat(2, 1fr);
    }

    .steps::before {
        display: none;
    }

    .footer-content {
        grid-template-columns: 1fr;
    }

    .progress-steps {
        flex-wrap: wrap;
    }

    .feature-card:nth-child(odd),
    .feature-card:nth-child(even),
    .story-card:nth-child(3n+1),
    .story-card:nth-child(3n+2),
    .story-card:nth-child(3n) {
        transform: none;
    }
}

@media (max-width: 480px) {
    .features-grid,
    .steps {
        grid-template-columns: 1fr;
    }

    .hero-actions {
        flex-direction: column;
        align-items: center;
    }

    .hero-actions .btn {
        width: 100%;
    }
}
