/* 全局样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

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

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

/* 头部样式 */
.header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 20px 0;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

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

.logo h1 {
    font-size: 28px;
    margin-bottom: 5px;
}

.logo h1 a {
    color: white;
    text-decoration: none;
}

.logo .slogan {
    font-size: 14px;
    opacity: 0.9;
}

.nav {
    display: flex;
    gap: 20px;
}

.nav a {
    color: white;
    text-decoration: none;
    padding: 8px 16px;
    border-radius: 4px;
    transition: background 0.3s;
}

.nav a:hover {
    background: rgba(255, 255, 255, 0.2);
}

.nav a.active {
    background: rgba(255, 255, 255, 0.3);
}

/* 下拉菜单 */
.nav-dropdown {
    position: relative;
    display: inline-block;
}

.nav-dropbtn {
    cursor: pointer;
}

.nav-dropdown-content {
    display: none;
    position: absolute;
    background: white;
    min-width: 180px;
    box-shadow: 0 8px 16px rgba(0,0,0,0.2);
    border-radius: 4px;
    z-index: 1000;
    top: 100%;
    left: 0;
    margin-top: 5px;
}

.nav-dropdown-content a {
    color: #333 !important;
    padding: 12px 16px;
    text-decoration: none;
    display: block;
    transition: background 0.3s;
}

.nav-dropdown-content a:hover {
    background: #f5f5f5 !important;
    border-radius: 4px;
}

.nav-dropdown:hover .nav-dropdown-content {
    display: block;
}

/* 面包屑导航 */
.breadcrumb {
    background: white;
    padding: 15px 0;
    margin-bottom: 20px;
    border-bottom: 1px solid #eee;
}

.breadcrumb .container {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
}

.breadcrumb a {
    color: #667eea;
    text-decoration: none;
}

.breadcrumb a:hover {
    text-decoration: underline;
}

.breadcrumb .separator {
    color: #999;
}

.breadcrumb .current {
    color: #666;
}

.category-description {
    color: #666;
    font-size: 14px;
    margin-top: 10px;
}

/* 子分类导航 */
.sub-categories {
    margin: 20px 0;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
}

.sub-category-list {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
}

.sub-category-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
    background: white;
    border-radius: 6px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    transition: all 0.3s;
    text-decoration: none;
    color: #333;
}

.sub-category-item:hover {
    background: #667eea;
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

.sub-category-item.active {
    background: #667eea;
    color: white;
}

.sub-icon {
    font-size: 20px;
}

.sub-name {
    font-weight: 500;
}

/* Banner 图片展示区 */
.banner {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 0;
    position: relative;
    overflow: hidden;
}

.banner-container {
    position: relative;
    width: 100%;
}

.banner-slider {
    position: relative;
    width: 100%;
    height: 400px;
}

.banner-slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    transition: opacity 0.5s ease-in-out;
}

.banner-slide.active {
    opacity: 1;
}

.banner-image {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.banner-image img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.banner-placeholder {
    text-align: center;
    color: white;
}

.banner-icon {
    font-size: 80px;
    margin-bottom: 20px;
    opacity: 0.9;
}

.banner-text {
    font-size: 36px;
    font-weight: 700;
    margin-bottom: 15px;
}

.banner-subtitle {
    font-size: 18px;
    opacity: 0.8;
}

.banner-controls {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    gap: 15px;
    z-index: 10;
}

.banner-prev,
.banner-next {
    background: rgba(255, 255, 255, 0.3);
    color: white;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    font-size: 24px;
    cursor: pointer;
    transition: background 0.3s;
}

.banner-prev:hover,
.banner-next:hover {
    background: rgba(255, 255, 255, 0.5);
}

.banner-dots {
    display: flex;
    gap: 10px;
}

.dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.5);
    cursor: pointer;
    transition: background 0.3s;
}

.dot.active {
    background: white;
}

.dot:hover {
    background: rgba(255, 255, 255, 0.8);
}

/* 统计信息 */
.stats {
    background: white;
    padding: 30px 0;
    margin: 20px 0;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.stats .container {
    display: flex;
    justify-content: space-around;
    flex-wrap: wrap;
    gap: 20px;
}

.stat-item {
    text-align: center;
}

.stat-number {
    font-size: 36px;
    font-weight: 700;
    color: #667eea;
    margin-bottom: 10px;
}

.stat-label {
    font-size: 16px;
    color: #666;
}

/* 区块样式 */
.section {
    padding: 40px 0;
}

.section-alt {
    background: white;
}

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

.section-header h2 {
    font-size: 24px;
    color: #333;
}

.more-link {
    color: #667eea;
    text-decoration: none;
    font-size: 14px;
}

.more-link:hover {
    text-decoration: underline;
}

.total-count {
    color: #666;
    font-size: 14px;
}

/* 卡片网格 */
.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}

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

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

.card-image {
    height: 180px;
    background: #f0f0f0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.placeholder-image {
    color: #999;
    font-size: 16px;
}

.card-content {
    padding: 20px;
    text-align: center !important;
}

.card-link {
    display: block;
    text-decoration: none;
    color: inherit;
}

.card-link:hover .card {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.card-title {
    font-size: 18px;
    margin-bottom: 10px;
    color: #333;
    text-align: center !important;
}

.card-meta {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-bottom: 10px;
    font-size: 12px;
}

.version {
    background: #e3f2fd;
    color: #1976d2;
    padding: 3px 8px;
    border-radius: 3px;
}

.arch {
    background: #f3e5f5;
    color: #7b1fa2;
    padding: 3px 8px;
    border-radius: 3px;
}

.size {
    background: #e8f5e9;
    color: #388e3c;
    padding: 3px 8px;
    border-radius: 3px;
}

.card-desc {
    color: #666;
    font-size: 14px;
    margin-bottom: 15px;
    line-height: 1.5;
}

.card-footer {
    display: flex;
    justify-content: center;
    align-items: center;
    padding-top: 10px;
    border-top: 1px solid #f0f0f0;
    margin-top: 10px;
}

.download-count {
    color: #999;
    font-size: 12px;
}

/* 列表样式 */
.list {
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.list-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    border-bottom: 1px solid #eee;
}

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

.list-item:hover {
    background: #f9f9f9;
}

.list-item-title {
    font-size: 16px;
    color: #333;
}

.list-item-meta {
    display: flex;
    gap: 15px;
    font-size: 12px;
    color: #666;
    margin-top: 5px;
}

.list-item-actions {
    display: flex;
    align-items: center;
    gap: 15px;
}

/* 按钮样式 */
.btn {
    display: inline-block;
    padding: 10px 20px;
    border: none;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    text-align: center;
    transition: all 0.3s;
}

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

.btn-primary:hover {
    background: #5568d3;
}

.btn-secondary {
    background: #6c757d;
    color: white;
}

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

.btn-sm {
    padding: 5px 15px;
    font-size: 12px;
}

.btn-danger {
    background: #dc3545;
    color: white;
}

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

.btn-block {
    width: 100%;
}

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

.page-link {
    display: inline-block;
    padding: 8px 15px;
    background: white;
    color: #667eea;
    border-radius: 4px;
    text-decoration: none;
    transition: all 0.3s;
}

.page-link:hover {
    background: #667eea;
    color: white;
}

.page-link.active {
    background: #667eea;
    color: white;
}

/* 页脚样式 */
.footer {
    background: #333;
    color: white;
    padding: 30px 0;
    text-align: center;
}

.footer p {
    margin-bottom: 10px;
}

/* 空消息 */
.empty-message {
    text-align: center;
    color: #999;
    padding: 40px;
    font-size: 16px;
}

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

.login-container {
    width: 100%;
    max-width: 400px;
    padding: 20px;
}

.login-box {
    background: white;
    padding: 40px;
    border-radius: 8px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
}

.login-box h1 {
    font-size: 24px;
    color: #667eea;
    margin-bottom: 10px;
    text-align: center;
}

.login-box h2 {
    font-size: 18px;
    color: #666;
    margin-bottom: 30px;
    text-align: center;
}

.login-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.form-group {
    display: flex;
    flex-direction: column;
}

.form-group label {
    margin-bottom: 8px;
    font-weight: 600;
    color: #333;
}

.form-group input {
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

.form-group input:focus {
    outline: none;
    border-color: #667eea;
}

.login-footer {
    text-align: center;
    margin-top: 20px;
    color: #666;
    font-size: 12px;
}

.login-footer a {
    color: #667eea;
    text-decoration: none;
}

/* 管理后台样式 */
.admin-wrapper {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: 250px;
    background: #2c3e50;
    color: white;
    padding: 20px;
}

.sidebar-header {
    margin-bottom: 30px;
}

.sidebar-header h2 {
    font-size: 20px;
    margin-bottom: 5px;
}

.sidebar-header p {
    font-size: 14px;
    opacity: 0.8;
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.sidebar-nav a {
    color: white;
    text-decoration: none;
    padding: 12px 15px;
    border-radius: 4px;
    transition: background 0.3s;
}

.sidebar-nav a:hover {
    background: rgba(255, 255, 255, 0.1);
}

.sidebar-nav a.active {
    background: #667eea;
}

.admin-main {
    flex: 1;
    background: #f5f7fa;
}

.admin-header {
    background: white;
    padding: 20px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.admin-header h1 {
    font-size: 24px;
    color: #333;
}

.admin-user {
    color: #666;
    font-size: 14px;
}

.admin-content {
    padding: 30px;
}

.admin-section {
    background: white;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.admin-section h2 {
    font-size: 18px;
    margin-bottom: 20px;
    color: #333;
}

.admin-section-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 20px;
}

/* 统计卡片 */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

.stat-card {
    background: white;
    padding: 20px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 15px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.stat-icon {
    font-size: 32px;
}

.stat-value {
    font-size: 24px;
    font-weight: 700;
    color: #667eea;
}

.stat-label {
    font-size: 14px;
    color: #666;
}

/* 表格样式 */
.admin-table {
    width: 100%;
    border-collapse: collapse;
}

.admin-table th {
    background: #f8f9fa;
    padding: 12px;
    text-align: left;
    font-weight: 600;
    color: #333;
    border-bottom: 2px solid #dee2e6;
}

.admin-table td {
    padding: 12px;
    border-bottom: 1px solid #eee;
}

.admin-table tr:hover {
    background: #f9f9f9;
}

.empty-row {
    text-align: center;
    color: #999;
}

.status-badge {
    padding: 5px 10px;
    border-radius: 3px;
    font-size: 12px;
}

.status-badge.active {
    background: #d4edda;
    color: #155724;
}

.status-badge.inactive {
    background: #f8d7da;
    color: #721c24;
}

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

/* 表单样式 */
.admin-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
}

.form-group {
    display: flex;
    flex-direction: column;
}

.form-group label {
    margin-bottom: 8px;
    font-weight: 600;
    color: #333;
}

.form-group input,
.form-group select,
.form-group textarea {
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

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

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}

.checkbox-label input[type="checkbox"] {
    cursor: pointer;
}

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

/* 消息样式 */
.success-message {
    background: #d4edda;
    color: #155724;
    padding: 15px;
    border-radius: 4px;
    margin-bottom: 20px;
}

.error-message {
    background: #f8d7da;
    color: #721c24;
    padding: 15px;
    border-radius: 4px;
    margin-bottom: 20px;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .header .container {
        flex-direction: column;
        gap: 15px;
    }

    .nav {
        flex-wrap: wrap;
        justify-content: center;
    }

    .nav-dropdown {
        position: static;
        width: 100%;
    }

    .nav-dropdown-content {
        position: static;
        box-shadow: none;
        margin-top: 0;
        border-radius: 0;
    }

    .banner-slider {
        height: 300px;
    }

    .banner-icon {
        font-size: 60px;
    }

    .banner-text {
        font-size: 28px;
    }

    .banner-subtitle {
        font-size: 16px;
    }

    .banner-prev,
    .banner-next {
        width: 35px;
        height: 35px;
        font-size: 20px;
    }

    .stats .container {
        flex-direction: column;
    }

    .card-grid {
        grid-template-columns: 1fr;
    }

    .admin-wrapper {
        flex-direction: column;
    }

    .sidebar {
        width: 100%;
    }

    .sidebar-nav {
        flex-direction: row;
        flex-wrap: wrap;
    }

    .admin-section-grid {
        grid-template-columns: 1fr;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    .breadcrumb .container {
        flex-wrap: wrap;
    }
}