/* 情绪身心觉察 - 治愈系样式 */

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

:root {
    --primary-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --glass-bg: rgba(255, 255, 255, 0.15);
    --glass-border: rgba(255, 255, 255, 0.25);
    --text-primary: #2d3748;
    --text-secondary: #718096;
    --success: #48bb78;
    --warning: #ed8936;
    --error: #f56565;
    --shadow-soft: 0 8px 32px rgba(31, 38, 135, 0.15);
    --shadow-medium: 0 12px 40px rgba(31, 38, 135, 0.2);
    --cubic-gentle: cubic-bezier(0.34, 1.56, 0.64, 1);
    --border-radius-xl: 24px;
    --border-radius-lg: 16px;
    --border-radius-md: 12px;
}

/* 深色模式 */
@media (prefers-color-scheme: dark) {
    :root {
        --text-primary: #e2e8f0;
        --text-secondary: #a0aec0;
        --glass-bg: rgba(30, 30, 50, 0.4);
        --glass-border: rgba(255, 255, 255, 0.1);
    }
    body {
        background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
    }
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    min-height: 100vh;
    background: linear-gradient(135deg, #e0c3fc 0%, #8ec5fc 50%, #e0c3fc 100%);
    background-attachment: fixed;
    color: var(--text-primary);
    overflow-x: hidden;
    transition: background 0.5s ease;
}

/* 背景装饰 */
.bg-decoration {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}

.floating-shape {
    position: absolute;
    border-radius: 50%;
    opacity: 0.3;
    animation: float 20s infinite ease-in-out;
}

.shape-1 {
    width: 300px;
    height: 300px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    top: -100px;
    left: -100px;
    animation-delay: 0s;
}

.shape-2 {
    width: 200px;
    height: 200px;
    background: linear-gradient(135deg, #f093fb, #f5576c);
    top: 50%;
    right: -50px;
    animation-delay: -7s;
}

.shape-3 {
    width: 250px;
    height: 250px;
    background: linear-gradient(135deg, #4facfe, #00f2fe);
    bottom: -80px;
    left: 30%;
    animation-delay: -14s;
}

@keyframes float {
    0%, 100% { transform: translate(0, 0) rotate(0deg); }
    25% { transform: translate(30px, -30px) rotate(5deg); }
    50% { transform: translate(-20px, 20px) rotate(-3deg); }
    75% { transform: translate(20px, 30px) rotate(3deg); }
}

/* 主容器 */
.app-container {
    position: relative;
    z-index: 1;
    min-height: 100vh;
}

.main-content {
    max-width: 900px;
    margin: 0 auto;
    padding: 20px;
}

/* 头部 */
.app-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 0;
    margin-bottom: 30px;
}

.app-title {
    font-size: 1.8rem;
    font-weight: 300;
    background: linear-gradient(135deg, #667eea, #764ba2);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.user-actions, .user-info {
    display: flex;
    gap: 15px;
    align-items: center;
}

.user-name {
    font-weight: 500;
}

.btn-text {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 0.95rem;
    cursor: pointer;
    padding: 8px 12px;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.btn-text:hover {
    color: var(--text-primary);
    background: var(--glass-bg);
}

/* 步骤容器 */
.steps-container {
    position: relative;
    min-height: 500px;
}

.step-section {
    display: none;
    animation: fadeInUp 0.6s var(--cubic-gentle);
}

.step-section.active {
    display: block;
}

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

.step-header {
    text-align: center;
    margin-bottom: 40px;
}

.step-number {
    display: inline-block;
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 10px;
    letter-spacing: 2px;
}

.step-header h2 {
    font-size: 1.8rem;
    font-weight: 500;
    margin-bottom: 10px;
}

.step-desc {
    color: var(--text-secondary);
    font-size: 1rem;
}

.btn-back {
    position: absolute;
    left: 0;
    top: 0;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    color: var(--text-primary);
    padding: 10px 18px;
    border-radius: var(--border-radius-md);
    cursor: pointer;
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
}

.btn-back:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: translateX(-3px);
}

/* 身体状态网格 */
.body-status-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 15px;
    margin-bottom: 40px;
}

.body-status-item {
    background: var(--glass-bg);
    border: 2px solid var(--glass-border);
    border-radius: var(--border-radius-lg);
    padding: 20px 15px;
    text-align: center;
    cursor: pointer;
    backdrop-filter: blur(10px);
    transition: all 0.3s var(--cubic-gentle);
}

.body-status-item:hover {
    transform: translateY(-3px);
    border-color: rgba(102, 126, 234, 0.4);
}

.body-status-item.selected {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.3), rgba(118, 75, 162, 0.3));
    border-color: #667eea;
    transform: scale(1.02);
}

.body-status-icon {
    font-size: 2rem;
    margin-bottom: 8px;
}

.body-status-name {
    font-size: 0.95rem;
}

/* 情绪卡 */
.emotion-main-card {
    position: relative;
    background: var(--glass-bg);
    border: 2px solid var(--glass-border);
    border-radius: var(--border-radius-xl);
    padding: 50px 30px;
    text-align: center;
    margin-bottom: 30px;
    backdrop-filter: blur(20px);
    overflow: hidden;
    transition: all 0.5s ease;
}

.breath-circle {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 200px;
    height: 200px;
    transform: translate(-50%, -50%);
    border-radius: 50%;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.2), rgba(118, 75, 162, 0.2));
    animation: breathe 10s infinite ease-in-out;
}

@keyframes breathe {
    0%, 100% { transform: translate(-50%, -50%) scale(1); opacity: 0.5; }
    50% { transform: translate(-50%, -50%) scale(1.3); opacity: 0.8; }
}

.card-content {
    position: relative;
    z-index: 1;
}

.card-emoji {
    font-size: 4rem;
    margin-bottom: 15px;
    animation: gentleBounce 2s infinite ease-in-out;
}

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

.card-name {
    font-size: 2rem;
    font-weight: 500;
    margin-bottom: 5px;
}

.card-en {
    font-size: 1rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 3px;
}

/* 情绪详情 */
.emotion-details {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: var(--border-radius-lg);
    padding: 25px;
    margin-bottom: 30px;
    backdrop-filter: blur(15px);
}

.detail-section {
    margin-bottom: 20px;
}

.detail-section:last-child {
    margin-bottom: 0;
}

.detail-section h4 {
    font-size: 1rem;
    margin-bottom: 8px;
    color: var(--text-primary);
}

.detail-section p {
    color: var(--text-secondary);
    line-height: 1.7;
}

/* 备选情绪卡 */
.emotion-backups {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin-bottom: 30px;
    flex-wrap: wrap;
}

.backup-card {
    background: var(--glass-bg);
    border: 2px solid var(--glass-border);
    border-radius: var(--border-radius-lg);
    padding: 25px 20px;
    text-align: center;
    cursor: pointer;
    backdrop-filter: blur(10px);
    transition: all 0.3s var(--cubic-gentle);
    min-width: 140px;
}

.backup-card:hover {
    transform: translateY(-5px) scale(1.02);
    border-color: rgba(102, 126, 234, 0.5);
}

.backup-emoji {
    font-size: 2.5rem;
    margin-bottom: 10px;
}

.backup-name {
    font-size: 1rem;
}

/* 应对卡 */
.cope-card {
    background: var(--glass-bg);
    border: 2px solid var(--glass-border);
    border-radius: var(--border-radius-xl);
    padding: 30px;
    margin-bottom: 30px;
    backdrop-filter: blur(15px);
}

.cope-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 15px;
}

.cope-difficulty, .cope-duration {
    font-size: 0.85rem;
    color: var(--text-secondary);
    background: rgba(255, 255, 255, 0.2);
    padding: 5px 12px;
    border-radius: 20px;
}

.cope-name {
    font-size: 1.5rem;
    margin-bottom: 15px;
}

.cope-method, .cope-examples {
    color: var(--text-secondary);
    line-height: 1.8;
    margin-bottom: 15px;
}

.swap-btn {
    width: 100%;
    text-align: center;
    padding: 12px;
}

/* 心得输入 */
.notes-section {
    margin-bottom: 30px;
}

.notes-section label {
    display: block;
    margin-bottom: 10px;
    color: var(--text-secondary);
}

.notes-section textarea {
    width: 100%;
    min-height: 120px;
    background: var(--glass-bg);
    border: 2px solid var(--glass-border);
    border-radius: var(--border-radius-lg);
    padding: 15px;
    color: var(--text-primary);
    font-size: 1rem;
    line-height: 1.6;
    resize: vertical;
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
}

.notes-section textarea:focus {
    outline: none;
    border-color: #667eea;
}

/* 按钮 */
.step-footer {
    text-align: center;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    color: white;
    padding: 14px 32px;
    font-size: 1.05rem;
    border-radius: var(--border-radius-lg);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    transition: all 0.3s var(--cubic-gentle);
    box-shadow: var(--shadow-soft);
}

.btn-primary:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: var(--shadow-medium);
}

.btn-primary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-primary.large {
    padding: 18px 45px;
    font-size: 1.15rem;
}

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

/* 弹窗 */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    backdrop-filter: blur(5px);
}

.modal {
    background: var(--glass-bg);
    border: 2px solid var(--glass-border);
    border-radius: var(--border-radius-xl);
    padding: 35px;
    width: 90%;
    max-width: 450px;
    backdrop-filter: blur(20px);
    animation: modalIn 0.4s var(--cubic-gentle);
    position: relative;
}

.modal.large-modal {
    max-width: 600px;
    max-height: 80vh;
    overflow-y: auto;
}

@keyframes modalIn {
    from {
        opacity: 0;
        transform: scale(0.9) translateY(20px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.modal-close {
    position: absolute;
    top: 15px;
    right: 20px;
    background: none;
    border: none;
    font-size: 1.8rem;
    color: var(--text-secondary);
    cursor: pointer;
    line-height: 1;
    transition: all 0.3s ease;
}

.modal-close:hover {
    color: var(--text-primary);
}

.modal-title {
    text-align: center;
    margin-bottom: 25px;
    font-size: 1.5rem;
}

.modal-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 25px;
}

.tab-btn {
    flex: 1;
    background: transparent;
    border: none;
    padding: 12px;
    font-size: 1rem;
    color: var(--text-secondary);
    cursor: pointer;
    border-radius: var(--border-radius-md);
    transition: all 0.3s ease;
}

.tab-btn.active {
    background: rgba(102, 126, 234, 0.2);
    color: var(--text-primary);
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

.tab-content input {
    width: 100%;
    background: var(--glass-bg);
    border: 2px solid var(--glass-border);
    border-radius: var(--border-radius-md);
    padding: 14px 16px;
    margin-bottom: 15px;
    color: var(--text-primary);
    font-size: 1rem;
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
}

.tab-content input:focus {
    outline: none;
    border-color: #667eea;
}

.tab-content .btn-primary {
    width: 100%;
    justify-content: center;
}

/* 记录列表 */
.records-list {
    max-height: 500px;
    overflow-y: auto;
}

.record-item {
    background: rgba(255, 255, 255, 0.1);
    border-radius: var(--border-radius-lg);
    padding: 20px;
    margin-bottom: 15px;
}

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

.record-emoji {
    font-size: 1.5rem;
}

.record-emotion {
    flex: 1;
    margin-left: 15px;
}

.record-time {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.record-notes {
    color: var(--text-secondary);
    line-height: 1.6;
}

/* 成功弹窗 */
.success-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(224, 195, 252, 0.95), rgba(142, 197, 252, 0.95));
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2000;
}

.success-modal {
    text-align: center;
    animation: successIn 0.6s var(--cubic-gentle);
}

@keyframes successIn {
    from {
        opacity: 0;
        transform: scale(0.8);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.success-icon {
    font-size: 5rem;
    margin-bottom: 20px;
    animation: gentleBounce 2s infinite ease-in-out;
}

.success-modal h3 {
    font-size: 1.8rem;
    margin-bottom: 15px;
}

.success-modal p {
    color: var(--text-secondary);
    margin-bottom: 10px;
    font-size: 1.05rem;
}

.falling-petals {
    position: relative;
    height: 80px;
    margin: 20px 0;
}

.falling-petals span {
    position: absolute;
    font-size: 1.5rem;
    animation: fall 4s infinite ease-in-out;
}

.falling-petals span:nth-child(1) { left: 10%; animation-delay: 0s; }
.falling-petals span:nth-child(2) { left: 30%; animation-delay: -0.8s; }
.falling-petals span:nth-child(3) { left: 50%; animation-delay: -1.6s; }
.falling-petals span:nth-child(4) { left: 70%; animation-delay: -2.4s; }
.falling-petals span:nth-child(5) { left: 90%; animation-delay: -3.2s; }

@keyframes fall {
    0% {
        transform: translateY(-30px) rotate(0deg);
        opacity: 0;
    }
    10% {
        opacity: 1;
    }
    90% {
        opacity: 1;
    }
    100% {
        transform: translateY(80px) rotate(360deg);
        opacity: 0;
    }
}

/* Toast */
.toast {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    padding: 15px 25px;
    border-radius: var(--border-radius-lg);
    backdrop-filter: blur(10px);
    z-index: 3000;
    animation: toastIn 0.3s ease;
}

@keyframes toastIn {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

/* 工具类 */
.hidden {
    display: none !important;
}

/* 响应式 */
@media (max-width: 768px) {
    .main-content {
        padding: 15px;
    }
    
    .app-title {
        font-size: 1.4rem;
    }
    
    .step-header h2 {
        font-size: 1.5rem;
    }
    
    .body-status-grid {
        grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
        gap: 12px;
    }
    
    .emotion-backups {
        flex-direction: column;
    }
    
    .backup-card {
        width: 100%;
    }
    
    .btn-back {
        position: relative;
        margin-bottom: 20px;
        left: auto;
        top: auto;
    }
}
