/* ============================================================
   全局重置与基础
   ============================================================ */
* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
    font-family: "Noto Sans SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
    color: #3a2a2a;
    overflow-x: hidden;
    background: #fff0f5;
}

/* ============================================================
   视差背景层 & 模糊
   ============================================================ */
.parallax-bg {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    z-index: -2; pointer-events: none;
}
.parallax-layer {
    position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    background-size: cover; background-position: center; background-repeat: no-repeat;
    will-change: transform;
}
.layer-main {
    background-image: url('../images/main.png');
    background-color: #fff0f5;
}
.layer-secondary {
    background-size: cover; background-position: center; background-repeat: no-repeat;
    opacity: 0; transition: opacity 0.5s;
    position: absolute; border-radius: 15px;
    box-shadow: 0 4px 15px rgba(255,105,180,0.15);
}
.layer-secondary.active { opacity: 0.7; }

.main-bg-blur {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    z-index: -1; pointer-events: none;
    backdrop-filter: blur(0px);
    transition: backdrop-filter 0.3s;
}

/* 视频背景兼容 */
.bg-video {
    position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    object-fit: cover; pointer-events: none;
}
.parallax-layer video,
video.parallax-layer {
    background: none;               /* 视频层不显示背景色 */
}

/* ============================================================
   导航栏
   ============================================================ */
.main-header {
    position: fixed; top: 0; left: 0; width: 100%; height: 62px;
    background: rgba(255,192,203,0.92); backdrop-filter: blur(8px);
    box-shadow: 0 2px 10px rgba(255,105,180,0.2);
    z-index: 1000; display: flex; align-items: center;
}
.header-inner { margin-left: 20px; display: flex; align-items: center; }
.logo { display: flex; align-items: center; text-decoration: none; color: #c71585; }
.logo-img { width: 36px; height: 36px; margin-right: 8px; object-fit: cover; border-radius: 50%; }
.logo-text { font-size: 24px; font-weight: bold; letter-spacing: 2px; }

/* ============================================================
   首页 Hero
   ============================================================ */
.hero {
    width: 100%; height: 100vh; position: relative;
    display: flex; flex-direction: column; align-items: center; justify-content: center;
}
.nav-card {
    background: rgba(255,255,255,0.7); backdrop-filter: blur(10px);
    border-radius: 30px; padding: 15px 30px;
    box-shadow: 0 10px 30px rgba(255,105,180,0.2);
    transform: scale(0.8);
}
.nav-card-inner { display: flex; gap: 15px; align-items: center; }
.nav-btn {
    padding: 12px 28px; border-radius: 30px; font-size: 18px; font-weight: bold;
    text-decoration: none; color: #fff;
    transition: transform 0.2s, box-shadow 0.2s;
    border: 2px solid #ffb6c1; cursor: pointer;
}
.nav-btn:hover { transform: translateY(-2px); box-shadow: 0 8px 20px rgba(255,105,180,0.4); }
.anime-btn { background: #ff85b3; }
.game-btn { background: #ff9aa2; }
.about-btn { background: #ffb07c; }

.social-links { margin-top: 20px; display: flex; gap: 15px; }
.social-icon {
    width: 40px; height: 40px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    overflow: hidden;
    transition: transform 0.15s ease-out;
}
.social-icon img { width: 70%; height: 70%; object-fit: contain; }
.social-icon:active { animation: jelly 0.3s ease; }

/* ============================================================
   日志卡片区（首页 - 优化版）
   ============================================================ */
.log-scroll {
    display: flex;
    flex-wrap: wrap;
    gap: 28px;
    justify-content: center;
    padding: 40px 20px;
}


/* 无封面占位 */
.no-cover {
    width: 100%; height: 100%;
    background: #f0e7dd;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #b8a99a;
    font-size: 1rem;
}

/* 新建日志卡片特殊样式（如果有使用） */
.new-log-card .log-cover { background: #ffd1dc; }
.plus-icon { font-size: 50px; color: #ff6fa7; }

/* ============================================================
   日志详情页
   ============================================================ */
.detail-container { max-width: 650px; margin: 90px auto 40px; padding: 0 20px; }
.back-link { color: #c71585; text-decoration: none; font-size: 16px; display: inline-block; margin-bottom: 15px; }
.detail-card {
    background: rgba(255,250,250,0.85); border-radius: 30px;
    overflow: hidden; box-shadow: 0 15px 35px rgba(255,105,180,0.2);
}
.detail-cover { width: 100%; height: 250px; overflow: hidden; }
.detail-cover img { width: 100%; height: 100%; object-fit: cover; }
.no-cover-large { font-size: 60px; display: flex; align-items: center; justify-content: center; height: 250px; }
.detail-body { padding: 25px; }
.detail-title { font-size: 28px; color: #c71585; margin-bottom: 10px; }
.detail-meta { color: #888; font-size: 14px; margin-bottom: 20px; border-bottom: 1px dashed #ffb6c1; padding-bottom: 15px; }
.detail-content { line-height: 1.8; font-size: 16px; white-space: pre-wrap; margin-bottom: 25px; }
.detail-actions { text-align: right; }
.delete-btn {
    padding: 8px 20px; background: none; border: 2px solid #ff6b6b;
    color: #ff6b6b; border-radius: 20px; cursor: pointer; font-size: 14px;
    transition: 0.2s;
}
.delete-btn:hover { background: #ff6b6b; color: #fff; }

/* ============================================================
   新建日志表单
   ============================================================ */
.form-container { max-width: 650px; margin: 100px auto; padding: 0 20px; }
.form-card {
    background: rgba(255,255,255,0.85); border-radius: 30px;
    padding: 35px; box-shadow: 0 20px 40px rgba(255,105,180,0.15);
    text-align: center;
}
.form-icon { font-size: 50px; margin-bottom: 10px; }
.form-card h2 { color: #c71585; margin-bottom: 25px; }
.form-group { margin-bottom: 25px; text-align: left; }
.form-group label { display: block; margin-bottom: 8px; font-weight: bold; color: #c71585; }
.form-group input[type="text"],
.form-group textarea {
    width: 100%; padding: 12px 15px; border: 2px solid #ffb6c1;
    border-radius: 15px; font-size: 16px; outline: none;
    transition: border 0.2s; background: #fff8fa;
}
.file-input-wrapper { position: relative; display: inline-block; width: 100%; }
.file-input-wrapper input[type="file"] {
    opacity: 0; width: 100%; height: 50px;
    position: absolute; left: 0; top: 0; cursor: pointer;
}
.file-placeholder {
    display: flex; align-items: center; justify-content: center;
    width: 100%; height: 50px; border: 2px dashed #ffb6c1;
    border-radius: 15px; background: #fff8fa; color: #999;
    font-size: 15px; transition: border 0.2s;
}
.file-input-wrapper:hover .file-placeholder { border-color: #ff6fa7; }
.crop-options { display: flex; gap: 15px; margin-top: 8px; }
.crop-option { display: flex; align-items: center; gap: 5px; cursor: pointer; font-size: 15px; }
.crop-option input { margin-right: 5px; }
.submit-btn {
    display: block; width: 100%; margin-top: 20px; padding: 14px;
    background: #ff6fa7; color: #fff; font-size: 20px; font-weight: bold;
    border: none; border-radius: 40px; cursor: pointer;
    transition: 0.2s; letter-spacing: 2px;
}
.submit-btn:hover { background: #ff85b3; transform: scale(1.02); }

/* ============================================================
   动画卡片网格
   ============================================================ */
.anime-card {
    position: relative; border-radius: 12px; overflow: hidden;
    box-shadow: 0 4px 12px rgba(255,105,180,0.3);
    transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
    transform: scale(0.8);
    opacity: 0;
    animation: cardFloatIn 0.6s cubic-bezier(0.23, 1, 0.32, 1) forwards;
}
.anime-card.reveal {
    animation: cardFloatIn 0.6s cubic-bezier(0.23, 1, 0.32, 1) forwards;
}
@keyframes cardFloatIn {
    0% { opacity: 0; transform: scale(0.7) translateY(30px); }
    100% { opacity: 1; transform: scale(0.88) translateY(0); }
}
.anime-card:hover {
    transform: scale(0.93) !important;
    box-shadow: 0 8px 25px rgba(255,105,180,0.5);
}
.card-inner { width: 100%; height: 100%; }
.cover-img { width: 100%; height: 100%; object-fit: cover; }
.card-overlay {
    position: absolute; bottom: 0; left: 0; right: 0; height: 80%;
    background: linear-gradient(transparent, rgba(0,0,0,0.7));
    color: white; padding: 20px;
    opacity: 0; transition: opacity 0.3s;
    display: flex; flex-direction: column; justify-content: flex-end;
}
.anime-card:hover .card-overlay { opacity: 1; }
.card-overlay h3 { font-size: 20px; margin-bottom: 8px; }
.card-overlay p { font-size: 15px; margin: 3px 0; color: #f0f0f0; }
.card-overlay .desc { max-height: 80px; overflow: hidden; }

/* ============================================================
   关于页面
   ============================================================ */
.about-container { display: flex; align-items: center; justify-content: center; min-height: 100vh; padding-top: 80px; }
.about-card {
    background: rgba(255,255,255,0.85); border-radius: 30px;
    padding: 40px; text-align: center; max-width: 500px;
    box-shadow: 0 20px 40px rgba(255,105,180,0.2);
}
.about-avatar img { width: 100px; height: 100px; border-radius: 50%; object-fit: cover; border: 3px solid #ffb6c1; }
.about-card h1 { color: #c71585; margin: 15px 0; }
.about-social { margin-top: 25px; display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.about-social-btn { padding: 8px 20px; background: #ff6fa7; color: white; border-radius: 20px; text-decoration: none; }

/* ============================================================
   通用动效与工具
   ============================================================ */
a:active, button:active, img:active {
    animation: jelly 0.3s ease;
}
@keyframes jelly {
    0%,100% { transform: scale(1); }
    25% { transform: scale(0.95, 1.05); }
    50% { transform: scale(1.02, 0.98); }
    75% { transform: scale(0.98, 1.02); }
}

.flash-messages { position: fixed; top: 70px; right: 20px; z-index: 1100; }
.flash-message { padding: 10px 20px; margin-bottom: 8px; border-radius: 20px; background: #ffb6c1; color: #fff; }

/* ============================================================
   自定义确认对话框（弹窗）
   ============================================================ */
.modal-overlay {
    display: none; position: fixed; top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(0,0,0,0.4); backdrop-filter: blur(4px);
    z-index: 9999; align-items: center; justify-content: center;
}
.modal-dialog {
    background: #fff0f5; border-radius: 25px; padding: 30px 40px;
    box-shadow: 0 20px 40px rgba(255,105,180,0.3);
    text-align: center; max-width: 360px;
    animation: modalFadeIn 0.3s ease;
}
.modal-dialog p { font-size: 18px; color: #c71585; margin-bottom: 25px; font-weight: bold; }
.modal-buttons { display: flex; gap: 15px; justify-content: center; }
.modal-buttons button {
    padding: 10px 30px; border-radius: 30px; border: none;
    font-size: 16px; font-weight: bold; cursor: pointer;
    transition: background 0.2s, transform 0.1s;
}
.confirm-yes { background: #ff6b6b; color: white; }
.confirm-yes:hover { background: #ff4d4d; transform: scale(1.02); }
.confirm-no { background: #ccc; color: #333; }
.confirm-no:hover { background: #bbb; transform: scale(1.02); }
@keyframes modalFadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ============================================================
   管理员页面样式
   ============================================================ */
.admin-login-container { display: flex; align-items: center; justify-content: center; height: 100vh; }
.admin-login-form {
    background: rgba(255,255,255,0.9); padding: 40px;
    border-radius: 30px; box-shadow: 0 20px 40px rgba(255,105,180,0.2);
    text-align: center;
}
.admin-login-form input[type="password"] {
    width: 100%; padding: 12px; border: 2px solid #ffb6c1;
    border-radius: 15px; margin-bottom: 15px; font-size: 16px;
}
.admin-dashboard {
    margin: 100px auto; max-width: 600px;
    background: rgba(255,255,255,0.85); border-radius: 20px; padding: 30px;
}
.admin-dashboard ul { list-style: none; }
.admin-dashboard li { margin: 15px 0; }
.admin-dashboard a { color: #c71585; font-size: 18px; text-decoration: none; }
.admin-form-container, .admin-bg-manager {
    margin: 100px auto; max-width: 700px;
    background: rgba(255,255,255,0.9); border-radius: 20px; padding: 30px;
}
.admin-bg-manager .image-select { display: flex; flex-wrap: wrap; gap: 15px; margin: 15px 0; }
.admin-bg-manager .image-select label { display: flex; flex-direction: column; align-items: center; cursor: pointer; }
.admin-bg-manager .image-select img { border-radius: 10px; box-shadow: 0 4px 10px rgba(0,0,0,0.1); }

/* ---------- 首页分区卡片（带封面） ---------- */
.home-categories {
    display: flex;
    gap: 40px;
    justify-content: center;
    align-items: center;
    padding: 120px 20px 40px;   /* 留出导航栏高度 */
    flex-wrap: wrap;
}

.category-card {
    display: block;
    width: 320px;
    height: 200px;
    border-radius: 24px;
    overflow: hidden;
    position: relative;
    box-shadow: 0 12px 30px rgba(0,0,0,0.08);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    text-decoration: none;
}
.category-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 18px 40px rgba(0,0,0,0.15);
}

.category-cover {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.category-label {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 15px;
    background: linear-gradient(to top, rgba(30,20,10,0.6), transparent);
    color: #fff;
    font-size: 1.8rem;
    font-weight: 600;
    letter-spacing: 2px;
    text-align: center;
}
/* ---------- 日志列表页 ---------- */
.log-items {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.log-list-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(255,250,245,0.85);
    backdrop-filter: blur(6px);
    border-radius: 20px;
    padding: 20px 28px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.04);
    text-decoration: none;
    color: #3a2a2a;
    transition: transform 0.2s, box-shadow 0.2s;
}
.log-list-item:hover {
    transform: translateX(5px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.08);
    background: rgba(255,245,235,0.95);
}

.log-item-left {
    display: flex;
    flex-direction: column;
}
.log-item-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: #5c4b3c;
    margin-bottom: 4px;
}
.log-item-time {
    font-size: 0.9rem;
    color: #aaa;
}
.log-item-arrow {
    font-size: 2rem;
    color: #c7a88d;
    font-weight: 300;
}

.empty-message {
    text-align: center;
    color: #b8a99a;
    font-size: 1.2rem;
    margin-top: 40px;
}