/* 明浩心理 - 公共样式 */

/* CSS变量定义 */
:root {
    --primary: #10B981;
    --primary-dark: #059669;
    --primary-light: #D1FAE5;
    --secondary: #8B5CF6;
    --secondary-light: #EDE9FE;
    --accent: #F59E0B;
    --accent-light: #FEF3C7;
    --danger: #EF4444;
    --text-primary: #1F2937;
    --text-secondary: #6B7280;
    --text-light: #9CA3AF;
    --bg-primary: #FFFFFF;
    --bg-secondary: #F9FAFB;
    --bg-tertiary: #F3F4F6;
    --border: #E5E7EB;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --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);
    --radius-sm: 8px;
    --radius: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    --header-height: 60px;
    --nav-height: 70px;
}

/* 重置样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
    background-color: var(--bg-secondary);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    padding-top: var(--header-height);
    padding-bottom: var(--nav-height);
}

/* 顶部导航 */
.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--header-height);
    background: var(--bg-primary);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 16px;
    z-index: 1000;
    box-shadow: var(--shadow-sm);
}

.logo {
    font-size: 20px;
    font-weight: 700;
    color: var(--primary-dark);
    display: flex;
    align-items: center;
    gap: 8px;
}

.logo::before {
    content: '🌿';
    font-size: 24px;
}

.user-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--primary-light);
    border: none;
    color: var(--primary-dark);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.user-btn:hover {
    background: var(--primary);
    color: white;
    transform: scale(1.05);
}

/* 底部导航 */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: var(--nav-height);
    background: var(--bg-primary);
    display: flex;
    justify-content: space-around;
    align-items: center;
    z-index: 1000;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.05);
    padding-bottom: env(safe-area-inset-bottom);
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 8px 16px;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 12px;
    transition: all 0.3s ease;
    border-radius: var(--radius);
}

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

.nav-item svg {
    width: 24px;
    height: 24px;
}

/* 主内容区 */
.main-content {
    padding: 16px;
    max-width: 480px;
    margin: 0 auto;
}

/* 卡片样式 */
.card {
    background: var(--bg-primary);
    border-radius: var(--radius-lg);
    padding: 20px;
    margin-bottom: 16px;
    box-shadow: var(--shadow);
}

.card-gradient-green {
    background: linear-gradient(135deg, #10B981 0%, #059669 100%);
    color: white;
}

.card-gradient-purple {
    background: linear-gradient(135deg, #8B5CF6 0%, #7C3AED 100%);
    color: white;
}

/* 按钮样式 */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    border-radius: var(--radius-xl);
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    border: none;
    outline: none;
}

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

.btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

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

.btn-secondary:hover {
    background: var(--border);
}

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

.btn-outline:hover {
    background: var(--primary);
    color: white;
}

.btn-block {
    width: 100%;
}

.btn-sm {
    padding: 8px 16px;
    font-size: 13px;
}

/* 模态框 */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: flex-end;
    justify-content: center;
    z-index: 2000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

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

.modal-overlay.active .modal-content {
    transform: translateY(0);
}

.modal-content {
    background: var(--bg-primary);
    width: 100%;
    max-width: 480px;
    max-height: 90vh;
    border-radius: var(--radius-xl) var(--radius-xl) 0 0;
    padding: 24px;
    transform: translateY(100%);
    transition: transform 0.3s ease;
    overflow-y: auto;
}

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

.modal-title {
    font-size: 18px;
    font-weight: 700;
}

.modal-close {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: none;
    background: var(--bg-tertiary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    color: var(--text-secondary);
}

/* 表单样式 */
.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.form-input {
    width: 100%;
    padding: 14px 16px;
    border: 2px solid var(--border);
    border-radius: var(--radius);
    font-size: 15px;
    transition: all 0.3s ease;
    background: var(--bg-primary);
}

.form-input:focus {
    outline: none;
    border-color: var(--primary);
}

.form-input::placeholder {
    color: var(--text-light);
}

/* 滑动条 */
.slider-container {
    margin: 20px 0;
}

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

.slider-label {
    font-size: 15px;
    font-weight: 600;
}

.slider-value {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 16px;
    font-weight: 700;
    color: var(--primary);
}

.emoji-display {
    font-size: 32px;
}

.slider {
    width: 100%;
    height: 8px;
    border-radius: 4px;
    background: var(--bg-tertiary);
    -webkit-appearance: none;
    appearance: none;
    outline: none;
}

.slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--primary);
    cursor: pointer;
    box-shadow: var(--shadow);
    transition: transform 0.2s ease;
}

.slider::-webkit-slider-thumb:hover {
    transform: scale(1.2);
}

.slider::-moz-range-thumb {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--primary);
    cursor: pointer;
    border: none;
    box-shadow: var(--shadow);
}

.slider-labels {
    display: flex;
    justify-content: space-between;
    margin-top: 8px;
    font-size: 12px;
    color: var(--text-light);
}

/* 文本域 */
.textarea {
    width: 100%;
    min-height: 120px;
    padding: 14px 16px;
    border: 2px solid var(--border);
    border-radius: var(--radius);
    font-size: 15px;
    resize: vertical;
    transition: all 0.3s ease;
    font-family: inherit;
}

.textarea:focus {
    outline: none;
    border-color: var(--primary);
}

.textarea::placeholder {
    color: var(--text-light);
}

.char-count {
    text-align: right;
    font-size: 12px;
    color: var(--text-light);
    margin-top: 4px;
}

/* 日记记录项 */
.diary-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 16px;
    background: var(--bg-primary);
    border-radius: var(--radius);
    margin-bottom: 12px;
    box-shadow: var(--shadow-sm);
}

.diary-emoji {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--primary-light);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    flex-shrink: 0;
}

.diary-content {
    flex: 1;
    min-width: 0;
}

.diary-score {
    font-size: 15px;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 4px;
}

.diary-text {
    font-size: 14px;
    color: var(--text-primary);
    margin-bottom: 4px;
    word-break: break-word;
}

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

/* 音频播放器 */
.audio-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px;
    background: var(--bg-primary);
    border-radius: var(--radius);
    margin-bottom: 12px;
    box-shadow: var(--shadow-sm);
}

.audio-icon {
    width: 56px;
    height: 56px;
    border-radius: var(--radius);
    background: var(--primary-light);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.audio-icon:hover {
    background: var(--primary);
}

.audio-icon:hover svg {
    fill: white;
}

.audio-icon svg {
    width: 24px;
    height: 24px;
    fill: var(--primary);
    transition: all 0.3s ease;
}

.audio-icon.playing {
    background: var(--primary);
}

.audio-icon.playing svg {
    fill: white;
}

.audio-info {
    flex: 1;
}

.audio-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.audio-meta {
    display: flex;
    gap: 12px;
    font-size: 12px;
    color: var(--text-secondary);
}

.audio-tag {
    padding: 2px 8px;
    background: var(--bg-tertiary);
    border-radius: 4px;
}

/* 呼吸动画 */
.breathing-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 32px 20px;
}

.breathing-circle {
    width: 180px;
    height: 180px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-light) 0%, var(--primary) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    transition: transform 0.1s linear;
}

.breathing-circle::before {
    content: '';
    position: absolute;
    width: 220px;
    height: 220px;
    border-radius: 50%;
    border: 2px solid var(--primary-light);
    opacity: 0.5;
    transition: transform 0.1s linear;
}

.breathing-text {
    font-size: 24px;
    font-weight: 700;
    color: var(--primary-dark);
}

.breathing-title {
    font-size: 18px;
    font-weight: 700;
    margin-top: 24px;
    margin-bottom: 8px;
}

.breathing-desc {
    font-size: 14px;
    color: var(--text-secondary);
    text-align: center;
}

/* 双列卡片 */
.card-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 16px;
}

.card-small {
    background: var(--bg-primary);
    border-radius: var(--radius);
    padding: 16px;
    box-shadow: var(--shadow-sm);
    cursor: pointer;
    transition: all 0.3s ease;
}

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

.card-small-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
}

.card-small-icon {
    width: 32px;
    height: 32px;
    border-radius: var(--radius-sm);
    background: var(--primary-light);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
}

.card-small-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
}

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

.card-small-value {
    font-size: 24px;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 4px;
}

/* 入口卡片 */
.entry-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px;
    background: var(--accent-light);
    border-radius: var(--radius);
    cursor: pointer;
    transition: all 0.3s ease;
    margin-bottom: 16px;
}

.entry-card:hover {
    transform: translateX(4px);
}

.entry-card-content h3 {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 4px;
}

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

.entry-card-arrow {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: white;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--accent);
    font-size: 20px;
}

/* 引导区域 */
.guide-section {
    background: var(--secondary-light);
    border-radius: var(--radius-lg);
    padding: 24px;
    text-align: center;
}

.guide-section h3 {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.guide-section p {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 16px;
}

/* 用户面板 */
.user-panel {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 20px;
    background: var(--bg-primary);
    border-radius: var(--radius);
    margin-bottom: 16px;
}

.user-avatar {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: var(--primary-light);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    flex-shrink: 0;
}

.user-info {
    flex: 1;
}

.user-name {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 4px;
}

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

/* 空状态 */
.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-light);
}

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

.empty-state-text {
    font-size: 14px;
}

/* Toast提示 */
.toast {
    position: fixed;
    top: 80px;
    left: 50%;
    transform: translateX(-50%) translateY(-20px);
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 12px 24px;
    border-radius: var(--radius-xl);
    font-size: 14px;
    z-index: 3000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.toast.show {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}

/* 响应式 */
@media (max-width: 360px) {
    .card-grid {
        grid-template-columns: 1fr;
    }
    
    .main-content {
        padding: 12px;
    }
}

/* 动画 */
@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.7;
    }
}

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

.fade-in {
    animation: fadeIn 0.3s ease;
}
