* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
}

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

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

a {
    text-decoration: none;
    color: #333;
}

img {
    max-width: 100%;
    height: auto;
}

.btn {
    display: inline-block;
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s;
}

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

.btn-primary:hover {
    background-color: #c0392b;
}

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

.btn-danger:hover {
    background-color: #d32f2f;
}

.btn-warning {
    background-color: #ff9800;
    color: white;
}

.btn-warning:hover {
    background-color: #f57c00;
}

.btn-secondary {
    background-color: #607d8b;
    color: white;
}

.btn-secondary:hover {
    background-color: #455a64;
}

.btn-sm {
    padding: 5px 10px;
    font-size: 0.875rem;
}

.btn-block {
    width: 100%;
}

.card {
    background: white;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    overflow: hidden;
}

.card-header {
    padding: 15px;
    border-bottom: 1px solid #eee;
    background-color: #fafafa;
}

.card-body {
    padding: 15px;
}

.form-group {
    margin-bottom: 15px;
}

.form-label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
}

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

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

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

.text-right {
    text-align: right;
}

.text-muted {
    color: #666;
}

.text-success {
    color: #e74c3c;
}

.text-danger {
    color: #f44336;
}

.mt-1 { margin-top: 5px; }
.mt-2 { margin-top: 10px; }
.mt-3 { margin-top: 15px; }
.mt-4 { margin-top: 20px; }
.mb-1 { margin-bottom: 5px; }
.mb-2 { margin-bottom: 10px; }
.mb-3 { margin-bottom: 15px; }
.mb-4 { margin-bottom: 20px; }
.p-1 { padding: 5px; }
.p-2 { padding: 10px; }
.p-3 { padding: 15px; }
.p-4 { padding: 20px; }

.badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 0.75rem;
}

.badge-success {
    background-color: #e8f5e9;
    color: #2e7d32;
}

.badge-danger {
    background-color: #ffebee;
    color: #c62828;
}

.category-filter {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
}

.category-tag {
    display: inline-flex;
    align-items: center;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 0.9rem;
    background-color: #f0f0f0;
    color: #666;
    transition: all 0.3s;
}

.category-tag:hover {
    background-color: #e0e0e0;
}

.category-tag.active {
    background-color: #e74c3c;
    color: white;
}

.alert {
    padding: 15px;
    border-radius: 5px;
    margin-bottom: 15px;
}

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

.alert-danger {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.alert-warning {
    background-color: #fff3cd;
    color: #856404;
    border: 1px solid #ffeeba;
}

header {
    background-color: #fff;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    position: sticky;
    top: 0;
    z-index: 100;
}

header .logo {
    font-size: 1.5rem;
    font-weight: 700;
    color: #e74c3c;
}

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

header .menu {
    display: flex;
    list-style: none;
    gap: 20px;
}

header .menu a {
    color: #666;
    transition: color 0.3s;
}

header .menu a:hover {
    color: #e74c3c;
}

header .menu a.active {
    color: #e74c3c;
    font-weight: bold;
}

header .search-bar {
    display: flex;
    gap: 10px;
}

header .search-bar input {
    padding: 8px 15px;
    border: 1px solid #ddd;
    border-radius: 20px;
    outline: none;
}

header .search-bar button {
    padding: 8px 15px;
    background-color: #e74c3c;
    color: white;
    border: none;
    border-radius: 20px;
    cursor: pointer;
}

.hero {
    background: linear-gradient(135deg, #e74c3c 0%, #c0392b 100%);
    color: white;
    padding: 40px 0;
    text-align: center;
}

.hero h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
}

.hero p {
    font-size: 1.1rem;
    opacity: 0.9;
}

.category-list {
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 12px;
    padding: 20px 0;
    width: 100%;
}

.category-item {
    flex: 0 0 auto;
    background: white;
    padding: 12px 22px;
    border-radius: 30px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    cursor: pointer;
    transition: transform 0.3s;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
}

.category-item:hover {
    transform: translateY(-2px);
}

.category-item.active {
    background-color: #e74c3c;
    color: white;
}

.app-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
    padding: 20px 0;
}

.app-card {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 15px rgba(0,0,0,0.08);
    transition: transform 0.3s, box-shadow 0.3s;
}

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

.app-card .app-icon {
    width: 100%;
    height: 180px;
    background-color: #f8f9fa;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 4rem;
}

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

.app-card .app-info {
    padding: 15px;
}

.app-card .app-info h3 {
    font-size: 1.1rem;
    margin-bottom: 5px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.app-card .app-info .app-meta {
    display: flex;
    justify-content: space-between;
    font-size: 0.875rem;
    color: #666;
}

.app-card .app-info .app-actions {
    margin-top: 15px;
    display: flex;
    gap: 10px;
}

.app-card .app-info .download-btn {
    flex: 1;
    background-color: #e74c3c;
    color: white;
    text-align: center;
    padding: 10px;
    border-radius: 8px;
    transition: background-color 0.3s;
}

.app-card .app-info .download-btn:hover {
    background-color: #c0392b;
}

.app-card .app-info .detail-btn {
    flex: 1;
    background-color: #f0f0f0;
    color: #666;
    text-align: center;
    padding: 10px;
    border-radius: 8px;
    border: 1px solid #ddd;
    transition: all 0.3s;
}

.app-card .app-info .detail-btn:hover {
    background-color: #e8e8e8;
    color: #333;
}

.app-detail {
    padding: 30px 0;
}

.app-detail-header {
    display: flex;
    gap: 30px;
    margin-bottom: 30px;
}

.app-detail-header .app-icon-large {
    width: 150px;
    height: 150px;
    background-color: #f8f9fa;
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 6rem;
    flex-shrink: 0;
}

.app-detail-header .app-icon-large img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 20px;
}

.app-detail-header .app-info {
    flex: 1;
}

.app-detail-header .app-info h1 {
    font-size: 2rem;
    margin-bottom: 10px;
}

.app-detail-header .app-info .app-meta {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
    font-size: 0.9rem;
}

.app-detail-header .app-info .download-stats {
    display: flex;
    gap: 30px;
    margin-bottom: 20px;
}

.app-detail-header .app-info .download-stats div {
    text-align: center;
}

.app-detail-header .app-info .download-stats div .number {
    font-size: 1.5rem;
    font-weight: 700;
    color: #e74c3c;
}

.app-detail-content {
    background: white;
    border-radius: 12px;
    padding: 25px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.app-detail-content h2 {
    font-size: 1.3rem;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid #eee;
}

.app-detail-content p {
    line-height: 1.8;
    color: #666;
}

/* 评论区样式 */
.comment-form {
    margin: 20px 0;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
}


.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    padding: 30px 0;
    flex-wrap: wrap;
}

.pagination .page-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    padding: 0 12px;
    background-color: white;
    border: 1px solid #ddd;
    border-radius: 8px;
    color: #666;
    text-decoration: none;
    font-size: 0.9rem;
    transition: all 0.3s;
}

.pagination .page-btn:hover {
    border-color: #e74c3c;
    color: #e74c3c;
    transform: translateY(-1px);
}

.pagination .page-btn.active {
    background-color: #e74c3c;
    border-color: #e74c3c;
    color: white;
    font-weight: 600;
}

.pagination .page-info {
    margin-left: 15px;
    color: #999;
    font-size: 0.875rem;
}

@media (max-width: 768px) {
    .pagination {
        padding: 20px 0;
        gap: 5px;
    }
    
    .pagination .page-btn {
        min-width: 35px;
        height: 35px;
        font-size: 0.85rem;
    }
    
    .pagination .page-info {
        margin-left: 10px;
        font-size: 0.8rem;
    }
}

.comment-form .form-group {
    margin-bottom: 12px;
}

.comment-form textarea {
    resize: vertical;
    min-height: 80px;
    font-family: inherit;
}

.comment-list {
    margin-top: 20px;
}

.comment-item {
    padding: 18px 0;
    border-bottom: 1px solid #eee;
}

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

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

.comment-author {
    display: flex;
    align-items: center;
    gap: 10px;
}

.comment-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 1rem;
}

.comment-name {
    font-weight: 600;
    color: #333;
}

.rank-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: bold;
}

.rank-1 {
    background: linear-gradient(135deg, #ff6b6b 0%, #ee5a24 100%);
    color: white;
}

.rank-2 {
    background: linear-gradient(135deg, #feca57 0%, #ff9f43 100%);
    color: white;
}

.rank-3 {
    background: linear-gradient(135deg, #54a0ff 0%, #2e86de 100%);
    color: white;
}

.comment-time {
    color: #999;
    font-size: 0.85rem;
}

.comment-content {
    color: #444;
    line-height: 1.7;
    margin-bottom: 10px;
    word-wrap: break-word;
}

.comment-actions {
    display: flex;
    gap: 15px;
}

.like-btn {
    background: white;
    border: 1px solid #ddd;
    padding: 6px 14px;
    border-radius: 20px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.9rem;
    color: #666;
    transition: all 0.3s;
}

.like-btn:hover {
    background: #fff5f5;
    border-color: #ff6b6b;
    color: #ff6b6b;
    transform: translateY(-1px);
}

.like-count {
    font-weight: 600;
}

@media (max-width: 768px) {
    .comment-form {
        padding: 15px;
    }
    
    .comment-avatar {
        width: 32px;
        height: 32px;
        font-size: 0.9rem;
    }
    
    .comment-item {
        padding: 15px 0;
    }
}

footer {
    background-color: #333;
    color: white;
    text-align: center;
    padding: 30px 0;
    margin-top: 50px;
}

footer p {
    opacity: 0.8;
}

.admin-sidebar {
    width: 250px;
    background-color: #2d3748;
    min-height: 100vh;
    position: fixed;
    left: 0;
    top: 0;
    padding-top: 20px;
}

.admin-sidebar .logo {
    text-align: center;
    color: white;
    font-size: 1.3rem;
    font-weight: 700;
    padding: 0 20px 20px;
    border-bottom: 1px solid #4a5568;
}

.admin-sidebar .menu {
    list-style: none;
    padding: 20px 0;
}

.admin-sidebar .menu li {
    margin-bottom: 5px;
}

.admin-sidebar .menu li a {
    display: block;
    padding: 12px 20px;
    color: #a0aec0;
    transition: all 0.3s;
}

.admin-sidebar .menu li a:hover {
    background-color: #4a5568;
    color: white;
}

.admin-sidebar .menu li a.active {
    background-color: #e74c3c;
    color: white;
}

.admin-sidebar .menu li.has-submenu .menu-parent {
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.admin-sidebar .menu li.has-submenu .menu-parent::after {
    content: '▼';
    font-size: 0.7rem;
    transition: transform 0.3s;
}

.admin-sidebar .menu li.has-submenu.open .menu-parent::after {
    transform: rotate(180deg);
}

.admin-sidebar .menu li.has-submenu.open > a {
    background-color: #e74c3c;
    color: white;
}

.admin-sidebar .menu .submenu {
    list-style: none;
    display: none;
    background-color: #1a202c;
}

.admin-sidebar .menu .submenu.show {
    display: block;
}

.admin-sidebar .menu .submenu li a {
    padding: 10px 20px 10px 40px;
    font-size: 0.9rem;
}

.admin-sidebar .menu .submenu li a:hover {
    background-color: #2d3748;
}

.admin-content {
    margin-left: 250px;
    padding: 30px;
}

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

.admin-content .page-header h1 {
    font-size: 1.5rem;
}

.table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.table th,
.table td {
    padding: 15px;
    text-align: left;
    border-bottom: 1px solid #eee;
}

.table th {
    background-color: #f8f9fa;
    font-weight: 600;
}

.table tr:hover {
    background-color: #fafafa;
}

.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #e74c3c 0%, #c0392b 100%);
}

.login-box {
    background: white;
    padding: 40px;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    width: 100%;
    max-width: 400px;
}

.login-box h2 {
    text-align: center;
    margin-bottom: 30px;
    color: #333;
}

.login-box .form-group:last-child {
    margin-bottom: 0;
}

.dashboard-stats {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: white;
    padding: 25px;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    text-align: center;
}

.stat-card .stat-icon {
    font-size: 2.5rem;
    margin-bottom: 10px;
}

.stat-card .stat-number {
    font-size: 2rem;
    font-weight: 700;
    color: #e74c3c;
}

.stat-card .stat-label {
    color: #666;
    font-size: 0.9rem;
}

@media (max-width: 768px) {
    html {
        font-size: 14px;
    }
    
    header nav {
        flex-direction: column;
        gap: 15px;
    }
    
    header .menu {
        flex-wrap: wrap;
        justify-content: center;
    }
    
    header .search-bar {
        width: 100%;
        justify-content: center;
    }
    
    header .search-bar input {
        width: 100%;
        max-width: 300px;
    }
    
    .hero h1 {
        font-size: 1.8rem;
    }
    
    .hero p {
        font-size: 1rem;
    }
    
    .app-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 15px;
    }
    
    .app-card .app-icon {
        height: 120px;
    }
    
    .app-card .app-icon img {
        font-size: 3rem;
    }
    
    .app-detail-header {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }
    
    .app-detail-header .app-icon-large {
        width: 120px;
        height: 120px;
        font-size: 5rem;
    }
    
    .app-detail-header .app-info h1 {
        font-size: 1.5rem;
    }
    
    .app-detail-header .app-info .app-meta {
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .admin-sidebar {
        width: 100%;
        position: relative;
        min-height: auto;
    }
    
    .admin-sidebar .menu {
        display: flex;
        flex-wrap: wrap;
        justify-content: center;
        padding: 10px 0;
    }
    
    .admin-sidebar .menu li a {
        padding: 10px 15px;
    }
    
    .admin-content {
        margin-left: 0;
        padding: 15px;
    }
    
    .admin-content .page-header {
        flex-direction: column;
        gap: 15px;
        align-items: flex-start;
    }
    
    .table {
        overflow-x: auto;
        display: block;
    }
    
    .dashboard-stats {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .login-box {
        padding: 30px 20px;
        margin: 0 15px;
    }
}

@media (max-width: 480px) {
    .app-grid {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
        gap: 10px;
    }
    
    .category-item {
        padding: 10px 15px;
        font-size: 0.875rem;
    }
    
    .dashboard-stats {
        grid-template-columns: 1fr;
    }
    
    .stat-card {
        padding: 20px;
    }
}

.icon-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    max-height: 300px;
    overflow-y: auto;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 8px;
}

.icon-option {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 70px;
    height: 70px;
    padding: 8px;
    border: 2px solid #ddd;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    background: #fff;
}

.icon-option:hover {
    border-color: #007bff;
    background: #f0f7ff;
}

.icon-option.selected,
.icon-option input[type="radio"]:checked + .icon-emoji {
    border-color: #007bff;
    background: #007bff;
    color: #fff;
}

.icon-option.selected .icon-label,
.icon-option input[type="radio"]:checked + .icon-emoji + .icon-label {
    color: #007bff;
}

.icon-option input[type="radio"] {
    display: none;
}

.icon-emoji {
    font-size: 24px;
    margin-bottom: 4px;
}

.icon-label {
    font-size: 10px;
    color: #666;
    text-align: center;
}

.editor-wrapper {
    border: 1px solid #ddd;
    border-radius: 8px;
    overflow: hidden;
}

.editor-toolbar {
    display: flex;
    align-items: center;
    padding: 8px 12px;
    background: #f8f9fa;
    border-bottom: 1px solid #ddd;
    flex-wrap: wrap;
    gap: 4px;
}

.toolbar-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border: 1px solid #ddd;
    background: #fff;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s;
}

.toolbar-btn:hover {
    background: #e9ecef;
    border-color: #adb5bd;
}

.toolbar-btn.btn-primary {
    width: auto;
    padding: 0 10px;
    background: #007bff;
    color: #fff;
    border-color: #007bff;
}

.toolbar-btn.btn-primary:hover {
    background: #0069d9;
    border-color: #0062cc;
}

.toolbar-divider {
    width: 1px;
    height: 24px;
    background: #ddd;
    margin: 0 4px;
}

.editor-content {
    min-height: 200px;
    padding: 15px;
    background: #fff;
    outline: none;
    font-family: inherit;
    font-size: 14px;
    line-height: 1.6;
}

.editor-content:focus {
    background: #fafafa;
}

.editor-content img {
    max-width: 100%;
    height: auto;
    margin: 5px 0;
    border-radius: 4px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.editor-content h2 {
    font-size: 18px;
    font-weight: bold;
    margin: 15px 0 10px;
    padding-bottom: 5px;
    border-bottom: 2px solid #007bff;
    color: #333;
}

.editor-content h3 {
    font-size: 16px;
    font-weight: bold;
    margin: 12px 0 8px;
    color: #444;
}

.editor-content ul,
.editor-content ol {
    margin: 10px 0;
    padding-left: 25px;
}

.editor-content li {
    margin: 5px 0;
}

.editor-content p {
    margin: 8px 0;
}

.editor-content a {
    color: #007bff;
    text-decoration: underline;
}

.editor-content blockquote {
    border-left: 4px solid #007bff;
    padding-left: 15px;
    margin: 15px 0;
    color: #666;
    background: #f8f9fa;
    padding: 10px 15px;
}