/* public/assets-nianxiang/css/style.css (V2.0) */
:root { --bg-color: #F4F1EA; --text-color: #5D4037; --primary-color: #A1887F; --primary-hover: #8D6E63; --card-bg: #FFFAF0; --border-color: #D7CCC8; --subtle-text: #BDBDBD; --nav-height: 70px; }
* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { font-family: 'Noto Sans SC', 'Microsoft YaHei', sans-serif; background-color: var(--bg-color); color: var(--text-color); scroll-behavior: smooth; }
.main-content { padding: 20px 20px calc(var(--nav-height) + 20px); min-height: 100vh; }

/* 页面切换 */
.page { display: none; animation: fadeIn 0.5s ease; }
.page.active { display: block; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

/* 底部导航 */
.bottom-nav { position: fixed; bottom: 0; left: 0; right: 0; height: var(--nav-height); background: rgba(255, 250, 240, 0.85); backdrop-filter: blur(15px); border-top: 1px solid var(--border-color); display: flex; justify-content: space-around; align-items: center; z-index: 100; }
.nav-item { display: flex; flex-direction: column; align-items: center; gap: 4px; cursor: pointer; color: var(--primary-color); border: none; background: none; padding: 8px; border-radius: 8px; transition: color 0.3s, background-color 0.3s; }
.nav-item svg { width: 24px; height: 24px; }
.nav-item span { font-size: 11px; }
.nav-item.active, .nav-item:hover { color: var(--primary-hover); }

/* 首页 */
#page-home.active { display: flex; flex-direction: column; justify-content: center; align-items: center; text-align: center; min-height: calc(100vh - var(--nav-height) - 40px); }
.welcome-title { font-family: 'ZCOOL QingKe HuangYou', cursive; font-size: 4rem; font-weight: 400; color: var(--primary-hover); }
.welcome-subtitle { font-size: 1.1rem; font-weight: 300; color: var(--primary-color); margin-top: 5px; }
.daily-whisper { margin-top: 50px; font-size: 1rem; font-style: italic; color: #757575; max-width: 90%; line-height: 1.8; padding: 20px; border-top: 1px solid var(--border-color); }
.add-entry-btn { width: 60px; height: 60px; border-radius: 50%; border: none; background-color: var(--primary-color); color: white; font-size: 2.5rem; font-weight: 300; cursor: pointer; display: flex; justify-content: center; align-items: center; box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1); transition: all 0.3s ease; margin-top: 50px; }
.add-entry-btn:hover { background-color: var(--primary-hover); transform: translateY(-3px) scale(1.05); }

/* 通用头部 */
.page-header { text-align: center; font-size: 1.8rem; font-weight: 400; color: var(--primary-color); margin-bottom: 30px; padding-top: 40px; }
.timeline-container { max-width: 700px; margin: 0 auto; }

/* ✨✨✨ V2.0 卡片样式 ✨✨✨ */
#entry-list-container { padding-top: 10px; }
.entry-card { background-color: var(--card-bg); border-radius: 12px; padding: 20px 25px; margin-bottom: 20px; box-shadow: 0 1px 4px rgba(0, 0, 0, 0.04); border: 1px solid rgba(0,0,0,0.05); cursor: pointer; transition: all 0.3s ease; }
.entry-card:hover { transform: translateY(-3px); box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08); }
.card-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 15px; }
.card-title { font-size: 1.1rem; font-weight: 500; color: var(--text-color); }
.card-date { font-size: 0.8rem; color: var(--subtle-text); }
.card-excerpt { font-size: 1rem; line-height: 1.7; color: #757575; margin-bottom: 15px; }
.card-tags .tag { display: inline-block; background-color: #EFEBE9; color: var(--primary-hover); padding: 4px 12px; border-radius: 15px; font-size: 0.8rem; margin-right: 8px; }

/* 写作与详情模态框 (共用部分样式) */
.modal-overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background-color: rgba(0, 0, 0, 0.5); display: none; justify-content: center; align-items: center; padding: 20px; opacity: 0; transition: opacity 0.3s ease; z-index: 1000; }
.modal-overlay.visible { display: flex; opacity: 1; }
.modal-card { background-color: var(--bg-color); padding: 30px; border-radius: 15px; box-shadow: 0 5px 20px rgba(0, 0, 0, 0.2); width: 100%; max-width: 500px; position: relative; transform: scale(0.95); transition: transform 0.3s cubic-bezier(0.18, 0.89, 0.32, 1.28); }
.modal-overlay.visible .modal-card { transform: scale(1); }
.close-btn { position: absolute; top: 10px; right: 15px; font-size: 1.8rem; color: var(--subtle-text); background: none; border: none; cursor: pointer; }
.modal-card h2 { text-align: center; margin-bottom: 25px; font-weight: 500; color: var(--primary-hover); }
.form-group { margin-bottom: 20px; }
.form-group label { display: block; margin-bottom: 8px; font-weight: 500; color: var(--primary-hover); }
.form-group input, .form-group textarea { width: 100%; padding: 12px; border: 1px solid var(--border-color); border-radius: 8px; background-color: #FFF; font-family: 'Noto Sans SC', sans-serif; font-size: 1rem; color: var(--text-color); transition: border-color 0.3s, box-shadow 0.3s; }
.form-group input:focus, .form-group textarea:focus { outline: none; border-color: var(--primary-color); box-shadow: 0 0 0 3px rgba(161, 136, 127, 0.2); }
.form-group textarea { resize: vertical; min-height: 100px; }
.seal-btn { width: 100%; padding: 15px; border: none; border-radius: 8px; background-color: var(--primary-hover); color: white; font-size: 1.1rem; font-weight: 500; cursor: pointer; transition: background-color 0.3s ease; }
.seal-btn:hover { background-color: #795548; }

/* ✨✨✨ V2.0 新增：详情弹窗特有样式 ✨✨✨ */
#detail-modal .modal-card { max-width: 600px; }
.detail-header { text-align: center; margin-bottom: 25px; }
#detail-title { font-size: 1.5rem; color: var(--primary-hover); margin-bottom: 5px; }
#detail-date { font-size: 0.9rem; color: var(--subtle-text); }
.detail-content { margin-top: 20px; }
.detail-content h3 { font-size: 0.9rem; font-weight: 500; color: var(--primary-color); border-bottom: 1px solid var(--border-color); padding-bottom: 8px; margin-bottom: 10px; }
.detail-content p { line-height: 1.8; white-space: pre-wrap; /* 保留换行 */ margin-bottom: 25px; }
#detail-tags { text-align: center; margin-top: 20px; }

/* 其他 */
.empty-state { text-align: center; padding: 50px 20px; color: var(--primary-color); }
.empty-state p { font-size: 1.1rem; line-height: 1.5; }

.detail-actions {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: flex-end; /* 按钮靠右 */
    gap: 15px;
}

.action-btn {
    padding: 8px 18px;
    border-radius: 8px;
    border: 1px solid transparent;
    background: none;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.2s ease;
}

.action-btn.edit {
    background-color: var(--primary-hover);
    color: white;
}
.action-btn.edit:hover {
    background-color: #795548; /* A bit darker */
}

.action-btn.delete {
    color: var(--primary-color);
    border: 1px solid var(--border-color);
}
.action-btn.delete:hover {
    background-color: #fbe9e7; /* A very light red */
    color: #c62828;
}

/* ✨ 新增：搜索框样式 */
.search-container {
    margin-bottom: 25px;
}

#search-input {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background-color: var(--card-bg);
    font-size: 1rem;
    color: var(--text-color);
    outline: none;
    transition: border-color 0.3s, box-shadow 0.3s;
    -webkit-appearance: none; /* 移除iOS上的默认样式 */
}

#search-input:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(161, 136, 127, 0.2);
}

#search-input::placeholder {
    color: var(--subtle-text);
}

/* ✨ ✨ ✨ 新增：数据统计页面样式 ✨ ✨ ✨ */

.stats-container {
    max-width: 700px;
    margin: 0 auto;
}

/* 核心指标网格 */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    margin-bottom: 40px;
}

.stat-card {
    background-color: var(--card-bg);
    border-radius: 12px;
    padding: 25px 20px;
    text-align: center;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.04);
    border: 1px solid rgba(0,0,0,0.05);
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.stat-number {
    font-size: 2.2rem;
    font-weight: 500;
    color: var(--primary-hover);
}

.stat-label {
    font-size: 0.9rem;
    color: var(--text-color);
}

/* 通用模块容器 */
.stats-module-container {
    background-color: var(--card-bg);
    border-radius: 12px;
    padding: 20px 25px;
    margin-bottom: 25px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.04);
    border: 1px solid rgba(0,0,0,0.05);
}

.stats-module-container h3 {
    font-size: 1.1rem;
    font-weight: 500;
    margin-bottom: 20px;
    color: var(--text-color);
}

/* 图表占位符 */
.chart-placeholder {
    min-height: 150px;
    display: flex;
    justify-content: center;
    align-items: center;
    background-color: rgba(0,0,0,0.02);
    border-radius: 8px;
    border: 1px dashed var(--border-color);
    color: var(--subtle-text);
    font-size: 0.9rem;
}

/* ✨ ✨ ✨ 新增：个人中心页面样式 ✨ ✨ ✨ */
.profile-container {
    max-width: 700px;
    margin: 0 auto;
}

/* 个人信息卡片 */
.profile-card {
    background-color: var(--card-bg);
    border-radius: 12px;
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 30px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.04);
    border: 1px solid rgba(0,0,0,0.05);
}

.avatar {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    object-fit: cover;
}

.user-info {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.user-name {
    font-size: 1.2rem;
    font-weight: 500;
    color: var(--text-color);
}

.user-quote {
    font-size: 0.9rem;
    color: var(--subtle-text);
    font-style: italic;
    margin: 0;
}

/* 功能列表 */
.settings-list {
    background-color: var(--card-bg);
    border-radius: 12px;
    padding: 10px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.04);
    border: 1px solid rgba(0,0,0,0.05);
}

.setting-item {
    display: flex;
    align-items: center;
    padding: 15px;
    text-decoration: none;
    color: var(--text-color);
    border-radius: 8px;
    transition: background-color 0.2s;
}

.setting-item:hover {
    background-color: rgba(0,0,0,0.03);
}

.setting-item span {
    flex-grow: 1;
    margin-left: 15px;
}

.setting-icon {
    color: var(--subtle-text);
    font-size: 1.1rem;
    width: 20px;
    text-align: center;
}

/* 退出登录 */
.logout-section {
    margin-top: 30px;
}

.logout-btn {
    width: 100%;
    padding: 12px;
    font-size: 1rem;
    border: 1px solid #d3c0b8;
    background-color: transparent;
    color: #c86868;
    border-radius: 8px;
    cursor: pointer;
    transition: background-color 0.2s, color 0.2s;
}

.logout-btn:hover {
    background-color: #c86868;
    color: #fff;
    border-color: #c86868;
}

/* ✨ 新增：账户与安全表单的微调样式 */
.form-divider {
    border: none;
    border-top: 1px solid var(--border-color);
    margin: 20px 0;
}

.form-hint {
    font-size: 0.85rem;
    color: var(--subtle-text);
    margin-bottom: 15px;
    text-align: center;
}

/* ✨ 新增：语音输入功能样式 */
.textarea-container {
    position: relative;
}

.speech-btn {
    position: absolute;
    bottom: 10px;
    right: 10px;
    background: #f0f0f0;
    border: 1px solid #ccc;
    border-radius: 50%;
    width: 36px;
    height: 36px;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    color: #555;
    font-size: 1.2rem;
    transition: all 0.2s ease-in-out;
}

.speech-btn:hover {
    background: #e0e0e0;
    transform: scale(1.1);
}

/* 录音时的激活状态 */
.speech-btn.recording {
    background-color: #ff4d4d;
    color: white;
    border-color: #ff4d4d;
    animation: pulse 1.5s infinite;
}

/* 状态提示文字 */
.speech-status-indicator {
    position: absolute;
    top: -22px; /* 显示在 Label 旁边 */
    right: 0;
    font-size: 0.8rem;
    color: #ff4d4d;
}

/* 脉冲动画 */
@keyframes pulse {
    0% { box-shadow: 0 0 0 0 rgba(255, 77, 77, 0.7); }
    70% { box-shadow: 0 0 0 10px rgba(255, 77, 77, 0); }
    100% { box-shadow: 0 0 0 0 rgba(255, 77, 77, 0); }
}

@media (max-width: 550px) {
    .modal-card {
        padding: 25px 20px; /* 减小内边距 */
        width: 92%; /* 让宽度自适应 */
        max-height: 85vh; /* 限制最大高度，防止内容溢出 */
        overflow-y: auto; /* 内容过多时可以滚动 */
    }

    .modal-card h2 {
        font-size: 1.3rem; /* 减小标题字号 */
        margin-bottom: 20px;
    }

    .form-group textarea {
        min-height: 80px; /* 减小文本框最小高度 */
    }

    .seal-btn {
        padding: 12px;
        font-size: 1rem;
    }

    .detail-header {
        margin-bottom: 20px;
    }

    #detail-title {
        font-size: 1.3rem;
    }
}