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

        /* 可访问性：键盘与辅助技术焦点样式（不改变鼠标点击轮廓） */
        button:focus-visible,
        a:focus-visible,
        input:focus-visible,
        select:focus-visible,
        textarea:focus-visible,
        .tab-item:focus-visible,
        .toolbar-btn:focus-visible,
        .profile-menu-item:focus-visible,
        .file-card-menu-item:focus-visible,
        .breadcrumb-btn:focus-visible,
        .view-size-btn:focus-visible {
            outline: 2px solid var(--mc-primary);
            outline-offset: 2px;
        }
        button:focus:not(:focus-visible),
        a:focus:not(:focus-visible),
        input:focus:not(:focus-visible),
        .tab-item:focus:not(:focus-visible) {
            outline: none;
        }

        body {
            font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei UI', 'Microsoft YaHei', '微软雅黑', sans-serif;
            background: linear-gradient(to bottom right, var(--mc-page-bg), var(--mc-page-bg-end));
            height: 100vh;
            height: 100dvh;
            min-height: 100vh;
            overflow: hidden;
            margin: 0;
            padding: 0;
        }

        /* 欢迎页面：单屏展示，无滚动，无图案 */
        .welcome-page {
            height: calc(100vh - 60px);
            height: calc(100dvh - 60px);
            min-height: 0;
            overflow: hidden;
            padding: 24px 32px 28px;
            display: grid;
            grid-template-columns: 1fr;
            grid-template-rows: auto 1fr;
            gap: 20px;
            color: var(--mc-welcome-text);
        }

        .welcome-page.hidden {
            display: none;
        }

        .welcome-hero {
            display: flex;
            flex-direction: column;
            align-items: center;
            text-align: center;
            gap: 0;
            background: linear-gradient(135deg, rgba(var(--mc-primary-rgb), 0.08) 0%, rgba(var(--mc-accent-rgb), 0.06) 100%);
            border-radius: 20px;
            padding: 28px 28px 24px;
            box-shadow: 0 8px 32px rgba(var(--mc-primary-rgb), 0.08);
            border: 1px solid rgba(var(--mc-primary-rgb), 0.1);
        }

        .welcome-hero-text {
            min-width: 0;
            width: 100%;
        }

        .welcome-hero-title {
            font-size: 32px;
            font-weight: 800;
            line-height: 1.3;
            color: var(--mc-text-strong);
            margin: 0;
            letter-spacing: -0.02em;
        }

        .welcome-hero-subtitle {
            font-size: 16px;
            line-height: 1.6;
            color: var(--mc-welcome-subtitle);
            margin: 12px 0 0 0;
        }

        .welcome-cta-group {
            display: flex;
            flex-wrap: wrap;
            justify-content: center;
            gap: 10px;
            width: 100%;
            margin-top: 24px;
            margin-bottom: 8px;
        }

        .welcome-primary-btn,
        .welcome-secondary-btn {
            border-radius: 20px;
            padding: 12px 26px;
            font-size: 16px;
            font-weight: 600;
            cursor: pointer;
            border: none;
            transition: transform 0.2s ease, box-shadow 0.2s ease;
        }

        .welcome-cta-center {
            padding: 14px 36px;
            font-size: 18px;
            border-radius: 24px;
            box-shadow: 0 8px 24px rgba(var(--mc-primary-rgb), 0.4);
        }

        .welcome-primary-btn {
            background: var(--mc-gradient-primary);
            color: #fff;
            box-shadow: 0 6px 20px rgba(var(--mc-primary-rgb), 0.35);
        }

        .welcome-secondary-btn {
            background: #fff;
            color: #4b5563;
            border: 1px solid rgba(var(--mc-primary-rgb), 0.2);
        }

        .welcome-primary-btn:hover,
        .welcome-secondary-btn:hover {
            transform: translateY(-1px);
            box-shadow: 0 8px 24px rgba(var(--mc-primary-rgb), 0.25);
        }

        .welcome-meta {
            display: flex;
            gap: 10px;
            flex-wrap: wrap;
            justify-content: center;
            margin-top: 16px;
            font-size: 14px;
            color: #5b5f75;
            width: 100%;
        }

        .welcome-meta span {
            display: inline-flex;
            align-items: center;
            gap: 6px;
            padding: 6px 12px;
            background: rgba(255, 255, 255, 0.85);
            border-radius: 14px;
        }

        /* 下方功能区 */
        .welcome-features {
            display: flex;
            flex-direction: column;
            min-height: 0;
            background: rgba(255, 255, 255, 0.7);
            border-radius: 24px;
            padding: 20px 24px;
            box-shadow: 0 12px 40px rgba(15, 23, 42, 0.06), inset 0 1px 0 rgba(255,255,255,0.9);
            border: 1px solid rgba(var(--mc-primary-rgb), 0.08);
        }

        .welcome-features-title {
            font-size: 22px;
            font-weight: 700;
            color: var(--mc-text-strong);
            margin-bottom: 14px;
            flex-shrink: 0;
        }

        .welcome-features-grid {
            flex: 1;
            min-height: 0;
            display: grid;
            grid-template-columns: 1fr 1fr;
            grid-template-rows: 1fr 1fr;
            gap: 12px;
        }

        .welcome-feature-card {
            border-radius: 14px;
            padding: 16px 18px;
            display: flex;
            flex-direction: column;
            gap: 6px;
            transition: transform 0.2s ease, box-shadow 0.2s ease;
        }

        .welcome-feature-card:hover {
            transform: translateY(-1px);
            box-shadow: 0 8px 24px rgba(15, 23, 42, 0.08);
        }

        .welcome-feature-card-1 {
            background: linear-gradient(135deg, #fff 0%, rgba(255, 107, 107, 0.06) 100%);
            border: 1px solid rgba(255, 107, 107, 0.18);
        }

        .welcome-feature-card-2 {
            background: linear-gradient(135deg, #fff 0%, rgba(var(--mc-primary-rgb), 0.06) 100%);
            border: 1px solid rgba(var(--mc-primary-rgb), 0.18);
        }

        .welcome-feature-card-3,
        .welcome-feature-card-4 {
            background: #fff;
            border: 1px solid rgba(var(--mc-primary-rgb), 0.1);
        }

        .welcome-feature-icon {
            font-size: 28px;
            line-height: 1;
            margin-bottom: 2px;
        }

        .welcome-feature-card h3 {
            font-size: 18px;
            font-weight: 700;
            color: var(--mc-text-strong);
            margin: 0;
        }

        .welcome-feature-card p {
            font-size: 14px;
            color: #4b5563;
            line-height: 1.5;
            margin: 0;
        }

        .welcome-guide {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
            gap: 20px;
        }

        .welcome-guide-card {
            background: #ffffff;
            border-radius: 20px;
            padding: 24px;
            box-shadow: 0 12px 32px rgba(15, 23, 42, 0.08);
            border: 1px solid rgba(var(--mc-primary-rgb), 0.12);
            display: flex;
            flex-direction: column;
            gap: 12px;
        }

        .welcome-guide-card h3 {
            font-size: 18px;
            color: #2b2f6b;
            margin: 0;
        }

        .welcome-guide-card p {
            font-size: 14px;
            color: #4b5563;
            line-height: 1.6;
            margin: 0;
        }

        .welcome-guide-card small {
            font-size: 12px;
            color: #9ca3af;
        }

        @media (max-width: 900px) {
            .welcome-page {
                padding: 16px 20px 20px;
            }

            .welcome-hero {
                flex-direction: column;
                align-items: center;
                text-align: center;
                padding: 18px 22px;
            }

            .welcome-cta-group {
                width: 100%;
                justify-content: center;
            }

            .welcome-hero-title {
                font-size: 26px;
            }

            .welcome-hero-subtitle {
                font-size: 15px;
            }

            .welcome-features {
                padding: 16px 20px;
            }

            .welcome-features-title {
                font-size: 19px;
                margin-bottom: 10px;
            }

            .welcome-features-grid {
                gap: 10px;
            }

            .welcome-feature-card {
                padding: 14px 16px;
            }

            .welcome-feature-card h3 {
                font-size: 16px;
            }

            .welcome-feature-card p {
                font-size: 13px;
            }

            .welcome-feature-icon {
                font-size: 24px;
            }
        }

        @media (max-width: 768px) {
            .welcome-page {
                padding: 12px 16px 16px;
            }

            .welcome-hero-title {
                font-size: 22px;
            }
        }

        /* 页面容器 */
        .page-container {
            display: none;
            height: calc(100vh - 60px - 60px); /* 减去header和tabbar的高度 */
            height: calc(100dvh - 60px - 60px);
            overflow-y: auto;
        }

        body.viewer-full .page-container {
            height: 100vh;
            height: 100dvh;
        }

        .page-container.active {
            display: block;
        }

        body.no-top-header-page #plaza-page.active,
        body.no-top-header-page #friends-page.active,
        body.no-top-header-page #ai-creation-page.active,
        body.no-top-header-page #profile-page.active,
        body.no-top-header-page #banana-pro-page.active {
            height: calc(100vh - 60px);
            height: calc(100dvh - 60px);
        }

        /* 我的页面：头部固定，仅菜单列表滚动 */
        #profile-page.active {
            display: flex !important;
            flex-direction: column;
            overflow: hidden;
        }
        #profile-page .profile-page-header {
            flex-shrink: 0;
            padding: 16px 24px;
            background: var(--mc-elevated);
            border-bottom: 1px solid var(--mc-header-rule);
        }
        #profile-page .profile-page-body {
            flex: 1;
            min-height: 0;
            overflow-y: auto;
            padding: 0 24px 16px;
        }

        :root[data-theme="pro"] #profile-page-name {
            color: var(--mc-text-strong) !important;
        }

        :root[data-theme="pro"] #profile-page-phone {
            color: var(--mc-text-muted) !important;
        }

        :root[data-theme="pro"] #profile-page-avatar {
            background: #30363d !important;
            border-color: var(--mc-border) !important;
        }

        /* 亲友页面：Tab 固定，内容区独立滚动（参考微信） */
        #friends-page.active {
            display: flex !important;
            flex-direction: column;
            overflow: hidden;
        }
        #friends-page > div {
            display: flex;
            flex-direction: column;
            flex: 1;
            min-height: 0;
            overflow: hidden;
        }
        /* 亲友页面内容水平居中，方便使用（宽度增加50%：640→960px） */
        #friends-chat-list-panel,
        #friends-contacts-panel {
            width: 100%;
            max-width: 960px;
            margin-left: auto;
            margin-right: auto;
            box-sizing: border-box;
        }
        /* 会话/亲友头部固定，滚动条仅作用于列表区域 */
        #friends-chat-list-panel {
            display: flex;
            flex-direction: column;
            flex: 1;
            min-height: 0;
        }
        #friends-contacts-panel {
            display: flex;
            flex-direction: column;
            flex: 1;
            min-height: 0;
        }

        /* AI创作页面特殊样式（需要flex布局） */
        #ai-creation-page.active {
            display: flex !important;
        }

        /* 底部导航栏 */
        .bottom-tabbar {
            position: fixed;
            bottom: 0;
            left: 0;
            right: 0;
            height: 60px;
            background: var(--mc-surface);
            border-top: 1px solid var(--mc-border);
            display: flex;
            justify-content: space-around;
            align-items: center;
            box-shadow: var(--mc-tabbar-shadow);
            z-index: 100;
            padding-bottom: env(safe-area-inset-bottom);
        }

        body.viewer-full .bottom-tabbar {
            display: none;
        }

        .bottom-tabbar.hidden {
            display: none;
        }

        .tab-item {
            flex: 1;
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            cursor: pointer;
            transition: all 0.2s;
            padding: 4px 0;
            min-height: 44px; /* 触摸目标 ≥44px，便于移动端与 a11y */
            color: var(--mc-tab-inactive);
        }

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

        /* 微信风格图标统一样式 */
        .tab-item-icon {
            width: 24px;
            height: 24px;
            margin-bottom: 2px;
            transition: all 0.2s;
            display: flex;
            align-items: center;
            justify-content: center;
        }

        .tab-item-icon svg {
            width: 100%;
            height: 100%;
        }

        .tab-item.active .tab-item-icon {
            transform: scale(1.05);
        }

        /* 微信风格图标类 - 统一使用线条图标 */
        .icon-wechat {
            width: 20px;
            height: 20px;
            color: #576b95;
            flex-shrink: 0;
        }

        .icon-wechat svg {
            width: 100%;
            height: 100%;
            stroke: currentColor;
            stroke-width: 1.5;
            fill: none;
            stroke-linecap: round;
            stroke-linejoin: round;
        }

        .icon-wechat-lg {
            width: 24px;
            height: 24px;
            color: #576b95;
            flex-shrink: 0;
        }

        .icon-wechat-lg svg {
            width: 100%;
            height: 100%;
            stroke: currentColor;
            stroke-width: 1.5;
            fill: none;
            stroke-linecap: round;
            stroke-linejoin: round;
        }

        .icon-wechat-empty {
            width: 72px;
            height: 72px;
            color: #c7c7cc;
            margin: 0 auto;
        }

        .icon-wechat-empty svg {
            width: 100%;
            height: 100%;
            stroke: currentColor;
            stroke-width: 2;
            fill: none;
            stroke-linecap: round;
            stroke-linejoin: round;
        }

        .icon-wechat-success {
            color: #07c160;
        }

        .icon-wechat-danger {
            color: #fa5151;
        }

        /* 微信风格菜单图标 */
        .profile-menu-item svg {
            stroke: currentColor;
            stroke-width: 1.5;
            fill: none;
            stroke-linecap: round;
            stroke-linejoin: round;
        }

        /* 填充图标（用于特殊场景） */
        .icon-filled svg {
            fill: currentColor;
            stroke: none;
        }

        .tab-item-label {
            font-size: 11px;
            font-weight: 400;
            transition: all 0.2s;
        }

        .tab-item.active .tab-item-label {
            font-weight: 500;
        }

        .profile-menu-item {
            padding: 12px 16px;
            display: flex;
            align-items: center;
            justify-content: space-between;
            cursor: pointer;
            transition: background 0.2s;
            border-bottom: 1px solid var(--mc-row-divider);
            background: var(--mc-elevated);
            color: var(--mc-text);
        }

        .profile-menu-item:last-child {
            border-bottom: none;
        }

        .profile-menu-item:hover {
            background: var(--mc-row-hover);
        }

        .profile-menu-item.danger {
            color: #fa5151;
        }

        .profile-menu-item.danger:hover {
            background: #fff5f5;
        }

        :root[data-theme="pro"] .profile-menu-item.danger:hover {
            background: rgba(250, 81, 81, 0.12);
        }

        .profile-menu-section-top {
            border-top: 1px solid var(--mc-header-rule);
        }

        /* 我的 → 界面主题分段按钮 */
        .profile-menu-item.mc-theme-row {
            cursor: default;
            flex-wrap: wrap;
            align-items: flex-start;
            gap: 10px;
        }

        .profile-menu-item.mc-theme-row:hover {
            background: var(--mc-elevated);
        }

        .mc-theme-segment {
            display: flex;
            width: 100%;
            max-width: 320px;
            padding: 3px;
            border-radius: 10px;
            background: var(--mc-row-hover);
            border: 1px solid var(--mc-row-divider);
            gap: 4px;
            box-sizing: border-box;
        }

        .mc-theme-segment button {
            flex: 1;
            border: none;
            border-radius: 8px;
            padding: 8px 12px;
            font-size: 14px;
            font-weight: 500;
            font-family: inherit;
            cursor: pointer;
            background: transparent;
            color: var(--mc-text-muted);
            transition: background 0.2s, color 0.2s, box-shadow 0.2s;
        }

        .mc-theme-segment button:hover {
            color: var(--mc-text);
        }

        .mc-theme-segment button.active {
            background: var(--mc-surface);
            color: var(--mc-primary);
            box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
        }

        :root[data-theme="pro"] .mc-theme-segment button.active {
            box-shadow: 0 0 0 1px rgba(var(--mc-primary-rgb), 0.35);
        }

        .header {
            background: var(--mc-gradient-primary);
            border-bottom: none;
            padding: 10px 20px;
            display: flex;
            align-items: center;
            justify-content: space-between;
            box-shadow: 0 4px 12px rgba(var(--mc-primary-rgb), 0.3);
        }
        body.viewer-full .header {
            display: none;
        }

        .header h1 {
            font-size: 22px;
            color: #fff;
            font-weight: 700;
            text-shadow: 0 2px 4px rgba(0,0,0,0.1);
        }

        .header-controls {
            display: flex;
            align-items: center;
            gap: 12px;
        }

        /* 登录相关样式 */
        .user-info {
            display: flex;
            align-items: center;
            gap: 8px;
            padding: 8px 16px;
            background: rgba(255, 255, 255, 0.2);
            border-radius: 20px;
            cursor: pointer;
            transition: all 0.3s ease;
        }

        .user-info:hover {
            background: rgba(255, 255, 255, 0.3);
        }

        .user-avatar {
            width: 32px;
            height: 32px;
            border-radius: 50%;
            background: var(--mc-gradient-primary);
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 18px;
            object-fit: cover;
            overflow: hidden;
            color: white;
        }

        .user-avatar img {
            width: 100%;
            height: 100%;
            object-fit: cover;
        }

        .user-name {
            color: #fff;
            font-size: 14px;
            font-weight: 500;
        }

        /* 用户菜单下拉框 */
        .user-menu {
            position: absolute;
            top: 100%;
            right: 0;
            margin-top: 8px;
            background: rgba(255, 255, 255, 0.95);
            border-radius: 8px;
            box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
            min-width: 200px;
            display: none;
            z-index: 1000;
            overflow: hidden;
        }

        .user-menu.show {
            display: block;
        }

        .user-menu-item {
            padding: 12px 16px;
            cursor: pointer;
            transition: background 0.2s;
            border-bottom: 1px solid rgba(0, 0, 0, 0.05);
        }

        .user-menu-item:last-child {
            border-bottom: none;
        }

        .user-menu-item:hover {
            background: rgba(0, 0, 0, 0.05);
        }

        .user-menu-item.danger {
            color: #dc3545;
        }

        /* 用户信息编辑模态框 */
        .profile-modal {
            display: none;
            position: fixed;
            z-index: 2000;
            left: 0;
            top: 0;
            width: 100%;
            height: 100%;
            background: rgba(0, 0, 0, 0.5);
            backdrop-filter: blur(4px);
        }

        .profile-modal-content {
            background: white;
            margin: 1.5rem auto;
            padding: 0;
            border-radius: 12px;
            width: 90%;
            max-width: 500px;
            box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
            animation: slideDown 0.3s ease;
            position: relative;
        }

        /* 我的资料 - 现代化布局（紧凑省高） */
        .profile-modal-body {
            padding: 0 20px 16px;
        }
        .profile-avatar-block {
            text-align: center;
            margin-bottom: 14px;
        }
        .profile-avatar-wrap {
            display: inline-flex;
            position: relative;
            cursor: pointer;
            border-radius: 50%;
            overflow: hidden;
        }
        .profile-avatar-wrap:hover .profile-avatar-change {
            opacity: 1;
        }
        .profile-avatar-img {
            width: 72px;
            height: 72px;
            border-radius: 50%;
            object-fit: cover;
            display: block;
            background: #f0f0f0;
        }
        .profile-avatar-placeholder {
            width: 72px;
            height: 72px;
            border-radius: 50%;
            background: #e8e8e8;
            color: #999;
            font-size: 30px;
            align-items: center;
            justify-content: center;
        }
        .profile-avatar-change {
            position: absolute;
            left: 0;
            right: 0;
            bottom: 0;
            padding: 4px 0;
            background: rgba(0, 0, 0, 0.5);
            color: #fff;
            font-size: 11px;
            opacity: 0;
            transition: opacity 0.2s ease;
        }
        .profile-section {
            margin-bottom: 14px;
        }
        .profile-section + .profile-section {
            border-top: 1px solid #eee;
            padding-top: 14px;
        }
        .profile-section-first {
            margin-top: 0;
            padding-top: 0;
            border-top: none;
        }
        .profile-section-title {
            font-size: 13px;
            font-weight: 600;
            color: #666;
            margin: 0 0 8px 0;
            letter-spacing: 0.02em;
        }
        .profile-required {
            color: #e53935;
        }
        .profile-optional {
            font-size: 12px;
            font-weight: 400;
            color: #999;
        }
        .profile-char-count {
            display: block;
            text-align: right;
            font-size: 12px;
            color: #999;
            margin-top: 2px;
        }
        .profile-bio-group .profile-char-count {
            margin-top: 4px;
        }
        .profile-phone-row {
            display: flex;
            gap: 8px;
            align-items: center;
        }
        .profile-phone-readonly {
            flex: 1;
            background: #f5f5f5 !important;
            color: #666;
        }
        .profile-btn-secondary {
            padding: 6px 14px;
            background: #f0f0f0;
            color: #333;
            border: none;
            border-radius: 8px;
            font-size: 14px;
            cursor: pointer;
            flex-shrink: 0;
        }
        .profile-btn-secondary:hover {
            background: #e0e0e0;
        }
        .profile-extra-rows {
            background: #fff;
            border-radius: 10px;
            border: 1px solid #eee;
            overflow: hidden;
        }
        .profile-row {
            display: flex;
            align-items: center;
            justify-content: space-between;
            padding: 10px 14px;
            cursor: pointer;
            transition: background 0.15s ease;
            min-height: 40px;
            box-sizing: border-box;
        }
        .profile-row:hover {
            background: #f8f9fa;
        }
        .profile-row:active {
            background: #f0f0f0;
        }
        .profile-row + .profile-row {
            border-top: 1px solid #f0f0f0;
        }
        .profile-row-last {
            border-bottom: none;
        }
        .profile-row-label {
            font-size: 15px;
            color: #333;
        }
        .profile-row-value {
            font-size: 14px;
            color: #666;
            display: flex;
            align-items: center;
            gap: 6px;
        }
        .profile-row-value.profile-value-empty {
            color: #999;
        }
        .profile-row-value.profile-row-action {
            color: #666;
            font-size: 14px;
        }
        .profile-row-icon {
            width: 20px;
            height: 20px;
            background-size: contain;
            background-repeat: no-repeat;
            background-position: center;
        }
        .profile-row-icon-qr {
            background-image: url('data:image/svg+xml,%3Csvg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="%23999" stroke-width="2"%3E%3Crect x="3" y="3" width="7" height="7"/%3E%3Crect x="14" y="3" width="7" height="7"/%3E%3Crect x="3" y="14" width="7" height="7"/%3E%3Crect x="8" y="8" width="3" height="3"/%3E%3Crect x="14" y="8" width="3" height="3"/%3E%3Crect x="8" y="14" width="3" height="3"/%3E%3C/svg%3E');
        }
        .profile-row-arrow {
            color: #bbb;
            font-size: 18px;
            font-weight: 300;
        }
        .profile-btn-address {
            width: 100%;
            padding: 10px 14px;
            background: var(--mc-gradient-primary);
            color: #fff;
            border: none;
            border-radius: 10px;
            font-size: 14px;
            font-weight: 500;
            cursor: pointer;
            margin-top: 6px;
            margin-bottom: 6px;
        }
        .profile-btn-address:hover {
            opacity: 0.95;
        }
        .profile-address-preview {
            background: #f8f9fa;
            padding: 10px 14px;
            border-radius: 8px;
            font-size: 13px;
            color: #999;
            text-align: center;
        }
        .profile-actions {
            display: flex;
            flex-direction: column;
            gap: 8px;
            margin-top: 16px;
        }
        .profile-btn-primary {
            width: 100%;
            padding: 12px 20px;
            background: linear-gradient(135deg, #007bff 0%, #0056b3 100%);
            color: #fff;
            border: none;
            border-radius: 10px;
            font-size: 16px;
            font-weight: 500;
            cursor: pointer;
        }
        .profile-btn-primary:hover {
            opacity: 0.95;
        }
        .profile-btn-ghost {
            width: 100%;
            padding: 10px 20px;
            background: transparent;
            color: #666;
            border: none;
            font-size: 14px;
            cursor: pointer;
        }
        .profile-btn-ghost:hover {
            color: #333;
        }
        .profile-error {
            margin-top: 12px;
            color: #e53935;
            font-size: 14px;
            text-align: center;
        }

        .profile-form-group {
            margin-bottom: 14px;
        }

        .profile-form-group label {
            display: block;
            margin-bottom: 6px;
            font-weight: 500;
            color: #333;
        }

        .profile-form-group input,
        .profile-form-group textarea {
            width: 100%;
            padding: 8px 10px;
            border: 1px solid #ddd;
            border-radius: 6px;
            font-size: 14px;
            font-family: inherit;
        }

        .profile-form-group textarea {
            min-height: 60px;
            resize: vertical;
        }

        .avatar-upload-area {
            display: flex;
            align-items: center;
            gap: 16px;
            margin-bottom: 20px;
        }

        .avatar-preview {
            width: 80px;
            height: 80px;
            border-radius: 50%;
            background: #f0f0f0;
            display: flex;
            align-items: center;
            justify-content: center;
            overflow: hidden;
            border: 2px solid #ddd;
        }

        .avatar-preview img {
            width: 100%;
            height: 100%;
            object-fit: cover;
        }

        .avatar-upload-btn {
            padding: 8px 16px;
            background: #007bff;
            color: white;
            border: none;
            border-radius: 6px;
            cursor: pointer;
            font-size: 14px;
        }

        .avatar-upload-btn:hover {
            background: #0056b3;
        }

        .login-btn {
            background: rgba(255, 255, 255, 0.2);
            color: white;
            border: 1px solid rgba(255, 255, 255, 0.3);
            padding: 8px 16px;
            border-radius: 20px;
            cursor: pointer;
            font-size: 14px;
            transition: all 0.3s ease;
        }

        .login-btn:hover {
            background: rgba(255, 255, 255, 0.3);
        }

        /* 登录模态框 */
        .modal {
            display: none;
            position: fixed;
            z-index: 10001; /* 确保对话框在所有元素之上（包括文件卡片菜单） */
            left: 0;
            top: 0;
            width: 100%;
            height: 100%;
            background: rgba(0, 0, 0, 0.5);
            backdrop-filter: blur(4px);
        }

        /* 聊天窗口与广场/亲友一致：按手机屏宽，最大 750px 居中 */
        #chat-modal.chat-modal-fullscreen {
            align-items: stretch;
            justify-content: stretch;
            background: #fff;
            backdrop-filter: none;
        }
        #chat-modal.chat-modal-fullscreen .chat-modal-content-fullscreen {
            width: 100%;
            max-width: min(100%, 750px);
            height: 100%;
            margin: 0 auto;
            padding: 0;
            border-radius: 0;
            box-shadow: none;
            background: #fff;
        }
        /* 密友订阅弹窗：与聊天框同尺寸，左侧箭头返回 */
        #close-friend-modal.close-friend-modal-fullscreen {
            display: flex;
            align-items: stretch;
            justify-content: center;
            background: #fff;
            backdrop-filter: none;
        }
        #close-friend-modal.close-friend-modal-fullscreen .close-friend-modal-content-fullscreen {
            width: 100%;
            max-width: min(100%, 750px);
            height: 100%;
            min-height: 100vh;
            margin: 0 auto;
            padding: 0;
            border-radius: 0;
            box-shadow: none;
            background: #fff;
        }
        #cf-subscribe-btn {
            position: relative;
            z-index: 2;
            pointer-events: auto;
            min-height: 44px;
        }
        /* 私密相册弹窗：与聊天框同尺寸（最大 750px 宽，全高） */
        #partner-album-modal.partner-album-modal-fullscreen {
            display: flex;
            align-items: stretch;
            justify-content: center;
            height: 100vh;
            min-height: 100vh;
            width: 100%;
            background: rgba(0, 0, 0, 0.5);
            backdrop-filter: blur(4px);
        }
        #partner-album-modal.partner-album-modal-fullscreen .partner-album-content-fullscreen {
            width: 100%;
            max-width: min(100%, 750px);
            height: 100vh;
            min-height: 100vh;
            margin: 0 auto;
            padding: 0;
            border-radius: 0;
            box-shadow: none;
            background: #fff;
            display: flex;
            flex-direction: column;
            overflow: hidden;
        }
        #partner-album-content {
            min-height: 0;
        }
        #chat-favorite-btn.active svg { fill: #ffc107; stroke: #ffc107; }

        .modal-content {
            background: white;
            margin: 5% auto;
            padding: 30px;
            border-radius: 16px;
            width: 90%;
            max-width: 450px;
            max-height: 85vh;
            overflow-y: auto;
            box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
            position: relative;
        }

        /* 确保关闭按钮在滚动时始终可见 */
        .modal-content:has(.close-modal) {
            padding-top: 48px;
        }

        /* 我的资料 - 二维码/性别/地区/出生日期 弹窗居中 */
        #profile-qrcode-modal.modal,
        #profile-extra-edit-modal.modal {
            align-items: center;
            justify-content: center;
        }
        #profile-extra-edit-body input {
            box-sizing: border-box;
        }
        .profile-picker-row {
            margin-bottom: 14px;
        }
        .profile-picker-row:last-child {
            margin-bottom: 0;
        }
        .profile-picker-row label {
            display: block;
            font-size: 13px;
            color: #666;
            margin-bottom: 6px;
        }

        /* AI手办创作弹窗：标题和底部固定，仅内容区滚动，滚动条不影响标题 */
        .ai-creation-modal-content {
            display: flex;
            flex-direction: column;
            overflow: hidden;
            padding: 0;
            padding-top: 48px; /* 为关闭按钮留出空间 */
        }
        .ai-creation-modal-content .modal-header {
            flex-shrink: 0;
            padding: 24px 24px 0;
            margin-bottom: 0;
        }
        #ai-creation-modal-body {
            flex: 1;
            min-height: 0;
            overflow-y: auto;
        }
        .ai-creation-modal-content #ai-creation-modal-footer {
            flex-shrink: 0;
        }
        #ai-creation-modal-body::-webkit-scrollbar {
            display: none;
        }

        .modal-header {
            text-align: center;
            margin-bottom: 24px;
        }

        .modal-header h2 {
            color: var(--mc-primary);
            font-size: 24px;
            margin-bottom: 8px;
        }

        .modal-header p {
            color: #666;
            font-size: 14px;
        }

        .form-group {
            margin-bottom: 20px;
        }

        .form-group label {
            display: block;
            margin-bottom: 8px;
            color: #333;
            font-size: 14px;
            font-weight: 500;
        }

        .form-group input {
            width: 100%;
            padding: 12px;
            border: 2px solid #e0e0e0;
            border-radius: 8px;
            font-size: 14px;
            transition: border-color 0.3s;
        }

        .form-group input:focus {
            border-color: var(--mc-primary);
        }
        .form-group input:focus-visible {
            outline: 2px solid var(--mc-primary);
            outline-offset: 2px;
        }
        .form-group input:focus:not(:focus-visible) {
            outline: none;
        }

        .send-code-btn {
            width: 100%;
            padding: 12px;
            background: var(--mc-gradient-primary);
            color: white;
            border: none;
            border-radius: 8px;
            font-size: 14px;
            font-weight: 500;
            cursor: pointer;
            transition: all 0.3s;
        }

        .send-code-btn:hover {
            transform: translateY(-2px);
            box-shadow: 0 4px 12px rgba(var(--mc-primary-rgb), 0.4);
        }

        .send-code-btn:disabled {
            opacity: 0.6;
            cursor: not-allowed;
            transform: none;
        }

        .close-modal {
            position: sticky;
            top: 16px;
            float: right;
            margin-bottom: -32px;
            margin-left: auto;
            background: rgba(255, 255, 255, 0.95);
            border: none;
            font-size: 24px;
            color: #999;
            cursor: pointer;
            width: 32px;
            height: 32px;
            display: flex;
            align-items: center;
            justify-content: center;
            border-radius: 50%;
            transition: all 0.3s;
            z-index: 1000;
            box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
        }

        .close-modal:hover {
            background: rgba(255, 255, 255, 1);
            color: #333;
            box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
        }

        /* 与系统消息一致：标题栏和关闭按钮固定在上端，仅内容区滚动 */
        .modal-fixed-header {
            display: flex;
            flex-direction: column;
            max-height: 90vh;
            overflow: hidden;
            padding: 0;
        }
        .modal-fixed-header .modal-fixed-header-top {
            flex-shrink: 0;
            display: flex;
            align-items: center;
            justify-content: space-between;
            padding: 16px 24px;
            border-bottom: 1px solid #eee;
            background: #fff;
        }
        /* 我的资料弹窗：标题栏更紧凑以节省高度 */
        .profile-modal-content .modal-fixed-header-top {
            padding: 12px 20px;
        }
        .profile-modal-content .modal-fixed-header-top h2 {
            font-size: 18px;
        }
        .modal-fixed-header .modal-fixed-header-top h2 {
            margin: 0;
            font-size: 20px;
            font-weight: 700;
            color: #2b2f6b;
        }
        .modal-fixed-header .modal-fixed-header-top p {
            margin: 4px 0 0 0;
            font-size: 14px;
            color: #666;
        }
        .modal-fixed-header .modal-fixed-header-body {
            flex: 1;
            min-height: 0;
            overflow-y: auto;
        }
        .modal-fixed-header .close-modal {
            position: static;
            float: none;
            margin: 0;
            margin-bottom: 0;
            flex-shrink: 0;
        }

        /* Toast 通知样式 */
        .toast-container {
            position: fixed;
            top: 80px;
            left: 50%;
            transform: translateX(-50%);
            z-index: 10000;
            pointer-events: none;
        }

        .toast {
            background: white;
            border-radius: 12px;
            padding: 16px 24px;
            margin-bottom: 12px;
            box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
            display: flex;
            align-items: center;
            gap: 12px;
            min-width: 280px;
            max-width: 400px;
            animation: toastSlideIn 0.3s ease-out;
            pointer-events: auto;
        }

        .toast.success {
            border-left: 4px solid #07c160;
        }

        .toast.error {
            border-left: 4px solid #ff3b30;
        }

        .toast.info {
            border-left: 4px solid #1890ff;
        }

        .toast.warning {
            border-left: 4px solid #ff9500;
        }

        @keyframes pulse {
            0%, 100% {
                transform: scale(1);
                opacity: 1;
            }
            50% {
                transform: scale(1.05);
                opacity: 0.9;
            }
        }

        @keyframes toastSlideIn {
            from {
                opacity: 0;
                transform: translateY(-20px);
            }
            to {
                opacity: 1;
                transform: translateY(0);
            }
        }

        @keyframes toastSlideOut {
            from {
                opacity: 1;
                transform: translateY(0);
            }
            to {
                opacity: 0;
                transform: translateY(-20px);
            }
        }

        .toast.hiding {
            animation: toastSlideOut 0.3s ease-out forwards;
        }

        .toast-icon {
            font-size: 24px;
            flex-shrink: 0;
        }

        .toast-content {
            flex: 1;
        }

        .toast-title {
            font-size: 16px;
            font-weight: 600;
            color: #333;
            margin-bottom: 4px;
        }

        .toast-message {
            font-size: 14px;
            color: #666;
            line-height: 1.5;
        }

        .status-indicator {
            display: flex;
            align-items: center;
            gap: 6px;
            font-size: 12px;
            color: #666;
        }

        .status-dot {
            width: 8px;
            height: 8px;
            border-radius: 50%;
            background: #28a745;
            animation: pulse 2s infinite;
        }

        @keyframes pulse {
            0% { opacity: 1; }
            50% { opacity: 0.5; }
            100% { opacity: 1; }
        }

        .refresh-btn {
            background: var(--mc-gradient-primary);
            color: white;
            border: none;
            padding: 10px 20px;
            border-radius: 25px;
            cursor: pointer;
            font-size: 14px;
            font-weight: 500;
            transition: all 0.3s ease;
            box-shadow: 0 4px 12px rgba(var(--mc-primary-rgb), 0.3);
        }
        .refresh-btn:hover {
            transform: translateY(-2px);
            box-shadow: 0 6px 16px rgba(var(--mc-primary-rgb), 0.4);
        }

        .main-container {
            display: flex;
            height: calc(100vh - 60px - 60px); /* 减去header和tabbar的高度 */
            height: calc(100dvh - 60px - 60px);
            position: relative;
            overflow: hidden;
        }

        body.viewer-full .main-container {
            height: 100vh;
            height: 100dvh;
        }

        .sidebar {
            width: 320px;
            background: linear-gradient(to bottom, #ffffff, #f8f9ff);
            border-right: 2px solid #e8eaf6;
            display: flex;
            flex-direction: column;
            padding: 0;
            box-shadow: 2px 0 8px rgba(0,0,0,0.05);
            height: calc(100vh - 140px); /* 减去header和tabbar的高度 */
            height: calc(100dvh - 140px);
            transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), margin-left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
            position: relative;
            flex-shrink: 0;
        }

        /* 侧边栏收缩状态 */
        .sidebar.collapsed {
            margin-left: -320px;
        }

        /* 侧边栏悬停时弹出（半透明预览） */
        .sidebar.collapsed:hover {
            transform: translateX(320px);
            opacity: 0.95;
            z-index: 100;
            box-shadow: 4px 0 24px rgba(0,0,0,0.15);
        }

        /* 侧边栏切换按钮 */
        .sidebar-toggle {
            position: absolute;
            top: 50%;
            right: -48px;
            transform: translateY(-50%);
            width: 48px;
            height: 80px;
            background: var(--mc-gradient-primary);
            border: none;
            border-radius: 0 12px 12px 0;
            cursor: pointer;
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            gap: 4px;
            color: white;
            font-size: 20px;
            box-shadow: 4px 0 16px rgba(var(--mc-primary-rgb), 0.4);
            transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
            z-index: 10;
        }

        .sidebar-toggle:hover {
            width: 52px;
            box-shadow: 6px 0 20px rgba(var(--mc-primary-rgb), 0.6);
            background: linear-gradient(135deg, #7c92f5 0%, #8a5cb8 100%);
        }

        .sidebar-toggle::before {
            content: '📁';
            font-size: 24px;
            animation: pulse 2s ease-in-out infinite;
        }

        .sidebar-toggle::after {
            content: '展开';
            font-size: 11px;
            font-weight: 600;
            letter-spacing: 1px;
        }

        /* 收缩状态下的按钮 */
        .sidebar.collapsed .sidebar-toggle {
            right: -48px;
        }

        /* 展开状态下的按钮（完全固定时）*/
        .sidebar:not(.collapsed) .sidebar-toggle::before {
            content: '📂';
        }

        .sidebar:not(.collapsed) .sidebar-toggle::after {
            content: '收起';
        }

        @keyframes pulse {
            0%, 100% {
                transform: scale(1);
            }
            50% {
                transform: scale(1.15);
            }
        }

        /* 收缩提示动画 */
        .sidebar-toggle .toggle-hint {
            position: absolute;
            right: 100%;
            white-space: nowrap;
            background: rgba(0,0,0,0.85);
            color: white;
            padding: 6px 12px;
            border-radius: 6px;
            font-size: 12px;
            pointer-events: none;
            opacity: 0;
            transition: opacity 0.3s;
            margin-right: 8px;
        }

        .sidebar-toggle:hover .toggle-hint {
            opacity: 1;
        }
        
        /* 上传区域 - 固定在上方，独立区域 */
        .sidebar-upload-section {
            padding: 12px 16px;
            background: #f8f9fa;
            border-bottom: 1px solid #e0e0e0;
            flex-shrink: 0;
        }
        
        .upload-section-box {
            background: #ffffff;
            padding: 10px 12px;
            border-radius: 6px;
            border: 1px solid #e0e0e0;
        }
        
        .sidebar-upload-section h3 {
            font-size: 14px;
            color: #495057;
            margin-bottom: 8px;
            font-weight: 600;
            display: none; /* 隐藏"上传模型"标题 */
        }
        
        /* 浏览区域 - 可滚动，独立区域 */
        .sidebar-browse-section {
            flex: 1;
            display: flex;
            flex-direction: column;
            min-height: 0;
            overflow: hidden;
        }

        .sidebar-browse-header {
            flex-shrink: 0;
            padding: 16px 16px 12px 16px;
            background: #ffffff;
            border-bottom: 1px solid #e8eaf6;
        }

        .sidebar-browse-section h2 {
            font-size: 16px;
            color: var(--mc-primary);
            margin-bottom: 12px;
            margin-top: 0;
            font-weight: 600;
            display: flex;
            align-items: center;
            gap: 6px;
        }

        .sidebar-browse-body {
            flex: 1;
            overflow-y: auto;
            padding: 16px;
        }

        .file-count {
            font-size: 12px;
            color: #666;
            margin-bottom: 16px;
            padding: 4px 8px;
            background: #f8f9fa;
            border-radius: 4px;
            display: inline-block;
        }

        .file-list {
            list-style: none;
        }

        .file-item {
            padding: 20px;
            border: 2px solid #e8eaf6;
            border-radius: 12px;
            margin-bottom: 16px;
            cursor: pointer;
            transition: all 0.3s ease;
            background: linear-gradient(to bottom right, #ffffff, #fafaff);
            box-shadow: 0 2px 8px rgba(0,0,0,0.03);
            min-height: 280px;
            display: flex;
            flex-direction: column;
        }
        
        .file-thumbnail {
            width: 100%;
            height: 180px;
            border-radius: 8px;
            object-fit: cover;
            margin-bottom: 12px;
            background: linear-gradient(135deg, #e0e7ff 0%, #ddd6fe 100%);
            display: flex;
            align-items: center;
            justify-content: center;
            overflow: hidden;
            position: relative;
            cursor: default;
        }
        
        .file-thumbnail img {
            width: 100%;
            height: 100%;
            object-fit: cover;
        }
        
        /* 保持 16:9 比例 */
        .file-thumbnail,
        .file-thumbnail img {
            aspect-ratio: 16 / 9;
        }
        
        .file-thumbnail-placeholder {
            font-size: 48px;
            color: var(--mc-primary);
            opacity: 0.5;
        }
        
        .file-thumbnail-upload-btn {
            position: absolute;
            bottom: 8px;
            right: 8px;
            background: var(--mc-gradient-primary);
            color: white;
            border: none;
            padding: 8px 20px;
            border-radius: 20px;
            font-size: 12px;
            font-weight: 500;
            cursor: pointer;
            opacity: 0;
            transition: all 0.3s ease;
            z-index: 10;
            box-shadow: 0 4px 12px rgba(var(--mc-primary-rgb), 0.4);
            white-space: nowrap;
        }

        /* 缩略图裁切预览模态框 */
        .thumbnail-crop-modal {
            display: none;
            position: fixed;
            z-index: 3000;
            left: 0;
            top: 0;
            width: 100%;
            height: 100%;
            background: rgba(0, 0, 0, 0.8);
            backdrop-filter: blur(4px);
        }

        .thumbnail-crop-modal.active {
            display: flex;
            align-items: center;
            justify-content: center;
        }

        .thumbnail-crop-content {
            background: white;
            border-radius: 16px;
            width: 90%;
            max-width: 800px;
            max-height: 90vh;
            display: flex;
            flex-direction: column;
            overflow: hidden;
            box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
            animation: slideDown 0.3s ease;
        }

        .thumbnail-crop-header {
            padding: 20px 24px;
            border-bottom: 1px solid #e5e5e5;
            display: flex;
            justify-content: space-between;
            align-items: center;
            background: var(--mc-gradient-primary);
            color: white;
        }

        .thumbnail-crop-header h3 {
            margin: 0;
            font-size: 18px;
            font-weight: 600;
        }

        .thumbnail-crop-close {
            background: none;
            border: none;
            color: white;
            font-size: 24px;
            cursor: pointer;
            padding: 0;
            width: 32px;
            height: 32px;
            display: flex;
            align-items: center;
            justify-content: center;
            border-radius: 50%;
            transition: background 0.2s;
        }

        .thumbnail-crop-close:hover {
            background: rgba(255, 255, 255, 0.2);
        }

        .thumbnail-crop-body {
            padding: 24px;
            display: flex;
            flex-direction: column;
            gap: 20px;
            overflow-y: auto;
            flex: 1;
        }

        .thumbnail-crop-preview-container {
            position: relative;
            width: 100%;
            background: #000;
            border-radius: 8px;
            overflow: hidden;
            display: flex;
            align-items: center;
            justify-content: center;
            min-height: 400px;
            max-height: 60vh;
        }

        .thumbnail-crop-image-container {
            position: relative;
            width: 100%;
            height: 100%;
            display: flex;
            align-items: center;
            justify-content: center;
        }

        .thumbnail-crop-image {
            max-width: 100%;
            max-height: 100%;
            display: block;
        }

        .thumbnail-crop-overlay {
            position: absolute;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            pointer-events: none;
        }

        .thumbnail-crop-box {
            position: absolute;
            border: 4px solid var(--mc-primary);
            box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.6), 0 0 0 2px rgba(255, 255, 255, 0.9), 0 0 30px rgba(var(--mc-primary-rgb), 1);
            pointer-events: auto;
            cursor: move;
            background: rgba(var(--mc-primary-rgb), 0.15);
            user-select: none;
        }
        
        .thumbnail-crop-box:hover {
            cursor: move;
            border-color: var(--mc-accent-warm);
            background: rgba(var(--mc-primary-rgb), 0.2);
        }
        
        .thumbnail-crop-box:active,
        .thumbnail-crop-box.dragging {
            cursor: grabbing !important;
            border-color: #fff;
            box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.7), 0 0 0 3px rgba(255, 255, 255, 1), 0 0 40px rgba(var(--mc-primary-rgb), 1.2);
        }

        .thumbnail-crop-box::before {
            content: '';
            position: absolute;
            top: -4px;
            left: -4px;
            right: -4px;
            bottom: -4px;
            border: 3px dashed rgba(255, 255, 255, 1);
            box-shadow: inset 0 0 10px rgba(255, 255, 255, 0.5);
        }

        .thumbnail-crop-handle {
            position: absolute;
            width: 20px;
            height: 20px;
            background: var(--mc-primary);
            border: 3px solid white;
            border-radius: 50%;
            pointer-events: all;
            cursor: nwse-resize;
            box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4), 0 0 0 2px rgba(var(--mc-primary-rgb), 0.8);
            transition: all 0.2s;
        }

        .thumbnail-crop-handle:hover {
            transform: scale(1.3);
            background: var(--mc-accent-warm);
            box-shadow: 0 4px 12px rgba(0, 0, 0, 0.6), 0 0 0 3px rgba(var(--mc-primary-rgb), 1);
        }

        .thumbnail-crop-handle.nw { top: -10px; left: -10px; cursor: nwse-resize; }
        .thumbnail-crop-handle.ne { top: -10px; right: -10px; cursor: nesw-resize; }
        .thumbnail-crop-handle.sw { bottom: -10px; left: -10px; cursor: nesw-resize; }
        .thumbnail-crop-handle.se { bottom: -10px; right: -10px; cursor: nwse-resize; }
        .thumbnail-crop-handle.n { top: -10px; left: 50%; transform: translateX(-50%); cursor: ns-resize; }
        .thumbnail-crop-handle.n:hover { transform: translateX(-50%) scale(1.3); }
        .thumbnail-crop-handle.s { bottom: -10px; left: 50%; transform: translateX(-50%); cursor: ns-resize; }
        .thumbnail-crop-handle.s:hover { transform: translateX(-50%) scale(1.3); }
        .thumbnail-crop-handle.w { left: -10px; top: 50%; transform: translateY(-50%); cursor: ew-resize; }
        .thumbnail-crop-handle.w:hover { transform: translateY(-50%) scale(1.3); }
        .thumbnail-crop-handle.e { right: -10px; top: 50%; transform: translateY(-50%); cursor: ew-resize; }
        .thumbnail-crop-handle.e:hover { transform: translateY(-50%) scale(1.3); }

        .thumbnail-crop-ratio-selector {
            display: flex;
            gap: 12px;
            align-items: center;
            padding: 12px;
            background: #f5f5f5;
            border-radius: 8px;
        }

        .thumbnail-crop-ratio-selector label {
            font-size: 14px;
            font-weight: 500;
            color: #333;
        }

        .thumbnail-crop-ratio-buttons {
            display: flex;
            gap: 8px;
            flex: 1;
        }

        .thumbnail-crop-ratio-btn {
            padding: 8px 16px;
            border: 2px solid #ddd;
            background: white;
            border-radius: 6px;
            cursor: pointer;
            font-size: 14px;
            transition: all 0.2s;
            flex: 1;
        }

        .thumbnail-crop-ratio-btn:hover {
            border-color: var(--mc-primary);
            color: var(--mc-primary);
        }

        .thumbnail-crop-ratio-btn.active {
            background: var(--mc-gradient-primary);
            border-color: var(--mc-primary);
            color: white;
        }

        .thumbnail-crop-info {
            padding: 12px;
            background: #f0f4ff;
            border-radius: 8px;
            font-size: 13px;
            color: #4b5563;
            text-align: center;
        }

        .thumbnail-crop-footer {
            padding: 20px 24px;
            border-top: 1px solid #e5e5e5;
            display: flex;
            justify-content: flex-end;
            gap: 12px;
        }

        .thumbnail-crop-btn {
            padding: 10px 24px;
            border: none;
            border-radius: 8px;
            font-size: 14px;
            font-weight: 500;
            cursor: pointer;
            transition: all 0.2s;
        }

        .thumbnail-crop-btn-cancel {
            background: #f5f5f5;
            color: #666;
        }

        .thumbnail-crop-btn-cancel:hover {
            background: #e5e5e5;
        }

        .thumbnail-crop-btn-confirm {
            background: var(--mc-gradient-primary);
            color: white;
        }

        .thumbnail-crop-btn-confirm:hover {
            transform: translateY(-1px);
            box-shadow: 0 4px 12px rgba(var(--mc-primary-rgb), 0.4);
        }
        
        .file-thumbnail-upload-btn:hover {
            transform: translateY(-2px);
            box-shadow: 0 6px 16px rgba(var(--mc-primary-rgb), 0.5);
        }
        
        .file-thumbnail:hover .file-thumbnail-upload-btn {
            opacity: 1;
        }

        .file-item:hover {
            background: linear-gradient(to bottom right, #f0f4ff, #e8edff);
            border-color: var(--mc-primary);
            transform: translateY(-2px);
            box-shadow: 0 6px 16px rgba(var(--mc-primary-rgb), 0.15);
        }

        .file-item.active {
            background: var(--mc-gradient-primary);
            border-color: var(--mc-primary);
            color: white;
            box-shadow: 0 4px 16px rgba(var(--mc-primary-rgb), 0.3);
        }
        
        .file-item.active .file-name {
            color: white;
        }
        
        .file-item.active .file-info {
            color: rgba(255,255,255,0.9);
        }
        
        .file-item.active .file-thumbnail {
            border: 2px solid rgba(255,255,255,0.5);
        }

        .file-name {
            font-weight: 600;
            color: #333;
            margin-bottom: 8px;
            word-break: break-all;
            font-size: 15px;
        }

        .file-info {
            font-size: 13px;
            color: #666;
            margin-top: auto;
        }
         .file-actions {
             margin-top: 8px;
             display: flex;
             gap: 8px;
         }

         .share-btn {
             background: var(--mc-gradient-primary);
             color: white;
             border: none;
             padding: 6px 12px;
             border-radius: 6px;
             font-size: 12px;
             cursor: pointer;
             transition: all 0.2s;
             margin-right: 4px;
         }
         .share-btn:hover {
             transform: translateY(-1px);
             box-shadow: 0 4px 8px rgba(var(--mc-primary-rgb), 0.3);
         }
         .rename-btn {
             background: var(--mc-gradient-primary);
             color: white;
             border: none;
             padding: 6px 14px;
             border-radius: 16px;
             cursor: pointer;
             font-size: 12px;
             font-weight: 500;
             transition: all 0.2s ease;
             box-shadow: 0 2px 6px rgba(var(--mc-primary-rgb), 0.2);
         }

         .rename-btn:hover {
             transform: translateY(-1px);
             box-shadow: 0 4px 8px rgba(var(--mc-primary-rgb), 0.3);
         }

         .delete-btn {
             background: linear-gradient(135deg, #ff6b6b 0%, #ee5a6f 100%);
             color: white;
             border: none;
             padding: 6px 14px;
             border-radius: 16px;
             cursor: pointer;
             font-size: 12px;
             font-weight: 500;
             transition: all 0.2s ease;
             box-shadow: 0 2px 6px rgba(238, 90, 111, 0.2);
         }

         .delete-btn:hover {
             transform: translateY(-1px);
             box-shadow: 0 4px 8px rgba(238, 90, 111, 0.3);
         }

         .folder-item {
             padding: 12px;
             border: 1px solid #e0e0e0;
             border-radius: 8px;
             margin-bottom: 8px;
             background: #f8f9fa;
             cursor: pointer;
             transition: all 0.2s;
         }

         .folder-item:hover {
             background: #e9ecef;
             border-color: #007bff;
         }

         .folder-item.expanded {
             background: #e3f2fd;
             border-color: #007bff;
         }

         .folder-header {
             display: flex;
             align-items: center;
             justify-content: space-between;
            width: 100%;
         }

         .folder-name {
             font-weight: 500;
             color: #333;
             display: flex;
             align-items: center;
             gap: 8px;
            flex: 1;
         }

         .folder-icon {
             font-size: 16px;
             transition: transform 0.2s;
         }

         .folder-item.expanded .folder-icon {
             transform: rotate(90deg);
         }

         .folder-count {
             font-size: 12px;
             color: #666;
             margin-left: 8px;
         }

         .folder-files {
             margin-top: 8px;
             padding-left: 20px;
             display: none;
         }

         .folder-item.expanded .folder-files {
             display: block;
         }

         .folder-file-item {
             padding: 20px;
             border: 2px solid #e8eaf6;
             border-radius: 12px;
             margin-bottom: 16px;
             background: linear-gradient(to bottom right, #ffffff, #fafaff);
             cursor: pointer;
             transition: all 0.3s ease;
             min-height: 280px;
             display: flex;
             flex-direction: column;
             box-shadow: 0 2px 8px rgba(0,0,0,0.03);
         }

         .folder-file-item:hover {
             background: linear-gradient(to bottom right, #f0f4ff, #e8edff);
             border-color: var(--mc-primary);
             transform: translateY(-2px);
             box-shadow: 0 6px 16px rgba(var(--mc-primary-rgb), 0.15);
         }

         .folder-file-item.active {
             background: var(--mc-gradient-primary);
             border-color: var(--mc-primary);
             color: white;
             box-shadow: 0 4px 16px rgba(var(--mc-primary-rgb), 0.3);
         }
         
         .folder-file-item.active .folder-file-name {
             color: white;
         }
         
         .folder-file-item.active .folder-file-info {
             color: rgba(255,255,255,0.9);
         }

         .folder-file-name {
             font-weight: 600;
             color: #333;
             margin-bottom: 8px;
             font-size: 15px;
         }

         .folder-file-info {
             font-size: 13px;
             color: #666;
             margin-top: auto;
         }
         
         /* 文件夹内文件的缩略图样式 */
         .folder-file-thumbnail {
             width: 100%;
             height: 180px;
             border-radius: 8px;
             object-fit: cover;
             margin-bottom: 12px;
             background: linear-gradient(135deg, #e0e7ff 0%, #ddd6fe 100%);
             display: flex;
             align-items: center;
             justify-content: center;
             overflow: hidden;
             position: relative;
             cursor: default;
         }
         
         .folder-file-thumbnail img {
             width: 100%;
             height: 100%;
             object-fit: cover;
         }
         
         .folder-file-thumbnail,
         .folder-file-thumbnail img {
             aspect-ratio: 16 / 9;
         }
         
         .folder-file-thumbnail .file-thumbnail-upload-btn {
             position: absolute;
             bottom: 8px;
             right: 8px;
             background: var(--mc-gradient-primary);
             color: white;
             border: none;
             padding: 8px 20px;
             border-radius: 20px;
             font-size: 12px;
             font-weight: 500;
             cursor: pointer;
             opacity: 0;
             transition: all 0.3s ease;
             z-index: 10;
             box-shadow: 0 4px 12px rgba(var(--mc-primary-rgb), 0.4);
             white-space: nowrap;
         }
         
         .folder-file-thumbnail .file-thumbnail-upload-btn:hover {
             transform: translateY(-2px);
             box-shadow: 0 6px 16px rgba(var(--mc-primary-rgb), 0.5);
         }
         
         .folder-file-thumbnail:hover .file-thumbnail-upload-btn {
             opacity: 1;
         }

        .folder-info {
            font-size: 12px;
            color: #666;
        }


         .create-folder-btn {
             background: var(--mc-gradient-primary);
             color: white;
             border: none;
             padding: 8px 16px;
             border-radius: 20px;
             cursor: pointer;
             font-size: 13px;
             font-weight: 500;
             margin-bottom: 0;
             width: 100%;
             transition: all 0.3s ease;
             box-shadow: 0 4px 12px rgba(var(--mc-primary-rgb), 0.3);
         }

         .create-folder-btn:hover {
             transform: translateY(-2px);
             box-shadow: 0 6px 16px rgba(var(--mc-primary-rgb), 0.4);
         }

         .move-file-btn {
             background: #ffc107;
             color: #212529;
             border: none;
             padding: 4px 8px;
             border-radius: 4px;
             cursor: pointer;
             font-size: 12px;
             transition: background 0.2s;
         }

         .move-file-btn:hover {
             background: #e0a800;
        }

        .viewer-container {
            flex: 1;
            background: #fff;
            display: flex;
            flex-direction: column;
            align-items: flex-start;
            justify-content: flex-start;
            position: relative;
            padding: 0;
        }

        /* iPhone风格顶部导航栏 */
        .viewer-topbar {
            position: absolute;
            top: 0;
            left: 0;
            right: 0;
            height: 70px;
            background: linear-gradient(180deg, rgba(0,0,0,0.65) 10%, rgba(0,0,0,0.35) 60%, rgba(0,0,0,0) 100%);
            display: flex;
            align-items: center;
            justify-content: space-between;
            padding: 12px 20px;
            z-index: 100;
            transition: opacity 0.3s ease, transform 0.3s ease;
            pointer-events: auto;
        }
        
        /* 工具栏隐藏状态 */
        body.viewer-controls-hidden .viewer-topbar {
            opacity: 0;
            pointer-events: none;
            transform: translateY(-100%);
        }
        
        /* 鼠标悬停时保持显示 */
        .viewer-topbar:hover {
            opacity: 1 !important;
            pointer-events: auto !important;
            transform: translateY(0) !important;
        }

        .viewer-back-btn,
        .viewer-more-btn {
            width: 44px;
            height: 44px;
            border: none;
            background: none;
            color: rgba(255,255,255,0.92);
            cursor: pointer;
            display: flex;
            align-items: center;
            justify-content: center;
            border-radius: 50%;
            transition: background 0.2s;
            box-shadow: 0 4px 12px rgba(0,0,0,0.35);
        }

        .viewer-back-btn:active,
        .viewer-more-btn:active {
            background: rgba(255,255,255,0.15);
        }

        .viewer-title {
            flex: 1;
            text-align: center;
            color: rgba(255,255,255,0.95);
            font-size: 16px;
            font-weight: 600;
            max-width: 60%;
            overflow: hidden;
            text-overflow: ellipsis;
            white-space: nowrap;
            padding: 0 12px;
            text-shadow: 0 2px 6px rgba(0,0,0,0.5);
        }

        /* 更多菜单（下拉菜单） */
        .viewer-menu {
            position: absolute;
            top: 60px;
            right: 16px;
            background: rgba(255, 255, 255, 0.95);
            backdrop-filter: blur(20px);
            -webkit-backdrop-filter: blur(20px);
            border-radius: 14px;
            padding: 8px;
            box-shadow: 0 8px 30px rgba(0, 0, 0, 0.25);
            z-index: 101;
            min-width: 200px;
        }
        .viewer-menu button {
            width: 100%;
            display: flex;
            align-items: center;
            gap: 12px;
            padding: 14px 16px;
            border: none;
            background: none;
            color: #000;
            font-size: 16px;
            text-align: left;
            border-radius: 8px;
            cursor: pointer;
            transition: background 0.2s;
        }

        .viewer-menu button:active {
            background: rgba(0, 0, 0, 0.05);
        }

        .viewer-menu button svg {
            flex-shrink: 0;
        }

        /* iPhone风格底部工具栏：预留底部安全距离，避免笔记本/任务栏遮挡 */
        .viewer-toolbar {
            position: absolute;
            left: 0;
            right: 0;
            bottom: 40px; /* 预留任务栏空间，避免被遮挡 */
            height: 90px;
            background: linear-gradient(0deg, rgba(0,0,0,0.55) 0%, rgba(0,0,0,0.25) 55%, rgba(0,0,0,0) 100%);
            display: flex;
            align-items: center;
            justify-content: space-between;
            padding: 0 12px 24px 12px;
            z-index: 100;
            backdrop-filter: blur(18px);
            -webkit-backdrop-filter: blur(18px);
            transition: opacity 0.3s ease, transform 0.3s ease;
            pointer-events: auto;
        }
        
        /* 工具栏左侧按钮组 */
        .viewer-toolbar .toolbar-left-group {
            display: flex;
            align-items: center;
            gap: 8px;
            flex: 1;
            justify-content: flex-start;
        }
        
        /* 工具栏中间按钮（打印成手办） */
        .viewer-toolbar .toolbar-center-btn {
            display: flex;
            flex-direction: column;
            align-items: center;
            gap: 4px;
            background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
            border: 2px solid rgba(255,255,255,0.3);
            border-radius: 16px;
            color: white;
            cursor: pointer;
            padding: 10px 16px;
            position: relative;
            flex: 0 0 auto;
            box-shadow: 0 4px 20px rgba(245, 87, 108, 0.4), 0 0 0 2px rgba(255,255,255,0.1);
            transition: all 0.3s ease;
            z-index: 10;
            min-width: 100px;
        }
        
        .viewer-toolbar .toolbar-center-btn:hover {
            transform: scale(1.05);
            box-shadow: 0 6px 25px rgba(245, 87, 108, 0.6), 0 0 0 3px rgba(255,255,255,0.2);
        }
        
        .viewer-toolbar .toolbar-center-btn:active {
            transform: scale(0.98);
        }
        
        .viewer-toolbar .toolbar-center-btn svg {
            width: 32px;
            height: 32px;
            stroke: white;
            stroke-width: 2.5;
            filter: drop-shadow(0 2px 4px rgba(0,0,0,0.2));
        }
        
        .viewer-toolbar .toolbar-center-btn span {
            font-size: 12px;
            font-weight: 700;
            text-shadow: 0 1px 2px rgba(0,0,0,0.3);
            letter-spacing: 0.5px;
        }
        
        /* 工具栏右侧按钮组 */
        .viewer-toolbar .toolbar-right-group {
            display: flex;
            align-items: center;
            gap: 8px;
            flex: 1;
            justify-content: flex-end;
        }
        
        /* 工具栏隐藏状态 */
        body.viewer-controls-hidden .viewer-toolbar {
            opacity: 0;
            pointer-events: none;
            transform: translateY(100%);
        }
        
        /* 鼠标悬停时保持显示 */
        .viewer-toolbar:hover {
            opacity: 1 !important;
            pointer-events: auto !important;
            transform: translateY(0) !important;
        }

        .viewer-toolbar .image-only {
            display: none;
        }

        body.viewer-image-mode .viewer-toolbar .image-only {
            display: flex;
        }

        .toolbar-btn {
            display: flex;
            flex-direction: column;
            align-items: center;
            gap: 4px;
            background: none;
            border: none;
            color: rgba(255,255,255,0.92);
            cursor: pointer;
            padding: 8px 8px;
            position: relative;
            flex: 0 0 auto;
            border-radius: 8px;
            transition: all 0.2s;
            min-width: 56px;
            min-height: 44px; /* 触摸目标 ≥44px */
            max-width: 80px;
        }

        .toolbar-btn.image-only {
            flex: 0;
            min-width: 64px;
            max-width: 72px;
        }

        .toolbar-btn:active {
            background: rgba(255, 255, 255, 0.15);
            transform: scale(0.95);
        }

        .toolbar-btn:disabled {
            opacity: 0.35;
            cursor: not-allowed;
        }

        .toolbar-btn span {
            font-size: 11px;
            font-weight: 500;
            color: inherit;
            text-shadow: 0 1px 3px rgba(0,0,0,0.55);
        }

        .toolbar-btn svg {
            flex-shrink: 0;
            filter: drop-shadow(0 2px 4px rgba(0,0,0,0.35));
        }

        .image-viewer-stage {
            position: relative;
            width: 100%;
            height: 100%;
            overflow: hidden;
            cursor: grab;
            touch-action: none;
        }

        .image-viewer-stage.dragging {
            cursor: grabbing;
        }

        .image-viewer-image {
            position: absolute;
            top: 50%;
            left: 50%;
            transform: translate(-50%, -50%) scale(1);
            transform-origin: center center;
            user-select: none;
            pointer-events: none;
            max-width: none;
            max-height: none;
            box-shadow: 0 10px 30px rgba(0,0,0,0.35);
            border-radius: 12px;
        }


        /* 移动端优化 */
        @media (max-width: 768px) {
            .viewer-topbar {
                height: 50px;
            }

            .viewer-toolbar {
                height: 100px;
                padding-bottom: env(safe-area-inset-bottom, 20px);
            }

            .toolbar-btn {
                min-width: 48px;
                padding: 6px 4px;
                max-width: 70px;
            }

            .toolbar-btn svg {
                width: 24px;
                height: 24px;
            }

            .toolbar-btn span {
                font-size: 10px;
            }

            .viewer-title {
                font-size: 14px;
            }
        }

        /* 文件网格视图容器（新增） */
        .file-grid-container {
            flex: 1;
            background: #fff;
            display: none; /* 默认隐藏，点击切换时显示 */
            flex-direction: column;
            overflow: hidden;
        }

        .file-grid-container.active {
            display: flex;
        }

        /* 文件网格工具栏 */
        .file-grid-toolbar {
            display: flex;
            align-items: center;
            padding: 12px 20px;
            border-bottom: 1px solid #e0e0e0;
            background: #fafafa;
            gap: 12px;
            flex-wrap: wrap;
        }
        
        .file-search-filter {
            min-width: 0;
        }
        
        @media (max-width: 768px) {
            .file-grid-toolbar {
                flex-direction: column;
                align-items: stretch;
                padding: 12px;
            }
            
            .file-search-filter {
                width: 100%;
                margin: 0 !important;
            }
            
            /* 移动端：操作按钮组移到工具栏下方，每个按钮单独一行 */
            .toolbar-action-buttons {
                display: flex !important;
                flex-direction: column !important;
                width: 100%;
                margin: 12px 0 0 0 !important;
                gap: 8px !important;
                order: 999; /* 放到最后 */
            }
            
            .toolbar-action-buttons button {
                width: 100% !important;
                padding: 12px 16px !important;
                font-size: 14px !important;
                margin: 0 !important;
                white-space: nowrap !important;
            }
        }

        /* 面包屑导航 */
        .file-breadcrumb {
            flex: 1;
            display: flex;
            align-items: center;
            gap: 6px;
            font-size: 14px;
            min-width: 0;
        }

        .breadcrumb-btn {
            padding: 4px 12px;
            border: none;
            background: transparent;
            cursor: pointer;
            border-radius: 4px;
            font-size: 14px;
            color: #333;
            transition: background 0.2s;
            display: flex;
            align-items: center;
            gap: 4px;
        }

        .breadcrumb-btn:hover {
            background: #e8e8e8;
        }

        /* 视图大小切换 */
        .view-size-btns {
            display: flex;
            gap: 4px;
            background: white;
            border: 1px solid #ddd;
            border-radius: 4px;
            padding: 2px;
        }

        .view-size-btn {
            padding: 6px 12px;
            border: none;
            background: transparent;
            cursor: pointer;
            border-radius: 3px;
            font-size: 13px;
            transition: all 0.2s;
            color: #666;
        }

        .view-size-btn:hover {
            background: #f0f0f0;
        }

        .view-size-btn.active {
            background: #e3f2fd;
            color: #1976d2;
            font-weight: 500;
        }

        /* 文件网格内容区 */
        .file-grid-content {
            flex: 1;
            overflow-y: auto;
            padding: 20px;
        }

        /* 文件网格 - 大图标 */
        .file-grid {
            display: grid;
            grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
            gap: 16px;
            list-style: none;
            padding: 0;
            margin: 0;
        }

        .file-grid.size-large {
            grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
            gap: 20px;
        }

        .file-grid.size-medium {
            grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
            gap: 16px;
        }

        .file-grid.size-small {
            grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
            gap: 12px;
        }

        /* 文件卡片 */
        .file-card {
            display: flex;
            flex-direction: column;
            cursor: pointer;
            border-radius: 8px;
            overflow: visible; /* 改为 visible，让菜单可以超出卡片边界 */
            transition: all 0.2s;
            background: white;
            border: 2px solid transparent;
            position: relative;
            z-index: 1; /* 默认层级 */
            margin-bottom: 20px; /* 增加底部间距，为菜单留出空间 */
        }
        
        /* 当菜单打开时，提高卡片的层级 */
        .file-card.menu-open {
            z-index: 100; /* 确保菜单所在的卡片在其他卡片之上，但低于对话框 */
        }

        .file-card:hover {
            border-color: var(--mc-primary);
            box-shadow: 0 4px 12px rgba(var(--mc-primary-rgb), 0.15);
            transform: translateY(-2px);
        }

        .file-card.selected {
            border-color: var(--mc-primary);
            background: #f0f4ff;
        }

        /* 文件夹卡片特殊样式 */
        .file-card.folder-card:hover {
            border-color: #8b5cf6;
            box-shadow: 0 4px 12px rgba(139, 92, 246, 0.2);
        }

        .file-card.folder-card.selected {
            border-color: #8b5cf6;
            background: #f5f3ff;
        }

        /* 好友分享文件夹特殊样式 */
        .file-card.friend-folder-card:hover {
            border-color: #07c160;
            box-shadow: 0 4px 12px rgba(7, 193, 96, 0.2);
        }

        .file-card.friend-folder-card.selected {
            border-color: #07c160;
            background: #e8f8f0;
        }

        /* 文件缩略图 */
        .file-card-thumb {
            width: 100%;
            aspect-ratio: 1;
            background: linear-gradient(135deg, #e0e7ff 0%, #ddd6fe 100%);
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 48px;
            position: relative;
            overflow: hidden;
            border-radius: 8px 8px 0 0;
            z-index: 1; /* 设置较低的 z-index */
        }

        .file-card-thumb img {
            width: 100%;
            height: 100%;
            object-fit: cover;
        }
        /* 文件类型标识（iPhone风格） */
        .file-type-badge {
            position: absolute;
            top: 6px;
            left: 6px;
            background: rgba(0, 0, 0, 0.6);
            color: white;
            padding: 3px 8px;
            border-radius: 4px;
            font-size: 10px;
            font-weight: 600;
            text-transform: uppercase;
            z-index: 3;
            backdrop-filter: blur(10px);
            -webkit-backdrop-filter: blur(10px);
            z-index: 2;
        }

        /* 文件卡片更多按钮 */
        .file-card-more {
            position: absolute;
            top: 6px;
            right: 6px;
            width: 28px;
            height: 28px;
            background: rgba(255, 255, 255, 0.9);
            border: none;
            border-radius: 50%;
            cursor: pointer;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 18px;
            color: #333;
            opacity: 0;
            z-index: 4;
            transition: all 0.2s;
            z-index: 3;
            backdrop-filter: blur(10px);
            -webkit-backdrop-filter: blur(10px);
            box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
        }

        .file-card:hover .file-card-more {
            opacity: 1;
        }

        .file-card-more:hover {
            background: white;
            box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
            transform: scale(1.05);
        }

        /* 文件卡片操作菜单 */
        .file-card-menu {
            position: absolute;
            top: 34px; /* 按钮下方 */
            right: 6px;
            background: white;
            border-radius: 8px;
            box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
            padding: 6px 0;
            min-width: 140px;
            max-width: 200px;
            z-index: 10000; /* 提高层级，确保在所有元素上方 */
            display: none;
            pointer-events: auto; /* 确保可以点击 */
        }

        .file-card-menu.active {
            display: block;
        }

        .file-card-menu-item {
            padding: 10px 16px;
            cursor: pointer;
            transition: background 0.2s;
            font-size: 14px;
            display: flex;
            align-items: center;
            gap: 8px;
            color: #333;
        }

        .file-card-menu-item:hover {
            background: #f5f5f5;
        }

        .file-card-menu-item.danger {
            color: #dc3545;
        }

        .file-card-menu-item.danger:hover {
            background: #fff5f5;
        }

        /* 视频时长标识 */
        .video-duration {
            position: absolute;
            bottom: 6px;
            right: 6px;
            background: rgba(0, 0, 0, 0.75);
            color: white;
            padding: 2px 6px;
            border-radius: 3px;
            font-size: 11px;
            font-weight: 500;
            backdrop-filter: blur(10px);
            -webkit-backdrop-filter: blur(10px);
            z-index: 2;
        }

        /* 播放图标覆盖层 */
        .play-icon-overlay {
            position: absolute;
            top: 50%;
            left: 50%;
            transform: translate(-50%, -50%);
            width: 48px;
            height: 48px;
            background: rgba(255, 255, 255, 0.9);
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
            z-index: 2;
            box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
        }

        .play-icon-overlay svg {
            width: 20px;
            height: 20px;
            fill: #333;
            margin-left: 2px;
        }

        /* 音频波形图标 */
        .audio-icon-overlay {
            position: absolute;
            top: 50%;
            left: 50%;
            transform: translate(-50%, -50%);
            font-size: 64px;
            opacity: 0.3;
            z-index: 1;
        }

        /* 3D模型标识 */
        .model-badge {
            background: var(--mc-gradient-primary);
        }

        /* 视频标识 */
        .video-badge {
            background: rgba(0, 122, 255, 0.85);
        }

        /* 音频标识 */
        .audio-badge {
            background: rgba(255, 45, 85, 0.85);
        }

        /* 图片标识 */
        .image-badge {
            background: rgba(52, 199, 89, 0.85);
        }

        .file-grid.size-small .file-card-thumb {
            font-size: 36px;
        }

        .file-grid.size-large .file-card-thumb {
            font-size: 60px;
        }

        /* 文件名 */
        .file-card-name {
            padding: 8px;
            font-size: 13px;
            color: #333;
            text-align: center;
            overflow: hidden;
            text-overflow: ellipsis;
            white-space: nowrap;
            background: white;
            position: relative;
            z-index: 1; /* 文件名 z-index 为 1 */
        }

        .file-grid.size-large .file-card-name {
            font-size: 14px;
            padding: 10px;
        }

        .file-grid.size-small .file-card-name {
            font-size: 12px;
            padding: 6px;
        }

        #viewer {
            display: flex;
            align-items: flex-start;
            justify-content: flex-start;
            width: 100%;
            height: 100%;
            min-height: 600px;
        }

        #viewer canvas,
        #viewer iframe,
        #viewer > div {
            max-width: 100%;
            max-height: 100%;
            border-radius: 8px;
            box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
        }

        /* 退出按钮样式已移到内联样式 */

        .viewer-placeholder {
            text-align: center;
            color: #666;
        }

        .viewer-controls-hint {
            position: absolute;
            top: 20px;
            left: 20px;
            background: rgba(0, 0, 0, 0.8);
            color: white;
            padding: 10px 15px;
            border-radius: 8px;
            font-size: 12px;
            z-index: 1000;
            max-width: 200px;
            line-height: 1.4;
        }

        .viewer-controls-hint.hidden {
            display: none;
        }

        /* 4:3比例自适应样式 */
        .viewer-adaptive {
            position: relative;
            width: 100%;
            height: 100%;
            display: flex;
            align-items: center;
            justify-content: center;
            overflow: hidden;
        }

        .viewer-adaptive > div {
            position: relative;
            max-width: 100%;
            max-height: 100%;
        }

        .viewer-adaptive canvas {
            max-width: 100% !important;
            max-height: 100% !important;
            object-fit: contain;
        }

        .viewer-placeholder h3 {
            font-size: 24px;
            margin-bottom: 12px;
            color: #333;
        }

        .viewer-placeholder p {
            font-size: 16px;
            line-height: 1.5;
        }

        .loading {
            display: none;
            position: absolute;
            top: 50%;
            left: 50%;
            transform: translate(-50%, -50%);
            text-align: center;
            color: #666;
        }

        .loading.show {
            display: block;
        }

        .spinner {
            width: 40px;
            height: 40px;
            border: 4px solid #f3f3f3;
            border-top: 4px solid #007bff;
            border-radius: 50%;
            animation: spin 1s linear infinite;
            margin: 0 auto 16px;
        }

        @keyframes spin {
            0% { transform: rotate(0deg); }
            100% { transform: rotate(360deg); }
        }

        .empty-state {
            text-align: center;
            color: #666;
            padding: 40px;
        }

        .empty-state h3 {
            font-size: 20px;
            margin-bottom: 12px;
            color: #333;
        }

        .empty-state p {
            font-size: 14px;
            line-height: 1.5;
            margin-bottom: 20px;
        }

        .upload-hint {
            background: #f8f9fa;
            border: 2px dashed #dee2e6;
            border-radius: 8px;
            padding: 20px;
            text-align: center;
            color: #6c757d;
            cursor: pointer;
            transition: all 0.2s;
        }

        .upload-hint:hover {
            border-color: #007bff;
            background: #f0f8ff;
        }

        .upload-area {
            margin-bottom: 0;
            padding: 0;
            background: transparent;
            border-radius: 0;
            border: none;
            display: block;
        }
        
        .upload-area-right {
            display: flex;
            flex-direction: column;
            gap: 8px;
            width: 100%;
        }
        .upload-btn {
            background: linear-gradient(135deg, #56ab2f 0%, #a8e063 100%);
            color: white;
            border: none;
            padding: 8px 12px;
            border-radius: 25px;
            cursor: pointer;
            font-size: 13px;
            font-weight: 500;
            transition: all 0.3s ease;
            box-shadow: 0 4px 12px rgba(86, 171, 47, 0.3);
        }

        .upload-btn:hover {
            transform: translateY(-2px);
            box-shadow: 0 6px 16px rgba(86, 171, 47, 0.4);
        }

        .delete-btn {
            background: #dc3545;
            color: white;
            border: none;
            padding: 4px 8px;
            border-radius: 4px;
            cursor: pointer;
            font-size: 12px;
            margin-left: 8px;
            transition: background 0.2s;
        }

        .delete-btn:hover {
            background: #c82333;
        }

        .error-message {
            background: #f8d7da;
            color: #721c24;
            padding: 12px;
            border-radius: 6px;
            margin: 16px 0;
            border: 1px solid #f5c6cb;
        }

        /* 骨架屏样式 */
        .skeleton {
            background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
            background-size: 200% 100%;
            animation: loading 1.5s ease-in-out infinite;
            border-radius: 8px;
        }

        @keyframes loading {
            0% { background-position: 200% 0; }
            100% { background-position: -200% 0; }
        }

        .skeleton-item {
            height: 100px;
            margin-bottom: 12px;
            border-radius: 8px;
        }

        /* 上传进度条 */
        .upload-progress {
            width: 100%;
            height: 3px;
            background: #e0e0e0;
            border-radius: 2px;
            margin-top: 6px;
            overflow: hidden;
            display: none;
        }

        .upload-progress-bar {
            height: 100%;
            background: linear-gradient(90deg, #56ab2f 0%, #a8e063 100%);
            width: 0%;
            transition: width 0.3s ease;
        }

        /* 健康状态指示器 */
        .health-indicator {
            display: inline-flex;
            align-items: center;
            gap: 6px;
            font-size: 12px;
            padding: 4px 8px;
            border-radius: 12px;
            background: rgba(255,255,255,0.8);
        }

        .health-indicator.ok {
            color: #28a745;
        }

        .health-indicator.degraded {
            color: #ffc107;
        }

        .health-indicator.error {
            color: #dc3545;
        }

        .health-dot {
            width: 6px;
            height: 6px;
            border-radius: 50%;
            display: inline-block;
        }

        .health-indicator.ok .health-dot {
            background: #28a745;
        }

        .health-indicator.degraded .health-dot {
            background: #ffc107;
        }

        .health-indicator.error .health-dot {
            background: #dc3545;
        }

        /* 回收站模态框样式 */
        .recycle-bin-modal {
            display: none;
            position: fixed;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
            background: rgba(0, 0, 0, 0.5);
            z-index: 10000;
            justify-content: center;
            align-items: center;
        }

        .recycle-bin-modal.show {
            display: flex;
        }

        .recycle-bin-content {
            background: white;
            border-radius: 12px;
            width: 90%;
            max-width: 800px;
            max-height: 80vh;
            display: flex;
            flex-direction: column;
            box-shadow: 0 10px 40px rgba(0,0,0,0.2);
            position: relative;
        }

        .recycle-bin-header {
            padding: 20px 24px;
            border-bottom: 2px solid #e8eaf6;
            display: flex;
            justify-content: space-between;
            align-items: center;
            background: linear-gradient(135deg, #f8f9ff 0%, #ffffff 100%);
            border-radius: 12px 12px 0 0;
        }

        .recycle-bin-header h3 {
            margin: 0;
            font-size: 20px;
            color: var(--mc-primary);
            font-weight: 700;
        }

        .recycle-bin-close {
            background: rgba(255, 255, 255, 0.95);
            border: none;
            font-size: 24px;
            cursor: pointer;
            color: #999;
            padding: 0;
            width: 32px;
            height: 32px;
            display: flex;
            align-items: center;
            justify-content: center;
            border-radius: 50%;
            transition: all 0.3s;
            box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
        }

        .recycle-bin-close:hover {
            background: rgba(255, 255, 255, 1);
            color: #333;
            box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
        }

        .recycle-bin-body {
            padding: 24px;
            overflow-y: auto;
            flex: 1;
        }

        .recycle-bin-empty {
            text-align: center;
            padding: 60px 20px;
            color: #999;
        }

        .recycle-bin-empty-icon {
            font-size: 64px;
            margin-bottom: 16px;
            opacity: 0.3;
        }

        .recycle-bin-list {
            display: grid;
            grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
            gap: 16px;
        }

        .recycle-bin-item {
            background: #f8f9fa;
            border: 2px solid #e8eaf6;
            border-radius: 8px;
            padding: 16px;
            transition: all 0.2s;
        }

        .recycle-bin-item:hover {
            border-color: var(--mc-primary);
            box-shadow: 0 4px 12px rgba(var(--mc-primary-rgb), 0.15);
        }

        .recycle-bin-item-name {
            font-weight: 600;
            color: #333;
            margin-bottom: 8px;
            word-break: break-all;
            font-size: 14px;
        }

        .recycle-bin-item-info {
            font-size: 12px;
            color: #666;
            margin-bottom: 12px;
        }

        .recycle-bin-item-actions {
            display: flex;
            gap: 8px;
        }

        .recycle-bin-btn {
            flex: 1;
            padding: 8px 12px;
            border: none;
            border-radius: 6px;
            cursor: pointer;
            font-size: 12px;
            font-weight: 500;
            transition: all 0.2s;
        }

        .recycle-bin-btn-restore {
            background: linear-gradient(135deg, #56ab2f 0%, #a8e063 100%);
            color: white;
        }

        .recycle-bin-btn-restore:hover {
            transform: translateY(-2px);
            box-shadow: 0 4px 12px rgba(86, 171, 47, 0.4);
        }

        .recycle-bin-btn-delete {
            background: linear-gradient(135deg, #dc3545 0%, #c82333 100%);
            color: white;
        }

        .recycle-bin-btn-delete:hover {
            transform: translateY(-2px);
            box-shadow: 0 4px 12px rgba(220, 53, 69, 0.4);
        }

        .recycle-bin-footer {
            padding: 16px 24px;
            border-top: 2px solid #e8eaf6;
            display: flex;
            justify-content: space-between;
            align-items: center;
            background: #f8f9fa;
            border-radius: 0 0 12px 12px;
        }

        .recycle-bin-footer-actions {
            display: flex;
            gap: 12px;
        }

        .recycle-bin-btn-batch {
            padding: 10px 20px;
            border: none;
            border-radius: 8px;
            cursor: pointer;
            font-size: 14px;
            font-weight: 600;
            transition: all 0.2s;
        }

        .recycle-bin-btn-batch-restore {
            background: linear-gradient(135deg, #56ab2f 0%, #a8e063 100%);
            color: white;
        }

        .recycle-bin-btn-batch-delete {
            background: linear-gradient(135deg, #dc3545 0%, #c82333 100%);
            color: white;
        }

        /* 聊天界面优化动画 */
        @keyframes fadeIn {
            from {
                opacity: 0;
                transform: translateY(4px);
            }
            to {
                opacity: 1;
                transform: translateY(0);
            }
        }

        /* 聊天消息容器滚动条优化 */
        #chat-messages-container::-webkit-scrollbar {
            width: 6px;
        }

        #chat-messages-container::-webkit-scrollbar-track {
            background: transparent;
        }

        #chat-messages-container::-webkit-scrollbar-thumb {
            background: rgba(0, 0, 0, 0.2);
            border-radius: 3px;
        }

        #chat-messages-container::-webkit-scrollbar-thumb:hover {
            background: rgba(0, 0, 0, 0.3);
        }