/* 现代简约个人文献库样式 */
:root {
    --primary-gradient: linear-gradient(135deg, #cddce2,40%, #d3cee8 70%);
    --primary-color: #c4d0d9;
    --primary-hover: #b8c7d1;
    --text-primary: #2c3e50;
    --text-secondary: #5a6c7d;
    --text-muted: #5d6368;
    --background-white: #ffffff;
    --background-light: #f8fafc;
    --background-hover: #f1f5f9;
    --border-light: #cdd2d9;
    --border-medium: #cbd5e1;
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.08);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.10);
    --shadow-lg: 0 8px 25px rgba(0, 0, 0, 0.12);
    --border-radius: 12px;
    --border-radius-sm: 8px;
    --transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
    box-sizing: border-box;
}

body {
    background: var(--background-white);
    color: var(--text-primary);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.6;
    margin: 0;
    padding: 0;
}

.library-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 24px;
}

/* 导航栏样式 */
.library-nav {
    background: #d3cee8;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-sm);
    margin-bottom: 32px;
    overflow: hidden;
    border: 1px solid var(--border-light);
}

.nav-list {
    display: flex;
    margin: 0;
    padding: 0;
    list-style: none;
}

.nav-item {
    flex: 1;
    text-align: center;
    padding: 20px 24px;
    background: var(--background-white);
    border-right: 1px solid var(--border-light);
    cursor: pointer;
    transition: var(--transition);
    color: var(--text-secondary);
    font-weight: 500;
    font-size: 15px;
    position: relative;
}

.nav-item:last-child {
    border-right: none;
}

.nav-item:hover {
    background: var(--background-hover);
    color: var(--text-primary);
}

.nav-item.active {
    background: var(--primary-gradient);
    color: white;
    font-weight: 600;
}

.nav-item.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 40px;
    height: 3px;
    background: rgba(255, 255, 255, 0.8);
    border-radius: 2px;
}

.nav-item i {
    margin-right: 10px;
    font-size: 16px;
}

/* 搜索栏样式 */
.library-search {
    background: var(--background-white);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-sm);
    margin-top: 15px;
    margin-bottom: 15px;
    padding: 24px;
    border: 1px solid var(--border-light);
}

.search-container {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.search-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.search-icon {
    position: absolute;
    left: 16px;
    color: var(--text-muted);
    font-size: 16px;
    z-index: 1;
}

.search-input {
    width: 100%;
    padding: 14px 90px 14px 50px; /* Increased right padding for search button */
    border: 2px solid var(--border-light);
    border-radius: var(--border-radius-sm);
    font-size: 16px;
    background: var(--background-white);
    transition: var(--transition);
    color: var(--text-primary);
}

.search-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(196, 208, 217, 0.1);
}

.clear-search {
    position: absolute;
    right: 16px;
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    transition: var(--transition);
    opacity: 0;
    visibility: hidden;
}

.clear-search.visible {
    opacity: 1;
    visibility: visible;
}

.clear-search:hover {
    color: var(--text-primary);
    background: var(--background-hover);
}

.search-button {
    position: absolute;
    right: 10px; /* Position to the left of clear button */
    background: var(--primary-color);
    border: none;
    color: white;
    cursor: pointer;
    padding: 5px 5px;
    border-radius: 4px;
    transition: var(--transition);
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 36px;
    max-width: 36px;
}

.search-button:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.search-button:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.search-filters {
    display: flex;
    gap: 16px;
    align-items: center;
    flex-wrap: wrap;
}

.search-select {
    padding: 10px 16px;
    border: 2px solid var(--border-light);
    border-radius: var(--border-radius-sm);
    background: var(--background-white);
    color: var(--text-primary);
    font-size: 14px;
    cursor: pointer;
    transition: var(--transition);
    min-width: 120px;
}

.search-select:focus {
    outline: none;
    border-color: var(--primary-color);
}

.tag-filter {
    position: relative;
    flex: 1;
    min-width: 200px;
}

.tag-input {
    width: 100%;
    padding: 10px 16px;
    border: 2px solid var(--border-light);
    border-radius: var(--border-radius-sm);
    font-size: 14px;
    background: var(--background-white);
    color: var(--text-primary);
    transition: var(--transition);
}

.tag-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(196, 208, 217, 0.1);
}

.tag-suggestions {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--background-white);
    border: 1px solid var(--border-light);
    border-radius: var(--border-radius-sm);
    box-shadow: var(--shadow-md);
    z-index: 1000;
    max-height: 200px;
    overflow-y: auto;
    display: none;
}

.tag-suggestions.visible {
    display: block;
}

.tag-suggestion-item {
    padding: 12px 16px;
    cursor: pointer;
    transition: var(--transition);
    border-bottom: 1px solid var(--border-light);
    font-size: 14px;
}

.tag-suggestion-item:last-child {
    border-bottom: none;
}

.tag-suggestion-item:hover {
    background: var(--background-hover);
}

.tag-suggestion-item.selected {
    background: var(--primary-color);
    color: white;
}

.tag-suggestion-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.tag-name {
    flex: 1;
}

.tag-count {
    font-size: 12px;
    color: var(--text-muted);
    background: var(--background-light);
    padding: 2px 6px;
    border-radius: 10px;
    margin-left: 8px;
}

.tag-suggestion-item.no-tags {
    color: var(--text-muted);
    font-style: italic;
    cursor: default;
}

.tag-suggestion-item.no-tags:hover {
    background: transparent;
}

.search-button {
    padding: 10px 20px;
    background: var(--primary-gradient);
    color: white;
    border: none;
    border-radius: var(--border-radius-sm);
    cursor: pointer;
    transition: var(--transition);
    font-size: 14px;
    font-weight: 500;
    min-width: 80px;
}

.search-button:hover {
    background: var(--primary-hover);
    transform: translateY(-1px);
    box-shadow: var(--shadow-sm);
}

.search-button:active {
    transform: translateY(0);
}

/* 头部控制区域样式 */
.header-controls {
    display: flex;
    align-items: center;
    gap: 16px;
}

.filter-controls {
    display: flex;
    gap: 8px;
    align-items: center;
    background: var(--background-light);
    border-radius: var(--border-radius-sm);
    padding: 8px 12px;
    border: 1px solid var(--border-light);
}

.filter-controls .tag-filter {
    position: relative;
    width: 200px; /* Fixed width */
    max-width: 200px;
    display: flex;
    background: var(--background-white);
    border: 2px solid var(--border-light);
    border-radius: var(--border-radius-sm);
    padding: 2px 4px;
    gap: 4px;
    align-items: center;
    overflow: visible; /* Allow dropdown to show */
}

.filter-controls .tag-filter:focus-within {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(196, 208, 217, 0.1);
}

.tag-chips-container {
    display: flex;
    gap: 4px;
    flex: 1;
    min-width: 0;
    align-items: center;
    justify-content: flex-start;
    overflow: visible; /* Don't hide tags */
    flex-wrap: nowrap; /* Keep tags in one line */
    min-height: 32px; /* 确保容器有足够高度 */
}

.tag-chips-container::-webkit-scrollbar {
    display: none; /* Hide scrollbar in Chrome/Safari */
}

.tag-chip {
    display: flex;
    background: var(--primary-color);
    color: white;
    padding: 2px 8px;
    border-radius: 16px;
    font-size: 12px;
    font-weight: 500;
    gap: 4px;
    align-items: center;
    flex-shrink: 0; /* Prevent tags from shrinking */
    white-space: nowrap; /* Keep tag text on one line */
}

.tag-chip-remove {
    background: none;
    border: none;
    align-items: center;
    color: white;
    cursor: pointer;
    padding: 0;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    transition: var(--transition);
}

.tag-chip-remove:hover {
    background: rgba(255, 255, 255, 0.2);
}

.tag-dropdown-btn {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    transition: var(--transition);
    z-index: 100;
}

.tag-dropdown-btn:hover {
    color: var(--text-primary);
    background: var(--background-hover);
}

.tag-input {
    border: none !important;
    background: none !important;
    padding: 4px 32px 4px 4px !important;
    flex: 0 0 100px; /* Fixed width for input */
    min-width: 100px;
    outline: none !important;
    box-shadow: none !important;
}

.tag-input::placeholder {
    color: var(--text-muted);
}


/* 主内容区域 */
.library-main {
    background: var(--background-white);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-sm);
    min-height: 600px;
    position: relative;
    border: 1px solid var(--border-light);
}

.library-content {
    padding: 40px;
}

/* 仪表盘样式 */
.dashboard h2 {
    margin-bottom: 40px;
    color: var(--text-primary);
    font-size: 32px;
    font-weight: 700;
    text-align: center;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 10px;
    margin-bottom: 48px;
}

.stat-card {
    background: linear-gradient(50deg, #e8f4f9 0%, #f5fcff 70%);
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: var(--border-radius);
    padding: 30px 20px;
    text-align: center;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    background: linear-gradient(50deg, rgba(255, 255, 255, 0.2) 0%, transparent 50%, rgba(255, 255, 255, 0.1) 100%);
    pointer-events: none;
}

.stat-card::after {
    content: '';
    position: absolute;
    border-radius: var(--border-radius);
    z-index: -1;
    opacity: 0;
    transition: var(--transition);
}

.stat-card:hover {
    transform: translateY(-8px) scale(1.02);
    border-color: rgba(255, 255, 255, 0.4);
}

.stat-card:hover::after {
    opacity: 1;
}

.stat-icon {
    font-size: 30px;
    margin-bottom: 10px;
    color: #a8b1b8;
    opacity: 1;
    transition: var(--transition);
}

.stat-card:hover .stat-icon {
    transform: scale(1.1);
}

.stat-number {
    font-size: 32px;
    font-weight: 600;
    margin-bottom: 7px;
    color: #5a6c7d;
    letter-spacing: -1px;
    transition: var(--transition);
}

.stat-card:hover .stat-number {
    transform: scale(1.05);
}

.stat-label {
    font-size: 16px;
    color: #5a6c7d;
    font-weight: 600;
    opacity: 1;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.recent-section {
    margin-bottom: 48px;
}

.recent-section h3 {
    margin-bottom: 24px;
    color: var(--text-primary);
    font-size: 24px;
    font-weight: 600;
    position: relative;
    padding-bottom: 12px;
}

.recent-section h3::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 60px;
    height: 3px;
    background: var(--primary-gradient);
    border-radius: 2px;
}

/* 数据同步工具样式 */
.sync-section {
    text-align: center;
    margin: 32px 0;
    padding: 24px;
    background: var(--background-light);
    border-radius: var(--border-radius);
    border: 1px solid var(--border-light);
}

.sync-section .btn {
    margin-bottom: 12px;
}

.sync-section small {
    display: block;
    color: var(--text-muted);
    font-size: 13px;
}

/* 视图头部 */
.view-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 40px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border-light);
}

.view-header h2 {
    margin: 0;
    color: var(--text-primary);
    font-size: 32px;
    font-weight: 700;
}

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

/* 网格布局 */
.projects-grid, .collections-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 24px;
}

.project-card, .collection-card {
    border: 1px solid var(--border-light);
    border-radius: var(--border-radius);
    overflow: hidden;
    transition: var(--transition);
    background: var(--background-white);
    box-shadow: var(--shadow-sm);
}

.project-card:hover, .collection-card:hover {
    border-color: var(--border-medium);
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 24px 24px 20px;
    background: var(--background-light);
}

.card-header h3 {
    margin: 0;
    color: var(--text-primary);
    font-size: 20px;
    font-weight: 600;
}

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

.card-body {
    padding: 20px 24px;
}

.card-body p {
    margin: 0 0 16px 0;
    color: var(--text-secondary);
    font-size: 15px;
    line-height: 1.6;
}

.project-stats, .collection-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    margin-bottom: 16px;
    font-size: 14px;
    color: var(--text-muted);
}

.project-stats span, .collection-stats span {
    display: flex;
    align-items: center;
    gap: 6px;
}

.card-footer {
    padding: 20px 24px 24px;
    background: var(--background-light);
}

/* 按钮样式 */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    border: none;
    border-radius: var(--border-radius-sm);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    text-decoration: none;
    transition: var(--transition);
    outline: none;
    position: relative;
    overflow: hidden;
}

.btn:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.btn-primary {
    background: var(--primary-gradient);
    color: white;
    border: 1px solid transparent;
    padding: 10px 15px;
}

.btn-primary:hover {
    opacity: 0.9;
}

.btn-action{
    background: var(--primary-gradient);
    color: #ffffff;
    font-weight: 600;
    font-size: 15px;
    border: 1px solid var(--primary-color);
    padding: 10px 15px;
    border-radius: 10px;
}

.btn-action:hover {
    opacity: 0.9;
}

.logout-button{
    background: var(--primary-gradient);
    color: #ffffff;
    font-weight: 400;
    font-size: 12px;
    border: 1px solid transparent;
    padding: 3px 8px;
    border-radius: 10px;
}

.logout-button:hover {
    opacity: 0.9;
}

.btn-secondary {
    background: var(--background-white);
    color: var(--text-secondary);
    border: 1px solid var(--border-medium);
}

.btn-secondary:hover {
    background: var(--background-hover);
    color: var(--text-primary);
}

.btn-outline {
    background: transparent;
    border: 1px solid var(--primary-color);
    color: #2c3e50;
    border-radius: 10px;
}

.btn-outline:hover {
    background: var(--primary-gradient);
    color: white;
}

.btn-link {
    background: transparent;
    color: #2c3e50;
    padding: 8px 16px;
    border: none;
}

.btn-link:hover {
    color: var(--primary-hover);
    background: var(--background-hover);
}

.btn-sm {
    padding: 6px 12px;
    font-size: 12px;
    min-width: auto;
}

.btn-icon {
    padding: 10px;
    border-radius: 50%;
    background: var(--background-white);
    border: 1px solid var(--border-light);
    color: var(--text-muted);
    width: 40px;
    height: 40px;
    justify-content: center;
}

.btn-icon:hover {
    background: var(--background-hover);
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.btn-danger {
    background: #ef4444;
    color: white;
    border: 1px solid transparent;
}

.btn-danger:hover {
    background: #dc2626;
}

.btn-warning {
    background: #f59e0b;
    color: white;
    border: 1px solid transparent;
}

.btn-warning:hover {
    background: #d97706;
}

.btn-info {
    background: #3b82f6;
    color: white;
    border: 1px solid transparent;
}

.btn-info:hover {
    background: #2563eb;
}

/* 文档管理专用按钮样式 */
.btn-analyze {
    background: #BEB9D1;
    color: white;
    border: 1px solid transparent;
    border-radius: 15px;
}

.btn-analyze:hover {
    opacity: 0.9;
    transform: translateY(-1px);
}

.btn-reanalyze {
    background: #B9C6CB;
    color: white;
    border: 1px solid transparent;
    border-radius: 15px;
}

.btn-reanalyze:hover {
    background: #859ba3;
    transform: translateY(-1px);
    
}

.btn-view {
    background: #9caabe;
    color: white;
    border: 1px solid transparent;
    border-radius: 15px;
}

.btn-view:hover {
    background:rgb(115, 131, 155)e;
    transform: translateY(-1px);
}

.btn-history {
    background: #8ccbd6;
    color: white;
    border: 1px solid transparent;
    border-radius: 15px;
}

.btn-history:hover {
    background: #67969e;
    transform: translateY(-1px);
}

.btn-delete {
    background: #e18181;
    color: white;
    border: 1px solid transparent;
    border-radius: 15px;
}

.btn-delete:hover {
    background: #b37575;
    transform: translateY(-1px);
}

/* 标签样式 */
.tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 12px;
}

.tag {
    display: inline-block;
    padding: 6px 12px;
    background: var(--background-light);
    color: var(--text-secondary);
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
    border: 1px solid var(--border-light);
}

.tag-sm {
    padding: 4px 8px;
    font-size: 11px;
}

.tag-placeholder {
    display: flex;
    align-items: center;
    padding: 6px 12px;
    height: 32px;
    color: #999;
    font-style: italic;
    pointer-events: none;
    user-select: none;
    font-size: 14px;
    line-height: 1;
}

.card-tag-placeholder {
    display: inline-block;
    padding: 6px 12px;
    height: 1.2em;
    visibility: hidden;
    font-size: 12px;
}

.tag-hint {
    display: inline-block;
    padding: 6px 12px;
    background: transparent;
    color: var(--text-muted);
    border: 1px dashed var(--border-light);
    border-radius: 20px;
    font-size: 12px;
    font-style: italic;
    font-weight: 400;
}

/* 列表样式 */
.project-list, .collection-list, .papers-list, .analysis-list, .documents-list {
    display: grid;
    gap: 16px;
    margin-bottom: 24px;
}

.project-item, .collection-item, .paper-item, .analysis-item, .document-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 24px;
    border: 1px solid var(--border-light);
    border-radius: var(--border-radius);
    transition: var(--transition);
    background: var(--background-white);
}

.document-item {
    align-items: flex-start; /* 改为顶部对齐 */
    overflow: hidden; /* 防止整个项目溢出 */
}

.document-item .document-info {
    flex: 1;
    min-width: 0; /* 允许收缩 */
    margin-right: 20px;
    overflow: hidden; /* 防止内容溢出 */
}

.project-item:hover, .collection-item:hover, 
.paper-item:hover, .analysis-item:hover, .document-item:hover {
    border-color: var(--border-medium);
    box-shadow: var(--shadow-sm);
    transform: translateY(-1px);
}

.project-info h4, .collection-info h4, 
.paper-info h4, .analysis-info h4 {
    margin: 0 0 8px 0;
    color: var(--text-primary);
    font-size: 18px;
    font-weight: 600;
}

.project-info p, .collection-info p {
    margin: 0 0 12px 0;
    color: var(--text-secondary);
    font-size: 15px;
}

.project-meta, .collection-meta, .paper-meta, .analysis-meta {
    display: flex;
    gap: 20px;
    font-size: 13px;
    color: var(--text-muted);
}

.project-actions, .collection-actions, .paper-actions, .analysis-actions {
    display: flex;
    gap: 8px;
}

/* 文档管理样式 */
.documents-section {
    margin-bottom: 40px;
}

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

.section-header h3 {
    margin: 0;
    color: var(--text-primary);
    font-size: 24px;
    font-weight: 600;
}

/* 内联筛选组样式 - 和标题在同一行 */
.filter-group-inline {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: auto;
}

.filter-group-inline label {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 6px;
}

.filter-group-inline label i {
    font-size: 13px;
    color: var(--text-muted);
}

.filter-select-inline {
    padding: 8px 12px;
    border: 1px solid var(--border-light);
    border-radius: var(--border-radius-sm);
    background: var(--background-white);
    color: var(--text-primary);
    font-size: 13px;
    cursor: pointer;
    transition: var(--transition);
    min-width: 130px;
}

.filter-select-inline:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(196, 208, 217, 0.1);
}

.filter-select-inline:hover {
    border-color: var(--border-medium);
}

/* 响应式筛选器 */
@media (max-width: 768px) {
    .section-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }
    
    .filter-group-inline {
        margin-left: 0;
        width: 100%;
    }
    
    .filter-select-inline {
        flex: 1;
    }
}

.document-title {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 16px;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 8px;
    min-width: 0; /* 允许flex子元素收缩 */
    width: 100%; /* 确保占满容器宽度 */
}

.document-filename {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    min-width: 0; /* 允许收缩 */
    flex: 1; /* 占据剩余空间 */
}

.document-meta {
    display: flex;
    gap: 20px;
    font-size: 13px;
    color: var(--text-muted);
    overflow: hidden; /* 防止元数据溢出 */
    flex-wrap: wrap; /* 允许换行 */
}

.document-actions {
    display: flex;
    flex-direction: column;
    gap: 12px;
    flex-shrink: 0; /* 不允许收缩 */
    min-width: 280px; /* 设置最小宽度 */
    align-items: flex-end; /* 右对齐 */
}

.primary-controls, .secondary-controls {
    display: flex;
    gap: 6px;
    align-items: center;
    flex-wrap: wrap;
}

.primary-controls {
    justify-content: flex-end; /* 右对齐 */
}

.secondary-controls {
    justify-content: flex-end; /* 右对齐 */
}

.model-select-doc {
    padding: 6px 10px;
    font-size: 12px;
    border: 1px solid var(--border-medium);
    border-radius: var(--border-radius-sm);
    background: var(--background-white);
    color: var(--text-secondary);
    min-width: 80px;
    height: 32px;
    transition: var(--transition);
}

.model-select-doc:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(196, 208, 217, 0.2);
    outline: none;
}

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

.modal-content {
    background: var(--background-white);
    border-radius: var(--border-radius);
    max-width: 600px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border-light);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 24px;
    border-bottom: 1px solid var(--border-light);
    background: var(--background-light);
}

.modal-header h3 {
    margin: 0;
    color: var(--text-primary);
    font-size: 20px;
    font-weight: 600;
}

.modal-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: var(--text-muted);
    padding: 4px;
    border-radius: 4px;
    transition: var(--transition);
}

.modal-close:hover {
    color: var(--text-primary);
    background: var(--background-hover);
}

.modal-body {
    padding: 24px;
}

/* 表单样式 */
.form-group {
    margin-bottom: 24px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: var(--text-primary);
    font-size: 14px;
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--border-light);
    border-radius: var(--border-radius-sm);
    font-size: 15px;
    outline: none;
    transition: var(--transition);
    background: var(--background-white);
    color: var(--text-primary);
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(196, 208, 217, 0.1);
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    font-size: 15px;
}

.checkbox-label input[type="checkbox"] {
    width: auto;
}

.form-actions, .modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid var(--border-light);
}

.help-text {
    font-size: 13px;
    color: var(--text-muted);
    margin-top: 6px;
}

/* 文件上传样式 */
.upload-form {
    max-width: 500px;
}

.upload-progress {
    margin: 24px 0;
    text-align: center;
}

.progress-bar {
    width: 100%;
    height: 8px;
    background: var(--background-light);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 12px;
}

.progress-fill {
    height: 100%;
    background: var(--primary-gradient);
    width: 0%;
    border-radius: 4px;
}

.progress-text {
    font-size: 14px;
    color: var(--text-secondary);
}

/* 分页样式 */
.pagination {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 32px;
}

.page-btn {
    padding: 8px 14px;
    border: 1px solid var(--border-light);
    background: var(--background-white);
    color: var(--text-secondary);
    cursor: pointer;
    border-radius: var(--border-radius-sm);
    font-size: 12px;
    transition: var(--transition);
    min-width: 36px;
    text-align: center;
}

.page-btn:hover {
    background: var(--background-hover);
    border-color: var(--border-medium);
    color: #2c3e50;
}

.page-btn.active {
    background: var(--primary-gradient);
    color: white;
    border-color: transparent;
}

.page-btn.disabled {
    background: var(--background-light);
    color: var(--text-muted);
    cursor: not-allowed;
    opacity: 0.5;
    pointer-events: none;
}

.pagination-dots {
    display: flex;
    align-items: center;
    padding: 10px 8px;
    color: var(--text-muted);
    font-size: 14px;
    cursor: default;
}

/* 消息提示 */
.message {
    position: fixed;
    top: 24px;
    right: 24px;
    padding: 16px 24px;
    border-radius: var(--border-radius-sm);
    color: white;
    font-weight: 500;
    z-index: 1001;
    animation: slideIn 0.3s ease;
    box-shadow: var(--shadow-md);
    max-width: 400px;
}

.message-success {
    background: #6cd8b4fd;
}

.message-error {
    background: #db7e7e;
}

.message-warning {
    background: #f0c781;
}

.message.fade-out {
    animation: slideOut 0.3s ease;
}
.message-info {
    background: #82d2f1;
}

.message.fade-out {
    opacity: 0;
}

.user-library-search-interface {
    background:rgb(255, 255, 255);
    border: 1px solidrgb(255, 255, 255);
    border-radius: 8px;
    padding: 5px;
    margin: 0px 0;
}

.search-controls {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.search-options {
    display: flex;
    gap: 20px;
}

.search-option {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-weight: 500;
}

.search-option input[type="radio"] {
    margin: 0;
}

.project-filter select {
    padding: 8px 12px;
    border: 1px solid #ced4da;
    border-radius: 4px;
    font-size: 14px;
    min-width: 200px;
}

.search-params {
    display: flex;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
}

.search-params label {
    font-weight: 500;
    color: #495057;
}

.search-params input[type="number"] {
    width: 80px;
    padding: 6px 10px;
    border: 1px solid #ced4da;
    border-radius: 4px;
    text-align: center;
}

#library-search-btn {
    align-self: flex-start;
    padding: 10px 20px;
    font-weight: 500;
}

.search-results {
    margin-top: 30px;
    border-top: 2px solid #dee2e6;
    padding-top: 20px;
}

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

.results-header h3 {
    margin: 0;
    color: #495057;
}

.search-result-item {
    background: white;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    margin-bottom: 15px;
    overflow: hidden;
    transition: all 0.3s ease;
}

.search-result-item:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}


.result-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    background:rgb(255, 255, 255);
    border-bottom: 1px solid #dee2e6;
}

.result-meta {
    display: flex;
    align-items: center;
    gap: 15px;
}

.result-rank {
    font-weight: bold;
    color: #6c757d;
    font-size: 14px;
}

.result-score {
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
    cursor: help;
}

.high-relevance .result-score {
    background: #d4edda;
    color: #155724;
}

.medium-relevance .result-score {
    background: #fff3cd;
    color: #856404;
}

.low-relevance .result-score {
    background: #f8d7da;
    color: #721c24;
}

.result-actions {
    display: flex;
    gap: 10px;
}

.result-body {
    padding: 20px;
}

.result-filename {
    margin: 0 0 10px 0;
    color: #495057;
    font-size: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.result-info {
    display: flex;
    gap: 20px;
    margin-bottom: 15px;
    font-size: 14px;
    color: #6c757d;
}

.result-info span {
    display: flex;
    align-items: center;
    gap: 5px;
}

.content-preview {
    background:rgb(255, 255, 255);
    padding: 15px;
    border-radius: 4px;
    margin-bottom: 10px;
    line-height: 1.6;
    font-size: 14px;
}

.content-preview mark {
    background: #ffeb3b;
    padding: 2px 4px;
    border-radius: 2px;
    font-weight: 500;
}

.content-full {
    background: rgb(255, 255, 255);
    padding: 15px;
    border-radius: 4px;
    margin-bottom: 10px;
    line-height: 1.6;
    font-size: 14px;
}

.content-full mark {
    background: #ffeb3b;
    padding: 2px 4px;
    border-radius: 2px;
    font-weight: 500;
}

.expand-btn {
    background: none;
    border: none;
    color: #007bff;
    cursor: pointer;
    font-size: 14px;
    padding: 8px 0;
    display: flex;
    align-items: center;
    gap: 5px;
    transition: color 0.2s ease;
    outline: none;
}

.expand-btn:hover {
    color: #0056b3;
    text-decoration: none;
}

.expand-btn:active {
    color: #004085;
}

.expand-btn i {
    font-size: 12px;
}


@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideOut {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(100%);
        opacity: 0;
    }
}

/* 加载动画 */
.library-loading {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.9);
    display: none;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    border-radius: var(--border-radius);
    backdrop-filter: blur(2px);
}

.loading-spinner {
    width: 48px;
    height: 48px;
    border: 4px solid var(--border-light);
    border-top: 4px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 16px;
}

.loading-text {
    color: var(--text-primary);
    font-size: 16px;
    font-weight: 500;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* 用户信息样式 */
.profile-content {
    max-width: 800px;
}

.profile-section {
    margin-bottom: 48px;
}

.profile-section h3 {
    margin-bottom: 24px;
    color: var(--text-primary);
    font-size: 22px;
    font-weight: 600;
    position: relative;
    padding-bottom: 12px;
}

.profile-section h3::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 60px;
    height: 3px;
    background: var(--primary-gradient);
    border-radius: 2px;
}

.profile-info {
    display: grid;
    gap: 20px;
}

.info-item {
    display: flex;
    gap: 20px;
    padding: 20px;
    background: var(--background-light);
    border-radius: var(--border-radius-sm);
    border: 1px solid var(--border-light);
}

.info-item label {
    min-width: 120px;
    font-weight: 500;
    color: var(--text-secondary);
}

.info-item span {
    color: var(--text-primary);
}

.profile-actions {
    margin-top: 32px;
    text-align: center;
}

.edit-profile-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    background: var(--primary-gradient);
    color: white;
    border: none;
    border-radius: var(--border-radius-sm);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    text-decoration: none;
    transition: var(--transition);
    box-shadow: var(--shadow-sm);
}

.edit-profile-btn:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
    opacity: 0.9;
}

.stat-item {
    text-align: center;
    padding: 32px 24px;
    border: 1px solid var(--border-light);
    border-radius: var(--border-radius);
    background: var(--background-white);
    transition: var(--transition);
}

.stat-item:hover {
    box-shadow: var(--shadow-sm);
    transform: translateY(-2px);
}

.stat-item .stat-number {
    font-size: 36px;
    font-weight: 700;
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 8px;
}

.stat-item .stat-label {
    color: var(--text-secondary);
    font-size: 15px;
    font-weight: 500;
}

/* 分析结果样式 */
.analysis-result {
    max-width: 800px;
}

.analysis-header {
    margin-bottom: 24px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border-light);
}

.analysis-header .analysis-info {
    display: flex;
    gap: 20px;
    margin-top: 8px;
}

.analysis-time, .analysis-model {
    font-size: 13px;
    color: var(--text-muted);
    background: var(--background-light);
    padding: 4px 12px;
    border-radius: 12px;
    border: 1px solid var(--border-light);
}

.analysis-header h4 {
    margin: 0 0 8px 0;
    color: var(--text-primary);
    font-size: 20px;
    font-weight: 600;
}

.analysis-content h5 {
    margin: 0 0 16px 0;
    color: var(--text-primary);
    font-size: 18px;
    font-weight: 600;
}

.result-text {
    background: var(--background-light);
    border: 1px solid var(--border-light);
    border-radius: var(--border-radius-sm);
    padding: 20px;
    line-height: 1.7;
    color: var(--text-primary);
    margin-bottom: 24px;
    max-height: 400px;
    overflow-y: auto;
}

.analysis-section {
    margin-bottom: 32px;
}

.analysis-section h5 {
    margin: 0 0 16px 0;
    color: var(--text-primary);
    font-size: 18px;
    font-weight: 600;
}

.analysis-section p {
    line-height: 1.7;
    color: var(--text-secondary);
    margin-bottom: 16px;
}

.analysis-section ul {
    padding-left: 24px;
    margin-bottom: 16px;
}

.analysis-section li {
    margin-bottom: 10px;
    line-height: 1.6;
    color: var(--text-secondary);
}

.analysis-history {
    max-width: 900px;
}

.analyses-list {
    max-height: 600px;
    overflow-y: auto;
}

.analysis-history-item {
    border: 1px solid var(--border-light);
    border-radius: var(--border-radius-sm);
    padding: 24px;
    margin-bottom: 16px;
    background: var(--background-white);
    transition: var(--transition);
}

.analysis-history-item:hover {
    box-shadow: var(--shadow-sm);
}

.analysis-type {
    background: var(--primary-gradient);
    color: white;
    padding: 6px 16px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
}

.analysis-time {
    font-size: 13px;
    color: var(--text-muted);
}

.analysis-preview {
    font-size: 15px;
    line-height: 1.6;
    margin-top: 16px;
}

/* 文档分析历史样式 */
.document-analysis-history {
    max-width: 900px;
}

.history-item {
    margin-bottom: 20px;
    padding: 20px;
    border-radius: var(--border-radius-sm);
    background: var(--background-light);
    border: 1px solid var(--border-light);
    transition: var(--transition);
}

.history-item:hover {
    box-shadow: var(--shadow-sm);
}

.history-item.current-version {
    border: 2px solid var(--primary-color);
    background: rgba(205, 220, 226, 0.1);
}

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

.history-header strong {
    color: var(--primary-color);
    font-weight: 600;
}

.history-header .time {
    margin-left: 12px;
    color: var(--text-muted);
    font-size: 14px;
}

.history-header .model {
    font-size: 13px;
    color: var(--text-muted);
    background: var(--background-white);
    padding: 4px 10px;
    border-radius: 12px;
    border: 1px solid var(--border-light);
}

.history-header button {
    margin-left: 12px;
    padding: 6px 12px;
    font-size: 12px;
    background: #10b981;
    color: white;
    border: none;
    border-radius: var(--border-radius-sm);
    cursor: pointer;
    transition: var(--transition);
}

.history-header button:hover {
    background: #059669;
}

.history-header button.view-detail {
    background: #3b82f6;
}

.history-header button.view-detail:hover {
    background: #2563eb;
}

.history-item .source {
    font-size: 14px;
    color: var(--text-secondary);
}

.history-item .source.archive {
    color: var(--text-muted);
}

/* 分析结果容器样式 */
.analysis-result-container {
    display: flex;
    gap: 24px;
    max-height: 85vh;
    overflow: hidden;
}

.analysis-left-panel {
    flex: 0 0 60%;
    overflow-y: auto;
    padding-right: 12px;
}

.analysis-right-panel {
    flex: 0 0 40%;
    overflow-y: auto;
    padding-left: 12px;
    border-left: 1px solid var(--border-light);
}

.flowchart-header {
    margin-bottom: 20px;
}

.flowchart-header h4 {
    margin: 0;
    color: var(--text-primary);
    font-size: 18px;
    font-weight: 600;
}

.no-flowchart, .js-no-flowchart {
    text-align: center;
    color: var(--text-muted);
    padding: 48px 24px;
    background: var(--background-light);
    border: 1px solid var(--border-light);
    border-radius: var(--border-radius-sm);
}

.flowchart-content {
    text-align: center;
    min-height: 300px;
}

.analysis-actions {
    margin-top: 20px;
    text-align: right;
    border-top: 1px solid var(--border-light);
    padding-top: 20px;
}

/* JavaScript样式类 */
.js-text-fallback {
    background: var(--background-light);
    border: 1px solid var(--border-light);
    border-radius: var(--border-radius-sm);
    padding: 20px;
    font-family: 'SF Mono', Monaco, 'Cascadia Code', 'Roboto Mono', Consolas, 'Courier New', monospace;
    font-size: 14px;
    line-height: 1.5;
    white-space: pre-wrap;
    overflow-x: auto;
    max-height: 500px;
    color: var(--text-primary);
}

.js-error-div, .js-error-flowchart {
    text-align: center;
    padding: 48px 24px;
    color: #ef4444;
    background: var(--background-light);
    border: 1px solid var(--border-light);
    border-radius: var(--border-radius-sm);
    margin: 24px 0;
}

.js-analysis-section {
    margin-bottom: 24px;
}

.js-content-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 12px;
    border-bottom: 2px solid #3b82f6;
    padding-bottom: 8px;
}

.js-value-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 12px;
    border-bottom: 2px solid #10b981;
    padding-bottom: 8px;
}

.js-no-analysis {
    text-align: center;
    color: var(--text-muted);
    padding: 48px 24px;
    background: var(--background-light);
    border: 1px solid var(--border-light);
    border-radius: var(--border-radius-sm);
}

.js-complex-ul {
    margin: 0;
    margin-top: 8px;
    padding-left: 24px;
}

.js-complex-li {
    margin-bottom: 8px;
    line-height: 1.6;
    color: var(--text-secondary);
}

.js-complex-container {
    margin-top: 12px;
}

.js-complex-item {
    margin-bottom: 12px;
}

.js-complex-title {
    font-weight: 600;
    font-size: 16px;
    color: var(--text-primary);
    margin-bottom: 6px;
}

.js-complex-title-sm {
    font-weight: 500;
    font-size: 15px;
    color: var(--text-primary);
    margin-bottom: 6px;
}

.js-complex-content {
    margin-left: 20px;
}

.js-complex-text {
    line-height: 1.6;
    color: var(--text-secondary);
}

.js-modal-wide {
    max-width: 95vw;
    width: 1600px;
    height: 90vh;
    max-height: 90vh;
}

.js-modal-body-fixed {
    overflow: hidden;
    height: calc(100% - 80px);
    padding: 20px;
}

.js-loading-visible {
    display: flex !important;
}

.js-loading-hidden {
    display: none !important;
}

.no-data {
    text-align: center;
    color: var(--text-muted);
    font-style: italic;
    padding: 48px 24px;
    background: var(--background-light);
    border: 1px solid var(--border-light);
    border-radius: var(--border-radius-sm);
}

/* 加载错误样式 */
.loading-error {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100%;
    min-height: 500px;
}

.error-content {
    text-align: center;
    max-width: 500px;
    padding: 48px 32px;
}

.error-content i {
    color: #ef4444;
    margin-bottom: 24px;
    font-size: 64px;
}

.error-content h2 {
    color: var(--text-primary);
    margin-bottom: 16px;
    font-size: 28px;
    font-weight: 600;
}

.error-content p {
    color: var(--text-secondary);
    margin-bottom: 32px;
    font-size: 16px;
    line-height: 1.6;
}

/* 响应式设计 */
@media (max-width: 1024px) {
    .library-container {
        padding: 16px;
    }
    
    .library-content {
        padding: 24px;
    }
    
    .analysis-result-container {
        flex-direction: column;
    }
    
    .analysis-left-panel, .analysis-right-panel {
        flex: 1;
        padding: 0;
        border: none;
    }
    
    .js-modal-wide {
        width: 95vw;
        max-width: 95vw;
    }
}

@media (max-width: 768px) {
    .library-container {
        padding: 12px;
    }
    
    .library-content {
        padding: 20px;
    }
    
    .nav-list {
        flex-wrap: wrap;
    }
    
    .nav-item {
        flex-basis: 50%;
        font-size: 14px;
        padding: 16px 20px;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .projects-grid, .collections-grid {
        grid-template-columns: 1fr;
    }
    
    .view-header {
        flex-direction: column;
        gap: 16px;
        align-items: stretch;
        text-align: center;
    }
    
    .header-actions {
        justify-content: center;
    }
    
    .project-item, .collection-item,
    .paper-item, .analysis-item, .document-item {
        flex-direction: column;
        gap: 16px;
        align-items: stretch;
    }
    
    .project-actions, .collection-actions,
    .paper-actions, .analysis-actions, .document-actions {
        justify-content: center;
        flex-direction: row;
        flex-wrap: wrap;
        gap: 6px;
    }
    
    .analysis-controls, .view-controls {
        gap: 4px;
    }
    
    .btn-sm {
        padding: 5px 8px;
        font-size: 11px;
    }
    
    .model-select-doc {
        min-width: 70px;
        font-size: 11px;
    }
    
    .modal-content {
        width: 95%;
        margin: 8px;
    }
    
    .modal-header, .modal-body {
        padding: 16px;
    }
    
    .header-controls {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
    }
    
    .filter-controls {
        justify-content: center;
    }
    
    .filter-controls .tag-filter {
        width: 250px; /* Fixed width for mobile */
        max-width: 250px;
    }
    
    .tag-input {
        min-width: 60px !important;
        max-width: 120px !important;
        padding-left: 8px !important;
    }
    
    .tag-chip {
        font-size: 11px;
        padding: 3px 6px;
    }
    
    .tag-chip-remove {
        width: 12px;
        height: 12px;
        font-size: 9px;
    }
    
    .dashboard h2 {
        font-size: 24px;
    }
    
    .view-header h2 {
        font-size: 24px;
    }

    .search-filters {
        flex-direction: column;
        align-items: stretch;
    }
    
    .tag-filter {
        min-width: unset;
    }
    
    .search-select {
        min-width: unset;
    }
}

/* 无结果状态样式 */
.no-results {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
}

.no-results i {
    color: var(--border-medium);
    margin-bottom: 20px;
}

.no-results h3 {
    color: var(--text-secondary);
    margin: 0 0 12px 0;
    font-size: 20px;
    font-weight: 600;
}

.no-results p {
    margin: 0;
    font-size: 16px;
    line-height: 1.5;
}

/* 移动端适配 - 448x924 */
@media (max-width: 480px) {
    .library-container {
        padding: 12px;
    }

    .library-nav {
        margin-bottom: 20px;
    }

    .nav-list {
        flex-wrap: wrap;
    }

    .nav-item {
        flex-basis: 50%;
        font-size: 14px;
        padding: 16px 12px;
        border-right: none;
        border-bottom: 1px solid var(--border-light);
    }

    .nav-item:nth-child(2n) {
        border-right: none;
    }

    .nav-item:last-child,
    .nav-item:nth-last-child(2) {
        border-bottom: none;
    }

    .library-search {
        padding: 16px;
        margin-bottom: 12px;
    }

    .search-input {
        padding: 12px 80px 12px 40px;
        font-size: 15px;
    }

    .search-icon {
        left: 12px;
        font-size: 14px;
    }

    .clear-search {
        right: 50px;
    }

    .search-button {
        right: 8px;
        height: 32px;
        max-width: 32px;
        font-size: 12px;
    }

    .search-filters {
        flex-direction: column;
        gap: 12px;
    }

    .search-select {
        min-width: 100%;
        padding: 8px 12px;
    }

    .tag-filter {
        min-width: 100%;
    }

    .library-content {
        padding: 20px;
    }

    .dashboard h2 {
        font-size: 24px;
        margin-bottom: 30px;
    }

    .stats-grid {
        grid-template-columns: 1fr 1fr;
        gap: 12px;
        margin-bottom: 30px;
    }

    .stat-card {
        padding: 16px 12px;
    }

    .stat-icon {
        font-size: 24px;
        margin-bottom: 10px;
    }

    .stat-number {
        font-size: 20px;
        margin-bottom: 4px;
    }

    .stat-label {
        font-size: 12px;
    }

    .view-header {
        flex-direction: column;
        gap: 16px;
        align-items: stretch;
        text-align: center;
        margin-bottom: 30px;
    }

    .view-header h2 {
        font-size: 24px;
    }

    .header-actions {
        justify-content: center;
        gap: 8px;
    }

    .projects-grid,
    .collections-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .card-header {
        padding: 16px;
    }

    .card-header h3 {
        font-size: 18px;
    }

    .card-body {
        padding: 16px;
    }

    .card-body p {
        font-size: 14px;
    }

    .card-footer {
        padding: 16px;
    }

    .document-item {
        flex-direction: column;
        gap: 12px;
        align-items: stretch;
        padding: 16px;
    }

    .document-actions {
        min-width: 100%;
        align-items: stretch;
        gap: 8px;
    }

    .primary-controls,
    .secondary-controls {
        justify-content: center;
        gap: 4px;
    }

    .btn {
        padding: 8px 12px;
        font-size: 13px;
    }

    .btn-sm {
        padding: 6px 8px;
        font-size: 11px;
    }

    .model-select-doc {
        min-width: 70px;
        font-size: 11px;
        padding: 5px 8px;
        height: 30px;
    }

    .modal-content {
        width: 95%;
        margin: 10px;
        max-height: 95vh;
    }

    .modal-header,
    .modal-body {
        padding: 16px;
    }

    .filter-controls .tag-filter {
        width: 100%;
        max-width: 100%;
    }

    .tag-input {
        min-width: 80px !important;
        max-width: 150px !important;
    }

    .search-controls-inline {
        flex-direction: column;
        gap: 12px;
        align-items: stretch;
    }

    .search-options {
        justify-content: center;
    }

    .project-filter select {
        min-width: 100%;
    }

    .search-params {
        justify-content: center;
        flex-wrap: wrap;
    }
}

@media (max-width: 448px) {
    .library-container {
        padding: 8px;
    }

    .nav-item {
        flex-basis: 100%;
        font-size: 13px;
        padding: 14px 16px;
    }
    
    .library-search {
        padding: 12px;
    }

    .search-input {
        padding: 10px 70px 10px 35px;
        font-size: 14px;
    }

    .search-icon {
        left: 10px;
        font-size: 13px;
    }

    .clear-search {
        right: 45px;
    }

    .search-button {
        right: 6px;
        height: 28px;
        max-width: 28px;
        font-size: 11px;
    }

    .library-content {
        padding: 16px;
    }

    .dashboard h2 {
        font-size: 20px;
        margin-bottom: 24px;
    }

    .stats-grid {
        grid-template-columns: 1fr;
        gap: 10px;
        margin-bottom: 24px;
    }

    .stat-card {
        padding: 14px 10px;
    }

    .stat-icon {
        font-size: 20px;
        margin-bottom: 8px;
    }

    .stat-number {
        font-size: 18px;
        margin-bottom: 3px;
    }

    .stat-label {
        font-size: 11px;
    }

    .view-header h2 {
        font-size: 20px;
    }

    .card-header {
        padding: 14px;
    }

    .card-header h3 {
        font-size: 16px;
    }

    .card-body {
        padding: 14px;
    }

    .card-body p {
        font-size: 13px;
    }

    .card-footer {
        padding: 14px;
    }

    .document-item {
        padding: 14px;
        gap: 10px;
    }

    .document-actions {
        gap: 6px;
    }

    .primary-controls,
    .secondary-controls {
        gap: 3px;
    }
    
    .btn {
        padding: 6px 10px;
        font-size: 12px;
    }
    
    .btn-sm {
        padding: 4px 6px;
        font-size: 10px;
    }

    .model-select-doc {
        min-width: 60px;
        font-size: 10px;
        padding: 4px 6px;
        height: 26px;
    }

    .modal-content {
        width: 98%;
        margin: 5px;
        max-height: 98vh;
    }

    .modal-header,
    .modal-body {
        padding: 12px;
    }

    .tag-input {
        min-width: 60px !important;
        max-width: 120px !important;
        font-size: 12px !important;
    }

    .tag-chip {
        font-size: 10px;
        padding: 2px 6px;
    }

    .tag-chip-remove {
        width: 12px;
        height: 12px;
        font-size: 8px;
    }

    .search-params input[type="number"] {
        width: 50px;
        font-size: 12px;
    }

    .search-params label {
        font-size: 12px;
    }
}

/* 用户文档库搜索界面样式 */
.user-library-search-interface {
    margin-top: 8px;
}

.search-controls-inline {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: nowrap;
    padding: 6px 0;
}

.search-options {
    display: flex;
    gap: 16px;
    flex-shrink: 0;
}

.search-option {
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    font-size: 14px;
    color: var(--text-secondary);
    white-space: nowrap;
}

.search-option input[type="radio"] {
    margin: 0;
}

.search-option span {
    user-select: none;
}

.project-filter {
    display: flex;
    align-items: center;
    flex-shrink: 0;
}

.project-filter select {
    padding: 6px 12px;
    border: 1px solid var(--border-light);
    border-radius: var(--border-radius-sm);
    background: var(--background-white);
    color: var(--text-primary);
    font-size: 14px;
    cursor: pointer;
    min-width: 150px;
}

.search-params {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 14px;
    color: var(--text-secondary);
    flex-shrink: 0;
}

.search-params label {
    white-space: nowrap;
    font-weight: 500;
}

.search-params input[type="number"] {
    width: 60px;
    padding: 4px 8px;
    border: 1px solid var(--border-light);
    border-radius: 4px;
    background: var(--background-white);
    color: var(--text-primary);
    font-size: 14px;
    text-align: center;
}

.search-params input[type="number"]:focus {
    outline: none;
    border-color: var(--primary-color);
}
