/**
 * @license
 * SPDX-License-Identifier: Apache-2.0
 */

/* ============================================================
   Sweet Module Base — 韩系复古 Y2K 甜酷少女风
   设计调性：拼贴手帐 · 奶油马卡龙 · 描边标题 · 浮动星星 · 锯齿标签
   色盘 (低饱和马卡龙奶油系)：
     奶油粉 #FCE4EC / 蜜桃粉 #F8BBD0 / 樱粉 #F48FB1
     天蓝粉 #B3E5FC / 薰衣草 #D1C4E9 / 柠檬奶 #FFF9C4
     薄荷奶 #C8E6C9 / 奶茶米 #FFF3E0 / 奶油白 #FFF8FA
   ============================================================ */

/* --- 低饱和马卡龙色值变量 --- */
:root {
    /* 主色 - 低饱和奶油系 */
    --macaron-pink: #F8BBD0;
    --macaron-hot-pink: #F48FB1;
    --macaron-blue: #B3E5FC;
    --macaron-lavender: #D1C4E9;
    --macaron-lemon: #FFF9C4;
    --macaron-mint: #C8E6C9;
    --macaron-cream: #FFEAF2;
    --macaron-peach: #FFCCBC;
    /* 文字色 - 柔和深色系 */
    --macaron-text: #4A3B56;
    --macaron-text-secondary: #6B5A79;
    --macaron-text-light: #7E6E8C;
    /* 功能色 */
    --macaron-card-bg: rgba(255, 255, 255, 0.25); /* Even softer white glass */
    --macaron-border: rgba(244, 143, 177, 0.18);
    --macaron-bg-pink: #FFF5F8;
    /* 尺寸 */
    --macaron-radius: 18px;
    --macaron-radius-sm: 12px;
    --macaron-gap: 14px;
    --macaron-padding-x: 10%;
    --macaron-padding-y: 24px;
}

/* --- 浮动星星关键帧动画 --- */
@keyframes sweet-float {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    50% { transform: translateY(-6px) rotate(8deg); }
}
@keyframes sweet-float-alt {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    50% { transform: translateY(-4px) rotate(-6deg); }
}
@keyframes sweet-twinkle {
    0%, 100% { opacity: 0.12; }
    50% { opacity: 0.3; }
}
@keyframes sweet-drift {
    0%, 100% { transform: translateY(0) translateX(0) rotate(0deg); }
    25% { transform: translateY(-4px) translateX(3px) rotate(5deg); }
    50% { transform: translateY(-8px) translateX(0) rotate(-3deg); }
    75% { transform: translateY(-3px) translateX(-2px) rotate(2deg); }
}
@keyframes sweet-badge-pulse {
    0%, 100% { box-shadow: 0 3px 12px rgba(244, 143, 177, 0.25); }
    50% { box-shadow: 0 3px 20px rgba(244, 143, 177, 0.45); }
}
@keyframes sweet-bubble-dance {
    0%, 100% { transform: translate(0, 0) scale(1); }
    33% { transform: translate(10px, -20px) scale(1.05); }
    66% { transform: translate(-10px, -10px) scale(0.95); }
}
@keyframes sweet-rotate-pulse {
    0% { transform: rotate(0deg) scale(1); opacity: 0.15; }
    50% { transform: rotate(180deg) scale(1.2); opacity: 0.3; }
    100% { transform: rotate(360deg) scale(1); opacity: 0.15; }
}

/* --- 通用：3:4 比例容器 + 奶油弥散渐变底 + 散落星点装饰 --- */
.scene-printable-content {
    width: 600px;
    max-width: 100% !important;
    container-type: inline-size;
    border-radius: 0 !important;
    border: none !important;
    box-shadow: none !important;
    overflow: hidden !important;
    position: relative;
    /* 核心点缀：噪点背景 - 已交由应用动态处理 */
    background-color: transparent;

    /* Sweet 模式下统一直角变量，消除导出白边 */
    --radius-md: 0 !important;
    --radius-sm: 0 !important;
    --radius-lg: 0 !important;
}

/* Sweet 模式下所有模块统一使用直角，防止导出时圆角产生白边 */
.is-sweet-bg .module-wrapper,
.is-sweet-bg .product-card-module,
.is-sweet-bg .product-card,
.is-sweet-bg .sweet-hero-module,
.is-sweet-bg .sweet-showcase-module,
.is-sweet-bg .sweet-ingredients-module,
.is-sweet-bg .sweet-tutorial-module,
.is-sweet-bg .sweet-compare-module,
.is-sweet-bg .sweet-specs-module,
.is-sweet-bg .sweet-notice-module,
.is-sweet-bg .sweet-reviews-module,
.is-sweet-bg .sweet-cta-module,
.is-sweet-bg .sweet-poses-module {
    border-radius: 0 !important;
}
/* 韩国甜美风氛围层 — 软棉棉的色彩色块 (Blob) */
.scene-printable-content.is-sweet-bg::before {
    content: '';
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    background:
        radial-gradient(circle at 10% 20%, rgba(244, 143, 177, 0.04) 0%, transparent 45%),
        radial-gradient(circle at 90% 15%, rgba(248, 187, 208, 0.05) 0%, transparent 40%),
        radial-gradient(circle at 50% 50%, rgba(252, 228, 236, 0.08) 0%, transparent 60%),
        radial-gradient(circle at 80% 85%, rgba(244, 143, 177, 0.03) 0%, transparent 35%),
        radial-gradient(circle at 20% 80%, rgba(248, 187, 208, 0.03) 0%, transparent 40%),
        radial-gradient(circle at 50% 98%, rgba(244, 143, 177, 0.04) 0%, transparent 45%);
    filter: blur(40px);
}

/* 动态背景点缀群 - 星星 & 圆点 & 缤纷纸屑 */
.scene-printable-content.is-sweet-bg::after {
    content: '';
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    background-color: transparent;
    background-image:
        /* 亮粉星点 */
        radial-gradient(circle 6.5px, rgba(248, 187, 208, 0.15) 100%, transparent 100%) 40px 120px,
        radial-gradient(circle 5.5px, rgba(244, 143, 177, 0.2) 100%, transparent 100%) 540px 80px,
        /* 缤纷粉红纸屑 (Confetti) */
        linear-gradient(rgba(244, 143, 177, 0.1), rgba(244, 143, 177, 0.1)) 120px 250px / 10px 10px,
        linear-gradient(rgba(248, 187, 208, 0.1), rgba(248, 187, 208, 0.1)) 450px 480px / 9px 9px,
        linear-gradient(45deg, transparent 40%, rgba(244, 143, 177, 0.1) 40%, rgba(244, 143, 177, 0.1) 60%, transparent 60%) 200px 700px / 15px 15px,
        /* 奶油色大圆点 (Bubble) */
        radial-gradient(circle 21px, rgba(252, 228, 236, 0.08) 100%, transparent 100%) 80px 450px,
        radial-gradient(circle 15px, rgba(248, 187, 208, 0.05) 100%, transparent 100%) 520px 1000px,
        /* 浅粉小星点 */
        radial-gradient(circle 5.5px, rgba(244, 143, 177, 0.15) 100%, transparent 100%) 300px 150px,
        radial-gradient(circle 7.5px, rgba(248, 187, 208, 0.1) 100%, transparent 100%) 500px 600px,
        radial-gradient(circle 6.5px, rgba(244, 143, 177, 0.1) 100%, transparent 100%) 150px 1300px,
        /* 新增微小随机散落点 */
        radial-gradient(circle 4.8px, rgba(244, 143, 177, 0.12) 100%, transparent 100%) 10% 8%,
        radial-gradient(circle 4.8px, rgba(248, 187, 208, 0.1) 100%, transparent 100%) 88% 18%,
        radial-gradient(circle 4.8px, rgba(244, 143, 177, 0.15) 100%, transparent 100%) 8% 48%,
        radial-gradient(circle 4.8px, rgba(248, 187, 208, 0.1) 100%, transparent 100%) 92% 78%,
        radial-gradient(circle 4.8px, rgba(244, 143, 177, 0.12) 100%, transparent 100%) 18% 92%,
        radial-gradient(circle 5.5px, rgba(248, 187, 208, 0.15) 100%, transparent 100%) 80% 96%,
        radial-gradient(circle 7.5px, rgba(244, 143, 177, 0.1) 100%, transparent 100%) 40% 98%,
        /* 额外新增 10 个点缀 */
        radial-gradient(circle 4px, rgba(244, 143, 177, 0.1) 100%, transparent 100%) 15% 25%,
        radial-gradient(circle 5px, rgba(248, 187, 208, 0.1) 100%, transparent 100%) 75% 10%,
        radial-gradient(circle 3px, rgba(244, 143, 177, 0.15) 100%, transparent 100%) 5% 75%,
        radial-gradient(circle 6px, rgba(252, 228, 236, 0.1) 100%, transparent 100%) 95% 45%,
        radial-gradient(circle 4px, rgba(244, 143, 177, 0.12) 100%, transparent 100%) 30% 60%,
        radial-gradient(circle 5px, rgba(248, 187, 208, 0.12) 100%, transparent 100%) 50% 30%,
        radial-gradient(circle 4px, rgba(244, 143, 177, 0.15) 100%, transparent 100%) 85% 85%,
        radial-gradient(circle 3px, rgba(252, 228, 236, 0.15) 100%, transparent 100%) 20% 5%,
        radial-gradient(circle 5px, rgba(244, 143, 177, 0.1) 100%, transparent 100%) 65% 90%,
        radial-gradient(circle 4px, rgba(248, 187, 208, 0.15) 100%, transparent 100%) 10% 95%;
    background-repeat: no-repeat;
}

.scene-printable-content.is-sweet-bg.is-white-bg::before,
.scene-printable-content.is-sweet-bg.is-white-bg::after {
    display: none;
}

/* --- 散落星星装饰 - 已去除 --- */
/* --- 通用模块半透明基底 + 无缝衔接 --- */
.is-sweet-bg .module-wrapper[class*="sweet-"] {
    background: transparent;
    position: relative;
    margin-bottom: 24px !important;
    border: none !important;
    box-shadow: none !important;
    border-radius: 0 !important;
    padding: 0 !important;
}
/* 尾模块：直角，与容器对齐 */
.sweet-cta-module {
    border-radius: 0 !important;
}
/* sweet 主题下产品组件背景白色，甜美组件保持透明透出粉色底 */
/* z-index 设为 5（低于分割线 z-index:20），避免白色背景遮盖上方模块的装饰分割线 */
.scene-printable-content > .product-overview-module,
.scene-printable-content > .product-advantage-module,
.scene-printable-content > .product-function-module,
.scene-printable-content > .product-scene-module,
.scene-printable-content > .product-spec-module,
.scene-printable-content > .product-notice-module,
.scene-printable-content > .product-card-module {
    background: #ffffff;
    position: relative;
    z-index: 5 !important; /* 盖住容器级装饰层 ::before/::after，但低于分割线 z-index:20 */
}
/* 产品/简历模块（白色背景）：隐藏甜美风格的散落装饰分割线，不需要点缀 */
/* 注意：甜美模块也有 product-module 类，必须用 :not 排除 */
.scene-printable-content.is-sweet-bg > .product-module:not([class*="sweet-"])::after,
.scene-printable-content.is-sweet-bg > .resume-module::after {
    display: none !important;
}
/* sweet 主题下甜美组件强制透明，盖住 .product-module 的白色 */
.scene-printable-content > .sweet-hero-module,
.scene-printable-content > .sweet-showcase-module,
.scene-printable-content > .sweet-ingredients-module,
.scene-printable-content > .sweet-tutorial-module,
.scene-printable-content > .sweet-compare-module,
.scene-printable-content > .sweet-specs-module,
.scene-printable-content > .sweet-notice-module,
.scene-printable-content > .sweet-reviews-module,
.scene-printable-content > .sweet-cta-module,
.scene-printable-content > .sweet-poses-module {
    background: transparent !important;
}
/* sweet 主题下 .resume-module 背景使用纯白保持正式感 */
.scene-printable-content > .resume-module {
    background: #ffffff;
    z-index: 5 !important; /* 盖住底部的碎花修饰，但低于分割线 z-index:20 */
}
.scene-printable-content.is-sweet-bg {
}
/* 首尾子模块直角适配 */
.scene-printable-content > .module-wrapper:first-child {
    border-radius: 0 !important;
    overflow: hidden;
}
.scene-printable-content > .module-wrapper:last-child {
    border-radius: 0 !important;
    overflow: hidden;
}
.scene-printable-content > .module-wrapper:only-child {
    border-radius: 0 !important;
    overflow: hidden;
}

/* 移除由特定模块 (甜美体式) 内部硬编码的顶部分割线，以防与全部分割线冲突 */

/* --- 高性能装饰：SVG 注入背景 --- */
.sweet-base-module {
    position: relative;
    overflow: visible;
}

[class*="sweet-"][class*="-module"] {
    position: relative;
}

.deco-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0; /* 确保在内容下方 */
    pointer-events: none;
    overflow: hidden;
    opacity: 0.8;
}

.deco-container svg {
    width: 100%;
    height: 100%;
}

/* --- 通用模块内标题（描边复古风） --- */
.sweet-section-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 37.5px var(--macaron-padding-x) 0;
}
.sweet-section-icon {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    /* 高质感玻璃质感 (Mobile UI Glass) */
    background: rgba(255, 255, 255, 0.5) !important;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1.5px solid rgba(255, 255, 255, 0.8) !important;
    color: var(--macaron-hot-pink) !important;
    box-shadow: 
        0 4px 12px rgba(244, 143, 177, 0.12),
        inset 0 1px 2px rgba(255, 255, 255, 0.4);
    flex-shrink: 0;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.sweet-section-icon:hover {
    transform: scale(1.05);
    background: rgba(255, 255, 255, 0.7) !important;
    box-shadow: 0 6px 16px rgba(244, 143, 177, 0.18);
}
.sweet-section-icon svg {
    width: 17px;
    height: 17px;
    display: block;
}
.sweet-section-title {
    font-size: calc(32px * var(--scale-factor, 1));
    font-weight: 100;
    color: var(--macaron-text-secondary);
    font-family: var(--bold-font), sans-serif !important;
    letter-spacing: 4px;
    text-transform: uppercase;
    flex-shrink: 0;
}

/* --- 点状虚线分隔（标题右侧填充） --- */
.sweet-section-header::after {
    content: '';
    display: block;
    flex: 1;
    height: 2px;
    background: repeating-radial-gradient(
        circle,
        var(--macaron-pink) 0, var(--macaron-pink) 1.2px,
        transparent 1.2px, transparent 5px
    ) 0 0 / 5px 2px;
    opacity: 0.4;
    margin-left: 8px;
    min-width: 20px;
}
