
/* * 配色方案 (Diagonal Symmetric Smudges):
    * BASE: #FCF9E8 (米白 - 主背景)
    * DEPTH 1 (较深): #7FDCE5 (亮星光蓝) -> 用于 左下 & 右上
    * DEPTH 2 (较浅): #D0EDF0 (极淡蓝) -> 用于 左上 & 右下
    */

body {
    /* 全局使用 Noto Sans SC，保证方正清晰 */
    font-family: "Noto Sans SC", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    color: #1B2A31;
    background-color: #FCF9E8; /* 纯米色背景 */
    min-height: 100vh;
    position: relative;
    /* 防止滚动条跳动 */
    overflow-y: scroll; 
    
    /* --- Flex 布局实现 Sticky Footer --- */
    display: flex;
    flex-direction: column;
}

/* --- 让主要视图区域自动填充剩余空间，将 Footer 顶到底部 --- */
#view-home, #view-aigc, #view-check, #view-write, #view-manual, #view-history {
    flex: 1;
    width: 100%; /* 确保宽度占满 */
}

/* * 修改：Ryumin (M-KL) 风格模拟 
    * 优先调用系统中的 Ryumin/Ryumin Pro。
    * 如果未安装，则回退到高品质明朝体(Mincho)或宋体。
    */
.ryumin-font {
    font-family: "Ryumin", "Ryumin Pro", "A-OTF Ryumin Pro", "Ryumin-KL", "Yu Mincho", "YuMincho", "Hiragino Mincho ProN", "HiraMinProN-W3", "Noto Serif SC", "Songti SC", serif;
    font-weight: 600; /* Ryumin M-KL 介于常规和粗体之间，600较为接近 */
    letter-spacing: 2px; /* 增加字间距以体现日式排版的高级呼吸感 */
}

/* 背景容器 */
.ambient-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    overflow: hidden;
    background-color: #FCF9E8; /* 纯色填充 */
}

/* 光斑通用设置 */
.ambient-blob {
    position: absolute;
    border-radius: 50%; 
    filter: blur(90px); /* 强模糊制造磨砂晕染感 */
    opacity: 0.6; /* 适中透明度 */
}

/* --- 对角线组 A: 较深 (#7FDCE5) - 径向渐变 --- */

/* blob-bl: 左下角 */
.blob-bl { 
    bottom: -15%; 
    left: -15%; 
    width: 50vw; 
    height: 50vw; 
    background: radial-gradient(circle, #7FDCE5 0%, rgba(127, 220, 229, 0) 65%);
}

/* blob-tr: 右上角 */
.blob-tr { 
    top: -15%; 
    right: -15%; 
    width: 50vw; 
    height: 50vw; 
    background: radial-gradient(circle, #7FDCE5 0%, rgba(127, 220, 229, 0) 65%);
}

/* --- 对角线组 B: 较浅 (#D0EDF0) - 纯色块模式 --- */

/* blob-tl: 左上角 */
.blob-tl { 
    top: -10%; 
    left: -10%; 
    width: 35vw; 
    height: 35vw; 
    background: #D0EDF0; 
    opacity: 0.5;
}

/* blob-br: 右下角 */
.blob-br { 
    bottom: -10%; 
    right: -10%; 
    width: 35vw; 
    height: 35vw; 
    background: #D0EDF0; 
    opacity: 0.5;
}

/* 磨砂玻璃卡片 */
.glass-card {
    background: rgba(255, 255, 255, 0.65);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.8);
    transition: all 0.3s ease;
}

/* 拖拽激活状态 - 新增 */
.glass-card.drag-active {
    border-color: #5399A0;
    background: rgba(255, 255, 255, 0.85);
    box-shadow: 0 0 20px rgba(83, 153, 160, 0.3);
    transform: scale(1.01);
}

.gradient-text {
    background: linear-gradient(135deg, #1B2A31, #5399A0);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.btn-gradient {
    background: linear-gradient(135deg, #5399A0 0%, #7dbdc2 100%);
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(83, 153, 160, 0.3);
}
.btn-gradient:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(83, 153, 160, 0.4);
}

.dashed-box {
    background-image: url("data:image/svg+xml,%3csvg width='100%25' height='100%25' xmlns='http://www.w3.org/2000/svg'%3e%3crect width='100%25' height='100%25' fill='none' rx='16' ry='16' stroke='%2398C3C7' stroke-width='2' stroke-dasharray='10%2c 10' stroke-dashoffset='0' stroke-linecap='square'/%3e%3c/svg%3e");
    transition: background-color 0.3s ease;
}
.dashed-box:hover {
    background-color: rgba(83, 153, 160, 0.08);
}

::selection {
    background: #7FDCE5;
    color: #FFFFFF;
}

/* --- 夸张可爱的艺术标题样式 --- */
.art-title-main {
    font-weight: 900;
    text-shadow: 
        3px 3px 0px #fff, 
        -3px -3px 0px #fff, 
        3px -3px 0px #fff, 
        -3px 3px 0px #fff, 
        5px 5px 0px #D0EDF0, 
        8px 8px 0px rgba(27, 42, 49, 0.1);
    color: #1B2A31;
    /* 同样应用 Ryumin 风格 */
    font-family: "Ryumin", "Ryumin Pro", "A-OTF Ryumin Pro", "Yu Mincho", "Noto Serif SC", serif;
    /* 修改：大幅增加字间距 */
    letter-spacing: 12px;
}

.art-title-span {
    color: #5399A0;
    /* 保持"降重"为原有字体，或根据需要统一 */
    font-family: "Noto Sans SC", sans-serif;
    text-shadow: 
        3px 3px 0px #fff, 
        -3px -3px 0px #fff, 
        3px -3px 0px #fff, 
        -3px 3px 0px #fff, 
        5px 5px 0px #7FDCE5, /* 亮星光蓝阴影 */
        8px 8px 0px rgba(83, 153, 160, 0.2);
    /* 修改：同步增加字间距 */
    letter-spacing: 12px;
}

/* 静态数字特效 */
.stat-number {
    font-family: 'Arial Black', sans-serif;
    letter-spacing: -1px;
    /* 静态阴影让数字浮起 */
    text-shadow: 2px 2px 0px rgba(83, 153, 160, 0.2);
}

/* 炫彩字体特效 - 用于“无限可能” */
.iridescent-text {
    background: linear-gradient(45deg, #ff00cc, #3333ff, #00ccff, #00ff99, #ffff00, #ff0000);
    background-size: 300% 300%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: iridescent 5s ease infinite;
}

@keyframes iridescent {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* 模态框样式 - 新增 */
.modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(27, 42, 49, 0.3);
    backdrop-filter: blur(4px);
    z-index: 100;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}
.modal-backdrop.show {
    opacity: 1;
    pointer-events: auto;
}
.modal-content {
    position: relative;
    background: #fff;
    padding: 24px;
    border-radius: 16px;
    width: 300px;
    max-width: 90vw;
    text-align: center;
    box-shadow: 0 10px 25px rgba(0,0,0,0.1);
    transform: scale(0.9);
    transition: transform 0.3s ease;
}
/* 支持自定义宽度的模态框 */
.modal-content.w-full {
    width: auto;
}
.modal-backdrop.show .modal-content {
    transform: scale(1);
}

/* --- FAQ 展开样式 - 终极丝滑优化版 --- */
.faq-answer {
    max-height: 0;
    overflow: hidden;
    will-change: max-height, opacity, padding;
    transition: max-height 0.4s cubic-bezier(0.4, 0, 0.2, 1), 
                opacity 0.4s cubic-bezier(0.4, 0, 0.2, 1),
                padding-top 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    opacity: 0;
    padding-top: 0; 
}

.faq-item {
    transition: all 0.3s ease;
}

.faq-item.active {
    border-color: #98C3C7; /* 激活时边框变色 */
    background-color: rgba(255, 255, 255, 0.85); /* 激活时背景加深 */
}

/* 激活时样式，由JS控制高度 */
.faq-item.active .faq-answer {
    opacity: 1;
    padding-top: 12px;
}

.faq-item.active .fa-chevron-right {
    transform: rotate(90deg);
}
.fa-chevron-right {
    transition: transform 0.3s ease;
}

/* 切换页面的隐藏样式 */
.hidden-page {
    display: none;
}

/* 页面切换动画 */
.fade-in {
    animation: fadeIn 0.3s ease-out forwards;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* 订单筛选按钮样式 */
.order-filter-btn {
    background: rgba(255, 255, 255, 0.6);
    color: #6b7280;
    transition: all 0.2s ease;
}
.order-filter-btn:hover {
    background: rgba(255, 255, 255, 0.9);
}
.order-filter-btn.active {
    background: #5399A0;
    color: white;
}

.status-filter-btn {
    background: #f3f4f6;
    color: #6b7280;
    border-radius: 9999px;
    transition: all 0.2s ease;
}
.status-filter-btn:hover {
    background: #e5e7eb;
}
.status-filter-btn.active {
    background: #5399A0;
    color: white;
}

/* 充值套餐卡片样式 */
.package-card {
    cursor: pointer;
    position: relative;
    background: #f9fafb;
    border: 2px solid #e5e7eb;
    border-radius: 16px;
    padding: 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease;
}
.package-card:hover {
    border-color: #5399A0;
    background: #f0f9fa;
}
.package-card.selected {
    border-color: #5399A0;
    background: linear-gradient(135deg, rgba(83, 153, 160, 0.1) 0%, rgba(152, 195, 199, 0.1) 100%);
    box-shadow: 0 4px 12px rgba(83, 153, 160, 0.2);
}
.package-card.popular {
    border-color: #5399A0;
}
.package-card .popular-badge {
    position: absolute;
    top: -10px;
    right: 16px;
    background: linear-gradient(135deg, #5399A0 0%, #98C3C7 100%);
    color: white;
    font-size: 10px;
    font-weight: bold;
    padding: 4px 12px;
    border-radius: 9999px;
}

/* 充值 tab 样式 */
#tab-packages.active,
#tab-redeem.active {
    color: #5399A0;
    border-bottom: 2px solid #5399A0;
}

/* ======== 抽屉展开式核心动画 CSS (检测查重部分) ======== */
.drawer {
    display: grid;
    grid-template-rows: 0fr;
    transition: grid-template-rows 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}
.drawer.is-open {
    grid-template-rows: 1fr;
}
.drawer-inner {
    overflow: hidden;
    transition: opacity 0.4s ease 0.1s; 
    opacity: 0;
    pointer-events: none;
}
.drawer.is-open .drawer-inner {
    opacity: 1;
    pointer-events: auto;
    padding-bottom: 0.5rem;
}

/* 选项卡片基础与选中样式 */
.option-card {
    border: 2px solid transparent;
    background-color: #f8fafc;
    transition: all 0.3s ease;
    cursor: pointer;
}
.option-card:hover { border-color: rgba(83, 153, 160, 0.3); background-color: white; }
.option-card.active {
    border-color: #5399A0;
    background-color: rgba(83, 153, 160, 0.05);
    box-shadow: 0 4px 14px rgba(83, 153, 160, 0.1);
}
.option-card.active .check-icon { opacity: 1; transform: scale(1); }
.check-icon { opacity: 0; transform: scale(0.5); transition: all 0.3s ease; }

/* ============================================================
   手机端折叠侧边栏（主站上边栏在 <768px 时折叠为抽屉）
   ============================================================ */
.mobile-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    height: 100dvh;
    width: min(84vw, 330px);
    background: #ffffff;
    z-index: 90;
    display: flex;
    flex-direction: column;
    transform: translateX(-102%);
    transition: transform 0.28s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 14px 0 44px rgba(27, 42, 49, 0.16);
    overscroll-behavior: contain;
}
.mobile-sidebar.open { transform: translateX(0); }
.mobile-sidebar-overlay {
    position: fixed;
    inset: 0;
    z-index: 80;
    background: rgba(27, 42, 49, 0.46);
    -webkit-backdrop-filter: blur(2px);
    backdrop-filter: blur(2px);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
}
.mobile-sidebar-overlay.show { opacity: 1; pointer-events: auto; }
body.mobile-sidebar-open { overflow: hidden; }

.mobile-sidebar-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 18px 18px 14px;
    border-bottom: 1px solid rgba(83, 153, 160, 0.14);
}
.mobile-sidebar-brand { display: flex; align-items: center; gap: 10px; cursor: pointer; min-width: 0; }
.mobile-sidebar-brand img { width: 34px; height: 38px; object-fit: contain; }
.mobile-sidebar-brand span { font-weight: 700; color: #1B2A31; font-size: 20px; line-height: 1.1; }
.mobile-sidebar-brand small { display: block; font-size: 10px; color: #7c8b8f; font-weight: 500; letter-spacing: 1px; margin-top: 2px; }
.mobile-sidebar-close {
    flex-shrink: 0; width: 36px; height: 36px; border: 0; border-radius: 10px;
    background: rgba(83, 153, 160, 0.1); color: #397e85; font-size: 18px; cursor: pointer;
}
.mobile-sidebar-user { padding: 14px 18px; border-bottom: 1px solid rgba(83, 153, 160, 0.12); }
.mobile-sidebar-user-title { margin: 0 0 10px; font-size: 12px; color: #7c8b8f; }
.mobile-sidebar-login-btn {
    width: 100%; border: 0; border-radius: 12px; padding: 11px 14px;
    background: #07C160; color: #fff; font-size: 14px; font-weight: 700; cursor: pointer;
    display: flex; align-items: center; justify-content: center; gap: 8px;
}
.mobile-sidebar-partner-link { display: block; margin-top: 10px; font-size: 11px; color: #5399A0; text-decoration: none; line-height: 1.5; }
.mobile-sidebar-user-row { display: flex; align-items: center; gap: 10px; }
.mobile-sidebar-avatar {
    width: 40px; height: 40px; border-radius: 50%; background: #5399A0; color: #fff;
    display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 15px; flex-shrink: 0;
}
.mobile-sidebar-user-row strong { display: block; font-size: 14px; color: #1B2A31; }
.mobile-sidebar-user-row small { display: block; font-size: 11px; color: #7c8b8f; margin-top: 2px; }
.mobile-sidebar-balance { display: flex; gap: 16px; margin-top: 10px; font-size: 11px; color: #7c8b8f; }
.mobile-sidebar-balance b { color: #397e85; font-size: 13px; }
.mobile-sidebar-nav { flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch; padding: 10px 12px 18px; }
.mobile-sidebar-title {
    margin: 14px 8px 6px; font-size: 10px; letter-spacing: 2px; font-weight: 700;
    color: #91a0a0; text-transform: uppercase;
}
.mobile-sidebar-nav > a {
    display: flex; align-items: center; gap: 12px;
    padding: 11px 12px; border-radius: 11px; font-size: 14px; color: #1B2A31; text-decoration: none;
}
.mobile-sidebar-nav > a:active { background: rgba(83, 153, 160, 0.12); }
.mobile-sidebar-nav > a i { width: 18px; text-align: center; color: #5399A0; font-size: 14px; }
.mobile-sidebar-nav > a span { flex: 1; }
.mobile-sidebar-nav .mobile-sidebar-logout { color: #d64545; }
.mobile-sidebar-nav .mobile-sidebar-logout i { color: #d64545; }
.mobile-sidebar-footer {
    padding: 14px 18px calc(14px + env(safe-area-inset-bottom));
    font-size: 10px; color: #a8b3b3; border-top: 1px solid rgba(83, 153, 160, 0.12);
}
/* 桌面端彻底隐藏手机端结构 */
@media (min-width: 768px) {
    .mobile-sidebar { display: none !important; }
    .mobile-sidebar-overlay { display: none !important; }
}

/* ============================================================
   子站显式授权登录弹窗（/?login=1&authorize=1&client=<host>&redirect=<url>）
   DOM 由 pages/js/auth.js 动态创建；移动端单列、按钮全宽。
   ============================================================ */
.auth-authorize-backdrop {
    z-index: 120;
}
.auth-authorize {
    width: 360px;
    max-width: calc(100vw - 32px);
    padding: 26px 24px 22px;
    text-align: left;
}
.auth-authorize-account {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}
.auth-authorize-avatar {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    flex-shrink: 0;
    overflow: hidden;
    border-radius: 50%;
    background: #5399A0;
    color: #fff;
    font-weight: 700;
    font-size: 18px;
}
.auth-authorize-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.auth-authorize-account-text strong {
    display: block;
    font-size: 14px;
    color: #1B2A31;
}
.auth-authorize-account-text small {
    display: block;
    margin-top: 2px;
    font-size: 11px;
    color: #91a0a0;
}
.auth-authorize h3 {
    margin: 0 0 10px;
    font-size: 18px;
    line-height: 1.4;
    color: #1B2A31;
    text-align: center;
}
.auth-authorize-lead {
    margin: 0 0 14px;
    font-size: 13px;
    line-height: 1.6;
    color: #4b5c60;
    text-align: center;
    word-break: break-all;
}
.auth-authorize-lead strong {
    color: #397e85;
}
.auth-authorize-scopes {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin: 0 0 14px;
    padding: 12px 14px;
    border-radius: 12px;
    background: rgba(83, 153, 160, 0.07);
    list-style: none;
}
.auth-authorize-scopes li {
    position: relative;
    padding-left: 16px;
    font-size: 12px;
    line-height: 1.5;
    color: #41575b;
}
.auth-authorize-scopes li::before {
    content: '';
    position: absolute;
    top: 6px;
    left: 0;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #5399A0;
}
.auth-authorize-note {
    margin: 0 0 16px;
    font-size: 11px;
    line-height: 1.6;
    color: #91a0a0;
}
.auth-authorize-error {
    margin: 0 0 12px;
    padding: 8px 10px;
    border-radius: 8px;
    background: #fbeeec;
    color: #a3493c;
    font-size: 12px;
    line-height: 1.5;
    word-break: break-all;
}
.auth-authorize-actions {
    display: flex;
    gap: 10px;
}
.auth-authorize-btn {
    flex: 1;
    padding: 11px 14px;
    border: 1px solid rgba(83, 153, 160, 0.35);
    border-radius: 12px;
    background: #fff;
    color: #397e85;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.2s ease, border-color 0.2s ease;
}
.auth-authorize-btn:hover {
    background: rgba(83, 153, 160, 0.08);
}
.auth-authorize-btn.primary {
    border-color: #5399A0;
    background: #5399A0;
    color: #fff;
}
.auth-authorize-btn.primary:hover {
    background: #4a8a90;
}
.auth-authorize-btn[disabled] {
    opacity: 0.65;
    cursor: not-allowed;
}
@media (max-width: 480px) {
    .auth-authorize {
        padding: 22px 18px 18px;
    }
    .auth-authorize-actions {
        flex-direction: column;
    }
}
