/* ===== wenyan-base.css — 两端共享样式 ===== */

.wy-page {
    padding: 16px 0 80px;
}

/* ── 搜索区（两行） ── */
.wy-search-wrap {
    margin: 0 16px 8px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.wy-search-row1 {
    display: flex;
}
.wy-search-row2 {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
}
.wy-search-input {
    flex: 1;
    padding: 10px 14px;
    border: 1px solid var(--color-border);
    border-radius: 20px;
    font-size: 14px;
    outline: none;
    background: var(--color-panel);
    color: var(--color-text);
    box-sizing: border-box;
}
.wy-search-input:focus { border-color: var(--color-brand); }
.wy-search-btn {
    flex-shrink: 0;
    padding: 0 16px;
    height: 40px;
    border: none;
    border-radius: 20px;
    background: var(--color-brand);
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
}
.wy-search-btn:disabled { opacity: .55; cursor: default; }

/* AI 搜索按钮 */
.wy-ai-btn {
    flex-shrink: 0;
    padding: 0 14px;
    height: 40px;
    border: none;
    border-radius: 20px;
    background: var(--color-subtle);
    color: var(--color-text-muted);
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: background .15s, color .15s;
}
.wy-ai-btn.active {
    background: var(--color-brand);
    color: #fff;
}

.wy-search-hint {
    margin: 0 16px 10px;
    font-size: 12px;
    color: var(--color-text-muted);
}

/* ── 卡片分类标签 ── */
.wy-card-tags {
    display: none;
    flex-wrap: wrap;
    gap: 5px;
    padding: 10px 12px 0;
}
.wy-tag {
    font-size: 11px;
    line-height: 1;
    color: var(--color-brand);
    background: var(--color-subtle);
    border: 1px solid var(--color-border-light);
    border-radius: 10px;
    padding: 4px 8px;
    white-space: nowrap;
}

/* ── 轮播舞台 ── */
.wy-stage {
    position: relative;
    overflow: hidden;
    cursor: grab;
    user-select: none;
}
.wy-stage.is-dragging { cursor: grabbing; }

.wy-track {
    display: flex;
    transition: transform .38s cubic-bezier(.4,0,.2,1);
    will-change: transform;
}
.wy-track.no-transition { transition: none; }

/* ── 单张卡片 ── */
.wy-card {
    flex-shrink: 0;
    aspect-ratio: 9 / 16;
    background: var(--color-panel);
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0,0,0,.12);
    display: flex;
    flex-direction: column;
    transition: transform .38s cubic-bezier(.4,0,.2,1), box-shadow .38s, opacity .38s;
    transform-origin: center center;
    will-change: transform;
}

/* 按距中心距离做梯度缩放（中间最大，两侧梯度变小）。
   distance 0 = 当前卡片，±1 = 相邻，±2 = 更远一层，其余溢出隐藏。 */
.wy-card[data-dist="0"] {
    transform: scale(1);
    opacity: 1;
    z-index: 3;
    box-shadow: 0 6px 28px rgba(0,0,0,.18);
}
.wy-card[data-dist="1"],
.wy-card[data-dist="-1"] {
    transform: scale(.88);
    opacity: .72;
    z-index: 2;
    box-shadow: 0 3px 14px rgba(0,0,0,.10);
}
.wy-card[data-dist="2"],
.wy-card[data-dist="-2"] {
    transform: scale(.74);
    opacity: .4;
    z-index: 1;
    box-shadow: 0 2px 8px rgba(0,0,0,.06);
}

/* 图片区 */
.wy-card-img {
    width: 100%;
    aspect-ratio: 4 / 3;
    flex-shrink: 0;
    overflow: hidden;
    background: var(--color-subtle);
}
.wy-card-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    pointer-events: none;
}
.wy-card-img-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 48px;
    color: var(--color-text-faint);
    background: linear-gradient(135deg, var(--color-subtle), var(--color-border));
}

/* 文字区 */
.wy-card-body {
    padding: 16px 20px 18px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    overflow-y: auto;
    flex: 1;
}
/* 白话（paraphrase） */
.wy-card-para {
    font-family: "SySTCT", serif;
    font-size: 12px;
    color: var(--color-text-muted);
    line-height: 1.6;
    text-align: left;
    margin-bottom: 6px;
}
/* 精彩诗句 */
.wy-card-quote {
    font-family: "MiSans", serif;
    font-size: 18px;
    line-height: 1.8;
    color: var(--color-text);
    text-align: center;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--color-border-light);
    margin-bottom: 4px;
}
.wy-card-title {
    font-size: 13px;
    font-weight: 700;
    color: var(--color-text);
    line-height: 1.6;
}
.wy-card-author {
    font-size: 12px;
    color: var(--color-text-muted);
}
/* 诗名·作者容器：默认居中一行 */
.wy-card-meta {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 2px;
    margin-bottom: 6px;
}
.wy-card-meta-sep {
    font-size: 12px;
    color: var(--color-text-faint);
}
/* 全诗内容 */
.wy-card-full {
    font-family: "MiSans", serif;
    font-size: 13px;
    line-height: 2;
    color: var(--color-text-sec);
    text-align: center;
    margin-top: 4px;
    padding-top: 8px;
    border-top: 1px solid var(--color-border-light);
}

/* ── 指示点 ── */
.wy-dots {
    display: none;
}
.wy-dot {
    width: 6px; height: 6px;
    border-radius: 50%;
    background: var(--color-border);
    transition: background .2s, width .2s;
    cursor: pointer;
    flex-shrink: 0;
}
.wy-dot.active {
    width: 18px;
    border-radius: 3px;
    background: var(--color-brand);
}

/* ── 空/错误状态 ── */
.wy-empty {
    text-align: center;
    padding: 80px 20px;
    color: var(--color-text-faint);
    font-size: 14px;
}

/* ── 全屏浏览层 ── */
.wy-fullscreen {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: #000;
    overflow: hidden;
}
.wy-fullscreen.open { display: block; }

.wy-fs-track {
    display: flex;
    height: 100%;
    transition: transform .35s cubic-bezier(.4,0,.2,1);
    will-change: transform;
}
.wy-fs-track.no-transition { transition: none; }

.wy-fs-slide {
    flex-shrink: 0;
    width: 100vw;
    height: 100%;
    position: relative;
}
.wy-fs-slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.wy-fs-slide-placeholder {
    width: 100%;
    height: 100%;
    background: linear-gradient(160deg, #1a1a2e, #16213e, #0f3460);
}
.wy-fs-overlay {
    position: absolute;
    bottom: 0; left: 0; right: 0;
    max-height: 70%;
    overflow-y: auto;
    padding: 48px 28px 60px;
    background: linear-gradient(transparent, rgba(0,0,0,.72) 40%, rgba(0,0,0,.88));
    color: #fff;
}
.wy-fs-quote {
    font-family: "MiSans", serif;
    font-size: 20px;
    line-height: 1.8;
    margin-bottom: 10px;
}
.wy-fs-source {
    font-size: 13px;
    color: rgba(255,255,255,.7);
    margin-bottom: 8px;
}
.wy-fs-title {
    font-size: 14px;
    font-weight: 700;
    color: rgba(255,255,255,.9);
    margin-bottom: 2px;
}
.wy-fs-author {
    font-size: 12px;
    color: rgba(255,255,255,.6);
    margin-bottom: 12px;
}
/* 白话（在诗句之上） */
.wy-fs-para {
    font-size: 12px;
    color: rgba(255,255,255,.55);
    line-height: 1.7;
    margin-bottom: 14px;
}
/* 全诗内容（全屏视图，诗名/作者之后，最小字） */
.wy-fs-full {
    font-family: "MiSans", serif;
    font-size: 13px;
    line-height: 2;
    color: rgba(255,255,255,.6);
    padding-top: 12px;
    border-top: 1px solid rgba(255,255,255,.2);
    white-space: pre-wrap;
}
.wy-fs-close {
    position: absolute;
    top: 16px; right: 16px;
    z-index: 10;
    width: 36px; height: 36px;
    border-radius: 50%;
    border: none;
    background: rgba(0,0,0,.45);
    color: #fff;
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(4px);
}

/* safe-area 适配 */
@supports (padding-bottom: env(safe-area-inset-bottom)) {
    .wy-fs-overlay {
        padding-bottom: calc(60px + env(safe-area-inset-bottom));
    }
}

/* 暗色 */
html[data-theme="dark"] .wy-card {
    box-shadow: 0 4px 20px rgba(0,0,0,.4);
}
html[data-theme="dark"] .wy-card:not(.is-active) {
    box-shadow: 0 2px 10px rgba(0,0,0,.3);
}

/* ── 视图 tab（全部 / 我的收藏） ── */
.wy-tab {
    width: 36px;
    height: 36px;
    padding: 0;
    border: 1.5px solid var(--color-border);
    border-radius: 50%;
    background: none;
    color: var(--color-text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background .15s, color .15s, border-color .15s;
}
.wy-tab svg {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}
.wy-tab.active {
    background: var(--color-brand);
    border-color: var(--color-brand);
    color: #fff;
}
.wy-tab.active svg {
    stroke: #fff;
}

/* ── card 底部操作栏（收藏/评论/红心） ── */
.wy-card-actions {
    display: flex;
    align-items: center;
    justify-content: space-around;
    padding: 8px 12px 10px;
    border-top: 1px solid var(--color-border-light);
    margin-top: auto;
    flex-shrink: 0;
    gap: 4px;
}
.wy-action-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 8px;
    transition: background .15s;
    color: var(--color-text-muted);
    font-size: 11px;
    line-height: 1;
    min-width: 40px;
}
.wy-action-btn:hover { background: var(--color-subtle); }
.wy-action-btn svg {
    width: 17px;
    height: 17px;
    stroke: currentColor;
    fill: none;
    stroke-width: 1.8;
    flex-shrink: 0;
}
/* 已激活状态 */
.wy-action-btn.active-collect svg { fill: var(--color-aux-cyan); stroke: var(--color-aux-cyan); }
.wy-action-btn.active-like    svg { fill: #e33; stroke: #e33; }
.wy-action-btn.active-collect { color: var(--color-aux-cyan); }
.wy-action-btn.active-like    { color: #e33; }
.wy-action-btn.wy-btn-save:disabled { opacity: 0.4; pointer-events: none; }
/* 数量为 0 时隐藏占位 span */
.wy-action-btn span.wy-count-hidden { display: none; }

/* ── 评论 Sheet（全屏浮层，两端共用结构）── */
.wy-cmt-sheet {
    display: flex;
    position: fixed;
    inset: 0;
    z-index: 1000;
    align-items: stretch;
    justify-content: flex-end;
    visibility: hidden;
    pointer-events: none;
}
.wy-cmt-sheet.open {
    visibility: visible;
    pointer-events: auto;
}

.wy-cmt-backdrop {
    position: absolute;
    inset: 0;
    background: var(--overlay-dim);
    opacity: 0;
    transition: opacity .28s ease;
}
.wy-cmt-sheet.open .wy-cmt-backdrop {
    opacity: 1;
}
.wy-cmt-panel {
    position: relative;
    width: 340px;
    height: 100%;
    background: var(--color-panel);
    border-radius: 16px 0 0 16px;
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow-modal);
    transform: translateX(100%);
    transition: transform .28s cubic-bezier(.32,0,.2,1);
}
.wy-cmt-sheet.open .wy-cmt-panel {
    transform: translateX(0);
}
.wy-cmt-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px 10px;
    border-bottom: 1px solid var(--color-border-light);
    flex-shrink: 0;
}
.wy-cmt-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--color-text);
}
.wy-cmt-close {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 16px;
    color: var(--color-text-muted);
    padding: 2px 6px;
    line-height: 1;
}
.wy-cmt-list {
    flex: 1;
    overflow-y: auto;
    padding: 10px 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}
/* 单条留言：头像左 + 气泡右 */
.wy-cmt-item {
    display: flex;
    gap: 10px;
    align-items: flex-start;
}
.wy-cmt-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
    background: var(--color-subtle);
    border: 1px solid var(--color-border-light);
}
.wy-cmt-avatar-placeholder {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    flex-shrink: 0;
    background: var(--color-subtle);
    border: 1px solid var(--color-border-light);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    color: var(--color-text-faint);
}
.wy-cmt-bubble {
    flex: 1;
    min-width: 0;
    background: #fff;
    border: 1px solid var(--color-border);
    border-radius: 4px 12px 12px 12px;
    padding: 8px 12px;
    box-shadow: 0 1px 4px rgba(0,0,0,.06);
}
html[data-theme="dark"] .wy-cmt-bubble {
    background: var(--color-panel);
}
.wy-cmt-bubble-top {
    display: flex;
    align-items: baseline;
    gap: 6px;
    margin-bottom: 4px;
}
.wy-cmt-author {
    font-size: 12px;
    font-weight: 600;
    color: var(--color-text);
}
.wy-cmt-time {
    font-size: 11px;
    color: var(--color-text-faint);
}
.wy-cmt-content {
    font-size: 13px;
    color: var(--color-text-sec);
    line-height: 1.6;
    word-break: break-all;
}
.wy-cmt-item--pending .wy-cmt-content {
    color: var(--color-text-muted);
}
.wy-cmt-empty {
    font-size: 13px;
    color: var(--color-text-faint);
    text-align: center;
    padding: 24px 0;
}
.wy-cmt-input-row {
    display: flex;
    gap: 8px;
    align-items: center;
    padding: 10px 16px;
    border-bottom: 1px solid var(--color-border-light);
    flex-shrink: 0;
}
.wy-cmt-input {
    flex: 1;
    border: 1px solid var(--color-border);
    border-radius: 20px;
    padding: 8px 14px;
    font-size: 13px;
    background: var(--color-subtle);
    color: var(--color-text);
    outline: none;
    min-width: 0;
}
.wy-cmt-input:focus { border-color: var(--color-brand); outline: none; }
.wy-cmt-submit {
    flex-shrink: 0;
    padding: 8px 16px;
    border: none;
    border-radius: 20px;
    background: var(--color-brand);
    color: #fff;
    font-size: 13px;
    cursor: pointer;
    font-weight: 600;
}
.wy-cmt-submit:disabled { opacity: .5; cursor: default; }
.wy-search-keywords {
    margin: 0 16px 6px;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: var(--color-text-muted);
}
.wy-search-keywords-label {
    color: var(--color-text-faint);
    flex-shrink: 0;
}
.wy-kw-tag {
    background: var(--color-subtle);
    border: 1px solid var(--color-border-light);
    border-radius: 10px;
    padding: 2px 8px;
    color: var(--color-brand);
    font-size: 11px;
    cursor: pointer;
    transition: background .15s;
}
.wy-kw-tag:hover {
    background: var(--color-border-light);
}
