/* 顶栏导航 */
.topnav {
    position: sticky;
    top: 0;
    z-index: 20;
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 16px;
    padding: 12px 8px;
    background: rgba(255,255,255,0.9);
    backdrop-filter: blur(8px);
    border-radius: 0 0 14px 14px;
    box-shadow: 0 6px 20px rgba(0,0,0,0.06);
    margin-bottom: 10px;
}
.brand {
    display: flex; align-items: center; gap: 10px; padding-left: 6px;
}
.brand-mark { font-size: 1.4rem; line-height: 1; }
.brand-title { font-weight: 700; color: #2c3e50; font-size: 1.1rem; }

.nav-links { display: flex; align-items: center; gap: 14px; justify-content: center; }
.nav-link { color: #5b6c84; text-decoration: none; padding: 8px 12px; border-radius: 12px; transition: .2s; }
.nav-link:hover { background: #eef2ff; color: #3b5bfd; }
.nav-link.active { background: #eef2ff; color: #3b5bfd; font-weight: 600; }
.menu-toggle { background: none; border: none; font-size: 1.4rem; cursor: pointer; color: #2c3e50; padding: 8px 12px; border-radius: 10px; }
.menu-toggle:hover { background: #f3f6ff; }

/* 首页特定样式 */

/* 英雄区 */
.hero {
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    align-items: center;
    gap: 40px;
    padding: 10px 0 30px 0;
}

.hero-title {
    font-size: 2.4rem;
    line-height: 1.25;
    color: #2c3e50;
    margin-bottom: 16px;
    letter-spacing: 1px;
}

.gradient-text {
    background: linear-gradient(135deg, #4476ff 0%, #5e9bff 40%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-subtitle {
    color: #6b7a90;
    font-size: 1.05rem;
    margin-bottom: 24px;
}

.hero-cta {
    padding: 14px 28px;
}

.hero-visual {
    display: flex;
    justify-content: center;
    align-items: center;
}

.orbit {
    position: relative;
    width: 300px;
    height: 300px;
    filter: drop-shadow(0 10px 25px rgba(102, 126, 234, 0.25));
}

.orbit-center {
    position: absolute;
    left: 50%;
    top: 50%;
    width: 18px;
    height: 18px;
    background: #20c997; /* 绿色点 */
    border-radius: 50%;
    transform: translate(-50%, -50%);
    box-shadow: 0 0 0 8px rgba(32, 201, 151, 0.1), 0 0 25px rgba(32, 201, 151, 0.5);
}

.orbit-rings {
    width: 100%;
    height: 100%;
}

.rotate-slow {
    transform-origin: 150px 150px;
    animation: orbitRotate 12s linear infinite;
}

@keyframes orbitRotate {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* 当鼠标悬停放大轻微加速 */
.orbit:hover .rotate-slow {
    animation-duration: 9s;
}

/* 测试分类区域 */
.test-categories {
    margin-top: 10px;
    margin-bottom: 50px;
}

.section-title {
    text-align: center;
    font-size: 2rem;
    color: #2c3e50;
    margin-bottom: 40px;
    font-weight: 600;
}

.category-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 30px;
    margin-bottom: 40px;
}

.category-card {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 20px;
    padding: 30px;
    text-align: center;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    transition: all 0.3s ease;
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.category-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    transform: scaleX(0);
    transition: transform 0.3s ease;
}

.category-card:hover::before {
    transform: scaleX(1);
}

.category-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.15);
}

.card-icon {
    font-size: 3rem;
    margin-bottom: 20px;
    display: block;
}

.category-card h3 {
    font-size: 1.4rem;
    color: #2c3e50;
    margin-bottom: 15px;
    font-weight: 600;
}

.category-card p {
    color: #7f8c8d;
    line-height: 1.6;
    margin-bottom: 25px;
    font-size: 0.95rem;
}

.card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 20px;
    border-top: 1px solid #ecf0f1;
}

.question-count,
.time-estimate {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 6px 12px;
    border-radius: 15px;
    font-size: 0.85rem;
    font-weight: 500;
}

/* 测试记录区域 */
.test-history-section {
    margin-bottom: 40px;
}

.history-card {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 20px;
    padding: 25px 30px;
    display: flex;
    align-items: center;
    gap: 20px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    transition: all 0.3s ease;
}

.history-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15);
}

.history-icon {
    font-size: 2.5rem;
    color: #667eea;
}

.history-content {
    flex: 1;
}

.history-content h3 {
    font-size: 1.3rem;
    color: #2c3e50;
    margin-bottom: 8px;
    font-weight: 600;
}

.history-content p {
    color: #7f8c8d;
    font-size: 0.95rem;
    margin: 0;
}

.history-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 25px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.history-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.6);
}

/* 测试记录模态框内容 */
.history-controls {
    margin-bottom: 25px;
    text-align: right;
}

.clear-all-btn {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 20px;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.clear-all-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(240, 147, 251, 0.4);
}

.history-list {
    max-height: 400px;
    overflow-y: auto;
}

.history-item {
    background: #f8f9fa;
    border-radius: 15px;
    padding: 20px;
    margin-bottom: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.3s ease;
}

.history-item:hover {
    background: #e9ecef;
    transform: translateX(5px);
}

.history-info {
    flex: 1;
}

.history-test-name {
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 5px;
    font-size: 1.1rem;
}

.history-test-time {
    color: #7f8c8d;
    font-size: 0.9rem;
    margin-bottom: 8px;
}

.history-test-result {
    color: #667eea;
    font-size: 0.9rem;
    font-weight: 500;
}

.delete-history-btn {
    background: #e74c3c;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-left: 15px;
}

.delete-history-btn:hover {
    background: #c0392b;
    transform: scale(1.05);
}

.empty-history {
    text-align: center;
    padding: 40px 20px;
    color: #7f8c8d;
}

.empty-history-icon {
    font-size: 3rem;
    margin-bottom: 20px;
    opacity: 0.5;
}

/* 卡片与按钮风格升级 */
.category-card {
    border-radius: 22px;
    box-shadow: 0 12px 40px rgba(20, 25, 41, 0.06), 0 4px 10px rgba(20,25,41,0.04);
}
.start-card-btn {
    margin-top: 18px;
    width: 100%;
    padding: 12px 16px;
    border-radius: 14px;
    border: none;
    background: linear-gradient(135deg, #3b82f6 0%, #6366f1 100%);
    color: #fff;
    font-weight: 600;
    box-shadow: 0 8px 24px rgba(59, 130, 246, 0.35);
    cursor: pointer;
    transition: transform .15s ease, box-shadow .2s ease;
}
.start-card-btn:hover { transform: translateY(-2px); box-shadow: 0 12px 30px rgba(59,130,246,.45); }
.start-card-btn:active { transform: translateY(0); }

/* 分类标题靠左，贴合参考 */
.test-categories .section-title { text-align: left; padding-left: 4px; }

/* 英雄区垂直堆叠布局 */
.hero.hero-stack {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 18px;
    padding: 10px 0 18px 0;
}
.hero-actions { display:flex; gap: 12px; justify-content: center; }
.hero-history { background:#fff; color:#334155; border:1px solid #cbd5e1; }

/* 移除首页记录卡片相关占位（如果仍有残留，以下保持通用样式不影响） */
.test-history-section { display: none; }

/* 响应式设计 */
@media (max-width: 992px) {
    .hero {
        grid-template-columns: 1fr;
        gap: 24px;
        text-align: center;
    }
    .hero-visual { order: -1; }
}

/* 小屏导航适配（修复：不再隐藏导航项） */
@media (max-width: 768px) {
    .topnav { grid-template-columns: auto 1fr auto; padding: 10px 8px; }
    .nav-links{ display:flex; gap:8px; overflow-x:auto; -webkit-overflow-scrolling:touch; scrollbar-width:none; }
    .nav-links::-webkit-scrollbar{ display:none; }
    .nav-link{ padding:6px 10px; font-size:.95rem; white-space:nowrap; }
    .menu-toggle{ display:none; }
}

@media (max-width: 480px) {
    .category-card { padding: 20px 15px; }
    .card-icon { font-size: 2rem; }
    .section-title { font-size: 1.6rem; }
    .history-item { flex-direction: column; text-align: center; gap: 15px; }
    .delete-history-btn { margin-left: 0; }
}
