/* 全局样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #F57C00;
    --secondary-color: #FFB300;
    --accent-color: #FFD54F;
    --text-dark: #1f2937;
    --text-light: #6b7280;
    --bg-light: #FFFDF7;
    --white: #ffffff;
    --shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    --transition: all 0.3s ease;
    --success-color: #4CAF50;
    --warning-color: #FF9800;
    --error-color: #F44336;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
    line-height: 1.6;
    color: var(--text-dark);
    overflow-x: hidden;
}

html {
    scroll-behavior: smooth;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* 导航栏 */
.navbar {
    position: fixed;
    top: 0;
    width: 100%;
    background: var(--white);
    box-shadow: var(--shadow);
    z-index: 1000;
    transition: var(--transition);
}

.navbar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 20px;
}

.logo {
    font-size: 1.5rem;
    font-weight: bold;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 2rem;
}

.nav-menu a {
    text-decoration: none;
    color: var(--text-dark);
    font-weight: 500;
    transition: var(--transition);
    position: relative;
}

.nav-menu a::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--primary-color);
    transition: var(--transition);
}

.nav-menu a:hover::after {
    width: 100%;
}

.hamburger {
    display: none;
    flex-direction: column;
    cursor: pointer;
    gap: 5px;
}

.hamburger span {
    width: 25px;
    height: 3px;
    background: var(--text-dark);
    transition: var(--transition);
}

/* 主页部分 */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    background: linear-gradient(135deg, #F57C00 0%, #FFB300 100%);
    padding: 100px 20px 50px;
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    width: 500px;
    height: 500px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    top: -200px;
    right: -200px;
    animation: float 6s ease-in-out infinite;
}

.hero-content {
    flex: 1;
    color: var(--white);
    z-index: 1;
    padding-left: 2rem;
}

.hero-title {
    font-size: 3.5rem;
    margin-bottom: 1rem;
    animation: fadeInUp 1s ease;
}

.hero-subtitle {
    font-size: 1.5rem;
    margin-bottom: 2rem;
    opacity: 0.9;
    animation: fadeInUp 1s ease 0.2s backwards;
}

.hero-image {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1;
}

.floating-card {
    background: var(--white);
    padding: 3rem;
    border-radius: 20px;
    box-shadow: var(--shadow);
    text-align: center;
    animation: float 3s ease-in-out infinite;
}

.card-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
}

.floating-card h3 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
    color: var(--text-dark);
}

.floating-card p {
    color: var(--text-light);
}

.hero-text-content {
    background: var(--white);
    padding: 3rem;
    border-radius: 20px;
    box-shadow: var(--shadow);
    max-width: 500px;
    animation: float 3s ease-in-out infinite;
}

.hero-text-content h3 {
    font-size: 1.8rem;
    margin-bottom: 1.5rem;
    color: var(--primary);
    font-weight: 600;
}

.hero-text-content p {
    font-size: 1rem;
    line-height: 1.6;
    margin-bottom: 1rem;
    color: var(--text-dark);
}

.hero-text-content p:last-child {
    margin-bottom: 0;
    font-size: 0.9rem;
    color: var(--text-light);
}

/* Logo区域样式 */
.logo-section {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 2rem;
    margin: 2rem 0 0 0;
    animation: fadeInUp 1s ease 0.6s backwards;
}

.logo-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

.logo-image {
    width: 80px;
    height: 80px;
    object-fit: contain;
    border-radius: 50%;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease;
}

.logo-image:hover {
    transform: scale(1.1);
}

.logo-text {
    font-size: 0.9rem;
    color: var(--text-dark);
    font-weight: 500;
}

/* 按钮 */
.btn-primary {
    padding: 1rem 2.5rem;
    background: var(--white);
    color: var(--primary-color);
    border: none;
    border-radius: 50px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: var(--shadow);
    animation: fadeInUp 1s ease 0.4s backwards;
}

.btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.2);
}

.btn-secondary {
    padding: 0.8rem 2rem;
    background: transparent;
    color: var(--primary-color);
    border: 2px solid var(--primary-color);
    border-radius: 50px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

.btn-secondary:hover {
    background: var(--primary-color);
    color: var(--white);
}

/* 上传检测部分 */
.upload-section {
    padding: 5rem 20px;
    background: var(--bg-light);
}

.section-title {
    font-size: 2.5rem;
    text-align: center;
    margin-bottom: 3rem;
    position: relative;
    color: var(--text-dark);
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 4px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    border-radius: 2px;
}

/* 上传区域 */
.upload-area {
    max-width: 600px;
    margin: 0 auto;
    border: 3px dashed var(--accent-color);
    border-radius: 20px;
    padding: 3rem;
    text-align: center;
    background: var(--white);
    transition: var(--transition);
    cursor: pointer;
}

.upload-area:hover {
    border-color: var(--primary-color);
    background: #f8f9fa;
}

.upload-area.dragover {
    border-color: var(--primary-color);
    background: #e8f5e8;
}

.upload-content {
    pointer-events: none;
}

.upload-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
}

.upload-area h3 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    color: var(--text-dark);
}

.upload-area p {
    color: var(--text-light);
    margin-bottom: 2rem;
}

/* 图片预览 */
.image-preview {
    max-width: 800px;
    margin: 2rem auto;
    background: var(--white);
    border-radius: 15px;
    padding: 2rem;
    box-shadow: var(--shadow);
    display: none; /* 默认隐藏 */
}

.image-preview.show {
    display: block !important; /* 强制显示 */
}

.image-preview h3 {
    text-align: center;
    margin-bottom: 2rem;
    color: var(--text-dark);
}

.preview-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2rem;
}

.preview-container img {
    max-width: 100%;
    max-height: 400px;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.preview-actions {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    justify-content: center;
}

/* 加载状态 */
.loading-state {
    text-align: center;
    padding: 3rem;
    background: var(--white);
    border-radius: 15px;
    box-shadow: var(--shadow);
    max-width: 400px;
    margin: 2rem auto;
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid var(--bg-light);
    border-top: 4px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 1rem;
}

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

/* 分析结果 */
.analysis-result {
    max-width: 1000px;
    margin: 2rem auto;
    background: var(--white);
    border-radius: 15px;
    padding: 2rem;
    box-shadow: var(--shadow);
}

.analysis-result h3 {
    text-align: center;
    margin-bottom: 2rem;
    color: var(--text-dark);
    font-size: 1.8rem;
}

.result-content {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.result-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    padding: 1.5rem;
    background: var(--bg-light);
    border-radius: 10px;
}

.result-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.label {
    font-weight: 600;
    color: var(--text-light);
    margin-bottom: 0.5rem;
}

.classification {
    font-size: 1.2rem;
    font-weight: bold;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    background: var(--warning-color);
    color: var(--white);
}

.classification.normal {
    background: var(--success-color);
}

.confidence {
    font-size: 1.1rem;
    font-weight: bold;
    color: var(--primary-color);
}

.quality {
    font-size: 1rem;
    font-weight: bold;
    padding: 0.3rem 0.8rem;
    border-radius: 15px;
    background: var(--accent-color);
    color: var(--white);
}

.result-images {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
    max-width: 600px;
    margin: 0 auto;
}

.image-container {
    text-align: center;
}

.image-container h4 {
    margin-bottom: 1rem;
    color: var(--text-dark);
}

.image-container img {
    max-width: 100%;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

/* 口腔区域信息样式 */
.mouth-info {
    background: var(--bg-light);
    border-radius: 10px;
    padding: 1.5rem;
    text-align: left;
}

.info-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0;
    border-bottom: 1px solid #e5e7eb;
}

.info-item:last-child {
    border-bottom: none;
}

.info-label {
    font-weight: 600;
    color: var(--text-light);
    min-width: 120px;
}

.info-value {
    font-weight: bold;
    color: var(--primary-color);
}

.info-value.success {
    color: var(--success-color);
}

.info-value.error {
    color: var(--error-color);
}

.recommendations {
    background: #fff3cd;
    border: 1px solid #ffeaa7;
    border-radius: 10px;
    padding: 1.5rem;
}

.recommendations h4 {
    margin-bottom: 1rem;
    color: var(--text-dark);
}

.recommendations ul {
    list-style: none;
    padding-left: 0;
}

.recommendations li {
    padding: 0.5rem 0;
    border-bottom: 1px solid #ffeaa7;
}

.recommendations li:last-child {
    border-bottom: none;
}

.quality-details {
    background: var(--bg-light);
    border-radius: 10px;
    padding: 1.5rem;
}

.quality-details h4 {
    margin-bottom: 1rem;
    color: var(--text-dark);
}

.quality-metrics {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

.metric {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem;
    background: var(--white);
    border-radius: 5px;
}

.metric-label {
    font-weight: 600;
    color: var(--text-light);
}

.metric-value {
    font-weight: bold;
    color: var(--primary-color);
}

/* 错误提示 */
.error-message {
    max-width: 500px;
    margin: 2rem auto;
    background: #f8d7da;
    border: 1px solid #f5c6cb;
    border-radius: 10px;
    padding: 2rem;
    text-align: center;
}

.error-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.error-message p {
    color: #721c24;
    margin-bottom: 1.5rem;
    font-weight: 500;
}

/* 关于部分 */
.about {
    padding: 5rem 20px;
    background: var(--white);
}

.about-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: center;
}

.about-text h3 {
    font-size: 1.8rem;
    margin-bottom: 1rem;
    color: var(--text-dark);
}

.about-text p {
    color: var(--text-light);
    margin-bottom: 1rem;
    font-size: 1.1rem;
}

.features-list {
    margin-top: 2rem;
}

.feature-item {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.feature-icon {
    font-size: 2rem;
    flex-shrink: 0;
}

.feature-item h4 {
    font-size: 1.2rem;
    margin-bottom: 0.5rem;
    color: var(--text-dark);
}

.feature-item p {
    color: var(--text-light);
    font-size: 1rem;
}

.about-image .image-placeholder {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    border-radius: 20px;
    height: 400px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.placeholder-icon {
    font-size: 8rem;
}

/* 联系部分 */
.contact {
    padding: 5rem 20px;
    background: var(--bg-light);
}

.contact-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    margin-bottom: 2rem;
}

.contact-info h3 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    color: var(--text-dark);
}

.contact-info p {
    color: var(--text-light);
    margin-bottom: 2rem;
}

.contact-methods {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.contact-method {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: var(--white);
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.method-icon {
    font-size: 1.5rem;
}

.contact-form {
    background: var(--white);
    padding: 2rem;
    border-radius: 15px;
    box-shadow: var(--shadow);
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 1rem;
    border: 2px solid #e5e7eb;
    border-radius: 10px;
    font-size: 1rem;
    font-family: inherit;
    transition: var(--transition);
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
}

.contact-form .btn-primary {
    width: 100%;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: var(--white);
}

.form-message {
    margin-top: 1rem;
    padding: 1rem;
    border-radius: 10px;
    text-align: center;
    display: none;
}

.form-message.success {
    background: #d1fae5;
    color: #065f46;
    display: block;
}

.form-message.error {
    background: #fee2e2;
    color: #991b1b;
    display: block;
}

/* 页脚 */
.footer {
    background: var(--text-dark);
    color: var(--white);
    padding: 2rem 20px;
    text-align: center;
}

.footer .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.social-links {
    display: flex;
    gap: 1rem;
}

.social-links a {
    font-size: 1.5rem;
    transition: var(--transition);
}

.social-links a:hover {
    transform: scale(1.2);
}

/* 动画 */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes float {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-20px);
    }
}

/* 响应式设计 */
@media (max-width: 768px) {
    .hamburger {
        display: flex;
    }

    .nav-menu {
        position: fixed;
        left: -100%;
        top: 70px;
        flex-direction: column;
        background: var(--white);
        width: 100%;
        text-align: center;
        transition: var(--transition);
        box-shadow: var(--shadow);
        padding: 2rem 0;
    }

    .nav-menu.active {
        left: 0;
    }

    .hero {
        flex-direction: column;
        text-align: center;
        padding-top: 120px;
        padding-bottom: 80px; /* 增加底部padding给白色框留空间 */
    }

    .hero-title {
        font-size: 2rem;
    }

    .hero-subtitle {
        font-size: 1.2rem;
    }

    /* 手机端白色框样式调整 */
    .hero-text-content {
        margin-top: 2rem; /* 增加顶部间距 */
        padding: 2rem; /* 减少内边距 */
        max-width: 90%; /* 调整宽度 */
    }

    .hero-text-content h3 {
        font-size: 1.5rem; /* 调整标题大小 */
        margin-bottom: 1rem;
    }

    .hero-text-content p {
        font-size: 0.9rem; /* 调整文字大小 */
        margin-bottom: 0.8rem;
    }

    .about-content {
        grid-template-columns: 1fr;
    }

    .contact-content {
        grid-template-columns: 1fr;
    }

    .result-images {
        grid-template-columns: 1fr;
    }

    .result-summary {
        grid-template-columns: 1fr;
    }

    .quality-metrics {
        grid-template-columns: 1fr;
    }

    .footer .container {
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .hero-title {
        font-size: 1.8rem;
    }

    .section-title {
        font-size: 2rem;
    }

    .floating-card {
        padding: 2rem;
    }

    .upload-area {
        padding: 2rem;
    }

    .preview-actions {
        flex-direction: column;
        align-items: center;
    }

    /* 小屏幕白色框进一步调整 */
    .hero-text-content {
        margin-top: 3rem; /* 进一步增加顶部间距 */
        padding: 1.5rem; /* 进一步减少内边距 */
        max-width: 95%; /* 进一步调整宽度 */
    }

    .hero-text-content h3 {
        font-size: 1.3rem; /* 进一步调整标题大小 */
        margin-bottom: 0.8rem;
    }

    .hero-text-content p {
        font-size: 0.85rem; /* 进一步调整文字大小 */
        margin-bottom: 0.7rem;
    }

    .logo-section {
        flex-direction: column;
        gap: 1rem;
        margin: 1.5rem 0;
    }

    .logo-image {
        width: 70px;
        height: 70px;
    }

    .logo-text {
        font-size: 0.8rem;
    }
}
