/* ===== 启田美学 - 公共样式表 ===== */
/* 所有页面共享的通用样式，从各页面内联<style>中提取 */

/* ===== 全局重置 ===== */
* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 80px; }
body { font-family: var(--font-family-base); line-height: 1.6; color: var(--text-secondary); overflow-x: hidden; width: 100%; position: relative; }
img { max-width: 100%; height: auto; display: block; }
a { color: var(--primary-color); text-decoration: none; }
ul { list-style: none; }

/* ===== 无障碍焦点样式 ===== */
:focus-visible { outline: 2px solid var(--qt-blue); outline-offset: 2px; }
:focus:not(:focus-visible) { outline: none; }

/* ===== 容器 ===== */
.container { max-width: 1200px; margin: 0 auto; padding: 0 20px; }

/* ===== 导航栏 ===== */
header { position: fixed; top: 0; left: 0; right: 0; height: 80px; z-index: 1000; transition: background var(--transition-base), box-shadow var(--transition-base), height var(--transition-base); background: rgba(26, 41, 66, 0.95); }
header.scrolled { background: rgba(255,255,255,0.95); backdrop-filter: blur(10px); box-shadow: var(--shadow-md); }
header.scrolled nav ul li a { color: var(--text-primary); }
header.scrolled .logo-img { filter: none; }
header.scrolled .btn-primary { background: var(--accent-color); color: white; }
.header-inner { display: flex; align-items: center; padding: 0 20px; height: 80px; max-width: 1200px; margin: 0 auto; gap: 30px; }
.logo { display: flex; align-items: center; flex-shrink: 0; }
.logo a { display: flex; align-items: center; text-decoration: none; }
.logo-img { height: 40px; width: auto; transition: transform 0.3s; }
.logo-img:hover { transform: scale(1.05); }
nav { display: flex; align-items: center; margin-left: auto; flex: 1; justify-content: flex-end; }
nav ul { list-style: none; display: flex; gap: 20px; flex-wrap: nowrap; }
nav ul li a { color: white; text-decoration: none; font-weight: 500; transition: color 0.3s; font-size: 14px; white-space: nowrap; }
nav ul li a:hover { color: var(--accent-color); }
nav ul li a.active { color: var(--accent-color); }
.menu-toggle { display: none; cursor: pointer; color: white; font-size: 24px; flex-shrink: 0; border: none; background: none; padding: 0; line-height: 1; }
header.scrolled .menu-toggle { color: var(--text-primary); }

/* ===== 移动端菜单关闭按钮 ===== */
.nav-close-btn {
    display: none;
    position: absolute;
    top: 16px;
    right: 16px;
    width: 36px;
    height: 36px;
    background: rgba(255,255,255,0.15);
    border: none;
    border-radius: var(--radius-md);
    font-size: 18px;
    color: white;
    cursor: pointer;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
    z-index: 10;
}
.nav-close-btn:hover {
    background: rgba(255,255,255,0.25);
}
header.scrolled .nav-close-btn,
nav.active .nav-close-btn {
    color: var(--text-primary);
    background: var(--bg-light);
}
header.scrolled .nav-close-btn:hover,
nav.active .nav-close-btn:hover {
    background: var(--border-light);
}
@media (max-width: 768px) {
    nav.active .nav-close-btn {
        display: flex;
    }
}

/* ===== 按钮系统 ===== */
.btn-primary,
.btn-secondary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 28px;
    height: 44px;
    border-radius: var(--radius-md);
    text-decoration: none;
    font-weight: 500;
    font-size: 16px;
    transition: 
        transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1),
        background 0.3s ease,
        box-shadow 0.3s ease,
        opacity 0.3s ease;
    border: none;
    cursor: pointer;
    flex-shrink: 0;
    margin-left: 10px;
    position: relative;
    overflow: hidden;
    box-sizing: border-box;
}
.btn-primary {
    background: var(--accent-color);
    color: white;
    border: none;
}
.btn-primary:hover {
    transform: scale(1.05);
    background: var(--accent-hover);
    box-shadow: 0 6px 20px rgba(255, 184, 0, 0.3);
}
.btn-primary:active {
    transform: scale(0.97);
    box-shadow: 0 2px 8px rgba(255, 184, 0, 0.2);
}
.btn-primary.loading,
.btn-primary:disabled,
.btn-primary.disabled {
    pointer-events: none;
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}
.btn-primary.loading::after {
    content: '';
    display: inline-block;
    width: 14px;
    height: 14px;
    margin-left: 8px;
    border: 2px solid rgba(255,255,255,0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: btn-spin 0.8s linear infinite;
}
@keyframes btn-spin {
    to { transform: rotate(360deg); }
}

.btn-secondary {
    background: transparent;
    color: white;
    border: 2px solid white;
    margin-left: 0;
}
.btn-secondary:hover { background: white; color: var(--primary-color); }

/* ===== 节（Section）通用 ===== */
.section { padding: 80px 0; }
.section-title { text-align: center; margin-bottom: 60px; }
.section-title h2 { font-size: 32px; color: var(--text-primary); margin-bottom: 15px; }
.section-title p { font-size: 16px; color: var(--cool-gray-9); }
section { padding: 60px 0; }
.banner, .hero { padding: 0; }

/* ===== 页脚 ===== */
footer {
    background: var(--secondary-color);
    color: white;
    padding: 60px 0 50px;
    -webkit-font-smoothing: antialiased;
}
.footer-content {
    display: grid;
    grid-template-columns: 1.2fr 1.8fr 1.2fr 1.8fr 1.8fr;
    gap: 20px;
}
.footer-section h4 { margin-bottom: 14px; font-size: 15px; text-wrap: balance; }
.footer-section ul { list-style: none; }
.footer-section ul li { margin-bottom: 8px; }
.footer-section ul li a {
    color: rgba(255,255,255,0.65);
    text-decoration: none;
    font-size: 13px;
    transition: color 0.3s, transform 0.15s;
    white-space: nowrap;
    display: inline-block;
}
.footer-section ul li a:hover { color: var(--qt-yellow); }
.footer-section ul li a:active { transform: scale(0.96); }
.footer-section.multi-col-3 ul { column-count: 3; column-gap: 12px; }

.footer-section.multi-col-3 ul li { break-inside: avoid; margin-bottom: 8px; }
.footer-section .address { font-size: 13px; color: rgba(255,255,255,0.65); line-height: 1.6; }
.footer-section .address .phone { color: var(--qt-yellow); font-weight: 500; }
.footer-bottom { text-align: center; padding-top: 22px; border-top: 1px solid rgba(255,255,255,0.1); font-size: 12px; color: rgba(255,255,255,0.65); }
.footer-bottom p { margin-bottom: 10px; line-height: 1.5; text-align: center; }
.footer-bottom p:last-child { white-space: nowrap; display: flex; align-items: center; justify-content: center; gap: 0; }
.footer-bottom p:last-child a { display: inline-flex; align-items: center; gap: 4px; }
.footer-bottom p:last-child a img { display: block; flex-shrink: 0; }

/* ===== 响应式：导航栏 + 页脚（1024px） ===== */
/* ===== 响应式：大屏 (1200px) ===== */
@media (max-width: 1200px) {
    .header-inner { padding: 12px 15px; gap: 20px; }
    nav ul { gap: 15px; }
    nav ul li a { font-size: 13px; }
    .btn-primary, .btn-secondary { padding: 10px 20px; font-size: 13px; height: 40px; }
}

/* ===== 响应式：平板横屏 (1024px) ===== */
@media (max-width: 1024px) {
    .footer-content { grid-template-columns: repeat(3, 1fr); gap: 20px; }
    .footer-section.multi-col-3 ul { column-count: 2; }
    nav ul { gap: 10px; }
    nav ul li a { font-size: 12px; }
    .btn-primary, .btn-secondary { padding: 8px 16px; font-size: 12px; height: 38px; }
    .logo span { font-size: 20px; }
    .logo span:last-child { font-size: 12px; }
}

/* ===== 响应式：平板竖屏/移动端横屏 (768px) ===== */
@media (max-width: 768px) {
    header { height: 60px; }
    .header-inner { height: 60px; }
    nav ul { display: none; }
    .menu-toggle { display: block; }
    nav.active ul {
        display: flex;
        flex-direction: column;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: white;
        padding: 20px;
        box-shadow: var(--shadow-md);
    }
    nav.active ul li { margin-bottom: 15px; }
    nav.active ul li a { color: var(--text-primary); font-size: 14px; }
    .footer-content { grid-template-columns: repeat(2, 1fr); gap: 20px; }
    .footer-section.multi-col-3 ul { column-count: 1; }
}

/* ===== 移动端触摸设备：hover遮罩层显示为点击切换 ===== */
@media (hover: none) and (pointer: coarse) {
    .classroom-item .overlay,
    .gallery-item .overlay,
    .work-item .overlay,
    .certificate-item .overlay {
        opacity: 0;
        transition: opacity 0.3s;
    }
    .classroom-item .overlay.touch-active,
    .gallery-item .overlay.touch-active,
    .work-item .overlay.touch-active,
    .certificate-item .overlay.touch-active {
        opacity: 1;
    }
}

/* ===== 响应式：移动端 (600px) ===== */
@media (max-width: 600px) {
    .footer-content { grid-template-columns: repeat(2, 1fr); gap: 16px; }
}

/* ===== 响应式：小屏移动端 (480px) ===== */
@media (max-width: 480px) {
    .footer-content { grid-template-columns: 1fr; gap: 16px; }
}

/* ===== 响应式：超小屏移动端 (320px) ===== */
@media (max-width: 320px) {
    .header-inner { padding: 10px 12px; }
    .logo span { font-size: 18px; }
    .logo span:last-child { font-size: 11px; }
    .btn-primary { padding: 6px 12px; font-size: 11px; }
    nav.active ul { padding: 16px; }
    nav.active ul li a { font-size: 13px; }
    .footer-content { grid-template-columns: 1fr; gap: 12px; }
    .footer-section h4 { font-size: 13px; }
    .footer-section ul li a { font-size: 12px; white-space: normal; }
    .footer-section .address { font-size: 12px; }
    .footer-bottom p:last-child { white-space: normal; flex-direction: column; gap: 4px; }
    .container { padding: 0 12px; }
    section { padding: 30px 0; }
    .section-title h2 { font-size: 20px; }
    .section-title p { font-size: 13px; }
}

/* ===== 内容居中对齐组件 ===== */
.content-centered { text-align: center; }
.content-centered p { text-align: center; }
.content-centered .section-subtitle { text-align: center; }
.content-centered blockquote { text-align: left; }

/* ===== 表单验证样式 ===== */
.form-field { display: flex; flex-direction: column; flex: 1; position: relative; }
.field-error { font-size: 12px; color: var(--error); margin-top: 4px; min-height: 16px; display: block; }
.field-error:empty { display: none; }
.form-field input,
.form-field select,
.form-field textarea {
    transition: border-color 0.3s ease, box-shadow 0.3s ease, background-color 0.3s ease;
}
.form-field input:focus,
.form-field select:focus,
.form-field textarea:focus {
    border-color: var(--qt-blue);
    box-shadow: 0 0 0 4px rgba(123, 159, 211, 0.15);
    background-color: white;
    outline: none;
}
.form-field input.invalid,
.form-field select.invalid {
    border-color: var(--error) !important;
    box-shadow: 0 0 0 4px rgba(231, 76, 60, 0.1) !important;
    animation: input-shake 0.4s ease;
}
.form-field input.valid,
.form-field select.valid {
    border-color: var(--success) !important;
    box-shadow: 0 0 0 4px rgba(82, 196, 26, 0.1) !important;
}
@keyframes input-shake {
    0%, 100% { transform: translateX(0); }
    20% { transform: translateX(-4px); }
    40% { transform: translateX(4px); }
    60% { transform: translateX(-4px); }
    80% { transform: translateX(4px); }
}
.form-feedback { text-align: center; padding: 12px; border-radius: var(--radius-md); margin-top: 15px; font-size: 14px; display: none; }
.form-feedback.success { display: block; background: var(--light-bg-color); color: var(--success); border: 1px solid var(--success); }
.form-feedback.error { display: block; background: var(--light-bg-color); color: var(--error); border: 1px solid var(--error); }

/* ===== 滚动进度指示器 ===== */
.scroll-progress {
    position: fixed;
    top: 0;
    left: 0;
    width: 0%;
    height: var(--scroll-progress-height, 3px);
    background: linear-gradient(90deg, var(--qt-blue), var(--qt-orange));
    z-index: 10000;
    transition: width 0.1s linear;
    box-shadow: 0 0 8px rgba(123, 159, 211, 0.5);
}

/* ===== Toast通知组件 ===== */
.toast-container {
    position: fixed;
    top: calc(var(--header-height, 80px) + 16px);
    right: 16px;
    z-index: 10001;
    display: flex;
    flex-direction: column;
    gap: 12px;
    pointer-events: none;
}
.toast {
    min-width: 280px;
    max-width: 400px;
    padding: 14px 18px;
    background: white;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    display: flex;
    align-items: flex-start;
    gap: 12px;
    pointer-events: auto;
    animation: toast-in 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    border-left: 4px solid;
}
.toast.success { border-left-color: var(--success); }
.toast.warning { border-left-color: var(--warning); }
.toast.error { border-left-color: var(--error); }
.toast-icon {
    flex-shrink: 0;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    color: white;
}
.toast.success .toast-icon { background: var(--success); }
.toast.warning .toast-icon { background: var(--warning); }
.toast.error .toast-icon { background: var(--error); }
.toast-content {
    flex: 1;
    font-size: var(--font-size-small);
    color: var(--text-primary);
    line-height: 1.5;
}
.toast-close {
    flex-shrink: 0;
    width: 24px;
    height: 24px;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-muted);
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s;
}
.toast-close:hover { color: var(--text-primary); }
.toast.hiding { animation: toast-out 0.3s ease forwards; }
@keyframes toast-in {
    from { opacity: 0; transform: translateX(100%) scale(0.9); }
    to { opacity: 1; transform: translateX(0) scale(1); }
}
@keyframes toast-out {
    from { opacity: 1; transform: translateX(0) scale(1); }
    to { opacity: 0; transform: translateX(100%) scale(0.9); }
}
@media (max-width: 480px) {
    .toast-container { left: 16px; right: 16px; }
    .toast { min-width: auto; max-width: none; }
}