/* 基础重置和变量定义 */
:root {
    /* 温暖大地色系 */
    --cream-white: #faf8f5;
    --warm-beige: #f5f1eb;
    --terracotta: #d4a574;
    --sage-green: #a8b5a0;
    --dusty-pink: #e8c4b8;
    --warm-gold: #f4d03f;
    --soft-brown: #8b7355;
    --warm-gray: #b8a99a;
    
    /* 阴影和效果 */
    --soft-shadow: 0 8px 32px rgba(139, 115, 85, 0.15);
    --gentle-shadow: 0 4px 16px rgba(139, 115, 85, 0.1);
    --inner-glow: 0 0 20px rgba(244, 208, 63, 0.3);
    
    /* 字体 */
    --font-family: 'Noto Sans SC', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    
    /* 动画时间 */
    --breathing-duration: 8s;
    --transition-smooth: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
    font-family: var(--font-family);
    background: var(--cream-white);
    color: var(--soft-brown);
    line-height: 1.6;
    overflow-x: hidden;
    min-height: 100vh;
    position: relative;
}

/* 背景纹理 */
.background-texture {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        radial-gradient(circle at 20% 80%, rgba(212, 165, 116, 0.05) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(168, 181, 160, 0.05) 0%, transparent 50%),
        radial-gradient(circle at 40% 40%, rgba(232, 196, 184, 0.03) 0%, transparent 50%);
    background-size: 400px 400px, 300px 300px, 500px 500px;
    animation: textureFloat 20s ease-in-out infinite;
    z-index: -1;
}

@keyframes textureFloat {
    0%, 100% { transform: translate(0, 0) rotate(0deg); }
    33% { transform: translate(10px, -10px) rotate(1deg); }
    66% { transform: translate(-5px, 5px) rotate(-1deg); }
}

/* 主容器 */
.container {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    position: relative;
}

/* 列表按钮 */
.list-btn {
    position: fixed;
    top: 2rem;
    left: 2rem;
    width: 48px;
    height: 48px;
    border: none;
    border-radius: 50%;
    background: var(--warm-beige);
    color: var(--soft-brown);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--gentle-shadow);
    transition: var(--transition-smooth);
    z-index: 1000;
}

.list-btn svg {
    display: block;
    margin: 0 auto;
}

.list-btn:hover {
    background: var(--terracotta);
    color: white;
    transform: scale(1.1);
    box-shadow: var(--soft-shadow);
}

.list-btn:focus {
    outline: 2px solid var(--warm-gold);
    outline-offset: 2px;
}

/* Info 按钮 */
.info-btn {
    position: fixed;
    top: 2rem;
    right: 2rem;
    width: 48px;
    height: 48px;
    border: none;
    border-radius: 50%;
    background: var(--warm-beige);
    color: var(--soft-brown);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--gentle-shadow);
    transition: var(--transition-smooth);
    z-index: 1000;
}

.info-btn:hover {
    background: var(--terracotta);
    color: white;
    transform: scale(1.1);
    box-shadow: var(--soft-shadow);
}

.info-btn:focus {
    outline: 2px solid var(--warm-gold);
    outline-offset: 2px;
}

/* 主要内容区域 */
.main-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3rem;
    max-width: 600px;
    width: 100%;
    z-index: 1;
}

/* 呼吸圆圈 */
.breathing-circle {
    width: 200px;
    height: 200px;
    position: relative;
    cursor: pointer;
    transition: var(--transition-smooth);
}

.breathing-circle:hover {
    transform: scale(1.05);
}

.circle-inner {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--terracotta), var(--sage-green));
    position: relative;
    overflow: hidden;
    box-shadow: var(--soft-shadow);
    animation: breathe var(--breathing-duration) ease-in-out infinite;
}

.circle-glow {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 80%;
    height: 80%;
    background: radial-gradient(circle, rgba(244, 208, 63, 0.4) 0%, transparent 70%);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    animation: glow var(--breathing-duration) ease-in-out infinite;
}

/* 呼吸动画 */
@keyframes breathe {
    0%, 100% {
        transform: scale(1);
        border-radius: 50%;
    }
    50% {
        transform: scale(1.1);
        border-radius: 45% 55% 50% 50%;
    }
}

@keyframes glow {
    0%, 100% {
        opacity: 0.6;
        transform: translate(-50%, -50%) scale(1);
    }
    50% {
        opacity: 0.9;
        transform: translate(-50%, -50%) scale(1.2);
    }
}

/* 练习卡片 */
.practice-card {
    background: var(--warm-beige);
    border-radius: 24px;
    padding: 2.5rem;
    box-shadow: var(--gentle-shadow);
    border: 1px solid rgba(212, 165, 116, 0.2);
    backdrop-filter: blur(10px);
    transition: var(--transition-smooth);
    width: 100%;
    max-width: 500px;
    position: relative;
}

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

.practice-title {
    font-size: 1.8rem;
    font-weight: 400;
    color: var(--soft-brown);
    margin-bottom: 1rem;
    text-align: center;
    line-height: 1.4;
}

.practice-description {
    font-size: 1.1rem;
    color: var(--warm-gray);
    text-align: center;
    margin-bottom: 1.5rem;
    line-height: 1.7;
}

/* 原理图标 */
.principle-icon {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    width: 28px;
    height: 28px;
    border: none;
    border-radius: 50%;
    background: rgba(212, 165, 116, 0.15);
    color: var(--terracotta);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: none;
    transition: var(--transition-smooth);
    z-index: 10;
    animation: principleIconFloat 4s ease-in-out infinite;
}

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

.principle-icon:hover,
.principle-icon:active {
    background: rgba(212, 165, 116, 0.25);
    transform: scale(1.05);
    animation-play-state: paused;
}

.principle-icon:focus {
    outline: 1px solid var(--terracotta);
    outline-offset: 1px;
    background: rgba(212, 165, 116, 0.2);
}

.principle-icon svg {
    width: 14px;
    height: 14px;
}



/* 控制按钮 */
.controls {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    justify-content: center;
}

.btn {
    padding: 0.8rem 2rem;
    border: none;
    border-radius: 20px;
    font-family: var(--font-family);
    font-size: 1rem;
    font-weight: 400;
    cursor: pointer;
    transition: var(--transition-smooth);
    position: relative;
    overflow: hidden;
}

.btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

.btn:hover::before {
    left: 100%;
}

.btn-primary {
    background: linear-gradient(135deg, var(--terracotta), var(--dusty-pink));
    color: white;
    box-shadow: var(--gentle-shadow);
}

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

.btn-secondary {
    background: var(--warm-beige);
    color: var(--soft-brown);
    border: 1px solid var(--terracotta);
    box-shadow: var(--gentle-shadow);
}

.btn-secondary:hover {
    background: var(--terracotta);
    color: white;
    transform: translateY(-2px);
}

/* Info 弹窗 */
.info-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(139, 115, 85, 0.3);
    backdrop-filter: blur(5px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    opacity: 0;
    transition: opacity 0.3s ease;
}

/* 原理弹窗 */
.principle-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(139, 115, 85, 0.3);
    backdrop-filter: blur(5px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.info-modal.show,
.principle-modal.show {
    display: flex;
    opacity: 1;
}

.modal-content {
    background: var(--warm-beige);
    border-radius: 24px;
    padding: 0;
    max-width: 500px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: var(--soft-shadow);
    border: 1px solid rgba(212, 165, 116, 0.2);
    transform: scale(0.9);
    transition: transform 0.3s ease;
}

.info-modal.show .modal-content,
.principle-modal.show .modal-content {
    transform: scale(1);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 2rem 2rem 1rem 2rem;
    border-bottom: 1px solid rgba(212, 165, 116, 0.2);
}

.modal-header h2 {
    color: var(--soft-brown);
    font-size: 1.5rem;
    font-weight: 400;
    margin: 0;
}

.close-btn {
    background: none;
    border: none;
    font-size: 2rem;
    color: var(--warm-gray);
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: var(--transition-smooth);
}

.close-btn:hover {
    background: var(--terracotta);
    color: white;
}

.modal-body {
    padding: 2rem;
}

.modal-body h3 {
    color: var(--terracotta);
    font-size: 1.2rem;
    font-weight: 400;
    margin-bottom: 1rem;
}

.modal-body p {
    color: var(--warm-gray);
    line-height: 1.6;
    margin-bottom: 1rem;
}

/* 原理内容样式 */
.principle-content {
    background: var(--cream-white);
    border-radius: 16px;
    padding: 1.5rem;
    border: 1px solid rgba(212, 165, 116, 0.1);
}

.principle-content p {
    color: var(--soft-brown);
    line-height: 1.8;
    font-size: 1.05rem;
    margin: 0;
}

/* 语言选择器 */
.language-selector {
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid rgba(212, 165, 116, 0.2);
}

.language-selector h3 {
    color: var(--soft-brown);
    font-size: 1.1rem;
    margin-bottom: 1rem;
    text-align: center;
}

.language-options {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.8rem;
}

.lang-btn {
    padding: 0.8rem 1rem;
    border: 1px solid rgba(212, 165, 116, 0.3);
    border-radius: 12px;
    background: var(--cream-white);
    color: var(--soft-brown);
    font-family: var(--font-family);
    font-size: 0.9rem;
    cursor: pointer;
    transition: var(--transition-smooth);
    text-align: center;
}

.lang-btn:hover {
    background: rgba(244, 208, 63, 0.1);
    border-color: var(--terracotta);
    transform: translateY(-1px);
}

.lang-btn.active {
    background: var(--terracotta);
    color: white;
    border-color: var(--terracotta);
}

.website-info {
    margin-bottom: 2rem;
}

.current-practice-info {
    padding-top: 1rem;
    border-top: 1px solid rgba(212, 165, 116, 0.2);
}

#modalPracticeContent {
    background: rgba(244, 208, 63, 0.1);
    padding: 1rem;
    border-radius: 12px;
    border: 1px solid rgba(244, 208, 63, 0.2);
}

#modalPracticeContent h4 {
    color: var(--terracotta);
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
}

#modalPracticeContent p {
    color: var(--soft-brown);
    margin-bottom: 0;
}

/* 侧边栏 */
.sidebar {
    position: fixed;
    top: 0;
    left: -400px;
    width: 400px;
    height: 100vh;
    background: var(--warm-beige);
    box-shadow: var(--soft-shadow);
    transition: left 0.3s ease;
    z-index: 1500;
    overflow-y: auto;
}

.sidebar.show {
    left: 0;
}

.sidebar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 2rem;
    border-bottom: 1px solid rgba(212, 165, 116, 0.2);
    background: var(--cream-white);
    position: sticky;
    top: 0;
    z-index: 10;
}

.sidebar-header h2 {
    color: var(--soft-brown);
    font-size: 1.5rem;
    font-weight: 400;
    margin: 0;
}

.close-sidebar-btn {
    background: none;
    border: none;
    font-size: 2rem;
    color: var(--warm-gray);
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: var(--transition-smooth);
}

.close-sidebar-btn:hover {
    background: var(--terracotta);
    color: white;
}

.sidebar-content {
    padding: 2rem;
}

/* 快捷操作按钮 */
.quick-actions {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid rgba(212, 165, 116, 0.2);
}

.quick-btn {
    padding: 1rem 1.5rem;
    border: 1px solid rgba(212, 165, 116, 0.3);
    border-radius: 12px;
    background: var(--cream-white);
    color: var(--soft-brown);
    font-family: var(--font-family);
    font-size: 1rem;
    font-weight: 400;
    cursor: pointer;
    transition: var(--transition-smooth);
    text-align: center;
    position: relative;
    overflow: hidden;
}

.quick-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(244, 208, 63, 0.2), transparent);
    transition: left 0.5s;
}

.quick-btn:hover::before {
    left: 100%;
}

.quick-btn:hover {
    background: rgba(244, 208, 63, 0.1);
    border-color: var(--terracotta);
    transform: translateY(-1px);
    box-shadow: var(--gentle-shadow);
}

.quick-btn:active {
    transform: translateY(0);
    box-shadow: none;
}



.practice-list {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}

.practice-item {
    padding: 0.8rem 1rem;
    background: var(--cream-white);
    border-radius: 10px;
    border: 1px solid rgba(212, 165, 116, 0.2);
    cursor: pointer;
    transition: var(--transition-smooth);
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}

.practice-item:hover {
    background: rgba(244, 208, 63, 0.1);
    border-color: var(--terracotta);
    transform: translateX(4px);
}

.practice-item.current {
    background: rgba(212, 165, 116, 0.1);
    border-color: var(--terracotta);
    border-width: 2px;
}

.practice-item-name {
    font-size: 1rem;
    font-weight: 500;
    color: var(--soft-brown);
    margin: 0;
}

.practice-item-category {
    font-size: 0.8rem;
    color: var(--warm-gray);
    background: rgba(168, 181, 160, 0.2);
    padding: 0.2rem 0.5rem;
    border-radius: 6px;
    display: inline-block;
    align-self: flex-start;
}

/* 侧边栏遮罩 */
.sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(139, 115, 85, 0.3);
    backdrop-filter: blur(5px);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    z-index: 1400;
}

.sidebar-overlay.show {
    opacity: 1;
    visibility: visible;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .container {
        padding: 1rem;
    }
    
    .list-btn {
        top: 1rem;
        left: 1rem;
        width: 40px;
        height: 40px;
    }
    
    .info-btn {
        top: 1rem;
        right: 1rem;
        width: 40px;
        height: 40px;
    }
    
    .sidebar {
        width: 100%;
        left: -100%;
    }
    
    .sidebar.show {
        left: 0;
    }
    
    .quick-actions {
        margin-bottom: 1.5rem;
        padding-bottom: 1rem;
    }
    
    .quick-btn {
        padding: 0.8rem 1.2rem;
        font-size: 0.9rem;
    }
    
    .main-content {
        gap: 2rem;
    }
    
    .breathing-circle {
        width: 150px;
        height: 150px;
    }
    
    .practice-card {
        padding: 2rem;
        border-radius: 20px;
    }
    
    .principle-icon {
        top: 0.5rem;
        right: 0.5rem;
        width: 24px;
        height: 24px;
    }
    
    .principle-icon svg {
        width: 12px;
        height: 12px;
    }
    
    .practice-title {
        font-size: 1.5rem;
    }
    
    .practice-description {
        font-size: 1rem;
    }
    
    .controls {
        flex-direction: column;
        align-items: center;
    }
    
    .btn {
        width: 100%;
        max-width: 200px;
    }
    
    .modal-content {
        width: 95%;
        margin: 1rem;
    }
    
    .modal-header {
        padding: 1.5rem 1.5rem 1rem 1.5rem;
    }
    
    .modal-body {
        padding: 1.5rem;
    }
}

@media (max-width: 480px) {
    .breathing-circle {
        width: 120px;
        height: 120px;
    }
    
    .practice-card {
        padding: 1.5rem;
    }
    
    .principle-icon {
        top: 0.4rem;
        right: 0.4rem;
        width: 22px;
        height: 22px;
    }
    
    .principle-icon svg {
        width: 11px;
        height: 11px;
    }
    
    .practice-title {
        font-size: 1.3rem;
    }
}

/* 无障碍功能 */
@media (prefers-reduced-motion: reduce) {
    .breathing-circle,
    .circle-glow,
    .background-texture {
        animation: none;
    }
    
    .breathing-circle:hover,
    .practice-card:hover,
    .btn:hover {
        transform: none;
    }
}

/* 高对比度模式支持 */
@media (prefers-contrast: high) {
    :root {
        --soft-brown: #5a4a3a;
        --warm-gray: #7a6b5a;
    }
    
    .practice-card {
        border: 2px solid var(--terracotta);
    }
}

/* 焦点样式 */
.btn:focus,
.breathing-circle:focus {
    outline: 2px solid var(--warm-gold);
    outline-offset: 2px;
}

/* 加载状态 */
.loading {
    opacity: 0.7;
    pointer-events: none;
}

.loading .breathing-circle {
    animation-play-state: paused;
}