/* --- 1. 全局变量与重置 --- */
:root {
    --bg-color: #f9f7f3;
    --bg-card: #ffffff;
    --text-main: #2c3e3e;
    --text-secondary: #6b7c7c;
    --border: #e5e0d8;
    --primary: #7d9a8c;
    --primary-dark: #6a8a7c;
    --danger: #e74c3c;
    --danger-dark: #c0392b;
    --accent: #7d9a8c;
    --accent-warm: #c9a86c;
    --success: #27ae60;
    --radius: 16px;
    --radius-sm: 10px;
    --header-height: 64px;
    --sidebar-width: 240px;
    --shadow: rgba(44, 62, 62, 0.08);
    --container-width: 1200px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body { 
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
    background: var(--bg-color);
    color: var(--text-main);
    min-height: 100vh;
    overflow-x: hidden;
    line-height: 1.6;
}

h1, h2, h3, .serif {
    font-family: "Songti SC", "SimSun", "Noto Serif SC", Georgia, serif;
}

a { text-decoration: none; color: inherit; cursor: pointer; }
ul { list-style: none; }
img { max-width: 100%; display: block; }
button { cursor: pointer; border: none; font-family: inherit; }
input, textarea { outline: none; }

/* 背景纹理 */
.bg-texture {
    position: fixed;
    inset: 0;
    background: 
        radial-gradient(ellipse at 20% 20%, rgba(125, 154, 140, 0.08) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 80%, rgba(201, 168, 108, 0.06) 0%, transparent 50%),
        url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%' height='100%' filter='url(%23noise)' opacity='0.03'/%3E%3C/svg%3E");
    pointer-events: none;
    z-index: 0;
}

/* --- 布局容器 --- */
.container {
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 24px;
}

/* --- 前台布局 --- */
header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 50;
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
    height: var(--header-height);
    display: flex;
    align-items: center;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

.logo {
    height: 40px;
    width: auto;
    margin: 10px 0;
    cursor: pointer;
}

.logo img {
    height: 40px;
    display: block;
}

nav ul {
    display: flex;
    align-items: center;
    gap: 30px;
}

nav a {
    position: relative;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 15px;
    cursor: pointer;
    padding: 5px 0;
    transition: color 0.3s ease;
}

nav a:hover, nav a.active {
    color: var(--accent);
    border-bottom: 2px solid var(--accent-warm);
}

/* 移动端菜单按钮 (默认隐藏) */
.mnavh {
    display: none;
    font-size: 2.5rem;
    cursor: pointer;
    padding: 8px;
    background: none;
    border: none;
}

.mnavh svg {
    width: 24px;
    height: 24px;
    color: var(--text-main);
}

.navicon {
    display: none;
}

/* --- 主要内容区域 --- */
main {
    padding: 40px 0;
    min-height: 100vh;
}

.content-wrapper {
    padding: 100px 0 40px;
    animation: fadeInUp 0.6s ease forwards;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.section-title {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 32px;
    text-align: center;
    position: relative;
}

/* --- 首页 --- */
.hero-avatar {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    margin: 80px auto 20px;
    background: linear-gradient(135deg, var(--accent), var(--accent-warm));
    padding: 4px;
    overflow: hidden;
}

.hero-avatar img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid white;
}

.hero-name {
    font-size: 2.5rem;
    font-weight: 800;
    text-align: center;
    margin-bottom: 16px;
    font-family: "Songti SC", "SimSun", "Noto Serif SC", Georgia, serif;
}

.hero-bio {
    color: var(--text-secondary);
    font-size: 1.1rem;
    text-align: center;
    max-width: 600px;
    margin: 0 auto 30px;
}

.social-links {
    display: flex;
    justify-content: center;
    gap: 12px;
    flex-wrap: wrap;
    margin: 30px 0;
}

.social-btn {
    padding: 10px 24px;
    border-radius: var(--radius-sm);
    font-weight: 500;
    transition: all 0.3s ease;
    cursor: pointer;
    border: 2px solid var(--border);
    font-size: 14px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: transparent;
    color: var(--text-main);
}

.social-btn:hover {
    border-color: var(--accent);
    color: var(--accent);
    transform: translateY(-2px);
}

.home-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 16px;
    margin-top: 64px;
}

.home-card {
    background: linear-gradient(135deg, var(--bg-card) 0%, var(--bg-color) 100%);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px 24px;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    text-align: center;
}

.home-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--accent), var(--accent-warm));
    transform: scaleX(0);
    transition: transform 0.4s ease;
}

.home-card:hover::before {
    transform: scaleX(1);
}

.home-card:hover {
    transform: translateY(-2px) scale(1.02);
    box-shadow: 0 12px 40px var(--shadow);
}

.home-number {
    font-size: 3rem;
    font-weight: 700;
    color: var(--accent);
}

.home-label {
    color: var(--text-secondary);
}

/* --- 2. 说说 --- */
.moments-list {
    max-width: 800px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.moment-card {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 24px;
    border-left: 4px solid var(--accent);
    transition: all 0.3s ease;
}

.moment-card:hover {
    border-left-color: var(--accent-warm);
    transform: translateX(8px);
}

.moment-content {
    margin-bottom: 16px;
    color: var(--text-main);
    font-size: 1rem;
    white-space: pre-line;
}

.moment-tags {
    display: flex;
    gap: 10px;
}

.tag {
    display: inline-block;
    padding: 4px 12px;
    border-radius: var(--radius-sm);
    font-size: 12px;
    background: var(--bg-color);
    color: var(--text-secondary);
}

.tag-accent {
    background: rgba(125, 154, 140, 0.15);
    color: var(--accent);
}

.moment-footer {
    margin-top: 15px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 14px;
    color: var(--text-secondary);
}

.like-btn {
    display: flex;
    align-items: center;
    gap: 4px;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-secondary);
    transition: color 0.2s;
}

.like-btn:hover {
    color: #e74c3c;
}

.like-btn:disabled {
    color: #e74c3c;
    cursor: not-allowed;
}

.like-btn.liked {
    color: #e74c3c;
    animation: likeAnimation 0.3s ease;
}

@keyframes likeAnimation {
    0% { transform: scale(1); }
    50% { transform: scale(1.2); }
    100% { transform: scale(1); }
}

/* --- 3. 博客 --- */
.blog-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
}

.blog-card {
    background: var(--bg-card);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: 0 4px 20px var(--shadow);
    transition: all 0.4s ease;
    display: flex;
    flex-direction: column;
    color: var(--text-main);
    cursor: pointer;
}

.blog-card:hover {
    box-shadow: 0 16px 40px var(--shadow);
}

.blog-card h3 {
    transition: color 0.3s;
}

.blog-card:hover h3 {
    color: var(--accent);
}

.blog-item {
    position: relative;
    aspect-ratio: 16/9;
    overflow: hidden;
}

.blog-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s ease;
}

.blog-card:hover .blog-item img {
    transform: scale(1.05);
}

.blog-content {
    padding: 20px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.blog-title {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 8px;
    font-family: "Songti SC", "SimSun", "Noto Serif SC", Georgia, serif;
}

.blog-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: auto;
}

.blog-views {
    font-size: 14px;
    color: var(--text-secondary);
}

.blog-date {
    font-size: 14px;
    color: var(--text-secondary);
}

/* --- 分页样式 --- */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-top: 40px;
    gap: 10px;
}

.page-btn {
    padding: 8px 16px;
    border: 1px solid var(--border);
    background: var(--bg-card);
    color: var(--text-main);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.3s ease;
}

.page-btn:hover:not(:disabled) {
    background: var(--accent);
    color: white;
    border-color: var(--accent);
}

.page-btn.active {
    background: var(--accent);
    color: white;
    border-color: var(--accent);
}

.page-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* --- 博客详情页 --- */
.article-header { text-align: center; margin-bottom: 20px; }
.article-title { 
    background: rgba(255, 255, 255, 0.9); 
    font-size: 2rem; 
    font-weight: 700;
    padding: 10px; 
    border-bottom: 1px solid var(--border); 
    margin-bottom: 16px;
    font-family: "Songti SC", "SimSun", "Noto Serif SC", Georgia, serif;
}
.article-cover { 
    max-width: 800px; 
    width: 100%;
    object-fit: cover; 
    border-radius: var(--radius); 
    margin: 0 auto 40px; 
    display: block; 
}
.article-content { 
    max-width: 800px; 
    margin: 0 auto; 
    font-size: 1rem; 
    line-height: 1.9; 
    color: var(--text-main); 
}
.article-content p {
    margin-bottom: 20px;
}
.back-btn { 
    margin-bottom: 32px;
    padding: 10px 24px;
    border-radius: var(--radius-sm);
    font-weight: 500;
    transition: all 0.3s ease;
    cursor: pointer;
    border: 2px solid var(--border);
    font-size: 14px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: transparent;
    color: var(--text-main);
}

.back-btn:hover {
    border-color: var(--accent);
    color: var(--accent);
}

/* --- 4. 语录 --- */
.quote-grid, .quotes-grid { 
    max-width: 900px;
    margin: 0 auto;
    display: grid; 
    grid-template-columns: repeat(2, 1fr); 
    gap: 24px; 
}
.quote-card { 
    background: linear-gradient(135deg, var(--bg-card) 0%, var(--bg-color) 100%);
    border-radius: var(--radius);
    padding: 32px;
    position: relative;
    transition: all 0.4s ease;
    min-height: 160px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    border-left: none;
    box-shadow: 0 4px 20px var(--shadow);
}

.quote-card::before {
    font-family: "Songti SC", "SimSun", serif;
    font-size: 96px;
    color: var(--accent);
    opacity: 0.2;
    position: absolute;
    top: 10px;
    left: 20px;
    line-height: 1;
}

.quote-card:hover { 
    transform: scale(1.02);
    box-shadow: 0 12px 40px var(--shadow);
}

.quote-content {
    font-size: 18px;
    line-height: 1.8;
    margin-bottom: 16px;
    position: relative;
    z-index: 1;
}

.quote-text { 
    font-size: 18px;
    line-height: 1.8;
    color: var(--text-main);
    margin-bottom: 16px;
    position: relative;
    z-index: 1;
    font-family: "Songti SC", "SimSun", "Noto Serif SC", Georgia, serif;
}

.quote-meta { 
    display: flex; 
    justify-content: flex-end; 
    align-items: center; 
    margin-top: auto; 
    font-size: 14px;
    color: var(--text-secondary);
}

.quote-author { 
    font-weight: 500; 
}

.quote-source { 
    font-size: 0.8rem; 
}

/* --- 5. 相册 --- */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}

.gallery-card {
    background: var(--bg-card);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: 0 4px 20px var(--shadow);
    transition: transform 0.3s, box-shadow 0.3s;
}

.gallery-card:hover {
    box-shadow: 0 8px 30px rgba(44, 62, 62, 0.12);
}

.gallery-item {
    position: relative;
    border-radius: var(--radius-sm);
    overflow: hidden;
    cursor: pointer;
    aspect-ratio: 16/9;
}

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.gallery-item:hover img {
    transform: scale(1.1);
}

.gallery-count {
    position: absolute;
    bottom: 10px;
    right: 10px;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: 500;
}

.gallery-info {
    padding: 15px 20px;
    display: flex;
    flex-direction: column;
    min-height: 80px;
}

.gallery-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 10px;
}

.gallery-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: auto;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.gallery-views {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.gallery-date {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

/* 相册详情页面 */
.gallery-detail-header {
    background: linear-gradient(135deg, var(--bg-card) 0%, var(--bg-color) 100%);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    margin-bottom: 30px;
    display: flex;
    align-items: flex-start;
    position: relative;
    overflow: hidden;
}

.gallery-detail-cover {
    flex-shrink: 0;
    width: 30%;
    aspect-ratio: 4/3;
    overflow: hidden;
}

.gallery-detail-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.gallery-detail-info {
    flex: 1;
    padding: 30px;
}

.gallery-detail-meta {
    color: var(--text-light);
    margin: 10px 0;
}

.gallery-detail-desc {
    color: var(--text-secondary);
    margin-top: 10px;
}

.gallery-detail-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 15px;
}

.gallery-detail-list {
    flex-shrink: 0;
    width: 100%;
    aspect-ratio: 4/3;
    overflow: hidden;
    cursor: pointer;
    border-radius: var(--radius-sm);
}

.gallery-detail-list img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

@media (max-width: 768px) {
    .gallery-detail-header {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    .gallery-detail-cover {
        width: 100%;
        max-width: 300px;
    }

    .gallery-detail-info {
        width: 100%;
    }
}

/* 关闭按钮（右上角） */
.lightbox-close-btn {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: none;
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
    font-size: 1.6rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1002;
    transition: all 0.25s ease;
    line-height: 1;
    backdrop-filter: blur(4px);
}
.lightbox-close-btn:hover {
    background: rgba(255, 80, 80, 0.7);
}

/* 左右导航按钮 */
.lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 50px;
    height: 50px;
    border-radius: 50%;
    border: 1.5px solid rgba(255, 255, 255, 0.35);
    background: rgba(0, 0, 0, 0.35);
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1001;
    transition: all 0.25s ease;
    backdrop-filter: blur(4px);
}

.lightbox-nav:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.65);
    transform: translateY(-50%) scale(1.1);
}

.lightbox-nav.prev {
    left: 24px;
}

.lightbox-nav.next {
    right: 24px;
}

/* 图片计数器 */
.lightbox-counter {
    position: absolute;
    bottom: 20px;
    color: white;
    background: rgba(0,0,0,0.5);
    padding: 5px 10px;
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
}

/* Lightbox (相册大图) */
.lightbox { 
    position: fixed; 
    top: 0; 
    left: 0; 
    width: 100%; 
    height: 100%; 
    background: rgba(44, 62, 62, 0.9); 
    z-index: 1000; 
    display: none; 
    align-items: center; 
    justify-content: center; 
    flex-direction: column; 
    backdrop-filter: blur(8px);
}
.lightbox.active { 
    display: flex; 
    animation: fadeIn 0.2s; 
}
.lightbox img { 
    max-height: 85vh; 
    max-width: 90vw; 
    border-radius: var(--radius-sm); 
}

/* --- 6.毒汤 --- */
.timeline {
    position: relative;
    max-width: 800px;
    margin: 0 auto;
    padding-left: 24px;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 2px;
    background: var(--border);
}

.soup-item {
    position: relative;
    margin-bottom: 40px;
    background: var(--bg-card);
    padding: 25px;
    border-radius: var(--radius);
    border-left: 4px solid var(--accent);
    box-shadow: 0 4px 20px var(--shadow);
    transition: all 0.3s ease;
}

.soup-item:hover {
    border-left-color: var(--accent-warm);
    box-shadow: 0 8px 30px rgba(44, 62, 62, 0.12);
}

.soup-item::before {
    content: '';
    position: absolute;
    left: -35px;
    top: 25px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--accent);
    border: 2px solid white;
    box-shadow: 0 0 0 2px var(--accent);
}

.soup-text {
    color: var(--text-main);
    font-size: 1rem;
    white-space: pre-line;
}

/* --- 7.视频 --- */
.video-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
}

.video-card {
    background: var(--bg-card);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: 0 4px 20px var(--shadow);
    cursor: pointer;
    transition: all 0.4s ease;
    display: flex;
    flex-direction: column;
}

.video-card:hover { 
    box-shadow: 0 16px 40px var(--shadow);
}

.video-wrapper {
    position: relative;
    overflow: hidden;
    background: #000;
    aspect-ratio: 16 / 9;
}

.video-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0.8;
    transition: transform 0.5s ease;
}

.video-card:hover .video-wrapper img {
    transform: scale(1.1);
}

.play-btn {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 64px;
    height: 64px;
    background: var(--bg-card);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: transform 0.3s ease;
}

.play-btn::after {
    content: '';
    border-style: solid;
    border-width: 10px 0 10px 16px;
    border-color: transparent transparent transparent var(--accent);
    margin-left: 4px;
}

.video-card:hover .play-btn {
    transform: translate(-50%, -50%) scale(1.1);
}

.video-duration {
    position: absolute;
    bottom: 10px;
    right: 10px;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: 500;
}

.video-info {
    padding: 16px;
    background: var(--bg-card);
}

.video-title {
    color: var(--text-main);
    font-weight: 500;
    margin-bottom: 8px;
    font-size: 1rem;
}

.video-meta {
    display: flex;
    justify-content: space-between;
    color: var(--text-secondary);
    font-size: 12px;
}

.video-views {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.video-date {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

/* 视频播放 */
    .video-player-container {
        max-width: 1200px;
        margin: 20px auto;
        padding: 20px;
        background: var(--bg-card);
        border-radius: 8px;
        box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    }
    .video-player {
        width: 100%;
        aspect-ratio: 16/9;
        border-radius: 8px;
        overflow: hidden;
        margin-bottom: 20px;
    }
    .video-info {
        margin-bottom: 20px;
    }
    .video-title {
        font-size: 1.5rem;
        font-weight: 600;
        margin-bottom: 10px;
        color: var(--text-main);
    }
    .video-meta {
        display: flex;
        gap: 20px;
        color: var(--text-secondary);
        font-size: 0.9rem;
    }

/* 确保16:9比例 */
@media (max-width: 768px) {
    .video-container {
        width: 95vw;
        height: 53.4375vw;
    }
}

@media (max-height: 600px) {
    .video-container {
        height: 90vh;
        width: 160vh;
        max-width: none;
    }
}
.play-overlay { 
    position: absolute; 
    top: 0; 
    left: 0; 
    width: 100%; 
    height: 100%; 
    display: flex; 
    align-items: center; 
    justify-content: center; 
    color: white; 
    font-size: 4rem; 
    cursor: pointer; 
}

/* --- 页脚 --- */
footer {
    border-top: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.5);
    backdrop-filter: blur(8px);
    padding: 32px 0;
    text-align: center;
}

.footer-text {
    color: var(--text-secondary);
    font-size: 14px;
}

/* 管理登录页 */
.login-view { 
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    background: var(--bg-color);
    padding: 20px;
}

.login-box { 
    background: var(--bg-card);
    border-radius: var(--radius);
    box-shadow: 0 8px 30px var(--shadow);
    padding: 40px;
    width: 100%;
    max-width: 400px;
    text-align: center;
    border: 1px solid var(--border);
}

.login-box h2 {
    color: var(--text-main);
    margin-bottom: 30px;
    font-size: 24px;
    font-weight: 700;
    font-family: "Songti SC", "SimSun", "Noto Serif SC", Georgia, serif;
}

.login-group {
    margin-bottom: 20px;
    text-align: left;
    display: flex;
    align-items: center;
    flex-wrap: nowrap;
}

.login-group label,
.login-group > *:first-child {
    width: 60px;
    font-weight: 500;
    color: var(--text-main);
    white-space: nowrap;
    flex-shrink: 0;
}

.login-group input { 
    flex: 1;
    min-width: 0;
    padding: 14px 18px;
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--bg-card);
    font-size: 15px;
    transition: all 0.3s ease;
    outline: none;
}

.login-group input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 4px rgba(125, 154, 140, 0.1);
}

#login-error {
    background-color: rgba(231, 76, 60, 0.1);
    border: 1px solid rgba(231, 76, 60, 0.3);
    border-radius: var(--radius-sm);
    padding: 10px;
    margin-bottom: 20px;
    color: var(--danger);
    font-size: 0.9rem;
}

.login-box .btn {
    width: 100%;
    padding: 12px;
    font-size: 1rem;
    font-weight: 600;
    border-radius: var(--radius-sm);
    margin-top: 20px;
    transition: all 0.3s ease;
    background: var(--accent);
    color: white;
    border: none;
}

.login-box .btn:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(125, 154, 140, 0.3);
}

/* --- 管理后台布局 --- */
.admin-view { 
    min-height: 100vh; 
    display: flex;
    max-width: var(--container-width);
    margin: 0 auto;
}

.admin-sidebar { 
    width: var(--sidebar-width); 
    background: var(--bg-card);
    border-right: 1px solid var(--border);
    display: flex; 
    flex-direction: column; 
    flex-shrink: 0;
    padding: 0 16px;
}

.admin-logo {
    height: var(--header-height);
    display: flex; 
    align-items: center; 
    padding: 0 24px; 
    font-size: 18px;
    font-weight: 600;
    color: var(--text-main);
    border-bottom: 1px solid var(--border);
    font-family: "Songti SC", "SimSun", "Noto Serif SC", Georgia, serif;
}

.admin-menu { 
    padding: 20px 0; 
    flex: 1; 
}

.admin-menu li a { 
    display: flex; 
    align-items: center; 
    padding: 14px 16px;
    gap: 12px; 
    transition: all 0.3s ease;
    border-radius: var(--radius-sm);
    margin: 4px 0;
    color: var(--text-secondary);
}

.admin-menu li a:hover, .admin-menu li a.active { 
    background: var(--bg-color);
    color: var(--accent);
}

.admin-main { 
    background: var(--bg-color);
    width: 100%;
}

.admin-header { 
    height: var(--header-height); 
    background: var(--bg-card); 
    border-bottom: 1px solid var(--border); 
    display: flex; 
    justify-content: space-between; 
    align-items: center; 
    padding: 0 30px;
}

.menu-btn {
    display: none;
    font-size: 2rem;
    cursor: pointer;
}

.admin-content { 
    padding: 30px 0 30px 30px; 
    overflow-y: auto;
    background: var(--bg-color);
}

/* 后台概览 */
.admin-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 16px;
    margin-bottom: 32px;
}

.admin-card {
    background: var(--bg-card);
    padding: 24px;
    border-radius: var(--radius);
    text-align: center;
    border: 1px solid var(--border);
    box-shadow: 0 4px 20px var(--shadow);
    border-left: 4px solid var(--accent);
}

.admin-label { 
    text-align: center; 
    color: var(--text-secondary); 
    font-size: 0.9rem; 
}

.admin-value { 
    text-align: center; 
    font-size: 28px;
    font-weight: 700;
    margin-top: 5px;
}

/* 响应式设计 */
@media (max-width: 1024px) {
    .home-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .blog-grid,
    .video-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .gallery-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .admin-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .quote-grid,
    .quotes-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .admin-content { 
        padding: 10px; 
    }
    .mnavh {
        display: block;
    }
    
    nav {
        display: none;
        position: absolute;
        top: var(--header-height);
        right: 0;
        width: 200px;
        background: white;
        box-shadow: 0 4px 20px var(--shadow);
        padding: 20px;
        border-radius: var(--radius-sm);
    }

    nav.mobile-active { 
        display: block; 
    }

    nav ul {
        width: 100%;
        flex-direction: column;
        gap: 5px;
    }

    nav li {
        width: 100%;
        text-align: center; 
    }

    nav a {
        width: 100%;
        display: block;
        padding: 12px 16px;
        font-size: 16px;
    }

    nav a:hover, nav a.active {
        background-color: var(--bg-color);
        border-radius: 8px;
        padding: 12px 16px;
        border-bottom: none;
    }
    
    nav a::after {
        display: none;
    }

    .home-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .blog-grid,
    .video-grid,
    .gallery-grid {
        grid-template-columns: 1fr;
    }
    
    .hero-name {
        font-size: 28px;
    }
    
    .home-number {
        font-size: 36px;
    }
    
    .article-title {
        font-size: 24px;
    }

    .admin-view { 
        flex-direction: column; 
    }
    
    .admin-header { 
        padding: 0 10px; 
    }
    
    .menu-btn { 
        display: block; 
    }
    
    .admin-sidebar { 
        position: absolute; 
        height: 100%; 
        z-index: 200; 
        transform: translateX(-100%); 
        transition: transform 0.3s; 
    }
    
    .admin-sidebar.open { 
        transform: translateX(0); 
    }
    
    .admin-grid {
        grid-template-columns: 1fr 1fr;
    }
    
    .quote-grid,
    .quotes-grid {
        grid-template-columns: 1fr;
    }
}

/* 模态框样式 */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(44, 62, 62, 0.6);
    backdrop-filter: blur(8px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 20px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.modal-overlay.active {
    display: flex;
    opacity: 1;
}

/* 确保模态框能够通过display属性显示 */
.modal-overlay[style*="display: block"] {
    display: flex;
}

.modal-box {
    background: var(--bg-card);
    border-radius: var(--radius);
    box-shadow: 0 8px 30px var(--shadow);
    width: 100%;
    max-width: 500px;
    overflow: hidden;
    transform: scale(0.9);
    transition: transform 0.3s ease;
    border: 1px solid var(--border);
}

.modal-overlay.active .modal-box {
    transform: scale(1);
}

.modal-box-header {
    padding: 20px;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-box-header h3 {
    margin: 0;
    color: var(--text-main);
    font-family: "Songti SC", "SimSun", "Noto Serif SC", Georgia, serif;
}

.toast-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-secondary);
    border-radius: 50%;
    padding: 0 10px 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.modal-box-body {
    padding: 20px;
}

.modal-box-footer {
    padding: 20px;
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

/* 提示框样式 */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 10000;
}

.toast {
    background: var(--bg-card);
    border-radius: var(--radius);
    box-shadow: 0 8px 30px var(--shadow);
    padding: 15px 20px;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 10px;
    animation: fadeIn 0.3s ease;
    border: 1px solid var(--border);
}

.toast.success {
    background: var(--success);
    color: white;
    border-color: var(--success);
}

.toast.error {
    background: var(--danger);
    color: white;
    border-color: var(--danger);
}

.toast.info {
    background: var(--accent);
    color: white;
    border-color: var(--accent);
}

.toast-icon {
    font-weight: bold;
}

.toast-message {
    flex: 1;
}

/* 说说列表 */
.moment-grid { 
    display: grid; 
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); 
    gap: 20px; 
}

.moment-list { 
    background: var(--bg-card); 
    padding: 20px; 
    border-bottom: 1px solid var(--border); 
    border-radius: var(--radius); 
    box-shadow: 0 4px 20px var(--shadow);
    gap: 15px; 
}

/* 后台表格 */
.table-responsive { 
    overflow-x: auto; 
    background: var(--bg-card); 
    border-radius: var(--radius); 
    border: 1px solid var(--border);
    box-shadow: 0 4px 20px var(--shadow);
}

table { 
    width: 100%; 
    border-collapse: collapse; 
    min-width: 600px; 
}

th, td { 
    text-align: center; 
    padding: 16px; 
    border-bottom: 1px solid var(--border); 
}

th { 
    background: var(--bg-color);
    font-weight: 500;
    color: var(--text-secondary);
    text-align: left;
}

td {
    text-align: left;
}

.admin-table tr:hover td {
    background: var(--bg-color);
}

.status-badge { 
    padding: 4px 12px; 
    border-radius: var(--radius-sm); 
    font-size: 12px; 
}

.status-published { 
    background: rgba(39, 174, 96, 0.15);
    color: var(--success);
}

.status-draft { 
    background: var(--bg-color);
    color: var(--text-secondary);
}

/* 表单样式 */
.form-group {
    font-size: 0.9rem;
    margin-bottom: 20px;
    text-align: left;
}

.form-group label {
    display: block;
    font-weight: 500;
    font-size: 14px;
    margin-bottom: 8px;
    color: var(--text-main);
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 14px 18px;
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--bg-card);
    font-size: 15px;
    transition: all 0.3s ease;
    outline: none;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 4px rgba(125, 154, 140, 0.1);
}

.form-group textarea {
    resize: vertical;
    min-height: 120px;
}

.form-footer {
    display:flex;
    justify-content: flex-end;
    gap:10px;
    margin-top:20px;
}

/* 按钮样式 */
.btn {
    display: inline-block;
    padding: 10px 24px;
    background: var(--accent);
    color: white;
    border-radius: var(--radius-sm);
    font-weight: 500;
    transition: all 0.3s ease;
    cursor: pointer;
    border: none;
    font-size: 14px;
}

.btn-primary {
    background: var(--accent);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-dark);
    box-shadow: 0 8px 20px rgba(125, 154, 140, 0.3);
}

.btn-danger {
    background: var(--danger);
    color: white;
}

.btn-danger:hover {
    background: var(--danger-dark);
}

.btn-sm {
    padding: 4px 10px;
    font-size: 0.8rem;
}

/* 表格操作按钮 */
.table-action {
    color: var(--accent);
    background: none;
    border: none;
    cursor: pointer;
    font-size: 14px;
    margin-right: 12px;
    transition: all 0.2s;
}

.table-action:hover {
    text-decoration: underline;
}

.table-action.danger {
    color: var(--danger);
}

/* 滚动条 */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-color);
}

::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--accent);
}

/* 动画 */
.animate-in {
    animation: fadeInUp 0.6s ease forwards;
}

.stagger-1 { animation-delay: 0.1s; opacity: 0; }
.stagger-2 { animation-delay: 0.2s; opacity: 0; }
.stagger-3 { animation-delay: 0.3s; opacity: 0; }
.stagger-4 { animation-delay: 0.4s; opacity: 0; }
.stagger-5 { animation-delay: 0.5s; opacity: 0; }

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        transition-duration: 0.01ms !important;
    }
}
