/* ========================================
   回忆详情页 - Q萌卡通风格 📖✨
   ======================================== */

/* --- 详情页整体容器 --- */
.detail-view {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
    animation: detailBounceIn 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes detailBounceIn {
    from {
        opacity: 0;
        transform: translateY(25px) scale(0.97);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* --- 返回按钮 --- */
.detail-back {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 22px;
    border: 2px solid rgba(255, 142, 199, 0.15);
    background: #fff;
    color: #b794f6;
    border-radius: 50px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 700;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    margin-bottom: 24px;
    box-shadow: 0 2px 8px rgba(255, 142, 199, 0.06);
}

.detail-back:hover {
    background: #fff0f6;
    border-color: #ff8ec7;
    color: #ff8ec7;
    transform: translateX(-4px) scale(1.02);
    box-shadow: 0 4px 15px rgba(255, 142, 199, 0.15);
}

.detail-back svg {
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.detail-back:hover svg {
    transform: translateX(-4px);
}

/* --- 文章头部 --- */
.detail-header {
    margin-bottom: 28px;
    padding-bottom: 24px;
    border-bottom: 2px dashed rgba(255, 142, 199, 0.12);
}

.detail-mood {
    font-size: 52px;
    margin-bottom: 12px;
    display: inline-block;
    animation: moodWiggle 2.5s ease-in-out infinite;
}

@keyframes moodWiggle {
    0%, 100% {
        transform: translateY(0) rotate(0deg);
    }
    25% {
        transform: translateY(-8px) rotate(-5deg);
    }
    75% {
        transform: translateY(-4px) rotate(5deg);
    }
}

.detail-title {
    font-size: 2rem;
    font-family: 'ZCOOL KuaiLe', cursive, sans-serif;
    font-weight: 700;
    color: #5a3e6f;
    margin: 0 0 16px 0;
    line-height: 1.4;
    background: linear-gradient(135deg, #ff8ec7, #b794f6);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.detail-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    font-size: 14px;
    color: #8b6e9e;
}

.detail-meta-item {
    display: flex;
    align-items: center;
    gap: 6px;
}

/* --- 封面图 --- */
.detail-cover {
    width: 100%;
    border-radius: 24px;
    overflow: hidden;
    margin-bottom: 32px;
    box-shadow: 0 8px 30px rgba(255, 142, 199, 0.12);
    border: 2px solid rgba(255, 142, 199, 0.08);
}

.detail-cover img {
    width: 100%;
    height: auto;
    max-height: 450px;
    object-fit: cover;
    display: block;
    transition: transform 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.detail-cover:hover img {
    transform: scale(1.03);
}

/* --- 文章正文（Markdown 渲染区） --- */
.detail-body {
    color: #5a3e6f;
    font-family: var(--font-article);
    font-size: 16px;
    line-height: 1.8;
    word-break: break-word;
    background: white;
    border-radius: 24px;
    padding: 32px;
    box-shadow: 0 4px 20px rgba(255, 142, 199, 0.06);
    border: 2px solid rgba(255, 142, 199, 0.06);
}

.detail-body h1,
.detail-body h2,
.detail-body h3,
.detail-body h4,
.detail-body h5,
.detail-body h6 {
    color: #5a3e6f;
    margin: 1.5em 0 0.6em;
    font-weight: 700;
    line-height: 1.4;
}

.detail-body h1 {
    font-size: 24px;
}

.detail-body h2 {
    font-size: 20px;
    border-bottom: 2px dashed rgba(255, 142, 199, 0.2);
    padding-bottom: 8px;
}

.detail-body h3 {
    font-size: 18px;
}

.detail-body p {
    margin: 0 0 1em;
}

.detail-body a {
    color: #b794f6;
    text-decoration: underline;
    text-decoration-color: rgba(183, 148, 246, 0.3);
    transition: all 0.2s ease;
}

.detail-body a:hover {
    color: #ff8ec7;
    text-decoration-color: #ff8ec7;
}

.detail-body img {
    max-width: 100%;
    border-radius: 16px;
    margin: 16px 0;
    box-shadow: 0 4px 15px rgba(255, 142, 199, 0.08);
}

.detail-body blockquote {
    border-left: 4px solid #ff8ec7;
    margin: 16px 0;
    padding: 12px 20px;
    background: rgba(255, 142, 199, 0.04);
    border-radius: 0 14px 14px 0;
    color: #8b6e9e;
}

.detail-body pre {
    background: #2d2040;
    color: #e2d8f0;
    border-radius: 16px;
    padding: 16px 20px;
    overflow-x: auto;
    margin: 16px 0;
    border: 2px solid rgba(183, 148, 246, 0.15);
}

.detail-body code {
    font-family: 'JetBrains Mono', 'Fira Code', 'Consolas', monospace;
    font-size: 14px;
}

.detail-body :not(pre)>code {
    background: rgba(183, 148, 246, 0.1);
    padding: 2px 8px;
    border-radius: 8px;
    font-size: 0.9em;
    color: #b794f6;
}

.detail-body ul,
.detail-body ol {
    margin: 12px 0;
    padding-left: 24px;
}

.detail-body li {
    margin-bottom: 6px;
}

.detail-body table {
    width: 100%;
    border-collapse: collapse;
    margin: 16px 0;
    border-radius: 14px;
    overflow: hidden;
}

.detail-body th,
.detail-body td {
    padding: 10px 14px;
    border: 1px solid #f0e0f6;
    text-align: left;
}

.detail-body th {
    background: #fdf5ff;
    font-weight: 700;
    color: #5a3e6f;
}

.detail-body hr {
    border: none;
    border-top: 2px dashed rgba(255, 142, 199, 0.15);
    margin: 32px 0;
}

/* --- 互动栏（点赞 + 统计） --- */
.detail-actions {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 20px 0;
    margin: 28px 0;
    border-top: 2px dashed rgba(255, 142, 199, 0.1);
    border-bottom: 2px dashed rgba(255, 142, 199, 0.1);
}

.action-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 22px;
    border: 2px solid #f0e0f6;
    background: white;
    color: #8b6e9e;
    border-radius: 50px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 700;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    box-shadow: 0 2px 8px rgba(255, 142, 199, 0.04);
}

.action-btn:hover {
    background: #fff0f6;
    border-color: #ff8ec7;
    color: #ff8ec7;
    transform: translateY(-2px) scale(1.03);
    box-shadow: 0 6px 18px rgba(255, 142, 199, 0.15);
}

.action-btn.liked {
    background: linear-gradient(135deg, rgba(255, 142, 199, 0.1), rgba(255, 107, 157, 0.1));
    border-color: #ff8ec7;
    color: #ff8ec7;
}

.action-btn.liked .like-icon {
    animation: likeAnim 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes likeAnim {
    0% { transform: scale(1); }
    25% { transform: scale(1.4) rotate(-10deg); }
    50% { transform: scale(0.85) rotate(5deg); }
    100% { transform: scale(1) rotate(0deg); }
}

.action-btn .like-icon {
    font-size: 18px;
}

.action-stat {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: #b8a0c8;
}

.action-spacer {
    flex: 1;
}

.edit-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 18px;
    border: 2px solid rgba(183, 148, 246, 0.25);
    background: rgba(183, 148, 246, 0.06);
    color: #b794f6;
    border-radius: 50px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 700;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.edit-btn:hover {
    background: rgba(183, 148, 246, 0.12);
    border-color: #b794f6;
    transform: translateY(-2px) scale(1.03);
    box-shadow: 0 4px 15px rgba(183, 148, 246, 0.2);
}

/* --- 评论区 --- */
.comments-section {
    margin-top: 36px;
    background: white;
    border-radius: 24px;
    padding: 28px;
    box-shadow: 0 4px 20px rgba(255, 142, 199, 0.06);
    border: 2px solid rgba(255, 142, 199, 0.06);
}

.comments-title {
    font-size: 20px;
    font-family: 'ZCOOL KuaiLe', cursive, sans-serif;
    font-weight: 700;
    color: #5a3e6f;
    margin-bottom: 24px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.comments-title .count-badge {
    font-size: 13px;
    background: linear-gradient(135deg, rgba(255, 142, 199, 0.12), rgba(183, 148, 246, 0.12));
    color: #b794f6;
    padding: 2px 12px;
    border-radius: 50px;
    font-weight: 700;
}

/* --- 评论输入框 --- */
.comment-form {
    display: flex;
    gap: 12px;
    margin-bottom: 28px;
    align-items: flex-start;
}

.comment-avatar {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: linear-gradient(135deg, #ff8ec7, #b794f6);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    color: #fff;
    flex-shrink: 0;
    box-shadow: 0 3px 10px rgba(255, 142, 199, 0.2);
}

.comment-input-wrap {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.comment-input {
    width: 100%;
    min-height: 80px;
    padding: 14px 16px;
    border: 2px solid #f0e0f6;
    background: #fdf5ff;
    color: #5a3e6f;
    border-radius: 16px;
    font-size: 14px;
    font-family: inherit;
    resize: vertical;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    box-sizing: border-box;
}

.comment-input:focus {
    outline: none;
    border-color: #ff8ec7;
    background: white;
    box-shadow: 0 0 0 4px rgba(255, 142, 199, 0.08);
    transform: scale(1.01);
}

.comment-input::placeholder {
    color: #b8a0c8;
}

.comment-submit-row {
    display: flex;
    justify-content: flex-end;
}

.comment-submit {
    padding: 8px 24px;
    border: none;
    background: linear-gradient(135deg, #ff8ec7, #b794f6);
    color: #fff;
    border-radius: 50px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 700;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    box-shadow: 0 3px 12px rgba(255, 142, 199, 0.25);
}

.comment-submit:hover {
    transform: translateY(-2px) scale(1.03);
    box-shadow: 0 6px 20px rgba(255, 142, 199, 0.35);
}

.comment-submit:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* --- 评论列表 --- */
.comment-list {
    display: flex;
    flex-direction: column;
}

.comment-item {
    padding: 16px 0;
    border-bottom: 2px dashed rgba(255, 142, 199, 0.06);
    animation: detailBounceIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.comment-item:last-child {
    border-bottom: none;
}

.comment-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
}

.comment-author {
    font-size: 14px;
    font-weight: 700;
    color: #b794f6;
}

.comment-time {
    font-size: 12px;
    color: #b8a0c8;
}

.comment-content {
    font-size: 14px;
    color: #5a3e6f;
    line-height: 1.6;
    margin-bottom: 8px;
}

.comment-actions {
    display: flex;
    gap: 16px;
}

.comment-action-btn {
    border: none;
    background: none;
    color: #b8a0c8;
    font-size: 12px;
    cursor: pointer;
    padding: 2px 0;
    transition: all 0.2s ease;
    font-weight: 600;
}

.comment-action-btn:hover {
    color: #b794f6;
}

.comment-action-btn.danger:hover {
    color: #ff6b9d;
}

/* --- 嵌套回复 --- */
.comment-replies {
    margin-left: 40px;
    margin-top: 4px;
    border-left: 3px solid rgba(255, 142, 199, 0.12);
    padding-left: 16px;
}

.reply-form {
    margin-top: 12px;
    margin-left: 40px;
    display: flex;
    gap: 10px;
    align-items: flex-start;
    animation: detailBounceIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.reply-input {
    flex: 1;
    min-height: 40px;
    padding: 10px 14px;
    border: 2px solid #f0e0f6;
    background: #fdf5ff;
    color: #5a3e6f;
    border-radius: 14px;
    font-size: 13px;
    font-family: inherit;
    resize: none;
    box-sizing: border-box;
    transition: all 0.3s ease;
}

.reply-input:focus {
    outline: none;
    border-color: #ff8ec7;
    background: white;
    box-shadow: 0 0 0 3px rgba(255, 142, 199, 0.08);
}

.reply-submit {
    padding: 10px 16px;
    border: none;
    background: linear-gradient(135deg, #ff8ec7, #b794f6);
    color: #fff;
    border-radius: 50px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 700;
    white-space: nowrap;
    box-shadow: 0 2px 8px rgba(255, 142, 199, 0.2);
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.reply-submit:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(255, 142, 199, 0.3);
}

/* --- 空评论状态 --- */
.comments-empty {
    text-align: center;
    padding: 40px 20px;
    color: #b8a0c8;
    font-size: 14px;
}

.comments-empty-icon {
    font-size: 44px;
    margin-bottom: 12px;
    animation: moodWiggle 3s ease-in-out infinite;
}

/* --- 评论点赞按钮 --- */
.comment-like-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    transition: all 0.2s ease;
}

.comment-like-btn .like-heart {
    font-size: 14px;
    transition: transform 0.2s;
}

.comment-like-btn:hover .like-heart {
    transform: scale(1.2);
}

.comment-like-btn.liked {
    color: #ff6b9d !important;
}

.comment-like-btn .like-num {
    font-size: 12px;
    min-width: 8px;
}

/* --- 置顶评论 --- */
.comment-item.pinned {
    background: linear-gradient(135deg, rgba(255,142,199,0.04), rgba(183,148,246,0.04));
    border-radius: 12px;
    padding: 16px !important;
    margin: -4px -4px 4px -4px;
    border: 1px dashed rgba(255,142,199,0.15);
}

.comment-pin-badge {
    font-size: 11px;
    color: #ff8ec7;
    font-weight: 700;
    background: rgba(255,142,199,0.08);
    padding: 1px 8px;
    border-radius: 20px;
}

/* --- @回复标识 --- */
.comment-reply-to {
    color: #b794f6;
    font-weight: 700;
    font-size: 13px;
    margin-right: 6px;
    cursor: default;
}

/* --- 编辑模式弹窗 --- */
.edit-overlay {
    position: fixed;
    inset: 0;
    background: rgba(255, 200, 230, 0.3);
    backdrop-filter: blur(10px);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: overlayFadeIn 0.3s ease;
}

@keyframes overlayFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.edit-panel {
    width: 90%;
    max-width: 700px;
    max-height: 85vh;
    background: white;
    border-radius: 28px;
    padding: 32px;
    overflow-y: auto;
    overflow-x: hidden;
    box-shadow: 0 25px 60px rgba(255, 142, 199, 0.18);
    border: 2px solid rgba(255, 142, 199, 0.08);
}

.edit-panel h2 {
    color: #5a3e6f;
    margin: 0;
    font-size: 20px;
    font-family: 'ZCOOL KuaiLe', cursive, sans-serif;
    background: linear-gradient(135deg, #ff8ec7, #b794f6);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.edit-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
}

.edit-header-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.draft-status {
    font-family: inherit;
    animation: draftPulse 2s ease-in-out infinite;
}

@keyframes draftPulse {
    0%, 100% { opacity: 0.6; }
    50% { opacity: 1; }
}

/* 日期快捷按钮 */
.date-shortcut-btn {
    padding: 2px 10px;
    border: 1.5px solid #f0e0f6;
    background: #fdf5ff;
    color: #8b6e9e;
    border-radius: 20px;
    cursor: pointer;
    font-size: 11px;
    font-weight: 600;
    transition: all 0.2s ease;
}

.date-shortcut-btn:hover {
    background: linear-gradient(135deg, #ff8ec7, #b794f6);
    color: #fff;
    border-color: transparent;
    transform: scale(1.05);
}

/* 日期快捷按钮内联到 label 旁 */
.date-shortcuts-inline {
    display: inline-flex;
    gap: 4px;
    margin-left: 8px;
    vertical-align: middle;
}

/* ===== Toggle 开关 ===== */
.toggle-label {
    display: inline-flex;
    align-items: center;
    vertical-align: middle;
    gap: 8px;
    cursor: pointer;
    font-size: 13px;
    color: #8b6e9e;
    font-weight: 700;
    white-space: nowrap;
    user-select: none;
    line-height: 1;
}

.toggle-input {
    display: none !important;
    width: 0 !important;
    height: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
}

.toggle-slider {
    display: inline-block;
    position: relative;
    width: 44px;
    min-width: 44px;
    height: 24px;
    background: #fff0f6;
    border-radius: 12px;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    flex-shrink: 0;
    border: 2px solid #ff8ec7;
    box-sizing: border-box;
    vertical-align: middle;
}

.toggle-slider::after {
    content: '';
    position: absolute;
    /* 24px total - 4px borders = 20px inner; knob 14px => (20-14)/2 = 3px */
    top: 3px;
    left: 3px;
    width: 14px;
    height: 14px;
    background: #ff8ec7;
    border-radius: 50%;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    box-shadow: 0 1px 4px rgba(255, 142, 199, 0.3);
}

.toggle-input:checked + .toggle-slider {
    background: #ff8ec7 !important;
    border-color: #ff8ec7 !important;
    box-shadow: 0 0 10px rgba(255, 142, 199, 0.5);
}

.toggle-input:checked + .toggle-slider::after {
    /* 44px - 4px borders - 14px knob - 3px offset = 23px */
    left: 23px;
    background: #fff;
    box-shadow: 0 1px 6px rgba(255, 142, 199, 0.4);
}

/* 字段标题行：左侧 label + 右侧 toggle */
.edit-label-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
    gap: 8px;
    min-width: 0;
}

.edit-label-row > label {
    margin-bottom: 0 !important;
}

.edit-label-row > label:first-child {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.edit-label-row > .toggle-label {
    flex-shrink: 0;
    margin-right: 48px;
}

/* 小号 Toggle（工具栏） */
.toggle-slider-sm {
    width: 36px;
    min-width: 36px;
    height: 20px;
    border-radius: 10px;
}

.toggle-slider-sm::after {
    /* 20px - 4px borders = 16px inner; knob 10px => (16-10)/2 = 3px */
    top: 3px;
    left: 3px;
    width: 10px;
    height: 10px;
}

.toggle-input:checked + .toggle-slider-sm::after {
    /* 36px - 4px borders - 10px knob - 3px = 19px */
    left: 19px;
}

.toggle-label-sm {
    font-size: 12px;
    gap: 5px;
}

/* 预览 toggle 在工具栏内 */
.md-preview-toggle {
    margin-left: auto;
    padding: 0 10px;
    margin-right: 48px;
}

/* 封面上传区域 */
.cover-upload-zone {
    border: 2px dashed #f0e0f6;
    border-radius: 14px;
    padding: 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    background: #fdf5ff;
    position: relative;
    overflow: hidden;
    min-height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.cover-upload-zone:hover,
.cover-upload-zone.drag-over {
    border-color: #ff8ec7;
    background: #fff0f6;
    box-shadow: 0 0 0 4px rgba(255, 142, 199, 0.08);
}

.cover-upload-placeholder {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #b8a0c8;
    font-size: 13px;
}

.cover-upload-icon {
    font-size: 20px;
}

.cover-preview-img {
    max-width: 100%;
    max-height: 120px;
    border-radius: 10px;
    object-fit: cover;
}

.edit-field {
    margin-bottom: 20px;
}

.edit-field label {
    display: block;
    font-size: 13px;
    color: #8b6e9e;
    margin-bottom: 8px;
    font-weight: 700;
}

.edit-field input,
.edit-field textarea,
.edit-field select {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #f0e0f6;
    background: #fdf5ff;
    color: #5a3e6f;
    border-radius: 14px;
    font-size: 14px;
    font-family: inherit;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    box-sizing: border-box;
}

.edit-field input:focus,
.edit-field textarea:focus,
.edit-field select:focus {
    outline: none;
    border-color: #ff8ec7;
    background: #fff;
    box-shadow: 0 0 0 4px rgba(255, 142, 199, 0.08);
    transform: scale(1.01);
}

.edit-field select {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url("/assets/svg/chevron-down.svg");
    background-repeat: no-repeat;
    background-position: right 14px center;
    padding-right: 40px;
    cursor: pointer;
}

.edit-field select:hover {
    border-color: #ffb6d9;
    background-color: #fff0f6;
}

/* 自定义下拉组件 */
.custom-select-wrap {
    position: relative;
}

.custom-select-trigger {
    width: 100%;
    padding: 12px 40px 12px 16px;
    border: 2px solid #f0e0f6;
    background: #fdf5ff;
    color: #5a3e6f;
    border-radius: 14px;
    font-size: 14px;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    box-sizing: border-box;
    display: flex;
    align-items: center;
    gap: 6px;
    user-select: none;
    position: relative;
}

.custom-select-trigger::after {
    content: '';
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    width: 12px;
    height: 8px;
    background-image: url("/assets/svg/chevron-down.svg");
    background-repeat: no-repeat;
    transition: transform 0.3s ease;
}

.custom-select-wrap.open .custom-select-trigger::after {
    transform: translateY(-50%) rotate(180deg);
}

.custom-select-trigger:hover {
    border-color: #ffb6d9;
    background-color: #fff0f6;
}

.custom-select-wrap.open .custom-select-trigger {
    border-color: #ff8ec7;
    background: #fff;
    box-shadow: 0 0 0 4px rgba(255, 142, 199, 0.08);
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
}

.custom-select-options {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #fff;
    border: 2px solid #ff8ec7;
    border-top: none;
    border-radius: 0 0 14px 14px;
    max-height: 200px;
    overflow-y: auto;
    z-index: 100;
    box-shadow: 0 8px 24px rgba(255, 142, 199, 0.15);
}

.custom-select-wrap.open .custom-select-options {
    display: block;
    animation: selectFadeIn 0.2s ease;
}

@keyframes selectFadeIn {
    from { opacity: 0; transform: translateY(-4px); }
    to { opacity: 1; transform: translateY(0); }
}

.custom-select-option {
    padding: 10px 16px;
    cursor: pointer;
    font-size: 14px;
    color: #5a3e6f;
    transition: all 0.15s ease;
    display: flex;
    align-items: center;
    gap: 6px;
}

.custom-select-option:hover {
    background: #fff0f6;
    color: #ff69b4;
}

.custom-select-option.selected {
    background: linear-gradient(135deg, rgba(255,142,199,0.1), rgba(183,148,246,0.1));
    color: #ff69b4;
    font-weight: 600;
}

.custom-select-option:last-child {
    border-radius: 0 0 12px 12px;
}

.edit-field textarea {
    min-height: 200px;
    resize: vertical;
    font-family: 'JetBrains Mono', 'Fira Code', 'Consolas', monospace;
    font-size: 13px;
    line-height: 1.6;
}

.edit-md-hint {
    font-size: 12px;
    color: #b8a0c8;
    margin-top: 6px;
}

.edit-buttons {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    margin-top: 24px;
}

.edit-cancel {
    padding: 10px 24px;
    border: 2px solid #f0e0f6;
    background: #fdf5ff;
    color: #8b6e9e;
    border-radius: 50px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 700;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.edit-cancel:hover {
    background: #fff0f6;
    border-color: #ffc2e2;
    transform: translateY(-2px);
}

.edit-save {
    padding: 10px 28px;
    border: none;
    background: linear-gradient(135deg, #ff8ec7, #b794f6);
    color: #fff;
    border-radius: 50px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 700;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    box-shadow: 0 4px 15px rgba(255, 142, 199, 0.3);
}

.edit-save:hover {
    transform: translateY(-2px) scale(1.03);
    box-shadow: 0 6px 20px rgba(255, 142, 199, 0.4);
}

/* --- 加载状态 --- */
.detail-loading {
    text-align: center;
    padding: 80px 20px;
    color: #b8a0c8;
}

.detail-loading .spinner {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(255, 142, 199, 0.15);
    border-top-color: #ff8ec7;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 0 auto 16px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* --- Quill 编辑器容器 --- */
.quill-editor-wrap {
    background: white;
    border-radius: 14px;
    display: flex;
    flex-direction: column;
    border: 2px solid #f0e0f6;
    overflow: hidden;
}

.ql-toolbar.ql-snow {
    border: none !important;
    border-bottom: 2px solid #f0e0f6 !important;
    background: #fdf5ff;
    border-top-left-radius: 14px;
    border-top-right-radius: 14px;
}

.ql-container.ql-snow {
    border: none !important;
    font-size: 16px;
    font-family: inherit;
    border-bottom-left-radius: 14px;
    border-bottom-right-radius: 14px;
}

.ql-editor {
    min-height: 200px;
}

/* --- 响应式 --- */
@media (max-width: 640px) {
    .detail-view {
        padding: 16px;
    }

    .detail-title {
        font-size: 1.5rem;
    }

    .detail-meta {
        flex-direction: column;
        gap: 8px;
    }

    .detail-body {
        padding: 20px;
        border-radius: 18px;
    }

    .detail-actions {
        flex-wrap: wrap;
        gap: 12px;
    }

    .comments-section {
        padding: 20px;
        border-radius: 18px;
    }

    .comment-replies {
        margin-left: 20px;
    }

    .edit-panel {
        padding: 20px;
        width: 95%;
        border-radius: 20px;
        overflow-x: hidden;
    }

    .edit-label-row {
        flex-wrap: wrap;
        gap: 6px;
    }
}

/* --- 导航按钮 (上一篇/下一篇) --- */
.nav-arrow-btn {
    border: 2px solid transparent;
    background: transparent;
    color: #b8a0c8;
    font-size: 14px;
    cursor: pointer;
    padding: 5px 12px;
    border-radius: 50px;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    font-weight: 700;
}

.nav-arrow-btn:hover {
    background: #fff0f6;
    color: #ff8ec7;
    border-color: rgba(255, 142, 199, 0.15);
    transform: scale(1.05);
}

.detail-nav-row {
    border-bottom: 2px dashed rgba(255, 142, 199, 0.1);
    padding-bottom: 15px;
    margin-bottom: 20px;
}