/* ====== 成长星球 - 主样式表 ====== */
/* 温暖少女风：柔和紫色/蓝色渐变 + 橙色点缀 */

:root {
    --primary: #7c5cbf;
    --primary-light: #a78bda;
    --primary-dark: #5a3e96;
    --secondary: #4a90d9;
    --accent: #ff8c42;
    --accent-light: #ffb07a;
    --pink: #e91e8c;
    --pink-light: #f5a0c8;
    --bg: #f8f6ff;
    --bg-card: #ffffff;
    --text: #2d2640;
    --text-secondary: #7a7390;
    --text-light: #b0a8c4;
    --border: #e8e0f5;
    --shadow: 0 2px 12px rgba(124, 92, 191, 0.08);
    --shadow-md: 0 4px 20px rgba(124, 92, 191, 0.12);
    --radius: 12px;
    --radius-sm: 8px;
    --radius-lg: 16px;
    --gradient-main: linear-gradient(135deg, #7c5cbf 0%, #4a90d9 100%);
    --gradient-warm: linear-gradient(135deg, #ff8c42 0%, #e91e8c 100%);
    --gradient-soft: linear-gradient(135deg, #a78bda 0%, #7cc4f0 100%);
    --nav-height: 60px;
    --header-height: 52px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
    background: var(--bg);
    color: var(--text);
    font-size: 15px;
    line-height: 1.6;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
}

/* ====== 顶部导航 ====== */
.app-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--header-height);
    background: var(--gradient-main);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 16px;
    z-index: 100;
    box-shadow: 0 2px 8px rgba(124, 92, 191, 0.2);
}

.app-logo {
    color: white;
    font-size: 18px;
    font-weight: 700;
    letter-spacing: 0.5px;
}

.header-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(255,255,255,0.3);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 600;
}

.avatar-link {
    text-decoration: none;
}

/* ====== 主内容区 ====== */
.app-main {
    padding-top: var(--header-height);
    padding-bottom: calc(var(--nav-height) + 16px);
    min-height: 100vh;
}

/* ====== 底部导航 ====== */
.app-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: var(--nav-height);
    background: white;
    display: flex;
    align-items: center;
    justify-content: space-around;
    box-shadow: 0 -2px 12px rgba(0,0,0,0.06);
    z-index: 100;
    border-top: 1px solid var(--border);
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    color: var(--text-light);
    font-size: 10px;
    padding: 4px 0;
    flex: 1;
    transition: color 0.2s;
}

.nav-item i {
    font-size: 20px;
    margin-bottom: 2px;
}

.nav-item.active {
    color: var(--primary);
}

.nav-item.active i {
    transform: scale(1.1);
}

/* ====== 消息提示 ====== */
.flash-messages {
    position: fixed;
    top: calc(var(--header-height) + 8px);
    left: 16px;
    right: 16px;
    z-index: 200;
}

.flash-message {
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 14px;
    animation: slideDown 0.3s ease;
    box-shadow: var(--shadow-md);
}

.flash-success {
    background: #e8f5e9;
    color: #2e7d32;
    border: 1px solid #c8e6c9;
}

.flash-error {
    background: #fde8e8;
    color: #c62828;
    border: 1px solid #f5c6c6;
}

.flash-info {
    background: #e3f2fd;
    color: #1565c0;
    border: 1px solid #bbdefb;
}

.flash-close {
    background: none;
    border: none;
    font-size: 18px;
    cursor: pointer;
    opacity: 0.6;
    color: inherit;
}

@keyframes slideDown {
    from { transform: translateY(-10px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

/* ====== 页面容器 ====== */
.page-container {
    padding: 16px;
    max-width: 640px;
    margin: 0 auto;
}

/* ====== 页面头部 ====== */
.page-header {
    margin-bottom: 16px;
}

.page-header h2 {
    font-size: 22px;
    font-weight: 700;
    color: var(--text);
}

.page-desc {
    color: var(--text-secondary);
    font-size: 13px;
    margin-top: 4px;
}

/* ====== 页面导航条 ====== */
.page-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
    gap: 12px;
}

.page-nav h2 {
    font-size: 18px;
    font-weight: 700;
    flex: 1;
}

.back-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--bg-card);
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    color: var(--primary);
    box-shadow: var(--shadow);
    flex-shrink: 0;
}

/* ====== Tab 栏 ====== */
.tab-bar {
    display: flex;
    gap: 4px;
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 4px;
    margin-bottom: 16px;
    box-shadow: var(--shadow);
}

.tab-item {
    flex: 1;
    text-align: center;
    padding: 8px 4px;
    font-size: 13px;
    color: var(--text-secondary);
    text-decoration: none;
    border-radius: var(--radius-sm);
    transition: all 0.2s;
}

.tab-item.active {
    background: var(--gradient-main);
    color: white;
    font-weight: 600;
}

/* ====== 段落标题 ====== */
.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.section-header h3 {
    font-size: 16px;
    font-weight: 600;
}

.more-link {
    font-size: 13px;
    color: var(--primary);
    text-decoration: none;
}

/* ====== 统计卡片 ====== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
    margin-bottom: 16px;
}

.stat-card {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 12px 8px;
    text-align: center;
    box-shadow: var(--shadow);
}

.stat-icon {
    font-size: 20px;
    margin-bottom: 4px;
}

.stat-value {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 2px;
}

.stat-label {
    font-size: 11px;
    color: var(--text-secondary);
}

.stat-purple .stat-value { color: var(--primary); }
.stat-pink .stat-value { color: var(--pink); }
.stat-orange .stat-value { color: var(--accent); }
.stat-blue .stat-value { color: var(--secondary); }

/* ====== 卡片列表 ====== */
.card-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.card {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 14px;
    text-decoration: none;
    color: var(--text);
    box-shadow: var(--shadow);
    transition: transform 0.15s, box-shadow 0.15s;
}

.card:active {
    transform: scale(0.98);
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}

.card-title {
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 4px;
}

.card-desc {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.5;
}

.card-meta {
    font-size: 12px;
    color: var(--text-light);
    margin-top: 4px;
}

.card-date {
    font-size: 11px;
    color: var(--text-light);
}

.card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 8px;
}

.card-tags {
    font-size: 11px;
    color: var(--primary);
}

/* ====== 标签 ====== */
.card-tag {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 500;
}

.tag-purple { background: rgba(124,92,191,0.12); color: var(--primary); }
.tag-blue { background: rgba(74,144,217,0.12); color: var(--secondary); }
.tag-pink { background: rgba(233,30,140,0.12); color: var(--pink); }
.tag-orange { background: rgba(255,140,66,0.12); color: var(--accent); }
.tag-red { background: rgba(220,50,50,0.12); color: #dc3232; }
.tag-green { background: rgba(76,175,80,0.12); color: #4CAF50; }

.status-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 500;
}

.status-active { background: #e8f5e9; color: #2e7d32; }
.status-done { background: #e3f2fd; color: #1565c0; }
.status-pause { background: #fff3e0; color: #e65100; }

/* ====== 进度条 ====== */
.progress-bar {
    height: 6px;
    background: var(--border);
    border-radius: 3px;
    overflow: hidden;
    margin: 8px 0 4px;
}

.progress-fill {
    height: 100%;
    background: var(--gradient-main);
    border-radius: 3px;
    transition: width 0.3s;
}

.progress-text {
    font-size: 11px;
    color: var(--primary);
    font-weight: 600;
}

/* ====== 空状态 ====== */
.empty-state {
    text-align: center;
    padding: 40px 20px;
}

.empty-state.compact {
    padding: 20px;
}

.empty-icon {
    font-size: 48px;
    margin-bottom: 12px;
}

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

/* ====== 按钮 ====== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 20px;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.2s;
}

.btn-primary {
    background: var(--gradient-main);
    color: white;
}

.btn-primary:active {
    opacity: 0.85;
}

.btn-accent {
    background: var(--gradient-warm);
    color: white;
}

.btn-outline {
    background: transparent;
    border: 1.5px solid var(--primary);
    color: var(--primary);
}

.btn-danger {
    background: #fde8e8;
    color: #c62828;
    border: 1px solid #f5c6c6;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 13px;
}

.btn-xs {
    padding: 3px 8px;
    font-size: 11px;
}

.btn-lg {
    padding: 14px 24px;
    font-size: 16px;
}

.btn-block {
    width: 100%;
}

/* ====== 表单 ====== */
.form-page {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.form-group label {
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
}

.form-group input[type="text"],
.form-group input[type="password"],
.form-group input[type="number"],
.form-group input[type="date"],
.form-group input[type="email"],
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 10px 14px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 14px;
    background: var(--bg-card);
    color: var(--text);
    transition: border-color 0.2s;
    font-family: inherit;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(124,92,191,0.1);
}

.form-group textarea {
    resize: vertical;
    min-height: 80px;
}

.form-row {
    display: flex;
    gap: 12px;
}

.form-group.half {
    flex: 1;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: normal !important;
    cursor: pointer;
}

.checkbox-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--primary);
}

.file-input {
    padding: 8px !important;
}

/* ====== 登录页 ====== */
.login-page {
    min-height: 100vh;
    background: var(--gradient-main);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.login-container {
    width: 100%;
    max-width: 360px;
}

.login-logo {
    text-align: center;
    margin-bottom: 32px;
}

.login-planet {
    font-size: 56px;
    margin-bottom: 8px;
}

.login-logo h1 {
    color: white;
    font-size: 28px;
    font-weight: 700;
}

.login-subtitle {
    color: rgba(255,255,255,0.8);
    font-size: 14px;
    margin-top: 4px;
}

.login-form {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: 24px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.15);
}

.login-form .form-group {
    position: relative;
    margin-bottom: 14px;
    gap: 0;
}

.login-form .form-group i {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-light);
    z-index: 1;
}

.login-form input {
    width: 100%;
    padding: 12px 14px 12px 40px !important;
    border: 1.5px solid var(--border) !important;
    border-radius: var(--radius-sm) !important;
    font-size: 15px;
}

.login-form input:focus {
    border-color: var(--primary) !important;
    box-shadow: 0 0 0 3px rgba(124,92,191,0.1);
    outline: none;
}

.login-hint {
    text-align: center;
    color: rgba(255,255,255,0.7);
    font-size: 12px;
    margin-top: 16px;
}

.login-form .flash-messages {
    position: static;
    margin-bottom: 12px;
}

/* ====== 首页欢迎区 ====== */
.welcome-section {
    background: var(--gradient-soft);
    border-radius: var(--radius-lg);
    padding: 20px;
    margin-bottom: 16px;
    color: white;
}

.welcome-text h2 {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 4px;
}

.welcome-text p {
    font-size: 13px;
    opacity: 0.9;
}

/* ====== 快捷操作 ====== */
.quick-actions {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
    margin-bottom: 16px;
}

.action-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 14px 8px;
    background: var(--bg-card);
    border-radius: var(--radius);
    text-decoration: none;
    color: var(--text);
    font-size: 11px;
    box-shadow: var(--shadow);
    transition: transform 0.15s;
}

.action-btn:active {
    transform: scale(0.95);
}

.action-btn i {
    font-size: 22px;
}

.action-checkin i { color: #4CAF50; }
.action-create i { color: var(--pink); }
.action-gallery i { color: var(--accent); }
.action-capsule i { color: var(--secondary); }

/* ====== 时间线 ====== */
.timeline-compact,
.timeline-full {
    position: relative;
    padding-left: 28px;
}

.timeline-compact::before,
.timeline-full::before {
    content: '';
    position: absolute;
    left: 14px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: var(--border);
}

.timeline-item {
    position: relative;
    margin-bottom: 16px;
}

.timeline-dot {
    position: absolute;
    left: -28px;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    z-index: 1;
}

.timeline-content {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 12px;
    box-shadow: var(--shadow);
}

.timeline-date {
    font-size: 11px;
    color: var(--text-light);
    margin-bottom: 4px;
}

.timeline-title {
    font-size: 14px;
    font-weight: 600;
}

.timeline-desc {
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: 4px;
}

/* ====== 创作类型卡片 ====== */
.creative-types {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin-bottom: 16px;
}

.type-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 16px 8px;
    background: var(--bg-card);
    border-radius: var(--radius);
    text-decoration: none;
    color: var(--text);
    box-shadow: var(--shadow);
    transition: transform 0.15s;
}

.type-card:active {
    transform: scale(0.96);
}

.type-icon {
    font-size: 28px;
    margin-bottom: 6px;
}

.type-name {
    font-size: 13px;
    font-weight: 600;
}

.type-count {
    font-size: 11px;
    color: var(--text-light);
}

.type-poem { border-top: 3px solid var(--pink); }
.type-novel { border-top: 3px solid var(--primary); }
.type-diary { border-top: 3px solid var(--secondary); }
.type-friend { border-top: 3px solid #4CAF50; }
.type-band { border-top: 3px solid var(--accent); }
.type-timeline { border-top: 3px solid var(--secondary); }
.type-achievement { border-top: 3px solid var(--accent); }
.type-capsule { border-top: 3px solid var(--pink); }

/* ====== 筛选条 ====== */
.filter-bar {
    display: flex;
    gap: 6px;
    overflow-x: auto;
    padding-bottom: 8px;
    margin-bottom: 12px;
    -webkit-overflow-scrolling: touch;
}

.filter-tag {
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 12px;
    white-space: nowrap;
    background: var(--bg-card);
    color: var(--text-secondary);
    text-decoration: none;
    border: 1px solid var(--border);
    transition: all 0.2s;
}

.filter-tag.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

/* ====== 画稿画廊 ====== */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}

.gallery-item {
    text-decoration: none;
    color: var(--text);
    background: var(--bg-card);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: transform 0.15s;
}

.gallery-item:active {
    transform: scale(0.97);
}

.gallery-thumb {
    position: relative;
    aspect-ratio: 1;
    overflow: hidden;
    background: var(--bg);
}

.gallery-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.gallery-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--text-light);
}

.gallery-placeholder span {
    font-size: 36px;
}

.gallery-placeholder small {
    font-size: 11px;
    margin-top: 4px;
}

.fav-badge {
    position: absolute;
    top: 6px;
    right: 6px;
    font-size: 14px;
}

.gallery-info {
    padding: 8px 10px;
}

.gallery-title {
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.gallery-date {
    font-size: 11px;
    color: var(--text-light);
}

/* ====== 朋友 ====== */
.friend-avatars {
    display: flex;
    gap: 12px;
    overflow-x: auto;
    padding-bottom: 8px;
    margin-bottom: 16px;
}

.friend-avatar-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-decoration: none;
    color: var(--text);
    min-width: 56px;
}

.friend-avatar-circle {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--gradient-soft);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 4px;
}

.friend-avatar-item span {
    font-size: 11px;
    max-width: 56px;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.friend-card {
    display: flex !important;
    align-items: center;
    gap: 12px;
}

.friend-card-left {
    flex-shrink: 0;
}

.friend-card-right {
    flex: 1;
    min-width: 0;
}

.friend-avatar-lg {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--gradient-soft);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    font-weight: 600;
}

/* ====== 乐队 ====== */
.band-members {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 16px;
}

.band-member-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    background: var(--bg-card);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.member-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--gradient-warm);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    font-weight: 600;
    flex-shrink: 0;
}

.member-info {
    flex: 1;
    min-width: 0;
}

.member-name {
    font-size: 14px;
    font-weight: 600;
}

.member-role {
    font-size: 12px;
    color: var(--text-secondary);
}

/* ====== AI 工具 ====== */
.ai-tools-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}

.ai-tool-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 16px 10px;
    background: var(--bg-card);
    border-radius: var(--radius);
    text-decoration: none;
    color: var(--text);
    box-shadow: var(--shadow);
    text-align: center;
    transition: transform 0.15s;
}

.ai-tool-card:active {
    transform: scale(0.96);
}

.ai-tool-icon {
    font-size: 32px;
    margin-bottom: 8px;
}

.ai-tool-name {
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 4px;
}

.ai-tool-desc {
    font-size: 11px;
    color: var(--text-secondary);
    line-height: 1.4;
}

.guide-banner {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px;
    background: var(--bg-card);
    border-radius: var(--radius);
    text-decoration: none;
    color: var(--text);
    box-shadow: var(--shadow);
    margin-bottom: 16px;
    border-left: 4px solid var(--accent);
}

.guide-icon {
    font-size: 28px;
    flex-shrink: 0;
}

.guide-info {
    flex: 1;
}

.guide-title {
    font-size: 14px;
    font-weight: 600;
}

.guide-desc {
    font-size: 12px;
    color: var(--text-secondary);
}

.guide-banner .fa-chevron-right {
    color: var(--text-light);
}

/* ====== AI 对话 ====== */
.ai-chat-container {
    display: flex;
    flex-direction: column;
    height: calc(100vh - var(--header-height) - var(--nav-height) - 80px);
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding-bottom: 12px;
}

.chat-welcome {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-secondary);
}

.chat-welcome-icon {
    font-size: 48px;
    margin-bottom: 12px;
}

.chat-welcome h3 {
    color: var(--text);
    margin-bottom: 6px;
}

.chat-hint {
    font-size: 13px;
    margin-top: 12px;
    color: var(--text-light);
}

.chat-message {
    margin-bottom: 12px;
    display: flex;
}

.chat-message.user {
    justify-content: flex-end;
}

.chat-message.assistant {
    justify-content: flex-start;
}

.chat-bubble {
    max-width: 80%;
    padding: 10px 14px;
    border-radius: var(--radius);
    font-size: 14px;
    line-height: 1.5;
    word-break: break-word;
}

.chat-message.user .chat-bubble {
    background: var(--gradient-main);
    color: white;
    border-bottom-right-radius: 4px;
}

.chat-message.assistant .chat-bubble {
    background: var(--bg-card);
    color: var(--text);
    border-bottom-left-radius: 4px;
    box-shadow: var(--shadow);
}

.chat-input-area {
    padding-top: 12px;
    border-top: 1px solid var(--border);
}

.chat-input-area form {
    display: flex;
    gap: 8px;
}

#chatInput {
    flex: 1;
    padding: 10px 14px;
    border: 1.5px solid var(--border);
    border-radius: 24px;
    font-size: 14px;
    outline: none;
    background: var(--bg-card);
}

#chatInput:focus {
    border-color: var(--primary);
}

.chat-send-btn {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: var(--gradient-main);
    color: white;
    border: none;
    font-size: 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.chat-disclaimer {
    font-size: 11px;
    color: var(--text-light);
    text-align: center;
    margin-top: 8px;
}

/* ====== 豆包指南 ====== */
.guide-content {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.guide-section {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 16px;
    box-shadow: var(--shadow);
}

.guide-section h3 {
    font-size: 16px;
    margin-bottom: 10px;
    color: var(--primary);
}

.guide-section p {
    font-size: 14px;
    line-height: 1.7;
}

.guide-steps {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.guide-step {
    display: flex;
    gap: 12px;
    align-items: flex-start;
}

.step-num {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--gradient-main);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 600;
    flex-shrink: 0;
}

.step-content strong {
    display: block;
    margin-bottom: 2px;
}

.step-content p {
    font-size: 13px;
    color: var(--text-secondary);
}

.tips-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}

.tip-card {
    padding: 12px;
    background: var(--bg);
    border-radius: var(--radius-sm);
}

.tip-icon {
    font-size: 24px;
    margin-bottom: 6px;
}

.tip-title {
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 4px;
}

.tip-desc {
    font-size: 12px;
    color: var(--text-secondary);
    line-height: 1.5;
}

.guide-warnings {
    padding-left: 20px;
    font-size: 13px;
    line-height: 2;
    color: var(--text-secondary);
}

/* ====== 成就徽章 ====== */
.achievement-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}

.achievement-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 16px 10px;
    background: var(--bg-card);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    text-align: center;
}

.achievement-card.earned {
    border: 2px solid var(--accent);
    background: linear-gradient(135deg, #fff9f0, #ffffff);
}

.achievement-card.locked {
    opacity: 0.65;
}

.achievement-icon {
    font-size: 32px;
    margin-bottom: 6px;
}

.achievement-title {
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 4px;
}

.achievement-desc {
    font-size: 11px;
    color: var(--text-secondary);
    margin-bottom: 6px;
}

.achievement-date {
    font-size: 10px;
    color: var(--accent);
}

.achievement-row {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    padding-bottom: 8px;
    margin-bottom: 16px;
}

.achievement-badge {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 64px;
}

.achievement-badge.earned .badge-icon {
    font-size: 32px;
}

.badge-name {
    font-size: 10px;
    color: var(--text-secondary);
    margin-top: 2px;
}

/* ====== 时间胶囊 ====== */
.capsule-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.capsule-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    background: var(--bg-card);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    text-decoration: none;
    color: var(--text);
    transition: transform 0.15s;
}

.capsule-card:active {
    transform: scale(0.98);
}

.capsule-icon {
    font-size: 24px;
    flex-shrink: 0;
}

.capsule-info {
    flex: 1;
    min-width: 0;
}

.capsule-title {
    font-size: 14px;
    font-weight: 600;
}

.capsule-date {
    font-size: 12px;
    color: var(--text-secondary);
}

.capsule-create-hint {
    text-align: center;
    padding: 12px;
    background: var(--bg-card);
    border-radius: var(--radius);
    margin-bottom: 16px;
    color: var(--text-secondary);
    font-size: 14px;
    box-shadow: var(--shadow);
}

.capsule-status {
    text-align: center;
    font-size: 14px;
    font-weight: 600;
    padding: 8px;
    border-radius: var(--radius-sm);
    margin-bottom: 12px;
}

.capsule-status.opened {
    background: #e8f5e9;
    color: #2e7d32;
}

.capsule-status.locked {
    background: #fff3e0;
    color: #e65100;
}

.capsule-locked-content {
    text-align: center;
    padding: 32px 20px;
    color: var(--text-secondary);
}

.lock-icon {
    font-size: 48px;
    margin-bottom: 8px;
}

.capsule-open-date {
    font-size: 13px;
    margin-top: 4px;
    color: var(--text-light);
}

/* ====== 详情页 ====== */
.detail-card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: 18px;
    box-shadow: var(--shadow-md);
}

.detail-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
}

.detail-title {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 8px;
}

.detail-subtitle {
    font-size: 14px;
    color: var(--text-secondary);
    margin-top: -4px;
    margin-bottom: 8px;
}

.detail-meta {
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 6px;
}

.detail-meta i {
    margin-right: 6px;
    color: var(--primary);
}

.detail-meta-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 16px;
    margin-bottom: 10px;
}

.meta-item {
    font-size: 13px;
    color: var(--text-secondary);
}

.meta-item i {
    margin-right: 4px;
    color: var(--primary);
}

.detail-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 12px;
}

.tag-chip {
    display: inline-block;
    padding: 3px 10px;
    background: rgba(124,92,191,0.1);
    color: var(--primary);
    border-radius: 20px;
    font-size: 12px;
}

.detail-section {
    margin-top: 14px;
    padding-top: 14px;
    border-top: 1px solid var(--border);
}

.detail-section h4 {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--primary);
}

.detail-section p {
    font-size: 14px;
    line-height: 1.7;
    color: var(--text);
}

.detail-footer {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 16px;
    margin-top: 14px;
    padding-top: 10px;
    border-top: 1px solid var(--border);
}

.detail-time {
    font-size: 11px;
    color: var(--text-light);
}

.detail-image {
    text-align: center;
    margin-bottom: 12px;
}

.detail-image img {
    max-width: 100%;
    border-radius: var(--radius);
}

.fav-mark {
    text-align: center;
    font-size: 14px;
    margin-bottom: 8px;
}

/* ====== 创作详情内容 ====== */
.creative-content {
    font-size: 15px;
    line-height: 1.9;
    padding: 14px 0;
    color: var(--text);
    white-space: pre-wrap;
}

/* ====== 朋友详情 ====== */
.friend-detail-card {
    text-align: center;
}

.friend-detail-avatar {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: var(--gradient-soft);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    font-weight: 600;
    margin: 0 auto 10px;
}

.capsule-detail-card {
    text-align: center;
}

.capsule-detail-icon {
    font-size: 48px;
    margin-bottom: 8px;
}

/* ====== 成绩表 ====== */
.grade-table-wrapper {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.grade-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
    background: var(--bg-card);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
}

.grade-table th {
    background: var(--gradient-main);
    color: white;
    padding: 10px 8px;
    text-align: left;
    font-weight: 500;
    font-size: 12px;
}

.grade-table td {
    padding: 10px 8px;
    border-bottom: 1px solid var(--border);
}

.grade-table tr:last-child td {
    border-bottom: none;
}

.grade-excellent { color: #2e7d32; font-weight: 600; }
.grade-good { color: #1565c0; font-weight: 600; }
.grade-normal { color: var(--text); }

.grade-mini-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.grade-mini-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 12px;
    background: var(--bg-card);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow);
}

.grade-subject {
    font-weight: 600;
    min-width: 40px;
}

.grade-score {
    font-weight: 600;
}

.grade-exam {
    font-size: 12px;
    color: var(--text-secondary);
    margin-left: auto;
}

/* ====== 打卡 ====== */
.checkin-card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: 20px;
    box-shadow: var(--shadow-md);
    text-align: center;
}

.checkin-date {
    font-size: 18px;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 12px;
}

.mood-selector {
    margin-bottom: 14px;
}

.mood-selector label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 8px;
}

.mood-options {
    display: flex;
    justify-content: center;
    gap: 12px;
}

.mood-item {
    cursor: pointer;
}

.mood-item input {
    display: none;
}

.mood-item span {
    display: inline-block;
    font-size: 28px;
    padding: 6px;
    border-radius: var(--radius-sm);
    border: 2px solid transparent;
    transition: all 0.2s;
}

.mood-item input:checked + span {
    border-color: var(--primary);
    background: rgba(124,92,191,0.08);
    transform: scale(1.15);
}

.checkin-today {
    text-align: center;
    margin-top: 1rem;
}

.checkin-badge {
    display: inline-block;
    padding: 8px 16px;
    background: #e8f5e9;
    color: #2e7d32;
    border-radius: 20px;
    font-weight: 600;
}

.checkin-history {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.checkin-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    background: var(--bg-card);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow);
}

.checkin-mood {
    font-size: 22px;
}

.checkin-info {
    display: flex;
    flex-direction: column;
}

.checkin-date-text {
    font-size: 13px;
    font-weight: 600;
}

.checkin-note {
    font-size: 12px;
    color: var(--text-secondary);
}

/* ====== 个人中心 ====== */
.profile-header-section {
    text-align: center;
    padding: 20px;
    background: var(--gradient-soft);
    border-radius: var(--radius-lg);
    margin-bottom: 16px;
    color: white;
}

.profile-avatar-lg {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: rgba(255,255,255,0.3);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    font-weight: 700;
    margin: 0 auto 10px;
}

.profile-name {
    font-size: 20px;
    font-weight: 700;
}

.profile-grade {
    font-size: 13px;
    opacity: 0.85;
}

.profile-motto {
    font-size: 13px;
    opacity: 0.8;
    margin-top: 4px;
    font-style: italic;
}

/* ====== 菜单列表 ====== */
.menu-list {
    background: var(--bg-card);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
}

.menu-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    text-decoration: none;
    color: var(--text);
    border-bottom: 1px solid var(--border);
    transition: background 0.15s;
}

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

.menu-item:active {
    background: var(--bg);
}

.menu-icon {
    font-size: 20px;
}

.menu-text {
    flex: 1;
    font-size: 14px;
}

.menu-arrow {
    color: var(--text-light);
    font-size: 12px;
}

/* ====== 危险区域 ====== */
.danger-zone {
    text-align: center;
    margin-top: 24px;
    padding-top: 16px;
}

/* ====== 周几网格 ====== */
.weekday-grid {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.weekday-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.weekday-item {
    display: flex;
    gap: 10px;
    padding: 8px 12px;
    background: var(--bg);
    border-radius: var(--radius-sm);
}

.day-label {
    font-weight: 600;
    color: var(--primary);
    min-width: 32px;
}

/* ====== 进度区域 ====== */
.progress-section {
    margin-top: 12px;
}

.progress-section span {
    font-size: 13px;
    color: var(--text-secondary);
}

/* ====== 响应式 ====== */
@media (min-width: 768px) {
    .page-container {
        padding: 24px;
    }

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

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

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

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

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

.card, .stat-card, .type-card, .action-btn, .ai-tool-card, .achievement-card {
    animation: fadeIn 0.3s ease;
}
/* ====== 增强欢迎区 ====== */
.welcome-section {
    position: relative;
    overflow: hidden;
}

.welcome-section::after {
    content: '🌟✨⭐';
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 28px;
    opacity: 0.3;
    letter-spacing: 4px;
}

/* ====== 首页padding修正 ====== */
.home-page {
    padding: 16px;
    max-width: 640px;
    margin: 0 auto;
}

.home-page .welcome-section {
    margin-bottom: 16px;
}

/* ====== 按钮增强 ====== */
.btn-lg {
    padding: 14px 20px;
    font-size: 16px;
    font-weight: 600;
}

.btn-accent {
    background: var(--gradient-warm);
    color: white;
}

/* ====== 菜单图标彩色 ====== */
.menu-item:hover {
    background: var(--bg);
}

/* ====== 页面淡入 ====== */
.page-container {
    animation: fadeIn 0.25s ease;
}

/* ====== 空状态增强 ====== */
.empty-state {
    text-align: center;
    padding: 40px 20px;
}

.empty-icon {
    font-size: 48px;
    margin-bottom: 12px;
}

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

/* ====== 进度条增强 ====== */
.progress-bar {
    height: 8px;
    background: var(--border);
    border-radius: 4px;
    overflow: hidden;
    margin: 6px 0;
}

.progress-fill {
    height: 100%;
    background: var(--gradient-main);
    border-radius: 4px;
    transition: width 0.3s ease;
}

.progress-text {
    font-size: 12px;
    color: var(--primary);
    font-weight: 600;
}

/* ====== 表单增强 ====== */
select {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 14px;
    background: var(--bg);
    color: var(--text);
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%237a7390' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 32px;
}

select:focus {
    border-color: var(--primary);
    outline: none;
    box-shadow: 0 0 0 3px rgba(124, 92, 191, 0.1);
}

/* ====== 卡片悬浮效果 ====== */
.card:hover {
    box-shadow: var(--shadow-md);
}

/* ====== 胶囊表单美化 ====== */
.capsule-create-hint i {
    color: var(--accent);
    margin-right: 4px;
}