* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

:root {
    color-scheme: light dark;
}

body {
    font-family: Arial, sans-serif;
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    margin: 0;
}

header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 2rem;
    background-color: #f8f9fa;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.site-title {
    font-size: 1.5rem;
    color: #333;
}

.user-area {
    font-size: 1rem;
}

.user-area a {
    text-decoration: none;
    color: #007bff;
}

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

.subtitle-card {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    overflow: hidden;
    transition: transform 0.2s;
}

.subtitle-card:hover {
    transform: translateY(-5px);
}

.subtitle-card img {
    width: 100%;
    height: 150px;
    object-fit: cover;
}

.subtitle-info {
    padding: 15px;
}

.subtitle-title {
    font-size: 1.1rem;
    margin-bottom: 10px;
}

.subtitle-meta {
    font-size: 0.9rem;
    color: #666;
}

.site-title a {
    color: inherit;
    text-decoration: none;
}

.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1000;
}

.modal-content {
    position: relative;
    background-color: #fff;
    margin: 10% auto;
    padding: 20px;
    width: 90%;
    max-width: 500px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.modal-body {
    text-align: center;
    margin-bottom: 20px;
}

.modal-body img {
    max-width: 100%;
    height: auto;
    margin-bottom: 15px;
    border-radius: 4px;
}

.modal-body h3 {
    font-size: 1.4rem;
    color: #333;
    margin: 10px 0;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding-top: 15px;
    border-top: 1px solid #eee;
}

.btn {
    padding: 8px 16px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1rem;
    transition: background-color 0.2s;
}

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

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

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

.btn-secondary:hover {
    background-color: #545b62;
}

.subtitle-card {
    cursor: pointer;
}

.empty-state {
    grid-column: 1 / -1;
    text-align: center;
    padding: 60px 20px;
}

.empty-state p {
    font-size: 1.5rem;
    color: #666;
    margin: 0;
}

/* 移动端适配 */
@media screen and (max-width: 768px) {
    header {
        padding: 0.8rem 1rem;
    }

    .site-title {
        font-size: 0.9rem;
    }

    .subtitle-grid {
        padding: 10px;
        gap: 15px;
    }

    .subtitle-card {
        margin-bottom: 0;
    }

    .modal-content {
        margin: 5% auto;
        width: 95%;
        padding: 15px;
    }

    .modal-body h3 {
        font-size: 1.2rem;
    }

    .btn {
        padding: 8px 12px;
        font-size: 0.9rem;
    }

    .empty-state {
        padding: 40px 15px;
    }

    .empty-state p {
        font-size: 1.2rem;
    }
}

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

.search-input {
    width: 100%;
    padding: 12px 20px;
    font-size: 1rem;
    border: 2px solid #e0e0e0;
    border-radius: 25px;
    outline: none;
    transition: all 0.3s ease;
    background-color: white;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.search-input:focus {
    border-color: #007bff;
    box-shadow: 0 2px 8px rgba(0,123,255,0.2);
}

/* 移动端搜索框适配 */
@media screen and (max-width: 768px) {
    .search-container {
        padding: 0 15px;
        margin: 15px auto;
    }

    .search-input {
        padding: 10px 15px;
        font-size: 0.9rem;
    }
}

.loading-container {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 40px;
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 5px solid #f3f3f3;
    border-top: 5px solid #007bff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.footer {
    text-align: center;
    padding: 13px;
    background-color: #f8f9fa;
    width: 100%;
    margin-top: auto;
    font-size: 0.9rem;
}

.footer a {
    color: #666;
    text-decoration: none;
    margin: 0 10px;
    font-size: 0.9rem;
}

.footer a:hover {
    color: #007bff;
}

main {
    flex: 1;
}

/* 移动端适配 */
@media screen and (max-width: 768px) {
    .footer {
        font-size: 0.7rem;
        padding: 10px;
    }

    .footer a {
        font-size: 0.7rem;
        margin: 0 5px;
    }
}

@media (prefers-color-scheme: dark) {
    html {
        background-color: #1a1a1a;
    }

    body {
        background-color: #1a1a1a;
        color: #e0e0e0;
        -webkit-text-size-adjust: 100%;
    }

    header {
        background-color: #2d2d2d !important;
        box-shadow: 0 2px 4px rgba(0,0,0,0.2) !important;
    }

    .site-title, 
    .site-title a {
        color: #e0e0e0 !important;
    }

    .user-area,
    .user-area a {
        color: #3391ff !important;
    }

    .subtitle-card {
        background-color: #2d2d2d !important;
        border: 1px solid #444;
        box-shadow: 0 2px 4px rgba(0,0,0,0.2) !important;
    }

    .subtitle-info {
        background-color: #2d2d2d !important;
    }

    .subtitle-title {
        color: #e0e0e0 !important;
    }

    .subtitle-meta {
        color: #999 !important;
    }

    .modal {
        background-color: rgba(0, 0, 0, 0.7) !important;
    }

    .modal-content {
        background-color: #2d2d2d !important;
        box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
    }

    .modal-body h3 {
        color: #e0e0e0 !important;
    }

    .search-input {
        background-color: #2d2d2d !important;
        border-color: #444 !important;
        color: #e0e0e0 !important;
        -webkit-appearance: none;
    }

    .search-input:focus {
        border-color: #0056b3 !important;
        box-shadow: 0 2px 8px rgba(0,123,255,0.2) !important;
    }

    .footer {
        background-color: #2d2d2d !important;
    }

    .empty-state p {
        color: #999 !important;
    }

    .modal-footer {
        border-top: 1px solid #444 !important;
    }

    .loading-spinner {
        border-color: #333 !important;
        border-top-color: #007bff !important;
    }

    .subtitle-card:hover {
        box-shadow: 0 5px 15px rgba(0,0,0,0.3) !important;
        transform: translateY(-5px);
    }

    .footer a {
        color: #999 !important;
    }

    .footer a:hover {
        color: #3391ff !important;
    }

    .btn-primary {
        background-color: #0056b3 !important;
        color: #ffffff !important;
    }

    .btn-primary:hover {
        background-color: #004494 !important;
    }

    .btn-secondary {
        background-color: #495057 !important;
        color: #ffffff !important;
    }

    .btn-secondary:hover {
        background-color: #383d42 !important;
    }

    .modal-body img {
        border: none !important;
        background-color: #1a1a1a !important;
    }

    .qrcode-modal p {
        color: #999 !important;
    }
    #qrcode {
        background: #ffffff !important;
        border: none !important;
    }
}

.logo-container {
    display: flex;
    align-items: center;
}

.logo {
    height: 40px;
    width: auto;
    margin-right: 0px;
    cursor: pointer;
    transition: transform 0.2s;
}

.logo:hover {
    transform: scale(1.1);
}

.qrcode-modal {
    max-width: 300px;
}

#qrcode {
    margin: 20px auto;
    width: 200px;
    height: 200px;
    padding: 8px;
    background: #ffffff;
    border-radius: 4px;
    display: flex;
    justify-content: center;
    align-items: center;
}

#qrcode img {
    display: block;
    margin: 0;
}

.qrcode-modal p {
    color: #666;
    margin-top: 10px;
}

/* 深色模式适配 */
@media (prefers-color-scheme: dark) {
    .qrcode-modal p {
        color: #999 !important;
    }
    #qrcode {
        background: #ffffff !important;
        border: none !important;
    }

    .modal-body img {
        border: none !important;
        background-color: #1a1a1a !important;
    }
}

/* 懒加载图片的占位样式 */
.subtitle-card img.lazy {
    opacity: 0;
    transition: opacity 0.3s ease-in;
}

.subtitle-card img:not(.lazy) {
    opacity: 1;
}

/* 图片加载时的背景 */
.subtitle-card {
    background: #f5f5f5;
}

@media (prefers-color-scheme: dark) {
    .subtitle-card {
        background: #2d2d2d;
    }
} 