/* 统一导航栏样式 */
.navbar-container {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(229, 231, 235, 0.8);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    transition: all 0.3s ease;
}

.navbar-container.scrolled {
    background: rgba(255, 255, 255, 0.98);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

.nav-link {
    position: relative;
    transition: all 0.3s ease;
    border-radius: 0.5rem;
    padding: 0.375rem 0.75rem;
    font-weight: 500;
    color: #374151;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.375rem;
    font-size: 0.875rem;
    white-space: nowrap;
}

.nav-link:hover {
    color: #165DFF;
    background-color: rgba(249, 250, 251, 0.8);
    transform: translateY(-1px);
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 50%;
    width: 0;
    height: 2px;
    background: linear-gradient(90deg, #165DFF, #36CFC9);
    transition: all 0.3s ease;
    transform: translateX(-50%);
    border-radius: 1px;
}

.nav-link:hover::after {
    width: 100%;
}

.nav-link.active::after {
    width: 100%;
}

.nav-link.active {
    color: #165DFF;
    background-color: rgba(22, 93, 255, 0.1);
}

.logo-container {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.logo-container:hover {
    transform: scale(1.02);
}

.logo-icon {
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 0.75rem;
    background: linear-gradient(135deg, #165DFF, #36CFC9);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 6px -1px rgba(22, 93, 255, 0.2);
    transition: all 0.3s ease;
}

.logo-container:hover .logo-icon {
    box-shadow: 0 8px 15px -3px rgba(22, 93, 255, 0.3);
    transform: scale(1.05);
}

.logo-text {
    display: flex;
    flex-direction: column;
}

.logo-title {
    font-size: 1.25rem;
    font-weight: 700;
    background: linear-gradient(135deg, #165DFF, #36CFC9);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    line-height: 1.2;
}

.logo-subtitle {
    font-size: 0.625rem;
    color: #6B7280;
    margin-top: -0.125rem;
}

.cta-button {
    background: linear-gradient(135deg, #165DFF, #36CFC9);
    color: white;
    padding: 0.5rem 1.25rem;
    border-radius: 9999px;
    font-weight: 500;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.375rem;
    transition: all 0.3s ease;
    box-shadow: 0 4px 6px -1px rgba(22, 93, 255, 0.2);
    font-size: 0.875rem;
    white-space: nowrap;
}

.cta-button:hover {
    background: linear-gradient(135deg, rgba(22, 93, 255, 0.9), rgba(54, 207, 201, 0.9));
    box-shadow: 0 8px 15px -3px rgba(22, 93, 255, 0.3);
    transform: translateY(-2px) scale(1.02);
    color: white;
    text-decoration: none;
}

.menu-toggle {
    display: none;
    background: none;
    border: none;
    color: #374151;
    padding: 0.5rem;
    border-radius: 0.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.menu-toggle:hover {
    background-color: rgba(249, 250, 251, 0.8);
    color: #165DFF;
}

.menu-toggle.active {
    transform: rotate(90deg);
}

.mobile-menu {
    display: none;
    position: fixed;
    left: 0;
    top: 0;
    width: 100vw;
    height: 100vh;
    z-index: 99;
    overflow-y: auto;
    background: rgba(255,255,255,0.98);
    border-top: 1px solid rgba(229, 231, 235, 0.8);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    transform: translateY(-100%);
    opacity: 0;
    transition: all 0.3s ease;
}

.mobile-menu.open {
    display: block !important;
    transform: translateY(0);
    opacity: 1;
}

.mobile-nav-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

.mobile-nav-item {
    padding: 0.75rem;
    border-radius: 0.5rem;
    font-weight: 500;
    color: #374151;
    text-decoration: none;
    text-align: center;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
}

.mobile-nav-item:hover {
    color: #165DFF;
    background-color: rgba(249, 250, 251, 0.8);
    text-decoration: none;
}

.mobile-nav-item.active {
    color: #165DFF;
    background-color: rgba(22, 93, 255, 0.1);
}

.mobile-nav-item i {
    font-size: 1.125rem;
    margin-bottom: 0.25rem;
}

.user-status {
    font-size: 0.75rem;
    color: #6B7280;
    background-color: #F3F4F6;
    padding: 0.25rem 0.5rem;
    border-radius: 0.375rem;
    white-space: nowrap;
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
}

.logout-link {
    color: #DC2626;
}

.logout-link:hover {
    color: #B91C1C;
    background-color: rgba(220, 38, 38, 0.1);
}

/* 桌面导航栏布局优化 */
.desktop-nav {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    flex-wrap: nowrap;
    overflow-x: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.desktop-nav::-webkit-scrollbar {
    display: none;
}

/* 用户操作区域优化 */
.user-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-shrink: 0;
}

.user-actions .nav-link {
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
}

/* 响应式优化 */
@media (max-width: 1400px) {
    .nav-link {
        padding: 0.25rem 0.5rem;
        font-size: 0.8rem;
    }
    
    .logo-title {
        font-size: 1.125rem;
    }
    
    .logo-subtitle {
        font-size: 0.6rem;
    }
    
    .cta-button {
        padding: 0.375rem 1rem;
        font-size: 0.8rem;
    }
}

@media (max-width: 1200px) {
    .desktop-nav {
        gap: 0.125rem;
    }
    
    .nav-link {
        padding: 0.25rem 0.375rem;
        font-size: 0.75rem;
    }
    
    .cta-button {
        padding: 0.375rem 1rem;
        font-size: 0.8rem;
    }
    
    .user-actions {
        gap: 0.375rem;
    }
    
    .user-actions .nav-link {
        padding: 0.25rem 0.375rem;
        font-size: 0.7rem;
    }
}

@media (max-width: 1024px) {
    .desktop-nav {
        display: none;
    }
    
    .menu-toggle {
        display: block;
    }
    
    .mobile-menu {
        display: block;
    }
}

@media (min-width: 1024px) {
    .mobile-menu {
        display: none;
    }
}

/* 超小屏幕优化 */
@media (max-width: 1100px) {
    .nav-link {
        padding: 0.25rem 0.25rem;
        font-size: 0.7rem;
    }
    
    .nav-link i {
        margin-right: 0.25rem !important;
    }
    
    .logo-title {
        font-size: 1rem;
    }
    
    .logo-subtitle {
        font-size: 0.55rem;
    }
    
    .cta-button {
        padding: 0.25rem 0.75rem;
        font-size: 0.75rem;
    }
    
    .user-status {
        max-width: 80px;
        font-size: 0.65rem;
        padding: 0.125rem 0.375rem;
    }
}

/* 确保导航栏不会换行 */
.navbar-container .container {
    min-width: 0;
    flex-wrap: nowrap;
}

.navbar-container .container > * {
    flex-shrink: 0;
}

.desktop-nav {
    flex: 1;
    min-width: 0;
    justify-content: center;
}

/* 用户操作区域紧凑布局 */
.user-actions {
    flex-shrink: 0;
    min-width: 0;
}

.user-actions .nav-link {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 80px;
}

/* 登录后状态优化 */
.user-status.logged-in {
    background-color: #DEF7EC;
    color: #03543F;
    border: 1px solid #0F766E;
}

.user-status.logged-out {
    background-color: #F3F4F6;
    color: #6B7280;
}

/* 动画效果 */
@keyframes slideIn {
    from {
        transform: translateY(-100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.mobile-menu.open {
    animation: slideIn 0.3s ease-out;
}

.mobile-nav-item {
    animation: fadeIn 0.3s ease-out;
}

/* 深色模式支持 */
@media (prefers-color-scheme: dark) {
    .navbar-container {
        background: rgba(17, 24, 39, 0.95);
        border-bottom-color: rgba(55, 65, 81, 0.8);
    }
    
    .navbar-container.scrolled {
        background: rgba(17, 24, 39, 0.98);
    }
    
    .nav-link {
        color: #D1D5DB;
    }
    
    .nav-link:hover {
        background-color: rgba(55, 65, 81, 0.8);
    }
    
    .nav-link.active {
        background-color: rgba(22, 93, 255, 0.2);
    }
    
    .logo-subtitle {
        color: #9CA3AF;
    }
    
    .menu-toggle {
        color: #D1D5DB;
    }
    
    .menu-toggle:hover {
        background-color: rgba(55, 65, 81, 0.8);
    }
    
    .mobile-menu {
        background: #111827;
        border-top-color: rgba(55, 65, 81, 0.8);
    }
    
    .mobile-nav-item {
        color: #D1D5DB;
    }
    
    .mobile-nav-item:hover {
        background-color: rgba(55, 65, 81, 0.8);
    }
    
    .user-status {
        background-color: rgba(55, 65, 81, 0.8);
        color: #9CA3AF;
    }
}

/* 错题解析卡片美化 */
.exam-result-card {
  background: linear-gradient(135deg, #fff 60%, #ffeaea 100%);
  border-radius: 1.25rem;
  box-shadow: 0 6px 24px -4px #f87171cc, 0 2px 8px #fca5a5cc;
  transition: transform 0.3s cubic-bezier(0.4,0,0.2,1), box-shadow 0.3s;
  overflow: hidden;
  position: relative;
}
.exam-result-card:hover {
  transform: scale(1.03) translateY(-2px) rotate(-1deg);
  box-shadow: 0 16px 40px -6px #f87171cc, 0 4px 16px #fca5a5cc;
}
.exam-result-badge {
  background: linear-gradient(90deg, #f87171, #f472b6);
  color: #fff;
  font-weight: bold;
  border-radius: 999px;
  padding: 0.25rem 1rem;
  font-size: 0.95rem;
  box-shadow: 0 2px 8px #fca5a5cc;
}
.explanation-toggle {
  background: linear-gradient(90deg, #f3f4f6 60%, #e0e7ff 100%);
  color: #165DFF;
  border: none;
  border-radius: 0.75rem;
  font-weight: 500;
  transition: background 0.2s, color 0.2s, box-shadow 0.2s;
  box-shadow: 0 2px 8px #dbeafe44;
  cursor: pointer;
}
.explanation-toggle:hover {
  background: linear-gradient(90deg, #165DFF 60%, #36CFC9 100%);
  color: #fff;
  box-shadow: 0 4px 16px #165DFF44;
}
.explanation-content {
  transition: max-height 0.3s cubic-bezier(0.4,0,0.2,1), opacity 0.3s;
  overflow: hidden;
}

/* 考试题卡悬浮阴影增强 */
.shadow-card-hover {
  transition: box-shadow 0.3s cubic-bezier(0.4,0,0.2,1), transform 0.3s;
  box-shadow: 0 4px 24px -4px #165dff44, 0 2px 8px #36cfc944;
}
.shadow-card-hover:hover {
  box-shadow: 0 16px 48px -8px #165dff66, 0 8px 24px #36cfc966;
  transform: translateY(-1px) scale(1.01);
}

/* 题型徽章样式 */
.exam-type-badge {
  position: absolute;
  top: -14px;
  left: -14px;
  z-index: 2;
  color: #fff;
  font-weight: bold;
  border-radius: 999px;
  padding: 0.25rem 0.8rem;
  font-size: 0.85rem;
  box-shadow: 0 2px 12px #165dff44;
  letter-spacing: 0.1em;
  user-select: none;
  pointer-events: none;
  white-space: nowrap;
}

/* 不同题型颜色 */
.exam-type-badge[data-type="选择题"] {
  background: linear-gradient(90deg, #165DFF 60%, #36CFC9 100%);
  box-shadow: 0 2px 12px #165dff44;
}

.exam-type-badge[data-type="判断题"] {
  background: linear-gradient(90deg, #F59E0B 60%, #F97316 100%);
  box-shadow: 0 2px 12px #f59e0b44;
}

.exam-type-badge[data-type="填空题"] {
  background: linear-gradient(90deg, #10B981 60%, #34D399 100%);
  box-shadow: 0 2px 12px #10b98144;
} 