/* 全局样式 */
:root {
    --primary-color: #4a6fa5;
    --secondary-color: #6b8cbc;
    --success-color: #28a745;
    --danger-color: #dc3545;
    --warning-color: #ffc107;
    --info-color: #17a2b8;
    --light-color: #f8f9fa;
    --dark-color: #343a40;
    --border-radius: 12px;
    --box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    --transition: all 0.3s ease;
}

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

body {
    background-color: #f5f7fa;
    font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #333;
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
}

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

.navbar-brand {
    font-weight: 700;
    color: var(--primary-color) !important;
    font-size: 1.5rem;
}

.navbar-nav .nav-link {
    font-weight: 500;
    transition: var(--transition);
}

.navbar-nav .nav-link:hover {
    color: var(--primary-color) !important;
}

.hero-section {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    padding: 60px 0;
    position: relative;
    overflow: hidden;
}

.hero-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1000 1000" opacity="0.1"><polygon fill="white" points="0,1000 1000,0 1000,1000"/></svg>');
    background-size: cover;
}

.hero-section .container {
    position: relative;
    z-index: 2;
}

.hero-section h1 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
    text-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.hero-section .lead {
    font-size: 1.2rem;
    margin-bottom: 1.5rem;
    opacity: 0.9;
    font-weight: 300;
}

.hero-buttons {
    margin-top: 1.5rem;
}

.hero-buttons .btn {
    border-radius: 50px;
    font-weight: 600;
    font-size: 1rem;
    padding: 12px 30px;
    transition: all 0.3s ease;
    border-width: 2px;
    background: rgba(255, 255, 255, 0.9) !important;
    color: var(--primary-color) !important;
    border-color: rgba(255, 255, 255, 0.9) !important;
}

.hero-buttons .btn:hover {
    background: white !important;
    color: var(--primary-color) !important;
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
    border-color: white !important;
}

.card {
    border: none;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    transition: var(--transition);
    margin-bottom: 25px;
    display: flex;
    flex-direction: column;
    height: auto;
}

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

.card-header {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    border-radius: var(--border-radius) var(--border-radius) 0 0 !important;
    border: none;
    font-weight: 600;
}

.btn {
    border-radius: 8px;
    font-weight: 500;
    transition: var(--transition);
    border: none;
    -webkit-tap-highlight-color: transparent;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    border: none;
}

.btn-primary:hover {
    background: linear-gradient(135deg, var(--secondary-color), var(--primary-color));
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(74, 111, 165, 0.3);
}

.install-container {
    max-width: 800px;
    margin: 50px auto;
}

.install-header {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    padding: 30px;
    text-align: center;
    border-radius: 15px 15px 0 0;
}

.install-body {
    background: white;
    padding: 30px;
    border-radius: 0 0 15px 15px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
}

.latest-images {
    padding: 40px 0;
    background: #f8fafc;
    overflow: hidden;
}

.latest-images h2 {
    font-size: 1.8rem;
    margin-bottom: 0.5rem;
}

.latest-images .text-muted {
    font-size: 1rem;
    margin-bottom: 2.5rem;
}

.image-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.5rem;
    -webkit-box-align: stretch;
    align-items: stretch;
}

.latest-images .image-card {
    background: white;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    overflow: hidden;
    transition: var(--transition);
    border: 1px solid #e2e8f0;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.latest-images .image-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
}

.latest-images .image-card img {
    width: 100%;
    height: 140px;
    object-fit: cover;
    cursor: pointer;
    transition: var(--transition);
    max-width: 100%;
    display: block;
    -webkit-user-drag: none;
    -webkit-touch-callout: none;
    image-rendering: -webkit-optimize-contrast;
    image-rendering: crisp-edges;
}

.latest-images .image-card:hover img {
    transform: scale(1.02);
}

.latest-images .image-card .card-body {
    padding: 0.8rem;
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.latest-images .image-card .card-title {
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--dark-color);
    font-size: 0.85rem;
    line-height: 1.3;
    word-break: break-all;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.latest-images .image-meta {
    color: #718096;
    font-size: 0.7rem;
    line-height: 1.4;
    -webkit-font-smoothing: antialiased;
}

.latest-images .image-actions {
    display: flex;
    gap: 0.4rem;
    margin-top: auto;
    padding-top: 0.5rem;
    border-top: 1px solid #f1f1f1;
}

.latest-images .image-actions .btn {
    flex: 1;
    font-size: 0.75rem;
    padding: 0.3rem 0.5rem;
    min-height: 32px;
    border: 1px solid #dee2e6 !important;
    background-color: #f8f9fa !important;
    color: #495057 !important;
    transition: all 0.2s ease;
}

.latest-images .image-actions .btn:hover {
    background-color: #e9ecef !important;
    transform: translateY(-1px);
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.gallery-header {
    padding: 1.5rem 0;
    border-bottom: 1px solid #e2e8f0;
    margin-bottom: 2rem;
}

.gallery-header h2 {
    margin-bottom: 0;
    font-size: 1.6rem;
}

.sort-dropdown {
    font-size: 0.9rem;
}

.gallery-images {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.5rem;
    -webkit-box-align: stretch;
    align-items: stretch;
}

.gallery-images .card {
    background: white;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    overflow: hidden;
    transition: var(--transition);
    border: 1px solid #e2e8f0;
    display: flex;
    flex-direction: column;
}

.gallery-images .card:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
}

.gallery-images .card img {
    width: 100%;
    height: 160px;
    object-fit: cover;
    cursor: pointer;
    transition: var(--transition);
    max-width: 100%;
    display: block;
    -webkit-user-drag: none;
    image-rendering: -webkit-optimize-contrast;
}

.gallery-images .card:hover img {
    transform: scale(1.02);
}

.gallery-images .card-body {
    padding: 1rem;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.gallery-images .card-title {
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--dark-color);
    font-size: 0.85rem;
    line-height: 1.3;
    word-break: break-all;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.gallery-images .image-meta {
    color: #718096;
    font-size: 0.7rem;
    line-height: 1.4;
    -webkit-font-smoothing: antialiased;
}

.gallery-images .image-actions {
    display: flex;
    gap: 0.4rem;
    margin-top: 0.5rem;
    padding-top: 0.5rem;
    border-top: 1px solid #f1f1f1;
}

.gallery-images .image-actions .btn {
    flex: 1;
    font-size: 0.75rem;
    padding: 0.3rem 0.5rem;
    min-height: 32px;
    border: 1px solid #dee2e6 !important;
    background-color: #f8f9fa !important;
    color: #495057 !important;
    transition: all 0.2s ease;
}

.gallery-images .image-actions .btn:hover {
    background-color: #e9ecef !important;
    transform: translateY(-1px);
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.gallery-images .image-actions .btn-outline-primary:hover {
    background-color: var(--primary-color) !important;
    color: white !important;
    border-color: var(--primary-color) !important;
}

.gallery-images .image-actions .btn-outline-success:hover {
    background-color: var(--success-color) !important;
    color: white !important;
    border-color: var(--success-color) !important;
}

.gallery-images .image-actions .btn-outline-danger:hover {
    background-color: var(--danger-color) !important;
    color: white !important;
    border-color: var(--danger-color) !important;
}

@media (max-width: 1200px) {
    .container {
        max-width: 1140px;
    }
    .image-grid,
    .gallery-images {
        grid-template-columns: repeat(4, 1fr);
    }
}

@media (max-width: 992px) {
    .container {
        max-width: 960px;
    }
    .image-grid,
    .gallery-images {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 768px) {
    .container {
        max-width: 720px;
        padding: 0 15px;
    }
    
    .hero-section {
        padding: 50px 0;
    }
    
    .hero-section h1 {
        font-size: 2rem;
    }
    
    .hero-section .lead {
        font-size: 1.1rem;
    }
    
    .hero-buttons .btn {
        display: block;
        width: 100%;
        margin-bottom: 1rem;
    }
    
    .hero-buttons .btn:last-child {
        margin-bottom: 0;
    }
    
    .install-container {
        margin: 20px;
    }
    
    .install-header,
    .install-body {
        padding: 20px;
    }
    
    .image-grid,
    .gallery-images {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }
    
    .latest-images .image-card img {
        height: 150px;
    }
    
    .gallery-images .card img {
        height: 170px;
    }
    
    .latest-images .image-actions,
    .gallery-images .image-actions {
        flex-direction: column;
    }
}

@media (max-width: 576px) {
    .container {
        max-width: 540px;
    }
    
    .hero-section {
        padding: 40px 0;
    }
    
    .hero-section h1 {
        font-size: 1.8rem;
    }
    
    .hero-section .lead {
        font-size: 1rem;
    }
    
    .hero-buttons .btn {
        padding: 10px 25px;
        font-size: 0.9rem;
    }
    
    .image-grid,
    .gallery-images {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .latest-images .image-card img {
        height: 200px;
    }
    
    .gallery-images .card img {
        height: 220px;
    }
    
    .latest-images .image-card,
    .gallery-images .card {
        max-width: 100%;
        overflow: hidden;
    }
    
    .latest-images .image-card .card-title,
    .gallery-images .card-title {
        font-size: 0.85rem;
        -webkit-font-smoothing: antialiased;
    }
    
    .latest-images .image-meta,
    .gallery-images .card-text {
        font-size: 0.7rem;
        -webkit-font-smoothing: antialiased;
    }
    
    .latest-images .image-actions .btn,
    .gallery-images .image-actions .btn {
        font-size: 0.7rem;
        padding: 0.25rem 0.4rem;
        min-height: 36px;
    }
}

@media (max-width: 375px) {
    .latest-images .image-card img {
        height: 180px;
    }
    
    .gallery-images .card img {
        height: 200px;
    }
    
    body {
        -webkit-overflow-scrolling: touch;
    }
    
    .image-grid,
    .gallery-images {
        gap: 0.8rem;
    }
}

@supports (-webkit-touch-callout: none) {
    .latest-images .image-card,
    .gallery-images .card {
        -webkit-transform: translateZ(0);
    }
    
    .btn {
        -webkit-appearance: none;
    }
}