/* ========== 绘本管理系统 - 样式表 ========== */

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: linear-gradient(180deg,
        #1a4d2e 0%,
        #256b3d 18%,
        #388a53 36%,
        #52a86c 54%,
        #78c490 72%,
        #a8ddb8 88%,
        #d4f0de 100%
    );
    background-attachment: fixed;
    color: #333;
    min-height: 100vh;
    padding-top: 52px;
    /* 纵向 flex 容器：让页脚能吃掉剩余空间，贴住视口底部。
       页面里的装饰层/顶栏/弹窗/抽屉/阅读器全部是 position:fixed，不参与流式布局，
       故此处的在流子元素只有 #categoryBar、.main 和页脚三个，改动面可控。 */
    display: flex;
    flex-direction: column;
}

/* Lucide 图标统一样式 */
.header-nav-btn       svg { width:14px; height:14px; margin-right:4px; vertical-align:middle; }
.empty-state-icon     svg { width:32px; height:32px; color:#999; stroke-width:1.4; }
.auth-input-icon      svg { width:14px; height:14px; opacity:0.45; }
.reader-footer-btn    svg { width:14px; height:14px; margin-right:4px; vertical-align:middle; }
.step-ai-btn          svg { width:14px; height:14px; margin-right:3px; vertical-align:middle; }
.btn-add-book         svg { width:14px; height:14px; margin-right:3px; vertical-align:middle; }
.user-dropdown-item   svg { width:14px; height:14px; margin-right:4px; vertical-align:middle; }
.download-success     svg { width:32px; height:32px; color:#28a745; }

/* 背景粒子 */
.bg-particles {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    pointer-events: none; z-index: 0;
}
.bg-particles::before, .bg-particles::after {
    content: ''; position: absolute; width: 4px; height: 4px;
    border-radius: 50%; background: rgba(255,255,255,0.6);
    animation: particleFloat 8s ease-in-out infinite;
}
.bg-particles::before {
    box-shadow:
        30px 80px 0 rgba(255,255,255,0.6),
        120px 200px 0 rgba(255,255,255,0.5),
        280px 120px 0 rgba(255,255,255,0.6),
        450px 340px 0 rgba(255,218,121,0.5),
        620px 180px 0 rgba(255,255,255,0.6),
        780px 400px 0 rgba(255,183,197,0.5),
        100px 420px 0 rgba(255,255,255,0.55),
        350px 520px 0 rgba(255,218,121,0.45),
        550px 480px 0 rgba(255,255,255,0.5),
        700px 600px 0 rgba(168,221,184,0.5),
        850px 250px 0 rgba(255,255,255,0.55),
        200px 650px 0 rgba(255,183,197,0.45),
        500px 700px 0 rgba(255,218,121,0.4),
        900px 500px 0 rgba(255,255,255,0.45),
        60px 300px 0 rgba(255,255,255,0.6),
        950px 650px 0 rgba(255,218,121,0.4),
        150px 750px 0 rgba(168,221,184,0.45);
}
.bg-particles::after {
    width: 3px; height: 3px;
    box-shadow:
        80px 50px 0 rgba(255,255,255,0.55),
        200px 100px 0 rgba(255,218,121,0.5),
        380px 60px 0 rgba(255,255,255,0.6),
        550px 150px 0 rgba(255,183,197,0.45),
        700px 80px 0 rgba(255,255,255,0.55),
        150px 350px 0 rgba(168,221,184,0.5),
        320px 280px 0 rgba(255,218,121,0.45),
        480px 250px 0 rgba(255,255,255,0.55),
        650px 320px 0 rgba(255,183,197,0.4),
        820px 150px 0 rgba(255,255,255,0.5),
        40px 500px 0 rgba(168,221,184,0.45),
        250px 580px 0 rgba(255,218,121,0.4),
        420px 620px 0 rgba(255,255,255,0.45),
        600px 550px 0 rgba(255,218,121,0.4),
        750px 680px 0 rgba(255,183,197,0.45),
        880px 420px 0 rgba(255,255,255,0.5),
        100px 600px 0 rgba(168,221,184,0.4),
        950px 300px 0 rgba(255,218,121,0.45);
    animation-duration: 10s; animation-delay: -3s;
}
@keyframes particleFloat {
    0%, 100% { transform: translateY(0); opacity: 0.5; }
    25% { opacity: 0.9; }
    50% { transform: translateY(-40px); opacity: 0.3; }
    75% { opacity: 0.8; }
}

/* 阳光扫光 */
.sunbeam {
    position: fixed; top: -50%; left: -30%; width: 80%; height: 200%;
    background: radial-gradient(ellipse at center, rgba(255,255,255,0.06) 0%, transparent 70%);
    pointer-events: none; z-index: 0;
    animation: sunSweep 15s ease-in-out infinite;
    transform: rotate(-15deg);
}
@keyframes sunSweep {
    0%, 100% { transform: rotate(-15deg) translateX(-20%); opacity: 0.3; }
    50% { transform: rotate(-15deg) translateX(40%); opacity: 0.8; }
}

/* 飘落花瓣 */
.petal {
    position: fixed; pointer-events: none; z-index: 1;
    font-size: 20px; opacity: 0.6;
    animation: petalFall linear infinite;
}
.petal-1 { top: -5%; left: 10%; animation-duration: 14s; animation-delay: 0s; font-size: 18px; }
.petal-2 { top: -8%; left: 25%; animation-duration: 12s; animation-delay: -3s; font-size: 22px; }
.petal-3 { top: -3%; left: 50%; animation-duration: 16s; animation-delay: -6s; font-size: 16px; }
.petal-4 { top: -10%; left: 70%; animation-duration: 13s; animation-delay: -9s; font-size: 24px; }
.petal-5 { top: -6%; left: 85%; animation-duration: 15s; animation-delay: -2s; font-size: 20px; }
.petal-6 { top: -4%; left: 40%; animation-duration: 17s; animation-delay: -8s; font-size: 19px; }
@keyframes petalFall {
    0% { transform: translateY(-10vh) rotate(0deg) translateX(0); opacity: 0; }
    10% { opacity: 0.6; }
    90% { opacity: 0.5; }
    100% { transform: translateY(105vh) rotate(720deg) translateX(120px); opacity: 0; }
}

/* 卡通装饰元素 — 春天花草光斑 */
.cartoon-decor {
    position: fixed; pointer-events: none; z-index: 1; opacity: 0.10;
    filter: blur(45px);
}
.decor-1 { top: 10%; left: 3%; width: 180px; height: 180px; background: rgba(255,183,197,0.5); border-radius: 50%; animation: float1 4s ease-in-out infinite; }
.decor-2 { top: 22%; right: 5%; width: 130px; height: 130px; background: rgba(255,218,121,0.4); border-radius: 30% 70% 70% 30% / 30% 30% 70% 70%; animation: float2 5s ease-in-out infinite; }
.decor-3 { bottom: 15%; left: 5%; width: 200px; height: 200px; background: rgba(168,221,184,0.45); border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%; animation: float3 6s ease-in-out infinite; }
.decor-4 { bottom: 25%; right: 3%; width: 120px; height: 120px; background: rgba(255,183,197,0.4); border-radius: 50%; animation: float1 4.5s ease-in-out infinite reverse; }
.decor-5 { top: 45%; left: 2%; width: 100px; height: 100px; background: rgba(255,218,121,0.45); border-radius: 50%; animation: float2 5.5s ease-in-out infinite; }
.decor-6 { top: 58%; right: 2%; width: 160px; height: 160px; background: rgba(168,221,184,0.4); border-radius: 30% 70% 70% 30% / 30% 30% 70% 70%; animation: float3 7s ease-in-out infinite reverse; }

@keyframes float1 {
    0%, 100% { transform: translateY(0) rotate(0deg) scale(1); }
    25% { transform: translateY(-40px) rotate(15deg) scale(1.1); }
    50% { transform: translateY(-60px) rotate(20deg) scale(1.15); }
    75% { transform: translateY(-40px) rotate(15deg) scale(1.1); }
}
@keyframes float2 {
    0%, 100% { transform: translateY(0) rotate(0deg) scale(1); }
    25% { transform: translateY(-50px) rotate(-20deg) scale(1.12); }
    50% { transform: translateY(-70px) rotate(-25deg) scale(1.18); }
    75% { transform: translateY(-50px) rotate(-20deg) scale(1.12); }
}
@keyframes float3 {
    0%, 100% { transform: translateY(0) scale(1) rotate(0deg); }
    33% { transform: translateY(-80px) scale(1.2) rotate(10deg); }
    66% { transform: translateY(-50px) scale(1.15) rotate(-5deg); }
}

/* 主内容区 */
/* width:100% 不可省：body 为纵向 flex 容器后，本元素左右外边距为 auto，
   按 flex 规范 align-self:stretch 失效（仅当两个交叉轴外边距都非 auto 时才拉伸），
   会被算成 fit-content；而 auto-fill 网格在固有尺寸计算中只按 1 列计，
   表现为卡片塌成一行一本。显式给宽度，再用 auto 外边距居中。 */
.main { width: 100%; padding: 10px 30px 30px 30px; max-width: 1600px; margin: 0 auto; position: relative; z-index: 2; }

/* 头部 */
.header {
    background: linear-gradient(180deg, rgba(37,107,61,0.60) 0%, rgba(37,107,61,0.20) 100%);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    color: white; padding: 0;
    position: fixed; top: 0; left: 0; right: 0; z-index: 100;
}
.header-inner {
    max-width: 1600px; margin: 0 auto;
    padding: 10px 30px 14px 30px;
    display: flex; justify-content: space-between; align-items: center;
}
.header-left {
    display: flex; align-items: center; gap: 16px;
}
.header-left h1 {
    font-size: 22px; margin: 0; display: flex; align-items: center; gap: 10px;
    cursor: pointer; transition: opacity 0.2s;
}
.header-left h1:hover { opacity: 0.85; }
.header-subtitle {
    font-size: 14px; font-weight: 400; opacity: 0.7; white-space: nowrap;
}
.header-right {
    display: flex; align-items: center; gap: 10px;
}
.header-nav {
    display: flex; align-items: center; gap: 6px;
}
.header-nav-btn {
    padding: 7px 16px; border: 1.5px solid transparent; border-radius: 20px;
    background: transparent; color: rgba(255,255,255,0.8); font-size: 13px;
    cursor: pointer; transition: all 0.2s; white-space: nowrap; font-weight: 500;
}
.header-nav-btn:hover {
    background: rgba(255,255,255,0.12); color: white;
}
.header-nav-btn.active {
    background: rgba(255,255,255,0.22); color: white; font-weight: 600;
    border-color: rgba(255,255,255,0.35);
}
.header-logo {
    font-size: 22px; line-height: 1;
}

/* 用户下拉菜单 */
.user-dropdown {
    position: relative; display: inline-flex; align-items: center;
}
.user-dropdown-toggle {
    color: white; cursor: pointer; font-size: 15px; padding: 6px 10px;
    border-radius: 8px; transition: background 0.2s; white-space: nowrap; user-select: none;
}
.user-dropdown-toggle:hover { background: rgba(255,255,255,0.15); }
.user-dropdown-toggle::after {
    content: ' ▾'; font-size: 18px; opacity: 0.7; vertical-align: middle;
}
.user-dropdown-menu {
    display: none; position: absolute; top: 100%; right: 0;
    margin-top: 8px; background: white; border-radius: 10px;
    box-shadow: 0 6px 24px rgba(0,0,0,0.12); min-width: 130px;
    padding: 4px 0; z-index: 2000; overflow: hidden;
}
.user-dropdown-menu.show { display: block; }
.user-dropdown-item {
    display: block; width: 100%; padding: 8px 16px; border: none;
    background: none; text-align: left; cursor: pointer; font-size: 13px;
    color: #333; transition: all 0.15s; white-space: nowrap;
}
.user-dropdown-item:hover { background: #f0faf3; color: #256b3d; }
.user-dropdown-item-manage {
    border-bottom: 1px solid #f0f0f0; color: #555;
}

.btn {
    padding: 8px 18px; border: none; border-radius: 8px;
    cursor: pointer; font-size: 13px; transition: all 0.2s; font-weight: 500;
}
.btn-primary { background: white; color: #256b3d; font-weight: 500; }
.btn-primary:hover { background: #f0f0f0; }
.btn-ghost { background: transparent; color: white; }
.btn-ghost:hover { background: rgba(255,255,255,0.15); }
#loginBtn { font-size: 14px; }
.btn-secondary { background: #f5f5f5; color: #555; border: 1px solid #e0e4e1; }
.btn-secondary:hover { background: #e8ece9; }
.btn-save {
/* 白字按钮/标题栏用深一档的绿：原 #38a169 作底时白字仅 3.25:1，不达 WCAG AA。
   #2b7a52 -> #1f5c34 保持同一色相。
   文字色统一用 #256b3d：它在白底 6.46:1、在 #e6f7ed/#f0faf3 等浅绿底上仍有 5.2~6.1:1；
   而 #2f855a 在浅绿底上仅 3.6~4.3:1 不达 AA，故不可用于带底色的文字。
   #38a169 仅保留给边框、图标、装饰渐变（非文本 3:1 已达标）。
   全站共 13 处采用此配色，改动时请一并调整，勿单独改回。 */
    background: linear-gradient(135deg, #2b7a52 0%, #1f5c34 100%);
    color: white; box-shadow: 0 2px 8px rgba(56,161,105,0.25);
}
.btn-save:hover { box-shadow: 0 4px 14px rgba(56,161,105,0.35); transform: translateY(-1px); }
.btn-add-book {
    background: linear-gradient(135deg, #2b7a52 0%, #1f5c34 100%);
    color: white; font-weight: 600; font-size: 13px;
    padding: 7px 24px; border-radius: 24px;
    box-shadow: 0 4px 14px rgba(56,161,105,0.35);
    white-space: nowrap; flex-shrink: 0;
}
.btn-add-book:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(56,161,105,0.45);
}

/* 分类筛选栏 */
.category-bar {
    padding: 12px 0 0 0;
    background: transparent;
}
.category-bar-inner {
    max-width: 1600px; margin: 0 auto;
    padding: 14px 30px 10px 30px;
    display: flex; justify-content: space-between; align-items: center;
    gap: 16px; flex-wrap: wrap; row-gap: 12px;
}
/* 页脚：联系我们入口 + ICP 备案信息
   （位于正文之下，需盖过背景装饰层，故与 .main 同为 z-index 2） */
.site-footer {
    position: relative; z-index: 2;
    max-width: 1600px; margin: 0 auto;
    width: 100%;   /* 同上：auto 外边距会关掉 stretch，需显式宽度 */
    /* margin-top:auto 吃掉 body 纵向 flex 的剩余空间：内容不足一屏时把页脚顶到视口底部，
       内容超过一屏时退化为 0，页脚照常紧随正文（左右 auto 保持水平居中）*/
    margin-top: auto;
    padding: 8px 30px 28px 30px;
    text-align: center; font-size: 13px; line-height: 1.6;
    color: #4a6b57;   /* 页面底部渐变为浅绿 #d4f0de，此色对比度约 4.9:1，满足 AA */
    /* 联系我们与备案号同一行居中；窄屏放不下时换行 */
    display: flex; flex-wrap: wrap; justify-content: center; align-items: center;
    gap: 6px 24px;
}
/* 联系我们 / 服务说明都是 <button>（要触发弹窗，不能是链接），
   需清掉浏览器默认按钮样式，使其与 .site-footer-link 表现一致 */
.site-footer-btn {
    padding: 0; border: none; background: none;
    color: #256b3d;   /* 对比度约 5.5:1，满足 AA */
    font-size: 13px; font-weight: 700; font-family: inherit; line-height: 1.6;
    cursor: pointer; white-space: nowrap;
    transition: color 0.2s;
}
.site-footer-btn:hover { color: #1a4d2e; text-decoration: underline; }
.site-footer-link {
    color: #256b3d;   /* 对比度约 5.5:1，满足 AA */
    font-weight: 700;
    text-decoration: none; transition: color 0.2s;
}
.site-footer-link:hover { color: #1a4d2e; text-decoration: underline; }

/* 分类筛选：全部选项平铺成一行胶囊，点击即筛选，当前项高亮 */
.category-chips {
    flex: 1; min-width: 0;
    display: flex; align-items: center; flex-wrap: wrap;
    gap: 10px;
}
.category-chip {
    padding: 7px 20px; border: 1.5px solid rgba(255,255,255,0.3);
    background: rgba(255,255,255,0.12); color: rgba(255,255,255,0.85);
    border-radius: 22px; cursor: pointer; font-size: 13px; font-weight: 500;
    transition: all 0.25s; white-space: nowrap; font-family: inherit;
}
.category-chip:hover {
    border-color: rgba(255,255,255,0.6); color: white; background: rgba(255,255,255,0.2);
}
.category-chip.active {
    background: white; color: #2f855a; border-color: transparent;
    box-shadow: 0 2px 12px rgba(0,0,0,0.15); font-weight: 600;
}

/* 卡片网格 */
.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }
.card {
    background: white; border-radius: 14px; overflow: hidden;
    box-shadow: 0 4px 16px rgba(47,133,90,0.10), 0 1px 3px rgba(0,0,0,0.04);
    transition: all 0.3s; cursor: pointer;
}
.card:hover { transform: translateY(-4px); box-shadow: 0 12px 30px rgba(47,133,90,0.16), 0 2px 6px rgba(0,0,0,0.06); }

/* 右键菜单 */
.context-menu {
    position: fixed; background: white; border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.15); padding: 8px 0;
    z-index: 2000; min-width: 120px; display: none;
}
.context-menu.show { display: block; }
.context-menu-item { padding: 10px 20px; cursor: pointer; font-size: 14px; transition: background 0.2s; }
.context-menu-item:hover { background: #f5f7fa; }
.context-menu-item.danger { color: #dc3545; }

/* 封面按 1:1 方形显示；高度由宽度推导，卡片高度随栅格列宽自适应 */
.card-cover-wrap { position: relative; width: 100%; aspect-ratio: 1 / 1; overflow: hidden; }
.card-copy-tag {
    position: absolute; top: 8px; left: 8px;
    padding: 3px 10px; border-radius: 10px;
    background: rgba(56, 161, 105, 0.85); color: white;
    font-size: 11px; font-weight: 500; white-space: nowrap;
    pointer-events: none;
}
/* 已付款但创作没跑完的标记。用橙色是因为它不是状态说明而是待办 —— 用户的钱还悬着。 */
.card-unfinished-tag {
    position: absolute; top: 8px; left: 8px;
    padding: 3px 10px; border-radius: 10px;
    background: rgba(230, 126, 34, 0.92); color: white;
    font-size: 11px; font-weight: 500; white-space: nowrap;
    pointer-events: none; z-index: 1;
}
/* 左上角两个标签互斥不了（一本被别人用过、自己又没跑完的书两个都可能有），
   所以「使用 N 次」往下让一格给「待完成」。 */
.card-copy-tag.below-unfinished { top: 40px; }
.card-cover { width: 100%; height: 100%; object-fit: cover; background: #f0f0f0; }

/* 卡片右上角的按钮组。竖排是因为删除和续跑会同时出现，横排会一起挤出卡片。
   两个都常驻可见，不藏在 hover 之后 —— 续跑对应一笔已经花掉的钱，删除是唯一的
   删除入口，都不能等着被发现。 */
.card-corner-actions {
    position: absolute; top: 8px; right: 8px;
    display: flex; flex-direction: column; align-items: flex-end; gap: 6px;
    z-index: 2;
}
.card-action-tag {
    display: inline-flex; align-items: center; gap: 3px;
    padding: 3px 10px; border-radius: 10px; border: none;
    font-size: 11px; font-weight: 500; cursor: pointer;
    white-space: nowrap; transition: all 0.15s;
    font-family: inherit;
}
.card-action-resume {
    background: #e67e22; color: white;
    box-shadow: 0 1px 4px rgba(230,126,34,0.35);
}
.card-action-resume:hover { background: #cf6d15; }
.card-action-tag svg { width: 11px; height: 11px; }

/* 删除按钮：红色圆形 + 垃圾桶图标，一眼能认出是破坏性操作。 */
.card-delete-btn {
    width: 28px; height: 28px; padding: 0; border: none; border-radius: 50%;
    display: inline-flex; align-items: center; justify-content: center;
    background: #dc3545; color: #fff; cursor: pointer;
    box-shadow: 0 2px 6px rgba(220,53,69,0.35);
    transition: background 0.2s, transform 0.15s;
}
.card-delete-btn:hover { background: #c82333; transform: scale(1.08); }
.card-delete-btn svg { width: 15px; height: 15px; }
/* 分类标签叠加在封面图内、贴近底部。
   注意 .card-category-tag 还被管理页绘本表格（main.js:1074）复用，
   故叠加用的浅色底只限定在 .card-cover-wrap 内，表格里仍是原来的浅灰标签。 */
.card-categories {
    position: absolute; bottom: 8px; left: 8px; right: 8px;
    display: flex; flex-wrap: wrap; gap: 5px;
    pointer-events: none; z-index: 1;
}
.card-category-tag { padding: 3px 8px; background: #f0f0f0; border-radius: 10px; font-size: 11px; color: #666; }
.card-cover-wrap .card-category-tag {
    background: rgba(255,255,255,0.92); color: #3a3a3a;
    box-shadow: 0 1px 4px rgba(0,0,0,0.12);
}
.card-desc {
    font-size: 14px; color: #666; line-height: 1.5;
    display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical;
    overflow: hidden; margin-bottom: 15px;
}
.card-meta {
    display: flex; justify-content: space-between; align-items: center;
    font-size: 12px; color: #999; border-top: 1px solid #f0f0f0; padding-top: 12px;
}
.card-actions { display: flex; gap: 8px; }
.card-btn { padding: 6px 12px; border: none; border-radius: 4px; cursor: pointer; font-size: 12px; transition: all 0.2s; }
.card-btn-edit { background: #e6f7ed; color: #256b3d; }
.card-btn-edit:hover { background: #c6f0d4; }
.card-btn-delete { background: #fce8e6; color: #dc3545; }
.card-btn-delete:hover { background: #fadbd9; }
.card-btn-preview { background: #e8f5e9; color: #28a745; }
.card-btn-preview:hover { background: #c8e6c9; }
.card-btn-export { background: #fff3e0; color: #ff9800; }
.card-btn-export:hover { background: #ffe0b2; }

/* 空状态 */
.empty-state { text-align: center; padding: 60px 20px; color: #999; }
.empty-state-icon { font-size: 48px; margin-bottom: 15px; }

/* 模态框 */
.modal {
    display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.5); z-index: 3000; justify-content: center; align-items: center;
}
.modal.show { display: flex; }
.modal-content {
    background: white; border-radius: 12px; width: 90%; max-width: 600px;
    max-height: 90vh; overflow-y: auto; animation: modalIn 0.3s;
}
@keyframes modalIn {
    from { opacity: 0; transform: scale(0.9); }
    to { opacity: 1; transform: scale(1); }
}
.modal-header {
    padding: 20px; border-bottom: 1px solid #eee;
    display: flex; justify-content: space-between; align-items: center;
}
.modal-header h2 { font-size: 18px; }
.modal-close { background: none; border: none; font-size: 24px; cursor: pointer; color: #999; }
.modal-close:hover { color: #333; }
.modal-body { padding: 20px; }
.form-group { margin-bottom: 18px; }
.form-group label {
    display: block; margin-bottom: 6px; font-weight: 600; color: #37474f;
    font-size: 13px; letter-spacing: 0.3px;
}
.form-group label .required { color: #e53e3e; margin-left: 2px; }
.form-group input, .form-group select, .form-group textarea {
    width: 100%; padding: 10px 14px; border: 1.5px solid #e0e4e1;
    border-radius: 8px; font-size: 14px; transition: all 0.2s;
    background: white; color: #333;
}
.form-group input:focus, .form-group select:focus, .form-group textarea:focus {
    outline: none; border-color: #38a169; box-shadow: 0 0 0 3px rgba(56,161,105,0.08);
}
.form-group textarea { min-height: 80px; resize: vertical; }
.form-hint { margin-top: 6px; font-size: 12px; color: #8a938d; }
.form-group select { cursor: pointer; appearance: none; background: white url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23666' fill='none' stroke-width='1.5'/%3E%3C/svg%3E") no-repeat right 14px center; padding-right: 36px; }
.form-group input.input-readonly,
.form-group textarea.input-readonly {
    background: #f0f4f1; color: #666; cursor: not-allowed;
    border-color: #dde5e0; user-select: none;
}
.form-group input.input-readonly:focus,
.form-group textarea.input-readonly:focus {
    border-color: #dde5e0; box-shadow: none;
}
.modal-footer { padding: 16px 24px; border-top: 1px solid #e8ece9; background: white; display: flex; justify-content: flex-end; gap: 10px; border-radius: 0 0 12px 12px; }
.modal-body { padding: 24px; background: #f9fafb; }
.modal-header {
    padding: 14px 24px; border-bottom: 1px solid #e8ece9;
    background: white; display: flex; justify-content: space-between; align-items: center;
    border-radius: 12px 12px 0 0; min-height: 52px;
}
.modal-header h2 { font-size: 18px; font-weight: 600; }

/* 抽屉 */
.drawer {
    position: fixed; top: 0; right: 0; width: 600px; max-width: 100%; height: 100%;
    background: #f9fafb; z-index: 2000; display: flex; flex-direction: column;
    transform: translateX(100%); transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: -8px 0 40px rgba(0,0,0,0.12);
}
.drawer.show { transform: translateX(0); }
.drawer-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.4); z-index: 1999;
    opacity: 0; visibility: hidden; transition: opacity 0.3s, visibility 0.3s;
}
.drawer-overlay.show { opacity: 1; visibility: visible; }

.drawer-header {
    padding: 14px 24px;
    background: linear-gradient(135deg, #2b7a52 0%, #1f5c34 100%);
    color: white; display: flex; justify-content: space-between; align-items: center;
    flex-shrink: 0; min-height: 52px;
}
.drawer-header h2 { font-size: 18px; margin: 0; font-weight: 600; color: white; }
.drawer-close {
    background: rgba(255,255,255,0.15); border: none; width: 32px; height: 32px;
    border-radius: 50%; cursor: pointer; color: white; font-size: 22px; line-height: 1;
    display: flex; align-items: center; justify-content: center; transition: background 0.2s;
}
.drawer-close:hover { background: rgba(255,255,255,0.3); }

.drawer-body { flex: 1; overflow-y: auto; padding: 24px; background: #f9fafb; }

/* 步骤条 */
.step-indicator { display: flex; align-items: center; justify-content: center; margin-bottom: 24px; gap: 0; }
.step-item { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.step-num {
    width: 28px; height: 28px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
    font-size: 12px; font-weight: 600; background: #e0e4e1; color: #999; transition: all 0.3s;
}
.step-item.active .step-num { background: #2b7a52; color: white; }
.step-item.done .step-num { background: #2b7a52; color: white; }
.step-label { font-size: 11px; color: #999; transition: color 0.3s; white-space: nowrap; }
.step-item.active .step-label { color: #256b3d; font-weight: 600; }
.step-item.done .step-label { color: #256b3d; }
.step-line { width: 90px; height: 2px; background: #e0e4e1; margin: 0 16px; margin-bottom: 16px; transition: background 0.3s; }
.step-line.done { background: #2b7a52; }   /* 与深一档的 .step-num 保持同色，勿单独改回 */

/* 步骤内容 */
.step-content { animation: fadeIn 0.3s; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: translateY(0); } }
.step-pages-list { display: flex; flex-direction: column; gap: 12px; }
.step-page-card {
    background: white; border: 1.5px solid #e0e4e1; border-radius: 10px; padding: 14px;
}
.step-page-card-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.step-page-card-num { font-size: 12px; font-weight: 600; color: #256b3d; }
.step-page-card-actions { display: flex; gap: 6px; }
.step-page-action-btn {
    display: inline-flex; align-items: center; gap: 2px;
    padding: 2px 8px; border: 1px solid #d0ddd4; border-radius: 5px;
    background: white; color: #555; font-size: 11px; cursor: pointer;
    transition: all 0.15s; font-family: inherit;
}
.step-page-action-btn:hover { background: #f0faf3; border-color: #38a169; color: #256b3d; }
.step-page-action-btn svg { width: 11px; height: 11px; }
.step-page-action-delete { color: #c44; border-color: #e8d0d0; }
.step-page-action-delete:hover { background: #fff0f0; border-color: #d44; color: #d44; }
.step-page-card label { font-size: 11px; color: #888; display: block; margin-bottom: 4px; }
.step-page-card textarea {
    width: 100%; min-height: 50px; border: 1px solid #e0e4e1; border-radius: 6px;
    padding: 8px 10px; font-size: 13px; resize: vertical; font-family: inherit;
}
.step-page-card textarea:focus { outline: none; border-color: #38a169; }
.step-page-card .step-page-img {
    width: 100%; aspect-ratio: 1; object-fit: cover;
    border-radius: 6px; margin-top: 8px;
}
.step-page-card .step-page-text-readonly {
    font-size: 13px; color: #555; line-height: 1.6; margin-top: 6px;
    background: #f5f7f6; padding: 10px; border-radius: 6px;
}

.step-ai-btn {
    padding: 8px 16px; border: 1.5px dashed #38a169; border-radius: 8px;
    background: #f0faf4; color: #256b3d; font-size: 13px; font-weight: 500;
    cursor: pointer; transition: all 0.2s; font-family: inherit;
}
.step-ai-btn:hover { background: #e6f5ec; border-color: #2d8a56; color: #2d8a56; }
.step-ai-btn:disabled { opacity: 0.6; cursor: not-allowed; }
.step-ai-btn-sm { padding: 4px 10px; font-size: 11px; border-radius: 6px; }
.step-ai-btn-delete {
    border-color: #e8c9c9; background: #fff8f8; color: #c44;
}
.step-ai-btn-delete:hover { background: #fff0f0; border-color: #d44; color: #d44; }

.drawer-footer {
    padding: 16px 24px; border-top: 1px solid #e8ece9;
    background: white; display: flex; justify-content: flex-end; gap: 10px;
    flex-shrink: 0;
}

/* 用户管理 */
.user-manage-table-wrap {
    overflow-x: auto; background: white; border-radius: 12px;
    padding: 16px 20px; box-shadow: 0 2px 12px rgba(0,0,0,0.06);
}
/* 绘本管理 / 用户管理 / 账单 管理视图的列表：半透明毛玻璃，透出页面绿色渐变 */
#userManageView .user-manage-table-wrap,
#bookManageView .user-manage-table-wrap,
#billingManageView .user-manage-table-wrap {
    background: rgba(255,255,255,0.2);
    -webkit-backdrop-filter: blur(6px);
    backdrop-filter: blur(6px);
}
#userManageView .user-manage-table thead th,
#bookManageView .user-manage-table thead th,
#billingManageView .user-manage-table thead th { border-bottom-color: rgba(232,236,233,0.6); }
#userManageView .user-manage-table tbody tr,
#bookManageView .user-manage-table tbody tr,
#billingManageView .user-manage-table tbody tr { border-bottom: none; }
#userManageView .user-manage-table tbody tr:hover,
#bookManageView .user-manage-table tbody tr:hover,
#billingManageView .user-manage-table tbody tr:hover { background: rgba(246,250,247,0.5); }
/* 管理视图：正文/时间列改黑，绿底上对比度更佳 */
#userManageView .user-manage-table tbody td,
#bookManageView .user-manage-table tbody td,
#billingManageView .user-manage-table tbody td { color: #000; }
#userManageView .user-manage-table tbody td.col-date,
#bookManageView .user-manage-table tbody td.col-date,
#billingManageView .user-manage-table tbody td.col-date { color: #000; }
.user-manage-table {
    width: 100%; border-collapse: collapse;
}
.user-manage-table thead th {
    text-align: left; padding: 12px 14px; font-size: 13px; font-weight: 600;
    color: #14532d; border-bottom: 2px solid #e8ece9;
    white-space: nowrap;
}
.user-manage-table thead th.col-action { text-align: center; }
/* 管理列表序号列 */
.user-manage-table thead th.col-index { text-align: center; width: 56px; }
.user-manage-table tbody td.col-index { text-align: center; color: #000; font-size: 12px; }
.user-manage-table tbody tr {
    border-bottom: 1px solid #f0f3f1; transition: background 0.15s;
}
.user-manage-table tbody tr:hover { background: #f6faf7; }
.user-manage-table tbody td {
    padding: 13px 14px; font-size: 14px; color: #333; vertical-align: middle;
}
.user-manage-table tbody td.col-date { color: #888; font-size: 13px; }
.user-manage-table tbody td.col-action { text-align: center; }
.role-badge {
    display: inline-block; padding: 4px 14px; border-radius: 12px; font-size: 12px; font-weight: 500;
}
.role-admin { background: linear-gradient(135deg, #2b7a52, #1f5c34); color: white; }
.role-user { background: #e8ece9; color: #555; }
.pin-tag {
    display: inline-block; margin-right: 6px; padding: 1px 6px;
    font-size: 11px; line-height: 1.4; border-radius: 3px;
    background: #fff7e6; color: #d97706; border: 1px solid #fde68a;
    vertical-align: middle;
}
.use-count-tag {
    display: inline-block; padding: 2px 10px; border-radius: 10px;
    background: rgba(56, 161, 105, 0.85); color: white;
    font-size: 11px; font-weight: 500; white-space: nowrap;
}
.muted-count { color: #bbb; }
.btn-delete-user {
    padding: 5px 14px; border: 1px solid #e8c9c9; border-radius: 6px;
    background: white; color: #d44; font-size: 12px; cursor: pointer;
    transition: all 0.2s;
}
.btn-delete-user:hover { background: #fff0f0; border-color: #d44; }
.current-user-tag { color: #aaa; font-size: 12px; }

.btn-manage-action {
    padding: 4px 12px; border: 1px solid #d0ddd4; border-radius: 5px;
    background: white; color: #2f855a; font-size: 12px; cursor: pointer;
    transition: all 0.15s; margin: 0 2px;
}
.btn-manage-action:hover { background: #f0faf3; border-color: #2f855a; }
.btn-manage-action:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-manage-delete { color: #d44; border-color: #e8c9c9; }
.refunded-tag {
    padding: 3px 10px; border: 1px solid #e2e5e9; border-radius: 5px;
    background: #f4f5f7; color: #98a1ab; font-size: 12px; white-space: nowrap;
}
.btn-manage-delete:hover { background: #fff0f0; border-color: #d44; }

/* 管理视图（主区域表格） */
.manage-view {
    background: transparent; padding: 0; margin-top: 12px;
}
.manage-toolbar {
    display: flex; justify-content: space-between; align-items: center;
    margin-bottom: 20px; gap: 16px; flex-wrap: wrap;
}
.manage-toolbar-left {
    display: flex; align-items: center; gap: 10px;
}
.manage-toolbar-right {
    display: flex; align-items: center; gap: 10px;
}
.manage-search-input {
    padding: 7px 16px; border: 1.5px solid #d0ddd4; border-radius: 22px;
    font-size: 13px; width: 180px; outline: none; background: transparent;
    color: #fff; transition: border-color 0.2s;
}
.manage-search-input:focus { border-color: #fff; }
.manage-search-input::placeholder { color: rgba(255,255,255,0.7); }
.manage-filter-select {
    padding: 7px 14px; border: 1.5px solid #d0ddd4; border-radius: 22px;
    font-size: 13px; outline: none; background: transparent;
    color: #fff; cursor: pointer;
}

/* 预览 */
.preview-modal .modal-content { max-width: 900px; }
.preview-book-title { text-align: center; font-size: 24px; margin-bottom: 10px; }
.preview-book-category { text-align: center; color: #256b3d; margin-bottom: 20px; }
.preview-book-desc { background: #f9f9f9; padding: 15px; border-radius: 8px; margin-bottom: 20px; line-height: 1.6; }
.preview-pages { display: flex; flex-direction: column; gap: 30px; }
.preview-page { border: 1px solid #eee; border-radius: 8px; padding: 20px; }
.preview-page-header { font-weight: 600; margin-bottom: 10px; color: #256b3d; }
.preview-page-text { line-height: 1.6; margin-bottom: 15px; }
.preview-page-image { max-width: 100%; max-height: 300px; border-radius: 8px; display: block; margin: 0 auto; }

/* 分页管理 */
.pages-section { margin-top: 20px; border-top: 1px solid #e8ece9; padding-top: 20px; }
.pages-section h3 { margin-bottom: 15px; font-size: 16px; font-weight: 600; color: #37474f; }
.page-item {
    background: white; border-radius: 10px; padding: 16px; margin-bottom: 12px;
    border: 1px solid #e8ece9; transition: box-shadow 0.2s;
}
.page-item:hover { box-shadow: 0 2px 12px rgba(0,0,0,0.06); }
.page-item-header {
    display: flex; justify-content: space-between; align-items: center;
    margin-bottom: 12px; padding-bottom: 10px; border-bottom: 1px solid #f0f2f1;
}
.page-item-header strong { color: #256b3d; font-size: 14px; }
.page-item-actions { display: flex; gap: 6px; }
.page-item-actions button {
    padding: 5px 12px; border: 1px solid #e0e4e1; border-radius: 6px;
    background: white; cursor: pointer; font-size: 12px; transition: all 0.15s;
}
.page-item-actions button:hover { background: #f0faf3; border-color: #38a169; color: #256b3d; }
.page-item-content { display: flex; gap: 15px; }
.page-item-text { flex: 1; font-size: 14px; line-height: 1.6; color: #555; }
.page-item-image {
    width: 100px; height: 100px; object-fit: cover; border-radius: 8px;
    background: #f0f2f1; flex-shrink: 0; overflow: hidden;
}
.page-item-image img { width: 100%; height: 100%; object-fit: cover; border-radius: 8px; }
.add-page-btn {
    width: 100%; padding: 14px; border: 2px dashed #c0c8c2; background: white;
    border-radius: 10px; cursor: pointer; color: #256b3d; font-size: 14px;
    font-weight: 500; transition: all 0.2s;
}
.add-page-btn:hover { border-color: #38a169; background: #f0faf3; }

/* 图片上传 */
.image-upload-area {
    border: 2px dashed #c0c8c2; border-radius: 10px; padding: 32px;
    text-align: center; cursor: pointer; transition: all 0.2s;
    background: white; color: #999; font-size: 14px;
}
.image-upload-area:hover { border-color: #38a169; background: #f0faf3; color: #256b3d; }
.image-upload-area img { max-width: 200px; max-height: 150px; border-radius: 8px; display: block; margin: 0 auto; }

/* 分类复选框 */
.category-checkbox { display: none; }
.category-tag {
    display: inline-block; padding: 6px 14px; border: 1px solid #ddd;
    border-radius: 20px; cursor: pointer; transition: all 0.2s;
    font-size: 13px; color: #666; background: white; user-select: none;
}
.category-tag:hover { border-color: #38a169; color: #256b3d; }
.category-checkbox:checked + .category-tag {
    background: linear-gradient(135deg, #2b7a52 0%, #1f5c34 100%);
    color: white; border-color: #2b7a52;
}

/* 统计信息 */
.stats { display: flex; gap: 20px; margin-bottom: 20px; }
.stat-item { background: white; padding: 15px 25px; border-radius: 8px; box-shadow: 0 2px 8px rgba(0,0,0,0.06); }
.stat-item .number { font-size: 24px; font-weight: 700; color: #256b3d; }
.stat-item .label { font-size: 12px; color: #999; }

/* 绘本阅读器 - 3D翻书效果 */
.book-reader {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: radial-gradient(ellipse at center, #1a3d28 0%, #0d1f14 100%);
    z-index: 2000; display: flex; flex-direction: column;
}
.reader-header {
    background: transparent;
    color: white; padding: 12px 20px;
    /* 三栏网格：左右各占 1fr，标题居中列。
       不用 flex + space-between —— 左右元素宽度不等（进度文字 vs 36px 关闭按钮）时标题会偏心。
       中列 minmax(0, auto) 允许被压缩，配合 .reader-title 的省略号避免长书名撑破布局。 */
    display: grid; grid-template-columns: 1fr minmax(0, auto) 1fr; align-items: center;
    flex-shrink: 0;
}
.reader-close {
    justify-self: end;
    background: rgba(255,255,255,0.1); border: none; width: 36px; height: 36px;
    border-radius: 50%; cursor: pointer; color: white; font-size: 24px;
    display: flex; align-items: center; justify-content: center; transition: background 0.2s;
}
.reader-close:hover { background: rgba(255,255,255,0.25); }
.reader-title {
    font-size: 26px; margin: 0; font-weight: 600; text-align: center;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
/* 左上角页码进度。tabular-nums 让数字等宽，翻页时"1"→"2"不会左右抖动 */
.reader-progress { font-size: 14px; opacity: 0.8; font-variant-numeric: tabular-nums; }
.reader-content {
    flex: 1; display: flex; justify-content: center; align-items: center;
    /* padding 直接吃掉书本可用高度（1366x768 等矮屏的瓶颈在此），故收紧到 16px */
    padding: 16px; overflow: hidden; position: relative;
}

/* 翻页箭头 */
.reader-arrow {
    position: absolute; top: 50%; transform: translateY(-50%);
    width: 48px; height: 48px; border-radius: 50%;
    background: rgba(255,255,255,0.1); border: 2px solid rgba(255,255,255,0.25);
    color: white; font-size: 24px; cursor: pointer; z-index: 10;
    display: flex; align-items: center; justify-content: center;
    transition: all 0.2s; backdrop-filter: blur(6px);
}
.reader-arrow:hover { background: rgba(255,255,255,0.2); border-color: rgba(255,255,255,0.5); }
.reader-arrow:disabled { opacity: 0.3; cursor: default; }
.reader-arrow-prev { left: 20px; }
.reader-arrow-next { right: 20px; }

/* PageFlip 挂载点：自研 3D 翻页结构已删除，尺寸/变换由库自管（.stf__parent） */
/* max-width 须 >= 2 倍 PageFlip 的 maxWidth（main.js 中为 600），
   否则对开时书宽被这里卡住、页面顶不到上限。600*2=1200，留 1200。 */
.reader-book-wrap {
    width: 100%; max-width: 1200px; position: relative;
    display: flex; justify-content: center;
}
.reader-book {
    position: relative; margin: 0 auto;
}

/* 单页内容（buildSinglePageHTML 复用；PageFlip 每页包装为 .reader-flip-page） */
.reader-flip-page {
    width: 100%; height: 100%;
}
.reader-page-inner {
    width: 100%; height: 100%; position: relative;
    display: flex; align-items: center; justify-content: center;
    overflow: hidden;
    background: #fdfdf9;
}

/* 图片填满页面 */
.reader-page-image {
    width: 100%; height: 100%; object-fit: cover;
    position: absolute; top: 0; left: 0;
}

/* 文字覆盖在图片上 */
.reader-page-text {
    position: absolute; bottom: 0; left: 0; right: 0;
    padding: 40px 20px 20px;
    font-family: 'KaiTi', 'STKaiti', '楷体', 'Noto Serif SC', 'SimSun', serif;
    font-size: 15px; line-height: 1.9; text-align: center; color: #2c2c2c;
    background: linear-gradient(to top,
        rgba(255,255,255,0.95) 0%,
        rgba(255,255,255,0.85) 25%,
        rgba(255,255,255,0.5) 50%,
        transparent 100%);
    letter-spacing: 1px;
    font-weight: 500;
}

/* 无图片时纯文字居中 */
.reader-page-text-only {
    position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
    width: 80%; font-family: 'KaiTi', 'STKaiti', '楷体', 'Noto Serif SC', 'SimSun', serif;
    font-size: 16px; line-height: 2; text-align: center; color: #3a3a3a;
    letter-spacing: 1.5px; font-weight: 500;
}

/* 单页图片加载失败占位 */
.reader-page-broken {
    position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
    width: 70%; padding: 16px; text-align: center;
    font-size: 14px; color: #9a9a9a; border-radius: 10px;
    background: #f5f3ee; border: 1px dashed #d8d4c8;
}

.reader-footer {
    padding: 10px 20px; display: flex; justify-content: center; align-items: center; gap: 20px;
    flex-shrink: 0;
    /* 三个按钮（创作/下载/分享）在窄屏放不下一行时换行，而不是溢出到屏幕外 */
    flex-wrap: wrap;
}
.reader-footer-btn {
    padding: 12px 36px; border: none; border-radius: 28px;
    font-size: 15px; font-weight: 600; cursor: pointer; transition: all 0.25s;
    letter-spacing: 0.5px;
}
.reader-footer-btn-create {
    background: linear-gradient(135deg, #2b7a52, #1f5c34);
    color: white; box-shadow: 0 4px 15px rgba(56,161,105,0.35);
}
.reader-footer-btn-create:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 22px rgba(56,161,105,0.5);
}
.reader-footer-btn-pdf {
    background: rgba(255,255,255,0.1);
    color: rgba(255,255,255,0.9);
    border: 1.5px solid rgba(255,255,255,0.25);
    backdrop-filter: blur(10px);
}
.reader-footer-btn-pdf:hover {
    background: rgba(255,255,255,0.2);
    border-color: rgba(255,255,255,0.45);
}
/* 分享：与「下载PDF」同一族的半透明描边风格，用绿色调区分出主次 */
.reader-footer-btn-share {
    background: rgba(56,161,105,0.22);
    color: rgba(255,255,255,0.95);
    border: 1.5px solid rgba(255,255,255,0.25);
    backdrop-filter: blur(10px);
}
.reader-footer-btn-share:hover {
    background: rgba(56,161,105,0.38);
    border-color: rgba(255,255,255,0.45);
}

/* 窄屏（手机）：收窄底部按钮的内边距，让三个按钮尽量排在一行。
   默认的 padding: 12px 36px 三个按钮合计约 460px，375px 屏幕必然换行。 */
@media (max-width: 560px) {
    .reader-footer { gap: 10px; padding: 10px 12px; }
    .reader-footer-btn { padding: 10px 18px; font-size: 14px; }
}

.reader-empty { text-align: center; color: rgba(255,255,255,0.6); padding: 40px; }
.reader-empty .empty-state-icon { font-size: 48px; margin-bottom: 15px; }

/* ===== 分享弹层 ===== */
.share-tip { margin: 0 0 14px; font-size: 13px; color: #666; text-align: center; }
.share-qr-wrap { display: flex; justify-content: center; margin-bottom: 18px; }
.share-qr {
    width: 180px; height: 180px; display: block;
    padding: 8px; background: white; border: 1px solid #e8ece9; border-radius: 10px;
}
/* 输入框撑满剩余宽度：min-width:0 必须保留，否则 flex 子项不会收缩、会把按钮挤出弹层 */
.share-link-row { display: flex; gap: 8px; }
.share-link-row input {
    flex: 1; min-width: 0; padding: 10px 14px; font-size: 13px;
    border: 1.5px solid #e0e4e1; border-radius: 8px; background: white; color: #333;
}
.share-link-row input:focus { outline: none; border-color: #38a169; }

/* 下载进度弹窗 */
.download-modal {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.5); z-index: 3000;
    display: none; justify-content: center; align-items: center;
}
.download-modal.show { display: flex; }
.download-content { background: white; border-radius: 16px; padding: 40px; text-align: center; min-width: 300px; }
.download-spinner {
    width: 60px; height: 60px; border: 4px solid #f0f0f0;
    border-top: 4px solid #38a169; border-radius: 50%;
    animation: spin 1s linear infinite; margin: 0 auto 20px;
}
@keyframes spin { to { transform: rotate(360deg); } }
.download-title { font-size: 16px; color: #333; margin-bottom: 10px; }
.download-actions { display: flex; gap: 15px; justify-content: center; }
.download-success { color: #28a745; font-size: 48px; margin-bottom: 10px; }

/* ========== AI创作进度弹层 ========== */
/* 外壳直接复用 .modal 那一套（头部标题栏 + 灰底内容区 + 白色按钮栏），
   与「导入绘本」等弹层是同一视觉，这里只覆盖宽度与内容区排版。
   .modal 的 z-index 是 3000，高于 .drawer(2000)：弹层出现时抽屉已关闭，不会叠着 */
.ai-progress-content { max-width: 460px; }

/* 进行中不再有转圈动画，也不再有「正在创作绘本…」标题：标题栏已经写着「AI 创作」，
   下面阶段列表里正在跑的那一行自带转圈圆点，那两个都是重复信息。
   标题样式仍被成功/失败两个结果页用着，故保留 */
.ai-progress-title { font-size: 16px; font-weight: 600; color: #256b3d; margin-bottom: 14px; }

/* 阶段列表：白底卡片浮在灰底内容区上，行间用分隔线而不是额外留白。
   状态：进行中=转圈，完成=绿底对勾，失败=红底叉，未开始=灰圈 */
.ai-stage-list {
    background: white; border: 1px solid #e8ece9; border-radius: 10px;
    padding: 2px 14px; margin-bottom: 14px;
}
.ai-stage { display: flex; align-items: center; gap: 10px; padding: 11px 0; }
.ai-stage + .ai-stage { border-top: 1px solid #f0f3f1; }
.ai-stage-dot {
    width: 16px; height: 16px; border-radius: 50%; box-sizing: border-box;
    border: 2px solid #dfe4e1; flex-shrink: 0; position: relative;
}
.ai-stage.running .ai-stage-dot {
    border-color: #e6f0ea; border-top-color: #38a169;
    animation: spin 0.8s linear infinite;
}
.ai-stage.done .ai-stage-dot { background: #38a169; border-color: #38a169; }
.ai-stage.done .ai-stage-dot::after {
    content: ''; position: absolute; left: 4px; top: 1px;
    width: 4px; height: 8px; border: solid white;
    border-width: 0 2px 2px 0; transform: rotate(45deg);
}
/* 失败态：文字与生图并发跑，先失败的那一步当场标红，
   用户不必等另一个跑完（可能还要十几分钟）才知道出了什么问题 */
.ai-stage.failed .ai-stage-dot { background: #e53e3e; border-color: #e53e3e; }
.ai-stage.failed .ai-stage-dot::before,
.ai-stage.failed .ai-stage-dot::after {
    content: ''; position: absolute; left: 4.5px; top: 1.5px;
    width: 3px; height: 9px; background: white;
}
.ai-stage.failed .ai-stage-dot::before { transform: rotate(45deg); }
.ai-stage.failed .ai-stage-dot::after { transform: rotate(-45deg); }
.ai-stage.failed .ai-stage-name { color: #c53030; }
.ai-stage.failed .ai-stage-detail { color: #e53e3e; }

.ai-stage-name { font-size: 13px; color: #b0b7b3; flex: 1; }
.ai-stage.running .ai-stage-name { color: #256b3d; font-weight: 600; }
.ai-stage.done .ai-stage-name { color: #4a5450; }
.ai-stage-detail { font-size: 12px; color: #9aa39d; font-variant-numeric: tabular-nums; }
.ai-stage.running .ai-stage-detail { color: #38a169; }

.ai-progress-hint {
    font-size: 12px; color: #8a938d; line-height: 1.7; text-align: left;
    background: white; border: 1px solid #e8ece9; border-radius: 10px;
    padding: 10px 12px; margin: 0;
}
/* 失败原因可能为空（服务端没给 detail），别留一个空白卡片 */
.ai-progress-hint:empty { display: none; }
.ai-progress-hint b { color: #256b3d; }

/* 成功/失败是「结果页」：图标与文案居中，没有阶段列表 */
.ai-progress-result .modal-body { text-align: center; }
.ai-progress-result .ai-progress-title { margin-bottom: 12px; }
.ai-progress-result .download-success { font-size: 32px; margin-bottom: 8px; }
.ai-progress-error { color: #e0a02a; font-size: 32px; margin-bottom: 8px; }
.ai-progress-error svg { width: 32px; height: 32px; }

/* ========== 登录/注册弹层 ========== */
.auth-modal-content {
    max-width: 420px; border-radius: 16px; overflow: hidden;
    position: relative; animation: authSlideIn 0.35s ease;
}
@keyframes authSlideIn {
    from { opacity: 0; transform: translateY(-30px) scale(0.95); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}
.auth-close {
    position: absolute; top: 14px; right: 16px; z-index: 10;
    font-size: 24px; color: rgba(255,255,255,0.8); background: none; border: none; cursor: pointer;
}
.auth-close:hover { color: white; }

/* 顶部品牌区 */
.auth-header {
    background: linear-gradient(135deg, #2b7a52 0%, #1f5c34 100%);
    padding: 34px 30px 26px; text-align: center; color: white;
}
/* 品牌标识：沿用站头同一个 emoji（项目无独立 logo 图片），
   深绿底上加半透明圆底托一下，避免嫩芽在暗色上发闷 */
.auth-logo {
    width: 64px; height: 64px; margin: 0 auto 14px;
    display: flex; align-items: center; justify-content: center;
    background: rgba(255,255,255,0.16);
    border: 1.5px solid rgba(255,255,255,0.3);
    border-radius: 50%;
    font-size: 32px; line-height: 1;
    box-shadow: 0 4px 14px rgba(0,0,0,0.14);
}
.auth-header h2 { font-size: 20px; margin: 0 0 6px; font-weight: 600; }
.auth-header p { font-size: 13px; margin: 0; opacity: 0.85; }

/* 表单区 */
.auth-body { padding: 28px 30px 34px; background: white; }

.auth-input-group {
    position: relative; display: flex; align-items: center;
    margin-bottom: 18px;
    border: 1.5px solid #e0e0e0; border-radius: 10px;
    transition: border-color 0.2s, box-shadow 0.2s; overflow: hidden;
}
.auth-input-group:focus-within {
    border-color: #38a169; box-shadow: 0 0 0 3px rgba(56,161,105,0.1);
}
.auth-input-icon {
    padding: 0 12px; font-size: 16px; opacity: 0.5; flex-shrink: 0;
}
.auth-input-group input {
    flex: 1; border: none; padding: 14px 8px 14px 0;
    font-size: 15px; outline: none; background: none; min-width: 0;
}

/* 错误提示 */
.auth-error {
    display: flex; align-items: center; gap: 8px;
    padding: 10px 14px; margin-bottom: 16px;
    background: #fff0f0; border-radius: 8px;
    color: #dc3545; font-size: 13px;
    animation: authShake 0.4s ease;
}
@keyframes authShake {
    0%, 100% { transform: translateX(0); }
    20% { transform: translateX(-6px); }
    40% { transform: translateX(6px); }
    60% { transform: translateX(-4px); }
    80% { transform: translateX(3px); }
}

/* 提交按钮 */
.auth-submit-btn {
    width: 100%; padding: 15px; border: none;
    border-radius: 10px; cursor: pointer; font-size: 16px; font-weight: 600;
    color: white; transition: all 0.2s;
    background: linear-gradient(135deg, #2b7a52 0%, #1f5c34 100%);
}
.auth-submit-btn:hover { transform: translateY(-1px); box-shadow: 0 4px 15px rgba(56,161,105,0.35); }
.auth-submit-btn:active { transform: scale(0.98); }
.auth-submit-btn.loading { pointer-events: none; opacity: 0.7; }
.auth-submit-btn.loading::after {
    content: '...'; animation: authDots 1.2s steps(4, end) infinite;
}
@keyframes authDots {
    0% { content: ''; } 25% { content: '.'; }
    50% { content: '..'; } 75% { content: '...'; }
}

/* ===== Toast 消息提示 ===== */
.toast-container {
    position: fixed; top: 70px; left: 50%; transform: translateX(-50%);
    z-index: 10000; display: flex; flex-direction: column; gap: 8px;
    pointer-events: none;
}
.toast {
    display: flex; align-items: center; gap: 8px;
    padding: 10px 20px; border-radius: 10px;
    font-size: 14px; font-weight: 500; color: #333;
    background: white; box-shadow: 0 4px 20px rgba(0,0,0,0.12);
    animation: toastIn 0.3s ease-out;
    pointer-events: auto; max-width: 360px;
}
.toast.toast-out { animation: toastOut 0.25s ease-in forwards; }
.toast svg { width: 16px; height: 16px; flex-shrink: 0; }
.toast-success { border-left: 3px solid #38a169; }
.toast-success svg { color: #38a169; }
.toast-error { border-left: 3px solid #e53e3e; }
.toast-error svg { color: #e53e3e; }
.toast-warn  { border-left: 3px solid #d69e2e; }
.toast-warn svg  { color: #d69e2e; }
.toast-info  { border-left: 3px solid #3182ce; }
.toast-info svg  { color: #3182ce; }
@keyframes toastIn {
    from { opacity: 0; transform: translateY(-12px); }
    to   { opacity: 1; transform: translateY(0); }
}
@keyframes toastOut {
    from { opacity: 1; transform: translateY(0); }
    to   { opacity: 0; transform: translateY(-12px); }
}

/* ===== Confirm 确认弹窗 ===== */
.confirm-overlay {
    position: fixed; inset: 0; background: rgba(0,0,0,0.35);
    z-index: 10001; display: flex; align-items: center; justify-content: center;
    opacity: 0; pointer-events: none; transition: opacity 0.2s;
}
.confirm-overlay.show { opacity: 1; pointer-events: auto; }
.confirm-box {
    background: white; border-radius: 14px; padding: 28px 32px 20px;
    text-align: center; max-width: 340px; width: 90%;
    box-shadow: 0 8px 32px rgba(0,0,0,0.15);
    animation: confirmIn 0.25s ease-out;
}
@keyframes confirmIn {
    from { opacity: 0; transform: scale(0.92); }
    to   { opacity: 1; transform: scale(1); }
}
.confirm-icon { margin-bottom: 12px; }
.confirm-icon svg { width: 40px; height: 40px; color: #d69e2e; }
.confirm-msg { font-size: 15px; color: #444; line-height: 1.6; margin-bottom: 20px; }
.confirm-actions { display: flex; gap: 10px; justify-content: center; }
.confirm-actions .btn { min-width: 80px; }

/* ===== 订单管理 ===== */

/* 管理操作按钮内的小图标 */
.btn-manage-action svg { width: 12px; height: 12px; margin-right: 2px; vertical-align: middle; }

/* 订单管理：汇总卡片网格，毛玻璃风格 */
.billing-cards {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin-bottom: 20px;
}
@media (max-width: 900px) {
    .billing-cards { grid-template-columns: repeat(2, 1fr); }
}
.billing-card {
    background: rgba(255,255,255,0.4);
    -webkit-backdrop-filter: blur(6px);
    backdrop-filter: blur(6px);
    border: 1px solid rgba(255,255,255,0.35);
    border-radius: 12px;
    padding: 16px 20px;
    box-shadow: 0 6px 20px rgba(0,0,0,0.08);
    text-align: center;
}
.billing-card-label { font-size: 12px; color: #2f855a; letter-spacing: 1px; }
.billing-card-num {
    font-size: 24px; font-weight: 800; margin-top: 6px; color: #1a4d2e;
}
.billing-card-num.is-negative { color: #d44; }
.billing-date-input {
    padding: 7px 12px; border: 1.5px solid #d0ddd4; border-radius: 22px;
    font-size: 13px; outline: none; background: transparent; color: #fff;
}
.billing-date-input:focus { border-color: #fff; }

/* 访问统计计数器：直接显示在账单工具栏里（刷新按钮左侧），随日期筛选联动。
   浅底深绿字，沿用下方汇总卡片的配色 —— 工具栏自身透明、坐在页面绿色渐变上，
   深色文字在渐变的任何位置都清晰。 */
.visit-counter {
    display: flex; align-items: baseline; gap: 6px;
    padding: 5px 16px; border-radius: 24px;
    background: rgba(255,255,255,0.55);
    border: 1px solid rgba(255,255,255,0.5);
    box-shadow: 0 4px 14px rgba(0,0,0,0.08);
    white-space: nowrap; flex-shrink: 0;
}
.visit-counter-label { font-size: 12px; color: #2f855a; letter-spacing: 1px; }
.visit-counter-num { font-size: 17px; font-weight: 800; color: #1a4d2e; }

/* 导入绘本弹层的打包说明：把「压缩包里该有哪些文件」拆成列表。
   原先三类文件挤在一句话里，最容易被漏掉的恰恰是必填的「参考图片」——
   漏了导入直接失败，用户却不知道自己少放了什么。
   全局 * 重置清掉了 ul 的 padding，这里必须显式补回，否则圆点会被裁到框外。 */
.import-spec-title { font-size: 13px; font-weight: 600; color: #37474f; margin-bottom: 8px; }
.import-spec-list { margin: 0 0 10px; padding-left: 20px; font-size: 13px; color: #666; line-height: 1.9; }
.import-spec-list li { list-style: disc; }
.import-spec-list code {
    padding: 1px 5px; border-radius: 3px;
    background: #eef2ef; color: #2f855a; font-size: 12px;
}
.import-spec-required {
    display: inline-block; margin-left: 6px; padding: 0 6px; border-radius: 3px;
    background: #fdecec; color: #e53e3e; font-size: 11px; font-weight: 600;
}
.import-spec-note { margin-bottom: 12px; font-size: 12px; color: #8a938d; line-height: 1.7; }

/* 订单状态标签：已退款/已支付/待支付/已关闭 */
.order-status {
    display: inline-block; padding: 3px 12px; border-radius: 12px;
    font-size: 12px; font-weight: 500; white-space: nowrap;
}
.order-status-paid { background: #e6f7ed; color: #256b3d; }
.order-status-pending { background: #fff8e6; color: #a86a00; }
.order-status-closed { background: #f0f0f0; color: #666; }
.order-status-refunded { background: #fff0f0; color: #d44; }
.col-order-no { font-size: 12px; color: #666; word-break: break-all; }

/* 订单分页 */
.pagination {
    display: flex; align-items: center; justify-content: center; gap: 6px;
    margin-top: 18px; flex-wrap: wrap;
}
.page-info { font-size: 13px; color: #666; margin-right: 8px; }
.page-btn {
    min-width: 32px; height: 32px; padding: 0 10px;
    border: 1px solid #d0ddd4; border-radius: 6px;
    background: white; color: #2f855a; font-size: 13px;
    cursor: pointer; transition: all 0.15s;
}
.page-btn:hover:not(:disabled) { background: #f0faf3; border-color: #2f855a; }
.page-btn.active {
    background: linear-gradient(135deg, #2b7a52, #1f5c34);
    color: white; border-color: transparent;
}
.page-btn:disabled { opacity: 0.45; cursor: default; }

/* ===== AI 创作付费弹窗 ===== */
/* 报价区：金额是用户唯一需要看懂的信息，所以给它最大的字号和最重的色，
   计费明细放下面一行小字 —— 用户想核对「为什么是这个价」时有得看，不想看也不碍事。 */
.ai-pay-box {
    background: #f0faf3; border: 1px solid #d5eade; border-radius: 12px;
    padding: 20px 16px; text-align: center;
}
.ai-pay-label { font-size: 13px; color: #6b7c72; }
.ai-pay-num { font-size: 32px; font-weight: 700; color: #e5533c; margin: 6px 0 0; }
.ai-pay-hint {
    font-size: 12px; color: #8a9a91; line-height: 1.6;
    margin: 14px 0 0;
}
.recharge-order-no {
    font-size: 12px; color: #999; word-break: break-all;
    margin-top: 6px;
}


.contact-modal-content { max-width: 380px; }
.contact-modal-body {
    background: white; text-align: center; padding: 26px 28px;
}
.contact-item {
    display: flex; align-items: center; justify-content: center; gap: 8px;
    margin-bottom: 22px;
}
.contact-item-label { font-size: 14px; color: #666; }
.contact-phone {
    color: #256b3d; font-weight: 700; font-size: 20px; text-decoration: none;
    letter-spacing: 0.5px;
}
.contact-phone:hover { color: #1a4d2e; }   /* 常态已压深，悬停须更深而非更浅 */
.contact-copy-btn {
    background: #2b7a52; color: white; border: none; border-radius: 6px;
    padding: 4px 12px; font-size: 12px; cursor: pointer; transition: background 0.2s;
}
.contact-copy-btn:hover { background: #2f855a; }
.contact-qr-label { font-size: 14px; color: #666; margin: 0 0 10px; }
.contact-qr-img-wrap {
    display: inline-block; border: 1px solid #e8ece9; border-radius: 12px;
    padding: 8px; background: white;
}
.contact-qr-img-wrap img {
    display: block; width: 220px; height: 220px; object-fit: contain;
    border-radius: 6px;
}
.contact-qr-img-wrap .contact-qr-placeholder {
    width: 220px; height: 220px; display: flex; flex-direction: column;
    align-items: center; justify-content: center; gap: 8px;
    color: #999; font-size: 13px; background: #f7f9f8; border-radius: 6px;
}
.contact-tip { font-size: 12px; color: #999; margin: 12px 0 0; }

/* 服务说明 / 隐私政策弹窗 */
.service-modal-content {
    max-width: 720px;
    /* .modal-content 自带的滚动在整张卡片上，滚动条会贴到卡片最右缘、
       压在 12px 圆角之外，看上去像浮在弹层外侧；圆角也裁不到它。
       这里改成：卡片本身不滚（overflow:hidden 顺带裁掉溢出的圆角），
       由内部 .modal-body 滚 —— 滚动条就落在内容区里。 */
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
.service-modal-content .modal-body {
    overflow-y: auto;
    overflow-x: hidden;
    min-height: 0;   /* flex 子项默认 min-height:auto，不归零会被内容撑高、永远不触发滚动 */
    overscroll-behavior: contain;   /* 滚到底不把滚动传给背后页面 */
    scrollbar-width: thin;                  /* Firefox */
    scrollbar-color: #cfdcd4 transparent;   /* Firefox：滑块颜色 / 轨道颜色 */
}
/* WebKit（Chrome/Edge/Safari）滚动条 */
.service-modal-content .modal-body::-webkit-scrollbar { width: 8px; }
.service-modal-content .modal-body::-webkit-scrollbar-track { background: transparent; }
.service-modal-content .modal-body::-webkit-scrollbar-thumb {
    background: #cfdcd4;      /* 与 .modal-body 的 #f9fafb 底色对比约 1.5:1，够看清又不抢眼 */
    border-radius: 4px;
}
.service-modal-content .modal-body::-webkit-scrollbar-thumb:hover { background: #a9c3b5; }
.service-doc {
    background: white;
    color: #37474f;
    font-size: 13.5px;
    line-height: 1.85;
    text-align: left;          /* 弹窗基座里有 text-align:center 的变体，这里显式复位 */
    padding: 22px 24px;
    border-radius: 8px;
}
.service-doc-section + .service-doc-section { margin-top: 22px; }
.service-doc h3 {
    margin: 0 0 10px;
    font-size: 15px;
    font-weight: 700;
    color: #2f855a;            /* 与站内主色一致，白底对比度约 4.6:1，满足 AA */
}
.service-doc p { margin: 0 0 10px; }
.service-doc p:last-child { margin-bottom: 0; }
.service-doc ol { margin: 0; padding-left: 22px; }
.service-doc li { margin-bottom: 7px; }
.service-doc li:last-child { margin-bottom: 0; }
.service-doc strong { color: #1f5c34; font-weight: 700; }
.service-doc a { color: #256b3d; font-weight: 700; text-decoration: none; }
.service-doc a:hover { text-decoration: underline; }
.service-doc-table {
    width: 100%;
    border-collapse: collapse;
    margin: 0 0 12px;
    font-size: 12.5px;
    line-height: 1.7;
}
.service-doc-table th,
.service-doc-table td {
    border: 1px solid #e2ebe5;
    padding: 8px 10px;
    text-align: left;
    vertical-align: top;
}
.service-doc-table th {
    background: #f0f7f3;
    color: #256b3d;            /* 深一档：12.5px 粗体不算「大字」，#2f855a 在此底色上仅 4.18:1 不达 AA */
    font-weight: 700;
    white-space: nowrap;
}
.service-doc-note {
    font-size: 12.5px;
    color: #5a6b62;
    background: #f7faf8;
    border-left: 3px solid #a8ddb8;
    border-radius: 0 6px 6px 0;
    padding: 9px 12px;
}
.service-doc-meta {
    font-size: 12.5px;
    color: #90a49a;
    margin-top: 14px;
}
/* 窄屏：表格三列挤不下，改为每行一块（表头隐藏，用 data-label 补字段名） */
@media (max-width: 560px) {
    .service-doc { padding: 16px 14px; font-size: 13px; }
    .service-doc-table,
    .service-doc-table tbody,
    .service-doc-table tr,
    .service-doc-table td { display: block; width: 100%; }
    .service-doc-table thead { display: none; }
    .service-doc-table tr {
        border: 1px solid #e2ebe5;
        border-radius: 8px;
        margin-bottom: 10px;
        overflow: hidden;
    }
    .service-doc-table td { border: none; border-top: 1px solid #eef3f0; }
    .service-doc-table td:first-child {
        border-top: none;
        background: #f0f7f3;
        color: #256b3d;
        font-weight: 700;
    }
}
