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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f8f9fa;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* 导航栏样式 */
.navbar {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 1rem 0;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    position: fixed;
    width: 100%;
    top: 0;
    z-index: 1000;
}

.navbar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-brand {
    display: flex;
    align-items: center;
    color: white;
    text-decoration: none;
}

.nav-brand i {
    font-size: 1.5rem;
    margin-right: 10px;
}

.nav-brand h1 {
    font-size: 1.5rem;
    font-weight: 600;
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 2rem;
}

.nav-link {
    color: white;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s ease;
}

.nav-link:hover,
.nav-link.active {
    color: #ffd700;
}

.nav-toggle {
    display: none;
    flex-direction: column;
    cursor: pointer;
}

.nav-toggle span {
    width: 25px;
    height: 3px;
    background: white;
    margin: 3px 0;
    transition: 0.3s;
}

/* 主要内容区域 */
main {
    margin-top: 80px;
}

/* 简化的搜索区域样式 */
.hero-compact {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 60px 0;
    text-align: center;
}

.search-section h2 {
    font-size: 2rem;
    margin-bottom: 1.5rem;
    font-weight: 600;
}

.search-box-compact {
    display: inline-flex;
    max-width: 500px;
    width: 100%;
    background: white;
    border-radius: 30px;
    overflow: hidden;
    box-shadow: 0 5px 20px rgba(0,0,0,0.1);
}

.search-box-compact input {
    flex: 1;
    border: none;
    padding: 12px 20px;
    font-size: 1rem;
    outline: none;
    color: #333;
}

.search-box-compact button {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    color: white;
    padding: 12px 20px;
    cursor: pointer;
    transition: opacity 0.3s ease;
}

.search-box-compact button:hover {
    opacity: 0.9;
}

/* 软件列表区域 */
.software-section {
    padding: 2rem 0;
    min-height: 60vh;
}

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

.section-header h2 {
    font-size: 2rem;
    color: #2c3e50;
}

.sort-options select {
    padding: 0.5rem 1rem;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    font-size: 1rem;
    outline: none;
    cursor: pointer;
}

.software-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.software-card {
    background: white;
    border-radius: 15px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.08);
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    cursor: pointer;
}

.software-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0,0,0,0.15);
}

.software-card-header {
    display: flex;
    align-items: center;
    padding: 1.5rem;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
}

.software-icon {
    width: 50px;
    height: 50px;
    border-radius: 10px;
    margin-right: 1rem;
    background: #667eea;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.5rem;
}

.software-info h3 {
    font-size: 1.2rem;
    color: #2c3e50;
    margin-bottom: 0.25rem;
}

.software-info .developer {
    color: #7f8c8d;
    font-size: 0.9rem;
}

.software-card-body {
    padding: 1.5rem;
}

.software-description {
    color: #555;
    margin-bottom: 1rem;
    line-height: 1.5;
}

.software-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 1rem;
    border-top: 1px solid #e9ecef;
}

.version-info {
    display: flex;
    flex-direction: column;
}

.version-number {
    font-weight: 600;
    color: #2c3e50;
}

.release-date {
    font-size: 0.8rem;
    color: #7f8c8d;
}

.download-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 0.6rem 1.2rem;
    border-radius: 20px;
    cursor: pointer;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    transition: transform 0.3s ease;
}

.download-btn:hover {
    transform: scale(1.05);
}

.download-btn i {
    margin-left: 0.5rem;
}

.software-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 1rem;
}

.tag {
    background: #e3f2fd;
    color: #1976d2;
    padding: 0.25rem 0.75rem;
    border-radius: 15px;
    font-size: 0.8rem;
    font-weight: 500;
}

.popularity {
    display: flex;
    align-items: center;
    margin-top: 0.5rem;
}

.popularity i {
    color: #ffc107;
    margin-right: 0.25rem;
}

.popularity-score {
    font-weight: 600;
    color: #2c3e50;
    margin-left: 0.5rem;
}

.load-more {
    text-align: center;
    margin-top: 2rem;
}

.load-more button {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 1rem 2rem;
    border-radius: 25px;
    cursor: pointer;
    font-size: 1rem;
    transition: transform 0.3s ease;
}

.load-more button:hover {
    transform: translateY(-2px);
}

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

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal-content {
    background-color: white;
    margin: 2% auto;
    padding: 0;
    border-radius: 15px;
    width: 90%;
    max-width: 800px;
    max-height: 90vh;
    overflow-y: auto;
    animation: slideIn 0.3s ease;
}

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

.close {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    padding: 1rem 1.5rem 0 0;
    cursor: pointer;
}

.close:hover {
    color: #000;
}

/* 模态框内容样式 */
.modal-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 2rem;
    border-radius: 15px 15px 0 0;
}

.modal-header-content {
    display: flex;
    align-items: center;
}

.modal-icon {
    width: 60px;
    height: 60px;
    border-radius: 15px;
    background: white;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #667eea;
    font-size: 2rem;
    margin-right: 1.5rem;
}

.modal-title h2 {
    font-size: 1.8rem;
    margin-bottom: 0.5rem;
}

.modal-title .developer {
    opacity: 0.9;
    font-size: 1rem;
}

.modal-body {
    padding: 2rem;
}

.version-details {
    background: #f8f9fa;
    padding: 1.5rem;
    border-radius: 10px;
    margin-bottom: 2rem;
}

.version-details h3 {
    color: #2c3e50;
    margin-bottom: 1rem;
}

.version-meta {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 1rem;
}

.version-meta-item {
    display: flex;
    align-items: center;
}

.version-meta-item i {
    color: #667eea;
    margin-right: 0.5rem;
    width: 20px;
}

.version-meta-item strong {
    color: #2c3e50;
    margin-right: 0.5rem;
}

.changelog {
    margin-bottom: 2rem;
}

.changelog h3 {
    color: #2c3e50;
    margin-bottom: 1rem;
}

.changelog ul {
    list-style: none;
}

.changelog li {
    padding: 0.5rem 0;
    border-bottom: 1px solid #e9ecef;
    position: relative;
    padding-left: 2rem;
}

.changelog li:before {
    content: "✓";
    color: #27ae60;
    position: absolute;
    left: 0;
    font-weight: bold;
}

.use-cases {
    margin-bottom: 2rem;
}

.use-cases h3 {
    color: #2c3e50;
    margin-bottom: 1rem;
}

.use-cases-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
}

.use-case-item {
    background: #e3f2fd;
    padding: 1rem;
    border-radius: 10px;
    text-align: center;
    color: #1976d2;
    font-weight: 500;
}

.download-section {
    text-align: center;
    padding: 2rem;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    border-radius: 10px;
}

.download-section h3 {
    color: #2c3e50;
    margin-bottom: 1rem;
}

.download-section p {
    color: #555;
    margin-bottom: 1.5rem;
}

.platform-downloads {
    display: flex;
    justify-content: center;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 1.5rem;
}

.platform-btn {
    background: white;
    border: 2px solid #667eea;
    color: #667eea;
    padding: 0.8rem 1.5rem;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s ease;
}

.platform-btn:hover {
    background: #667eea;
    color: white;
}

.primary-download {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 1rem 2rem;
    border: none;
    border-radius: 25px;
    font-size: 1.1rem;
    cursor: pointer;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    transition: transform 0.3s ease;
}

.primary-download:hover {
    transform: scale(1.05);
    color: white;
}

.primary-download i {
    margin-left: 0.5rem;
}

/* 页脚样式 */
.footer {
    background: #2c3e50;
    color: white;
    padding: 3rem 0 1rem;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.footer-section h3 {
    margin-bottom: 1rem;
    color: #ecf0f1;
}

.footer-section ul {
    list-style: none;
}

.footer-section ul li {
    margin-bottom: 0.5rem;
}

.footer-section a {
    color: #bdc3c7;
    text-decoration: none;
    transition: color 0.3s ease;
}

.footer-section a:hover {
    color: white;
}

.footer-bottom {
    text-align: center;
    padding-top: 1rem;
    border-top: 1px solid #34495e;
    color: #bdc3c7;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .nav-menu {
        position: fixed;
        left: -100%;
        top: 70px;
        flex-direction: column;
        background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
        width: 100%;
        text-align: center;
        transition: 0.3s;
        box-shadow: 0 10px 27px rgba(0,0,0,0.05);
        padding: 2rem 0;
    }

    .nav-menu.active {
        left: 0;
    }

    .nav-toggle {
        display: flex;
    }

    .hero-content h2 {
        font-size: 2rem;
    }

    .software-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .section-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }

    .filter-tabs {
        flex-wrap: nowrap;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .modal-content {
        width: 95%;
        margin: 5% auto;
        max-height: 95vh;
    }

    .platform-downloads {
        flex-direction: column;
    }

    .version-meta {
        grid-template-columns: 1fr;
    }

    .use-cases-grid {
        grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    }
}

@media (max-width: 480px) {
    .hero {
        padding: 60px 0;
    }

    .hero-content h2 {
        font-size: 1.5rem;
    }

    .hero-content p {
        font-size: 1rem;
    }

    .search-box {
        flex-direction: column;
        border-radius: 10px;
    }

    .search-box input {
        border-radius: 10px 10px 0 0;
    }

    .search-box button {
        border-radius: 0 0 10px 10px;
    }

    .software-card-header {
        padding: 1rem;
    }

    .software-card-body {
        padding: 1rem;
    }

    .modal-header,
    .modal-body {
        padding: 1.5rem;
    }
}

/* 版本管理样式 */
.version-management {
    padding: 2rem;
}

.version-management h3 {
    color: #2c3e50;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.version-list {
    margin-bottom: 2rem;
}

.version-item {
    background: #f8f9fa;
    padding: 1.5rem;
    border-radius: 10px;
    margin-bottom: 1rem;
    border-left: 4px solid #667eea;
}

.version-item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.version-info {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.version-number {
    font-weight: bold;
    color: #2c3e50;
}

.version-date {
    color: #7f8c8d;
    font-size: 0.9rem;
}

.version-size {
    color: #555;
    font-size: 0.9rem;
}

.version-actions {
    display: flex;
    gap: 0.5rem;
}

.version-btn {
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

.edit-btn {
    background: #3498db;
    color: white;
}

.edit-btn:hover {
    background: #2980b9;
}

.delete-btn {
    background: #e74c3c;
    color: white;
}

.delete-btn:hover {
    background: #c0392b;
}

.add-version-btn {
    background: linear-gradient(135deg, #27ae60 0%, #2ecc71 100%);
    color: white;
    padding: 1rem 2rem;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: transform 0.3s ease;
}

.add-version-btn:hover {
    transform: translateY(-2px);
}

/* 上传表单样式 */
.upload-form {
    padding: 2rem;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: #2c3e50;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 0.8rem;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    font-size: 1rem;
    outline: none;
    transition: border-color 0.3s ease;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    border-color: #667eea;
}

.form-group textarea {
    resize: vertical;
    min-height: 100px;
}

.file-upload {
    position: relative;
    display: inline-block;
    width: 100%;
}

.file-upload input[type="file"] {
    position: absolute;
    opacity: 0;
    width: 100%;
    height: 100%;
    cursor: pointer;
}

.file-upload-label {
    display: block;
    padding: 2rem;
    border: 2px dashed #667eea;
    border-radius: 8px;
    text-align: center;
    color: #667eea;
    cursor: pointer;
    transition: all 0.3s ease;
}

.file-upload-label:hover {
    background: #f8f9fa;
}

.file-upload-label i {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.upload-progress {
    margin-top: 1rem;
    display: none;
}

.progress-bar {
    width: 100%;
    height: 10px;
    background: #e9ecef;
    border-radius: 5px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    width: 0%;
    transition: width 0.3s ease;
}

.form-actions {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
    margin-top: 2rem;
}

.btn {
    padding: 0.8rem 1.5rem;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1rem;
    transition: all 0.3s ease;
}

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

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

.btn-secondary {
    background: #e9ecef;
    color: #333;
}

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

/* 移动端优化 */
@media (max-width: 768px) {
    .version-item-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }

    .version-actions {
        width: 100%;
    }

    .form-actions {
        flex-direction: column;
    }

    .btn {
        width: 100%;
    }
}

/* 管理员登录样式 */
.admin-login {
    max-width: 400px;
    margin: 2rem auto;
    padding: 2rem;
    background: white;
    border-radius: 10px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.1);
}

.admin-login h3 {
    text-align: center;
    margin-bottom: 1.5rem;
    color: #2c3e50;
}

/* 提示消息样式 */
.notification {
    position: fixed;
    top: 100px;
    right: 20px;
    padding: 1rem 1.5rem;
    border-radius: 8px;
    color: white;
    font-weight: 500;
    z-index: 3000;
    animation: slideInRight 0.3s ease;
    display: none;
}

.notification.success {
    background: linear-gradient(135deg, #27ae60 0%, #2ecc71 100%);
}

.notification.error {
    background: linear-gradient(135deg, #e74c3c 0%, #c0392b 100%);
}

.notification.warning {
    background: linear-gradient(135deg, #f39c12 0%, #e67e22 100%);
}