/**
 * Star Score Plugin Styles
 */

.star-score-container {
    background: #fff;
    border: 1px solid #e8e8e8;
    border-radius: 12px;
    padding: 0;
    margin: 30px 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

.star-score-title {
    text-align: center;
    padding: 20px 20px 0 20px;
}

.star-score-title h4 {
    margin: 0;
    color: #333;
    font-size: 18px;
    font-weight: 600;
}

.star-score-content {
    display: flex;
    gap: 20px;
    align-items: stretch;
    min-height: 120px;
    padding: 15px;
}

.star-score-left {
    flex: 0 0 250px;
    background: #4285f4;
    color: white;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 30px 20px;
    margin: auto 0;
    border-radius: 10px;
}

.star-score-right {
    flex: 1;
    background: #fff;
    display: flex;
    align-items: center;
    margin-right: 10px;
}

.star-score-rating {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    height: 100%;
}

.star-score-stars {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    cursor: pointer;
    user-select: none;
    justify-content: center;
    order: 2;
}

.star-score-stars-row {
    display: flex;
    gap: 5px;
}

.star-score-stars[data-rated="true"] {
    cursor: default;
}

.star-score-star {
    width: 24px;
    height: 24px;
    cursor: pointer;
    transition: all 0.2s ease;
    fill: rgba(255,255,255,0.3);
}

.star-score-star:hover {
    transform: scale(1.05);
}

.star-score-stars:not([data-rated="true"]) .star-score-star:hover {
    fill: rgba(255,255,255,0.9);
    cursor: pointer;
}

.star-score-stars:not([data-rated="true"]) .star-score-star:hover ~ .star-score-star {
    fill: rgba(255,255,255,0.3);
}

.star-score-star.filled {
    fill: rgba(255,255,255,0.9);
}

.star-score-star.hover {
    fill: rgba(255,255,255,0.9);
}

.star-score-info {
    text-align: center;
    color: white;
    order: 1;
}

.star-score-average-display {
    display: flex;
    align-items: center;
    gap: 0;
    margin-bottom: 6px;
}

.star-score-wheat-left,
.star-score-wheat-right {
    width: 30px;
    height: 30px;
    fill: rgba(255,255,255,0.7);
    flex-shrink: 0;
    transition: all 0.3s ease;
    transform: translateY(5px);
}

.star-score-info:hover .star-score-wheat-left,
.star-score-info:hover .star-score-wheat-right {
    fill: rgba(255,255,255,0.9);
    transform: scale(1.05);
}

.star-score-average {
    font-weight: bold;
    font-size: 48px;
    color: white;
    line-height: 1;
}

.star-score-separator,
.star-score-max {
    display: none;
}

.star-score-votes {
    color: rgba(255,255,255,0.9);
    font-size: 14px;
    font-weight: 400;
    order: 3;
    margin-top: 4px;
    background: #ffffff40;
    border-radius: 50px;
}

.star-score-hover-text {
    color: rgba(255,255,255,0.9);
    font-size: 12px;
    font-weight: 400;
    margin-top: 8px;
    text-align: center;
    display: none;
    transition: all 0.2s ease;
}

.star-score-hover-text.show {
    display: block;
}

/* 评分分布样式 */
.star-score-distribution {
    background: transparent;
    padding: 0;
    width: 100%;
}

.star-score-distribution-title {
    display: none;
}

.star-score-distribution-row {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
    font-size: 14px;
}

.star-score-distribution-row:last-child {
    margin-bottom: 0;
}

.star-score-distribution-label {
    width: 80px;
    text-align: left;
    flex-shrink: 0;
}

.star-score-distribution-stars {
    display: inline-flex;
    gap: 1px;
}

.star-mini {
    width: 14px;
    height: 14px;
    margin-right: 1px;
}

.star-mini.filled {
    fill: #ffc107;
}

.star-mini.outline {
    fill: #f0f0f0;
}

.star-score-distribution-bar {
    flex: 1;
    height: 8px;
    background: #f0f0f0;
    border-radius: 4px;
    overflow: hidden;
    position: relative;
}

.star-score-distribution-fill {
    height: 100%;
    background: #4285f4;
    border-radius: 4px;
    transition: width 0.5s ease;
}

.star-score-distribution-fill:empty {
    min-width: 0;
}

.star-score-distribution-percentage {
    width: 45px;
    text-align: right;
    font-weight: 400;
    color: #666;
    font-size: 14px;
    flex-shrink: 0;
}

.star-score-distribution-count {
    display: none;
}

.star-score-message {
    display: none;
    margin: 15px;
    padding: 12px 20px;
    border-radius: 8px;
    font-size: 14px;
    text-align: center;
    font-weight: 500;
    opacity: 0;
    transform: translateY(-10px);
    transition: all 0.3s ease;
}

.star-score-message.success {
    display: block;
    opacity: 1;
    transform: translateY(0);
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.star-score-message.error {
    display: block;
    opacity: 1;
    transform: translateY(0);
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.star-score-message.info {
    display: block;
    opacity: 1;
    transform: translateY(0);
    background-color: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
}

/* 加载状态 */
.star-score-loading .star-score-stars {
    opacity: 0.5;
    pointer-events: none;
}

.star-score-loading .star-score-message::after {
    content: "...";
    animation: dots 1.5s steps(5, end) infinite;
}

@keyframes dots {
    0%, 20% {
        color: rgba(0,0,0,0);
        text-shadow:
            .25em 0 0 rgba(0,0,0,0),
            .5em 0 0 rgba(0,0,0,0);
    }
    40% {
        color: #333;
        text-shadow:
            .25em 0 0 rgba(0,0,0,0),
            .5em 0 0 rgba(0,0,0,0);
    }
    60% {
        text-shadow:
            .25em 0 0 #333,
            .5em 0 0 rgba(0,0,0,0);
    }
    80%, 100% {
        text-shadow:
            .25em 0 0 #333,
            .5em 0 0 #333;
    }
}

/* 响应式设计 */
@media (max-width: 768px) {
    .star-score-container {
        margin: 20px 0;
    }

    .star-score-content {
        flex-direction: column;
        min-height: auto;
    }

    .star-score-left {
        flex: none;
        padding: 30px 20px;
        margin: 0;
    }

    .star-score-right {
        padding:0 5px;
    }

    .star-score-title {
        padding: 15px 15px 0 15px;
    }

    .star-score-title h4 {
        font-size: 16px;
    }

    .star-score-star {
        width: 20px;
        height: 20px;
    }

    .star-score-distribution-row {
        font-size: 13px;
        gap: 10px;
    }

    .star-score-distribution-percentage {
        width: 40px;
    }

    .star-score-message {
        margin-top: 10px;
        padding: 10px 15px;
        font-size: 13px;
    }

    .star-score-hover-text {
        font-size: 11px;
    }
}


@media (max-width: 480px) {
    .star-score-distribution-percentage {
        width: 35px;
        font-size: 12px;
    }

    .star-score-hover-text {
        font-size: 10px;
    }
}

/* 减少动画模式 */
@media (prefers-reduced-motion: reduce) {
    .star-score-star {
        transition: none;
    }
    
    .star-score-star:hover {
        transform: none;
    }
    
    @keyframes dots {
        0%, 100% { opacity: 1; }
        50% { opacity: 0.5; }
    }
}
