/* 基础优化：禁用文本选择时的高亮，减少重绘 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: "Segoe UI", "微软雅黑", "Ma Shan Zheng", cursive;
    -webkit-tap-highlight-color: transparent; /* 禁用移动端点击高亮 */
    outline: none; /* 移除默认焦点框 */
}

/* 替换为动态渐变背景（适配二次元温馨风） */
body {
    color: #555555;
    line-height: 1.6;
    background-attachment: fixed;
    position: relative;
    min-height: 100vh;
    /* 初始渐变背景（贴合原有温馨风） */
    background: linear-gradient(135deg, #fdf9f3 0%, #fef7f0 50%, #faf0e6 100%);
    /* 背景过渡动画：延长时间减少卡顿 */
    transition: background 2s ease-in-out;
    overflow-x: hidden; /* 隐藏横向溢出 */
    cursor: pointer;
    will-change: background; /* 告诉浏览器提前优化背景渲染 */
}

/* 移除原有静态光点装饰，整合到动态背景中 */
body::before {
    content: "";
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at 20% 80%, rgba(255, 204, 214, 0.1) 0%, transparent 50%),
                radial-gradient(circle at 80% 20%, rgba(204, 242, 255, 0.1) 0%, transparent 50%),
                radial-gradient(circle at 40% 40%, rgba(255, 240, 204, 0.05) 0%, transparent 50%);
    pointer-events: none;
    z-index: -1;
    will-change: transform; /* 硬件加速 */
}

/* 点击反馈效果（同步浅粉） */
.click-effect {
    position: absolute;
    border-radius: 50%;
    background: rgba(252, 218, 226, 0.8);
    backdrop-filter: blur(10px);
    pointer-events: none;
    z-index: 1;
    animation: clickExpand 0.6s ease-out forwards; /* 缩短动画时间 */
    transform-origin: center center;
    /* 硬件加速 */
    transform: translateZ(0);
    will-change: opacity, transform;
}

/* 点击扩散动画：简化关键帧 */
@keyframes clickExpand {
    0% {
        opacity: 0.7;
        transform: translate(-50%, -50%) scale(0) translateZ(0);
    }
    100% {
        opacity: 0;
        transform: translate(-50%, -50%) scale(2) translateZ(0);
    }
}

/* 整体布局 - 优化重排 */
.container {
    display: flex;
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem 0 2rem 0.2rem;
    gap: 0.2rem;
    flex-wrap: wrap;
    position: relative;
    z-index: 2;
    will-change: contents;
}

/* 左侧菜单（温馨风） */
.menu {
    width: 220px;
    flex-shrink: 0;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 15px;
    padding: 1.5rem;
    border: 1px solid rgba(255, 204, 214, 0.3);
    box-shadow: 0 0 20px rgba(255, 204, 214, 0.1);
    will-change: contents;
}

.menu button {
    width: 100%;
    padding: 12px 15px;
    margin-bottom: 10px;
    border: none;
    background: rgba(255, 245, 247, 0.8);
    color: #555555;
    cursor: pointer;
    font-size: 16px;
    border-radius: 8px;
    transition: all 0.2s ease; /* 缩短过渡时间 */
    border-left: 3px solid transparent;
}

/* 菜单hover效果更温和，减少计算 */
.menu button:hover {
    background: rgba(255, 235, 240, 0.9);
    border-left: 3px solid #ff8da1;
    transform: scale(1.01); /* 减小缩放幅度 */
    color: #e66465;
    box-shadow: 0 2px 8px rgba(255, 141, 161, 0.15);
}

.menu button.active {
    background: linear-gradient(90deg, rgba(255, 240, 245, 0.8), rgba(255, 230, 235, 0.8));
    color: #333333;
    border-left: 3px solid #89cff0;
    box-shadow: 0 0 10px rgba(137, 207, 240, 0.3);
}

.menu button:active {
    transform: scale(0.98);
}

/* 右侧内容区域 */
.content {
    flex: 1;
    min-width: 300px;
}

.tab {
    opacity: 0;
    height: 0;
    overflow: hidden;
    padding: 0 1.5rem;
    transition: all 0.3s ease; /* 缩短过渡时间 */
    will-change: opacity, height;
}

.tab.show {
    opacity: 1;
    height: auto;
    padding: 1.5rem;
}

/* 内容容器样式 */
.page-container {
    max-width: 900px;
    margin: 0 0 0 2rem;
}

/* 首页（介绍）样式 */
header {
    text-align: center;
    padding: 2rem 0;
}

/* 头像禁止选中（可点击/hover） */
.avatar {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    object-fit: cover;
    margin-bottom: 1rem;
    border: 3px solid #ff8da1;
    box-shadow: 0 0 15px rgba(255, 141, 161, 0.5),
                0 0 30px rgba(255, 141, 161, 0.3);
    transition: all 0.3s ease; /* 缩短过渡时间 */
    user-select: none;
    -webkit-user-select: none;
    -ms-user-select: none;
    cursor: pointer;
    transform: translateZ(0); /* 硬件加速 */
}

.avatar:hover {
    transform: rotate(5deg) scale(1.03); /* 减小缩放幅度 */
    border-color: #89cff0;
    box-shadow: 0 0 15px rgba(137, 207, 240, 0.5),
                0 0 30px rgba(137, 207, 240, 0.3);
}

/* 标题禁止选中（可点击） */
h1 {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
    background: linear-gradient(90deg, #ff8da1, #89cff0);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    user-select: none;
    -webkit-user-select: none;
    -ms-user-select: none;
    cursor: pointer;
}

/* 副标题禁止选中 */
.subtitle {
    font-size: 1.2rem;
    color: #e66465;
    font-weight: 500;
    user-select: none;
    -webkit-user-select: none;
    -ms-user-select: none;
    cursor: pointer;
}

/* 二级标题禁止选中 */
h2 {
    font-size: 1.6rem;
    margin-bottom: 1rem;
    color: #333333;
    border-left: 4px solid #ff8da1;
    padding-left: 10px;
    user-select: none;
    -webkit-user-select: none;
    -ms-user-select: none;
    cursor: pointer;
}

h3 {
    font-size: 1.4rem;
    color: #ff8da1;
    margin-bottom: 1rem;
    user-select: none;
}

section {
    margin: 2rem 0;
}

/* 温馨风卡片：优化阴影减少计算 */
.card {
    background: rgba(255, 255, 255, 0.9);
    padding: 1.5rem;
    border-radius: 15px;
    margin-bottom: 1rem;
    border: 1px solid rgba(255, 204, 214, 0.3);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.03); /* 简化阴影 */
    transition: all 0.2s ease;
    will-change: box-shadow, transform;
}

.card:hover {
    transform: translateY(-3px); /* 减小位移 */
    box-shadow: 0 4px 15px rgba(255, 141, 161, 0.1); /* 简化阴影 */
    border-color: rgba(137, 207, 240, 0.3);
}

/* 技能标签 */
.skills {
    display: flex;
    flex-wrap: wrap;
    gap: 0.8rem;
    margin-top: 1rem;
}

.tag {
    background: rgba(255, 245, 247, 0.8);
    padding: 0.4rem 0.8rem;
    border-radius: 20px;
    font-size: 0.9rem;
    border: 1px solid rgba(255, 141, 161, 0.2);
    transition: all 0.15s ease; /* 缩短过渡时间 */
}

.tag:hover {
    background: rgba(255, 235, 240, 0.9);
    border-color: #89cff0;
    color: #89cff0;
    transform: scale(1.02); /* 减小缩放 */
}

/* 项目/链接样式 */
.link-item {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    padding: 0.8rem 0;
    border-bottom: 1px dashed rgba(255, 204, 214, 0.3);
}

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

.link-item a {
    color: #ff8da1;
    text-decoration: none;
    font-size: 1.05rem;
    transition: all 0.15s ease;
}

.link-item a:hover {
    color: #89cff0;
    text-decoration: underline;
}

/* 通用链接样式 */
a {
    color: #ff8da1;
    text-decoration: none;
    transition: all 0.15s ease;
}

a:hover {
    color: #89cff0;
    text-decoration: underline;
}

/* 页脚 */
footer {
    text-align: center;
    padding: 2rem 0;
    color: #888888;
    font-size: 0.9rem;
    margin-top: 2rem;
}

/* ========== 插件容器样式 ========== */
.plugins-container {
    position: fixed;
    top: 20px;
    right: 20px;
    display: flex;
    flex-direction: column;
    gap: 15px;
    z-index: 100;
    user-select: none;
    -webkit-user-select: none;
    -ms-user-select: none;
    will-change: display;
}

.plugins-container * {
    user-select: none;
    -webkit-user-select: none;
    -ms-user-select: none;
}

.plugins-container.hide {
    display: none;
}

/* 鼠标点击统计插件 */
.click-stats {
    background: rgba(255, 245, 247, 0.9);
    border: 1px solid rgba(255, 204, 214, 0.5);
    border-radius: 12px;
    padding: 1rem;
    box-shadow: 0 2px 10px rgba(255, 141, 161, 0.1);
    font-size: 0.9rem;
    color: #555;
    transition: all 0.2s ease;
    min-width: 140px;
    cursor: pointer;
}

.click-stats:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(255, 141, 161, 0.15);
}

.click-stats h4 {
    margin-bottom: 0.5rem;
    color: #ff8da1;
    font-size: 1rem;
}

/* 温馨小猫日历插件 */
.cat-calendar {
    background: rgba(255, 245, 247, 0.9);
    border: 1px solid rgba(255, 204, 214, 0.5);
    border-radius: 12px;
    padding: 1rem;
    box-shadow: 0 2px 10px rgba(255, 141, 161, 0.1);
    font-size: 0.9rem;
    color: #555;
    transition: all 0.2s ease;
    min-width: 180px;
    cursor: pointer;
}

.cat-calendar:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(255, 141, 161, 0.15);
}

.cat-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.cat-icon {
    font-size: 1.2rem;
}

.cat-calendar h4 {
    margin: 0;
    color: #ff8da1;
    font-size: 1rem;
}

.calendar-date {
    font-size: 0.85rem;
    color: #888;
    margin-bottom: 0.3rem;
}

.calendar-time {
    font-size: 1.2rem;
    font-weight: 500;
    color: #333;
}

/* 插件预留空位 */
.plugin-reserve {
    background: rgba(255, 245, 247, 0.6);
    border: 1px dashed rgba(255, 204, 214, 0.5);
    border-radius: 12px;
    padding: 1rem;
    min-width: 140px;
    min-height: 80px;
    color: #aaa;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    font-size: 0.8rem;
}

/* ========== 追番数据库样式 ========== */
.anime-db-title {
    text-align: center;
    font-size: 2rem;
    margin: 1rem 0 2rem;
    background: linear-gradient(90deg, #ff8da1, #89cff0);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    user-select: none;
}

.filter-bar {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    flex-wrap: wrap;
    align-items: center;
    background: rgba(255, 255, 255, 0.9);
    padding: 1rem;
    border-radius: 15px;
    border: 1px solid rgba(255, 204, 214, 0.3);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.03);
}

.filter-bar select, .filter-bar input {
    padding: 8px 10px;
    font-size: 14px;
    border: 1px solid rgba(255, 204, 214, 0.3);
    border-radius: 8px;
    min-width: 120px;
    background: rgba(255, 255, 255, 0.8);
    transition: all 0.15s ease;
}

.filter-bar select:focus, .filter-bar input:focus {
    outline: none;
    border-color: #89cff0;
    box-shadow: 0 0 5px rgba(137, 207, 240, 0.2); /* 简化阴影 */
}

.filter-bar button {
    padding: 8px 16px;
    font-size: 14px;
    background: #ff8da1;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.15s ease;
}

.filter-bar button:hover {
    background: #89cff0;
    transform: scale(1.01); /* 减小缩放 */
    box-shadow: 0 2px 5px rgba(137, 207, 240, 0.2);
}

.form-card {
    border: 1px solid rgba(255, 204, 214, 0.3);
    padding: 20px;
    border-radius: 15px;
    margin-bottom: 25px;
    background: rgba(255, 255, 255, 0.9);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.03);
    transition: all 0.2s ease;
}

.form-card:hover {
    box-shadow: 0 4px 15px rgba(255, 141, 161, 0.1);
    border-color: rgba(137, 207, 240, 0.3);
}

.form-card h3 {
    margin-bottom: 15px;
    font-size: 1.4rem;
    color: #ff8da1;
    border-left: 4px solid #ff8da1;
    padding-left: 10px;
}

.form-row {
    margin: 12px 0;
    display: flex;
    gap: 12px;
    align-items: flex-start;
    flex-wrap: wrap;
}

.form-row label {
    min-width: 80px;
    padding-top: 8px;
    font-size: 15px;
    color: #555;
}

.form-row input, .form-row select, .form-row textarea {
    padding: 8px 10px;
    border: 1px solid rgba(255, 204, 214, 0.3);
    border-radius: 8px;
    flex: 1;
    min-width: 150px;
    font-size: 14px;
    background: rgba(255, 255, 255, 0.8);
    transition: all 0.15s ease;
}

.form-row textarea {
    min-width: 300px;
    min-height: 80px;
    resize: vertical;
}

.form-row input:focus, .form-row select:focus, .form-row textarea:focus {
    outline: none;
    border-color: #89cff0;
    box-shadow: 0 0 5px rgba(137, 207, 240, 0.2);
}

.form-row button {
    padding: 10px 20px;
    font-size: 14px;
    margin-right: 10px;
    margin-top: 5px;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    transition: all 0.15s ease;
}

#submitBtn {
    background: #ff8da1;
    color: white;
}

#submitBtn:hover {
    background: #89cff0;
    transform: scale(1.01);
    box-shadow: 0 2px 5px rgba(137, 207, 240, 0.2);
}

.form-row button:nth-child(2) {
    background: rgba(255, 245, 247, 0.8);
    color: #555;
    border: 1px solid rgba(255, 204, 214, 0.3);
}

.form-row button:nth-child(2):hover {
    background: rgba(255, 235, 240, 0.9);
    border-color: #89cff0;
    transform: scale(1.01);
}

/* 表格核心优化：减少重排 */
table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
    table-layout: fixed; /* 固定布局，避免列宽重排 */
    background: rgba(255, 255, 255, 0.9);
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.03);
    will-change: contents;
}

th, td {
    border: 1px solid rgba(255, 204, 214, 0.2);
    padding: 12px 8px; /* 减少内边距 */
    text-align: center;
    word-wrap: break-word;
    font-size: 14px; /* 减小字体 */
}

th {
    background: linear-gradient(90deg, rgba(255, 240, 245, 0.8), rgba(255, 230, 235, 0.8));
    position: sticky;
    top: 0;
    font-size: 15px; /* 减小字体 */
    font-weight: bold;
    color: #555;
    z-index: 10; /* 避免被遮挡 */
}

td {
    font-size: 14px;
    line-height: 1.4; /* 减小行高 */
}

tr:hover td {
    background: rgba(255, 245, 247, 0.3); /* 简化hover背景 */
}

.btn-group {
    display: flex;
    gap: 5px; /* 减小间距 */
    justify-content: center;
    align-items: center;
}

.btn-edit {
    background: #ffc107;
    color: white;
    border: none;
    padding: 6px 10px; /* 减小内边距 */
    border-radius: 8px;
    cursor: pointer;
    font-size: 13px; /* 减小字体 */
    transition: all 0.15s ease;
}

.btn-edit:hover {
    background: #ff8da1;
    transform: scale(1.01);
    box-shadow: 0 2px 5px rgba(255, 141, 161, 0.2);
}

.btn-delete {
    background: #e74c3c;
    color: white;
    border: none;
    padding: 6px 10px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 13px;
    transition: all 0.15s ease;
}

.btn-delete:hover {
    background: #c0392b;
    transform: scale(1.01);
    box-shadow: 0 2px 5px rgba(231, 76, 60, 0.2);
}

.msg {
    padding: 12px;
    border-radius: 8px;
    margin: 15px 0;
    font-size: 14px;
    text-align: center;
    user-select: none;
}

.success {
    background: rgba(220, 252, 231, 0.8);
    color: #28a745;
    border: 1px solid rgba(110, 231, 183, 0.5);
}

.error {
    background: rgba(254, 226, 226, 0.8);
    color: #dc3545;
    border: 1px solid rgba(248, 113, 113, 0.5);
}

input[type="date"] {
    min-width: 180px;
}

/* 列宽优化：减小列宽减少重排 */
th:nth-child(1), td:nth-child(1) { width: 50px; }  /* 序号 */
th:nth-child(2), td:nth-child(2) { width: 140px; } /* 作品名 */
th:nth-child(3), td:nth-child(3) { width: 70px; }  /* 类型 */
th:nth-child(4), td:nth-child(4) { width: 90px; } /* 状态 */
th:nth-child(5), td:nth-child(5) { width: 50px; }  /* 评分 */
th:nth-child(6), td:nth-child(6) { width: 80px; }  /* 进度 */
th:nth-child(7), td:nth-child(7) { width: 100px; } /* 标签 */
th:nth-child(8), td:nth-child(8) { width: 150px; } /* 备注 */
th:nth-child(9), td:nth-child(9) { width: 120px; } /* 撒花时间 */
th:nth-child(10), td:nth-child(10) { width: 120px; } /* 操作 */

/* 移动端适配：简化样式 */
@media (max-width: 768px) {
    .container {
        flex-direction: column;
        padding: 1rem;
    }
    .menu {
        width: 100%;
        display: flex;
        overflow-x: auto;
        gap: 0.5rem;
        padding: 1rem;
    }
    .menu button {
        min-width: 100px;
        margin-bottom: 0;
    }
    .plugins-container {
        position: static;
        flex-direction: row;
        justify-content: center;
        margin: 1rem auto;
        width: 90%;
        flex-wrap: wrap;
    }
    .filter-bar {
        flex-direction: column;
        align-items: stretch;
    }
    .form-row {
        flex-direction: column;
        align-items: stretch;
    }
    .form-row label {
        padding-top: 0;
        margin-bottom: 5px;
    }
    table {
        font-size: 13px;
    }
    th, td {
        padding: 8px 5px;
    }
    .btn-group {
        flex-direction: column;
        gap: 3px;
    }
    .btn-edit, .btn-delete {
        padding: 4px 6px;
        font-size: 12px;
    }
    /* 列宽移动端适配 */
    th:nth-child(1), td:nth-child(1) { width: 40px; }
    th:nth-child(2), td:nth-child(2) { width: 90px; }
    th:nth-child(3), td:nth-child(3) { width: 50px; }
    th:nth-child(4), td:nth-child(4) { width: 70px; }
    th:nth-child(5), td:nth-child(5) { width: 40px; }
    th:nth-child(6), td:nth-child(6) { width: 60px; }
    th:nth-child(7), td:nth-child(7) { width: 70px; }
    th:nth-child(8), td:nth-child(8) { width: 90px; }
    th:nth-child(9), td:nth-child(9) { width: 90px; }
    th:nth-child(10), td:nth-child(10) { width: 70px; }
}