/* ========================================
   R2 存储浏览器 - 青色主题样式
   ======================================== */

:root {
    /* 青色主题色 */
    --primary-50: #e0f7fa;
    --primary-100: #b2ebf2;
    --primary-200: #80deea;
    --primary-300: #4dd0e1;
    --primary-400: #26c6da;
    --primary-500: #00bcd4;
    --primary-600: #00acc1;
    --primary-700: #0097a7;
    --primary-800: #00838f;
    --primary-900: #006064;

    /* 中性色 */
    --gray-50: #f8fafc;
    --gray-100: #f1f5f9;
    --gray-200: #e2e8f0;
    --gray-300: #cbd5e1;
    --gray-400: #94a3b8;
    --gray-500: #64748b;
    --gray-600: #475569;
    --gray-700: #334155;
    --gray-800: #1e293b;
    --gray-900: #0f172a;

    /* 功能色 */
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --info: #3b82f6;

    /* 亮色模式变量 */
    --bg-primary: linear-gradient(135deg, #e0f7fa 0%, #b2ebf2 50%, #e0f2f1 100%);
    --bg-secondary: rgba(255, 255, 255, 0.8);
    --bg-glass: rgba(255, 255, 255, 0.7);
    --text-primary: var(--gray-900);
    --text-secondary: var(--gray-600);
    --text-muted: var(--gray-400);
    --border-color: rgba(0, 188, 212, 0.2);
    --shadow-color: rgba(0, 188, 212, 0.15);
    --hover-bg: rgba(0, 188, 212, 0.1);

    /* 尺寸 */
    --header-height: 64px;
    --border-radius: 16px;
    --border-radius-sm: 8px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* 深色模式 */
[data-theme="dark"] {
    --bg-primary: linear-gradient(135deg, #0f172a 0%, #1e293b 50%, #0f172a 100%);
    --bg-secondary: rgba(30, 41, 59, 0.9);
    --bg-glass: rgba(30, 41, 59, 0.8);
    --text-primary: var(--gray-50);
    --text-secondary: var(--gray-300);
    --text-muted: var(--gray-500);
    --border-color: rgba(0, 188, 212, 0.3);
    --shadow-color: rgba(0, 188, 212, 0.2);
    --hover-bg: rgba(0, 188, 212, 0.15);
}

/* ========================================
   基础样式
   ======================================== */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    line-height: 1.6;
    overflow-x: hidden;
}

/* 玻璃态效果 */
.glass {
    background: var(--bg-glass);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--border-color);
    box-shadow: 0 8px 32px var(--shadow-color);
}

/* ========================================
   屏幕切换
   ======================================== */

.screen {
    display: none !important;
    visibility: hidden;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    min-height: 100vh;
    opacity: 0;
    overflow-y: auto;
    z-index: 1;
}

.screen.active {
    display: flex !important;
    visibility: visible;
    position: fixed;
    opacity: 1;
    z-index: 10;
    animation: fadeIn 0.5s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ========================================
   登录界面
   ======================================== */

#login-screen.active {
    display: flex !important;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    width: 100%;
    padding: 20px;
    background: var(--bg-primary);
    position: fixed;
    overflow: hidden;
    z-index: 100;
}

#login-screen::before {
    content: '';
    position: absolute;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, var(--primary-400) 0%, transparent 70%);
    opacity: 0.3;
    top: -200px;
    right: -200px;
    animation: float 8s ease-in-out infinite;
}

#login-screen::after {
    content: '';
    position: absolute;
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, var(--primary-600) 0%, transparent 70%);
    opacity: 0.2;
    bottom: -100px;
    left: -100px;
    animation: float 10s ease-in-out infinite reverse;
}

@keyframes float {

    0%,
    100% {
        transform: translate(0, 0);
    }

    50% {
        transform: translate(30px, 30px);
    }
}

.login-container {
    width: 100%;
    max-width: 420px;
    padding: 48px 40px;
    border-radius: var(--border-radius);
    position: relative;
    z-index: 1;
    margin: auto;
}

.login-header {
    text-align: center;
    margin-bottom: 36px;
}

.logo-icon {
    font-size: 64px;
    color: var(--primary-500);
    margin-bottom: 16px;
    display: block;
    filter: drop-shadow(0 4px 8px var(--shadow-color));
}

.login-header h1 {
    font-size: 28px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.subtitle {
    color: var(--text-secondary);
    font-size: 14px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.form-group label .material-symbols-rounded {
    font-size: 18px;
    color: var(--primary-500);
}

.form-group input {
    width: 100%;
    padding: 14px 16px;
    font-size: 15px;
    font-family: inherit;
    border: 2px solid var(--border-color);
    border-radius: var(--border-radius-sm);
    background: var(--bg-secondary);
    color: var(--text-primary);
    transition: var(--transition);
}

.form-group input:focus {
    outline: none;
    border-color: var(--primary-500);
    box-shadow: 0 0 0 4px rgba(0, 188, 212, 0.15);
}

.form-group input::placeholder {
    color: var(--text-muted);
}

.login-footer {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 24px;
    padding-top: 24px;
    border-top: 1px solid var(--border-color);
    font-size: 12px;
    color: var(--text-muted);
}

.login-footer .material-symbols-rounded {
    font-size: 16px;
}

/* ========================================
   按钮样式
   ======================================== */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    font-size: 14px;
    font-weight: 600;
    font-family: inherit;
    border: none;
    border-radius: var(--border-radius-sm);
    cursor: pointer;
    transition: var(--transition);
    white-space: nowrap;
}

.btn .material-symbols-rounded {
    font-size: 20px;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-500) 0%, var(--primary-600) 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(0, 188, 212, 0.4);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 188, 212, 0.5);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-secondary {
    background: var(--bg-secondary);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    background: var(--hover-bg);
    border-color: var(--primary-400);
}

.btn-ghost {
    background: transparent;
    color: var(--text-secondary);
    padding: 10px;
}

.btn-ghost:hover {
    background: var(--hover-bg);
    color: var(--primary-500);
}

.btn-danger {
    background: linear-gradient(135deg, var(--danger) 0%, #dc2626 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(239, 68, 68, 0.4);
}

.btn-danger:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(239, 68, 68, 0.5);
}

.btn-icon {
    padding: 8px;
    border-radius: var(--border-radius-sm);
}

/* ========================================
   主界面
   ======================================== */

#main-screen.active {
    display: flex !important;
    flex-direction: column;
    min-height: 100vh;
    background: var(--bg-primary);
}

.header {
    position: sticky;
    top: 0;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: var(--header-height);
    padding: 0 24px;
    border-radius: 0;
    border-bottom: 1px solid var(--border-color);
}

.header-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.header-left .logo-icon {
    font-size: 36px;
    margin-bottom: 0;
}

.header-left h1 {
    font-size: 20px;
    font-weight: 600;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* 存储源切换器 */
.storage-switcher {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-left: 16px;
    padding: 4px;
    background: var(--bg-glass);
    border-radius: var(--border-radius-sm);
    border: 1px solid var(--border-color);
}

.storage-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 13px;
    font-weight: 500;
}

.storage-btn:hover {
    background: var(--hover-bg);
    color: var(--text-primary);
}

.storage-btn.active {
    background: var(--primary-500);
    color: white;
    box-shadow: 0 2px 8px rgba(0, 200, 200, 0.3);
}

.storage-btn .material-symbols-rounded {
    font-size: 18px;
}

.storage-name {
    display: inline;
}

/* Google 用户信息 */
.google-user-info {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px 12px;
    background: var(--bg-glass);
    border-radius: 20px;
    border: 1px solid var(--border-color);
}

.user-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    object-fit: cover;
}

.user-name {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-primary);
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.btn-sm {
    padding: 4px;
}

.btn-sm .material-symbols-rounded {
    font-size: 18px;
}

.main-content {
    flex: 1;
    padding: 24px;
    max-width: 1400px;
    margin: 0 auto;
    width: 100%;
}

/* ========================================
   工具栏
   ======================================== */

.toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 20px;
    margin-bottom: 20px;
    border-radius: var(--border-radius);
    gap: 16px;
    flex-wrap: wrap;
}

.breadcrumb {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-wrap: wrap;
}

.breadcrumb-item {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 8px 12px;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
    background: transparent;
    border: none;
    border-radius: var(--border-radius-sm);
    cursor: pointer;
    transition: var(--transition);
    font-family: inherit;
}

.breadcrumb-item:hover {
    background: var(--hover-bg);
    color: var(--primary-500);
}

.breadcrumb-item.active {
    color: var(--primary-600);
    font-weight: 600;
}

.breadcrumb-separator {
    color: var(--text-muted);
    font-size: 18px;
}

.toolbar-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

/* ========================================
   文件浏览器
   ======================================== */

.file-browser {
    border-radius: var(--border-radius);
    overflow: hidden;
    position: relative;
    min-height: 400px;
}

.file-list-header {
    display: grid;
    grid-template-columns: 1fr 120px 180px 100px;
    gap: 16px;
    padding: 16px 20px;
    background: var(--hover-bg);
    border-bottom: 1px solid var(--border-color);
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.file-list {
    max-height: calc(100vh - 300px);
    overflow-y: auto;
}

.file-item {
    display: grid;
    grid-template-columns: 1fr 120px 180px 100px;
    gap: 16px;
    padding: 14px 20px;
    align-items: center;
    border-bottom: 1px solid var(--border-color);
    transition: var(--transition);
    cursor: pointer;
}

.file-item:hover {
    background: var(--hover-bg);
}

.file-item:last-child {
    border-bottom: none;
}

.file-name {
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: 500;
    color: var(--text-primary);
    overflow: hidden;
}

.file-name .material-symbols-rounded {
    font-size: 24px;
    flex-shrink: 0;
}

.file-name.folder .material-symbols-rounded {
    color: var(--primary-500);
}

.file-name.file .material-symbols-rounded {
    color: var(--text-muted);
}

.file-name span:last-child {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.file-size,
.file-date {
    font-size: 13px;
    color: var(--text-secondary);
}

.file-actions {
    display: flex;
    gap: 4px;
    opacity: 0;
    transition: var(--transition);
}

.file-item:hover .file-actions {
    opacity: 1;
}

.file-actions .btn-icon {
    color: var(--text-secondary);
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 6px;
    border-radius: 6px;
    transition: var(--transition);
}

.file-actions .btn-icon:hover {
    background: var(--hover-bg);
    color: var(--primary-500);
}

.file-actions .btn-icon.delete:hover {
    color: var(--danger);
}

/* 拖拽上传区域 */
.drop-zone {
    display: none;
    position: absolute;
    inset: 0;
    background: rgba(0, 188, 212, 0.1);
    border: 3px dashed var(--primary-500);
    border-radius: var(--border-radius);
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    z-index: 10;
}

.drop-zone.active {
    display: flex;
}

.drop-zone .material-symbols-rounded {
    font-size: 64px;
    color: var(--primary-500);
}

.drop-zone p {
    font-size: 18px;
    font-weight: 500;
    color: var(--primary-600);
}

/* 空状态 */
.empty-state {
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    text-align: center;
}

.empty-state.active {
    display: flex;
}

.empty-state .material-symbols-rounded {
    font-size: 80px;
    color: var(--text-muted);
    margin-bottom: 16px;
}

.empty-state p {
    color: var(--text-secondary);
    margin-bottom: 20px;
}

/* 加载状态 */
.loading-state {
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
}

.loading-state.active {
    display: flex;
}

.spinner {
    width: 48px;
    height: 48px;
    border: 4px solid var(--border-color);
    border-top-color: var(--primary-500);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 16px;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.loading-state p {
    color: var(--text-secondary);
}

/* ========================================
   弹窗
   ======================================== */

.modal {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal.active {
    display: flex;
    animation: fadeIn 0.3s ease;
}

.modal-content {
    width: 100%;
    max-width: 480px;
    border-radius: var(--border-radius);
    overflow: hidden;
}

.modal-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-color);
}

.modal-header h3 {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 18px;
    font-weight: 600;
}

.modal-header .material-symbols-rounded {
    color: var(--primary-500);
}

.modal-header .warning-icon {
    color: var(--warning);
}

.modal-body {
    padding: 24px;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    padding: 16px 24px;
    border-top: 1px solid var(--border-color);
}

/* 上传列表 */
.upload-list {
    max-height: 300px;
    overflow-y: auto;
}

.upload-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: var(--bg-secondary);
    border-radius: var(--border-radius-sm);
    margin-bottom: 8px;
}

.upload-item:last-child {
    margin-bottom: 0;
}

.upload-item .material-symbols-rounded {
    font-size: 24px;
    color: var(--text-muted);
}

.upload-info {
    flex: 1;
    min-width: 0;
}

.upload-name {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.upload-progress {
    height: 4px;
    background: var(--border-color);
    border-radius: 2px;
    margin-top: 8px;
    overflow: hidden;
}

.upload-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-500) 0%, var(--primary-400) 100%);
    border-radius: 2px;
    transition: width 0.3s ease;
}

.upload-status {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 4px;
}

.upload-status.success {
    color: var(--success);
}

.upload-status.error {
    color: var(--danger);
}

/* ========================================
   Toast 通知
   ======================================== */

.toast-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    z-index: 2000;
}

.toast {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 20px;
    background: var(--bg-glass);
    backdrop-filter: blur(20px);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-sm);
    box-shadow: 0 8px 32px var(--shadow-color);
    animation: slideIn 0.3s ease;
    min-width: 280px;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(100%);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.toast .material-symbols-rounded {
    font-size: 24px;
}

.toast.success .material-symbols-rounded {
    color: var(--success);
}

.toast.error .material-symbols-rounded {
    color: var(--danger);
}

.toast.info .material-symbols-rounded {
    color: var(--info);
}

.toast-message {
    flex: 1;
    font-size: 14px;
    color: var(--text-primary);
}

/* ========================================
   响应式设计
   ======================================== */

@media (max-width: 768px) {

    .file-list-header,
    .file-item {
        grid-template-columns: 1fr 80px;
    }

    .col-size,
    .col-date,
    .file-size,
    .file-date {
        display: none;
    }

    .toolbar {
        flex-direction: column;
        align-items: stretch;
    }

    .toolbar-actions {
        justify-content: flex-end;
    }

    .header-left h1 {
        font-size: 16px;
    }

    .login-container {
        padding: 32px 24px;
        max-width: 90%;
    }

    .login-header h1 {
        font-size: 24px;
    }

    .logo-icon {
        font-size: 48px;
    }

    .modal-content {
        max-width: 100%;
        margin: 16px;
    }

    .main-content {
        padding: 16px;
    }

    .header {
        padding: 0 16px;
    }

    /* 移动端文件操作按钮始终显示 */
    .file-actions {
        opacity: 1;
    }
}

/* 平板适配 */
@media (min-width: 769px) and (max-width: 1024px) {

    .file-list-header,
    .file-item {
        grid-template-columns: 1fr 100px 140px 80px;
    }

    .main-content {
        padding: 20px;
    }

    .login-container {
        padding: 40px 36px;
    }
}

@media (max-width: 480px) {
    .main-content {
        padding: 12px;
    }

    .btn {
        padding: 10px 16px;
        font-size: 13px;
    }

    .btn span:not(.material-symbols-rounded) {
        display: none;
    }

    .toolbar-actions .btn-primary span:not(.material-symbols-rounded) {
        display: inline;
    }

    .login-container {
        padding: 28px 20px;
        max-width: 95%;
    }

    .login-header h1 {
        font-size: 22px;
    }

    .logo-icon {
        font-size: 40px;
    }

    .form-group input {
        padding: 12px 14px;
        font-size: 14px;
    }

    .toolbar {
        padding: 10px 12px;
        gap: 10px;
    }

    .breadcrumb-item {
        padding: 6px 8px;
        font-size: 13px;
    }

    .file-browser {
        min-height: 300px;
        border-radius: 12px;
    }

    .file-item {
        padding: 12px 14px;
    }

    .file-name .material-symbols-rounded {
        font-size: 20px;
    }

    .toast-container {
        bottom: 16px;
        right: 16px;
        left: 16px;
    }

    .toast {
        min-width: auto;
        width: 100%;
    }
}

/* ========================================
   滚动条样式
   ======================================== */

::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--primary-400);
}

/* ========================================
   文件预览弹窗
   ======================================== */

.preview-modal {
    padding: 0;
}

.preview-container {
    width: 95vw;
    height: 95vh;
    max-width: 1400px;
    border-radius: var(--border-radius);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.preview-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 24px;
    border-bottom: 1px solid var(--border-color);
    flex-shrink: 0;
}

.preview-title {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
    overflow: hidden;
}

.preview-title .material-symbols-rounded {
    font-size: 28px;
    color: var(--primary-500);
    flex-shrink: 0;
}

.preview-title #preview-filename {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.preview-actions {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
}

.preview-body {
    flex: 1;
    overflow: auto;
    position: relative;
    background: var(--bg-secondary);
}

.preview-loading,
.preview-unsupported {
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    gap: 16px;
    color: var(--text-secondary);
}

.preview-loading.active,
.preview-unsupported.active {
    display: flex;
}

.preview-unsupported .material-symbols-rounded {
    font-size: 80px;
    color: var(--text-muted);
}

.preview-content {
    display: none;
    width: 100%;
    height: 100%;
}

.preview-content.active {
    display: block;
}

/* Markdown 预览 */
.preview-content.markdown {
    padding: 32px;
    max-width: 900px;
    margin: 0 auto;
    line-height: 1.8;
}

.preview-content.markdown h1,
.preview-content.markdown h2,
.preview-content.markdown h3,
.preview-content.markdown h4 {
    margin-top: 24px;
    margin-bottom: 16px;
    font-weight: 600;
    color: var(--text-primary);
}

.preview-content.markdown h1 {
    font-size: 2em;
    border-bottom: 2px solid var(--border-color);
    padding-bottom: 12px;
}

.preview-content.markdown h2 {
    font-size: 1.5em;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 8px;
}

.preview-content.markdown p {
    margin-bottom: 16px;
}

.preview-content.markdown code {
    background: var(--hover-bg);
    padding: 2px 6px;
    border-radius: 4px;
    font-family: 'Consolas', 'Monaco', monospace;
    font-size: 0.9em;
}

.preview-content.markdown pre {
    background: var(--bg-glass);
    padding: 16px;
    border-radius: var(--border-radius-sm);
    overflow-x: auto;
    margin-bottom: 16px;
}

.preview-content.markdown pre code {
    background: none;
    padding: 0;
}

.preview-content.markdown blockquote {
    border-left: 4px solid var(--primary-500);
    padding-left: 16px;
    margin: 16px 0;
    color: var(--text-secondary);
}

.preview-content.markdown ul,
.preview-content.markdown ol {
    margin-bottom: 16px;
    padding-left: 24px;
}

.preview-content.markdown li {
    margin-bottom: 8px;
}

.preview-content.markdown a {
    color: var(--primary-500);
    text-decoration: none;
}

.preview-content.markdown a:hover {
    text-decoration: underline;
}

.preview-content.markdown table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 16px;
}

.preview-content.markdown th,
.preview-content.markdown td {
    border: 1px solid var(--border-color);
    padding: 10px 14px;
    text-align: left;
}

.preview-content.markdown th {
    background: var(--hover-bg);
    font-weight: 600;
}

.preview-content.markdown img {
    max-width: 100%;
    border-radius: var(--border-radius-sm);
}

/* 文本预览 */
.preview-content.text {
    padding: 24px;
    font-family: 'Consolas', 'Monaco', monospace;
    font-size: 14px;
    line-height: 1.6;
    white-space: pre-wrap;
    word-break: break-all;
}

/* 图片预览 */
.preview-content.image {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: repeating-conic-gradient(var(--gray-200) 0% 25%, transparent 0% 50%) 50% / 20px 20px;
}

[data-theme="dark"] .preview-content.image {
    background: repeating-conic-gradient(var(--gray-700) 0% 25%, var(--gray-800) 0% 50%) 50% / 20px 20px;
}

.preview-content.image img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    border-radius: var(--border-radius-sm);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

/* 视频预览 */
.preview-content.video {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: #000;
}

.preview-content.video video {
    max-width: 100%;
    max-height: 100%;
    border-radius: var(--border-radius-sm);
}

/* 音频预览 */
.preview-content.audio {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 24px;
    padding: 48px;
}

.preview-content.audio .audio-icon {
    font-size: 120px;
    color: var(--primary-500);
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {

    0%,
    100% {
        transform: scale(1);
        opacity: 1;
    }

    50% {
        transform: scale(1.05);
        opacity: 0.8;
    }
}

.preview-content.audio audio {
    width: 100%;
    max-width: 500px;
}

/* PDF 预览 */
.preview-content.pdf {
    padding: 0;
}

.preview-content.pdf iframe {
    width: 100%;
    height: 100%;
    border: none;
}

/* Office 文档预览 */
.preview-content.office {
    padding: 0;
}

.preview-content.office iframe {
    width: 100%;
    height: 100%;
    border: none;
}

.preview-content.office .office-notice {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    gap: 16px;
    padding: 24px;
    text-align: center;
}

.preview-content.office .office-notice .material-symbols-rounded {
    font-size: 64px;
    color: var(--primary-500);
}

.preview-content.office .office-notice p {
    color: var(--text-secondary);
    margin-bottom: 16px;
}

/* 响应式预览 */
@media (max-width: 768px) {
    .preview-container {
        width: 100vw;
        height: 100vh;
        border-radius: 0;
    }

    .preview-header {
        padding: 12px 16px;
    }

    .preview-title {
        font-size: 16px;
    }

    .preview-content.markdown {
        padding: 20px;
    }

    .preview-content.audio {
        padding: 24px;
    }

    .preview-content.audio .audio-icon {
        font-size: 80px;
    }
}