/* assets/css/style.css */
/* 全局样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Microsoft YaHei', Arial, sans-serif;
}

body {
    background-color: #f5f7fa;
    color: #333;
    line-height: 1.6;
}

a {
    text-decoration: none;
    color: #3498db;
    transition: color 0.3s;
}

a:hover {
    color: #2980b9;
}

.container {
    width: 1200px;
    max-width: 100%;
    margin: 0 auto;
    padding: 0 15px;
}

/* 导航栏样式 */
header {
    background-color: #2c3e50;
    color: white;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 0;
}

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

.logo span {
    color: #3498db;
}

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

.nav-item {
    position: relative;
    margin: 0 15px;
}

.nav-link {
    color: white;
    padding: 10px 0;
    font-weight: 500;
}

.dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    background-color: white;
    min-width: 200px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    border-radius: 4px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: all 0.3s;
    z-index: 1001;
}

.nav-item:hover .dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-item {
    display: block;
    padding: 10px 15px;
    color: #333;
    border-bottom: 1px solid #eee;
}

.dropdown-item:hover {
    background-color: #f8f9fa;
}

.nav-actions {
    display: flex;
    align-items: center;
}

.search-box {
    position: relative;
    margin-right: 20px;
}

.search-input {
    padding: 8px 15px;
    border: none;
    border-radius: 20px;
    width: 200px;
    outline: none;
}

.search-btn {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #7f8c8d;
    cursor: pointer;
}

.auth-buttons a {
    color: white;
    margin-left: 15px;
    padding: 8px 15px;
    border-radius: 4px;
}

.login-btn {
    background-color: transparent;
    border: 1px solid #3498db;
}

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

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

.section-title {
    font-size: 24px;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid #3498db;
    display: inline-block;
}

/* 修改后的软件网格布局 - 每行显示8个 */
.software-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 15px;
    margin-bottom: 30px;
}

.software-card {
    background-color: white;
    border-radius: 6px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    transition: transform 0.3s, box-shadow 0.3s;
}

.software-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.software-img {
    width: 180px;  /* 改为固定宽度180px */
    height: 120px;  /* 保持固定高度120px */
    object-fit: contain;  /* 改为contain，保持比例不裁剪 */
    background-color: #f8f9fa;
}

.software-info {
    padding: 12px;
}

.software-name {
    font-size: 14px;
    margin-bottom: 6px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.software-meta {
    display: flex;
    justify-content: space-between;
    color: #7f8c8d;
    font-size: 12px;
    margin-bottom: 8px;
}

.software-desc {
    color: #555;
    font-size: 12px;
    line-height: 1.4;
    height: 34px;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.download-btn {
    display: block;
    text-align: center;
    background-color: #3498db;
    color: white;
    padding: 8px;
    border-radius: 4px;
    margin-top: 10px;
    font-weight: 500;
    font-size: 12px;
    transition: background-color 0.3s;
}

.download-btn:hover {
    background-color: #2980b9;
    color: white;
}

/* 软件详情页样式 */
.software-detail {
    background: white;
    border-radius: 8px;
    padding: 30px;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.08);
    margin-bottom: 30px;
}

.software-header {
    display: flex;
    margin-bottom: 30px;
}

.software-icon {
    width: 120px;
    height: 120px;
    object-fit: cover;
    border-radius: 8px;
    margin-right: 30px;
}

.software-basic-info {
    flex: 1;
}

.software-title {
    font-size: 28px;
    margin-bottom: 10px;
    color: #2c3e50;
}

.software-meta-detail {
    display: flex;
    gap: 20px;
    margin-bottom: 15px;
    color: #7f8c8d;
}

.software-actions {
    margin-top: 20px;
}

.btn-primary {
    background: #3498db;
    color: white;
    padding: 12px 30px;
    border: none;
    border-radius: 4px;
    font-size: 16px;
    cursor: pointer;
    transition: background 0.3s;
}

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

.software-content {
    border-top: 1px solid #eee;
    padding-top: 20px;
}

.content-section {
    margin-bottom: 25px;
}

.content-section h3 {
    margin-bottom: 10px;
    color: #2c3e50;
}

/* 分类页面样式 */
.category-header {
    background: white;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 30px;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.08);
}

.category-title {
    font-size: 24px;
    color: #2c3e50;
    margin-bottom: 10px;
}

.category-description {
    color: #7f8c8d;
}

/* 搜索页面样式 */
.search-results {
    background: white;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 30px;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.08);
}

.search-info {
    margin-bottom: 20px;
}

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

.form-label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
    color: #2c3e50;
}

.form-control {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

.form-control:focus {
    border-color: #3498db;
    outline: none;
}

/* 页脚样式 */
footer {
    background-color: #2c3e50;
    color: #ecf0f1;
    padding: 40px 0 20px;
}

.footer-content {
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    margin-bottom: 30px;
}

.footer-column {
    flex: 1;
    min-width: 200px;
    margin-bottom: 20px;
}

.footer-column h3 {
    font-size: 18px;
    margin-bottom: 20px;
    color: #3498db;
}

.footer-links {
    list-style: none;
}

.footer-links li {
    margin-bottom: 10px;
}

.footer-links a {
    color: #bdc3c7;
}

.footer-links a:hover {
    color: #3498db;
}

.copyright {
    text-align: center;
    padding-top: 20px;
    border-top: 1px solid #34495e;
    color: #95a5a6;
    font-size: 14px;
}

/* 消息提示样式 */
.alert {
    padding: 15px;
    margin-bottom: 20px;
    border: 1px solid transparent;
    border-radius: 4px;
}

.alert-success {
    color: #155724;
    background-color: #d4edda;
    border-color: #c3e6cb;
}

.alert-error {
    color: #721c24;
    background-color: #f8d7da;
    border-color: #f5c6cb;
}

.alert-warning {
    color: #856404;
    background-color: #fff3cd;
    border-color: #ffeaa7;
}

/* 分页样式 */
.pagination {
    display: flex;
    justify-content: center;
    list-style: none;
    margin: 30px 0;
}

.pagination li {
    margin: 0 5px;
}

.pagination a {
    display: block;
    padding: 8px 15px;
    border: 1px solid #ddd;
    border-radius: 4px;
    color: #3498db;
}

.pagination a:hover {
    background: #f8f9fa;
}

.pagination .active a {
    background: #3498db;
    color: white;
    border-color: #3498db;
}

/* 权限提示样式 */
.access-denied {
    text-align: center;
    padding: 50px 20px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.08);
}

.access-denied h2 {
    color: #e74c3c;
    margin-bottom: 15px;
}

.access-denied p {
    color: #7f8c8d;
    margin-bottom: 20px;
}

/* 响应式设计 - 软件网格 */
@media (max-width: 768px) {
    .software-grid {
        grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    }
}

@media (max-width: 992px) {
    .nav-menu {
        display: none;
    }
    
    .software-grid {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    }
    
    .software-header {
        flex-direction: column;
        text-align: center;
    }
    
    .software-icon {
        margin-right: 0;
        margin-bottom: 20px;
    }
}

@media (max-width: 768px) {
    .nav-actions {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .search-box {
        margin-bottom: 10px;
        margin-right: 0;
    }
    
    .search-input {
        width: 180px;
    }
    
    .software-grid {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
        gap: 10px;
    }
    
    .software-img {
        height: 150px;
    }
    
    .software-info {
        padding: 8px;
    }
    
    .footer-content {
        flex-direction: column;
    }
    
    .footer-column {
        min-width: 100%;
    }
}