:root {
    --bg-dark: #1a1a1a; --bg-panel: #252525; --bg-toolbar: #2d2d2d;
    --bg-input: #1e1e1e; --border-dark: #3a3a3a; --border-light: #444;
    --text-primary: #e0e0e0; --text-secondary: #999; --text-muted: #666;
    --accent-red: #cc0000; --accent-red-hover: #dd1111; --accent-blue: #0066cc;
    --success-green: #27ae60; --info-blue: #4fc3f7;
}
* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: 'Segoe UI', Tahoma, sans-serif; background: var(--bg-dark); color: var(--text-primary); overflow: hidden; height: 100vh; width: 100vw; user-select: none; }

/* SPLASH */
.splash-screen { position: fixed; top: 0; left: 0; right: 0; bottom: 0; background: #0d0d0d; display: flex; align-items: center; justify-content: center; z-index: 9999; transition: opacity 0.5s, visibility 0.5s; }
.splash-screen.hidden { opacity: 0; visibility: hidden; pointer-events: none; }
.splash-content { text-align: center; }
.splash-logo { font-size: 48px; margin-bottom: 20px; animation: splashPulse 1.5s ease-in-out infinite; }
@keyframes splashPulse { 0%,100%{transform:scale(1);opacity:1} 50%{transform:scale(1.1);opacity:0.8} }
.splash-title { font-size: 28px; font-weight: 300; color: #ccc; margin-bottom: 6px; letter-spacing: 2px; }
.splash-subtitle { font-size: 14px; color: var(--accent-red); font-weight: 600; margin-bottom: 30px; }
.splash-loader { width: 200px; height: 3px; background: #1a1a1a; border-radius: 2px; overflow: hidden; margin: 0 auto; }
.splash-loader-bar { height: 100%; width: 0%; background: linear-gradient(90deg, var(--accent-red), #e74c3c); border-radius: 2px; animation: splashLoad 3s ease-in-out forwards; }
@keyframes splashLoad { 0%{width:0} 30%{width:35%} 60%{width:70%} 100%{width:100%} }
.splash-status { margin-top: 12px; font-size: 11px; color: var(--text-muted); }

/* TITLE BAR */
.title-bar { background: #0d0d0d; height: 32px; display: flex; align-items: center; padding: 0 12px; font-size: 12px; color: var(--text-secondary); border-bottom: 1px solid #2a2a2a; }
.title-bar .doc-title { flex: 1; text-align: center; color: #ccc; }
.title-bar .window-controls { display: flex; gap: 8px; }
.title-bar .window-controls span { width: 12px; height: 12px; border-radius: 50%; display: inline-block; cursor: pointer; }

/* MENU BAR */
.menu-bar { background: var(--bg-toolbar); height: 28px; display: flex; align-items: center; padding: 0 8px; font-size: 12px; border-bottom: 1px solid var(--border-dark); }
.menu-bar .menu-item { padding: 4px 10px; color: #ccc; cursor: pointer; border-radius: 3px; }
.menu-bar .menu-item:hover { background: #3e3e3e; }
.menu-bar .menu-item.active { background: var(--accent-blue); color: #fff; }

/* TOOLBAR */
.toolbar { background: linear-gradient(to bottom, #3a3a3a, #2d2d2d); height: 48px; display: flex; align-items: center; padding: 0 12px; border-bottom: 1px solid var(--border-light); gap: 6px; }
.toolbar .tool-btn { background: transparent; border: 1px solid transparent; color: #ccc; padding: 6px 10px; font-size: 12px; cursor: pointer; border-radius: 4px; display: flex; align-items: center; gap: 5px; }
.toolbar .tool-btn:hover { background: #4a4a4a; border-color: #555; }
.toolbar .tool-btn.primary { background: linear-gradient(to bottom, var(--accent-red), #990000); color: #fff; font-weight: 600; border-color: #8b0000; }
.toolbar .tool-btn.primary:hover { background: linear-gradient(to bottom, var(--accent-red-hover), #aa0000); }
.toolbar .separator { width: 1px; height: 32px; background: #555; margin: 0 6px; }
.toolbar .logo-text { color: #e74c3c; font-weight: 700; font-size: 14px; margin-right: 8px; }

/* PATH BAR */
.path-bar { background: var(--bg-input); height: 36px; display: flex; align-items: center; padding: 0 12px; border-bottom: 1px solid var(--border-dark); }
.path-bar .path-icon { color: #e74c3c; margin-right: 8px; font-size: 16px; }
.path-bar .path-text { font-size: 12px; color: var(--text-secondary); }

/* LAYOUT */
.main-content { display: flex; height: calc(100vh - 32px - 28px - 48px - 36px); }
/* SIDEBAR */
.sidebar { width: 140px; background: var(--bg-panel); border-right: 1px solid var(--border-dark); padding: 12px; overflow-y: auto; }
.sidebar .section-title { font-size: 11px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 1px; margin-bottom: 10px; }
.sidebar .page-thumb { width: 100%; aspect-ratio: 8.5/11; background: #fff; border-radius: 4px; margin-bottom: 10px; position: relative; cursor: pointer; overflow: hidden; }
.sidebar .page-thumb:hover, .sidebar .page-thumb.active { border: 2px solid var(--accent-blue); }
.sidebar .page-thumb .thumb-content { padding: 8px; font-size: 4px; color: #333; line-height: 1.4; }
.sidebar .page-thumb .page-label { position: absolute; bottom: 2px; right: 4px; font-size: 6px; color: var(--text-muted); }

/* DOCUMENT VIEWER */
.document-viewer { flex: 1; background: #1e1e1e; display: flex; align-items: flex-start; justify-content: center; padding: 30px; overflow-y: auto; position: relative; }
.pdf-page { width: 680px; min-height: 880px; background: #fff; color: #1a1a1a; box-shadow: 0 4px 20px rgba(0,0,0,0.5); padding: 60px 70px; position: relative; cursor: pointer; }
.pdf-page::before { content: ''; position: absolute; top: 0; left: 0; right: 0; bottom: 0; background: linear-gradient(to bottom, rgba(0,0,0,0.02) 0%, transparent 5%); pointer-events: none; }

/* STATUS BAR */
.status-bar { position: fixed; bottom: 0; left: 0; right: 0; background: var(--bg-toolbar); height: 26px; display: flex; align-items: center; padding: 0 12px; font-size: 10px; color: var(--text-muted); border-top: 1px solid var(--border-dark); z-index: 500; }
.status-bar .status-left { display: flex; gap: 16px; }
.status-bar .status-right { margin-left: auto; display: flex; gap: 12px; align-items: center; }

/* TOAST */
.toast-container { position: fixed; top: 80px; right: 20px; z-index: 2000; display: flex; flex-direction: column; gap: 8px; }
.toast { background: var(--bg-toolbar); border: 1px solid var(--border-dark); border-radius: 6px; padding: 10px 16px; font-size: 12px; color: #ccc; box-shadow: 0 4px 12px rgba(0,0,0,0.4); display: flex; align-items: center; gap: 8px; animation: toastIn 0.3s ease forwards; min-width: 260px; }
.toast.toast-out { animation: toastOut 0.3s ease forwards; }
@keyframes toastIn { from { opacity: 0; transform: translateX(40px); } to { opacity: 1; transform: translateX(0); } }
@keyframes toastOut { from { opacity: 1; transform: translateX(0); } to { opacity: 0; transform: translateX(40px); } }

/* UTILITIES */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: var(--bg-dark); }
::-webkit-scrollbar-thumb { background: #444; border-radius: 4px; }
.fade-in { animation: fadeIn 0.3s ease; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(-10px); } to { opacity: 1; transform: translateY(0); } }

