* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #0D2B5E;
    --secondary-color: #1A4A8A;
    --background-color: #E8F0FE;
    --text-color: #333;
    --text-light: #666;
    --white: #fff;
    --border-color: #ccc;
}

body {
    font-family: 'Microsoft YaHei', 'PingFang SC', Arial, sans-serif;
    background-color: var(--background-color);
    color: var(--text-color);
    line-height: 1.6;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

header {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: var(--white);
    padding: 20px 0;
    box-shadow: 0 2px 10px rgba(13, 43, 94, 0.3);
}

header .logo {
    font-size: 24px;
    font-weight: bold;
    text-decoration: none;
    color: var(--white);
}

header nav {
    float: right;
    margin-top: 5px;
}

header nav ul {
    list-style: none;
}

header nav ul li {
    display: inline-block;
    margin-left: 30px;
}

header nav ul li a {
    color: var(--white);
    text-decoration: none;
    font-size: 16px;
    transition: color 0.3s;
}

header nav ul li a:hover {
    color: #a8c5f0;
}

.search-box {
    margin: 20px 0;
    text-align: center;
}

.search-box input {
    width: 50%;
    padding: 12px 20px;
    border: 2px solid var(--secondary-color);
    border-radius: 25px;
    font-size: 16px;
    outline: none;
    transition: all 0.3s;
}

.search-box input:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 10px rgba(26, 74, 138, 0.3);
}

.search-box button {
    padding: 12px 30px;
    background-color: var(--primary-color);
    color: var(--white);
    border: none;
    border-radius: 25px;
    font-size: 16px;
    cursor: pointer;
    margin-left: 10px;
    transition: all 0.3s;
}

.search-box button:hover {
    background-color: var(--secondary-color);
    transform: translateY(-2px);
}

.category-section {
    margin-bottom: 40px;
}

.category-section h2 {
    color: var(--primary-color);
    font-size: 24px;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 3px solid var(--primary-color);
    display: inline-block;
}

.software-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}

.software-card {
    background: var(--white);
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 2px 15px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s, box-shadow 0.3s;
    cursor: pointer;
}

.software-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 25px rgba(13, 43, 94, 0.2);
}

.software-card img {
    width: 64px;
    height: 64px;
    border-radius: 8px;
    margin-bottom: 15px;
}

.software-card h3 {
    color: var(--primary-color);
    font-size: 18px;
    margin-bottom: 10px;
}

.software-card p {
    color: var(--text-light);
    font-size: 14px;
    margin-bottom: 15px;
    height: 42px;
    overflow: hidden;
}

.download-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.download-btn {
    flex: 1;
    min-width: 80px;
    padding: 8px 12px;
    border: none;
    border-radius: 6px;
    font-size: 12px;
    cursor: pointer;
    text-decoration: none;
    text-align: center;
    display: inline-block;
    transition: all 0.3s;
}

.btn-baidu {
    background-color: #231266;
    color: var(--white);
}

.btn-baidu:hover {
    background-color: #1a0d4d;
}

.btn-quark {
    background-color: #1e88e5;
    color: var(--white);
}

.btn-quark:hover {
    background-color: #1565c0;
}

.btn-xunlei {
    background-color: #ff6600;
    color: var(--white);
}

.btn-xunlei:hover {
    background-color: #e65c00;
}

footer {
    background: var(--primary-color);
    color: var(--white);
    text-align: center;
    padding: 30px 0;
    margin-top: 50px;
}

footer p {
    margin-bottom: 10px;
}

footer a {
    color: #a8c5f0;
    text-decoration: none;
}

footer a:hover {
    text-decoration: underline;
}

.admin-link {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background-color: var(--primary-color);
    color: var(--white);
    padding: 12px 24px;
    border-radius: 25px;
    text-decoration: none;
    box-shadow: 0 4px 15px rgba(13, 43, 94, 0.4);
    transition: all 0.3s;
}

.admin-link:hover {
    background-color: var(--secondary-color);
    transform: translateY(-2px);
}

.detail-container {
    max-width: 800px;
    margin: 30px auto;
    background: var(--white);
    border-radius: 12px;
    padding: 30px;
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.1);
}

.detail-header {
    display: flex;
    align-items: flex-start;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid var(--background-color);
}

.detail-header img {
    width: 120px;
    height: 120px;
    border-radius: 12px;
    margin-right: 25px;
}

.detail-info h1 {
    color: var(--primary-color);
    font-size: 32px;
    margin-bottom: 15px;
}

.detail-info p {
    color: var(--text-light);
    font-size: 16px;
    margin-bottom: 10px;
}

.qr-code-section {
    background: var(--background-color);
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 30px;
    text-align: center;
}

.qr-code-section img {
    max-width: 200px;
    margin: 10px 0;
}

.download-section h3 {
    color: var(--primary-color);
    font-size: 20px;
    margin-bottom: 20px;
}

.download-section .download-btn {
    padding: 12px 30px;
    font-size: 16px;
    margin-right: 15px;
    margin-bottom: 15px;
}

.login-container {
    max-width: 400px;
    margin: 100px auto;
    background: var(--white);
    border-radius: 12px;
    padding: 40px;
    box-shadow: 0 5px 30px rgba(13, 43, 94, 0.2);
}

.login-container h2 {
    color: var(--primary-color);
    text-align: center;
    margin-bottom: 30px;
    font-size: 28px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    color: var(--primary-color);
    margin-bottom: 8px;
    font-weight: bold;
}

.form-group input {
    width: 100%;
    padding: 12px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 16px;
    outline: none;
    transition: border-color 0.3s;
}

.form-group input:focus {
    border-color: var(--secondary-color);
}

.login-btn {
    width: 100%;
    padding: 15px;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: var(--white);
    border: none;
    border-radius: 8px;
    font-size: 18px;
    cursor: pointer;
    transition: all 0.3s;
}

.login-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(13, 43, 94, 0.3);
}

.admin-layout {
    display: flex;
    min-height: 100vh;
}

.admin-sidebar {
    width: 250px;
    background: linear-gradient(180deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: var(--white);
    padding: 20px 0;
    position: fixed;
    height: 100%;
    overflow-y: auto;
}

.admin-sidebar .logo {
    font-size: 20px;
    font-weight: bold;
    padding: 0 20px;
    margin-bottom: 30px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding-bottom: 20px;
}

.admin-sidebar ul {
    list-style: none;
}

.admin-sidebar ul li {
    margin-bottom: 5px;
}

.admin-sidebar ul li a {
    display: block;
    color: var(--white);
    text-decoration: none;
    padding: 12px 20px;
    transition: background-color 0.3s;
}

.admin-sidebar ul li a:hover,
.admin-sidebar ul li a.active {
    background-color: rgba(255, 255, 255, 0.1);
}

.admin-content {
    margin-left: 250px;
    flex: 1;
    padding: 30px;
    background-color: var(--background-color);
}

.admin-content h2 {
    color: var(--primary-color);
    margin-bottom: 25px;
    font-size: 24px;
}

.table {
    width: 100%;
    border-collapse: collapse;
    background: var(--white);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.table th,
.table td {
    padding: 15px;
    text-align: left;
    border-bottom: 1px solid var(--background-color);
}

.table th {
    background-color: var(--primary-color);
    color: var(--white);
    font-weight: bold;
}

.table tr:hover {
    background-color: rgba(26, 74, 138, 0.05);
}

.action-buttons {
    display: flex;
    gap: 8px;
}

.action-btn {
    padding: 6px 12px;
    border: none;
    border-radius: 4px;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.3s;
    text-decoration: none;
}

.btn-edit {
    background-color: #4CAF50;
    color: var(--white);
}

.btn-edit:hover {
    background-color: #45a049;
}

.btn-delete {
    background-color: #f44336;
    color: var(--white);
}

.btn-delete:hover {
    background-color: #d32f2f;
}

.btn-toggle {
    background-color: #ff9800;
    color: var(--white);
}

.btn-toggle:hover {
    background-color: #f57c00;
}

.btn-add {
    display: inline-block;
    padding: 10px 20px;
    background-color: var(--primary-color);
    color: var(--white);
    border: none;
    border-radius: 6px;
    font-size: 16px;
    cursor: pointer;
    text-decoration: none;
    margin-bottom: 20px;
    transition: all 0.3s;
}

.btn-add:hover {
    background-color: var(--secondary-color);
}

.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: var(--white);
    border-radius: 12px;
    padding: 30px;
    width: 90%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
}

.modal-content h3 {
    color: var(--primary-color);
    margin-bottom: 20px;
    font-size: 22px;
}

.form-group select {
    width: 100%;
    padding: 12px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 16px;
    outline: none;
    transition: border-color 0.3s;
}

.form-group select:focus {
    border-color: var(--secondary-color);
}

.form-group textarea {
    width: 100%;
    padding: 12px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 16px;
    outline: none;
    transition: border-color 0.3s;
    resize: vertical;
    min-height: 100px;
}

.form-group textarea:focus {
    border-color: var(--secondary-color);
}

.modal-buttons {
    display: flex;
    justify-content: flex-end;
    gap: 15px;
    margin-top: 30px;
}

.modal-buttons button {
    padding: 12px 25px;
    border: none;
    border-radius: 6px;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-save {
    background-color: var(--primary-color);
    color: var(--white);
}

.btn-save:hover {
    background-color: var(--secondary-color);
}

.btn-cancel {
    background-color: #ccc;
    color: var(--text-color);
}

.btn-cancel:hover {
    background-color: #bbb;
}

.stats-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: var(--white);
    border-radius: 12px;
    padding: 25px;
    box-shadow: 0 2px 15px rgba(0, 0, 0, 0.1);
}

.stat-card h4 {
    color: var(--text-light);
    font-size: 16px;
    margin-bottom: 10px;
}

.stat-card .number {
    color: var(--primary-color);
    font-size: 36px;
    font-weight: bold;
}

.pagination {
    margin-top: 20px;
    text-align: center;
}

.pagination a {
    display: inline-block;
    padding: 8px 16px;
    margin: 0 5px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    text-decoration: none;
    color: var(--primary-color);
    transition: all 0.3s;
}

.pagination a:hover,
.pagination a.active {
    background-color: var(--primary-color);
    color: var(--white);
    border-color: var(--primary-color);
}

.status-badge {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: bold;
}

.status-online {
    background-color: #4CAF50;
    color: var(--white);
}

.status-offline {
    background-color: #f44336;
    color: var(--white);
}

.file-upload {
    border: 2px dashed var(--border-color);
    border-radius: 8px;
    padding: 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
}

.file-upload:hover {
    border-color: var(--secondary-color);
    background-color: rgba(26, 74, 138, 0.05);
}

.file-upload input[type="file"] {
    display: none;
}

.file-upload label {
    cursor: pointer;
    color: var(--primary-color);
    font-weight: bold;
}

.toast {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 15px 25px;
    border-radius: 8px;
    color: var(--white);
    font-size: 16px;
    z-index: 2000;
    animation: fadeIn 0.3s, fadeOut 0.3s 2.7s;
}

.toast.success {
    background-color: #4CAF50;
}

.toast.error {
    background-color: #f44336;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateX(100px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes fadeOut {
    from {
        opacity: 1;
        transform: translateX(0);
    }
    to {
        opacity: 0;
        transform: translateX(100px);
    }
}

@media (max-width: 768px) {
    header nav ul li {
        margin-left: 15px;
    }

    .search-box input {
        width: 80%;
        margin-bottom: 10px;
    }

    .search-box button {
        width: 80%;
        margin-left: 0;
    }

    .software-grid {
        grid-template-columns: 1fr;
    }

    .admin-sidebar {
        width: 100%;
        height: auto;
        position: relative;
    }

    .admin-content {
        margin-left: 0;
    }

    .detail-header {
        flex-direction: column;
        text-align: center;
    }

    .detail-header img {
        margin: 0 auto 20px;
    }
}