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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
}

header {
    text-align: center;
    color: white;
    margin-bottom: 40px;
    padding: 20px 0;
}

header h1 {
    font-size: clamp(28px, 5vw, 48px);
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2);
}

header p {
    font-size: clamp(14px, 2vw, 18px);
    opacity: 0.9;
}

.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 24px;
    padding: 10px;
}

.card {
    background: white;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    cursor: pointer;
    aspect-ratio: 9/19;
    display: flex;
    flex-direction: column;
    animation: fadeInUp 0.6s ease backwards;
}

.card:hover {
    transform: translateY(-8px);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.3);
}

.card:focus-visible {
    outline: 3px solid #fff;
    outline-offset: 3px;
}

.card-preview {
    width: 100%;
    height: 72%;
    flex: none;
    overflow: hidden;
    position: relative;
    background: #111;
    pointer-events: none;
}

.card-preview::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(to bottom, rgba(0, 0, 0, 0.1) 0%, rgba(0, 0, 0, 0.3) 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.card:hover .card-preview::after {
    opacity: 1;
}

.card-preview iframe {
    border: 0;
    display: block;
    transform-origin: top left;
    pointer-events: none;
    overflow: hidden;
    scrollbar-width: none;
    background: #111;
}

.card-content {
    padding: 20px;
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 8px;
}

.card-copy {
    min-width: 0;
}

.card-title {
    margin: 0;
    font-size: clamp(18px, 2.5vw, 22px);
    font-weight: bold;
    color: #333;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.card-number {
    margin: 8px 0 0;
    font-size: clamp(13px, 1.8vw, 15px);
    color: #666;
    line-height: 1.6;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.card-footer {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
}

.card-date {
    font-size: 12px;
    color: #999;
    white-space: nowrap;
}

.card-tag {
    flex: none;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
    line-height: 1.4;
}

.loading,
.empty {
    color: white;
    text-align: center;
    grid-column: 1 / -1;
    padding: 40px 0;
}

@media (max-width: 768px) {
    body {
        padding: 10px;
    }

    header {
        margin-bottom: 20px;
    }

    .card-grid {
        grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
        gap: 12px;
        padding: 5px;
    }

    .card {
        border-radius: 12px;
    }

    .card-preview {
        height: 68%;
    }

    .card-content {
        padding: 12px;
    }

    .card-footer {
        margin-top: 8px;
        padding-top: 8px;
    }
}

@media (max-width: 480px) {
    .card-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }

    .card {
        aspect-ratio: 9/17;
    }

    .card-preview {
        height: 65%;
    }

    .card-content {
        padding: 8px;
        gap: 4px;
    }

    .card-title {
        font-size: 14px;
    }

    .card-number {
        margin-top: 4px;
        font-size: 11px;
        -webkit-line-clamp: 2;
    }

    .card-date,
    .card-tag {
        font-size: 10px;
    }

    .card-tag {
        padding: 2px 8px;
    }
}

@media (min-width: 1400px) {
    .card-grid {
        grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
        gap: 30px;
    }
}

footer {
    text-align: center;
    color: white;
    padding: 30px 0;
    margin-top: 40px;
    opacity: 0.8;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}
