* {
    box-sizing: border-box;
}
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: #f0f2f5;
    margin: 0;
    padding: 20px;
}
.container {
    max-width: 1400px;
    margin: 0 auto;
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
    overflow: hidden;
}
.header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 20px 30px;
}
.header h1 {
    margin: 0;
    font-size: 1.8rem;
}
.header p {
    margin: 5px 0 0;
    opacity: 0.9;
}
.toolbar {
    padding: 20px 30px;
    background: #f8f9fa;
    border-bottom: 1px solid #e9ecef;
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    align-items: flex-end;
}
.tool-group {
    display: flex;
    flex-direction: column;
    gap: 5px;
}
.tool-group label {
    font-size: 0.8rem;
    font-weight: 600;
    color: #495057;
}
input, button {
    padding: 8px 12px;
    font-size: 14px;
    border-radius: 6px;
    border: 1px solid #ced4da;
    background: white;
}
button {
    background: #667eea;
    color: white;
    border: none;
    cursor: pointer;
    transition: background 0.2s;
}
button:hover {
    background: #5a67d8;
}
.search-box {
    flex: 1;
    min-width: 200px;
}
.search-box input {
    width: 100%;
}
.status {
    padding: 10px 30px;
    background: #e9ecef;
    font-size: 0.9rem;
    color: #495057;
    border-bottom: 1px solid #dee2e6;
}
.main {
    display: flex;
    min-height: 600px;
}
.sidebar {
    width: 280px;
    background: #f8f9fa;
    border-right: 1px solid #e9ecef;
    padding: 15px;
    overflow-y: auto;
    max-height: 70vh;
}
.sidebar h3 {
    margin-top: 0;
    font-size: 1rem;
    color: #495057;
}
.session-list {
    list-style: none;
    padding: 0;
    margin: 0;
}
.session-list li {
    padding: 8px 12px;
    margin-bottom: 5px;
    background: white;
    border-radius: 6px;
    cursor: pointer;
    border: 1px solid #dee2e6;
    font-size: 0.85rem;
    word-break: break-all;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.session-list li:hover {
    background: #e9ecef;
}
.session-list li.active {
    background: #667eea;
    color: white;
    border-color: #667eea;
}
.session-list li .session-info {
    flex: 1;
    overflow: hidden;
}
.session-list li .delete-session {
    background: none;
    border: none;
    color: #dc3545;
    cursor: pointer;
    font-size: 16px;
    font-weight: bold;
    padding: 0 5px;
    opacity: 0.6;
}
.session-list li .delete-session:hover {
    opacity: 1;
}
.content {
    flex: 1;
    padding: 20px;
    overflow-x: auto;
    max-height: 1600px;
    overflow-y: auto;
}
.tree {
    font-family: 'Consolas', 'Monaco', monospace;
    font-size: 14px;
    line-height: 1.6;
}
.tree ul {
    padding-left: 24px;
    list-style: none;
}
.tree li {
    position: relative;
    padding: 2px 0;
}
.tree .folder::before {
    content: "📁 ";
    cursor: pointer;
}
.tree .file::before {
    content: "📄 ";
}
.file-name {
    cursor: pointer;
    color: #007bff;
}
.file-name:hover {
    text-decoration: underline;
}
.download-btn {
    background: none;
    border: none;
    color: #28a745;
    cursor: pointer;
    font-size: 12px;
    padding: 0 4px;
    margin-left: 8px;
}
.download-btn:hover {
    text-decoration: underline;
    background: none;
    color: #218838;
}
.size-info {
    color: #6c757d;
    font-size: 12px;
    margin-left: 6px;
}
.highlight {
    background-color: #ffecb3;
    font-weight: bold;
    border-radius: 2px;
    padding: 0 2px;
}
.loading {
    text-align: center;
    padding: 40px;
    color: #6c757d;
}
.error {
    color: #dc3545;
    padding: 10px;
    background: #f8d7da;
    border-radius: 6px;
}
.empty-tip {
    text-align: center;
    padding: 60px 20px;
    color: #adb5bd;
    font-size: 1.2rem;
}
hr {
    margin: 15px 0;
}
.export-btn {
    background-color: #28a745;
    margin-top: 10px;
    width: 100%;
}
.export-btn:hover {
    background-color: #218838;
}
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0,0,0,0.5);
}
.modal-content {
    background-color: #fefefe;
    margin: 5% auto;
    padding: 20px;
    border: 1px solid #888;
    width: 80%;
    max-width: 1000px;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.2);
}
.close {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
}
.close:hover {
    color: black;
}
.preview-content {
    max-height: 70vh;
    overflow: auto;
    margin-top: 20px;
}
.preview-text {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 6px;
    font-family: monospace;
    white-space: pre-wrap;
    word-break: break-all;
}
.preview-image {
    max-width: 100%;
    height: auto;
}
.preview-pdf {
    width: 100%;
    height: 70vh;
}
@media (max-width: 768px) {
    .main {
        flex-direction: column;
    }
    .sidebar {
        width: 100%;
        max-height: 200px;
        border-right: none;
        border-bottom: 1px solid #e9ecef;
    }
    .modal-content {
        width: 95%;
        margin: 10% auto;
    }
    .content {
        max-height: 600px;
    }
}