/* ========== 1. 全局变量 ========== */
:root {
    --primary: #1b7e6c;
    --primary-light: #d1fae5;
    --text-main: #333;
    --text-sub: #64748b;
    --text-light: #94a3b8;
    --bg-body: #f0f2f5;
    --bg-gray: #f1f5f9;
    --bg-light: #f8fafc;
    --border: #cbd5e1;
    --border-hover: #e2e8f0;
    --radius-md: 12px;
    --radius-lg: 16px;
}

/* ========== 2. 全局重置与基础样式 ========== */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html,
body {
    height: 100%;
}

body {
    font-family: 'Segoe UI', system-ui, sans-serif;
    background: var(--bg-body);
    min-height: 100vh;
    color: var(--text-main);
    -webkit-tap-highlight-color: transparent;
    -webkit-user-select: none;
    user-select: none;
}

:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

a {
    color: #2563eb;
    text-decoration: none;
}

::-webkit-scrollbar {
    width: 0;
    height: 0;
}

/* ========== 3. 布局工具类 ========== */
.flex {
    display: flex;
}

.flex-center {
    display: flex;
    align-items: center;
    justify-content: center;
}

.flex-col {
    display: flex;
    flex-direction: column;
}

.flex-1 {
    flex: 1;
}

.gap-2 {
    gap: 4px;
}

.gap-4 {
    gap: 8px;
}

.gap-6 {
    gap: 12px;
}

.w-80 {
    width: 80px;
}

.w-200 {
    width: 200px;
}

.form-row-start {
    align-items: flex-start;
}

.form-row-center {
    align-items: center;
}

.flex-input-wrap {
    flex: 1;
    position: relative;
}

/* ========== 4. 主容器与品牌 ========== */
.app-container {
    max-width: 500px;
    margin: 0 auto;
    padding: 12px;
    padding-bottom: calc(80px + env(safe-area-inset-bottom, 0px));
}

.header {
    text-align: center;
    padding: 20px 0 10px;
}

.logo-title {
    font-size: 28px;
    font-weight: 800;
    color: var(--primary);
    margin-bottom: 10px;
    animation: titlePop 0.6s ease-out;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.logo-subtitle {
    font-size: 14px;
    color: #5b7a9a;
    margin-bottom: 20px;
}

@keyframes titlePop {
    0% {
        transform: scale(0.8);
        opacity: 0;
    }

    100% {
        transform: scale(1);
        opacity: 1;
    }
}

/* ========== 5. 通用组件：表单控件 ========== */
.form-control {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    font-size: 15px;
    background: #fff;
    font-family: inherit;
    outline: none;
    transition: border-color 0.2s;
}

.text-input {
    width: 100%;
    display: block;
    padding: 10px 12px;
    min-height: 52px;
    max-height: 58px;
    line-height: 1.5;
    resize: none;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
}

.text-input:focus {
    scroll-margin-bottom: 300px;
}

.text-input-inner-count {
    padding-bottom: 22px !important;
}

.char-count-inner {
    position: absolute;
    right: 8px;
    bottom: 4px;
    font-size: 12px;
    color: var(--text-light);
    pointer-events: none;
    background: rgba(255, 255, 255, 0.8);
    padding: 0 4px;
    border-radius: 4px;
}

/* ========== 6. 通用组件：胶囊按钮 ========== */
.btn-chip {
    padding: 8px 16px;
    border-radius: 20px;
    background: var(--bg-gray);
    color: #475569;
    font-size: 14px;
    cursor: pointer;
    border: 1px solid transparent;
    user-select: none;
    white-space: nowrap;
    font-family: inherit;
    transition: all 0.2s;
}

.btn-chip:active {
    background: var(--border-hover);
}

.btn-chip.selected {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
    font-weight: 600;
}

.quick-voice-btn {
    padding: 8px 14px;
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
}

.recent-tag {
    padding: 8px 14px;
    border-radius: 20px;
    background: var(--bg-gray);
    color: #475569;
    font-size: 12px;
    /* 与 label-horiz 一致 */
    cursor: pointer;
    border: 1px solid transparent;
    user-select: none;
    white-space: nowrap;
    font-family: inherit;
    transition: all 0.2s;
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
}

.recent-tag:active {
    background: var(--border-hover);
}

/* ========== 7. 通用组件：遮罩层 ========== */
.overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.65);
    z-index: 2000;
    justify-content: center;
    align-items: center;
}

.overlay.active {
    display: flex;
}

.loading-spinner {
    width: 36px;
    height: 36px;
    border: 3px solid rgba(255, 255, 255, 0.25);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* ========== 8. 通用组件：主要按钮 ========== */
.btn-primary {
    width: 100%;
    padding: 16px;
    background: var(--primary);
    color: #fff;
    border: none;
    border-radius: 24px;
    font-size: 17px;
    font-weight: 700;
    cursor: pointer;
    letter-spacing: 1px;
    font-family: inherit;
    transition: opacity 0.2s;
}

.btn-primary:active {
    opacity: 0.8;
}

.btn-primary:disabled {
    background: var(--text-light);
    opacity: 0.7;
    cursor: not-allowed;
}

.btn-action {
    background: linear-gradient(135deg, #dc2626, #ef4444);
    animation: bounce-btn 1.2s ease-in-out infinite;
    margin-top: 24px;
    margin-bottom: 24px;
}

@keyframes bounce-btn {
    0%, 100% { transform: translateY(0); }
    30% { transform: translateY(-6px); }
    50% { transform: translateY(0); }
    70% { transform: translateY(-3px); }
}

.adjust-crop-hint {
    text-align: center;
    font-size: 13px;
    color: #64748b;
    padding: 4px 0;
    cursor: pointer;
    user-select: none;
}

/* ========== 9. 卡片与布局 ========== */
.card,
.simple-card {
    background: #fff;
    border-radius: var(--radius-lg);
    padding: 16px;
    margin-bottom: 4px;
}

.form-item {
    margin-bottom: 16px;
}

.form-item:last-child {
    margin-bottom: 0;
}

.form-item-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
}

/* ========== 10. 标签系统 ========== */
.label-vert {
    writing-mode: vertical-lr;
    text-orientation: upright;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    margin-right: 8px;
    width: 24px;
    padding: 6px 0;
    font-weight: 700;
    font-size: 13px;
    color: var(--primary);
    letter-spacing: 2px;
    background: var(--primary-light);
    border-radius: 4px;
    word-break: break-all;
    line-height: 1.2;
}

.label-horiz {
    flex-shrink: 0;
    font-weight: 600;
    font-size: 12px;
    color: var(--text-sub);
    white-space: nowrap;
    margin-right: 8px;
}

.label-sub {
    display: inline-block;
    font-weight: 600;
    font-size: 12px;
    color: var(--text-sub);
    margin-bottom: 0;
    white-space: nowrap;
    flex-shrink: 0;
}

/* ========== 11. 特定区域：预览 ========== */
.preview-container {
    position: relative;
    background: #1e2a3a;
    border-radius: var(--radius-lg);
    margin: 8px 0 12px;
    overflow: hidden;
    text-align: center;
}

.preview-image-wrap {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 300px;
    height: min(300px, 40vh);
    cursor: pointer;
}

.preview-image-wrap img {
    display: block;
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    margin: 0 auto;
}

.preview-bar-top,
.preview-bar-bottom {
    display: none;
    padding: 10px 16px;
    font-size: 16px;
    font-weight: 600;
    color: #000;
    background: #fff;
    min-height: 40px;
    line-height: 1.4;
}

.preview-subtitle {
    display: none;
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(0, 0, 0, 0.5);
    color: #fff;
    padding: 10px 16px;
    font-size: 16px;
    font-weight: 600;
    z-index: 5;
}

.preview-empty-hint {
    color: var(--text-light);
    font-size: 14px;
    padding: 60px 20px;
    cursor: pointer;
}

/* ========== 12. 特定区域：音色与动效 ========== */
.voice-selector-box {
    background: var(--bg-light);
    padding: 10px;
    border-radius: 10px;
}

/* 音色行：左右布局，左侧下拉框堆叠，右侧按钮 */
.voice-compact-row {
    display: flex;
    align-items: center;
    flex-wrap: nowrap;
    gap: 8px;
}

/* 下拉框垂直容器，占满剩余空间 */
.voice-select-stack {
    flex: 1 1 auto;
    /* 允许收缩和扩展 */
    max-width: 60%;
    /* 限制最大宽度，为右侧留出至少30%空间 */
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 0;
}

/* 下拉框宽度自动充满容器 */
.voice-category-select,
.voice-select {
    width: 100%;
}

/* 试听按钮固定尺寸 */
#voicePreviewBtn {
    width: 28px;
    flex-shrink: 0;
}

/* 收藏标签不缩放 */
#favCheckboxArea {
    flex-shrink: 0;
}

/* 动效行 flex 布局 */
.motion-btn-row {
    display: flex;
    align-items: center;
    flex-wrap: nowrap;
}

.motion-btn-row>* {
    min-width: 0;
}

#motionSelect {
    flex: 2;
}

#motionFavCheckboxArea {
    flex: 2;
    justify-content: center;
}

#motionPreviewBtn {
    width: 28px;
    flex-shrink: 0;
}

.spacer {
    flex: 1;
}

.fav-checkbox-label {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    cursor: pointer;
    user-select: none;
    font-family: inherit;
}

.fav-checkbox-label.disabled {
    opacity: 0.5;
}

.preview-btn {
    flex: none;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 1px solid var(--border);
    background: var(--bg-light);
    /* 与父级容器背景融合 */
    font-size: 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.15));
    /* 可用时更立体 */
}

.preview-btn:disabled {
    background: #e5e7eb;
    /* 明显灰色背景 */
    border-color: #d1d5db;
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
    filter: none;
}

/* 收藏区域同行 */
.pref-area {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 8px;
}

.motion-fav-row {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 8px;
}

.fav-list-inline {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    margin-top: 0;
}

.fav-tag {
    background: var(--bg-gray);
    color: #475569;
    padding: 3px 10px;
    border-radius: 10px;
    font-size: 12px;
}

/* ========== 13. 特定区域：语速 ========== */
.speed-collapsible {
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    overflow: hidden;
}

.speed-header {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    padding: 10px 12px;
    background: var(--bg-light);
    user-select: none;
}

.speed-current {
    font-weight: bold;
    color: var(--primary);
}

.speed-arrow {
    font-size: 12px;
    color: var(--text-light);
    transition: transform 0.25s ease;
}

.speed-expanded .speed-arrow {
    transform: rotate(180deg);
}

.speed-body {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.25s ease;
}

.speed-expanded .speed-body {
    max-height: 60px;
}

.speed-inline-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px 12px;
}

.speed-mark {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-light);
    min-width: 32px;
}

[type="range"] {
    flex: 1;
    height: 4px;
    -webkit-appearance: none;
    background: #ddd;
    border-radius: 2px;
    outline: none;
}

[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    background: var(--primary);
    border-radius: 50%;
    cursor: pointer;
}

.speed-collapsible-inline {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    border: none;
    border-radius: 0;
    overflow: visible;
}

.speed-collapsible-inline .speed-header {
    background: transparent;
    padding: 4px 8px 4px 0;
}

.speed-collapsible-inline .speed-body {
    flex: 1;
    min-width: 120px;
}

.speed-collapsible-inline.speed-expanded .speed-body {
    max-height: 40px;
}

/* ========== 14. 特定区域：高级面板 ========== */
.advanced-toggle {
    text-align: right;
    /* 按钮靠右 */
    margin: 4px 0;
}

.advanced-toggle-btn {
    color: var(--primary);
    font-size: 14px;
    font-weight: 600;
    padding: 5px 15px;
    cursor: pointer;
    border: none;
    background: none;
    font-family: inherit;
}

.advanced-panel {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.advanced-panel.expanded {
    max-height: 2000px;
}

/* ========== 15. 底部 Sheet ========== */
.sheet-overlay {
    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: flex-end;
}

.sheet-overlay.active {
    display: flex;
}

.sheet-panel {
    width: 100%;
    max-width: 500px;
    background: #f5f5f7;
    border-radius: 14px 14px 0 0;
    padding: 8px 0 0;
    padding-bottom: env(safe-area-inset-bottom, 12px);
    transform: translateY(100%);
    transition: transform 0.28s cubic-bezier(0.32, 0.72, 0, 1);
}

.sheet-overlay.active .sheet-panel {
    transform: translateY(0);
}

.sheet-handle {
    width: 36px;
    height: 5px;
    background: #d1d1d6;
    border-radius: 3px;
    margin: 0 auto 8px;
    opacity: 0.7;
}

.sheet-title {
    text-align: center;
    font-size: 13px;
    color: var(--text-sub);
    margin-bottom: 8px;
}

.sheet-option {
    display: flex;
    align-items: center;
    width: calc(100% - 16px);
    margin: 0 8px 6px;
    padding: 14px 20px;
    background: #fff;
    border-radius: 12px;
    font-size: 16px;
    cursor: pointer;
    border: none;
    text-align: left;
    font-family: inherit;
}

.sheet-option:active {
    background: #e8e8ed;
}

.sheet-option .sheet-icon {
    margin-right: 12px;
    font-size: 20px;
}

.sheet-cancel {
    margin: 8px 8px 0;
    color: #007aff;
    font-weight: 600;
    justify-content: center;
}

/* ========== 16. 底部导航 ========== */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    max-width: 500px;
    margin: 0 auto;
    height: 55px;
    background: #fff;
    border-top: 1px solid var(--border);
    display: flex;
    z-index: 100;
    padding-bottom: env(safe-area-inset-bottom);
}

.nav-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--text-light);
    text-decoration: none;
    font-size: 11px;
    font-weight: 500;
    padding: 6px 16px;
}

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

.nav-item svg {
    width: 22px;
    height: 22px;
}

/* ========== 17. 弹窗与 Loading ========== */
.loading-text {
    font-size: 15px;
    color: #ddd;
    letter-spacing: 0.5px;
    margin-top: 14px;
}

.modal-box {
    background: #fff;
    border-radius: 16px;
    padding: 20px;
    max-width: 320px;
    width: 90%;
    text-align: center;
    position: relative;
}

.modal-close-btn {
    position: absolute;
    top: 10px;
    right: 15px;
    font-size: 18px;
    color: #999;
    cursor: pointer;
    border: none;
    background: none;
}

.modal-title {
    font-size: 18px;
    margin: 0 0 10px;
}

.modal-content {
    font-size: 13px;
    color: #475569;
    margin-bottom: 16px;
}

.modal-confirm-btn {
    width: 100%;
    padding: 10px 0;
    background: var(--primary);
    color: #fff;
    border: none;
    border-radius: 20px;
    font-size: 15px;
    cursor: pointer;
}

/* ========== 18. 裁剪区 ========== */
#cropperContainer {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 998;
    background: rgba(0, 0, 0, 0.85);
    pointer-events: none;
}

#cropperContainer img {
    max-width: 100%;
    max-height: 100%;
}

#cropToolbar {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: #000;
    z-index: 1001;
    padding: 12px 16px;
    max-width: 500px;
    margin: 0 auto;
}

.crop-toolbar-grid {
    display: flex;
    flex-direction: column;
    gap: 12px;
    width: 100%;
}

.crop-toolbar-row-top,
.crop-toolbar-row-bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

#cropToolbar button {
    background: none;
    border: none;
    color: #fff;
    font-size: 16px;
    padding: 10px 20px;
    cursor: pointer;
    font-family: inherit;
    min-width: 80px;
    min-height: 44px;
}

#cropToolbar button:active {
    opacity: 0.6;
}

#cropToolbar button:disabled {
    opacity: 0.35;
    cursor: not-allowed;
}

#cropDoneBtn {
    color: #07c160 !important;
    font-weight: 600;
}

#cropResetBtn {
    color: #94a3b8;
}

body.cropping {
    overflow: hidden;
}

body.cropping .bottom-nav {
    display: none !important;
}

body.cropping [data-role="preview-image-wrap"] {
    position: fixed !important;
    bottom: 120px !important;
    left: 0 !important;
    right: 0 !important;
    top: auto !important;
    height: 60vh !important;
    max-width: 500px !important;
    margin: 0 auto !important;
    z-index: 1000 !important;
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    background: transparent !important;
    pointer-events: auto !important;
}

body.cropping [data-role="preview-image"] {
    display: none !important;
}

/* ========== 19. 登录与其他 ========== */
.wx-login-btn {
    width: 100%;
    padding: 12px 0;
    background: #07c160;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.hidden {
    display: none !important;
}

.logged-out-hidden {
    display: none !important;
}

.footer-submit {
    margin-bottom: 70px;
    padding-bottom: env(safe-area-inset-bottom, 0px);
}

.agreement-row {
    font-size: 12px;
    margin-top: 40px;
    margin-bottom: 24px;
    text-align: center;
    justify-content: center;
}

.agreement-row a {
    font-size: 12px;
}

/* 用于高级配置展开时隐藏精简区音色/动效 */
.hidden-when-advanced {
    display: none !important;
}

/* ========== Banner 轮播（修复版） ========== */
.banner-container {
    position: relative;
    width: 100%;
    max-width: 500px;
    margin: 0 auto 12px;
    height: 200px;
    overflow: hidden;
    border-radius: var(--radius-lg);
    background: #1e2a3a; /* 背景色，如果出缝会显示此色 */
    
    /* 【修复1】将 CSS 变量定义在此处，使其所有子元素（包括 slide）都可继承 */
    --slide-count: 1; 
}

.banner-track {
    display: flex;
    height: 100%;
    /* 宽度仍由 JS 动态设置 */
    will-change: transform;
    
    /* 【修复2】消除 flex 容器的默认间隙，这是导致黑屏的常见原因 */
    margin: 0;
    padding: 0;
    /* 确保子元素无纵向对齐导致的间隙 */
    align-items: stretch; 
}

.banner-slide {
    /* 基础样式保持不变 */
    width: calc(100% / var(--slide-count));
    flex-shrink: 0;
    height: 100%;
    display: block;
    margin: 0 !important;
    padding: 0 !important;
    border: none !important;
    vertical-align: bottom;
    pointer-events: none;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    transform: translateZ(0);

    /* 默认模式：cover（裁剪填充） */
    object-fit: cover;
}

/* ================= 动态模式类定义 ================= */

/* 1. mode-cover: 裁剪填充，默认背景色填充 */
.banner-slide.mode-cover {
    object-fit: cover;
}

/* 2. mode-contain: 完整显示，内容不裁剪（你说的"全部显示"） */
.banner-slide.mode-contain {
    object-fit: contain;
    /* 设置背景色，防止留白时透明 */
    background: #1e2a3a; 
}

/* 3. mode-fill: 强制拉伸，填满容器 */
.banner-slide.mode-fill {
    object-fit: fill;
}

/* 4. mode-none: 原图尺寸，居中显示 */
.banner-slide.mode-none {
    object-fit: none;
    object-position: center center;
}


.banner-slide.error {
    visibility: hidden;
}

.banner-dots {
    display: flex;
    justify-content: center;
    gap: 6px;
    margin-bottom: 8px;
}

.banner-dot {
    width: 8px; height: 8px;
    border-radius: 50%;
    background: #cbd5e1;
    cursor: pointer;
    transition: background 0.3s;
}

.banner-dot.active {
    background: var(--primary);
    width: 20px;
    border-radius: 4px;
}

/* ========== 20. 订单页 ========== */
.orders-page .container { max-width: 500px; margin: 0 auto; padding: 12px; padding-bottom: 40px; }
.orders-page .header { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
.orders-page .header a { color: #64748b; text-decoration: none; font-weight: 600; font-size: 15px; }
.orders-page .header h1 { font-size: 20px; color: #0b3b3c; margin: 0; }

.order-item { background: #fff; border-radius: 14px; padding: 14px; margin-bottom: 10px; box-shadow: 0 1px 3px rgba(0,0,0,0.05); transition: background 0.15s; -webkit-tap-highlight-color: transparent; }
.order-item:active { background: #f1f5f9; }
.order-meta { display: flex; justify-content: space-between; align-items: center; font-size: 12px; color: #64748b; margin-bottom: 8px; }

.status-badge { padding: 3px 10px; border-radius: 10px; font-weight: 600; font-size: 12px; display: inline-block; }
.status-pending { background: #fef3c7; color: #d97706; }
.status-processing { background: #dbeafe; color: #2563eb; }
.status-success { background: #d1fae5; color: #059669; }
.status-failed { background: #fee2e2; color: #dc2626; }

.order-desc { font-size: 14px; color: #2c3e4e; margin-bottom: 10px; word-break: break-all; }

.btn-group { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.btn { padding: 7px 14px; border-radius: 16px; border: none; font-size: 13px; font-weight: 600; cursor: pointer; text-decoration: none; display: inline-block; text-align: center; }
.btn:active { opacity: 0.75; }
.btn-view { background: #eff6ff; color: #2563eb; }
.btn-del { background: #fef2f2; color: #dc2626; }

.orders-page .empty-text { text-align: center; color: #64748b; padding: 40px 0; font-size: 14px; }
.orders-page .loading-text { text-align: center; color: #64748b; padding: 30px 0; font-size: 14px; }

.orders-page .modal-overlay { display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.7); z-index: 1000; justify-content: center; align-items: center; }
.orders-page .video-modal { background: #fff; padding: 16px; border-radius: 14px; width: 95%; max-width: 420px; text-align: center; }
.orders-page .video-modal video { width: 100%; border-radius: 10px; max-height: 60vh; background: #000; }
.video-modal-actions { display: flex; justify-content: center; gap: 24px; margin-top: 12px; }
.btn-close { background: #64748b; color: #fff; border: none; padding: 10px 28px; border-radius: 20px; font-size: 14px; cursor: pointer; min-width: 100px; }
.btn-download { background: #059669; color: #fff; border: none; padding: 10px 28px; border-radius: 20px; font-size: 14px; cursor: pointer; text-decoration: none; display: inline-block; min-width: 100px; text-align: center; }

.order-error-text { color: #dc2626; font-size: 13px; margin-top: 4px; }

/* ========== 21. 我的页 ========== */
.my-page .container { max-width: 500px; margin: 0 auto; padding: 12px; padding-bottom: 80px; }
.my-page .user-card { background: #fff; border-radius: 16px; padding: 20px; margin-bottom: 14px; text-align: center; }
.my-page .user-avatar { width: 60px; height: 60px; border-radius: 50%; background: #e2e8f0; margin: 0 auto 10px; display: flex; align-items: center; justify-content: center; font-size: 28px; }
.my-page .user-avatar.vip { background: linear-gradient(135deg, #f59e0b, #ef4444, #8b5cf6); }
.my-page .user-avatar.logged-in { background: #f59e0b; }
.my-page .user-name { font-size: 16px; font-weight: 700; color: #0b3b3c; margin-bottom: 4px; }
.my-page .user-quota { font-size: 12px; color: #64748b; }
.my-page .login-btn { display: inline-block; padding: 10px 30px; background: #07c160; color: #fff; border-radius: 24px; font-size: 14px; font-weight: 600; cursor: pointer; border: none; margin-top: 10px; }

.my-page .menu-card { background: #fff; border-radius: 16px; margin-bottom: 12px; overflow: hidden; }
.my-page .menu-item { display: flex; align-items: center; gap: 12px; padding: 16px; border-bottom: 1px solid #f1f5f9; text-decoration: none; color: #2c3e4e; font-size: 15px; font-weight: 500; cursor: pointer; }
.my-page .menu-item:last-child { border-bottom: none; }
.my-page .menu-item .icon { font-size: 20px; }
.my-page .menu-item .arrow { margin-left: auto; color: #cbd5e1; }

.my-page .logout-btn { width: 100%; display: flex; align-items: center; gap: 12px; padding: 16px; border: none; border-bottom: 1px solid #f1f5f9; background: none; color: #2c3e4e; font-size: 15px; font-weight: 500; cursor: pointer; font-family: inherit; }
.my-page .logout-btn:last-child { border-bottom: none; }
.my-page .logout-btn .icon { font-size: 20px; }
.my-page .logout-btn .arrow { margin-left: auto; color: #cbd5e1; }

/* ========== 22. 生成记录页 ========== */
.records-page .container { max-width: 500px; margin: 0 auto; padding: 12px; padding-bottom: 40px; }
.records-page .header { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
.records-page .header a { color: #64748b; text-decoration: none; font-weight: 600; font-size: 15px; }
.records-page .header h1 { font-size: 20px; color: #0b3b3c; margin: 0; }

.records-stats-card { background: #fff; border-radius: 14px; padding: 14px; margin-bottom: 10px; }
.records-stats-text { font-size: 13px; color: #64748b; }
.records-warning { font-size: 12px; color: #d97706; margin-top: 8px; background: #fef3c7; padding: 6px 10px; border-radius: 8px; }

.records-item { padding: 14px; border-bottom: 1px solid #f1f5f9; background: #fff; }
.records-item-alt { background: #f8fafc; }
.records-item:first-child { border-radius: 14px 14px 0 0; }

.records-view-all { text-align: center; padding: 14px; font-size: 13px; color: #1b7e6c; font-weight: 600; cursor: pointer; background: #fff; border-radius: 0 0 14px 14px; }
.records-empty { text-align: center; color: #64748b; padding: 40px 0; font-size: 14px; background: #fff; border-radius: 14px; }