/* 移动端专用样式 */

/* 基础样式 */
body {
    font-family: 'PingFang SC', 'Helvetica Neue', Arial, sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    font-size: 16px;
    line-height: 1.6;
}

/* 自定义 Tailwind 样式覆盖 */
/* 将 h-16 高度从默认的 4rem 改为 3rem */
.h-16 {
    height: 3rem !important;
}

nav .h-16 {
    height: 3rem !important;
}

.mobile-navbar .h-16 {
    height: 3rem !important;
}

/* 将 h-14 高度从默认的 3.5rem 改为 2.5rem */
.h-14 {
    height: 2.5rem !important;
}

footer .h-14 {
    height: 2.5rem !important;
}

/* 将 w-16 宽度从默认的 4rem 改为 3rem */
.w-16 {
    width: 3rem !important;
}

/* 将 text-xl 的行高从默认的 1.75rem 改为 3rem */
.text-xl {
    font-size: 1.25rem;
    line-height: 2.5rem;
}

/* 滚动条隐藏 */
.scrollbar-hide {
    -ms-overflow-style: none;  /* IE and Edge */
    scrollbar-width: none;  /* Firefox */
}

.scrollbar-hide::-webkit-scrollbar {
    display: none;  /* Chrome, Safari and Opera */
}

/* 课程滚动容器 */
#card-container, #list-container {
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
}

/* 课程体系视图切换样式 */
.course-view {
    transition: all 0.3s ease;
}

.active-view {
    font-weight: bold;
}

/* 课程卡片样式 */
.course-card {
    transition: all 0.3s ease;
    border: 1px solid #e5e7eb;
}

.course-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

.course-tag {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 500;
}

/* 底部导航栏重新优化样式 */
footer {
    box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.08);
    border-top: 1px solid #e5e7eb;
    background: linear-gradient(to bottom, #ffffff, #fafafa);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    height: 56px;
    padding: 4px 0;
}

.footer-nav {
    display: flex;
    justify-content: space-around;
    align-items: center;
    height: 100%;
}

footer a {
    position: relative;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 12px;
    padding: 0.25rem 0.5rem;
    margin: 0.125rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex: 1;
    height: 100%;
    text-decoration: none;
}

footer a:hover {
    background-color: rgba(59, 130, 246, 0.12);
    transform: translateY(-2px);
}

footer a:active {
    transform: scale(0.92);
}

footer .text-blue-600 {
    background-color: rgba(59, 130, 246, 0.15);
}

/* 底部导航图标动画 */
footer i {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    margin-bottom: 0.125rem;
    font-size: 1.125rem; /* 18px */
}

footer a:hover i {
    transform: scale(1.15) translateY(-2px);
}

/* 底部导航标签动画 */
footer span {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-weight: 500;
    font-size: 0.7rem;
    line-height: 1.2;
}

footer a:hover span {
    color: #3b82f6;
    transform: translateY(-1px);
}

/* 小红点通知 */
footer .relative .notification-dot {
    position: absolute;
    top: -0.125rem;
    right: 1.25rem;
    width: 0.5rem;
    height: 0.5rem;
    background-color: #ef4444;
    border-radius: 50%;
    border: 1px solid #ffffff;
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.7);
    }
    70% {
        transform: scale(1.1);
        box-shadow: 0 0 0 6px rgba(239, 68, 68, 0);
    }
    100% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(239, 68, 68, 0);
    }
}

/* 首页激活状态的特殊动画 */
footer a:first-child .notification-dot:first-child {
    animation: bounce 2s infinite;
}

@keyframes bounce {
    0%, 100% {
        transform: translateY(0) scale(1);
    }
    50% {
        transform: translateY(-5px) scale(1.2);
    }
}

/* 指示器 */
.indicator-active {
    background-color: #3b82f6;
}

.indicator-inactive {
    background-color: #d1d5db;
}

/* 导航栏适配 */
#navbar {
    height: 64px;
    padding: 0 16px;
}

/* 移动端导航栏样式 */
.mobile-navbar {
    background-color: #ffffff;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 50;
    height: 3rem; /* 48px */
    padding: 0 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

/* 导航栏品牌区域 */
.navbar-brand {
    display: flex;
    align-items: center;
    text-decoration: none;
    min-width: 0;
}

/* 导航栏图标 */
.navbar-brand i {
    font-size: 1.5rem; /* 24px */
    margin-right: 0.5rem;
    color: #3b82f6;
}

/* 导航栏标题 */
.navbar-brand span {
    font-size: 1.125rem; /* 18px */
    font-weight: 700;
    color: #3b82f6;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* 导航栏右侧区域 */
.navbar-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

/* 导航栏按钮 */
.navbar-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2.5rem; /* 40px */
    height: 2.5rem; /* 40px */
    border-radius: 50%;
    background-color: #f3f4f6;
    color: #4b5563;
    transition: all 0.2s ease;
    border: none;
    cursor: pointer;
}

.navbar-btn:hover {
    background-color: #e5e7eb;
    color: #3b82f6;
    transform: scale(1.05);
}

.navbar-btn:active {
    transform: scale(0.95);
}

/* 导航栏按钮图标 */
.navbar-btn i {
    font-size: 1rem; /* 16px */
}

/* 主内容区域 */
.main-content {
    padding-top: 3rem; /* 48px */
    padding-bottom: 3.5rem; /* 56px */
}

/* 练习设置区域响应式优化 */
.practice-setting-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

@media (max-width: 374px) {
    .practice-setting-grid {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }
    
    .practice-setting-grid > div:first-child {
        order: 2;
    }
    
    .practice-setting-grid > div:last-child {
        order: 1;
    }
}

/* 小屏幕优化 */
@media (max-width: 480px) {
    .mobile-navbar {
        padding: 0 0.75rem;
        height: 2.75rem; /* 44px */
    }
    
    .navbar-brand i {
        font-size: 1.25rem; /* 20px */
        margin-right: 0.375rem;
    }
    
    .navbar-brand span {
        font-size: 1rem; /* 16px */
    }
    
    .navbar-btn {
        width: 2.25rem; /* 36px */
        height: 2.25rem; /* 36px */
    }
    
    .main-content {
        padding-top: 2.75rem; /* 44px */
    }
    
    /* 练习设置区域小屏幕优化 */
    .practice-setting-grid {
        gap: 0.75rem;
    }
}

/* 超小屏幕优化 */
@media (max-width: 375px) {
    .mobile-navbar {
        padding: 0 0.5rem;
        height: 2.5rem; /* 40px */
    }
    
    .navbar-brand i {
        font-size: 1.125rem; /* 18px */
        margin-right: 0.25rem;
    }
    
    .navbar-brand span {
        font-size: 0.875rem; /* 14px */
    }
    
    .navbar-btn {
        width: 2rem; /* 32px */
        height: 2rem; /* 32px */
    }
    
    .navbar-btn i {
        font-size: 0.875rem; /* 14px */
    }
    
    .main-content {
        padding-top: 2.5rem; /* 40px */
    }
    
    /* 练习设置区域超小屏幕优化 */
    .practice-setting-grid {
        gap: 0.5rem;
    }
}

/* 大屏手机优化 */
@media (min-width: 414px) and (max-width: 768px) {
    .mobile-navbar {
        padding: 0 1.25rem;
        height: 3.25rem; /* 52px */
    }
    
    .navbar-brand i {
        font-size: 1.75rem; /* 28px */
        margin-right: 0.625rem;
    }
    
    .navbar-brand span {
        font-size: 1.25rem; /* 20px */
    }
    
    .navbar-btn {
        width: 2.75rem; /* 44px */
        height: 2.75rem; /* 44px */
    }
    
    .navbar-btn i {
        font-size: 1.125rem; /* 18px */
    }
    
    .main-content {
        padding-top: 3.25rem; /* 52px */
    }
    
    /* 练习设置区域大屏手机优化 */
    .practice-setting-grid {
        gap: 1.25rem;
    }
}

/* 平板优化 */
@media (min-width: 768px) {
    .mobile-navbar {
        padding: 0 1.5rem;
        height: 3.5rem; /* 56px */
    }
    
    .navbar-brand i {
        font-size: 2rem; /* 32px */
        margin-right: 0.75rem;
    }
    
    .navbar-brand span {
        font-size: 1.5rem; /* 24px */
    }
    
    .navbar-btn {
        width: 3rem; /* 48px */
        height: 3rem; /* 48px */
    }
    
    .navbar-btn i {
        font-size: 1.25rem; /* 20px */
    }
    
    .main-content {
        padding-top: 3.5rem; /* 56px */
    }
    
    /* 练习设置区域平板优化 */
    .practice-setting-grid {
        gap: 1.5rem;
    }
}

/* 底部导航栏已整合到上面的样式中 */

/* 卡片样式优化 */
.card {
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    margin-bottom: 16px;
    padding: 16px;
}

/* 按钮样式 */
.btn {
    border-radius: 0.5rem; /* 8px */
    padding: 0.75rem 1rem; /* 12px 16px */
    font-size: 1rem; /* 16px */
    font-weight: 500;
    height: 3rem; /* 48px */
}

.btn-sm {
    padding: 0.5rem 0.75rem; /* 8px 12px */
    font-size: 0.875rem; /* 14px */
    height: 2.25rem; /* 36px */
}

/* 表单元素 */
.form-input, .form-select {
    border-radius: 8px;
    padding: 0.75rem 1rem;
    font-size: 1rem; /* 16px 防止iOS缩放 */
    height: 3rem; /* 48px */
}

.form-input:focus, .form-select:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 0.1875rem rgba(59, 130, 246, 0.2);
}

/* 标题优化 */
h1 {
    font-size: 1.5rem; /* 24px */
    line-height: 1.33;
}

h2 {
    font-size: 1.25rem; /* 20px */
    line-height: 1.4;
}

h3 {
    font-size: 1.125rem; /* 18px */
    line-height: 1.44;
}

/* 文本优化 */
.text-sm {
    font-size: 0.875rem; /* 14px */
    line-height: 1.43;
}

.text-xs {
    font-size: 0.75rem; /* 12px */
    line-height: 1.33;
}

/* 间距优化 */
.m-4 {
    margin: 16px;
}

.p-4 {
    padding: 16px;
}

.mb-4 {
    margin-bottom: 16px;
}

/* 网格布局优化 */
.grid-cols-2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.grid-cols-3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.grid-cols-4 {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.gap-4 {
    gap: 16px;
}

/* 移动端菜单面板 */
#menu-panel {
    width: 80%;
    max-width: 300px;
}

/* 快捷功能容器 */
.quick-access-container {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

/* 快捷功能项 */
.quick-access-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border-radius: 0.75rem;
    padding: 0.75rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    text-decoration: none;
}

.quick-access-item:hover {
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}

/* 快捷功能图标容器 */
.quick-access-icon {
    width: 3rem;
    height: 3rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 0.5rem;
}

/* 快捷功能标签 */
.quick-access-label {
    font-size: 0.75rem;
    text-align: center;
    line-height: 1.2;
}

/* 小屏幕优化 */
@media (max-width: 480px) {
    .quick-access-container {
        gap: 0.5rem;
        margin-bottom: 1rem;
    }
    
    .quick-access-item {
        padding: 0.5rem;
    }
    
    .quick-access-icon {
        width: 2.5rem;
        height: 2.5rem;
    }
    
    .quick-access-label {
        font-size: 0.625rem;
    }
}

/* 超小屏幕优化 */
@media (max-width: 375px) {
    .quick-access-container {
        gap: 0.375rem;
    }
    
    .quick-access-item {
        padding: 0.375rem;
    }
    
    .quick-access-icon {
        width: 2.25rem;
        height: 2.25rem;
    }
    
    .quick-access-label {
        font-size: 0.5625rem;
    }
}

/* 大屏手机优化 */
@media (min-width: 414px) and (max-width: 768px) {
    .quick-access-container {
        gap: 1rem;
        margin-bottom: 2rem;
    }
    
    .quick-access-item {
        padding: 1rem;
    }
    
    .quick-access-icon {
        width: 3.5rem;
        height: 3.5rem;
    }
    
    .quick-access-label {
        font-size: 0.875rem;
    }
}

/* 平板优化 */
@media (min-width: 768px) {
    .quick-access-container {
        gap: 1.5rem;
        margin-bottom: 2.5rem;
    }
    
    .quick-access-item {
        padding: 1.25rem;
    }
    
    .quick-access-icon {
        width: 4rem;
        height: 4rem;
    }
    
    .quick-access-label {
        font-size: 1rem;
    }
}

/* 响应式优化 */
@media (max-width: 480px) {
    .container {
        padding-left: 0.75rem; /* 12px */
        padding-right: 0.75rem; /* 12px */
    }
    
    h1 {
        font-size: 1.375rem; /* 22px */
    }
    
    h2 {
        font-size: 1.125rem; /* 18px */
    }
    
    .btn {
        padding: 0.625rem 0.875rem; /* 10px 14px */
        height: 2.75rem; /* 44px */
    }
    
    .form-input, .form-select {
        padding: 0.625rem 0.875rem; /* 10px 14px */
        height: 2.75rem; /* 44px */
    }
    
    footer {
        height: 2.75rem; /* 44px */
    }
    
    footer a {
        padding: 0.125rem 0.25rem;
    }
    
    footer i {
        font-size: 1rem; /* 16px */
    }
    
    footer span {
        font-size: 0.625rem; /* 10px */
    }
}

/* 触摸优化 */
@media (hover: none) and (pointer: coarse) {
    .btn, .card, a, .mobile-option, .function-btn, .mobile-btn, .answer-card-btn {
        min-height: 44px;
        min-width: 44px;
        -webkit-tap-highlight-color: transparent;
    }
    
    /* 减少悬停效果 */
    .btn:hover, .card:hover, .mobile-option:hover, .function-btn:hover, .mobile-btn:hover, .answer-card-btn:hover {
        transform: none;
    }
    
    /* 触摸时的反馈 */
    .btn:active, .card:active, footer a:active, .mobile-option:active, .function-btn:active, .mobile-btn:active, .answer-card-btn:active {
        transform: scale(0.95);
    }
}

/* 横屏适配 */
@media (orientation: landscape) and (max-height: 500px) {
    footer {
        height: 2.5rem; /* 40px */
    }
    
    #navbar {
        height: 3.5rem; /* 56px */
    }
    
    main {
        padding-top: 3.5rem; /* 56px */
        padding-bottom: 2.5rem; /* 40px */
    }
    
    footer span {
        font-size: 0.625rem; /* 10px */
    }
    
    footer a {
        padding: 0.1rem 0.2rem;
    }
}

/* 大屏手机优化 */
@media (min-width: 414px) and (max-width: 768px) {
    h1 {
        font-size: 1.75rem; /* 28px */
    }
    
    h2 {
        font-size: 1.5rem; /* 24px */
    }
    
    h3 {
        font-size: 1.25rem; /* 20px */
    }
    
    .text-sm {
        font-size: 1rem; /* 16px */
    }
    
    .text-xs {
        font-size: 0.875rem; /* 14px */
    }
    
    .btn {
        font-size: 1.125rem; /* 18px */
        padding: 0.875rem 1rem;
    }
    
    footer {
        height: 3rem; /* 48px */
    }
    
    footer i {
        font-size: 1.25rem; /* 20px */
    }
    
    footer span {
        font-size: 0.75rem; /* 12px */
    }
}

/* 小屏幕优化 */
@media (max-width: 320px) {
    h1 {
        font-size: 1.375rem; /* 22px */
    }
    
    h2 {
        font-size: 1.125rem; /* 18px */
    }
    
    h3 {
        font-size: 1rem; /* 16px */
    }
    
    .text-sm {
        font-size: 0.8125rem; /* 13px */
    }
    
    .text-xs {
        font-size: 0.75rem; /* 12px */
    }
    
    .btn {
        font-size: 0.875rem; /* 14px */
        padding: 0.625rem 0.75rem;
    }
    
    footer {
        height: 2.5rem; /* 40px */
    }
    
    footer i {
        font-size: 0.875rem; /* 14px */
    }
    
    footer span {
        font-size: 0.625rem; /* 10px */
    }
}

/* 超大屏手机优化 */
@media (min-width: 768px) {
    footer {
        height: 3.5rem; /* 56px */
    }
    
    footer i {
        font-size: 1.375rem; /* 22px */
    }
    
    footer span {
        font-size: 0.875rem; /* 14px */
    }
}

/* 移动端分页样式 */
.pagination-container {
    display: flex;
    justify-content: center;
    margin-top: 1.5rem;
    margin-bottom: 4rem;
}

.pagination-content {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    flex-wrap: wrap;
    justify-content: center;
}

.pagination-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem 0.75rem;
    border-radius: 0.5rem;
    background-color: #fff;
    border: 1px solid #e5e7eb;
    color: #6b7280;
    font-size: 0.875rem;
    font-weight: 500;
    transition: all 0.2s ease;
    text-decoration: none;
    min-width: 2.5rem;
    min-height: 2.5rem;
}

.pagination-btn:hover {
    background-color: #f9fafb;
    color: #1f2937;
}

.pagination-btn.active {
    background-color: #3b82f6;
    border-color: #3b82f6;
    color: #fff;
}

.pagination-ellipsis {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem 0.25rem;
    color: #9ca3af;
    min-width: 2rem;
}

/* 小屏幕优化 */
@media (max-width: 480px) {
    .pagination-content {
        gap: 0.125rem;
    }
    
    .pagination-btn {
        padding: 0.375rem 0.5rem;
        font-size: 0.75rem;
        min-width: 2rem;
        min-height: 2rem;
    }
    
    .pagination-ellipsis {
        padding: 0.375rem 0.125rem;
        font-size: 0.75rem;
        min-width: 1.5rem;
    }
}