/* ── 灵感阅读机 · 玻璃态 + 双主题自适应 ── */

/* ═══════════════════════════════════════════════
   默认浅色主题（玻璃态）
   ═══════════════════════════════════════════════ */

.rr-wrap {
    font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, Helvetica, sans-serif;
    background: var(--bg-card, #f0f4f8);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    position: relative;
}

.rr-wrap::before {
    content: "";
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at 20% 30%, rgba(99, 102, 241, 0.06) 0%, transparent 70%);
    pointer-events: none;
    z-index: 0;
}

/* ── 主容器 ── */
.rr-machine {
    max-width: 720px;
    width: 100%;
    background: rgba(255, 255, 255, 0.75);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border-radius: 3rem;
    border: 1px solid rgba(0, 0, 0, 0.08);
    box-shadow: 0 30px 50px rgba(0, 0, 0, 0.08), 0 0 0 0.5px rgba(255, 255, 255, 0.8) inset;
    padding: 2rem 2rem 2.2rem;
    transition: all 0.3s ease;
    z-index: 2;
    position: relative;
}

/* ── 头部 ── */
.rr-header {
    text-align: center;
    margin-bottom: 2rem;
}

.rr-title {
    font-size: 2.4rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    background: linear-gradient(135deg, #4f46e5, #06b6d4);
    background-clip: text;
    -webkit-background-clip: text;
    color: transparent;
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    flex-wrap: wrap;
    justify-content: center;
}

.rr-title svg {
    font-size: 2rem;
    background: none;
    color: #f59e0b;
    fill: #f59e0b;
    filter: drop-shadow(0 0 8px rgba(245, 158, 11, 0.3));
}

.rr-sub {
    margin-top: 0.6rem;
    color: #64748b;
    font-weight: 400;
    font-size: 0.9rem;
    letter-spacing: 0.3px;
    border-top: 1px solid rgba(0, 0, 0, 0.08);
    display: inline-block;
    padding-top: 0.6rem;
}

.rr-sub svg {
    color: #f59e0b;
    fill: #f59e0b;
}

/* ── SVG 图标 ── */
.rr-icon,
.rr-icon-sm,
.rr-icon-xs {
    display: inline-block;
    vertical-align: middle;
    flex-shrink: 0;
}

.rr-icon {
    width: 1em;
    height: 1em;
}

.rr-icon-sm {
    width: 0.9em;
    height: 0.9em;
}

.rr-icon-xs {
    width: 0.75em;
    height: 0.75em;
}

/* ── 文章卡片 ── */
.rr-article-card {
    background: rgba(255, 255, 255, 0.6);
    backdrop-filter: blur(4px);
    border-radius: 2rem;
    padding: 1.8rem 2rem;
    border: 1px solid rgba(0, 0, 0, 0.06);
    box-shadow: 0 20px 35px -12px rgba(0, 0, 0, 0.1);
    transition: transform 0.25s ease, box-shadow 0.3s ease;
    margin-bottom: 1.5rem;
}

.rr-card-animate {
    animation: rr-card-float-pop 0.4s cubic-bezier(0.2, 0.9, 0.4, 1.1);
}

@keyframes rr-card-float-pop {
    0% {
        opacity: 0.6;
        transform: scale(0.97) translateY(8px);
    }
    100% {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.rr-article-tag {
    display: inline-block;
    background: rgba(99, 102, 241, 0.1);
    backdrop-filter: blur(4px);
    padding: 0.25rem 0.9rem;
    border-radius: 30px;
    font-size: 0.7rem;
    font-weight: 500;
    letter-spacing: 0.5px;
    color: #4f46e5;
    border: 0.5px solid rgba(99, 102, 241, 0.25);
    margin-bottom: 1.2rem;
}

.rr-article-tag svg {
    margin-right: 4px;
    fill: currentColor;
}

.rr-article-title {
    font-size: 1.8rem;
    font-weight: 700;
    line-height: 1.3;
    margin-bottom: 0.8rem;
    color: #1e293b;
    letter-spacing: -0.3px;
}

.rr-article-meta {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    flex-wrap: wrap;
    margin-bottom: 1.2rem;
    font-size: 0.85rem;
    color: #64748b;
    border-left: 3px solid #6366f1;
    padding-left: 0.8rem;
}

.rr-article-meta svg {
    margin-right: 4px;
    fill: currentColor;
}

.rr-article-excerpt {
    font-size: 1rem;
    line-height: 1.6;
    color: #475569;
    font-weight: 400;
    margin-bottom: 1.2rem;
    text-align: justify;
}

/* ── 阅读全文按钮 ── */
.rr-read-more-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(99, 102, 241, 0.1);
    backdrop-filter: blur(4px);
    padding: 0.5rem 1.3rem;
    border-radius: 40px;
    font-size: 0.85rem;
    font-weight: 500;
    color: #4f46e5;
    text-decoration: none;
    border: 1px solid rgba(99, 102, 241, 0.3);
    transition: all 0.2s ease;
    margin-top: 0.4rem;
    float: right;
}

.rr-read-more-btn:hover {
    background: #4f46e5;
    color: #ffffff;
    border-color: #4f46e5;
    transform: translateX(4px);
}

.rr-read-more-btn svg {
    width: 0.9em;
    height: 0.9em;
    fill: currentColor;
}

/* ── 语录 ── */
.rr-inspire-quote {
    font-size: 0.8rem;
    color: #94a3b8;
    border-top: 1px dashed rgba(0, 0, 0, 0.1);
    margin-top: 1rem;
    padding-top: 0.9rem;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    clear: both;
}

.rr-inspire-quote svg {
    fill: #94a3b8;
}

/* ── 按钮区域 ── */
.rr-button-area {
    display: flex;
    justify-content: center;
    margin-top: 0.5rem;
}

.rr-random-btn {
    background: linear-gradient(105deg, #6366f1, #4f46e5);
    border: none;
    padding: 0.9rem 2rem;
    font-size: 1.1rem;
    font-weight: 600;
    font-family: inherit;
    color: #ffffff;
    border-radius: 60px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 12px;
    backdrop-filter: blur(8px);
    transition: all 0.25s ease;
    box-shadow: 0 8px 18px rgba(99, 102, 241, 0.2), 0 0 0 1px rgba(255, 255, 255, 0.3) inset;
    border: 1px solid rgba(99, 102, 241, 0.3);
}

.rr-random-btn svg {
    font-size: 1.25rem;
    transition: transform 0.3s ease;
    fill: currentColor;
}

.rr-random-btn:hover:not(:disabled) {
    background: linear-gradient(105deg, #4f46e5, #4338ca);
    transform: scale(1.02);
    box-shadow: 0 12px 24px rgba(99, 102, 241, 0.3);
    border-color: rgba(99, 102, 241, 0.5);
}

.rr-random-btn:hover:not(:disabled) svg:first-child {
    transform: rotate(180deg);
}

.rr-random-btn:active:not(:disabled) {
    transform: scale(0.98);
}

.rr-random-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* ── 底部信息 ── */
.rr-footer-note {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 1.8rem;
    font-size: 0.75rem;
    color: #94a3b8;
    padding-top: 0.8rem;
    border-top: 1px solid rgba(0, 0, 0, 0.06);
    flex-wrap: wrap;
    gap: 0.5rem;
}

.rr-counter {
    background: rgba(99, 102, 241, 0.1);
    padding: 0.2rem 0.8rem;
    border-radius: 40px;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    color: #4f46e5;
}

.rr-counter svg {
    fill: currentColor;
}

.rr-tiny-tip {
    display: flex;
    align-items: center;
    gap: 5px;
}

.rr-tiny-tip svg {
    fill: currentColor;
}

/* ═══════════════════════════════════════════════
   深色主题适配（data-theme="dark"）
   ═══════════════════════════════════════════════ */

html[data-theme="dark"] .rr-wrap {
    background: linear-gradient(145deg, #0a0f1e 0%, #0c1225 100%);
}

html[data-theme="dark"] .rr-wrap::before {
    background: radial-gradient(circle at 20% 30%, rgba(90, 130, 200, 0.08) 0%, rgba(20, 30, 50, 0) 70%);
}

/* 深色主容器 */
html[data-theme="dark"] .rr-machine {
    background: rgba(18, 24, 40, 0.65);
    border: 1px solid rgba(255, 255, 255, 0.12);
    box-shadow: 0 30px 50px rgba(0, 0, 0, 0.4), 0 0 0 0.5px rgba(255, 255, 255, 0.05) inset;
}

/* 标题 - 深色渐变 */
html[data-theme="dark"] .rr-title {
    background: linear-gradient(135deg, #F9F3E2, #C0E0FF);
    background-clip: text;
    -webkit-background-clip: text;
    color: transparent;
}

html[data-theme="dark"] .rr-title svg {
    color: #FFD966;
    fill: #FFD966;
    filter: drop-shadow(0 0 8px rgba(255, 210, 90, 0.5));
}

/* 副标题 */
html[data-theme="dark"] .rr-sub {
    color: #9aa9c7;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

html[data-theme="dark"] .rr-sub svg {
    color: #FFD966;
    fill: #FFD966;
}

/* 文章卡片 - 深色玻璃态 */
html[data-theme="dark"] .rr-article-card {
    background: rgba(12, 18, 32, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.12);
    box-shadow: 0 20px 35px -12px rgba(0, 0, 0, 0.3);
}

/* 标签 */
html[data-theme="dark"] .rr-article-tag {
    background: rgba(79, 114, 189, 0.25);
    color: #bcd0ff;
    border: 0.5px solid rgba(130, 170, 255, 0.4);
}

/* 文章标题 */
html[data-theme="dark"] .rr-article-title {
    color: #F5F0E8;
}

/* 元信息 */
html[data-theme="dark"] .rr-article-meta {
    color: #8f9bb5;
    border-left: 3px solid #4d7cff;
}

/* 摘要 */
html[data-theme="dark"] .rr-article-excerpt {
    color: #d3deff;
}

/* 阅读全文按钮 */
html[data-theme="dark"] .rr-read-more-btn {
    background: rgba(77, 124, 255, 0.15);
    color: #BCD3FF;
    border: 1px solid rgba(77, 124, 255, 0.4);
}

html[data-theme="dark"] .rr-read-more-btn:hover {
    background: #4d7cff;
    color: #ffffff;
    border-color: #4d7cff;
}

/* 语录 */
html[data-theme="dark"] .rr-inspire-quote {
    color: #7e8bb0;
    border-top: 1px dashed rgba(255, 255, 255, 0.15);
}

html[data-theme="dark"] .rr-inspire-quote svg {
    fill: #6c86c9;
}

/* 随机按钮 - 深色 */
html[data-theme="dark"] .rr-random-btn {
    background: linear-gradient(105deg, #232d4c, #1a1f33);
    color: #F5F2E8;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 8px 18px rgba(0, 0, 0, 0.3), 0 0 0 1px rgba(255, 255, 255, 0.05) inset;
}

html[data-theme="dark"] .rr-random-btn:hover:not(:disabled) {
    background: linear-gradient(105deg, #2f3b62, #23294a);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.4);
    border-color: rgba(100, 150, 250, 0.4);
}

/* 底部 */
html[data-theme="dark"] .rr-footer-note {
    color: #6f7b9e;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

html[data-theme="dark"] .rr-counter {
    background: rgba(70, 90, 130, 0.3);
    color: #a0b0d0;
}

/* ── 响应式 ── */
@media (max-width: 550px) {
    .rr-machine {
        padding: 1.5rem 1.2rem 1.8rem;
        border-radius: 2rem;
    }
    .rr-article-card {
        padding: 1.4rem 1.2rem;
        border-radius: 1.5rem;
    }
    .rr-article-title {
        font-size: 1.4rem;
    }
    .rr-title {
        font-size: 1.8rem;
    }
    .rr-random-btn {
        padding: 0.7rem 1.5rem;
        font-size: 1rem;
    }
    .rr-footer-note {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.6rem;
    }
}

/* ── 触摸设备优化 ── */
@media (hover: none) {
    .rr-article-card:hover {
        transform: none;
        box-shadow: 0 20px 35px -12px rgba(0, 0, 0, 0.1);
    }
    .rr-random-btn:hover:not(:disabled) {
        transform: none;
        box-shadow: 0 8px 18px rgba(99, 102, 241, 0.2), 0 0 0 1px rgba(255, 255, 255, 0.3) inset;
    }
    .rr-read-more-btn:hover {
        transform: none;
    }
}

/* 深色主题触摸优化 */
html[data-theme="dark"] .rr-article-card:hover {
    transform: none;
    box-shadow: 0 20px 35px -12px rgba(0, 0, 0, 0.3);
}

html[data-theme="dark"] .rr-random-btn:hover:not(:disabled) {
    transform: none;
    box-shadow: 0 8px 18px rgba(0, 0, 0, 0.3), 0 0 0 1px rgba(255, 255, 255, 0.05) inset;
}
