/* ========================================
   article_detail.css - 文章详情页样式
   风格：简约可爱，延续「愉你无关」统一主题
   ======================================== */

:root {
    --color-pink: #EE82EE;
    --color-pink-light: rgba(238, 130, 238, 0.12);
    --color-blue: #7EC8E3;
    --color-blue-light: #e8f7ff;
    --color-text: #333;
    --color-text-light: #888;
    --color-border: #f0e6e6;
    --radius: 18px;
    --shadow: 0 8px 30px rgba(0, 0, 0, 0.08);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background: linear-gradient(180deg, #e8f7ff 0%, #ffffe0 100%);
    background-attachment: fixed;
    font-family: '微软雅黑', 'Microsoft YaHei', sans-serif;
    color: var(--color-text);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ---- 顶部导航条 ---- */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 80px;
    background-color: #ADD8E6;
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.5);
    z-index: 1000;
}

.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 15px;
    height: 80px;
}

.nav-logo {
    flex-shrink: 0;
    white-space: nowrap;
}

.nav-logo a {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    font-size: 20px;
    font-weight: bold;
    color: #FAF0E6;
}

.nav-logo a>span {
    font-size: 20px;
    font-weight: bold;
    color: #FAF0E6;
    white-space: nowrap;
}

.nav-logo a>img {
    width: 50px;
    height: 44px;
}

.nav-menu {
    display: flex;
    gap: 4px;
    list-style: none;
    padding: 0;
    margin: 0;
}

.nav-menu li {
    border-radius: 4px;
    transition: background-color 0.3s;
}

.nav-menu li:hover {
    background-color: rgba(255, 255, 255, 0.3);
}

.nav-menu a {
    display: block;
    padding: 6px 14px;
    text-decoration: none;
    color: var(--color-pink);
    font-size: 15px;
    font-weight: 500;
    white-space: nowrap;
}

.nav-menu a:hover {
    background-color: #FFF5EE;
    border-radius: 4px;
}

/* ---- 主体 ---- */
.detail-main {
    flex: 1;
    width: 82%;
    max-width: 860px;
    margin: 110px auto 40px;
    position: relative;
    z-index: 1;
}

.detail-card {
    background: #fff;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    border: 2px solid var(--color-border);
    padding: 40px 46px;
}

/* 分类徽章 */
.detail-category {
    margin-bottom: 14px;
}

.cat-badge {
    display: inline-block;
    font-size: 12px;
    color: #fff;
    background: linear-gradient(135deg, var(--color-pink), #DDA0DD);
    padding: 3px 14px;
    border-radius: 20px;
}

/* 标题 */
.detail-title {
    font-size: 28px;
    font-weight: bold;
    line-height: 1.5;
    color: #2c3e50;
    margin-bottom: 16px;
}

/* 作者信息行 */
.detail-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    padding-bottom: 20px;
    border-bottom: 2px dashed var(--color-border);
    margin-bottom: 26px;
    font-size: 13px;
    color: var(--color-text-light);
}

.meta-avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    border: 2px solid var(--color-pink);
    object-fit: cover;
}

.meta-author {
    color: var(--color-pink);
    font-weight: bold;
    text-decoration: none;
}

.meta-author:hover {
    text-decoration: underline;
}

.meta-sep {
    color: #ddd;
}

/* 正文 */
.detail-content {
    font-size: 15.5px;
    line-height: 2;
    color: #444;
}

.detail-content p {
    margin-bottom: 16px;
}

/* 点赞区 */
.detail-like {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 26px 0 6px;
}

.btn-up {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 26px;
    border: 2px solid var(--color-pink);
    background: #fff;
    color: var(--color-pink);
    border-radius: 999px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    font-family: '微软雅黑', sans-serif;
    transition: all 0.25s;
}

.btn-up:hover {
    background: var(--color-pink-light);
    transform: translateY(-2px);
}

.btn-up:active {
    transform: scale(0.94);
}

.btn-up.up-active {
    background: linear-gradient(135deg, #EE82EE, #DDA0DD);
    color: #fff;
    border-color: transparent;
    box-shadow: 0 4px 14px rgba(238, 130, 238, 0.35);
}

.up-msg {
    font-size: 13px;
}

/* ---- 评论区 ---- */
.comment-section {
    margin-top: 24px;
    background: #fff;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    border: 2px solid var(--color-border);
    padding: 28px 34px;
}

.comment-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-bottom: 14px;
    border-bottom: 2px dashed var(--color-border);
    margin-bottom: 22px;
}

.comment-title {
    font-size: 18px;
    font-weight: bold;
    color: #2c3e50;
}

.comment-count-badge {
    font-size: 12px;
    color: #fff;
    background: linear-gradient(135deg, #EE82EE, #DDA0DD);
    padding: 3px 14px;
    border-radius: 20px;
    box-shadow: 0 3px 10px rgba(238, 130, 238, 0.25);
}

/* 输入区：头像 + 输入卡片 */
.comment-editor {
    display: flex;
    gap: 14px;
    margin-bottom: 26px;
}

.editor-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 2px solid var(--color-pink);
    object-fit: cover;
    flex-shrink: 0;
    margin-top: 2px;
}

.editor-main {
    flex: 1;
}

.comment-textarea {
    width: 100%;
    min-height: 88px;
    border: 2px solid #eef3f6;
    background: #fafcfe;
    border-radius: 14px;
    padding: 12px 16px;
    font-size: 14px;
    font-family: '微软雅黑', sans-serif;
    color: var(--color-text);
    resize: vertical;
    box-sizing: border-box;
    transition: all 0.3s;
}

.comment-textarea::placeholder {
    color: #b3c0cc;
}

.comment-textarea:focus {
    outline: none;
    background: #fff;
    border-color: var(--color-pink);
    box-shadow: 0 4px 16px rgba(238, 130, 238, 0.12);
}

.comment-textarea.input-error {
    border-color: #e74c3c;
    background: #fffafa;
    box-shadow: 0 0 0 3px rgba(231, 76, 60, 0.08);
}

.editor-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 10px;
}

.reply-target {
    font-size: 13px;
    color: var(--color-pink);
    cursor: pointer;
    background: var(--color-pink-light);
    padding: 5px 14px;
    border-radius: 16px;
    display: none;
    transition: all 0.25s;
}

.reply-target:hover {
    background: rgba(238, 130, 238, 0.25);
}

.reply-target:not(:empty) {
    display: inline-block;
}

.reply-target:not(:empty) ~ .editor-hint {
    display: none;
}

.editor-hint {
    font-size: 12px;
    color: #b3c0cc;
}

.editor-count {
    margin-left: auto;
    font-size: 12px;
    color: #b3c0cc;
}

.btn-comment {
    padding: 9px 28px;
    border: none;
    border-radius: 999px;
    background: linear-gradient(135deg, var(--color-pink), #DDA0DD);
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    font-family: '微软雅黑', sans-serif;
    transition: all 0.25s;
    box-shadow: 0 4px 14px rgba(238, 130, 238, 0.25);
}

.btn-comment:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(238, 130, 238, 0.4);
}

.btn-comment:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* 评论列表 */
.comment-list {
    list-style: none;
}

.comment-status {
    min-height: 18px;
    margin-top: 8px;
    font-size: 13px;
    color: var(--color-text-light);
}

.comment-status:not(:empty) {
    padding: 9px 12px;
    border-radius: 12px;
}

.comment-status.is-info {
    background: #eef8ff;
    color: #2f86b8;
    border: 1px solid #cfeeff;
}

.comment-status.is-error {
    background: #fff0f0;
    color: #d64545;
    border: 1px solid #ffd0d0;
}

.comment-status.is-success {
    background: #eefaf2;
    color: #26945a;
    border: 1px solid #c9efd8;
}

.comment-item {
    display: flex;
    gap: 12px;
    padding: 16px 12px;
    border-radius: 12px;
    transition: background-color 0.25s;
}

.comment-item:hover {
    background: #fdf8fc;
}

.comment-item + .comment-item {
    border-top: 1px dashed #f0f0f0;
}

/* 回复评论微缩进，用 @徽章 区分 */
.comment-item.comment-reply {
    padding-left: 26px;
}

.comment-avatar {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    border: 2px solid var(--color-pink);
    object-fit: cover;
    flex-shrink: 0;
}

.comment-main {
    flex: 1;
    min-width: 0;
}

.comment-top {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 6px;
}

.c-user {
    font-weight: bold;
    font-size: 14px;
    color: var(--color-pink);
}

.c-to {
    font-size: 12px;
    color: #4a9fd4;
    background: var(--color-blue-light);
    padding: 2px 10px;
    border-radius: 12px;
}

.c-time {
    font-size: 12px;
    color: #b8c4ce;
    margin-left: auto;
}

.c-text {
    font-size: 14.5px;
    color: #444;
    line-height: 1.9;
    word-break: break-word;
}

.c-reply {
    margin-top: 6px;
    font-size: 12px;
    color: #a8b4bf;
    background: none;
    border: none;
    cursor: pointer;
    padding: 2px 10px;
    border-radius: 10px;
    transition: all 0.25s;
    font-family: '微软雅黑', sans-serif;
}

.c-reply:hover {
    color: var(--color-pink);
    background: var(--color-pink-light);
}

/* 新评论入场动画 */
@keyframes comment-in {
    from { opacity: 0; transform: translateY(-8px); }
    to   { opacity: 1; transform: translateY(0); }
}

.comment-item.comment-new {
    animation: comment-in 0.35s ease;
}

.comment-empty {
    text-align: center;
    padding: 40px 0 30px;
    color: #b3c0cc;
    font-size: 14px;
    list-style: none;
}

/* 标签区 */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 22px;
    padding-top: 18px;
    border-top: 1px dashed var(--color-border);
}

.pagination a,
.page-info {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 36px;
    padding: 8px 14px;
    border-radius: 999px;
    font-size: 13px;
    text-decoration: none;
}

.pagination a {
    color: var(--color-pink);
    background: var(--color-pink-light);
    border: 1px solid rgba(238, 130, 238, 0.22);
    transition: transform 0.2s, background 0.2s, color 0.2s;
}

.pagination a:hover,
.pagination a:focus {
    color: #fff;
    background: var(--color-pink);
    transform: translateY(-1px);
}

.page-info {
    color: #4a9fd4;
    background: var(--color-blue-light);
}

.detail-tags {
    margin-top: 28px;
    padding-top: 18px;
    border-top: 2px dashed var(--color-border);
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    align-items: center;
}

.detail-tag {
    background: var(--color-blue-light);
    color: #4a9fd4;
    font-size: 13px;
    padding: 4px 14px;
    border-radius: 16px;
    cursor: pointer;
    transition: all 0.3s;
}

.detail-tag:hover {
    background: var(--color-pink);
    color: #fff;
}

/* 底部操作 */
.detail-actions {
    display: flex;
    gap: 12px;
    margin-top: 30px;
    flex-wrap: wrap;
}

.btn {
    display: inline-block;
    padding: 10px 28px;
    border-radius: 999px;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.25s;
    font-family: '微软雅黑', sans-serif;
}

.btn-primary {
    background: linear-gradient(135deg, var(--color-pink), #DDA0DD);
    color: #fff;
    box-shadow: 0 4px 14px rgba(238, 130, 238, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(238, 130, 238, 0.4);
    color: #fff;
}

.btn-ghost {
    background: var(--color-blue-light);
    color: #4a9fd4;
}

.btn-ghost:hover {
    transform: translateY(-2px);
    background: #d9f0fd;
    color: #2f86b8;
}

/* 文章不存在兜底 */
.detail-empty {
    text-align: center;
    padding: 60px 0;
    color: #999;
}

/* ---- 页脚 ---- */
footer {
    width: 100%;
    height: 50px;
    line-height: 50px;
    text-align: center;
    background: linear-gradient(90deg, #FFB6C1, #FF1493);
    color: #fff;
    font-size: 14px;
    letter-spacing: 2px;
    margin-top: auto;
}

/* ---- 响应式 ---- */
@media screen and (max-width: 768px) {
    .detail-main {
        width: 94%;
        margin-top: 100px;
    }

    .detail-card {
        padding: 24px 20px;
    }

    .detail-title {
        font-size: 22px;
    }

    .nav-menu a {
        padding: 6px 8px;
        font-size: 13px;
    }

    .comment-section {
        padding: 24px 18px;
    }

    .comment-editor {
        gap: 10px;
    }

    .editor-bar {
        flex-wrap: wrap;
    }

    .editor-count {
        margin-left: 0;
    }

    .btn-comment {
        width: 100%;
    }
}
