/* 今日诗词悬浮组件 - 右下角锚定弹出 */
.poetry-widget {
    position: fixed;
    right: 24px;
    bottom: 24px;
    z-index: 900;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 12px;
}

.poetry-panel {
    display: none;
    flex-direction: column;
    width: 400px;
    max-width: calc(100vw - 48px);
    max-height: min(72vh, 560px);
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.18);
    border: 1px solid #e2e8f0;
    overflow: hidden;
    animation: poetryPanelIn 0.25s ease-out;
}

.poetry-panel.is-open {
    display: flex;
}

@keyframes poetryPanelIn {
    from {
        opacity: 0;
        transform: translateY(12px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.poetry-panel__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    flex-shrink: 0;
}

.poetry-panel__title {
    font-size: 16px;
    font-weight: 600;
}

.poetry-panel__date {
    font-size: 12px;
    opacity: 0.85;
    margin-top: 2px;
}

.poetry-panel__close {
    width: 32px;
    height: 32px;
    border: none;
    background: rgba(255, 255, 255, 0.2);
    color: #fff;
    border-radius: 50%;
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
    transition: background 0.2s;
    flex-shrink: 0;
}

.poetry-panel__close:hover {
    background: rgba(255, 255, 255, 0.35);
}

.poetry-panel__body {
    flex: 1;
    overflow: hidden;
    position: relative;
    min-height: 120px;
}

.poetry-panel__state {
    padding: 36px 20px;
    text-align: center;
    color: #718096;
    font-size: 14px;
}

.poetry-panel__state--error {
    color: #c53030;
}

.poetry-carousel {
    height: 100%;
    overflow: hidden;
    touch-action: pan-y;
}

.poetry-carousel__track {
    display: flex;
    height: 100%;
    transition: transform 0.35s ease;
    will-change: transform;
}

.poetry-carousel__slide {
    flex: 0 0 100%;
    min-width: 100%;
    overflow-y: auto;
    max-height: min(52vh, 420px);
}

.poetry-card {
    padding: 20px 22px 24px;
}

.poetry-card__image-wrap {
    margin: 0 0 16px;
    border-radius: 10px;
    overflow: hidden;
    max-height: 140px;
}

.poetry-card__image {
    width: 100%;
    height: auto;
    max-height: 140px;
    object-fit: cover;
    display: block;
}

.poetry-card__title {
    font-size: 20px;
    font-weight: 700;
    color: #2d3748;
    text-align: center;
    margin-bottom: 6px;
    letter-spacing: 0.05em;
}

.poetry-card__author {
    font-size: 13px;
    color: #718096;
    text-align: center;
    margin-bottom: 18px;
}

.poetry-card__content {
    font-size: 16px;
    line-height: 2;
    color: #2d3748;
    text-align: center;
    white-space: pre-line;
    letter-spacing: 0.08em;
    font-family: 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', serif;
}

.poetry-card__translation {
    margin-top: 18px;
    padding-top: 16px;
    border-top: 1px dashed #e2e8f0;
    font-size: 13px;
    line-height: 1.75;
    color: #718096;
    text-align: left;
    white-space: pre-line;
}

.poetry-card__translation::before {
    content: '译文';
    display: block;
    font-size: 11px;
    font-weight: 600;
    color: #a0aec0;
    margin-bottom: 6px;
    letter-spacing: 0.1em;
}

.poetry-panel__nav {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 10px 16px 14px;
    flex-shrink: 0;
    border-top: 1px solid #f0f4f8;
}

.poetry-panel__nav-btn {
    width: 36px;
    height: 36px;
    border: 1px solid #e2e8f0;
    background: #fff;
    border-radius: 50%;
    color: #4a5568;
    font-size: 18px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.poetry-panel__nav-btn:hover:not(:disabled) {
    border-color: #667eea;
    color: #667eea;
    background: #f7fafc;
}

.poetry-panel__nav-btn:disabled {
    opacity: 0.35;
    cursor: not-allowed;
}

.poetry-panel__dots {
    display: flex;
    gap: 6px;
    align-items: center;
}

.poetry-panel__dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    border: none;
    padding: 0;
    background: #cbd5e0;
    cursor: pointer;
    transition: all 0.2s;
}

.poetry-panel__dot.is-active {
    background: #667eea;
    width: 18px;
    border-radius: 4px;
}

.poetry-panel__nav.is-hidden {
    display: none;
}

.poetry-fab {
    width: 56px;
    height: 56px;
    border: none;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    box-shadow: 0 4px 16px rgba(102, 126, 234, 0.45);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s, box-shadow 0.2s;
    flex-shrink: 0;
}

.poetry-fab:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 24px rgba(102, 126, 234, 0.55);
}

.poetry-fab.is-active {
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.35);
}

.poetry-fab img {
    width: 28px;
    height: 28px;
    filter: brightness(0) invert(1);
}

@media (max-width: 480px) {
    .poetry-widget {
        right: 16px;
        bottom: 16px;
    }

    .poetry-panel {
        width: calc(100vw - 32px);
    }

    .poetry-fab {
        width: 50px;
        height: 50px;
    }

    .poetry-fab img {
        width: 24px;
        height: 24px;
    }

    .poetry-card {
        padding: 16px 18px 20px;
    }

    .poetry-card__content {
        font-size: 15px;
    }
}
