/* 自定义样式 */
:root {
    --primary-color: #8A4FFF;
    --secondary-color: #B388FF;
    --accent-color: #FFD166;
    --text-primary: #333333;
    --text-secondary: #666666;
    --bg-light: #F8F9FE;
    --bg-white: #FFFFFF;
    --gradient-primary: linear-gradient(135deg, #8A4FFF 0%, #B388FF 100%);
    --shadow-sm: 0 4px 6px rgba(138, 79, 255, 0.1);
    --shadow-md: 0 6px 12px rgba(138, 79, 255, 0.15);
    --shadow-lg: 0 10px 20px rgba(138, 79, 255, 0.2);
    --radius-sm: 8px;
    --radius-md: 16px;
    --radius-lg: 24px;
    --radius-full: 9999px;
}

/* 基础样式，确保内容完整显示 */
html, body {
    height: auto;
    min-height: 100%;
    overflow-x: hidden;
    overflow-y: auto;
}

/* 隐藏横向滚动条但保持滚动功能 */
.category-scroll {
    display: flex;
    overflow-x: auto;
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* IE and Edge */
    scroll-snap-type: x mandatory;
    padding-bottom: 10px;
    margin-bottom: -10px; /* 抵消padding-bottom，保持整体高度不变 */
    position: relative;
}

.category-scroll::-webkit-scrollbar {
    display: none; /* Chrome, Safari, Opera */
}

.category-item {
    scroll-snap-align: start;
    flex-shrink: 0;
}

/* 滑动指示器 */
.category-scroll-container {
    position: relative;
}

.scroll-indicator {
    position: absolute;
    bottom: 15px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 6px;
    z-index: 10;
}

.indicator-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background-color: rgba(0, 0, 0, 0.2);
    cursor: pointer;
    transition: all 0.2s ease;
}

.indicator-dot.active {
    background-color: var(--primary-color);
    width: 8px;
    height: 8px;
}

/* 滑动箭头 */
.scroll-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 30px;
    height: 30px;
    background-color: rgba(255, 255, 255, 0.8);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 20;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    transition: all 0.2s ease;
}

.scroll-arrow:hover {
    background-color: white;
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.15);
}

.scroll-arrow.left {
    left: 5px;
}

.scroll-arrow.right {
    right: 5px;
}

.scroll-arrow.hidden {
    opacity: 0;
    pointer-events: none;
}

/* 主内容区域样式 */
main {
    padding-bottom: 80px; /* 确保底部有足够空间，不被导航栏遮挡 */
}

/* 底部导航栏样式 */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background-color: var(--bg-white);
    box-shadow: var(--shadow-sm);
    z-index: 100;
    width: 100%;
    border-top-left-radius: var(--radius-md);
    border-top-right-radius: var(--radius-md);
    padding: 12px 0;
}

/* 卡片样式 */
.card {
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border: 1px solid rgba(138, 79, 255, 0.1);
    background-color: var(--bg-white);
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-md);
    border-color: rgba(138, 79, 255, 0.2);
}

/* 按钮样式 */
.btn-primary {
    background: var(--gradient-primary);
    color: white;
    border-radius: var(--radius-full);
    padding: 0.75rem 1.5rem;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: var(--shadow-sm);
    border: none;
}

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

.btn-secondary {
    background-color: white;
    color: var(--primary-color);
    border: 1px solid var(--secondary-color);
    border-radius: var(--radius-full);
    padding: 0.75rem 1.5rem;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: var(--shadow-sm);
}

.btn-secondary:hover {
    background-color: rgba(138, 79, 255, 0.05);
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

/* 动画效果 */
@keyframes bounce {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-10px);
    }
}

.animate-bounce {
    animation: bounce 2s infinite;
}

/* 进度条样式 */
.progress-bar {
    height: 8px;
    border-radius: var(--radius-full);
    background-color: rgba(255, 255, 255, 0.3);
    overflow: hidden;
}

.progress-bar-fill {
    height: 100%;
    border-radius: var(--radius-full);
    background: linear-gradient(90deg, var(--accent-color), var(--primary-color));
    transition: width 0.5s ease;
    box-shadow: 0 0 10px rgba(138, 79, 255, 0.5);
}

/* 徽章样式 */
.badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    font-weight: 600;
    text-align: center;
    box-shadow: var(--shadow-sm);
}

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

.badge-secondary {
    background-color: white;
    color: var(--primary-color);
    border: 1px solid var(--secondary-color);
}

.badge-accent {
    background-color: var(--accent-color);
    color: var(--text-primary);
    box-shadow: 0 2px 8px rgba(255, 209, 102, 0.4);
}

/* 单词卡片样式 */
.word-card {
    position: relative;
    perspective: 1000px;
    width: 100%;
    height: 200px;
}

.word-card-inner {
    position: relative;
    width: 100%;
    height: 100%;
    text-align: center;
    transition: transform 0.6s;
    transform-style: preserve-3d;
}

.word-card.flipped .word-card-inner {
    transform: rotateY(180deg);
}

.word-card-front, .word-card-back {
    position: absolute;
    width: 100%;
    height: 100%;
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    border: 1px solid rgba(138, 79, 255, 0.1);
}

.word-card-front {
    background-color: var(--bg-white);
    color: var(--text-primary);
}

.word-card-back {
    background: var(--gradient-primary);
    color: white;
    transform: rotateY(180deg);
}