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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: #f5f5f5;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

#app {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* 顶部导航栏 */
.top-nav {
    background: #2c3e50;
    padding: 12px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    z-index: 100;
}

.nav-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.nav-left .logo {
    color: white;
    font-size: 24px;
    font-weight: bold;
}

.version-badge {
    background: rgba(255, 255, 255, 0.15);
    color: rgba(255, 255, 255, 0.8);
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
}

.nav-center {
    flex: 1;
    max-width: 500px;
    margin: 0 40px;
}

.search-input {
    width: 100%;
    padding: 8px 16px;
    border: none;
    border-radius: 20px;
    font-size: 14px;
    background: rgba(255, 255, 255, 0.2);
    color: white;
    outline: none;
}

.search-input::placeholder {
    color: rgba(255, 255, 255, 0.7);
}

.nav-right {
    display: flex;
    gap: 8px;
}

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

.nav-btn:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.5);
}

/* 认证界面 */
#auth-container {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
}

.auth-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    max-width: 380px;
}

.auth-logo {
    font-size: 48px;
    font-weight: bold;
    color: #2c3e50;
    margin-bottom: 32px;
}

.auth-copyright {
    margin-top: 24px;
    font-size: 12px;
    color: #999;
    text-align: center;
}

.auth-version {
    margin-top: 8px;
    font-size: 11px;
    color: #bbb;
}

.auth-box {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.1);
    width: 100%;
    max-width: 380px;
    overflow: hidden;
}

.auth-tabs {
    display: flex;
}

.auth-tabs button {
    flex: 1;
    padding: 16px;
    border: none;
    background: #f8f9fa;
    cursor: pointer;
    font-size: 15px;
    color: #666;
    transition: all 0.2s ease;
}

.auth-tabs button.active {
    background: white;
    color: #2c3e50;
    font-weight: 500;
}

.auth-form {
    padding: 30px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.auth-form input {
    padding: 12px 16px;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s ease;
}

.auth-form input:focus {
    border-color: #3498db;
}

.auth-form button[type="submit"] {
    padding: 12px;
    background: #3498db;
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 15px;
    cursor: pointer;
    transition: background 0.2s ease;
}

.auth-form button[type="submit"]:hover {
    background: #2980b9;
}

/* 主布局 */
.main-layout {
    flex: 1;
    display: flex;
    background: white;
}

/* 左侧边栏 */
.sidebar {
    width: 280px;
    background: #fafafa;
    border-right: 1px solid #e8e8e8;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
}

.sidebar-title {
    padding: 16px 20px;
    font-size: 15px;
    color: #333;
    font-weight: 500;
    border-bottom: 1px solid #e8e8e8;
    display: flex;
    align-items: center;
    gap: 8px;
}

.sidebar-title .folder-icon {
    font-size: 18px;
}

.folder-tree {
    flex: 1;
    padding: 8px 0;
    overflow-y: auto;
}

.folder-item {
    display: flex;
    flex-direction: column;
    cursor: pointer;
    font-size: 14px;
    color: #333;
    position: relative;
    margin: 0;
}

.folder-item:hover > .folder-header {
    background: #f0f0f0;
}

.folder-item.selected > .folder-header {
    background: #e8f0fe;
}

.folder-header {
    display: flex;
    align-items: center;
    width: 100%;
    padding: 0 20px;
    height: 24px;
    min-height: 24px;
    line-height: 1;
    transition: background-color 0.15s ease;
}

.folder-toggle {
    width: 14px;
    height: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    color: #999;
    margin-right: 4px;
    flex-shrink: 0;
}

.folder-icon {
    margin-right: 6px;
    font-size: 16px;
    flex-shrink: 0;
}

.bookmark-icon-sm {
    margin-right: 6px;
    font-size: 14px;
    flex-shrink: 0;
}

.folder-name {
    flex: 1;
    color: #333;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.subfolders {
    padding-left: 1em;
}

/* 右侧内容区 */
.content-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: white;
}

.content-header {
    padding: 20px 30px;
    border-bottom: 1px solid #e8e8e8;
    background: white;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.content-header h2 {
    font-size: 20px;
    color: #333;
    font-weight: 500;
}

.content-actions {
    display: flex;
    gap: 8px;
}

.action-btn {
    padding: 6px 16px;
    border: 1px solid #d0d0d0;
    border-radius: 4px;
    background: white;
    color: #333;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.15s ease;
}

.action-btn:hover {
    background: #f0f0f0;
    border-color: #bbb;
}

/* 三点菜单 */
.menu-wrapper {
    position: relative;
}

#more-menu-btn {
    padding: 6px 10px;
    font-weight: bold;
    letter-spacing: 2px;
}

.dropdown-menu {
    position: absolute;
    right: 0;
    top: 100%;
    margin-top: 4px;
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    min-width: 140px;
    z-index: 200;
}

.dropdown-item {
    display: block;
    width: 100%;
    padding: 10px 16px;
    border: none;
    background: none;
    text-align: left;
    font-size: 13px;
    color: #333;
    cursor: pointer;
    transition: background 0.1s ease;
}

.dropdown-item:hover {
    background: #f5f5f5;
}

.dropdown-item:first-child {
    border-radius: 4px 4px 0 0;
}

.dropdown-item:last-child {
    border-radius: 0 0 4px 4px;
}

.dropdown-divider {
    height: 1px;
    background: #eee;
    margin: 4px 0;
}

.dropdown-item--danger {
    color: #e74c3c;
}

.dropdown-item--danger:hover {
    background: #fdf2f2;
}

.bookmarks-list {
    flex: 1;
    padding: 20px 30px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.bookmark-item {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    background: #fafafa;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.15s ease;
    text-decoration: none;
    color: inherit;
}

.content-folder-item {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    background: #f0f4ff;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.15s ease;
    text-decoration: none;
    color: inherit;
    gap: 10px;
    margin-bottom: 4px;
}

.content-folder-item:hover {
    background: #e2eafc;
}

.content-folder-icon {
    font-size: 20px;
    flex-shrink: 0;
}

.content-folder-name {
    font-size: 14px;
    font-weight: 500;
    color: #333;
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.content-folder-count {
    font-size: 12px;
    color: #888;
    flex-shrink: 0;
}

.bookmark-item:hover {
    background: #f0f0f0;
    text-decoration: none;
}

.bookmark-item * {
    text-decoration: none;
}

.bookmark-favicon {
    width: 32px;
    height: 32px;
    border-radius: 4px;
    margin-right: 12px;
    flex-shrink: 0;
    background: #f5f5f5;
}

.bookmark-info {
    flex: 1;
    min-width: 0;
}

.bookmark-info h3 {
    font-size: 14px;
    font-weight: 400;
    color: #333;
    margin-bottom: 2px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.bookmark-info p {
    font-size: 12px;
    color: #888;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #888;
    font-size: 14px;
}

/* 模态框 */
.modal {
    display: flex;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    align-items: center;
    justify-content: center;
}

.modal.hidden {
    display: none;
}

.modal-content {
    background-color: white;
    padding: 30px;
    border-radius: 8px;
    width: 90%;
    max-width: 600px;
    max-height: 80vh;
    overflow-y: auto;
    position: relative;
}

.close {
    position: absolute;
    right: 20px;
    top: 15px;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    color: #aaa;
    line-height: 1;
}

.close:hover {
    color: #333;
}

.modal-content h2 {
    margin-bottom: 20px;
    color: #333;
    font-size: 20px;
}

.modal-content details {
    margin-bottom: 16px;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
}

.modal-content summary {
    padding: 12px 16px;
    cursor: pointer;
    font-weight: 500;
    color: #333;
    background: #fafafa;
}

.modal-content summary:hover {
    background: #f0f0f0;
}

.modal-content ul {
    padding: 12px 16px 12px 36px;
    background: white;
}

.modal-content li {
    margin-bottom: 8px;
    color: #555;
    font-size: 14px;
}

.hidden {
    display: none !important;
}

/* 手机端适配 */
@media (max-width: 768px) {
    .top-nav {
        flex-wrap: wrap;
        padding: 8px 12px;
        gap: 6px;
    }

    .nav-left {
        order: 1;
        flex: 1;
        min-width: 0;
    }

    .nav-left .logo {
        font-size: 18px;
    }

    .version-badge {
        font-size: 10px;
        padding: 2px 6px;
    }

    .nav-center {
        order: 3;
        flex-basis: 100%;
        margin: 0;
        max-width: none;
    }

    .nav-right {
        order: 2;
        flex-wrap: wrap;
        justify-content: flex-end;
        gap: 4px;
    }

    .nav-btn {
        padding: 6px 10px;
        font-size: 11px;
    }

    .main-layout {
        flex-direction: column;
    }

    .sidebar {
        width: 100%;
        max-height: 40vh;
        border-right: none;
        border-bottom: 1px solid #e8e8e8;
    }

    .folder-header {
        padding: 0 12px;
        height: 36px;
        min-height: 36px;
    }

    .folder-tree {
        padding: 4px 0;
    }

    .content-area {
        min-height: 50vh;
    }

    .content-header {
        padding: 12px 16px;
    }

    .content-header h2 {
        font-size: 16px;
    }

    .bookmarks-list {
        padding: 12px 16px;
        gap: 6px;
    }

    .bookmark-item {
        padding: 10px 12px;
    }

    .bookmark-favicon {
        width: 24px;
        height: 24px;
        margin-right: 10px;
    }

    .bookmark-info h3 {
        font-size: 13px;
    }

    .auth-logo {
        font-size: 36px;
        margin-bottom: 20px;
    }

    .auth-box {
        max-width: 100%;
    }

    .auth-form {
        padding: 20px 16px;
    }

    .modal-content {
        width: 95%;
        padding: 20px 16px;
    }
}