/* 资源管理器 - 前端样式 */

/* 基础容器 */
.rm-frontend-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* 类型导航 */
.rm-type-tabs {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-bottom: 20px;
    padding: 0 20px;
}

.rm-type-tab {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    color: #495057;
    padding: 10px 20px;
    border-radius: 25px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 6px;
}

.rm-type-tab:hover {
    background: #e9ecef;
    transform: translateY(-1px);
}

.rm-type-tab.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-color: transparent;
    box-shadow: 0 3px 10px rgba(102, 126, 234, 0.3);
}

.rm-tab-icon {
    font-size: 16px;
}

/* 搜索和筛选区域 */
.rm-search-filters {
    background: #f8f9fa;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 30px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.rm-form-inline {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    align-items: center;
}

.rm-search-group {
    display: flex;
    flex: 1;
    min-width: 250px;
}

.rm-search-input {
    flex: 1;
    padding: 12px 16px;
    border: 2px solid #e1e5e9;
    border-radius: 8px 0 0 8px;
    font-size: 14px;
    outline: none;
    transition: border-color 0.3s ease;
}

.rm-search-input:focus {
    border-color: #007cba;
}

.rm-search-btn {
    padding: 12px 20px;
    background: #007cba;
    color: white;
    border: none;
    border-radius: 0 8px 8px 0;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: background-color 0.3s ease;
}

.rm-search-btn:hover {
    background: #005a87;
}

.rm-filter-group {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.rm-filter-select {
    padding: 10px 14px;
    border: 2px solid #e1e5e9;
    border-radius: 8px;
    font-size: 14px;
    outline: none;
    background: white;
    cursor: pointer;
}

.rm-filter-btn {
    padding: 10px 20px;
    background: #6c757d;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    transition: background-color 0.3s ease;
}

.rm-filter-btn:hover {
    background: #5a6268;
}

/* 资源网格 */
.rm-resources-grid {
    display: grid;
    gap: 12px;
    margin-bottom: 30px;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
}

.rm-grid-columns-1 { grid-template-columns: 1fr; }
.rm-grid-columns-2 { grid-template-columns: repeat(2, 1fr); }
.rm-grid-columns-3 { grid-template-columns: repeat(3, 1fr); }
.rm-grid-columns-4 { grid-template-columns: repeat(4, 1fr); }

/* 资源卡片 */
.rm-resource-card {
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    border: 1px solid #e9ecef;
    display: flex;
    flex-direction: column;
    height: auto;
}

.rm-resource-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* 缩略图区域 */
.rm-resource-thumbnail {
    position: relative;
    width: 100%;
    height: 100px;
    overflow: hidden;
    background: #f8f9fa;
}

.rm-thumbnail-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.rm-resource-card:hover .rm-thumbnail-img {
    transform: scale(1.03);
}

.rm-no-thumbnail {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    font-size: 28px;
    color: #dee2e6;
}

/* 文字缩略图样式 */
.rm-text-thumbnail {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    width: 100%;
    position: relative;
}

.rm-text-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    height: 100%;
    width: 100%;
    padding: 8px;
}

.rm-text-title {
    font-size: 18px;
    font-weight: bold;
    color: white;
    line-height: 1.2;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
    margin-bottom: 4px;
    display: block;
}

.rm-text-type {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.9);
    font-weight: 500;
    text-shadow: 0 1px 1px rgba(0, 0, 0, 0.2);
    display: block;
}

.rm-type-badge {
    position: absolute;
    top: 8px;
    left: 8px;
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 10px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 3px;
}

.rm-resource-link .rm-type-badge {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.rm-resource-download .rm-type-badge {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
}

.rm-resource-template .rm-type-badge {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
}

.rm-resource-tool .rm-type-badge {
    background: linear-gradient(135deg, #dc3545 0%, #bd2130 100%);
}

.rm-resource-tutorial .rm-type-badge {
    background: linear-gradient(135deg, #fd7e14 0%, #e55100 100%);
}

.rm-resource-plugin .rm-type-badge {
    background: linear-gradient(135deg, #6f42c1 0%, #5a32a3 100%);
}

/* 内容区域 */
.rm-resource-content {
    padding: 15px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.rm-resource-title {
    font-size: 16px;
    font-weight: 700;
    margin: 0 0 8px 0;
    color: #1a1a1a;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.rm-resource-description {
    color: #666;
    font-size: 14px;
    line-height: 1.5;
    margin: 0 0 12px 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* 元数据 */
.rm-resource-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 3px;
    margin-bottom: 6px;
}

.rm-category-tag {
    color: white;
    padding: 4px 10px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.5px;
}

.rm-tag {
    background: #f1f3f4;
    color: #5f6368;
    padding: 3px 8px;
    border-radius: 8px;
    font-size: 10px;
    font-weight: 500;
}

/* 统计信息 */
.rm-resource-stats {
    display: flex;
    gap: 10px;
    margin-bottom: 10px;
}

.rm-stat {
    display: flex;
    align-items: center;
    gap: 4px;
    color: #888;
    font-size: 12px;
    font-weight: 500;
}

/* 操作按钮 */
.rm-resource-actions {
    display: flex;
    gap: 3px;
    flex-wrap: wrap;
    margin-top: auto;
}

.rm-copy-btn,
.rm-download-btn,
.rm-view-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 10px 14px;
    border: none;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.3s ease;
    flex: 1;
    justify-content: center;
    min-width: 0;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.rm-copy-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.rm-copy-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(102, 126, 234, 0.5);
}

.rm-download-btn {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: white;
}

.rm-download-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(240, 147, 251, 0.5);
}

.rm-view-btn {
    background: linear-gradient(135deg, #6c757d 0%, #495057 100%);
    color: white;
}

.rm-view-btn:hover {
    background: linear-gradient(135deg, #495057 0%, #343a40 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(108, 117, 125, 0.4);
}

/* 无资源状态 */
.rm-no-resources {
    text-align: center;
    padding: 60px 20px;
    color: #6c757d;
    grid-column: 1 / -1;
}

.rm-no-resources-icon {
    font-size: 64px;
    margin-bottom: 20px;
}

.rm-no-resources h3 {
    font-size: 24px;
    margin-bottom: 8px;
    color: #495057;
}

/* 分页 */
.rm-pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    margin-top: 40px;
}

.rm-page-btn {
    padding: 10px 16px;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    color: #495057;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.rm-page-btn:hover {
    background: #f8f9fa;
    border-color: #007cba;
    color: #007cba;
}

.rm-current-page {
    background: #007cba;
    color: white;
    border-color: #007cba;
}

.rm-prev-btn,
.rm-next-btn {
    font-weight: 600;
}

/* 模态框 */
.rm-modal {
    display: none;
    position: fixed;
    z-index: 9999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    animation: rmFadeIn 0.3s ease;
}

.rm-modal-content {
    background-color: white;
    margin: 5% auto;
    border-radius: 16px;
    width: 90%;
    max-width: 600px;
    max-height: 80vh;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: rmSlideIn 0.3s ease;
}

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

.rm-modal-header h3 {
    margin: 0;
    font-size: 20px;
    font-weight: 600;
    color: #212529;
}

.rm-modal-close {
    background: none;
    border: none;
    font-size: 28px;
    font-weight: bold;
    color: #6c757d;
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.rm-modal-close:hover {
    background: #e9ecef;
    color: #495057;
}

.rm-modal-body {
    padding: 24px;
    max-height: 60vh;
    overflow-y: auto;
}

/* 消息提示 */
.rm-message {
    position: fixed;
    top: 20px;
    right: 20px;
    background: #28a745;
    color: white;
    padding: 12px 20px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    box-shadow: 0 4px 12px rgba(40, 167, 69, 0.3);
    z-index: 10000;
    transform: translateX(400px);
    opacity: 0;
    transition: all 0.3s ease;
}

.rm-message-show {
    transform: translateX(0);
    opacity: 1;
}

/* 动画 */
@keyframes rmFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes rmSlideIn {
    from { 
        opacity: 0;
        transform: translateY(-30px);
    }
    to { 
        opacity: 1;
        transform: translateY(0);
    }
}

/* 页面头部样式 */
.rm-page-header {
    text-align: center;
    margin-bottom: 20px;
    padding: 20px;
}

.rm-page-title {
    font-size: 1.8rem;
    font-weight: 600;
    margin: 0 0 10px 0;
    color: #212529;
}

.rm-page-description {
    font-size: 0.9rem;
    line-height: 1.5;
    margin: 0 0 15px 0;
    color: #6c757d;
    max-width: 600px;
    margin: 0 auto 15px auto;
}

.rm-page-notice {
    background: #fff3cd;
    border: 1px solid #ffeaa7;
    border-radius: 6px;
    padding: 12px;
    margin: 15px auto 0 auto;
    max-width: 600px;
    font-size: 0.85rem;
    color: #856404;
    text-align: center;
}

/* 帮助区域 */
.rm-help-section {
    margin: 20px 0;
}

.rm-help-toggle {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 12px 16px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    justify-content: space-between;
    align-items: center;
    user-select: none;
}

.rm-help-toggle:hover {
    background: #e9ecef;
    border-color: #007cba;
}

.rm-help-text {
    color: #495057;
    font-size: 14px;
}

.rm-help-arrow {
    color: #6c757d;
    font-size: 12px;
    transition: transform 0.3s ease;
}

.rm-help-toggle.active .rm-help-arrow {
    transform: rotate(180deg);
}

.rm-help-content {
    margin-top: 15px;
    border-radius: 8px;
    overflow: hidden;
    animation: rmSlideDown 0.3s ease;
}

@keyframes rmSlideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 鼓励上传区域 */
.rm-upload-encourage {
    margin: 0 0 20px 0;
    padding: 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 12px;
    color: white;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.2);
}

.rm-encourage-section h3 {
    margin: 0 0 15px 0;
    font-size: 18px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

.rm-encourage-section p {
    margin: 0 0 20px 0;
    line-height: 1.6;
    font-size: 14px;
    opacity: 0.95;
}

.rm-encourage-stats {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}

.rm-stat-item {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.15);
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 500;
    backdrop-filter: blur(10px);
}

.rm-stat-item .rm-icon {
    font-size: 16px;
}

/* 快速提示区域 */
.rm-quick-tips {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 20px;
    border: 1px solid #e9ecef;
}

.rm-quick-tips h4 {
    margin: 0 0 15px 0;
    font-size: 16px;
    font-weight: 600;
    color: #495057;
}

.rm-tips-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 12px;
}

.rm-tip-item {
    background: white;
    padding: 12px 16px;
    border-radius: 6px;
    border: 1px solid #e9ecef;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: all 0.3s ease;
}

.rm-tip-item:hover {
    border-color: #007cba;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.rm-tip-icon {
    font-size: 18px;
    width: 30px;
    text-align: center;
}

.rm-tip-item strong {
    color: #495057;
    font-size: 14px;
    margin-right: 4px;
}

.rm-tip-item {
    font-size: 13px;
    color: #6c757d;
}

/* 上传按钮样式 */
.rm-upload-section {
    margin-left: auto;
}

.rm-upload-btn {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 25px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 4px 15px rgba(240, 147, 251, 0.4);
}

.rm-upload-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(240, 147, 251, 0.6);
}

.rm-icon-upload {
    font-size: 16px;
}

/* 一键转存按钮样式 */
.rm-direct-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin-left: 5px;
}

.rm-direct-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.rm-icon-direct {
    font-size: 12px;
}

/* 上传表单模态框样式 */
.rm-upload-notice {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 25px;
}

.rm-upload-notice p {
    margin: 0 0 10px 0;
    font-weight: 600;
    color: #495057;
}

.rm-upload-notice ul {
    margin: 0;
    padding-left: 20px;
}

.rm-upload-notice li {
    color: #6c757d;
    margin-bottom: 5px;
    line-height: 1.4;
}

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

.rm-form-group label {
    display: block;
    font-weight: 600;
    color: #495057;
    margin-bottom: 8px;
}

.rm-form-group input,
.rm-form-group textarea,
.rm-form-group select {
    width: 100%;
    padding: 12px;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    font-size: 14px;
    transition: border-color 0.3s ease;
    box-sizing: border-box;
}

.rm-form-group input:focus,
.rm-form-group textarea:focus,
.rm-form-group select:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.rm-form-group small {
    display: block;
    color: #6c757d;
    font-size: 12px;
    margin-top: 5px;
}

.rm-form-actions {
    display: flex;
    gap: 15px;
    justify-content: flex-end;
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #e9ecef;
}

.rm-upload-submit-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 12px 30px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.rm-upload-submit-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.rm-upload-cancel-btn {
    background: #6c757d;
    color: white;
    border: none;
    padding: 12px 30px;
    border-radius: 8px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.rm-upload-cancel-btn:hover {
    background: #5a6268;
    transform: translateY(-1px);
}

/* 响应式设计 */
@media (max-width: 768px) {
    .rm-frontend-container {
        padding: 15px;
    }
    
    .rm-type-tabs {
        flex-direction: column;
        gap: 8px;
        padding: 0 10px;
    }
    
    .rm-type-tab {
        width: 100%;
        justify-content: center;
        padding: 8px 16px;
        font-size: 13px;
    }
    
    .rm-form-inline {
        flex-direction: column;
        align-items: stretch;
    }
    
    .rm-search-group {
        min-width: auto;
    }
    
    .rm-filter-group {
        justify-content: stretch;
    }
    
    .rm-filter-select,
    .rm-filter-btn {
        flex: 1;
    }
    
    .rm-resources-grid {
        grid-template-columns: 1fr !important;
        gap: 12px;
    }
    
    .rm-resource-thumbnail {
        height: 80px;
    }
    
    .rm-resource-content {
        padding: 10px;
    }
    
    .rm-resource-title {
        font-size: 13px;
        margin-bottom: 4px;
    }
    
    .rm-resource-description {
        font-size: 11px;
        margin-bottom: 8px;
        -webkit-line-clamp: 1;
    }
    
    .rm-resource-meta {
        margin-bottom: 6px;
    }
    
    .rm-category-tag {
        font-size: 9px;
        padding: 1px 4px;
    }
    
    .rm-tag {
        font-size: 8px;
        padding: 1px 3px;
    }
    
    .rm-resource-stats {
        margin-bottom: 8px;
    }
    
    .rm-stat {
        font-size: 9px;
    }
    
    .rm-resource-actions {
        flex-direction: column;
        gap: 4px;
    }
    
    .rm-copy-btn,
    .rm-download-btn,
    .rm-view-btn {
        flex: none;
        padding: 6px 8px;
        font-size: 9px;
        gap: 2px;
    }
    
    .rm-pagination {
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .rm-modal-content {
        margin: 10px;
        width: calc(100% - 20px);
    }
    
    .rm-message {
        right: 10px;
        left: 10px;
        transform: translateY(-100px);
    }
    
    .rm-message-show {
        transform: translateY(0);
    }
    
    /* 移动端帮助区域 */
    .rm-help-section {
        margin: 15px 0;
    }
    
    .rm-help-toggle {
        padding: 10px 14px;
    }
    
    .rm-help-text {
        font-size: 13px;
    }
    
    /* 移动端鼓励上传区域 */
    .rm-upload-encourage {
        margin: 0 0 15px 0;
        padding: 15px;
    }
    
    .rm-encourage-section h3 {
        font-size: 16px;
        margin-bottom: 10px;
    }
    
    .rm-encourage-section p {
        font-size: 13px;
        margin-bottom: 15px;
    }
    
    .rm-encourage-stats {
        gap: 10px;
    }
    
    .rm-stat-item {
        padding: 6px 12px;
        font-size: 12px;
    }
    
    /* 移动端快速提示 */
    .rm-quick-tips {
        padding: 15px;
    }
    
    .rm-quick-tips h4 {
        font-size: 14px;
        margin-bottom: 12px;
    }
    
    .rm-tips-grid {
        grid-template-columns: 1fr;
        gap: 8px;
    }
    
    .rm-tip-item {
        padding: 10px 12px;
        gap: 8px;
    }
    
    .rm-tip-icon {
        font-size: 16px;
        width: 25px;
    }
    
    .rm-tip-item strong {
        font-size: 13px;
    }
    
    .rm-tip-item {
        font-size: 12px;
    }
}

@media (max-width: 480px) {
    .rm-search-filters {
        padding: 15px;
    }
    
    .rm-resource-content {
        padding: 14px;
    }
    
    .rm-resource-title {
        font-size: 15px;
    }
    
    .rm-resource-description {
        font-size: 13px;
    }
    
    .rm-modal-header {
        padding: 16px 20px;
    }
    
    .rm-modal-body {
        padding: 20px;
    }
}

/* 平板设备 */
@media (min-width: 768px) and (max-width: 1024px) {
    .rm-grid-columns-3,
    .rm-grid-columns-4 {
        grid-template-columns: repeat(2, 1fr);
    }
    
    /* 平板端快速提示 */
    .rm-tips-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
    
    .rm-encourage-stats {
        gap: 15px;
    }
} 