/**
 * Riven WP 自定义短代码样式
 * 提醒框、时间线、下载、回复可见、折叠面板、选项卡、复选框
 */

/* === 通用：防止 li 黑点 === */
.riven-notice, .riven-notice-content,
.riven-timeline, .riven-timeline-item,
.riven-download, .riven-download-desc,
.riven-hide-notice, .riven-hide-content,
.riven-collapse, .riven-collapse-body,
.riven-tabs, .riven-tab-panel,
.riven-check {
    list-style: none;
}

/* === 提醒框 === */
.riven-notice {
    --notice-accent: #5470a6;
    align-items: flex-start;
    display: flex;
    gap: 11px;
    margin: 14px 0;
    padding: 12px 15px;
    border: 1px solid color-mix(in srgb, var(--notice-accent) 28%, #ddd);
    border-radius: 8px;
    background: color-mix(in srgb, var(--notice-accent) 9%, #fff);
    color: color-mix(in srgb, var(--notice-accent) 72%, #333);
    font: 500 15px/1.8 inherit;
}
.riven-notice-icon {
    flex: 0 0 auto;
    width: 19px;
    height: 19px;
    margin-top: 4px;
    color: var(--notice-accent);
    fill: color-mix(in srgb, var(--notice-accent) 16%, #fff);
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 2;
}
.riven-notice-icon circle {
    stroke: currentColor;
    stroke-width: 1.6;
}
.riven-notice-content { min-width: 0; }
.riven-notice-content p { margin: 0 0 8px; }
.riven-notice-content p:last-child { margin-bottom: 0; }
.riven-notice-content > :last-child { margin-bottom: 0; }
.riven-notice + .riven-notice { margin-top: 10px; }

.riven-notice-red   { --notice-accent: #b85249; }
.riven-notice-green { --notice-accent: #4f8a62; }
.riven-notice-orange{ --notice-accent: #b77a32; }
.riven-notice-blue  { --notice-accent: #4d78a8; }

/* 暗色模式 */
:root[data-theme="dark"] .riven-notice {
    background: color-mix(in srgb, var(--notice-accent) 18%, #1a1a1a);
    border-color: color-mix(in srgb, var(--notice-accent) 28%, #444);
}
:root[data-theme="dark"] .riven-notice-icon {
    fill: color-mix(in srgb, var(--notice-accent) 14%, #1a1a1a);
    stroke-width: 2.1;
}
:root[data-theme="dark"] .riven-notice-red   { --notice-accent: #e17970; }
:root[data-theme="dark"] .riven-notice-green { --notice-accent: #76b889; }
:root[data-theme="dark"] .riven-notice-orange{ --notice-accent: #dfa052; }
:root[data-theme="dark"] .riven-notice-blue  { --notice-accent: #78a7d6; }

/* === 时间线 === */
.riven-timeline {
    position: relative;
    padding-left: 28px;
    margin: 16px 0;
}
.riven-timeline::before {
    content: '';
    position: absolute;
    left: 8px;
    top: 4px;
    bottom: 4px;
    width: 2px;
    background: #d4c5b5;
    border-radius: 1px;
}
.riven-timeline-item { position: relative; padding-bottom: 20px; }
.riven-timeline-item:last-child { padding-bottom: 0; }
.riven-timeline-dot {
    position: absolute;
    left: -24px;
    top: 4px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #8b6f5e;
    border: 2px solid #fff;
    box-shadow: 0 0 0 2px #d4c5b5;
}
.riven-timeline-time { font-size: 13px; color: #8b7355; font-weight: 500; margin-bottom: 4px; }
.riven-timeline-content { font-size: 14px; line-height: 1.7; color: #5a4a40; }
.riven-timeline-content p { margin: 0; }

:root[data-theme="dark"] .riven-timeline::before { background: #4a3f35; }
:root[data-theme="dark"] .riven-timeline-dot { background: #c4a882; border-color: #2a2520; box-shadow: 0 0 0 2px #4a3f35; }
:root[data-theme="dark"] .riven-timeline-time { color: #b0a090; }
:root[data-theme="dark"] .riven-timeline-content { color: #c0b0a0; }

/* === 下载 === */
.riven-download {
    display: block;
    width: 50%;
    margin: 16px auto;
    padding: 16px;
    border: 1px dashed color-mix(in srgb, var(--text-secondary, #8b7355) 55%, var(--line-secondary, #e8ddd0));
    border-radius: 8px;
    background: color-mix(in srgb, var(--bg-card, #faf8f5) 88%, #f2f2f2);
    color: var(--text-primary, #3a3028);
    text-decoration: none;
    box-sizing: border-box;
}
.riven-download-head {
    align-items: center;
    display: flex;
    gap: 12px;
    justify-content: space-between;
    min-width: 0;
}
.riven-download-file {
    align-items: center;
    display: flex;
    gap: 10px;
    min-width: 0;
}
.riven-download-icon {
    width: 32px;
    height: 32px;
    padding: 8px;
    border-radius: 4px;
    background: color-mix(in srgb, var(--text-muted, #a09080) 12%, var(--line-soft, #f0ebe5));
    color: color-mix(in srgb, var(--text-primary, #3a3028) 72%, var(--text-secondary, #8b7355));
    fill: none;
    flex: 0 0 auto;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 2.5;
}
.riven-download-name {
    color: inherit;
    font: 600 16px/1.45 var(--font-main, -apple-system, sans-serif);
    min-width: 0;
    overflow-wrap: anywhere;
}
.riven-download-attrs {
    display: grid;
    gap: 6px;
    margin-top: 12px;
}
.riven-download-attr {
    align-items: baseline;
    color: var(--text-secondary, #8b7355);
    display: flex;
    font: 500 13px/1.5 var(--font-main, sans-serif);
    gap: 16px;
    justify-content: space-between;
    min-width: 0;
}
.riven-download-attr-name,
.riven-download-attr-value {
    min-width: 0;
    overflow-wrap: anywhere;
}
.riven-download-attr-name { color: var(--text-secondary, #8b7355); }
.riven-download-attr-value {
    color: var(--text-secondary, #8b7355);
    flex: 0 1 auto;
    font-weight: 500;
    text-align: right;
}
.riven-download-action {
    align-self: center;
    align-items: center;
    display: inline-flex;
    gap: 4px;
    justify-content: center;
    min-width: 78px;
    padding: 7px 10px;
    border-radius: 4px;
    background: color-mix(in srgb, #1e90ff 14%, var(--bg-card, #fff));
    color: #1e90ff;
    font: 700 13px/1 var(--font-main, sans-serif);
    text-decoration: none;
    white-space: nowrap;
    flex-shrink: 0;
}
.riven-download-action:hover {
    background: color-mix(in srgb, #1e90ff 20%, var(--bg-card, #fff));
    color: #1e90ff;
}
.riven-download-action-icon {
    width: 13px;
    height: 13px;
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 2.6;
}
.riven-download-desc {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid var(--line-soft, #e8ddd0);
    font-size: 13px;
    color: var(--text-secondary, #8b7355);
    line-height: 1.6;
}
.riven-download-desc p { margin: 0; }

:root[data-theme="dark"] .riven-download {
    background: color-mix(in srgb, var(--bg-card, #1e1a16) 88%, var(--bg-soft, #141414));
    border-color: color-mix(in srgb, var(--text-secondary, #a09080) 46%, var(--line-secondary, #3a3028));
}
@media (max-width: 560px) {
    .riven-download { width: 100%; padding: 14px; }
    .riven-download-head { gap: 12px; }
    .riven-download-icon { width: 30px; height: 30px; padding: 8px; }
}

/* === 回复可见 === */
.riven-hide-notice {
    display: flex; align-items: center; justify-content: center;
    gap: 8px; padding: 20px;
    background: #faf8f5; border: 1px dashed #d4c5b5;
    border-radius: 8px; margin: 16px 0;
    color: #8b7355; font-size: 14px;
}
.riven-hide-icon { width: 20px; height: 20px; color: #8b7355; }
.riven-hide-content {
    background: #f0fdf4; border: 1px solid #bbf7d0;
    border-radius: 8px; padding: 14px 16px;
    margin: 16px 0; font-size: 14px; line-height: 1.7; color: #166534;
}
:root[data-theme="dark"] .riven-hide-notice { background: #1e1a16; border-color: #3a3028; color: #a09080; }
:root[data-theme="dark"] .riven-hide-content { background: rgba(34,197,94,.1); border-color: rgba(34,197,94,.3); color: #86efac; }

/* === 折叠面板 === */
.riven-collapse { border: 1px solid #e8ddd0; border-radius: 8px; margin: 16px 0; overflow: hidden; }
.riven-collapse-btn {
    display: flex; align-items: center; width: 100%;
    padding: 12px 16px; background: #faf8f5; border: none;
    cursor: pointer; font-size: 15px; font-weight: 500;
    color: #3a3028; text-align: left; transition: background .2s;
}
.riven-collapse-btn:hover { background: #f0ebe5; }
.riven-collapse-btn::before {
    content: ''; display: inline-block;
    width: 0; height: 0;
    border-left: 6px solid #8b7355;
    border-top: 4px solid transparent;
    border-bottom: 4px solid transparent;
    margin-right: 10px; transition: transform .2s;
}
.riven-collapse-btn.collapsed::before { transform: rotate(0); }
.riven-collapse-btn:not(.collapsed)::before { transform: rotate(90deg); }
.riven-collapse-body { max-height: 0; overflow: hidden; transition: max-height .3s ease; }
.riven-collapse-body.show { max-height: 2000px; }
.riven-collapse-body > * { padding: 0 16px; }
.riven-collapse-body > :first-child { padding-top: 14px; }
.riven-collapse-body > :last-child { padding-bottom: 14px; }

:root[data-theme="dark"] .riven-collapse { border-color: #3a3028; }
:root[data-theme="dark"] .riven-collapse-btn { background: #1e1a16; color: #e0d0c0; }
:root[data-theme="dark"] .riven-collapse-btn:hover { background: #2a2520; }
:root[data-theme="dark"] .riven-collapse-btn::before { border-left-color: #b0a090; }

/* === 选项卡 === */
.riven-tabs { margin: 16px 0; border: 1px solid #e8ddd0; border-radius: 8px; overflow: hidden; }
.riven-tab-nav {
    display: flex; background: #faf8f5;
    border-bottom: 1px solid #e8ddd0; overflow-x: auto;
}
.riven-tab-btn {
    padding: 10px 18px; background: none; border: none;
    border-bottom: 2px solid transparent; cursor: pointer;
    font-size: 14px; color: #8b7355; white-space: nowrap;
    transition: all .2s;
}
.riven-tab-btn:hover { color: #3a3028; }
.riven-tab-btn.active { color: #8b6f5e; border-bottom-color: #8b6f5e; font-weight: 500; }
.riven-tab-content { padding: 0; }
.riven-tab-panel { display: none; padding: 14px 16px; font-size: 14px; line-height: 1.7; }
.riven-tab-panel.active { display: block; }
.riven-tab-panel p { margin: 0 0 10px; }
.riven-tab-panel p:last-child { margin-bottom: 0; }

:root[data-theme="dark"] .riven-tabs { border-color: #3a3028; }
:root[data-theme="dark"] .riven-tab-nav { background: #1e1a16; border-bottom-color: #3a3028; }
:root[data-theme="dark"] .riven-tab-btn { color: #a09080; }
:root[data-theme="dark"] .riven-tab-btn:hover { color: #e0d0c0; }
:root[data-theme="dark"] .riven-tab-btn.active { color: #c4a882; border-bottom-color: #c4a882; }

/* === 复选框 === */
.riven-check {
    display: flex; align-items: center; gap: 8px;
    padding: 6px 0; cursor: default; user-select: none;
}
.riven-check-icon { width: 18px; height: 18px; flex-shrink: 0; }
.riven-check span { font-size: 14px; color: #5a4a40; line-height: 1.6; }
.riven-check.checked span { color: #8b7355; }
:root[data-theme="dark"] .riven-check span { color: #c0b0a0; }
:root[data-theme="dark"] .riven-check.checked span { color: #c4a882; }

/* === 视频 === */
.riven-video {
    position: relative;
    width: 100%;
    margin: 16px 0;
    border-radius: 10px;
    overflow: hidden;
    background: #000;
}
.riven-video video,
.riven-video iframe {
    display: block;
    width: 100%;
    height: auto;
    border: 0;
    border-radius: 10px;
    aspect-ratio: 16 / 9;
    background: #111;
}

/* === 图库 === */
.riven-photo-row {
    display: flex;
    gap: 8px;
    width: 100%;
    margin: 14px 0;
    flex-wrap: wrap;
}
.riven-photo-item {
    flex: 1 1 0;
    min-width: 0;
    display: block;
    border: 1px solid #e8ddd0;
    border-radius: 8px;
    overflow: hidden;
    transition: transform .2s ease, box-shadow .2s ease;
}
.riven-photo-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(62, 57, 52, 0.1);
}
.riven-photo-item img {
    display: block;
    width: 100%;
    height: auto;
    aspect-ratio: 16 / 10;
    margin: 0;
    border-radius: 0;
    object-fit: cover;
    cursor: pointer;
}

:root[data-theme="dark"] .riven-photo-item { border-color: #3a3028; }
:root[data-theme="dark"] .riven-photo-item:hover { box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3); }

/* === 文章卡片 === */
.riven-postcard {
    display: block;
    position: relative;
    width: 50%;
    margin: 16px auto;
    padding: 12px 12px 8px;
    border: 1px solid var(--line-soft, #e8ddd0);
    border-radius: 6px;
    background: color-mix(in srgb, var(--bg-card, #faf8f5) 88%, #f1f1f1);
    color: var(--text-primary, #3a3028);
    text-decoration: none;
}
.riven-postcard-badge {
    position: absolute;
    top: 8px;
    right: 8px;
    padding: 2px 6px;
    border-radius: 999px;
    background: color-mix(in srgb, var(--accent-brown, #8b6f5e) 12%, var(--bg-card, #faf8f5));
    color: var(--accent-brown, #8b6f5e);
    font: 600 11px/1.4 var(--font-main, sans-serif);
}
.riven-postcard:hover {
    border-color: color-mix(in srgb, var(--accent-brown, #8b6f5e) 42%, var(--line-secondary, #d4c5b5));
}
.riven-postcard-main {
    align-items: center;
    display: flex;
    gap: 12px;
}
.riven-postcard-main > span {
    display: grid;
    flex: 1 1 auto;
    gap: 4px;
    min-width: 0;
    padding-right: 46px;
}
.riven-postcard-icon {
    flex: 0 0 auto;
    width: 34px;
    height: 34px;
    padding: 8px;
    border-radius: 50%;
    background: color-mix(in srgb, var(--accent-brown, #8b6f5e) 12%, var(--bg-card, #faf8f5));
    color: var(--accent-brown, #8b6f5e);
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 1.8;
}
.riven-postcard-main strong {
    display: block;
    color: var(--text-primary, #3a3028);
    font: 700 15px/1.5 var(--font-main, sans-serif);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.riven-postcard-main em,
.riven-postcard > small {
    color: var(--text-secondary, #8b7355);
    font: 500 12px/1.4 var(--font-main, sans-serif);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.riven-postcard-main em {
    display: block;
    min-width: 0;
    font-style: normal;
}
.riven-postcard > small {
    display: block;
    margin-top: 10px;
    padding-top: 7px;
    border-top: 1px solid var(--line-soft, #e8ddd0);
    align-items: center;
    justify-content: space-between;
}
.riven-postcard > small b,
.riven-postcard > small time {
    color: inherit;
    font: inherit;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.riven-postcard > small time {
    flex: 0 0 auto;
    margin-left: 8px;
}

:root[data-theme="dark"] .riven-postcard {
    background: color-mix(in srgb, var(--bg-card, #1e1a16) 88%, var(--bg-soft, #141414));
    border-color: var(--line-primary, #3a3028);
}
@media (max-width: 560px) {
    .riven-postcard { width: 100%; }
    .riven-postcard-main > span { padding-right: 42px; }
}

/* === 音乐播放器 === */
.riven-music-card {
    display: grid;
    grid-template-columns: 72px 1fr 34px;
    align-items: center;
    gap: 12px;
    margin: 16px 0;
    padding: 12px 14px;
    border: 1px solid #e8ddd0;
    border-radius: 10px;
    background: #faf8f5;
}
.riven-music-cover {
    position: relative;
    width: 72px;
    height: 72px;
    padding: 0;
    border: none;
    border-radius: 50%;
    background: linear-gradient(135deg, #d4c5b5 0%, #8b6f5e 50%, #5a4a40 100%);
    cursor: pointer;
    overflow: hidden;
    flex-shrink: 0;
    transition: transform .3s ease;
}
.riven-music-cover span {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 18px;
    height: 18px;
    transform: translate(-50%, -50%);
    border-radius: 50%;
    background: #faf8f5;
    z-index: 1;
}
/* 唱片纹路 */
.riven-music-cover::before {
    content: '';
    position: absolute;
    inset: 8px;
    border-radius: 50%;
    border: 1px solid rgba(255,255,255,0.08);
    background: repeating-radial-gradient(
        circle at center,
        transparent 0px,
        transparent 3px,
        rgba(255,255,255,0.04) 3px,
        rgba(255,255,255,0.04) 4px
    );
}
.riven-music-card.playing .riven-music-cover {
    animation: riven-vinyl-spin 4s linear infinite;
}
@keyframes riven-vinyl-spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}
.riven-music-body {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}
.riven-music-title {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: #3a3028;
    line-height: 1.5;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.riven-music-status {
    display: block;
    font-size: 12px;
    color: #a09080;
    line-height: 1.4;
}
.riven-music-controls {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-top: 2px;
}
.riven-music-progress {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 4px;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 2px;
    background: #e0d5c8;
    cursor: pointer;
    outline: none;
}
.riven-music-progress::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #8b6f5e;
    border: 2px solid #fff;
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
    cursor: pointer;
    transition: transform .15s ease;
}
.riven-music-progress::-webkit-slider-thumb:hover {
    transform: scale(1.2);
}
.riven-music-progress::-moz-range-thumb {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #8b6f5e;
    border: 2px solid #fff;
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
    cursor: pointer;
}
.riven-music-progress::-moz-range-track {
    height: 4px;
    border-radius: 2px;
    background: #e0d5c8;
    border: 0;
}
.riven-music-time {
    display: block;
    font-size: 11px;
    color: #a09080;
    line-height: 1;
    font-variant-numeric: tabular-nums;
}
.riven-music-play {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    padding: 0;
    border: none;
    border-radius: 50%;
    background: #8b6f5e;
    color: #fff;
    cursor: pointer;
    flex-shrink: 0;
    transition: background .2s, transform .15s;
}
.riven-music-play:hover {
    background: #6b5040;
    transform: scale(1.06);
}
.riven-music-play svg {
    width: 16px;
    height: 16px;
    fill: currentColor;
}
.riven-music-card.playing .riven-music-play {
    background: #6b5040;
}

/* 音乐 - 暗色模式 */
:root[data-theme="dark"] .riven-music-card { background: #1e1a16; border-color: #3a3028; }
:root[data-theme="dark"] .riven-music-cover { background: linear-gradient(135deg, #4a3f35 0%, #6b5040 50%, #3a3028 100%); }
:root[data-theme="dark"] .riven-music-cover span { background: #1e1a16; }
:root[data-theme="dark"] .riven-music-title { color: #e0d0c0; }
:root[data-theme="dark"] .riven-music-status { color: #8b7355; }
:root[data-theme="dark"] .riven-music-progress { background: #3a3028; }
:root[data-theme="dark"] .riven-music-progress::-webkit-slider-thumb { background: #c4a882; border-color: #1e1a16; }
:root[data-theme="dark"] .riven-music-progress::-moz-range-thumb { background: #c4a882; border-color: #1e1a16; }
:root[data-theme="dark"] .riven-music-progress::-moz-range-track { background: #3a3028; }
:root[data-theme="dark"] .riven-music-time { color: #8b7355; }
:root[data-theme="dark"] .riven-music-play { background: #6b5040; }
:root[data-theme="dark"] .riven-music-play:hover { background: #8b6f5e; }
:root[data-theme="dark"] .riven-music-card.playing .riven-music-play { background: #8b6f5e; }

/* === 响应式 === */
@media (max-width: 600px) {
    .riven-music-card {
        grid-template-columns: 56px 1fr 30px;
        gap: 10px;
        padding: 10px 12px;
    }
    .riven-music-cover {
        width: 56px;
        height: 56px;
    }
    .riven-music-cover span {
        width: 14px;
        height: 14px;
    }
    .riven-music-play {
        width: 30px;
        height: 30px;
    }
    .riven-music-play svg {
        width: 14px;
        height: 14px;
    }
    .riven-photo-row {
        flex-wrap: wrap;
    }
    .riven-photo-item {
        flex: 1 1 calc(50% - 4px);
        min-width: calc(50% - 4px);
    }
}
