:root {
    --bg-color: #F8F9FA;
    --text-color: #0A2463;
    --accent-color: #3A86FF;
    --secondary-accent: #4361EE;
    --divider-color: #E9ECEF;
    --subtitle-color: #6C757D;
}

/* Background animation */
.background-animation {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    background: linear-gradient(
        135deg,
        rgba(248, 249, 250, 0.95) 0%,
        rgba(232, 235, 239, 0.85) 100%
    );
    overflow: hidden;
}

.background-animation::after {
    content: "";
    position: absolute;
    top: -30%;
    left: -30%;
    right: -30%;
    bottom: -30%;
    background: linear-gradient(
        to bottom right,
        rgba(58, 134, 255, 0.25) 0%,
        rgba(58, 134, 255, 0.1) 50%
    );
    animation: gradientRotate 8s ease infinite;
    transform: rotate(0deg);
}

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

/* Fixed header */
.fixed-header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    padding: 2rem 5rem 2rem 1rem;
    background-color: var(--bg-color);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    z-index: 100;
    opacity: 1;
    transform: translateY(0);
}

.fixed-header .logo-container {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    gap: 0.3rem;
    display: flex;
    align-items: center;
}

.fixed-header .logo-text {
    font-size: 1.2rem;
    opacity: 1;
    animation: none;
}

.fixed-header .logo-icon {
    width: 1rem;
    height: 1rem;
}

body {
    background-color: var(--bg-color);
    color: var(--text-color);
    font-family: 'Segoe UI', system-ui, sans-serif;
    margin: 0;
    padding: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Language switcher */
.language-switcher {
    position: fixed;
    top: 1rem;
    right: 1rem;
    z-index: 200;
    display: flex;
    gap: 0.5rem;
}

.lang-btn {
    padding: 0.25rem 0.5rem;
    background: transparent;
    border: 1px solid var(--text-color);
    border-radius: 4px;
    color: var(--text-color);
    cursor: pointer;
    font-size: 0.8rem;
}

.lang-btn.active {
    background-color: var(--text-color);
    color: white;
}

/* Hero section */
.hero-section {
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.hero-content {
    max-width: 800px;
    padding: 2rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2rem;
}

.hero-logo .logo-text {
    font-size: 3.5rem;
}

.button-group {
    margin-top: 3rem;
}

.hero-logo .logo-icon {
    width: 3rem;
    height: 3rem;
}

.header {
    text-align: center;
    padding: 2rem 1rem;
    position: relative;
}

.logo-container {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.logo-text {
    font-size: 2.5rem;
    font-weight: 700;
    opacity: 0;
}

.logo-left {
    animation: fadeInLeft 0.8s ease-out forwards;
}

.logo-right {
    animation: fadeInRight 0.8s ease-out 0.2s forwards;
}

.logo-icon {
    width: 2rem;
    height: 2rem;
    stroke: var(--text-color);
    stroke-width: 2;
    fill: none;
    animation: drawPath 1.2s ease-out 0.4s forwards;
}

.subtitle {
    color: var(--subtitle-color);
    margin: 0;
    opacity: 0;
    animation: fadeIn 0.6s ease-out 0.8s forwards;
}

.hero {
    display: flex;
    justify-content: center;
    padding: 2rem;
}

.button-group {
    display: flex;
    gap: 1rem;
}

.btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

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

.btn-accent {
    background: linear-gradient(to right, var(--accent-color), var(--secondary-accent));
    color: white;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.btn-accent:hover {
    background: linear-gradient(to right, var(--secondary-accent), var(--accent-color));
}

.detection-area {
    display: flex;
    padding: 2rem;
    gap: 2rem;
    max-width: 1200px;
    margin: 0 auto;
}

.input-section, .result-section {
    width: 60vw;
    height: 70vh;
    background: white;
    border-radius: 8px;
    padding: 0;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.05);
    overflow: hidden;
}

.input-container {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    height: 100%;
}

.text-input-wrapper {
    position: relative;
    flex: 24;  /* 增加文本框占比 */
    min-height: 220px;  /* 增加高度 */
    box-sizing: border-box;
    padding: 0.8rem;  /* 增加内边距 */
}

.text-input {
    width: 100%;
    height: 85%;
    padding: 1.2rem;  /* 增加内边距 */
    padding-right: 3.5rem;
    border: 2px solid var(--text-color);
    border-radius: 8px;
    font-family: inherit;
    resize: vertical;
    box-sizing: border-box;
}

.submit-btn {
    position: absolute;
    right: 1.2rem;  /* 往左上移动 */
    bottom: 1.2rem;  /* 往左上移动 */
    width: 90px;  /* 稍微加宽 */
    height: 36px;  /* 稍微加高 */
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #0A2463;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 1rem;  /* 增大字体 */
    gap: 0.4rem;
}

.submit-btn:hover {
    background-color: var(--secondary-accent);
    transform: scale(1.05);
}

.file-upload {
    flex: 0.8;  /* 减小高度占比 */
    min-height: 60px;  /* 设置最小高度 */
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.5rem;  /* 减小内边距 */
    border: 2px dashed var(--divider-color);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.file-upload:hover {
    border-color: var(--accent-color);
    background-color: rgba(58, 134, 255, 0.05);
}

.loading-animation {
    height: 100px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.loading-animation svg {
    width: 100%;
    height: 20px;
}

.result-display {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    height: 100%;
    padding: 2rem;
    margin: 0;
    box-sizing: border-box;
    gap: 1.5rem;
    overflow: auto;
}

.loading-spinner {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 40px;
    height: 40px;
    border: 4px solid rgba(58, 134, 255, 0.2);
    border-radius: 50%;
    border-top-color: #0A2463;
    animation: spin 1s ease-in-out infinite;
    z-index: 1000;
    display: none;
}

@keyframes spin {
    to { transform: translate(-50%, -50%) rotate(360deg); }
}

.result-section {
    position: relative;
    width: auto;
    height: auto;
    padding: 2rem;
    margin: 0;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.loading-animation {
    position: relative;
    margin: 1rem auto 0;
    width: 100%;
    max-width: 200px;
    z-index: 1;
}

.ai-highlight {
    background-color: rgba(58, 134, 255, 0.2);
    padding: 0.1rem 0.2rem;
    border-radius: 4px;
}

.ai-percentage {
    font-size: 3rem;
    font-weight: 700;
    text-align: center;
    margin-bottom: 1.5rem;
    position: relative;
}

.default-message {
    font-size: 1rem;
    color: var(--subtitle-color);
    margin-top: 0.5rem;
    font-weight: normal;
}

@keyframes fadeInLeft {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes fadeInRight {
    from {
        opacity: 0;
        transform: translateX(20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes drawPath {
    0% {
        stroke-dasharray: 1000;
        stroke-dashoffset: 1000;
    }
    100% {
        stroke-dasharray: 1000;
        stroke-dashoffset: 0;
    }
}

.principles-section {
    padding: 4rem 2rem;
    background-color: white;
    margin-top: 2rem;
}

.principles-section h2 {
    color: #0A2463;
    text-align: center;
    margin-bottom: 2rem;
    font-size: 2rem;
}

.principle-detail {
    max-width: 900px;
    margin: 0 auto;
    padding: 2rem;
    background: var(--bg-color);
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.article-content {
    line-height: 1.8;
    color: var(--text-color);
}

.article-content h3 {
    color: var(--text-color);
    border-bottom: 2px solid var(--accent-color);
    padding-bottom: 0.5rem;
    margin-top: 2rem;
}

.article-content h4 {
    color: #0A2463;
    margin-top: 1.5rem;
}

.article-content p, 
.article-content li {
    margin-bottom: 1rem;
}

.tech-advantages {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin: 2rem 0;
    
}

.advantage-item {
    background: white;
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.advantage-item h5 {
    color: #0A2463;
    margin-top: 0;
    margin-bottom: 0.5rem;
}

.team-section {
    padding: 4rem 2rem;
    background-color: white;
    text-align: center;
}

.team-section h2 {
    margin-bottom: 3rem;
}

.team-card {
    background: var(--bg-color);
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    text-align: left
}

.team-card h3 {
    color: var(--text-color);
    margin-top: 0;
    margin-bottom: 1rem;
    border-bottom: 2px solid var(--accent-color);
    padding-bottom: 0.5rem;
    text-align: left;
}

.team-content {
    line-height: 1.8;
    font-size: 1rem;
    color: var(--text-color);
    padding: 0.5rem 0;
}

.team-card {
    transition: transform 0.3s ease;
}

.team-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 16px rgba(0,0,0,0.1);
}

.principle-card {
    background: var(--bg-color);
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.principle-card h3 {
    color: var(--text-color);
    margin-top: 0;
    border-bottom: 2px solid var(--accent-color);
    padding-bottom: 0.5rem;
}
.principle-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 16px rgba(0,0,0,0.1);
}

.principle-card {
    transition: transform 0.3s ease;
}

.card-content {
    line-height: 1.6;
}

.footer {
    text-align: center;
    padding: 2rem;
    background-color: var(--text-color);
    color: white;
}

@media (max-width: 768px) {
    .detection-area {
        flex-direction: column;
    }
    
    .header {
        padding-top: 4rem;
    }
}

/* 确保卡片是相对定位，以便子元素绝对定位 */
.principle-card,
.team-card {
    position: relative;
    padding-bottom: 2rem; /* 为底部的“查看详情”留出空间 */
}

/* 仅针对原理卡片和团队卡片的“查看详情”链接 */
.principle-card .detail-link,
.team-card .detail-link {
    position: absolute;
    right: 1rem;
    bottom: 1rem;
    color: #0A2463;
    font-weight: bold;
    transition: all 0.3s ease;
    font-size: 0.9em;
    padding: 0.2rem 0.4rem;
    border-radius: 4px;
    text-decoration: none;
}

/* 悬浮效果 */
.principle-card .detail-link:hover,
.team-card .detail-link:hover {
    color: #0A2463;
    background-color: #ffffff;
}
