/* ==================== 基础样式 ==================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #667eea;
    --primary-hover: #5a67d8;
    --secondary-color: #f093fb;
    --bg-color: #f5f7fa;
    --card-bg: #ffffff;
    --text-primary: #2d3748;
    --text-secondary: #718096;
    --border-color: #e2e8f0;
    --success-color: #48bb78;
    --error-color: #f56565;
    --warning-color: #ed8936;
    --info-color: #4299e1;
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    min-height: 100vh;
    color: var(--text-primary);
    line-height: 1.6;
    position: relative;
}

/* ==================== 吉祥物图片通用样式 ==================== */
.mascot-img {
    object-fit: cover;
    image-rendering: -webkit-optimize-contrast;
    border-radius: 50%;
    border: 4px solid white;
    box-shadow: 0 8px 20px rgba(0,0,0,0.25);
}

.float-icon {
    display: inline-block;
    margin: 0 10px;
}

.float-icon img {
    width: 150px;
    height: 150px;
    object-fit: cover;
    border-radius: 50%;
    border: 5px solid white;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
}

.companion-emoji-img {
    width: 150px;
    height: 150px;
    object-fit: cover;
    border-radius: 50%;
    border: 5px solid white;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
    filter: drop-shadow(0 4px 8px rgba(0,0,0,0.2));
}

.switcher-animal-emoji-img {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: 50%;
    border: 3px solid white;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
    filter: drop-shadow(0 4px 8px rgba(0,0,0,0.2));
}

.empty-animal-img {
    width: 120px;
    height: 120px;
    object-fit: cover;
    border-radius: 50%;
    border: 4px solid white;
    box-shadow: 0 8px 20px rgba(0,0,0,0.3);
    filter: drop-shadow(0 8px 16px rgba(0,0,0,0.3));
}

.animal-emoji-float-img {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: 50%;
    border: 3px solid white;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

.current-animal-img {
    width: 40px;
    height: 40px;
    object-fit: cover;
    border-radius: 50%;
    border: 2px solid white;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

/* 背景渐变层 */
.bg-layer {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    transition: opacity 2s ease-in-out;
}

.bg-layer-1 {
    opacity: 1;
}

.bg-layer-2 {
    opacity: 0;
}

/* 首页动态渐变背景 */
.home-page-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -2;
    background: linear-gradient(45deg, #667eea, #764ba2, #f093fb, #f5576c, #96e6a1, #d4fc79, #a1c4fd, #667eea);
    background-size: 400% 400%;
    animation: gradientShift 20s ease infinite;
}

.home-page-bg::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle at 20% 80%, rgba(255, 255, 255, 0.1) 0%, transparent 50%),
                radial-gradient(circle at 80% 20%, rgba(255, 255, 255, 0.08) 0%, transparent 50%),
                radial-gradient(circle at 40% 40%, rgba(255, 255, 255, 0.05) 0%, transparent 30%);
    pointer-events: none;
}

.home-page-bg::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.03) 0%, transparent 70%);
    animation: bgRotate 30s linear infinite;
    pointer-events: none;
}

@keyframes gradientShift {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

@keyframes bgRotate {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

/* 日记列表页面多颜色渐变背景 */
.diary-list-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -2;
    background: linear-gradient(45deg, #667eea, #764ba2, #f093fb, #f5576c, #96e6a1, #d4fc79, #a1c4fd, #667eea);
    background-size: 400% 400%;
    animation: gradientShift 20s ease infinite;
}

.diary-list-bg::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle at 20% 80%, rgba(255, 255, 255, 0.1) 0%, transparent 50%),
                radial-gradient(circle at 80% 20%, rgba(255, 255, 255, 0.08) 0%, transparent 50%),
                radial-gradient(circle at 40% 40%, rgba(255, 255, 255, 0.05) 0%, transparent 30%);
    pointer-events: none;
}

.diary-list-bg::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.03) 0%, transparent 70%);
    animation: bgRotate 30s linear infinite;
    pointer-events: none;
}

@keyframes gradientShift {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

@keyframes bgRotate {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

/* 日记卡片玻璃拟态效果增强 */
.diary-card {
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.diary-card:hover {
    background: rgba(255, 255, 255, 0.95);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15);
    transform: translateY(-2px);
}

/* 日记列表容器背景 */
.diary-list-container {
    position: relative;
    background: rgba(255, 255, 255, 0.6);
    backdrop-filter: blur(5px);
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.08);
}

/* 空状态背景 */
.empty-state {
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 60px 40px;
    text-align: center;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

/* 宠物背景装饰样式已移除 */

/* ==================== 导航栏 ==================== */
.navbar {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 100;
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-logo {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--primary-color);
    text-decoration: none;
    transition: transform 0.2s;
}

.nav-logo:hover {
    transform: scale(1.05);
}

/* 刷新按钮 */
.refresh-btn {
    background: white;
    border: 2px solid var(--primary-color);
    border-radius: 20px;
    padding: 6px 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--primary-color);
    transition: all 0.3s ease;
    box-shadow: var(--shadow);
    white-space: nowrap;
    margin-left: 0.5rem;
}

.refresh-btn:hover {
    background: var(--primary-color);
    color: white;
    transform: scale(1.05);
    box-shadow: var(--shadow-lg);
}

.refresh-btn.spinning {
    animation: refreshSpin 1s ease-in-out;
}

@keyframes refreshSpin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* 微博式快捷发布框 - 导航菜单版 */
.nav-menu .weibo-post-box {
    display: inline-flex;
    margin: 0;
}

.nav-menu .weibo-post-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 1rem;
    background: linear-gradient(90deg, #ff9a9e, #fad0c4, #fad0c4, #a18cd1, #fbc2eb, #8fd3f4, #84fab0, #ff9a9e);
    background-size: 200% 100%;
    border-radius: 20px;
    text-decoration: none;
    color: white;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    white-space: nowrap;
    animation: rainbow-flow 15s linear infinite;
}

.nav-menu .weibo-post-btn:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    transform: translateY(-2px);
}

@keyframes rainbow-flow {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

.nav-menu .weibo-icon {
    font-size: 1rem;
}

.nav-menu .weibo-text {
    color: white;
}

/* 导航栏反馈按钮 */
.feedback-btn-nav {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.25rem;
    background: rgba(255, 255, 255, 0.15);
    color: white;
    text-decoration: none;
    border-radius: 25px;
    font-size: 1rem;
    font-weight: 600;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    margin-left: 0;
    margin-right: 0.5rem;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    border: 2px solid rgba(255, 255, 255, 0.3);
}

.feedback-btn-nav:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
}

/* 明亮模式下反馈按钮文字为黑色 */
:root .feedback-btn-nav {
    color: black;
}

/* 深色模式下反馈按钮文字为白色 */
[data-theme="dark"] .feedback-btn-nav {
    color: white;
}

/* 爪子图标动画 */
.paw-icon {
    display: inline-block;
    animation: pawWiggle 2s ease-in-out infinite;
    transform-origin: center bottom;
}

@keyframes pawWiggle {
    0%, 100% { 
        transform: rotate(0deg) scale(1);
    }
    10% { 
        transform: rotate(-15deg) scale(1.1);
    }
    20% { 
        transform: rotate(10deg) scale(1.05);
    }
    30% { 
        transform: rotate(-10deg) scale(1.08);
    }
    40% { 
        transform: rotate(5deg) scale(1);
    }
    50% { 
        transform: rotate(0deg) scale(1);
    }
}

.nav-links {
    display: flex;
    gap: 1.5rem;
}

.nav-link {
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s;
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
}

.nav-link:hover {
    color: var(--primary-color);
    background: rgba(102, 126, 234, 0.1);
}

/* ==================== 主容器 ==================== */
.main-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
    min-height: calc(100vh - 140px);
}

/* ==================== 按钮样式 ==================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 0.5rem;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
}

.btn-primary {
    background: linear-gradient(135deg, #a1c4fd 0%, #c2e9fb 100%);
    color: #5a67d8;
    font-weight: 600;
    transition: all 3s ease;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
    background: linear-gradient(135deg, #8fb3f9 0%, #b8dff6 100%);
}

.btn-gradient {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    overflow: hidden;
    border: none;
    color: white;
    font-weight: 600;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.btn-gradient-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    transition: opacity 2s ease-in-out;
}

.btn-gradient-bg-1 {
    opacity: 1;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 25%, #f093fb 50%, #f5576c 75%, #96e6a1 100%);
    background-size: 200% 200%;
    animation: btnGradientShift 6s ease infinite;
}

.btn-gradient-bg-2 {
    opacity: 0;
    background: linear-gradient(135deg, #d4fc79 0%, #96e6a1 25%, #f5576c 50%, #f093fb 75%, #667eea 100%);
    background-size: 200% 200%;
    animation: btnGradientShift 6s ease infinite;
    animation-delay: 3s;
}

@keyframes btnGradientShift {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

.btn-text {
    position: relative;
    z-index: 1;
    padding: 0.75rem 1.5rem;
}

.btn-gradient:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.btn-secondary {
    background: var(--border-color);
    color: var(--text-primary);
}

.btn-secondary:hover {
    background: #cbd5e0;
}

.btn-danger {
    background: var(--error-color);
    color: white;
}

.btn-danger:hover {
    background: #e53e3e;
}

.btn-small {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
}

.btn-large {
    padding: 1rem 2rem;
    font-size: 1.125rem;
}

.btn-full {
    width: 100%;
}

/* ==================== 表单样式 ==================== */
.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: var(--text-primary);
}

.form-input,
.form-textarea {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 2px solid var(--border-color);
    border-radius: 0.5rem;
    font-size: 1rem;
    transition: border-color 0.2s, box-shadow 0.2s;
    background: white;
}

.form-input:focus,
.form-textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.form-textarea {
    resize: vertical;
    min-height: 200px;
    font-family: inherit;
    line-height: 1.8;
}

.form-actions {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
}

/* ==================== 心情选择器 ==================== */
.current-mood-label {
    display: inline-block;
    margin-left: 0.5rem;
    padding: 0.25rem 0.75rem;
    background: var(--primary-light);
    color: var(--primary-color);
    border-radius: 15px;
    font-size: 0.85rem;
    font-weight: 600;
}

.mood-selector {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    padding: 1rem;
    background: #f8fafc;
    border-radius: 0.75rem;
    border: 2px solid var(--border-color);
    margin-top: 0.5rem;
}

.mood-selector input[type="radio"] {
    display: none;
}

.mood-option {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 0.75rem 1rem;
    border-radius: 0.75rem;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 2px solid transparent;
    background: white;
    min-width: 70px;
}

.mood-option:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow);
}

.mood-option.selected {
    border-color: var(--primary-color);
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.1) 0%, rgba(118, 75, 162, 0.1) 100%);
}

.mood-emoji {
    font-size: 1.75rem;
    margin-bottom: 0.25rem;
}

.mood-name {
    font-size: 0.85rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.mood-selector input[type="radio"]:checked + .mood-option {
    border-color: var(--primary-color);
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.15) 0%, rgba(118, 75, 162, 0.15) 100%);
}

.mood-selector input[type="radio"]:checked + .mood-option .mood-name {
    color: var(--primary-color);
    font-weight: 600;
}

/* ==================== 认证页面 ==================== */
.auth-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: calc(100vh - 200px);
}

.auth-card {
    background: var(--card-bg);
    padding: 3rem;
    border-radius: 1rem;
    box-shadow: var(--shadow-lg);
    width: 100%;
    max-width: 400px;
}

.auth-header {
    text-align: center;
    margin-bottom: 2rem;
}

.auth-header h1 {
    font-size: 2rem;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.auth-header p {
    color: var(--text-secondary);
}

.auth-form {
    margin-bottom: 1.5rem;
}

.auth-footer {
    text-align: center;
    color: var(--text-secondary);
}

.auth-footer a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
}

.auth-footer a:hover {
    text-decoration: underline;
}

/* ==================== 动物选择页面 ==================== */
.animal-selection-container {
    max-width: 900px;
    margin: 0 auto;
}

.animal-selection-header {
    text-align: center;
    margin-bottom: 3rem;
    color: white;
}

.animal-selection-header h1 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

.animal-selection-header p {
    font-size: 1.25rem;
    opacity: 0.9;
}

.animal-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.animal-card {
    cursor: pointer;
    position: relative;
}

.animal-card input {
    position: absolute;
    opacity: 0;
}

.animal-card-content {
    background: var(--card-bg);
    border-radius: 1rem;
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: all 0.3s;
    border: 3px solid transparent;
}

.animal-card:hover .animal-card-content {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

.animal-card input:checked + .animal-card-content {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.3);
}

/* .animal-image 样式已移除，使用 .animal-select-img 替代 */

.animal-info {
    padding: 1.5rem;
    text-align: center;
}

.animal-info h3 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.animal-info p {
    color: var(--text-secondary);
}

/* 动物选择页面 - 静态图片布局 */
.animal-image-box {
    width: 100%;
    height: 220px;
    overflow: hidden;
    border-radius: 1rem 1rem 0 0;
    position: relative;
}

.animal-select-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.animal-card:hover .animal-select-img {
    transform: scale(1.05);
}

.animal-tag {
    display: inline-block;
    margin-top: 10px;
    padding: 8px 16px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 500;
}

.animal-selection-actions {
    text-align: center;
}

/* ==================== 日记列表 ==================== */
.diary-list-container {
    background: var(--card-bg);
    border-radius: 1rem;
    padding: 2rem;
    box-shadow: var(--shadow-lg);
}

.diary-list-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid var(--border-color);
}

.diary-list-header h1 {
    font-size: 1.875rem;
    color: #000000;
}

.diary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
}

.diary-card {
    background: var(--bg-color);
    border-radius: 0.75rem;
    padding: 1.5rem;
    transition: transform 0.2s, box-shadow 0.2s;
    border: 1px solid var(--border-color);
}

.diary-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow);
}

.diary-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1rem;
}

.diary-title {
    font-size: 1.25rem;
    color: #000000;
    margin: 0;
    flex: 1;
    margin-right: 1rem;
}

.diary-title-row {
    display: flex;
    align-items: center;
    flex: 1;
}

.diary-mood {
    font-size: 1.5rem;
    margin-left: 0.5rem;
    animation: bounce 1s ease-in-out infinite;
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-5px); }
}

.diary-date {
    font-size: 0.875rem;
    color: var(--text-secondary);
    white-space: nowrap;
}

.diary-preview {
    color: var(--text-secondary);
    margin-bottom: 1rem;
    line-height: 1.6;
    word-wrap: break-word;
    overflow-wrap: break-word;
    max-height: 4.8em;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
}

.diary-ai-hint {
    display: inline-block;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 1rem;
    font-size: 0.75rem;
    margin-bottom: 1rem;
}

.diary-card-actions {
    display: flex;
    gap: 0.5rem;
}

/* 页面动物伙伴样式已移除 */

/* ==================== 空状态 ==================== */
.empty-state {
    text-align: center;
    padding: 4rem 2rem;
}

.empty-state-icon {
    font-size: 5rem;
    margin-bottom: 1rem;
}

.empty-animal-icon {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
}

.empty-cat {
    display: inline-block;
    animation: emptyCatDance 2.5s ease-in-out infinite;
    font-size: 6rem;
    filter: drop-shadow(0 8px 16px rgba(0,0,0,0.3));
}

.empty-dolphin {
    display: inline-block;
    animation: emptyDolphinSwim 2s ease-in-out infinite;
    font-size: 6rem;
}

.empty-dog {
    display: inline-block;
    animation: emptyDogExcited 0.8s ease-in-out infinite;
    font-size: 6rem;
}

.empty-message {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 12px 20px;
    border-radius: 25px;
    font-size: 1rem;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
    animation: emptyMessagePulse 2s ease-in-out infinite;
}

@keyframes emptyCatDance {
    0%, 100% { 
        transform: rotate(-15deg) translateY(0) scale(1);
        filter: drop-shadow(0 8px 16px rgba(0,0,0,0.3));
    }
    10% { 
        transform: rotate(20deg) translateY(-30px) scale(1.25);
        filter: drop-shadow(0 25px 30px rgba(0,0,0,0.4));
    }
    25% { 
        transform: rotate(-10deg) translateY(-10px) scale(1.1);
        filter: drop-shadow(0 12px 20px rgba(0,0,0,0.35));
    }
    40% { 
        transform: rotate(25deg) translateY(-35px) scale(1.3);
        filter: drop-shadow(0 30px 35px rgba(0,0,0,0.45));
    }
    55% { 
        transform: rotate(-5deg) translateY(-15px) scale(1.15);
        filter: drop-shadow(0 15px 22px rgba(0,0,0,0.32));
    }
    70% { 
        transform: rotate(18deg) translateY(-25px) scale(1.2);
        filter: drop-shadow(0 22px 28px rgba(0,0,0,0.38));
    }
    85% { 
        transform: rotate(-8deg) translateY(-8px) scale(1.05);
        filter: drop-shadow(0 10px 15px rgba(0,0,0,0.28));
    }
}

@keyframes emptyDolphinSwim {
    0%, 100% { 
        transform: translateX(0) rotate(-6deg) scale(1);
        filter: drop-shadow(0 8px 16px rgba(0,0,0,0.3));
    }
    12.5% { 
        transform: translateX(10px) rotate(2deg) scale(1.05);
        filter: drop-shadow(5px 9px 17px rgba(0,0,0,0.31));
    }
    25% { 
        transform: translateX(20px) rotate(8deg) scale(1.1);
        filter: drop-shadow(8px 11px 19px rgba(0,0,0,0.33));
    }
    37.5% { 
        transform: translateX(12px) rotate(3deg) scale(1.06);
        filter: drop-shadow(6px 10px 17px rgba(0,0,0,0.31));
    }
    50% { 
        transform: translateX(0) rotate(0deg) scale(1.03);
        filter: drop-shadow(0 9px 16px rgba(0,0,0,0.3));
    }
    62.5% { 
        transform: translateX(-12px) rotate(-4deg) scale(1.06);
        filter: drop-shadow(-5px 10px 17px rgba(0,0,0,0.31));
    }
    75% { 
        transform: translateX(-20px) rotate(-8deg) scale(1.1);
        filter: drop-shadow(-8px 11px 19px rgba(0,0,0,0.33));
    }
    87.5% { 
        transform: translateX(-10px) rotate(-2deg) scale(1.05);
        filter: drop-shadow(-5px 9px 17px rgba(0,0,0,0.31));
    }
}

@keyframes emptyDogExcited {
    0%, 100% { transform: rotate(-20deg) scale(1); }
    50% { transform: rotate(20deg) scale(1.2); }
}

@keyframes emptyMessagePulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

.empty-state h3 {
    font-size: 1.5rem;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.empty-state p {
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
}

/* ==================== 日记详情 ==================== */
.diary-detail-container {
    background: var(--card-bg);
    border-radius: 1rem;
    padding: 2rem;
    box-shadow: var(--shadow-lg);
}

/* 深色模式下的日记详情 */
[data-theme="dark"] .diary-detail-container {
    background: #1a1a1a;
    color: #c0c0c0;
}

[data-theme="dark"] .diary-detail-container .diary-meta h1 {
    color: #e0e0e0;
}

[data-theme="dark"] .diary-detail-container .diary-content {
    color: #c0c0c0;
}

[data-theme="dark"] .diary-detail-container .diary-meta-row {
    color: #a0a0a0;
}

.diary-detail-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 2px solid var(--border-color);
}

.diary-meta h1 {
    font-size: 2rem;
    color: var(--text-primary);
    margin-bottom: 0.75rem;
}

.diary-meta-row {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    color: var(--text-secondary);
    font-size: 0.875rem;
}

.diary-mood-detail {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.1rem;
    color: var(--primary-color);
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.diary-actions {
    display: flex;
    gap: 0.75rem;
}

.delete-form {
    display: inline;
}

.diary-content {
    font-size: 1.125rem;
    line-height: 2;
    color: var(--text-primary);
    margin-bottom: 2rem;
    white-space: pre-wrap;
}

/* ==================== AI 回复区域 ==================== */
.ai-response-section {
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    border-radius: 1rem;
    padding: 2rem;
    margin-bottom: 2rem;
}

.ai-response-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.animal-avatar {
    font-size: 3rem;
}

/* 日记详情页动物头像动画 */
.animal-avatar-detail {
    font-size: 4rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* AI回复区域宠物头像图片 */
.avatar-img {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    object-fit: cover;
    border: 4px solid white;
    box-shadow: 0 6px 20px rgba(0,0,0,0.25);
    transition: transform 0.3s ease;
}

.avatar-img:hover {
    transform: scale(1.1);
}

.avatar-cat-img {
    animation: avatarCatImgFloat 5s ease-in-out infinite;
}

.avatar-dolphin-img {
    animation: avatarDolphinImgFloat 3s ease-in-out infinite;
}

.avatar-dog-img {
    animation: avatarDogImgFloat 2s ease-in-out infinite;
}

@keyframes avatarCatImgFloat {
    0%, 100% { transform: translateY(0) rotate(-5deg); }
    50% { transform: translateY(-8px) rotate(5deg); }
}

@keyframes avatarDolphinImgFloat {
    0%, 100% { transform: translateY(0) rotate(-3deg); }
    50% { transform: translateY(-6px) rotate(3deg); }
}

@keyframes avatarDogImgFloat {
    0%, 100% { transform: translateY(0) rotate(-8deg); }
    50% { transform: translateY(-10px) rotate(8deg); }
}

/* 保留原来的emoji样式作为备用 */
.avatar-cat {
    display: inline-block;
    animation: avatarCatTalk 4s ease-in-out infinite;
    filter: drop-shadow(0 6px 12px rgba(0,0,0,0.25));
}

.avatar-dolphin {
    display: inline-block;
    animation: avatarDolphinTalk 2s ease-in-out infinite;
    filter: drop-shadow(0 4px 8px rgba(0,0,0,0.2));
}

.avatar-dog {
    display: inline-block;
    animation: avatarDogTalk 2s ease-in-out infinite;
    filter: drop-shadow(0 4px 8px rgba(0,0,0,0.2));
}

@keyframes avatarCatTalk {
    0%, 100% { 
        transform: scale(1) rotate(-10deg);
        filter: drop-shadow(0 6px 12px rgba(0,0,0,0.25));
    }
    20% { 
        transform: scale(1.2) rotate(15deg) translateY(-8px);
        filter: drop-shadow(0 15px 20px rgba(0,0,0,0.35));
    }
    40% { 
        transform: scale(1.1) rotate(-8deg) translateY(-3px);
        filter: drop-shadow(0 10px 15px rgba(0,0,0,0.3));
    }
    60% { 
        transform: scale(1.25) rotate(20deg) translateY(-12px);
        filter: drop-shadow(0 20px 25px rgba(0,0,0,0.4));
    }
    80% { 
        transform: scale(1.15) rotate(-5deg) translateY(-5px);
        filter: drop-shadow(0 12px 18px rgba(0,0,0,0.28));
    }
}

@keyframes avatarDolphinTalk {
    0%, 100% { 
        transform: translateY(0) rotate(-4deg) scale(1);
        filter: drop-shadow(0 6px 12px rgba(0,0,0,0.25));
    }
    12.5% { 
        transform: translateY(-3px) rotate(1deg) scale(1.02);
        filter: drop-shadow(0 7px 13px rgba(0,0,0,0.26));
    }
    25% { 
        transform: translateY(-6px) rotate(5deg) scale(1.04);
        filter: drop-shadow(0 8px 14px rgba(0,0,0,0.27));
    }
    37.5% { 
        transform: translateY(-4px) rotate(2deg) scale(1.03);
        filter: drop-shadow(0 7px 13px rgba(0,0,0,0.26));
    }
    50% { 
        transform: translateY(-2px) rotate(0deg) scale(1.01);
        filter: drop-shadow(0 6px 12px rgba(0,0,0,0.25));
    }
    62.5% { 
        transform: translateY(-4px) rotate(-3deg) scale(1.03);
        filter: drop-shadow(0 7px 13px rgba(0,0,0,0.26));
    }
    75% { 
        transform: translateY(-6px) rotate(-6deg) scale(1.04);
        filter: drop-shadow(0 8px 14px rgba(0,0,0,0.27));
    }
    87.5% { 
        transform: translateY(-3px) rotate(-1deg) scale(1.02);
        filter: drop-shadow(0 7px 13px rgba(0,0,0,0.26));
    }
}

@keyframes avatarDogTalk {
    0%, 100% { transform: rotate(-10deg) scale(1); }
    25% { transform: rotate(15deg) scale(1.2); }
    50% { transform: rotate(-15deg) scale(1); }
    75% { transform: rotate(10deg) scale(1.1); }
}

.ai-response-header h3 {
    color: #000000;
    font-size: 1.25rem;
}

.ai-response-content {
    background: white;
    padding: 1.5rem;
    border-radius: 0.75rem;
    color: var(--text-primary);
    line-height: 1.8;
    font-style: italic;
    border-left: 4px solid var(--primary-color);
}

.diary-detail-footer {
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 2px solid var(--border-color);
}

/* ==================== 日记表单 ==================== */
.diary-form-container {
    background: var(--card-bg);
    border-radius: 1rem;
    padding: 2rem;
    box-shadow: var(--shadow-lg);
    max-width: 800px;
    margin: 0 auto;
}

.diary-form-header {
    margin-bottom: 2rem;
}

.diary-form-header h1 {
    font-size: 1.875rem;
    color: #000000;
    margin-bottom: 0.5rem;
}

.diary-form-header p {
    color: var(--text-secondary);
}

/* ==================== Flash 消息 ==================== */
.flash-messages {
    margin-bottom: 1.5rem;
}

.flash-message {
    padding: 1rem 1.5rem;
    border-radius: 0.5rem;
    margin-bottom: 0.75rem;
    font-weight: 500;
}

.flash-success {
    background: #c6f6d5;
    color: #22543d;
    border-left: 4px solid var(--success-color);
}

.flash-error {
    background: #fed7d7;
    color: #742a2a;
    border-left: 4px solid var(--error-color);
}

.flash-info {
    background: #bee3f8;
    color: #2a4365;
    border-left: 4px solid var(--info-color);
}

/* ==================== 切换动物弹窗 ==================== */
.animal-switcher-trigger {
    position: fixed;
    left: 20px;
    top: 65%;
    transform: translateY(-50%);
    background: white;
    border-radius: 1rem;
    padding: 12px 16px;
    box-shadow: var(--shadow-lg);
    cursor: pointer;
    z-index: 100;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
    border: 3px solid transparent;
}

.animal-switcher-trigger:hover {
    transform: translateY(-50%) scale(1.1);
    border-color: var(--primary-color);
    box-shadow: 0 10px 25px rgba(102, 126, 234, 0.3);
}

.current-animal {
    font-size: 2.5rem;
    animation: triggerBounce 1s ease-in-out infinite;
}

.switcher-text {
    font-size: 0.75rem;
    color: var(--text-secondary);
    font-weight: 600;
    white-space: nowrap;
}

@keyframes triggerBounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-5px); }
}

.animal-switcher-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.animal-switcher-modal.active {
    opacity: 1;
    visibility: visible;
}

.animal-switcher-content {
    background: white;
    border-radius: 1.5rem;
    padding: 2rem;
    width: 90%;
    max-width: 500px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    transform: scale(0.8) translateY(20px);
    transition: all 0.3s ease;
}

.animal-switcher-modal.active .animal-switcher-content {
    transform: scale(1) translateY(0);
}

.switcher-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid var(--border-color);
}

.switcher-header h3 {
    font-size: 1.5rem;
    color: var(--text-primary);
    margin: 0;
}

.close-switcher {
    background: none;
    border: none;
    font-size: 2rem;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 0;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s ease;
}

.close-switcher:hover {
    background: var(--bg-color);
    color: var(--error-color);
}

.switcher-animals {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.switcher-animal-option {
    background: var(--bg-color);
    border-radius: 1rem;
    padding: 1.5rem 1rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 3px solid transparent;
}

.switcher-animal-option:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow);
    background: white;
}

.switcher-animal-option.active {
    border-color: var(--primary-color);
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.switcher-animal-option.active .switcher-animal-name,
.switcher-animal-option.active .switcher-animal-desc {
    color: white;
}

.switcher-animal-emoji {
    font-size: 3rem;
    margin-bottom: 0.5rem;
    display: inline-block;
}

.switcher-cat {
    animation: switcherCatWiggle 3s ease-in-out infinite;
    filter: drop-shadow(0 4px 8px rgba(0,0,0,0.2));
}

.switcher-dolphin {
    animation: switcherDolphinJump 2s ease-in-out infinite;
}

.switcher-dog {
    animation: switcherDogWag 2s ease-in-out infinite;
}

.switcher-animal-option:hover .switcher-animal-emoji {
    animation-duration: 2s;
}

.switcher-animal-name {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

.switcher-animal-desc {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

@keyframes switcherCatWiggle {
    0%, 100% { 
        transform: rotate(-15deg) scale(1);
        filter: drop-shadow(0 4px 8px rgba(0,0,0,0.2));
    }
    25% { 
        transform: rotate(20deg) scale(1.3) translateY(-10px);
        filter: drop-shadow(0 15px 20px rgba(0,0,0,0.35));
    }
    50% { 
        transform: rotate(-10deg) scale(1.1) translateY(-3px);
        filter: drop-shadow(0 8px 12px rgba(0,0,0,0.25));
    }
    75% { 
        transform: rotate(25deg) scale(1.35) translateY(-15px);
        filter: drop-shadow(0 20px 25px rgba(0,0,0,0.4));
    }
}

@keyframes switcherDolphinJump {
    0%, 100% { 
        transform: translateY(0) rotate(-4deg) scale(1);
        filter: drop-shadow(0 4px 8px rgba(0,0,0,0.2));
    }
    12.5% { 
        transform: translateY(-4px) rotate(1deg) scale(1.04);
        filter: drop-shadow(0 5px 9px rgba(0,0,0,0.22));
    }
    25% { 
        transform: translateY(-8px) rotate(6deg) scale(1.08);
        filter: drop-shadow(0 7px 11px rgba(0,0,0,0.25));
    }
    37.5% { 
        transform: translateY(-5px) rotate(2deg) scale(1.05);
        filter: drop-shadow(0 6px 10px rgba(0,0,0,0.23));
    }
    50% { 
        transform: translateY(-3px) rotate(0deg) scale(1.02);
        filter: drop-shadow(0 5px 9px rgba(0,0,0,0.22));
    }
    62.5% { 
        transform: translateY(-5px) rotate(-3deg) scale(1.05);
        filter: drop-shadow(0 6px 10px rgba(0,0,0,0.23));
    }
    75% { 
        transform: translateY(-8px) rotate(-6deg) scale(1.08);
        filter: drop-shadow(0 7px 11px rgba(0,0,0,0.25));
    }
    87.5% { 
        transform: translateY(-4px) rotate(-2deg) scale(1.04);
        filter: drop-shadow(0 5px 9px rgba(0,0,0,0.22));
    }
}

@keyframes switcherDogWag {
    0%, 100% { transform: rotate(-15deg); }
    50% { transform: rotate(15deg); }
}

.switcher-form {
    margin-top: 1rem;
}

/* ==================== 页脚 ==================== */
.footer {
    text-align: center;
    padding: 1rem;
    margin-top: -1rem;
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.875rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

/* 反馈按钮 */
.feedback-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.5rem 1rem;
    background: rgba(255, 255, 255, 0.2);
    color: white;
    text-decoration: none;
    border-radius: 20px;
    font-size: 0.875rem;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.feedback-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
}

/* ==================== 响应式设计 ==================== */
@media (max-width: 768px) {
    .nav-container {
        padding: 1rem;
    }

    .nav-links {
        gap: 0.5rem;
    }

    .nav-link {
        padding: 0.4rem 0.75rem;
        font-size: 0.875rem;
    }

    .main-container {
        padding: 1rem;
    }

    .auth-card {
        padding: 2rem 1.5rem;
    }

    .animal-selection-header h1 {
        font-size: 1.875rem;
    }

    .diary-list-header {
        flex-direction: column;
        gap: 1rem;
        align-items: stretch;
    }

    .diary-detail-header {
        flex-direction: column;
        gap: 1rem;
    }

    .diary-actions {
        width: 100%;
        justify-content: flex-start;
    }

    .form-actions {
        flex-direction: column;
    }

    .form-actions .btn {
        width: 100%;
    }
}

/* ==================== 动画 ==================== */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.diary-card,
.auth-card,
.animal-card-content {
    animation: fadeIn 0.3s ease-out;
}

/* ==================== 浮动宠物 GIF ==================== */
.floating-pet {
    position: fixed;
    width: 120px;
    height: 120px;
    z-index: 50;
    pointer-events: none;
    opacity: 0.9;
}

.floating-pet img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    border-radius: 50%;
}

.pet-top-left {
    top: 80px;
    left: 20px;
    animation: float 3s ease-in-out infinite;
}

.pet-top-right {
    top: 100px;
    right: 20px;
    animation: float 3s ease-in-out infinite 0.5s;
}

.pet-bottom-left {
    bottom: 80px;
    left: 30px;
    animation: float 3s ease-in-out infinite 1s;
}

.pet-bottom-right {
    bottom: 100px;
    right: 30px;
    animation: float 3s ease-in-out infinite 1.5s;
}

@keyframes float {
    0%, 100% {
        transform: translateY(0) rotate(0deg);
    }
    50% {
        transform: translateY(-15px) rotate(5deg);
    }
}

/* 写日记页面动物伙伴样式已移除 */

/* ==================== 日记日历 ==================== */
.diary-calendar-section {
    background: white;
    border-radius: 1rem;
    padding: 1.5rem;
    margin-bottom: 2rem;
    box-shadow: var(--shadow);
}

.calendar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.calendar-title {
    font-size: 1.25rem;
    color: var(--text-primary);
    margin: 0;
}

.calendar-nav-btn {
    background: var(--primary-color);
    color: white;
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1rem;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.calendar-nav-btn:hover {
    background: var(--primary-hover);
    transform: scale(1.1);
}

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 8px;
}

.calendar-weekday {
    text-align: center;
    font-weight: 600;
    color: var(--text-secondary);
    padding: 0.5rem;
    font-size: 0.875rem;
}

.calendar-day {
    aspect-ratio: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border-radius: 0.75rem;
    cursor: pointer;
    transition: all 0.3s ease;
    background: #f7fafc;
    position: relative;
    min-height: 60px;
}

.calendar-day:hover {
    background: #e2e8f0;
    transform: translateY(-2px);
}

.calendar-day.other-month {
    opacity: 0.4;
}

.calendar-day.today {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.calendar-day.today:hover {
    transform: translateY(-2px) scale(1.05);
}

.calendar-day.has-diary {
    background: linear-gradient(135deg, #48bb78 0%, #38a169 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(72, 187, 120, 0.4);
}

.calendar-day.has-diary:hover {
    transform: translateY(-2px) scale(1.05);
}

.calendar-day.has-diary.today {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: 3px solid #48bb78;
}

/* 过去日期的样式 */
.calendar-day.past-day {
    background: #ffffff;
    border: 2px solid #e2e8f0;
    color: #a0aec0;
    cursor: not-allowed;
}

.calendar-day.past-day:hover {
    background: #f7fafc;
    transform: none;
}

.calendar-day.past-day.has-diary {
    background: #ffffff;
    border: 2px solid #48bb78;
    color: #38a169;
}

.calendar-day.past-day.today {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: 3px solid #e2e8f0;
    color: white;
}

.day-number {
    font-size: 1rem;
    font-weight: 600;
}

.diary-indicator {
    font-size: 0.75rem;
    margin-top: 2px;
}

.calendar-legend {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.legend-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
}

.legend-dot.has-diary {
    background: linear-gradient(135deg, #48bb78 0%, #38a169 100%);
}

.legend-dot.no-diary {
    background: #f7fafc;
    border: 1px solid #e2e8f0;
}

.legend-dot.today {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

/* ==================== 日历按钮 ==================== */
.header-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.calendar-trigger-btn {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background: white;
    padding: 0.75rem 1rem;
    border-radius: 1rem;
    box-shadow: var(--shadow);
    cursor: pointer;
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.calendar-trigger-btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary-color);
}

.calendar-icon {
    font-size: 1.5rem;
}

.calendar-info {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.calendar-date {
    font-weight: 600;
    color: #000000;
    font-size: 0.9rem;
}

.calendar-count {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

/* ==================== 日历弹窗 ==================== */
.calendar-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.calendar-modal.active {
    opacity: 1;
    visibility: visible;
}

.calendar-modal-content {
    background: white;
    border-radius: 1.5rem;
    padding: 2rem;
    width: 90%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    transform: scale(0.8) translateY(20px);
    transition: all 0.3s ease;
}

.calendar-modal.active .calendar-modal-content {
    transform: scale(1) translateY(0);
}

.calendar-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid var(--border-color);
}

.calendar-modal-header h3 {
    margin: 0;
    font-size: 1.25rem;
    color: var(--text-primary);
}

.close-calendar {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--text-secondary);
    cursor: pointer;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.close-calendar:hover {
    background: #f7fafc;
    color: var(--text-primary);
}

.calendar-section {
    padding: 0;
}

/* 响应式：小屏幕上日历按钮简化显示 */
@media (max-width: 768px) {
    .calendar-trigger-btn {
        padding: 0.5rem 0.75rem;
    }
    
    .calendar-info {
        display: none;
    }
    
    .calendar-modal-content {
        padding: 1.5rem;
        width: 95%;
    }
}

/* ==================== 深色模式支持 ==================== */

/* 强制深色模式 */
[data-theme="dark"] {
    /* 文字颜色 */
    --text-primary: #ffffff;
    --text-secondary: #a6a6a6;
    --text-tertiary: #8c8c8c;
    --text-disabled: #434343;
    
    /* 背景颜色 */
    --bg-primary: #141414;
    --bg-secondary: #1f1f1f;
    --bg-tertiary: #262626;
    
    /* 边框颜色 */
    --border-color: #434343;
    --border-light: #303030;
    
    /* 阴影 */
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.2);
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.3), 0 1px 2px rgba(0, 0, 0, 0.2);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.3), 0 2px 4px -1px rgba(0, 0, 0, 0.2);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.3), 0 4px 6px -2px rgba(0, 0, 0, 0.2);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.3), 0 10px 10px -5px rgba(0, 0, 0, 0.2);
}

/* 深色模式下的背景 */
[data-theme="dark"] body {
    background-color: #141414;
}

[data-theme="dark"] .bg-layer {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
}

[data-theme="dark"] .card {
    background: #1f1f1f;
    border-color: #303030;
}

[data-theme="dark"] .stat-card,
[data-theme="dark"] .feature-card,
[data-theme="dark"] .companion-card,
[data-theme="dark"] .testimonial-card,
[data-theme="dark"] .faq-item {
    background: #1f1f1f;
    border-color: #303030;
}

[data-theme="dark"] .stat-card:hover,
[data-theme="dark"] .feature-card:hover,
[data-theme="dark"] .companion-card:hover {
    background: #262626;
}

[data-theme="dark"] .faq-item:hover {
    background: #262626;
}

[data-theme="dark"] .cta-content {
    background: linear-gradient(135deg, #1a3a6e 0%, #0d2144 100%);
}

[data-theme="dark"] .auth-card {
    background: #141414;
}

/* 深色模式下的文字颜色 */
[data-theme="dark"] .hero-title,
[data-theme="dark"] .section-title,
[data-theme="dark"] .feature-title,
[data-theme="dark"] .companion-name,
[data-theme="dark"] .testimonial-text,
[data-theme="dark"] .faq-question {
    color: #ffffff;
}

[data-theme="dark"] .hero-subtitle,
[data-theme="dark"] .section-description,
[data-theme="dark"] .stat-label,
[data-theme="dark"] .companion-type,
[data-theme="dark"] .testimonial-author,
[data-theme="dark"] .faq-answer p {
    color: #a6a6a6;
}

[data-theme="dark"] .cta-content p {
    color: rgba(255, 255, 255, 0.9);
}

[data-theme="dark"] .cta-content h2 {
    color: rgba(255, 255, 255, 0.85);
}

/* 深色模式下的AI响应内容 */
[data-theme="dark"] .ai-response-content {
    background: #262626;
    color: #ffffff;
    border-left-color: #1677ff;
}

/* 深色模式下的日记列表容器 */
[data-theme="dark"] .diary-list-container {
    background: rgba(30, 30, 30, 0.8);
}

/* 深色模式下的日记列表标题 */
[data-theme="dark"] .diary-list-header h1 {
    color: #d0d0d0;
}

/* 深色模式下的动物切换弹窗 */
[data-theme="dark"] .animal-switcher-content {
    background: #000000;
}

[data-theme="dark"] .switcher-animal-name {
    color: #a0a0a0;
}

/* 深色模式下的登录/注册页面标题 */
[data-theme="dark"] .auth-header h1 {
    color: #000000;
}

[data-theme="dark"] .form-group label {
    color: #000000;
}

/* 明亮模式下的动物选择页面 */
:root .animal-selection-header {
    color: #000000;
}

/* 深色模式下的动物选择页面 */
[data-theme="dark"] .animal-selection-header {
    color: #ffffff;
}

[data-theme="dark"] .animal-card {
    background: #1f1f1f;
    border-color: #434343;
}

[data-theme="dark"] .animal-card:hover {
    border-color: #1677ff;
    box-shadow: 0 4px 12px rgba(22, 119, 255, 0.2);
}

[data-theme="dark"] .animal-info h3 {
    color: #ffffff;
}

[data-theme="dark"] .animal-info p {
    color: #a6a6a6;
}

[data-theme="dark"] .animal-tag {
    background: linear-gradient(135deg, #0958d9 0%, #003eb3 100%);
}

/* 深色模式下的按钮 */
[data-theme="dark"] .btn-secondary {
    background: #434343;
    color: #ffffff;
}

[data-theme="dark"] .btn-secondary:hover {
    background: #1677ff;
}

[data-theme="dark"] .btn-primary {
    background: linear-gradient(135deg, #0958d9 0%, #003eb3 100%);
    color: #ffffff;
}

[data-theme="dark"] .refresh-btn {
    background: #434343;
    border-color: #1677ff;
    color: #ffffff;
}

[data-theme="dark"] .refresh-btn:hover {
    background: #1677ff;
    border-color: #1677ff;
}

/* 深色模式下的表单元素 */
[data-theme="dark"] .form-input,
[data-theme="dark"] .form-textarea {
    background: #D2B48C;
    border-color: #C19A6B;
    color: #000000;
}

[data-theme="dark"] .form-input:focus,
[data-theme="dark"] .form-textarea:focus {
    border-color: #1677ff;
    box-shadow: 0 0 0 3px rgba(22, 119, 255, 0.2);
}

/* 深色模式下的日历 */
[data-theme="dark"] .calendar-day {
    background: #262626;
    border-color: #303030;
}

[data-theme="dark"] .calendar-day:hover {
    background: #303030;
}

[data-theme="dark"] .calendar-weekday {
    color: #a6a6a6;
}

/* ==================== 护眼模式支持 ==================== */

/* 护眼模式变量 */
[data-theme="eye-care"] {
    --text-primary: #5c4b37;
    --text-secondary: #7a6b5a;
    --text-tertiary: #998e80;
    --text-disabled: #b8b0a6;
    
    --bg-primary: #fdf6e3;
    --bg-secondary: #f5ecd8;
    --bg-tertiary: #f0e6d0;
    
    --border-color: #e5d9c3;
    --border-light: #f0e6d0;
    
    --primary-color: #8b7355;
    --primary-hover: #6d5a42;
    --primary-light: #f5ecd8;
    
    --shadow-sm: 0 1px 2px rgba(139, 115, 85, 0.1);
    --shadow: 0 1px 3px rgba(139, 115, 85, 0.15), 0 1px 2px rgba(139, 115, 85, 0.1);
    --shadow-md: 0 4px 6px -1px rgba(139, 115, 85, 0.15), 0 2px 4px -1px rgba(139, 115, 85, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(139, 115, 85, 0.15), 0 4px 6px -2px rgba(139, 115, 85, 0.1);
    --shadow-xl: 0 20px 25px -5px rgba(139, 115, 85, 0.15), 0 10px 10px -5px rgba(139, 115, 85, 0.1);
}

/* 护眼模式下的背景 - 浅黄色 */
[data-theme="eye-care"] body {
    background-color: #fdf6e3 !important;
}

[data-theme="eye-care"] .bg-layer,
[data-theme="eye-care"] .home-page-bg,
[data-theme="eye-care"] .diary-list-bg {
    background: #fdf6e3 !important;
    animation: none !important;
}

[data-theme="eye-care"] .home-page-bg::before,
[data-theme="eye-care"] .home-page-bg::after,
[data-theme="eye-care"] .diary-list-bg::before,
[data-theme="eye-care"] .diary-list-bg::after {
    display: none !important;
}

[data-theme="eye-care"] .nav-container {
    background: rgba(253, 246, 227, 0.95) !important;
    border-bottom-color: #e5d9c3;
}

[data-theme="eye-care"] .card,
[data-theme="eye-care"] .stat-card,
[data-theme="eye-care"] .feature-card,
[data-theme="eye-care"] .companion-card,
[data-theme="eye-care"] .testimonial-card,
[data-theme="eye-care"] .faq-item {
    background: #f5ecd8;
    border-color: #e5d9c3;
}

[data-theme="eye-care"] .hero-content,
[data-theme="eye-care"] .cta-content {
    background: rgba(245, 236, 216, 0.9);
}

[data-theme="eye-care"] .hero-title,
[data-theme="eye-care"] .section-title,
[data-theme="eye-care"] .feature-title,
[data-theme="eye-care"] .companion-name,
[data-theme="eye-care"] .testimonial-text,
[data-theme="eye-care"] .faq-question {
    color: #5c4b37;
}

[data-theme="eye-care"] .hero-subtitle,
[data-theme="eye-care"] .section-description,
[data-theme="eye-care"] .stat-label,
[data-theme="eye-care"] .companion-type,
[data-theme="eye-care"] .testimonial-author,
[data-theme="eye-care"] .faq-answer p {
    color: #7a6b5a;
}

/* ==================== 响应式布局增强 ==================== */

/* 大屏幕 */
@media (min-width: 1400px) {
    .main-container {
        max-width: 1280px;
    }
}

/* 中等屏幕 */
@media (min-width: 1024px) and (max-width: 1399px) {
    .main-container {
        max-width: 1024px;
    }
}

/* 平板横屏 */
@media (min-width: 768px) and (max-width: 1023px) {
    .main-container {
        max-width: 768px;
        padding: 1.5rem 1rem;
    }
}

/* 平板竖屏 */
@media (min-width: 576px) and (max-width: 767px) {
    .main-container {
        max-width: 576px;
        padding: 1rem;
    }
}

/* 手机 */
@media (max-width: 575px) {
    .main-container {
        max-width: 100%;
        padding: 0.75rem;
    }
}

/* ==================== 打印样式 ==================== */
@media print {
    .navbar,
    .footer,
    .refresh-btn {
        display: none !important;
    }
    
    .main-container {
        max-width: 100%;
        padding: 0;
    }
    
    body {
        background: white;
        color: black;
    }
}

/* ==================== 性能优化 ==================== */

/* 减少动画 */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* 高对比度模式 */
@media (prefers-contrast: high) {
    :root {
        --primary-color: #0066cc;
        --text-primary: #000000;
        --text-secondary: #333333;
        --border-color: #000000;
    }
}

/* ==================== 工具类 ==================== */

/* 显示/隐藏 */
.hidden {
    display: none !important;
}

.visible {
    display: block !important;
}

@media (max-width: 768px) {
    .hidden-mobile {
        display: none !important;
    }
}

@media (min-width: 769px) {
    .hidden-desktop {
        display: none !important;
    }
}

/* 文本对齐 */
.text-center {
    text-align: center;
}

.text-left {
    text-align: left;
}

.text-right {
    text-align: right;
}

/* 字体粗细 */
.font-bold {
    font-weight: 700;
}

.font-medium {
    font-weight: 500;
}

.font-normal {
    font-weight: 400;
}

/* 字体大小 */
.text-sm {
    font-size: 12px;
}

.text-base {
    font-size: 14px;
}

.text-lg {
    font-size: 18px;
}

.text-xl {
    font-size: 20px;
}

.text-2xl {
    font-size: 24px;
}

.text-3xl {
    font-size: 30px;
}

/* 颜色 */
.text-primary {
    color: var(--primary-color);
}

.text-secondary {
    color: var(--text-secondary);
}

.text-success {
    color: var(--success-color);
}

.text-error {
    color: var(--error-color);
}

.text-warning {
    color: var(--warning-color);
}

/* 背景 */
.bg-primary {
    background-color: var(--bg-primary);
}

.bg-secondary {
    background-color: var(--bg-secondary);
}

.bg-tertiary {
    background-color: var(--bg-tertiary);
}

/* 边距 */
.m-0 { margin: 0; }
.m-auto { margin: auto; }
.mx-auto { margin-left: auto; margin-right: auto; }

.mt-0 { margin-top: 0; }
.mt-1 { margin-top: 4px; }
.mt-2 { margin-top: 8px; }
.mt-3 { margin-top: 12px; }
.mt-4 { margin-top: 16px; }
.mt-6 { margin-top: 24px; }
.mt-8 { margin-top: 32px; }

.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: 4px; }
.mb-2 { margin-bottom: 8px; }
.mb-3 { margin-bottom: 12px; }
.mb-4 { margin-bottom: 16px; }
.mb-6 { margin-bottom: 24px; }
.mb-8 { margin-bottom: 32px; }

.my-4 { margin-top: 16px; margin-bottom: 16px; }
.my-6 { margin-top: 24px; margin-bottom: 24px; }
.my-8 { margin-top: 32px; margin-bottom: 32px; }

/* 内边距 */
.p-0 { padding: 0; }
.p-1 { padding: 4px; }
.p-2 { padding: 8px; }
.p-3 { padding: 12px; }
.p-4 { padding: 16px; }
.p-6 { padding: 24px; }
.p-8 { padding: 32px; }

.px-2 { padding-left: 8px; padding-right: 8px; }
.px-4 { padding-left: 16px; padding-right: 16px; }
.px-6 { padding-left: 24px; padding-right: 24px; }

.py-2 { padding-top: 8px; padding-bottom: 8px; }
.py-4 { padding-top: 16px; padding-bottom: 16px; }
.py-6 { padding-top: 24px; padding-bottom: 24px; }

/* 圆角 */
.rounded {
    border-radius: 4px;
}

.rounded-md {
    border-radius: 8px;
}

.rounded-lg {
    border-radius: 12px;
}

.rounded-xl {
    border-radius: 16px;
}

.rounded-full {
    border-radius: 9999px;
}

/* 阴影 */
.shadow-sm {
    box-shadow: var(--shadow-sm);
}

.shadow {
    box-shadow: var(--shadow);
}

.shadow-md {
    box-shadow: var(--shadow-md);
}

.shadow-lg {
    box-shadow: var(--shadow-lg);
}

.shadow-xl {
    box-shadow: var(--shadow-xl);
}

/* 边框 */
.border {
    border: 1px solid var(--border-color);
}

.border-t {
    border-top: 1px solid var(--border-color);
}

.border-b {
    border-bottom: 1px solid var(--border-color);
}

.border-l {
    border-left: 1px solid var(--border-color);
}

.border-r {
    border-right: 1px solid var(--border-color);
}

/* Flexbox */
.flex {
    display: flex;
}

.flex-col {
    flex-direction: column;
}

.items-center {
    align-items: center;
}

.items-start {
    align-items: flex-start;
}

.items-end {
    align-items: flex-end;
}

.justify-center {
    justify-content: center;
}

.justify-start {
    justify-content: flex-start;
}

.justify-end {
    justify-content: flex-end;
}

.justify-between {
    justify-content: space-between;
}

.justify-around {
    justify-content: space-around;
}

.flex-wrap {
    flex-wrap: wrap;
}

.flex-nowrap {
    flex-wrap: nowrap;
}

.gap-1 { gap: 4px; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.gap-4 { gap: 16px; }
.gap-6 { gap: 24px; }
.gap-8 { gap: 32px; }

/* Grid */
.grid {
    display: grid;
}

.grid-cols-2 {
    grid-template-columns: repeat(2, 1fr);
}

.grid-cols-3 {
    grid-template-columns: repeat(3, 1fr);
}

.grid-cols-4 {
    grid-template-columns: repeat(4, 1fr);
}

@media (max-width: 768px) {
    .grid-cols-2,
    .grid-cols-3,
    .grid-cols-4 {
        grid-template-columns: 1fr;
    }
}

/* 溢出 */
.overflow-hidden {
    overflow: hidden;
}

.overflow-auto {
    overflow: auto;
}

.overflow-scroll {
    overflow: scroll;
}

/* 定位 */
.relative {
    position: relative;
}

.absolute {
    position: absolute;
}

.fixed {
    position: fixed;
}

.sticky {
    position: sticky;
}

/* 宽度和高度 */
.w-full {
    width: 100%;
}

.h-full {
    height: 100%;
}

.min-h-screen {
    min-height: 100vh;
}

/* 透明度 */
.opacity-0 {
    opacity: 0;
}

.opacity-50 {
    opacity: 0.5;
}

.opacity-100 {
    opacity: 1;
}

/* 过渡 */
.transition {
    transition: all 0.3s ease;
}

.transition-fast {
    transition: all 0.15s ease;
}

.transition-slow {
    transition: all 0.5s ease;
}

/* 变换 */
.transform {
    transform: translate(0, 0);
}

.scale-95 {
    transform: scale(0.95);
}

.scale-100 {
    transform: scale(1);
}

.scale-105 {
    transform: scale(1.05);
}

/* 指针事件 */
.pointer-events-none {
    pointer-events: none;
}

.pointer-events-auto {
    pointer-events: auto;
}

/* 用户选择 */
.select-none {
    user-select: none;
}

.select-text {
    user-select: text;
}

/* 滚动条样式 */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-secondary);
}

::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-disabled);
}

/* 选择文本颜色 */
::selection {
    background: var(--primary-color);
    color: white;
}
