* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif; background: #f5f7fa; color: #333; line-height: 1.6; }
.container { max-width: 900px; margin: 0 auto; padding: 20px; }
header#toolsHeader { background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); color: white; padding: 12px 16px; text-align: left; transition: padding 0.25s ease; position: relative; z-index: 10; }
header .container { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.header-inner { flex-wrap: wrap; }
header .header-text { min-width: 0; }
header h1 { font-size: 1.25rem; margin-bottom: 2px; line-height: 1.2; }
header p { font-size: 0.85rem; opacity: 0.9; margin: 0; }
header .nav-link { display: inline-flex; align-items: center; padding: 5px 12px; background: rgba(255,255,255,0.2); border-radius: 20px; color: white; text-decoration: none; font-size: 0.8rem; white-space: nowrap; transition: background 0.2s; margin: 0; }
header .nav-link:hover { background: rgba(255,255,255,0.3); }
.header-actions { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.header-toggle { display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; border: 1px solid rgba(255,255,255,0.35); background: rgba(255,255,255,0.15); color: white; border-radius: 6px; cursor: pointer; font-size: 1rem; line-height: 1; transition: all 0.2s; }
.header-toggle:hover { background: rgba(255,255,255,0.25); }
/* 折叠状态 */
#toolsHeader.collapsed { padding-top: 8px; padding-bottom: 8px; }
#toolsHeader.collapsed .header-text p,
#toolsHeader.collapsed .nav-link { display: none; }
#toolsHeader.collapsed h1 { font-size: 1rem; }
@media(max-width: 640px){ #toolsHeader .nav-link { display: none; } #toolsHeader h1 { font-size: 1.05rem; } }

.tool-tabs { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; margin: 30px 0; }
.tool-tab { background: white; border: 2px solid #e2e8f0; border-radius: 12px; padding: 16px; text-align: center; cursor: pointer; transition: all 0.3s; }
.tool-tab:hover { border-color: #667eea; transform: translateY(-2px); box-shadow: 0 4px 12px rgba(102,126,234,0.15); }
.tool-tab.active { border-color: #667eea; background: #f0f4ff; }
.tool-tab .icon { font-size: 1.8rem; margin-bottom: 8px; }
.tool-tab .name { font-size: 0.85rem; font-weight: 600; color: #4a5568; }

.tool-panel { background: white; border-radius: 16px; padding: 30px; box-shadow: 0 4px 20px rgba(0,0,0,0.08); display: none; }
.tool-panel.active { display: block; }
.tool-panel { scroll-margin-top: 80px; }
.tool-panel h2 { font-size: 1.4rem; margin-bottom: 8px; color: #2d3748; }
.tool-panel .desc { color: #718096; margin-bottom: 20px; font-size: 0.9rem; }

.form-group { margin-bottom: 16px; }
.form-group label { display: block; font-weight: 600; margin-bottom: 6px; font-size: 0.9rem; color: #4a5568; }
.form-group input, .form-group select, .form-group textarea { width: 100%; padding: 12px 16px; border: 2px solid #e2e8f0; border-radius: 8px; font-size: 1rem; transition: border-color 0.3s; }
.form-group input:focus, .form-group select:focus, .form-group textarea:focus { outline: none; border-color: #667eea; }
.form-group textarea { resize: vertical; min-height: 80px; }

.btn-primary { background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); color: white; border: none; padding: 14px 28px; border-radius: 8px; font-size: 1rem; font-weight: 600; cursor: pointer; transition: all 0.3s; width: 100%; }
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 6px 20px rgba(102,126,234,0.4); }

.result-box { margin-top: 24px; padding: 20px; background: #f7fafc; border-radius: 12px; border-left: 4px solid #667eea; }
.result-box h3 { font-size: 1.1rem; margin-bottom: 12px; color: #2d3748; }
.result-item { padding: 10px 0; border-bottom: 1px solid #e2e8f0; }
.result-item:last-child { border-bottom: none; }
.result-item .title { font-weight: 600; color: #2d3748; }
.result-item .subtitle { font-size: 0.85rem; color: #718096; margin-top: 4px; }

.copy-btn { background: #48bb78; color: white; border: none; padding: 8px 16px; border-radius: 6px; font-size: 0.85rem; cursor: pointer; margin-top: 12px; transition: all 0.3s; }
.copy-btn:hover { background: #38a169; }

.cta-box { margin-top: 24px; padding: 20px; background: linear-gradient(135deg, #fff5f5 0%, #fffaf0 100%); border-radius: 12px; text-align: center; border: 1px solid #fed7d7; }
.cta-box p { font-size: 0.9rem; color: #4a5568; margin-bottom: 10px; }
.cta-box .highlight { font-weight: 700; color: #e53e3e; font-size: 1.1rem; }

.related-links { margin-top: 30px; padding: 20px; background: white; border-radius: 12px; }
.related-links h3 { font-size: 1rem; margin-bottom: 12px; color: #4a5568; }
.related-links a { display: block; padding: 10px; color: #667eea; text-decoration: none; border-radius: 6px; transition: background 0.3s; }
.related-links a:hover { background: #f0f4ff; }

.calendar-grid { display: grid; gap: 12px; margin-top: 16px; }
.calendar-day { background: white; border: 1px solid #e2e8f0; border-radius: 8px; padding: 14px; }
.calendar-day .day-label { font-weight: 700; color: #667eea; font-size: 0.85rem; margin-bottom: 6px; }
.calendar-day .topic-title { font-weight: 600; color: #2d3748; margin-bottom: 4px; }
.calendar-day .topic-angle { font-size: 0.85rem; color: #718096; }

footer { text-align: center; padding: 30px 20px; color: #718096; font-size: 0.85rem; margin-top: 40px; }
footer a { color: #667eea; text-decoration: none; }
footer a:hover { text-decoration: underline; }

/* AI增强工具区 */
.ai-section-divider { text-align: center; margin: 40px 0 30px; position: relative; }
.ai-section-divider::before { content: ''; position: absolute; top: 50%; left: 0; right: 0; height: 1px; background: linear-gradient(90deg, transparent, #667eea, transparent); }
.ai-section-divider span { position: relative; background: #f5f7fa; padding: 0 20px; font-size: 1.1rem; font-weight: 700; color: #667eea; }
.ai-tool-tabs { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 10px; margin-bottom: 20px; }
.ai-tool-tab { background: white; border: 2px solid #e2e8f0; border-radius: 12px; padding: 14px 10px; text-align: center; cursor: pointer; transition: all 0.3s; position: relative; }
.ai-tool-tab:hover { border-color: #f59e0b; transform: translateY(-2px); box-shadow: 0 4px 12px rgba(245,158,11,0.15); }
.ai-tool-tab.active { border-color: #f59e0b; background: #fffbeb; }
.ai-tool-tab .icon { font-size: 1.5rem; margin-bottom: 6px; }
.ai-tool-tab .name { font-size: 0.8rem; font-weight: 600; color: #4a5568; }
.ai-tool-tab .cost { font-size: 0.7rem; color: #f59e0b; margin-top: 4px; }
.ai-tool-panel { background: white; border-radius: 16px; padding: 30px; box-shadow: 0 4px 20px rgba(0,0,0,0.08); display: none; }
.ai-tool-panel.active { display: block; }
.ai-tool-panel { scroll-margin-top: 80px; }
.ai-tool-panel h2 { font-size: 1.4rem; margin-bottom: 8px; color: #2d3748; }
.ai-tool-panel .desc { color: #718096; margin-bottom: 20px; font-size: 0.9rem; }
.ai-cost-badge { display: inline-flex; align-items: center; gap: 4px; padding: 4px 10px; background: #fffbeb; border: 1px solid #fde68a; border-radius: 20px; color: #d97706; font-size: 0.8rem; font-weight: 600; margin-bottom: 16px; }
.ai-loading { display: none; text-align: center; padding: 30px; color: #718096; }
.ai-loading.show { display: block; }
.ai-loading .spinner { display: inline-block; width: 24px; height: 24px; border: 3px solid #e2e8f0; border-top-color: #667eea; border-radius: 50%; animation: spin 0.8s linear infinite; margin-bottom: 10px; }
@keyframes spin { to { transform: rotate(360deg); } }
.ai-login-notice { background: #fffbeb; border: 1px solid #fde68a; border-radius: 12px; padding: 20px; text-align: center; margin-bottom: 20px; }
.ai-login-notice p { color: #92400e; margin-bottom: 10px; }
.ai-login-notice a { color: #667eea; font-weight: 600; }
.ai-free-badge { display: inline-flex; align-items: center; gap: 4px; padding: 4px 10px; background: #ecfdf5; border: 1px solid #a7f3d0; border-radius: 20px; color: #059669; font-size: 0.8rem; font-weight: 600; margin-left: 8px; }
.ai-stats-bar { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; font-size: 0.85rem; color: #718096; }
.ai-stats-bar .stat { display: flex; align-items: center; gap: 4px; }
.ai-upgrade-box { margin-top: 20px; padding: 16px; background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%); border-radius: 12px; border: 1px solid #fde68a; text-align: center; }
.ai-upgrade-box .utitle { font-weight: 700; color: #92400e; margin-bottom: 6px; }
.ai-upgrade-box .udesc { font-size: 0.85rem; color: #78716c; margin-bottom: 10px; }
.ai-upgrade-box .ubtn { display: inline-block; padding: 8px 20px; background: linear-gradient(135deg, #f59e0b, #d97706); color: white; border-radius: 8px; font-size: 0.85rem; font-weight: 600; cursor: pointer; border: none; text-decoration: none; }
.free-trial-banner { background: linear-gradient(135deg, #ecfdf5, #d1fae5); border: 1px solid #a7f3d0; border-radius: 12px; padding: 16px 20px; text-align: center; margin-bottom: 16px; }
.free-trial-banner p { color: #065f46; font-size: 0.9rem; margin-bottom: 8px; }
.free-trial-banner .btn-login { display: inline-block; padding: 6px 16px; background: #667eea; color: white; border-radius: 6px; font-size: 0.85rem; text-decoration: none; margin-left: 8px; }
.credits-guide { background: #f0f4ff; border: 1px solid #c7d2fe; border-radius: 12px; padding: 16px; margin-top: 16px; }
.credits-guide h4 { color: #4338ca; margin-bottom: 8px; font-size: 0.95rem; }
.credits-guide ul { list-style: none; padding: 0; }
.credits-guide li { padding: 4px 0; font-size: 0.85rem; color: #4a5568; }
.credits-guide li::before { content: '✅ '; }

/* ====== AI家教练习模式样式 ====== */
.tutor-mode-switch {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
}
.tutor-mode-btn {
    padding: 8px 16px;
    border: 2px solid rgba(59, 130, 246, 0.3);
    border-radius: 8px;
    background: rgba(59, 130, 246, 0.05);
    color: #64748b;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.25s;
    font-weight: 500;
}
.tutor-mode-btn:hover {
    border-color: #3b82f6;
    color: #3b82f6;
}
.tutor-mode-btn.active {
    background: #3b82f6;
    border-color: #3b82f6;
    color: white;
    font-weight: 600;
}
.tutor-qa-area, .tutor-practice-area {
    transition: opacity 0.3s;
}
.tutor-practice-area {
    border: 1px dashed rgba(59, 130, 246, 0.2);
    border-radius: 12px;
    padding: 20px;
    background: rgba(59, 130, 246, 0.02);
}
.practice-question-box {
    background: #f0f9ff;
    border: 1px solid #bae6fd;
    border-radius: 10px;
    padding: 16px;
    margin: 12px 0;
    font-size: 0.95rem;
    line-height: 1.8;
    color: #1e3a5f;
}
.practice-question-box .q-label {
    font-size: 0.8rem;
    color: #3b82f6;
    font-weight: 700;
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 1px;
}
.practice-question-box .q-type {
    display: inline-block;
    padding: 3px 10px;
    background: #dbeafe;
    color: #1d4ed8;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    margin-bottom: 8px;
}
.practice-hint {
    margin-top: 10px;
    padding: 10px 14px;
    background: #fffbeb;
    border-left: 3px solid #f59e0b;
    border-radius: 0 8px 8px 0;
    font-size: 0.85rem;
    color: #92400e;
}
.practice-grade-result {
    margin-top: 12px;
    padding: 16px;
    border-radius: 10px;
    border: 1px solid;
}
.practice-grade-result.correct {
    background: #ecfdf5;
    border-color: #6ee7b7;
}
.practice-grade-result.incorrect {
    background: #fef2f2;
    border-color: #fecaca;
}
.practice-grade-result .grade-score {
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: 8px;
}
.practice-grade-result.correct .grade-score { color: #059669; }
.practice-grade-result.incorrect .grade-score { color: #dc2626; }
.practice-grade-result .grade-explain {
    font-size: 0.9rem;
    line-height: 1.7;
    color: #374151;
    margin-bottom: 8px;
}
.practice-grade-result .grade-correct-answer {
    background: rgba(255,255,255,0.6);
    padding: 10px 14px;
    border-radius: 8px;
    font-size: 0.88rem;
    line-height: 1.7;
    color: #1e3a5f;
}
.practice-grade-result .grade-takeaway {
    margin-top: 8px;
    padding: 8px 12px;
    background: rgba(245, 158, 11, 0.08);
    border-radius: 6px;
    font-size: 0.85rem;
    color: #92400e;
}
.practice-grade-result .grade-cheer {
    margin-top: 8px;
    font-size: 0.9rem;
    color: #6366f1;
    font-weight: 500;
}

.site-nav{background:rgba(15,23,42,0.95);backdrop-filter:blur(16px);-webkit-backdrop-filter:blur(16px);border-bottom:1px solid rgba(255,255,255,0.08);position:sticky;top:0;z-index:100;font-family:'Noto Sans SC','Microsoft YaHei',sans-serif}
.site-nav .nav-inner{max-width:1200px;margin:0 auto;padding:0 20px;display:flex;justify-content:space-between;align-items:center}
.site-nav .nav-logo{color:#fff;text-decoration:none;font-size:1.1rem;font-weight:700;background:linear-gradient(135deg,#818cf8,#c084fc,#22d3ee);-webkit-background-clip:text;-webkit-text-fill-color:transparent}
.site-nav ul{display:flex;list-style:none;gap:0.3rem;align-items:center}
.site-nav a{color:rgba(255,255,255,0.8);text-decoration:none;padding:0.5rem 0.7rem;font-size:0.85rem;transition:color 0.3s}
.site-nav a:hover{color:#e0e7ff}
.site-nav li{position:relative}
.site-nav .sub{display:none;position:absolute;background:rgba(15,23,42,0.95);backdrop-filter:blur(20px);min-width:160px;box-shadow:0 8px 32px rgba(0,0,0,0.3);z-index:1;border-radius:10px;top:100%;left:0;border:1px solid rgba(255,255,255,0.12);padding:6px 0}
.site-nav .sub a{display:block;padding:8px 14px;font-size:0.82rem}
.site-nav .sub a:hover{background:rgba(99,102,241,0.15);color:#c7d2fe}
.site-nav li:hover .sub{display:block}
@media(max-width:768px){.site-nav ul{flex-wrap:wrap}}

.tool-cat-pill { padding:10px 16px; min-height:44px; border:1px solid #e2e8f0; background:#fff; border-radius:22px; cursor:pointer; font-size:14px; color:#4a5568; transition:all .2s; display:inline-flex; align-items:center; }
.tool-cat-pill:hover { border-color:#f59e0b; color:#f59e0b; }
.tool-cat-pill.active { background:linear-gradient(135deg,#667eea,#764ba2); color:#fff; border-color:transparent; }
.ai-tool-tab.hidden { display:none; }

/* ====== 工具页导航 header 紧凑化 ====== */
/* 工具页是操作面板，导航 header 需要尽量紧凑，留出空间给工具操作区 */
header:not(#toolsHeader) {
    padding: 0.25rem 0;
}
header:not(#toolsHeader) .logo {
    font-size: 1.15rem;
}
header:not(#toolsHeader) nav a {
    font-size: 0.8rem;
    padding: 0.3rem 0.5rem;
}
header:not(#toolsHeader) .submenu-trigger {
    font-size: 0.8rem;
    padding: 0.3rem 0.5rem;
}
@media (max-width: 768px) {
    header:not(#toolsHeader) .header-content {
        min-height: 40px;
    }
    header:not(#toolsHeader) .logo {
        font-size: 1.05rem;
    }
}
