/* =====================================
   CloudDocs - 在线文档系统样式
   ===================================== */

/* === 重置 & 全局变量 === */
:root {
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --primary-light: #dbeafe;
    --accent: #8b5cf6;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --text: #1e293b;
    --text-secondary: #64748b;
    --text-muted: #94a3b8;
    --bg: #ffffff;
    --bg-secondary: #f8fafc;
    --bg-tertiary: #f1f5f9;
    --border: #e2e8f0;
    --border-light: #f1f5f9;
    --radius: 12px;
    --radius-sm: 8px;
    --radius-xs: 6px;
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
    --shadow: 0 1px 3px rgba(0,0,0,0.1), 0 1px 2px rgba(0,0,0,0.06);
    --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.1), 0 2px 4px -2px rgba(0,0,0,0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.1), 0 4px 6px -4px rgba(0,0,0,0.1);
    --shadow-xl: 0 20px 25px -5px rgba(0,0,0,0.1), 0 8px 10px -6px rgba(0,0,0,0.1);
    --transition: all 0.2s ease;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
    font-family: 'PingFang SC', 'Microsoft YaHei', 'Helvetica Neue', -apple-system, BlinkMacSystemFont, 'Segoe UI', Arial, sans-serif;
    color: var(--text);
    background: var(--bg);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

a { text-decoration: none; color: inherit; }

/* === 按钮 === */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 20px;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    white-space: nowrap;
    font-family: inherit;
}

.btn-primary {
    background: var(--primary);
    color: #fff;
}
.btn-primary:hover { background: var(--primary-dark); transform: translateY(-1px); box-shadow: var(--shadow-md); }

.btn-outline {
    background: transparent;
    color: var(--primary);
    border: 1.5px solid var(--primary);
}
.btn-outline:hover { background: var(--primary-light); }

.btn-sm { padding: 6px 14px; font-size: 13px; }
.btn-lg { padding: 14px 32px; font-size: 16px; border-radius: var(--radius); }
.btn-full { width: 100%; justify-content: center; padding: 12px; font-size: 15px; }
.btn-icon { font-size: 18px; line-height: 1; }

.btn:disabled { opacity: 0.6; cursor: not-allowed; }

/* === 导航栏 === */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: rgba(255,255,255,0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border);
    z-index: 1000;
    padding: 0 24px;
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 64px;
}

.nav-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 20px;
    font-weight: 700;
    color: var(--text);
}
.nav-logo span {
    background: linear-gradient(135deg, #2563eb, #8b5cf6);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 28px;
    font-size: 14px;
    color: var(--text-secondary);
}
.nav-links a:hover { color: var(--primary); }

/* === Hero === */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
    padding-top: 64px;
}

.hero-bg {
    position: absolute;
    inset: 0;
    pointer-events: none;
}

.hero-shape {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.5;
}
.shape-1 {
    width: 500px; height: 500px;
    background: #dbeafe;
    top: -150px; right: -100px;
    animation: float 8s ease-in-out infinite;
}
.shape-2 {
    width: 400px; height: 400px;
    background: #ede9fe;
    bottom: -100px; left: -80px;
    animation: float 10s ease-in-out infinite reverse;
}
.shape-3 {
    width: 300px; height: 300px;
    background: #fef3c7;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    animation: float 12s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translate(0, 0) scale(1); }
    33% { transform: translate(30px, -30px) scale(1.05); }
    66% { transform: translate(-20px, 20px) scale(0.95); }
}

.hero-content {
    position: relative;
    text-align: center;
    max-width: 720px;
    padding: 40px 24px;
}

.hero-badge {
    display: inline-block;
    background: var(--primary-light);
    color: var(--primary);
    padding: 6px 16px;
    border-radius: 50px;
    font-size: 13px;
    font-weight: 500;
    margin-bottom: 24px;
}

.hero-title {
    font-size: 56px;
    font-weight: 800;
    line-height: 1.2;
    color: var(--text);
    margin-bottom: 20px;
    letter-spacing: -0.02em;
}

.text-gradient {
    background: linear-gradient(135deg, #2563eb, #8b5cf6, #ec4899);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-desc {
    font-size: 18px;
    color: var(--text-secondary);
    line-height: 1.8;
    margin-bottom: 36px;
}

.hero-actions {
    display: flex;
    gap: 16px;
    justify-content: center;
    margin-bottom: 48px;
    flex-wrap: wrap;
}

.pulse {
    animation: pulse 2s ease-in-out infinite;
}
@keyframes pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(37,99,235,0.4); }
    50% { box-shadow: 0 0 0 20px rgba(37,99,235,0); }
}

.hero-stats {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 32px;
}

.stat-item {
    text-align: center;
}
.stat-number {
    display: block;
    font-size: 28px;
    font-weight: 700;
    background: linear-gradient(135deg, #2563eb, #8b5cf6);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
.stat-label {
    font-size: 13px;
    color: var(--text-muted);
    margin-top: 4px;
}
.stat-divider {
    width: 1px;
    height: 40px;
    background: var(--border);
}

/* === 通用 Section === */
.section-header {
    text-align: center;
    margin-bottom: 56px;
}
.section-header h2 {
    font-size: 36px;
    font-weight: 700;
    margin-bottom: 12px;
}
.section-header p {
    font-size: 17px;
    color: var(--text-secondary);
}

/* === 功能特性 === */
.features {
    padding: 100px 24px;
    background: var(--bg-secondary);
}

.features-grid {
    max-width: 1100px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
}

.feature-card {
    background: #fff;
    border-radius: var(--radius);
    padding: 32px;
    border: 1px solid var(--border);
    transition: var(--transition);
    cursor: default;
}
.feature-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); border-color: var(--primary-light); }
.feature-icon { font-size: 40px; margin-bottom: 16px; }
.feature-card h3 { font-size: 18px; font-weight: 600; margin-bottom: 8px; }
.feature-card p { font-size: 14px; color: var(--text-secondary); line-height: 1.7; }

/* === 全屏登录弹出层 === */
.login-overlay {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
    animation: overlayFadeIn 0.3s ease;
}
.login-overlay.show {
    display: flex;
}

@keyframes overlayFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.login-overlay-bg {
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, #0f172a 0%, #1e3a5f 30%, #1a365d 50%, #0c1929 100%);
    z-index: -1;
}
.login-overlay-bg::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse at 20% 50%, rgba(37,99,235,0.25) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 20%, rgba(139,92,246,0.2) 0%, transparent 50%),
        radial-gradient(ellipse at 60% 80%, rgba(236,72,153,0.15) 0%, transparent 50%);
}
.login-overlay-bg::after {
    content: '';
    position: absolute;
    inset: 0;
    background-image:
        repeating-linear-gradient(0deg, transparent, transparent 40px, rgba(255,255,255,0.015) 40px, rgba(255,255,255,0.015) 41px),
        repeating-linear-gradient(90deg, transparent, transparent 40px, rgba(255,255,255,0.015) 40px, rgba(255,255,255,0.015) 41px);
    pointer-events: none;
}

.login-close-btn {
    position: absolute;
    top: 24px;
    right: 24px;
    z-index: 10;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 2px solid rgba(255,255,255,0.2);
    background: rgba(255,255,255,0.08);
    color: rgba(255,255,255,0.8);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    backdrop-filter: blur(8px);
}
.login-close-btn:hover {
    background: rgba(255,255,255,0.18);
    border-color: rgba(255,255,255,0.4);
    color: #fff;
    transform: rotate(90deg);
}

.login-overlay-content {
    display: flex;
    width: 100%;
    max-width: 960px;
    min-height: 560px;
    background: rgba(255,255,255,0.04);
    border-radius: 20px;
    border: 1px solid rgba(255,255,255,0.08);
    overflow: hidden;
    box-shadow: 0 40px 80px rgba(0,0,0,0.4);
    backdrop-filter: blur(4px);
    margin: 0 24px;
    animation: contentSlideUp 0.4s ease;
}

@keyframes contentSlideUp {
    from { opacity: 0; transform: translateY(30px); }
    to { opacity: 1; transform: translateY(0); }
}

/* 左侧文字说明 */
.login-overlay-left {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 56px 48px;
    position: relative;
    min-width: 0;
}

.login-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 40px;
}
.login-brand h2 {
    font-size: 24px;
    font-weight: 700;
    color: #fff;
    letter-spacing: -0.5px;
}

.login-slogan {
    font-size: 40px;
    font-weight: 800;
    color: #fff;
    line-height: 1.2;
    margin-bottom: 20px;
    letter-spacing: -0.02em;
}
.login-slogan-highlight {
    background: linear-gradient(135deg, #60a5fa, #a78bfa, #f472b6);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.login-desc {
    font-size: 15px;
    color: rgba(255,255,255,0.6);
    line-height: 1.7;
    margin-bottom: 36px;
    max-width: 380px;
}

.login-features {
    display: flex;
    flex-direction: column;
    gap: 14px;
}
.login-feature-item {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 14px;
    color: rgba(255,255,255,0.7);
}
.login-feature-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: linear-gradient(135deg, #60a5fa, #a78bfa);
    flex-shrink: 0;
    box-shadow: 0 0 8px rgba(96,165,250,0.4);
}

/* 右侧登录表单 */
.login-overlay-right {
    width: 440px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
    background: #fff;
    flex-shrink: 0;
}

.login-card-wrapper {
    width: 100%;
    max-width: 360px;
}

.login-card-header {
    text-align: center;
    margin-bottom: 28px;
}
.login-avatar-icon {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: linear-gradient(135deg, #2563eb, #8b5cf6);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px;
    color: #fff;
    box-shadow: 0 8px 24px rgba(37,99,235,0.3);
}
.login-card-header h3 {
    font-size: 22px;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 6px;
}
.login-card-header p {
    font-size: 14px;
    color: var(--text-muted);
}

.form-group {
    margin-bottom: 16px;
}
.form-group label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    margin-bottom: 6px;
    color: var(--text);
}
.form-group input {
    width: 100%;
    padding: 12px 16px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 15px;
    font-family: inherit;
    transition: var(--transition);
    background: var(--bg-secondary);
    outline: none;
}
.form-group input:focus {
    border-color: var(--primary);
    background: #fff;
    box-shadow: 0 0 0 3px rgba(37,99,235,0.1);
}

.login-error {
    background: #fef2f2;
    color: var(--danger);
    padding: 10px 14px;
    border-radius: var(--radius-xs);
    font-size: 13px;
    margin-bottom: 16px;
    border: 1px solid #fecaca;
}

.login-card-footer {
    text-align: center;
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid var(--border);
}
.login-card-footer p {
    font-size: 13px;
    color: var(--text-muted);
}
.login-card-footer a {
    color: var(--primary);
    font-weight: 500;
    cursor: pointer;
}
.login-card-footer a:hover { text-decoration: underline; }

/* 登录/注册标签切换 */
.auth-tabs {
    display: flex;
    gap: 0;
    border-bottom: 2px solid var(--border);
    margin-bottom: 24px;
}
.auth-tab {
    flex: 1;
    padding: 12px 16px;
    border: none;
    background: none;
    font-size: 15px;
    font-weight: 600;
    color: var(--text-muted);
    cursor: pointer;
    position: relative;
    transition: var(--transition);
    font-family: inherit;
}
.auth-tab:hover { color: var(--text-secondary); }
.auth-tab.active {
    color: var(--primary);
}
.auth-tab.active::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 20%;
    right: 20%;
    height: 2px;
    background: var(--primary);
    border-radius: 2px;
}

/* 表单面板显隐 */
.auth-panel { display: none; }
.auth-panel.active { display: block; animation: panelFadeIn 0.25s ease; }
@keyframes panelFadeIn {
    from { opacity: 0; transform: translateY(6px); }
    to { opacity: 1; transform: translateY(0); }
}

/* 注册图标颜色 */
.register-icon {
    background: linear-gradient(135deg, #059669, #10b981) !important;
    box-shadow: 0 8px 24px rgba(16,185,129,0.3) !important;
}

/* 错误提示统一 */
.auth-error {
    background: #fef2f2;
    color: var(--danger);
    padding: 10px 14px;
    border-radius: var(--radius-xs);
    font-size: 13px;
    margin-bottom: 16px;
    border: 1px solid #fecaca;
}

/* === 页脚 === */
.footer {
    background: var(--text);
    color: #fff;
    padding: 60px 24px 30px;
}
.footer-content {
    max-width: 1100px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    margin-bottom: 40px;
}
.footer-brand h3 { font-size: 22px; margin-bottom: 6px; }
.footer-brand p { font-size: 13px; opacity: 0.6; }
.footer-links { display: flex; gap: 60px; }
.footer-col h4 { font-size: 14px; margin-bottom: 12px; }
.footer-col a { display: block; font-size: 13px; opacity: 0.6; margin-bottom: 8px; transition: var(--transition); }
.footer-col a:hover { opacity: 1; }
.footer-bottom {
    max-width: 1100px;
    margin: 0 auto;
    padding-top: 24px;
    border-top: 1px solid rgba(255,255,255,0.1);
    text-align: center;
    font-size: 13px;
    opacity: 0.4;
}

/* =====================================
   已登录：文档管理界面
   ===================================== */
.app-container {
    display: flex;
    min-height: 100vh;
}

/* 侧边栏 */
.sidebar {
    width: 250px;
    background: #1e293b;
    color: #fff;
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 100;
}

.sidebar-header {
    padding: 20px;
    border-bottom: 1px solid rgba(255,255,255,0.08);
}
.sidebar-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 18px;
    font-weight: 700;
    color: #fff;
}

.sidebar-nav {
    flex: 1;
    padding: 12px;
}
.nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    transition: var(--transition);
    color: #cbd5e1;
}
.nav-item:hover, .nav-item.active {
    background: rgba(255,255,255,0.08);
    color: #fff;
}
.nav-icon { font-size: 18px; }

.sidebar-user {
    padding: 16px 20px;
    border-top: 1px solid rgba(255,255,255,0.08);
    display: flex;
    align-items: center;
    gap: 10px;
}
.user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, #2563eb, #8b5cf6);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 15px;
    font-weight: 600;
    flex-shrink: 0;
}
.user-info { flex: 1; min-width: 0; }
.user-name { display: block; font-size: 13px; font-weight: 500; }
.user-email { display: block; font-size: 12px; color: #94a3b8; }
.logout-btn {
    color: #94a3b8;
    font-size: 18px;
    transition: var(--transition);
    cursor: pointer;
    background: none;
    border: none;
}
.logout-btn:hover { color: #ef4444; }

/* 侧边栏用户中心按钮 */
.sidebar-bottom {
    padding: 0 12px 8px;
}
.sidebar-profile-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    color: #cbd5e1;
    transition: var(--transition);
    text-decoration: none;
}
.sidebar-profile-btn:hover {
    background: rgba(255,255,255,0.08);
    color: #fff;
}
.profile-btn-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(255,255,255,0.1);
    flex-shrink: 0;
}

/* 主内容区 */
.main-content {
    margin-left: 250px;
    flex: 1;
    background: var(--bg-secondary);
    min-height: 100vh;
}

.content-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 28px 36px;
    background: #fff;
    border-bottom: 1px solid var(--border);
}
.header-left { display: flex; align-items: baseline; gap: 14px; }
.header-left h1 { font-size: 24px; font-weight: 700; }
.doc-count { font-size: 14px; color: var(--text-muted); }

/* 创建下拉菜单 */
.create-dropdown { position: relative; }
.dropdown-menu {
    display: none;
    position: absolute;
    right: 0; top: 100%;
    margin-top: 8px;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-xl);
    min-width: 220px;
    z-index: 50;
    overflow: hidden;
}
.dropdown-menu.show { display: block; }
.dropdown-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 18px;
    transition: var(--transition);
    border-bottom: 1px solid var(--border-light);
}
.dropdown-item:last-child { border-bottom: none; }
.dropdown-item:hover { background: var(--primary-light); }
.dropdown-icon { font-size: 24px; flex-shrink: 0; }
.dropdown-item strong { display: block; font-size: 14px; color: var(--text); }
.dropdown-item small { font-size: 12px; color: var(--text-muted); }

/* 文档列表区域 */
.documents-area {
    padding: 28px 36px;
}

.empty-state {
    text-align: center;
    padding: 100px 20px;
    color: var(--text-muted);
}
.empty-icon { font-size: 64px; margin-bottom: 16px; }
.empty-state h3 { font-size: 20px; color: var(--text); margin-bottom: 8px; }
.empty-state p { font-size: 15px; }

/* 文档卡片网格 */
.doc-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}

.doc-card {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    cursor: pointer;
    transition: var(--transition);
    overflow: hidden;
}
.doc-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary-light);
}

.doc-card-preview {
    height: 140px;
    padding: 24px;
    background: var(--bg-secondary);
    position: relative;
    border-bottom: 1px solid var(--border);
}
.doc-type-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 50px;
    font-size: 11px;
    font-weight: 500;
    margin-bottom: 12px;
}
.doc-type-badge.doc, .doc-type-badge.pdf { background: #dbeafe; color: #2563eb; }
.doc-type-badge.sheet { background: #d1fae5; color: #059669; }

.doc-card-content {
    font-size: 13px;
    color: var(--text-muted);
    line-height: 1.6;
    display: -webkit-box;
    -webkit-line-clamp: 4;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.doc-card-info {
    padding: 16px 20px;
}
.doc-card-title {
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 8px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.doc-card-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 12px;
    color: var(--text-muted);
}
.doc-card-actions { display: flex; gap: 2px; }
.action-btn {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 14px;
    padding: 4px 6px;
    border-radius: var(--radius-xs);
    transition: var(--transition);
    opacity: 0.5;
    line-height: 1;
}
.action-btn:hover { opacity: 1; background: var(--bg-tertiary); }
.action-delete:hover { background: #fef2f2; color: var(--danger); }

/* =====================================
   编辑器样式
   ===================================== */
.editor-app {
    display: flex;
    flex-direction: column;
    height: 100vh;
    overflow: hidden;
}

.editor-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 20px;
    background: #fff;
    border-bottom: 1px solid var(--border);
    gap: 16px;
    flex-shrink: 0;
}

.toolbar-left {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
    min-width: 0;
}
.back-btn {
    color: var(--text-muted);
    cursor: pointer;
    padding: 6px;
    border-radius: var(--radius-xs);
    transition: var(--transition);
    display: flex;
    align-items: center;
}
.back-btn:hover { color: var(--primary); background: var(--primary-light); }

.doc-title-area {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
    min-width: 0;
}
.doc-title-input {
    border: 1.5px solid transparent;
    padding: 6px 12px;
    font-size: 16px;
    font-weight: 600;
    font-family: inherit;
    border-radius: var(--radius-xs);
    outline: none;
    transition: var(--transition);
    background: transparent;
    max-width: 400px;
    color: var(--text);
}
.doc-title-input:hover { border-color: var(--border); }
.doc-title-input:focus { border-color: var(--primary); background: #fff; }

.toolbar-center { flex-shrink: 0; }
.save-indicator {
    font-size: 13px;
    padding: 4px 10px;
    border-radius: 50px;
}
.save-indicator.saved { color: var(--success); }
.save-indicator.saving { color: var(--warning); }
.save-indicator.unsaved { color: var(--danger); }

.toolbar-right {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
}

/* 转换格式下拉 */
.convert-dropdown { position: relative; }
.convert-menu {
    right: auto;
    left: 0;
    min-width: 200px;
}

/* Quill 编辑器 */
.editor-body {
    flex: 1;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.rich-editor-wrapper {
    display: flex;
    flex-direction: column;
    height: 100%;
}

#editor-container {
    flex: 1;
    overflow-y: auto;
    padding: 40px 80px;
    background: var(--bg-secondary);
}

#editor-container .ql-editor {
    max-width: 800px;
    margin: 0 auto;
    background: #fff;
    min-height: calc(100vh - 200px);
    padding: 60px 80px;
    box-shadow: var(--shadow);
    border-radius: 4px;
    font-size: 16px;
    line-height: 1.8;
    border: none;
}

#editor-container .ql-editor h1 { font-size: 28px; margin-bottom: 16px; }
#editor-container .ql-editor h2 { font-size: 22px; margin-bottom: 12px; }
#editor-container .ql-editor h3 { font-size: 18px; margin-bottom: 10px; }
#editor-container .ql-editor p { margin-bottom: 12px; }
#editor-container .ql-editor ul, #editor-container .ql-editor ol { margin-bottom: 12px; padding-left: 24px; }
#editor-container .ql-editor blockquote {
    border-left: 4px solid var(--primary);
    padding-left: 16px;
    color: var(--text-secondary);
    margin: 16px 0;
}

.quill-toolbar-sticky {
    background: #fff;
    border-bottom: 1px solid var(--border);
    padding: 10px 16px;
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    flex-shrink: 0;
    justify-content: center;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}

.quill-toolbar-sticky .ql-formats {
    margin-right: 8px;
}

.quill-toolbar-sticky button {
    width: 32px;
    height: 32px;
    border-radius: var(--radius-xs);
}

.quill-toolbar-sticky button:hover,
.quill-toolbar-sticky button.ql-active {
    background: var(--primary-light);
    color: var(--primary);
}

/* 自定义插入网页按钮 */
.ql-insertpage {
    width: auto !important;
    padding: 4px 12px !important;
    font-size: 13px !important;
    font-weight: 500;
    color: #475569 !important;
    border: 1px solid var(--border) !important;
    border-radius: var(--radius-xs) !important;
    background: #fff !important;
    white-space: nowrap !important;
}
.ql-insertpage:hover {
    background: var(--primary-light) !important;
    color: var(--primary) !important;
    border-color: var(--primary) !important;
}

/* 通用弹窗 */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15,23,42,0.6);
    backdrop-filter: blur(4px);
    z-index: 10000;
    display: none;
    align-items: center;
    justify-content: center;
    animation: overlayFadeIn 0.2s ease;
}
.modal-overlay.show {
    display: flex;
}

.modal-dialog {
    background: #fff;
    border-radius: 16px;
    width: 90%;
    max-width: 480px;
    box-shadow: 0 25px 60px rgba(0,0,0,0.3);
    animation: contentSlideUp 0.25s ease;
    overflow: hidden;
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid var(--border);
}
.modal-header h3 { font-size: 17px; font-weight: 600; }

.modal-close {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: none;
    background: var(--bg-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    transition: var(--transition);
}
.modal-close:hover { background: #fee2e2; color: var(--danger); }

.modal-body { padding: 24px; }
.modal-desc { font-size: 14px; color: var(--text-secondary); margin-bottom: 16px; line-height: 1.6; }

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 16px 24px;
    border-top: 1px solid var(--border);
    background: var(--bg-secondary);
}

.form-msg.info { color: var(--primary); }

/* 网页预览面板 */
.page-preview-panel {
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    height: 45%;
    min-height: 240px;
    border-top: 2px solid var(--primary);
    background: #fff;
    animation: panelSlideUp 0.3s ease;
}

@keyframes panelSlideUp {
    from { height: 0; opacity: 0; }
    to { height: 45%; opacity: 1; }
}

.preview-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 20px;
    background: linear-gradient(135deg, #1e3a5f, #2563eb);
    color: #fff;
    flex-shrink: 0;
}
.preview-title {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 14px;
    font-weight: 500;
    min-width: 0;
}
.preview-url {
    font-size: 12px;
    opacity: 0.7;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 300px;
}
.preview-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}
.preview-actions .btn {
    font-size: 12px;
    padding: 5px 12px;
}
.preview-close-btn {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 1px solid rgba(255,255,255,0.3);
    background: rgba(255,255,255,0.1);
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    margin-left: 8px;
}
.preview-close-btn:hover {
    background: rgba(255,255,255,0.2);
    border-color: rgba(255,255,255,0.6);
}

.preview-body {
    flex: 1;
    position: relative;
    background: #f1f5f9;
    overflow: hidden;
}

.preview-loading {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    color: var(--text-muted);
    font-size: 14px;
    z-index: 5;
    background: #f1f5f9;
}

.loading-spinner {
    width: 36px;
    height: 36px;
    border: 3px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}
@keyframes spin {
    to { transform: rotate(360deg); }
}

#page-iframe {
    width: 100%;
    height: 100%;
    border: none;
    display: block;
}

/* 编辑器内链接卡片 */
.ql-editor .linkcard {
    display: flex !important;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    overflow: hidden;
    background: #fff;
    margin: 16px 0;
    transition: all 0.2s ease;
    cursor: pointer;
    max-width: 600px;
    text-decoration: none;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}
.ql-editor .linkcard:hover {
    border-color: #2563eb;
    box-shadow: 0 4px 16px rgba(37,99,235,0.12);
    transform: translateY(-1px);
}
.ql-editor .linkcard-image {
    width: 200px;
    min-height: 130px;
    flex-shrink: 0;
    background: #f1f5f9;
    overflow: hidden;
}
.ql-editor .linkcard-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.ql-editor .linkcard-body {
    flex: 1;
    padding: 16px 20px;
    min-width: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
}
.ql-editor .linkcard-title {
    font-size: 16px;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 6px;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.ql-editor .linkcard-desc {
    font-size: 13px;
    color: #64748b;
    margin-bottom: 10px;
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.ql-editor .linkcard-footer {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: #94a3b8;
}
.ql-editor .linkcard-favicon {
    width: 16px;
    height: 16px;
    border-radius: 3px;
}
.ql-editor .linkcard-domain {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* 移动端卡片适配 */
@media (max-width: 768px) {
    .ql-editor .linkcard { flex-direction: column; max-width: 100%; }
    .ql-editor .linkcard-image { width: 100%; height: 140px; }
}

/* 电子表格 */
.sheet-body {
    display: flex;
    flex-direction: column;
    padding: 0;
}

#sheet-container {
    flex: 1;
    overflow: hidden;
}

.sheet-toolbar {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: #fff;
    border-top: 1px solid var(--border);
    flex-shrink: 0;
}

.sheet-info {
    margin-left: auto;
    font-size: 13px;
    color: var(--text-muted);
}

/* =====================================
   Toast 提示
   ===================================== */
.toast {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: #1e293b;
    color: #fff;
    padding: 12px 24px;
    border-radius: 50px;
    font-size: 14px;
    z-index: 9999;
    transition: transform 0.3s ease, opacity 0.3s ease;
    opacity: 0;
    pointer-events: none;
    box-shadow: var(--shadow-lg);
}
.toast.show { transform: translateX(-50%) translateY(0); opacity: 1; }
.toast.error { background: var(--danger); }
.toast.warning { background: var(--warning); }

/* =====================================
   用户中心
   ===================================== */
.profile-area {
    padding: 28px 36px;
    max-width: 800px;
}

.profile-card {
    background: #fff;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    overflow: hidden;
    margin-bottom: 24px;
}

.profile-card-header {
    display: flex;
    align-items: center;
    gap: 24px;
    padding: 32px;
    background: linear-gradient(135deg, #1e3a5f 0%, #2563eb 100%);
    color: #fff;
}

.profile-avatar {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    background: rgba(255,255,255,0.2);
    border: 3px solid rgba(255,255,255,0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    font-weight: 700;
    flex-shrink: 0;
}

.profile-info h2 {
    font-size: 22px;
    font-weight: 700;
    margin-bottom: 4px;
}
.profile-info p {
    font-size: 14px;
    opacity: 0.8;
    margin-bottom: 10px;
}
.profile-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    font-size: 13px;
    opacity: 0.75;
}

/* 设置分区 */
.profile-section {
    background: #fff;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    overflow: hidden;
    margin-bottom: 20px;
}

.section-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 16px;
    font-weight: 600;
    padding: 20px 24px;
    border-bottom: 1px solid var(--border);
    background: var(--bg-secondary);
}
.section-icon { font-size: 20px; }

.key-badge {
    margin-left: auto;
    font-size: 12px;
    padding: 3px 10px;
    border-radius: 50px;
    font-weight: 500;
    background: #f1f5f9;
    color: var(--text-muted);
}
.key-badge.active {
    background: #d1fae5;
    color: #059669;
}

.section-body {
    padding: 24px;
}

.section-desc {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 16px;
    line-height: 1.7;
}
.section-desc a {
    color: var(--primary);
    font-weight: 500;
    text-decoration: underline;
}

.form-row {
    display: flex;
    gap: 10px;
    align-items: center;
}

.form-input {
    flex: 1;
    padding: 10px 14px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-family: inherit;
    outline: none;
    transition: var(--transition);
    background: var(--bg-secondary);
}
.form-input:focus {
    border-color: var(--primary);
    background: #fff;
    box-shadow: 0 0 0 3px rgba(37,99,235,0.1);
}

.form-msg {
    margin-top: 10px;
    font-size: 13px;
    min-height: 20px;
}
.form-msg.success { color: var(--success); }
.form-msg.error { color: var(--danger); }

/* =====================================
   Responsive
   ===================================== */
@media (max-width: 768px) {
    .hero-title { font-size: 36px; }
    .hero-desc { font-size: 15px; }
    .features-grid { grid-template-columns: 1fr; }
    .nav-links a { display: none; }
    .sidebar { width: 72px; }
    .sidebar span:not(.nav-icon) { display: none; }
    .sidebar-logo span { display: none; }
    .user-info { display: none; }
    .sidebar-user { justify-content: center; }
    .main-content { margin-left: 72px; }
    #editor-container { padding: 20px; }
    #editor-container .ql-editor { padding: 30px 24px; }

    .footer-content { flex-direction: column; gap: 40px; }
    .footer-links { gap: 40px; }

    .doc-grid { grid-template-columns: 1fr; }
    .hero-stats { gap: 20px; }

    /* 登录弹出层移动端 */
    .login-overlay-content { flex-direction: column; max-width: 100%; border-radius: 0; margin: 0; min-height: auto; }
    .login-overlay-left { padding: 32px 28px 24px; text-align: center; align-items: center; }
    .login-overlay-left .login-desc { max-width: none; }
    .login-slogan { font-size: 28px; }
    .login-overlay-right { width: 100%; padding: 24px 20px; }
    .login-close-btn { top: 12px; right: 12px; }

    /* 用户中心移动端 */
    .profile-area { padding: 20px 16px; }
    .profile-card-header { flex-direction: column; text-align: center; padding: 24px 20px; }
    .profile-meta { justify-content: center; }
    .form-row { flex-wrap: wrap; }
    .sidebar-bottom { display: none; }
}
