/*
Theme Name: MarkBox - 书签管理主题
Theme URI: https://markbox.app
Author: MarkBox Team
Author URI: https://markbox.app
Description: 轻量级网页书签管理主题，支持文件夹分类、标签系统和搜索功能
Version: 1.0.0
License: GPL v2 or later
Text Domain: markbox
*/

/* ==================== 基础样式 ==================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: #f5f7fa;
    color: #333;
    line-height: 1.6;
}

a {
    text-decoration: none;
    color: inherit;
}

button {
    cursor: pointer;
    border: none;
    background: none;
    font-family: inherit;
}

/* ==================== 登录页面 ==================== */
.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 20px;
}

.login-container {
    width: 100%;
    max-width: 400px;
    background: #fff;
    border-radius: 16px;
    padding: 40px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}

.login-logo {
    text-align: center;
    margin-bottom: 30px;
}

.login-logo .logo-icon {
    width: 64px;
    height: 64px;
    background: linear-gradient(135deg, #4a90d9 0%, #667eea 100%);
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 15px;
    font-size: 32px;
}

.login-logo h1 {
    font-size: 24px;
    color: #333;
    margin-bottom: 5px;
}

.login-logo p {
    color: #999;
    font-size: 14px;
}

.login-form .form-group {
    margin-bottom: 20px;
}

.login-form label {
    display: block;
    margin-bottom: 8px;
    font-size: 14px;
    color: #555;
    font-weight: 500;
}

.login-form input[type="text"],
.login-form input[type="password"] {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e8e8e8;
    border-radius: 8px;
    font-size: 15px;
    transition: border-color 0.3s;
}

.login-form input:focus {
    outline: none;
    border-color: #4a90d9;
}

.login-form .login-btn {
    width: 100%;
    padding: 14px;
    background: linear-gradient(135deg, #4a90d9 0%, #667eea 100%);
    color: #fff;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 500;
    transition: transform 0.2s, box-shadow 0.2s;
}

.login-form .login-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(74, 144, 217, 0.4);
}

.login-form .error-message {
    background: #fee;
    color: #c33;
    padding: 12px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-size: 14px;
}

/* ==================== 主布局 ==================== */
.app-container {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ==================== 顶部导航 ==================== */
.top-header {
    background: #fff;
    border-bottom: 1px solid #e8e8e8;
    padding: 12px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 100;
}

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

.header-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 20px;
    font-weight: 600;
    color: #4a90d9;
}

.header-logo .logo-icon {
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, #4a90d9 0%, #667eea 100%);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
}

.header-center {
    flex: 1;
    max-width: 400px;
    margin: 0 40px;
}

.search-box {
    position: relative;
}

.search-box input {
    width: 100%;
    padding: 10px 16px 10px 40px;
    border: 1px solid #e8e8e8;
    border-radius: 20px;
    font-size: 14px;
    background: #f5f7fa;
    transition: all 0.3s;
}

.search-box input:focus {
    outline: none;
    background: #fff;
    border-color: #4a90d9;
}

.search-box .search-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: #999;
    font-size: 14px;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 16px;
}

.user-menu {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    border-radius: 20px;
    cursor: pointer;
    transition: background 0.2s;
}

.user-menu:hover {
    background: #f5f7fa;
}

.user-avatar {
    width: 32px;
    height: 32px;
    background: linear-gradient(135deg, #4a90d9 0%, #667eea 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 14px;
    font-weight: 500;
}

.user-name {
    font-size: 14px;
    color: #555;
}

.dropdown-menu {
    position: absolute;
    top: 100%;
    right: 0;
    background: #fff;
    border: 1px solid #e8e8e8;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    min-width: 150px;
    display: none;
    margin-top: 8px;
}

.user-menu:hover .dropdown-menu {
    display: block;
}

.dropdown-menu a {
    display: block;
    padding: 10px 16px;
    font-size: 14px;
    color: #555;
    transition: background 0.2s;
}

.dropdown-menu a:hover {
    background: #f5f7fa;
}

/* ==================== 主内容区 ==================== */
.main-content {
    flex: 1;
    display: flex;
    overflow: hidden;
}

/* ==================== 侧边栏 ==================== */
.sidebar {
    width: 240px;
    background: #fff;
    border-right: 1px solid #e8e8e8;
    padding: 20px 0;
    overflow-y: auto;
}

.sidebar-section {
    padding: 0 16px;
    margin-bottom: 24px;
}

.sidebar-title {
    font-size: 12px;
    font-weight: 600;
    color: #999;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 12px;
    padding: 0 8px;
}

.folder-list {
    list-style: none;
}

.folder-list li {
    margin-bottom: 2px;
}

.folder-list a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 8px;
    font-size: 14px;
    color: #555;
    transition: all 0.2s;
}

.folder-list a:hover {
    background: #f5f7fa;
}

.folder-list li.active a {
    background: #4a90d9;
    color: #fff;
}

.folder-list .folder-icon {
    font-size: 16px;
}

.folder-list .folder-name {
    flex: 1;
}

.folder-list .count {
    font-size: 12px;
    opacity: 0.7;
}

/* ==================== 内容区域 ==================== */
.content-area {
    flex: 1;
    padding: 24px;
    overflow-y: auto;
}

.content-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.content-title {
    font-size: 20px;
    font-weight: 600;
    color: #333;
}

.content-title .count {
    font-size: 14px;
    color: #999;
    font-weight: normal;
    margin-left: 8px;
}

.add-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 10px 20px;
    background: #4a90d9;
    color: #fff;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s;
}

.add-btn:hover {
    background: #3a7bc8;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(74, 144, 217, 0.3);
}

/* ==================== 书签卡片 ==================== */
.bookmark-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.bookmark-card {
    background: #fff;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
    transition: all 0.2s;
}

.bookmark-card:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.bookmark-header {
    margin-bottom: 12px;
}

.bookmark-title {
    font-size: 16px;
    font-weight: 500;
    color: #333;
    margin-bottom: 8px;
}

.bookmark-title a:hover {
    color: #4a90d9;
}

.bookmark-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 13px;
    color: #999;
}

.bookmark-meta .domain {
    color: #4a90d9;
}

.bookmark-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 16px;
}

.tag {
    display: inline-block;
    padding: 4px 12px;
    background: #e8f4fc;
    color: #4a90d9;
    border-radius: 12px;
    font-size: 12px;
}

.bookmark-actions {
    display: flex;
    gap: 12px;
}

.action-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    border-radius: 6px;
    font-size: 13px;
    color: #666;
    background: #f5f7fa;
    transition: all 0.2s;
}

.action-btn:hover {
    background: #e8e8e8;
}

.action-btn.edit:hover {
    background: #e8f4fc;
    color: #4a90d9;
}

.action-btn.delete:hover {
    background: #fee;
    color: #c33;
}

/* ==================== 空状态 ==================== */
.empty-state {
    text-align: center;
    padding: 80px 20px;
}

.empty-icon {
    font-size: 64px;
    margin-bottom: 20px;
}

.empty-state h3 {
    font-size: 18px;
    color: #333;
    margin-bottom: 8px;
}

.empty-state p {
    color: #999;
}

/* ==================== 弹窗 ==================== */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: #fff;
    border-radius: 16px;
    width: 90%;
    max-width: 480px;
    max-height: 90vh;
    overflow-y: auto;
}

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

.modal-header h3 {
    font-size: 18px;
    font-weight: 600;
}

.modal-close {
    font-size: 24px;
    color: #999;
    cursor: pointer;
    transition: color 0.2s;
}

.modal-close:hover {
    color: #333;
}

.modal-body {
    padding: 24px;
}

.form-row {
    margin-bottom: 20px;
}

.form-row label {
    display: block;
    margin-bottom: 8px;
    font-size: 14px;
    font-weight: 500;
    color: #555;
}

.form-row input,
.form-row select {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid #e8e8e8;
    border-radius: 8px;
    font-size: 14px;
    transition: border-color 0.2s;
}

.form-row input:focus,
.form-row select:focus {
    outline: none;
    border-color: #4a90d9;
}

.form-row .loading-text {
    font-size: 12px;
    color: #4a90d9;
    margin-top: 6px;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    padding: 16px 24px 24px;
}

.btn {
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-secondary {
    background: #f5f7fa;
    color: #555;
}

.btn-secondary:hover {
    background: #e8e8e8;
}

.btn-primary {
    background: #4a90d9;
    color: #fff;
}

.btn-primary:hover {
    background: #3a7bc8;
}

/* ==================== 响应式 ==================== */
@media (max-width: 768px) {
    .sidebar {
        display: none;
    }
    
    .header-center {
        display: none;
    }
    
    .content-area {
        padding: 16px;
    }
    
    .bookmark-card {
        padding: 16px;
    }
}
