/* ================================
   kafuu.me - 主人屋网站样式
   Author: 筑紫喵 🐱
   Style: Modern, Clean, Responsive
   ================================ */

/* 全局 code 字体重置 - 放在最前面 */
code {
    font-family: 'Fira Code', Consolas, monospace !important;
}

/* 文章内联代码 - 浅色背景深色文字（只匹配 p, li, td 等容器内的 code，不匹配 pre 内的 code） */
.article-body p code,
.article-content p code,
.article-body li code,
.article-content li code,
.article-body td code,
.article-content td code,
.article-body span code,
.article-content span code {
    background: #f0f0f5 !important;
    color: #1a1a2e !important;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.9em;
    font-family: 'Noto Sans SC', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

/* 代码块样式 - 必须放在内联代码后面，并使用更高明确性 */
pre.highlight,
.article-body pre.highlight,
.article-content pre.highlight {
    background: #1e1e2e !important;
    border-radius: 8px;
    padding: 0 !important;
    overflow-x: auto;
    margin: 0 0 1.5em 0;
    border: 1px solid #333;
    line-height: 1.6;
    -webkit-background-clip: initial !important;
    -webkit-text-fill-color: initial !important;
    background-clip: initial !important;
    font-family: 'Noto Sans SC', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

pre.highlight code,
.article-body pre.highlight code,
.article-content pre.highlight code {
    background: transparent !important;
    color: white !important;
    font-family: 'Noto Sans SC', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif !important;
    font-size: 14px !important;
    line-height: 1.6;
    margin: 0 !important;
    padding: 16px 20px !important;
    border: none !important;
    -webkit-text-fill-color: white !important;
    display: block;
    white-space: pre;
}

/* ============= 全局变量 ============= */
:root {
    --primary-color: #667eea;
    --secondary-color: #764ba2;
    --accent-color: #f093fb;
    --text-primary: #1a1a2e;
    --text-secondary: #4a4a68;
    --bg-primary: #ffffff;
    --bg-secondary: #f8f9fa;
    --border-color: #e0e0e8;
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.12);
    --transition-fast: 0.2s ease;
    --transition-normal: 0.3s ease;
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
}

/* ============= 基础重置 ============= */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Noto Sans SC', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    color: var(--text-primary);
    background-color: var(--bg-primary);
    line-height: 1.6;
    overflow-x: hidden;
}

a {
    text-decoration: none;
    color: inherit;
    transition: color var(--transition-fast);
}

ul {
    list-style: none;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* ============= 容器 ============= */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
}

/* ============= 导航栏 ============= */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: white;
    box-shadow: var(--shadow-sm);
    z-index: 1000;
    transition: all var(--transition-normal);
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 16px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 24px;
    font-weight: 700;
    color: var(--primary-color);
    transition: transform var(--transition-fast);
}

.logo:hover {
    transform: scale(1.05);
}

.nav-menu {
    display: flex;
    align-items: center;
    gap: 32px;
}

.nav-menu a {
    font-weight: 500;
    color: var(--text-secondary);
    position: relative;
    padding: 4px 0;
}

.nav-menu a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
    transition: width var(--transition-normal);
}

.nav-menu a:hover,
.nav-menu a.active {
    color: var(--primary-color);
}

.nav-menu a:hover::after,
.nav-menu a.active::after {
    width: 100%;
}

/* menuButton - from C:\tmp\not_no\menuButton.html */
#menuButton {
    font-size: 3px; width: 10em; height: 10em; position: relative;
    display: flex; flex-direction: column; justify-content: space-around;
    -webkit-user-select: none; -moz-user-select: none; -ms-user-select: none; user-select: none;
    display: none;
}
.menuButtonLi { width: 100%; height: 1em; background-color: #00ffc3; border-radius: 20px; transition: 0.6s; }
.menuButtonLiA { width: 100%; position: relative; top: 3.334em; transform: rotate(135deg); }
.menuButtonLiB { background-color: transparent; }
.menuButtonLiC { width: 100%; position: relative; top: -3.334em; transform: rotate(-135deg); }
#menuButtonLi1, #menuButtonLi3 { width: 60%; }


.mobile-menu-btn span {
    width: 24px;
    height: 2px;
    background: var(--text-primary);
    transition: all var(--transition-fast);
}

/* ============= Hero 区域 ============= */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 120px 24px 80px;
    position: relative;
    overflow: hidden;
    background: linear-gradient(135deg, #f5f7fa 0%, #e4e8ec 100%);
}

.hero-content {
    text-align: center;
    max-width: 800px;
    z-index: 1;
}

.hero-title {
    font-size: clamp(32px, 5vw, 56px);
    font-weight: 700;
    margin-bottom: 16px;
    line-height: 1.2;
}

.gradient-text {
    background: linear-gradient(137deg, #00ebb4, #00C9A7);
    background: linear-gradient(135deg, #22c55e, #3b82f6, #a855f7);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-subtitle {
    font-size: clamp(16px, 2.5vw, 20px);
    color: var(--text-secondary);
    margin-bottom: 32px;
}

.hero-actions {
    display: flex;
    gap: 16px;
    justify-content: center;
    margin-bottom: 48px;
    flex-wrap: wrap;
}

.btn {
    padding: 12px 32px;
    border-radius: var(--radius-md);
    font-weight: 500;
    font-size: 16px;
    cursor: pointer;
    transition: all var(--transition-normal);
    display: inline-block;
    border: 2px solid transparent;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    box-shadow: var(--shadow-md);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.btn-secondary {
    background: white;
    color: var(--text-primary);
    border: 2px solid var(--border-color);
}

.btn-secondary:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.btn-outline {
    background: transparent;
    color: var(--primary-color);
    border: 2px solid var(--primary-color);
}

.btn-outline:hover {
    background: var(--primary-color);
    color: white;
}

.hero-social {
    display: flex;
    gap: 24px;
    justify-content: center;
}

.social-link {
    font-size: 24px;
    opacity: 0.7;
    transition: all var(--transition-fast);
}

.social-link:hover {
    opacity: 1;
    transform: scale(1.2);
}

/* 装饰元素 */
.hero-decoration {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
    overflow: hidden;
}

.floating-shapes {
    position: absolute;
    width: 100%;
    height: 100%;
}

.shape {
    position: absolute;
    border-radius: 50%;
    opacity: 0.35;
    animation: float 20s infinite ease-in-out;
}

/* 大泡泡 */
.shape-1 {
    width: 400px;
    height: 400px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    top: -5%;
    left: -5%;
    animation-delay: 0s;
}

.shape-2 {
    width: 300px;
    height: 300px;
    background: linear-gradient(135deg, #f093fb, #4facfe);
    bottom: 10%;
    right: -5%;
    animation-delay: -7s;
}

/* 中泡泡 */
.shape-3 {
    width: 200px;
    height: 200px;
    background: linear-gradient(135deg, #4facfe, #00f2fe);
    top: 20%;
    right: 10%;
    animation-delay: -14s;
}

.shape-4 {
    width: 180px;
    height: 180px;
    background: linear-gradient(135deg, #a8edea, #fed6e3);
    bottom: 30%;
    left: 5%;
    animation-delay: -3s;
}

/* 小泡泡 */
.shape-5 {
    width: 120px;
    height: 120px;
    background: linear-gradient(135deg, #f5576c, #f093fb);
    top: 55%;
    left: 20%;
    animation-delay: -10s;
}

.shape-6 {
    width: 90px;
    height: 90px;
    background: linear-gradient(135deg, #667eea, #f093fb);
    top: 10%;
    right: 30%;
    animation-delay: -5s;
}

.shape-7 {
    width: 70px;
    height: 70px;
    background: linear-gradient(135deg, #00f2fe, #4facfe);
    bottom: 20%;
    left: 35%;
    animation-delay: -12s;
}

.shape-8 {
    width: 110px;
    height: 110px;
    background: linear-gradient(135deg, #764ba2, #667eea);
    top: 65%;
    right: 5%;
    animation-delay: -8s;
}

@keyframes float {
    0%, 100% {
        transform: translate(0, 0) rotate(0deg);
    }
    25% {
        transform: translate(30px, -30px) rotate(90deg);
    }
    50% {
        transform: translate(-20px, 20px) rotate(180deg);
    }
    75% {
        transform: translate(20px, 30px) rotate(270deg);
    }
}

/* ============= 通用部分样式 ============= */
.section-title {
    font-size: clamp(24px, 3vw, 32px);
    font-weight: 700;
    margin-bottom: 40px;
    text-align: center;
    position: relative;
}

.section-title::after {
    content: '';
    display: block;
    width: 60px;
    height: 4px;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
    margin: 16px auto 0;
    border-radius: 2px;
}

section {
    padding: 80px 0;
}

/* ============= 博客部分 ============= */
.blog-section {
    background: var(--bg-secondary);
}

.blog-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 32px;
    margin-bottom: 40px;
}

.blog-card {
    background: white;
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: all var(--transition-normal);
}

.blog-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-lg);
}

.blog-image {
    height: 200px;
    position: relative;
    padding: 16px;
}

.blog-category {
    position: absolute;
    top: 16px;
    left: 16px;
    background: rgba(255, 255, 255, 0.95);
    padding: 6px 12px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 500;
}

.blog-content {
    padding: 24px;
}

.blog-title {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 12px;
    line-height: 1.4;
    /* 组合使用，兼容性更好 */
    overflow-wrap: break-word;  /* 正常情况在单词边界换行 */
    word-break: break-all;      /* 实在不行就在任意字符换行 */
}

.blog-excerpt {
    color: var(--text-secondary);
    margin-bottom: 16px;
    font-size: 15px;
}

.blog-meta {
    display: flex;
    gap: 16px;
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 16px;
}

.blog-link {
    color: var(--primary-color);
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.blog-link:hover {
    text-decoration: underline;
}

.section-footer {
    text-align: center;
}

/* ============= 日志部分 ============= */
.logs-list {
    max-width: 800px;
    margin: 0 auto;
}

.log-item {
    display: flex;
    gap: 24px;
    padding: 24px;
    background: white;
    border-radius: var(--radius-md);
    margin-bottom: 16px;
    box-shadow: var(--shadow-sm);
    transition: all var(--transition-fast);
}

.log-item:hover {
    transform: translateX(4px);
    box-shadow: var(--shadow-md);
}

.log-date {
    font-weight: 600;
    color: var(--primary-color);
    min-width: 100px;
    padding-top: 4px;
}

.log-content h4 {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 8px;
}

.log-excerpt {
    color: var(--text-secondary);
    font-size: 15px;
    line-height: 1.6;
}

.log-link {
    display: inline-block;
    margin-top: 12px;
    color: var(--primary-color);
    font-weight: 500;
    font-size: 14px;
}

/* ============= 关于部分 ============= */
.about-section {
    background: var(--bg-secondary);
}

.about-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 64px;
    align-items: center;
}

.about-intro {
    font-size: 24px;
    margin-bottom: 24px;
}

.about-description {
    color: var(--text-secondary);
    font-size: 16px;
    line-height: 1.8;
    margin-bottom: 32px;
}

.about-skills h4 {
    font-size: 18px;
    margin-bottom: 16px;
}

.skill-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.skill-tag {
    background: white;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    transition: all var(--transition-fast);
}

.skill-tag:hover {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.avatar-placeholder {
    width: 200px;
    height: 200px;
    margin: 0 auto;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    border-radius: 50%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: white;
    box-shadow: var(--shadow-lg);
}

.avatar-icon {
    font-size: 64px;
    margin-bottom: 8px;
}

/* ============= 联系部分 ============= */
.contact-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 64px;
    align-items: start;
}

.contact-info {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.contact-item {
    display: flex;
    gap: 16px;
    align-items: flex-start;
}

.contact-icon {
    font-size: 32px;
    min-width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
}

.contact-details h4 {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 4px;
}

.contact-details p {
    color: var(--text-secondary);
}

.contact-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 16px;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    font-family: inherit;
    font-size: 16px;
    transition: border-color var(--transition-fast);
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
}

.form-group textarea {
    resize: vertical;
    min-height: 120px;
}

/* ============= 页脚 ============= */
.footer {
    background: var(--text-primary);
    color: white;
    padding: 40px 0;
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
}

.footer-copyright {
    font-size: 14px;
    opacity: 0.8;
}

.footer-links {
    display: flex;
    gap: 16px;
}

.footer-links a {
    font-size: 14px;
    opacity: 0.7;
    transition: opacity var(--transition-fast);
}

.footer-links a:hover {
    opacity: 1;
}

.footer-social {
    display: flex;
    gap: 24px;
}

.footer-social a {
    font-size: 20px;
    opacity: 0.7;
    transition: opacity var(--transition-fast);
}

.footer-social a:hover {
    opacity: 1;
}

/* ============= 响应式设计 ============= */
@media (max-width: 768px) {
    .nav-menu {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: white;
        flex-direction: column;
        padding: 16px;
        box-shadow: var(--shadow-md);
        gap: 0;
    }

    .nav-menu.active {
        display: flex;
    }

    .nav-menu li {
        padding: 12px 0;
        border-bottom: 1px solid var(--border-color);
    }

    #menuButton {
        display: flex !important;
    }

    .mobile-menu-btn {
        display: none;
    }

    .hero {
        padding: 100px 24px 60px;
    }

    .hero-actions {
        flex-direction: column;
        align-items: center;
    }

    .about-content,
    .contact-grid {
        grid-template-columns: 1fr;
        gap: 48px;
    }

    .footer-content {
        flex-direction: column;
        gap: 16px;
        text-align: center;
    }

    .blog-grid {
        grid-template-columns: 1fr;
    }

    .log-item {
        flex-direction: column;
        gap: 8px;
    }

    .log-date {
        min-width: auto;
    }
}

/* ============= 暗色模式支持 (可选) ============= */
@media (prefers-color-scheme: dark) {
    :root {
        --text-primary: #e0e0e0;
        --text-secondary: #b0b0c0;
        --bg-primary: #1a1a2e;
        --bg-secondary: #16213e;
        --border-color: #2d2d44;
    }

    .navbar {
        background: rgba(26, 26, 46, 0.95);
    }

    .blog-card,
    .log-item,
    .avatar-placeholder {
        background: #16213e;
    }

    .form-group input,
    .form-group textarea {
        background: #1a1a2e;
        color: var(--text-primary);
    }
}

/* ============= 加载动画 ============= */
.loading {
    opacity: 0;
    animation: fadeIn 0.6s forwards;
}

@keyframes fadeIn {
    to {
        opacity: 1;
    }
}

/* ============= 右下角"关于"按钮 ============= */
.about-button {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    border: none;
    font-size: 24px;
    cursor: pointer;
    box-shadow: var(--shadow-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-normal);
    z-index: 999;
    animation: aboutPulse 3s infinite ease-in-out;
}

.about-button:hover {
    transform: scale(1.1) rotate(5deg);
    box-shadow: 0 12px 40px rgba(102, 126, 234, 0.4);
}

.about-button::after {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    border: 2px solid var(--primary-color);
    animation: aboutRing 2s infinite ease-out;
}

@keyframes aboutPulse {
    0%, 100% {
        box-shadow: 0 8px 32px rgba(102, 126, 234, 0.3);
    }
    50% {
        box-shadow: 0 8px 48px rgba(102, 126, 234, 0.5);
    }
}

@keyframes aboutRing {
    0% {
        transform: scale(1);
        opacity: 1;
    }
    100% {
        transform: scale(1.5);
        opacity: 0;
    }
}

/* ============= 登录页样式 ============= */
.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #f5f7fa 0%, #e4e8ec 100%);
    padding: 24px;
}

.login-container {
    width: 100%;
    max-width: 400px;
}

.login-card {
    background: white;
    border-radius: var(--radius-lg);
    padding: 40px;
    box-shadow: var(--shadow-lg);
}

.login-header {
    text-align: center;
    margin-bottom: 32px;
}

.login-header .logo {
    font-size: 32px;
    font-weight: 700;
    color: var(--primary-color);
    display: block;
    margin-bottom: 8px;
}

.login-header p {
    color: var(--text-secondary);
    font-size: 14px;
}

.login-tabs {
    display: flex;
    border-bottom: 2px solid var(--border-color);
    margin-bottom: 24px;
}

.login-tab {
    flex: 1;
    text-align: center;
    padding: 12px;
    cursor: pointer;
    font-weight: 500;
    color: var(--text-secondary);
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    transition: all var(--transition-fast);
}

.login-tab.active {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
}

.login-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.form-group label {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
}

.form-group input {
    padding: 12px 16px;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    font-size: 15px;
    font-family: inherit;
    transition: border-color var(--transition-fast);
}

.form-group input:focus {
    outline: none;
    border-color: var(--primary-color);
}

.form-group input.error {
    border-color: #ff4757;
}

.form-error {
    color: #ff4757;
    font-size: 13px;
    margin-top: 4px;
}

.login-btn {
    width: 100%;
    padding: 14px;
    margin-top: 8px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    border: none;
    border-radius: var(--radius-md);
    font-size: 16px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: all var(--transition-normal);
    box-shadow: var(--shadow-md);
}

.login-btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.login-btn:active {
    transform: translateY(0);
}

.login-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.login-footer {
    margin-top: 24px;
    text-align: center;
    font-size: 14px;
    color: var(--text-secondary);
}

.login-footer a {
    color: var(--primary-color);
    font-weight: 500;
}

.login-footer a:hover {
    text-decoration: underline;
}

/* ============= 文章详情页样式 ============= */
.article-page {
    padding-top: 100px;
    min-height: 100vh;
}

.article-header {
    max-width: 800px;
    margin: 0 auto 40px;
    padding: 0 24px;
}

.article-category {
    display: inline-block;
    background: var(--primary-color);
    color: white;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 500;
    margin-bottom: 16px;
}

.article-title {
    font-size: clamp(28px, 4vw, 42px);
    font-weight: 700;
    line-height: 1.3;
    margin-bottom: 20px;
    /* 组合使用，兼容性更好 */
    overflow-wrap: break-word;  /* 正常情况在单词边界换行 */
    word-break: break-all;      /* 实在不行就在任意字符换行 */
}

.article-meta {
    display: flex;
    gap: 20px;
    color: var(--text-secondary);
    font-size: 14px;
    flex-wrap: wrap;
}

.article-meta span {
    display: flex;
    align-items: center;
    gap: 6px;
}

.article-cover {
    max-width: 720px;
    padding: 8px;
    margin-bottom: 16px;
}

.article-cover img {
    width: 100%;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
}

.article-body {
    max-width: 800px;
    margin: 0 auto;
    padding: 0 24px 80px;
    /* 组合使用，兼容性更好 */
    overflow-wrap: break-word;  /* 正常情况在单词边界换行 */
    word-break: break-all;      /* 实在不行就在任意字符换行 */
}

.article-content {
    font-size: 17px;
    line-height: 1.9;
    color: var(--text-primary);
}

.article-content h1,
.article-content h2,
.article-content h3,
.article-content h4 {
    margin: 1.5em 0 0.8em;
    line-height: 1.4;
}

.article-content h1 { font-size: 2em; }
.article-content h2 { font-size: 1.6em; }
.article-content h3 { font-size: 1.3em; }
.article-content h4 { font-size: 1.1em; }

.article-content p {
    margin-bottom: 1.2em;
}

.article-content img {
    max-width: 100%;
    border-radius: var(--radius-md);
    margin: 1em 0;
}

.article-content pre {
    background: #1a1a2e;
    color: #e0e0e0;
    padding: 20px;
    border-radius: var(--radius-md);
    overflow-x: auto;
    margin: 1.5em 0;
    font-size: 14px;
    line-height: 1.6;
}

.article-content blockquote {
    border-left: 4px solid var(--primary-color);
    padding: 12px 20px;
    margin: 1.5em 0;
    background: var(--bg-secondary);
    border-radius: 0 var(--radius-md) var(--radius-md) 0;
    color: var(--text-secondary);
}

.article-content a {
    color: var(--primary-color);
    text-decoration: underline;
}

.article-content ul,
.article-content ol {
    margin: 1em 0;
    padding-left: 1.5em;
}

.article-content li {
    margin-bottom: 0.5em;
}

.article-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.5em 0;
}

.article-content th,
.article-content td {
    border: 1px solid var(--border-color);
    padding: 10px 14px;
    text-align: left;
}

.article-content th {
    background: var(--bg-secondary);
    font-weight: 600;
}

/* 文章点赞栏 */
.article-actions {
    display: flex;
    gap: 16px;
    align-items: center;
    padding: 24px 0;
    border-top: 1px solid var(--border-color);
    border-bottom: 1px solid var(--border-color);
    margin: 40px 0;
}

.article-action-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    border: 2px solid var(--border-color);
    border-radius: 30px;
    background: white;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    font-family: inherit;
    transition: all var(--transition-fast);
}

.article-action-btn:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.article-action-btn.liked {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    border-color: transparent;
}

/* 文章评论区 */
.comments-section {
    max-width: 800px;
    margin: 0 auto;
    padding: 0 0px 80px;
}

.comments-title {
    font-size: 22px;
    font-weight: 700;
    margin-bottom: 24px;
    padding: 0px 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.comment-form {
    background: white;
    border-radius: var(--radius-md);
    padding: 16px;
    margin-bottom: 24px;
    box-shadow: var(--shadow-sm);
}

.comment-form textarea {
    width: 100%;
    min-height: 100px;
    padding: 12px;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 15px;
    resize: vertical;
    margin-bottom: 12px;
}

.comment-form textarea:focus {
    outline: none;
    border-color: var(--primary-color);
}

.comment-form-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.comment-nickname {
    padding: 8px 12px;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 14px;
    flex: 1;
    min-width: 0;
}

.comment-submit {
    padding: 10px 24px;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-weight: 500;
    font-family: inherit;
    transition: all var(--transition-fast);
    min-width: 100px;
    flex-shrink: 0;
}

.comment-submit:hover {
    background: var(--secondary-color);
}

.comment-list {
    background: white;
    border-radius: var(--radius-md);
    padding: 16px;
    box-shadow: var(--shadow-sm);
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.comment-item {
    background: white;
    padding-bottom: 8px;
    border-bottom: 1px solid #e0e0e8;
}

.comment-main {
    display: flex;
    gap: 12px;
}

.comment-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 16px;
    flex-shrink: 0;
}

.comment-body {
    flex: 1;
}

.comment-meta {
    display: flex;
    gap: 8px;
    align-items: center;
    margin-bottom: 8px;
}

.comment-author {
    font-weight: 600;
    font-size: 14px;
}

.comment-time {
    color: var(--text-secondary);
    font-size: 12px;
}

.comment-text {
    /* 组合使用，兼容性更好 */
    overflow-wrap: break-word;  /* 正常情况在单词边界换行 */
    word-break: break-all;      /* 实在不行就在任意字符换行 */
    font-size: 15px;
    line-height: 1.6;
    color: var(--text-primary);
}

.comment-actions {
    display: flex;
    gap: 12px;
    margin-top: 8px;
}

.comment-action {
    font-size: 13px;
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 4px;
}

.comment-action:hover {
    color: var(--primary-color);
}

.comment-action.liked .heart-icon,
.comment-action.liked {
    color: #e74c3c;
}

/* 二级评论 */
.comment-replies {
    margin-top: 12px;
    padding-left: 52px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    border-left: 0px solid var(--border-color);
    padding-left: 16px;
}

.comment-reply {
    display: flex;
    gap: 10px;
}

.comment-reply .comment-avatar {
    width: 32px;
    height: 32px;
    font-size: 13px;
}

.comment-reply-username {
    font-weight: 600;
    font-size: 13px;
    color: var(--primary-color);
}

.comment-reply-text {
    font-size: 14px;
    line-height: 1.5;
}

/* ============= 文章编辑页样式 ============= */
.editor-page {
    padding-top: 80px;
    min-height: 100vh;
    background: var(--bg-secondary);
}

.editor-container {
    max-width: 900px;
    margin: 0 auto;
    padding: 24px;
}

.editor-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    flex-wrap: wrap;
    gap: 12px;
}

.editor-header h1 {
    font-size: 24px;
    font-weight: 700;
}

.editor-actions {
    display: flex;
    gap: 12px;
}

.editor-btn {
    padding: 10px 24px;
    border-radius: var(--radius-md);
    font-size: 14px;
    font-weight: 500;
    font-family: inherit;
    cursor: pointer;
    transition: all var(--transition-fast);
    border: 2px solid var(--border-color);
    background: white;
}

.editor-btn:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.editor-btn-primary {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    border: none;
}

.editor-btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    color: white;
}

.editor-card {
    background: white;
    border-radius: var(--radius-lg);
    padding: 32px;
    box-shadow: var(--shadow-sm);
    margin-bottom: 24px;
}

.editor-field {
    margin-bottom: 20px;
}

.editor-field label {
    display: block;
    font-weight: 600;
    font-size: 14px;
    margin-bottom: 8px;
    color: var(--text-primary);
}

.editor-field input,
.editor-field select,
.editor-field textarea {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    font-size: 15px;
    font-family: inherit;
    transition: border-color var(--transition-fast);
}

.editor-field input:focus,
.editor-field select:focus,
.editor-field textarea:focus {
    outline: none;
    border-color: var(--primary-color);
}

.editor-title-input {
    font-size: 20px !important;
    font-weight: 600 !important;
}

.editor-summary-input {
    min-height: 80px;
    resize: vertical;
}

.editor-settings {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.editor-content-area {
    display: flex;
    gap: 24px;
    align-items: flex-start;
}

.editor-md-panel,
.editor-preview-panel {
    flex: 1;
    min-width: 0;
}

.editor-panel-header {
    font-weight: 600;
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.editor-textarea {
    width: 100%;
    min-height: 500px;
    font-family: 'Cascadia Code', 'JetBrains Mono', 'Fira Code', 'Consolas', monospace;
    font-size: 14px;
    line-height: 1.7;
    resize: vertical;
    background: #1a1a2e;
    color: #e0e0e0;
    border-radius: var(--radius-md);
    padding: 16px;
    border: 2px solid #2d2d44;
}

.editor-textarea:focus {
    border-color: var(--primary-color);
}

.editor-preview {
    min-height: 500px;
    padding: 16px;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    background: var(--bg-primary);
    font-size: 15px;
    line-height: 1.8;
}

.editor-status {
    padding: 12px 16px;
    border-radius: var(--radius-md);
    font-size: 14px;
    margin-top: 12px;
    display: none;
}

.editor-status.success {
    display: block;
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.editor-status.error {
    display: block;
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* ============= 页面切换动画 ============= */
.page-transition {
    animation: pageIn 0.3s ease;
}

@keyframes pageIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ============= 空状态 ============= */
.empty-state {
    text-align: center;
    padding: 60px 24px;
    color: var(--text-secondary);
}

.empty-state-icon {
    font-size: 64px;
    margin-bottom: 16px;
}

.empty-state h3 {
    font-size: 20px;
    margin-bottom: 8px;
    color: var(--text-primary);
}

.empty-state p {
    font-size: 15px;
    margin-bottom: 24px;
}

/* ============= 加载状态 ============= */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    flex-direction: column;
    gap: 16px;
}

.loading-spinner {
    width: 48px;
    height: 48px;
    border: 4px solid var(--border-color);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.loading-text {
    color: var(--text-secondary);
    font-size: 14px;
}

/* ============= Toast 提示 ============= */
.toast {
    position: fixed;
    top: 100px;
    left: 50%;
    transform: translateX(-50%) translateY(-20px);
    background: var(--text-primary);
    color: white;
    padding: 12px 24px;
    border-radius: var(--radius-md);
    font-size: 14px;
    z-index: 10000;
    opacity: 0;
    transition: all 0.3s ease;
    pointer-events: none;
    box-shadow: var(--shadow-lg);
}

.toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.toast.success {
    background: #28a745;
}

.toast.error {
    background: #dc3545;
}

@media (max-width: 768px) {
    .about-button {
        width: 48px;
        height: 48px;
        font-size: 20px;
        bottom: 16px;
        right: 16px;
    }

    .login-card {
        padding: 24px;
    }

    .editor-settings {
        grid-template-columns: 1fr;
    }

    .editor-content-area {
        flex-direction: column;
    }

    .editor-textarea,
    .editor-preview {
        min-height: 300px;
    }

    .comment-replies {
        padding-left: 0;
    }

    .comment-form-footer {
        flex-direction: column;
        gap: 12px;
        align-items: stretch;
    }

    .comment-nickname {
        width: 100%;
        min-width: 0;
    }

    .editor-header {
        flex-direction: column;
        align-items: flex-start;
    }
}

/* 小屏幕下评论区占满 article-body 宽度 */
@media (max-width: 490px) {
    .comments-section {
        max-width: 100%;
        padding-left: 0;
        padding-right: 0;
    }
}

/* 更小屏幕（360px以下）确保全宽 */
@media (max-width: 360px) {
    .comments-section {
        max-width: 100vw;
    }
}
/* ============= 个人空间样式 ============= */
.profile-page {
    padding-top: 80px;
    min-height: 100vh;
}

.profile-header {
    background: var(--bg-secondary);
    padding: 40px 0 20px;
    border-bottom: 1px solid var(--border-color);
}

.profile-card {
    display: flex;
    gap: 16px;
    align-items: flex-start;
    padding: 16px;
    margin-bottom: 16px;
}

.profile-avatar-wrapper {
    padding: 8px;
    position: relative;
    flex-shrink: 0;
}

.profile-avatar {
    width: 96px;
    height: 96px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid var(--primary-color);
    background: var(--bg-secondary);
}

.profile-avatar-edit {
    position: absolute;
    bottom: 0;
    right: 0;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--primary-color);
    color: white;
    border: 2px solid white;
    font-size: 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.profile-avatar-edit:hover {
    background: var(--secondary-color);
}

.profile-info {
    flex: 1;
}

.profile-name-row {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 8px;
}

.profile-name {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-primary);
}

.profile-bio {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 8px;
    line-height: 1.5;
}

.profile-meta {
    display: flex;
    gap: 16px;
    font-size: 13px;
    color: var(--text-secondary);
}

.profile-meta-item {
    display: flex;
    align-items: center;
    gap: 4px;
}

/* 统计数据 */
.profile-stats {
    display: flex;
    gap: 0;
    background: var(--bg-primary);
    border-radius: var(--radius-lg);
    padding: 16px;
    box-shadow: var(--shadow-sm);
}

.stat-item {
    flex: 1;
    display: flex;           /* 覆盖默认布局 */
    justify-content: center; /* 水平居中 */
    align-items: center;     /* 垂直居中（可选） */
    padding: 4px;
}

.stat-item:last-child {
    border-right: none;
}

.stat-value {
    font-size: 20px;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 4px;
}

.stat-label {
    font-size: 12px;
    color: var(--text-secondary);
}

/* 文章列表 */
.profile-articles {
    padding: 40px 0;
}

.profile-articles .blog-grid {
    margin-top: 24px;
}

/* 关于我 */
.profile-about {
    padding: 40px 0;
    border-top: 1px solid var(--border-color);
}

.about-textarea {
    width: 100%;
    min-height: 120px;
    padding: 12px;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    font-family: inherit;
    font-size: 14px;
    resize: vertical;
    box-sizing: border-box;
}

.about-textarea:focus {
    outline: none;
    border-color: var(--primary-color);
}

.about-display {
    background: var(--bg-secondary);
    padding: 20px;
    border-radius: var(--radius-md);
    line-height: 1.7;
    color: var(--text-secondary);
}

/* 社交链接 */
.profile-social {
    padding: 16px 0;
}

.social-links {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.social-link-item {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    background: var(--bg-secondary);
    border-radius: 20px;
    font-size: 13px;
    color: var(--text-secondary);
    text-decoration: none;
    transition: all var(--transition-fast);
}

.social-link-item:hover {
    background: var(--primary-color);
    color: white;
}

/* 模态框 */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 20px;
}

.modal-content {
    background: var(--bg-primary);
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 480px;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-color);
}

.modal-header h3 {
    font-size: 16px;
    font-weight: 600;
}

.modal-close {
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
    color: var(--text-secondary);
    padding: 0;
    line-height: 1;
}

.modal-body {
    padding: 20px;
}

.modal-footer {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    padding: 16px 20px;
    border-top: 1px solid var(--border-color);
}

/* 表单 */
.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    margin-bottom: 6px;
    color: var(--text-primary);
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 10px 12px;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 14px;
    box-sizing: border-box;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
}

.btn-sm {
    padding: 6px 14px;
    font-size: 13px;
}

/* 响应式 */
@media (max-width: 640px) {
    .profile-card {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    .profile-name-row {
        justify-content: center;
        flex-wrap: wrap;
    }

    .profile-meta {
        justify-content: center;
    }

    .profile-stats {
        flex-wrap: wrap;
    }

    .stat-item {
        /* min-width: 50%; */
    }
}
/* ============= 头像下拉菜单 ============= */
.nav-avatar-wrapper {
    position: relative;
    cursor: pointer;
}

.nav-avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    overflow: hidden;
    transition: transform var(--transition-fast), box-shadow var(--transition-fast);
    border: 2px solid transparent;
}

.nav-avatar:hover {
    transform: scale(1.08);
    box-shadow: 0 4px 16px rgba(102, 126, 234, 0.35);
}

.nav-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* 小三角箭头 */
.nav-dropdown::before {
    content: '';
    position: absolute;
    top: -6px;
    right: 12px;
    width: 10px;
    height: 10px;
    background: var(--bg-primary);
    border-left: 1px solid var(--border-color);
    border-top: 1px solid var(--border-color);
    transform: rotate(45deg);
    z-index: 1;
}

.nav-dropdown {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    min-width: 200px;
    padding: 16px;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-12px) scale(0.95);
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1000;
    overflow: hidden;
}

.nav-avatar-wrapper:hover .nav-dropdown,
.nav-dropdown:hover {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}

.nav-dropdown-header {
    padding: 8px 8px 16px;
    border-bottom: 1px solid var(--border-color);
}

.nav-dropdown-name {
    font-weight: 700;
    font-size: 15px;
    color: var(--text-primary);
    display: block;
    margin-bottom: 2px;
}

.nav-dropdown-identity {
    font-size: 12px;
    color: var(--primary-color);
    font-weight: 500;
}

.nav-dropdown-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    font-size: 14px;
    color: var(--text-primary);
    text-decoration: none;
    transition: all var(--transition-fast);
}

.nav-dropdown-item:hover {
    background: #e0f7f4;
}

.nav-dropdown-item-icon {
    font-size: 16px;
    opacity: 0.8;
}

.nav-dropdown-logout {
    color: #e74c3c;
}

.nav-dropdown-logout:hover {
    background: #fccfcf;
    color: #c0392b;
}

.nav-dropdown-divider {
    height: 1px;
    background: linear-gradient(to right, transparent, var(--border-color), transparent);
    margin: 6px 0;
}

/* 活跃指示器 */
.nav-dropdown-item.active {
    background: rgba(102, 126, 234, 0.08);
    color: var(--primary-color);
}