* { box-sizing: border-box; }
body {
    margin: 0;
    font-family: Arial, Helvetica, sans-serif;
    color: #2f2f3a;
    background: #f7f9fb;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
.container { width: min(1760px, calc(100% - 48px)); margin: 0 auto; }
.top-strip { background: #19182a; color: #fff; font-weight: 700; font-size: var(--top-header-font-size, 16px); }
.top-strip .container { min-height: 42px; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.socials { display: flex; gap: 14px; align-items: center; }
.socials a { width: 24px; height: 24px; display: grid; place-items: center; border-radius: 50%; opacity: .95; }
.socials svg { width: 18px; height: 18px; fill: currentColor; display: block; }
.main-header { position: sticky; top: 0; z-index: 20; background: var(--header-bg, #fff); box-shadow: 0 3px 14px rgba(0,0,0,.1); }
.main-header .container { min-height: 66px; display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.brand { display: flex; align-items: center; gap: 10px; font-size: var(--site-name-font-size, 34px); color: #7167cf; font-weight: 700; }
.brand img { width: 48px; height: 48px; object-fit: contain; border-radius: 10px; }
.brand-mark { font-size: 34px; }
.nav { display: flex; align-items: center; gap: 36px; font-size: var(--nav-font-size, 21px); font-weight: 700; }
.nav-item { position: relative; padding: 22px 0; }
.nav-item:hover .submenu { display: grid; }
.submenu { display: none; min-width: 210px; position: absolute; top: 62px; left: 0; background: #fff; border-radius: 8px; box-shadow: 0 16px 32px rgba(0,0,0,.16); overflow: hidden; }
.submenu a { padding: 13px 16px; white-space: nowrap; }
.submenu a:hover { background: #f0eefb; }
.search-toggle { width: var(--search-button-size, 48px); height: var(--search-button-size, 48px); border: 0; border-radius: 50%; background: #7365d0; color: #fff; font-size: calc(var(--search-button-size, 48px) * .5); cursor: pointer; box-shadow: 0 8px 16px rgba(77,59,160,.28); }
.site-search { display: none; position: absolute; right: 24px; top: 74px; width: min(460px, calc(100vw - 48px)); background: #fff; border: 1px solid #e2e2ec; box-shadow: 0 16px 36px rgba(0,0,0,.18); border-radius: 8px; padding: 12px; }
.site-search.open { display: block; }
.site-search input { width: 100%; border: 1px solid #d7d7e4; border-radius: 24px; padding: 12px 16px; font-size: 16px; }
.hero-wrap { padding: 22px 0; background: var(--hero-bg, #fff); }
.hero {
    position: relative;
    min-height: clamp(260px, 38vw, 740px);
    border: 5px solid #28e848;
    border-radius: 18px;
    overflow: hidden;
    background: linear-gradient(120deg, #fae6ff, #d6f2ff 45%, #fff2c7);
    display: grid;
    place-items: center;
}
.hero img { width: 100%; height: 100%; min-height: inherit; object-fit: cover; }
.placeholder-hero { padding: 48px; text-align: center; font-size: clamp(36px, 6vw, 82px); color: #19186c; font-weight: 900; }
.cta {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 46px;
    padding: 10px 26px;
    border-radius: 28px;
    color: #fff;
    background: linear-gradient(180deg, #3a24ff, #ec2175);
    font-size: var(--button-font-size, 18px);
    font-weight: 800;
    box-shadow: 0 8px 16px rgba(221,36,113,.22);
}
.hero .cta { position: absolute; left: 50%; bottom: 32px; transform: translateX(-50%); }
.card-section { padding: 26px 0 34px; background: var(--section-bg, #eaf8ec); }
.grid-4 { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 28px; }
.feature-card {
    min-height: 360px;
    border: 4px solid var(--card-border, #7d5df4);
    background: #fff;
    box-shadow: 0 8px 18px rgba(0,0,0,.18);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 20px;
}
.feature-card.has-image {
    min-height: 0;
    padding: 12px;
    justify-content: center;
}
.feature-card:nth-child(2) { --card-border: #12aef1; }
.feature-card:nth-child(3) { --card-border: #1c1836; }
.feature-card:nth-child(4) { --card-border: #f18b75; }
.card-image-link { display: block; position: relative; width: 100%; }
.feature-card img { width: 100%; height: auto; object-fit: contain; border-radius: 6px; background: #f8f8f8; }
.card-overlay-button { position: absolute; left: 50%; bottom: 26px; transform: translateX(-50%); display: inline-flex; align-items: center; justify-content: center; min-height: 42px; padding: 9px 24px; border-radius: 28px; color: #fff; background: linear-gradient(180deg, #3a24ff, #ec2175); font-size: var(--button-font-size, 18px); font-weight: 800; box-shadow: 0 8px 16px rgba(221,36,113,.22); white-space: nowrap; }
.card-placeholder { width: 100%; aspect-ratio: 4 / 3; display: grid; place-items: center; text-align: center; border-radius: 6px; padding: 24px; background: linear-gradient(135deg, #fff, #e7fbff); color: #081e61; font-size: 30px; font-weight: 900; }
.feature-card h3 { margin: 0; text-align: center; color: #092462; font-size: var(--card-title-font-size, 30px); }
.listing-section { padding: 34px 0 50px; background: var(--section-bg, #9b5cc9); }
.listing-panel { border-radius: 24px; padding: clamp(28px, 4vw, 58px); }
.section-title { margin: 0 0 34px; text-align: center; font-size: var(--heading-font-size, 48px); color: #ffb120; font-weight: 900; }
.filter-search { display: block; width: min(460px, 100%); margin: 0 auto 38px; border: 0; border-radius: 28px; padding: 16px 22px; font-size: 20px; box-shadow: inset 0 0 0 1px #eee; }
.post-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 32px; }
.post-card { overflow: hidden; background: #fff; border-radius: 16px; }
.post-card img, .post-image-placeholder { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; background: #fff; }
.post-image-placeholder { display: grid; place-items: center; color: #111; font-size: 80px; font-weight: 900; border-bottom: 1px solid #eee; }
.post-body { padding: 18px 22px 22px; }
.post-body h3 { margin: 0 0 12px; font-size: 24px; }
.muted { color: #666; }
.coloring-tool { padding: 28px 0 54px; background: var(--section-bg, #eef0f5); }
.tool-shell { overflow: hidden; border: 28px solid #6659c7; border-radius: 28px; background: #fff; }
.tool-title { padding: 28px; text-align: center; color: #fff; background: linear-gradient(100deg, #19182a, #34a4dd); }
.tool-title h2 { margin: 0 0 8px; font-size: 34px; }
.tool-body { display: grid; grid-template-columns: 1fr 390px; min-height: 680px; }
.canvas-area { display: grid; place-items: center; padding: 28px; background: #f1f2f5; }
#colorCanvas { width: min(900px, 100%); aspect-ratio: 1 / 1; background: #fff; border: 4px solid #c9cedd; border-radius: 12px; touch-action: none; }
.tools { padding: 26px; background: #fff; border-left: 1px solid #e2e2e8; }
.tools h3 { margin: 0 0 16px; color: #7072dd; font-size: 28px; }
.tool-buttons { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; margin-bottom: 22px; }
.tool-buttons button, .stamp-btn {
    border: 0;
    border-radius: 24px;
    min-height: 48px;
    color: #fff;
    font-size: 18px;
    font-weight: 800;
    cursor: pointer;
}
.tool-buttons button.active { outline: 4px solid #9ea0aa; outline-offset: 3px; }
.tool-buttons button:nth-child(1) { background: #7365d9; }
.tool-buttons button:nth-child(2) { background: #7d8a8a; }
.tool-buttons button:nth-child(3) { background: #ee801d; }
.tool-buttons button:nth-child(4) { background: #2caf68; }
.tool-buttons button:nth-child(5) { background: #ef473f; }
.slider-row, .smart-fill { margin: 18px 0; font-weight: 800; font-size: 18px; }
.slider-row input { width: 100%; }
.smart-fill { background: #f4f4f4; border-radius: 16px; padding: 18px; }
.stamps { display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; }
.stamp-btn { color: #222; background: #f8f8f8; border: 3px solid #e8e8e8; border-radius: 12px; font-size: 28px; }
.stamp-btn.active { border-color: #7266d8; }
.palette { display: grid; grid-template-columns: repeat(6, 1fr); gap: 9px; margin-top: 14px; }
.color { width: 100%; aspect-ratio: 1 / 1; border-radius: 50%; border: 3px solid #eee; cursor: pointer; }
.color.active { outline: 4px solid #222; }
.tool-actions { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-top: 18px; }
.tool-actions button { border: 0; border-radius: 8px; padding: 12px; background: #19182a; color: #fff; font-weight: 800; cursor: pointer; }
.footer { background: var(--footer-bg, #19182a); color: #fff; padding: 42px 0; }
.footer-grid { display: grid; grid-template-columns: 1.3fr 1fr 1fr; gap: 34px; }
.footer-logo { display: flex; align-items: center; gap: 10px; font-size: 28px; font-weight: 900; }
.footer-logo img { width: 58px; height: 58px; object-fit: contain; }
.footer h3 { margin: 0 0 18px; color: #ffb120; }
.footer-links { display: grid; gap: 10px; }
.credit { padding: 14px 0; text-align: center; color: #fff; background: #11101d; }
.detail-page { padding: 46px 0; background: #f7f9fb; }
.detail-card { width: min(1220px, calc(100% - 48px)); margin: 0 auto; background: #fff; border-radius: 12px; padding: clamp(22px, 4vw, 42px); box-shadow: 0 12px 28px rgba(0,0,0,.08); }
.detail-card h1 { margin: 0 0 24px; font-size: clamp(34px, 5vw, 68px); color: #1f2937; }
.detail-image { width: 100%; height: auto; border-radius: 10px; background: #fff; }
.detail-content { margin-top: 28px; font-size: 22px; line-height: 1.8; }
.audio-box { margin: 24px 0; padding: 28px; border-radius: 12px; text-align: center; color: #fff; background: linear-gradient(120deg, #6579df, #7a48aa); }
.audio-box audio { width: min(600px, 100%); }
.game-frame-wrap { overflow: hidden; border: 24px solid #6b67df; border-radius: 26px; background: #111; aspect-ratio: 16 / 9; }
.game-frame-wrap iframe { width: 100%; height: 100%; border: 0; display: block; }
.coloring-detail-page { padding-top: 28px; }
.coloring-detail-card { width: min(1600px, calc(100% - 48px)); padding: 0; background: transparent; box-shadow: none; }
.detail-coloring-tool { padding: 0; background: transparent; }
.detail-coloring-tool .tool-shell { border-width: 22px; box-shadow: 0 18px 42px rgba(0,0,0,.12); }
.category-page { padding: 42px 0; background: #f7f9fb; min-height: 70vh; }
.category-title { margin: 0 0 30px; font-size: var(--category-title-font-size, 44px); color: #1f2937; }
.category-list { display: grid; gap: 0; }
.category-item { display: grid; grid-template-columns: 320px 1fr; gap: 24px; padding: 26px; background: #fff; border-radius: 14px; box-shadow: 0 8px 22px rgba(0,0,0,.08); margin-bottom: 18px; }
.category-item img { width: 100%; aspect-ratio: 16 / 9; object-fit: contain; background: #fff; border-radius: 10px; }
.category-item h2 { margin: 0 0 12px; font-size: 30px; color: #6579df; }
.category-item p { font-size: 20px; line-height: 1.6; color: #666; }
.read-more { color: #0ba9ec; font-size: 22px; font-weight: 800; }
.panel-empty { padding: 24px; background: #fff; border-radius: 10px; box-shadow: 0 8px 20px rgba(0,0,0,.06); }
.mobile-menu-toggle { display: none; width: 46px; height: 46px; border: 0; border-radius: 8px; background: #19182a; color: #fff; font-size: 28px; cursor: pointer; }
@media (max-width: 768px) {
    .top-strip .container, .main-header .container { width: min(100% - 28px, 720px); }
    .top-strip .container { align-items: flex-start; padding: 8px 0; }
    .main-header .container { position: relative; min-height: 72px; gap: 12px; }
    .brand { min-width: 0; }
    .brand span:last-child { overflow-wrap: anywhere; }
    .search-toggle { flex: 0 0 var(--search-button-size, 44px); }
    .mobile-menu-toggle { display: grid; place-items: center; flex: 0 0 46px; }
    .nav {
        display: none;
        position: absolute;
        left: 0;
        right: 0;
        top: 72px;
        z-index: 30;
        padding: 10px;
        background: #fff;
        border-top: 1px solid #ececf4;
        box-shadow: 0 14px 22px rgba(0,0,0,.12);
        gap: 0;
        font-size: 18px;
    }
    .nav.open { display: grid; }
    .nav-item { padding: 0; }
    .nav-item > a { display: block; padding: 14px 10px; }
    .submenu { position: static; display: grid; box-shadow: none; border-radius: 0; background: #f7f7fb; margin: 0 0 8px; }
    .nav-item:hover .submenu { display: grid; }
    .hero { min-height: 0; aspect-ratio: auto; background: transparent; }
    .hero img { width: 100%; height: auto; min-height: 0; object-fit: contain; }
    .placeholder-hero { min-height: 260px; display: grid; place-items: center; }
    .hero .cta { bottom: 16px; }
    .grid-4, .post-grid, .footer-grid { grid-template-columns: 1fr; }
    .category-item { grid-template-columns: 1fr; }
    .tool-body { grid-template-columns: 1fr; }
    .tools { border-left: 0; border-top: 1px solid #e2e2e8; }
    .container { width: min(100% - 28px, 720px); }
    .detail-page { padding: 22px 0; }
    .detail-card { width: min(100% - 28px, 720px); }
    .coloring-detail-card { width: min(100% - 32px, 620px); }
    .detail-coloring-tool .tool-shell { border-width: 14px; border-radius: 24px; }
    .tool-title { padding: 18px 16px; }
    .tool-title h2 { font-size: 28px; }
    .tool-body { min-height: 0; }
    .canvas-area { padding: 18px; }
    #colorCanvas { width: 100%; }
    .tools { padding: 22px 18px; overflow: hidden; }
    .tool-buttons { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .tool-buttons button { min-width: 0; padding: 0 10px; font-size: 16px; }
    .stamps { grid-template-columns: repeat(4, minmax(0, 1fr)); }
    .palette { grid-template-columns: repeat(4, minmax(0, 1fr)); }
    .smart-fill { font-size: 16px; }
}
