/* Picture Mode Styles */
.pic-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 20px;
    padding: 20px 0;
}

.pic-card {
    background: white;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    position: relative;
    border: 2px solid transparent;
}

.pic-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 24px rgba(0,0,0,0.12);
    border-color: var(--primary-color);
}

.pic-card.playing {
    border-color: #4CAF50;
    box-shadow: 0 0 0 4px rgba(76, 175, 80, 0.2);
}

.pic-card__img-wrap {
    width: 100%;
    height: 160px;
    background-color: #f5f5f5;
    position: relative;
    overflow: hidden;
}

.pic-card__img-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
    opacity: 0; /* Initially hidden for lazy loading */
}

.pic-card__img-wrap img.loaded {
    opacity: 1;
}

.pic-card:hover .pic-card__img-wrap img {
    transform: scale(1.1);
}

.pic-card__placeholder {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3em;
    color: #ddd;
    background: #fafafa;
}

.pic-card__info {
    padding: 15px;
}

.pic-card__top {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 8px;
}

.pic-card__word {
    font-size: 1.3em;
    font-weight: 700;
    color: #333;
}

.pic-card__pos {
    font-size: 0.85em;
    font-weight: 600;
    padding: 2px 6px;
    border-radius: 4px;
    background: #eee;
    color: #666;
}

.pos-n { background: #e3f2fd; color: #1976d2; }
.pos-v { background: #e8f5e9; color: #388e3c; }
.pos-adj { background: #fff3e0; color: #f57c00; }
.pos-adv { background: #f3e5f5; color: #7b1fa2; }
.pos-num { background: #e0f7fa; color: #0097a7; }

.pic-card__zh {
    font-size: 1em;
    color: #666;
    margin-bottom: 8px;
}

.pic-card__example {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-out;
    font-size: 0.9em;
    color: #555;
    border-top: 1px dashed #eee;
}

.pic-card.expanded .pic-card__example {
    max-height: 120px;
    margin-top: 8px;
    padding-top: 8px;
}

.pic-card__example p {
    margin: 0;
    line-height: 1.4;
}

.pic-card__example .ex-hu {
    margin-bottom: 4px;
    font-style: italic;
}

.pic-card__example .ex-zh {
    color: #999;
    font-size: 0.9em;
}
