/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    /* font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Times New Roman', Arial, sans-serif; */
    font-family: 'PingFang SC', 'Microsoft YaHei', 'Times New Roman', Arial, sans-serif;
	line-height: 1.6;
    color: #333;
    background-color: #f9fafb;
}

/* Container */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem 1rem;
}

/* Card Styles */
.card {
    background: white;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    margin-bottom: 2rem;
    overflow: hidden;
}

.card-content {
    padding: 2rem;
}

/* Title Section */
.title-section {
    text-align: center;
    margin-bottom: 2rem;
}

.main-title {
    font-size: 2rem;
    font-weight: normal;
    color: #1f2937;
    margin-bottom: 1rem;
}

.subtitle {
    font-size: 1.75rem;
    color: #1f2937;
    margin-bottom: 1.5rem;
    line-height: 1.5;
}

/* Links Section */
.links-section {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    text-decoration: none;
    color: #2563eb;
    background: white;
    font-size: 0.875rem;
    transition: all 0.2s;
}

.btn:hover {
    background-color: #dbf9ff;
    border-color: #02b4ea;
}

.btn-outline {
    background: transparent;
}

/* Authors */
.authors {
    font-size: 1rem;
    color: #1f2937;
    line-height: 1.5;
}

/* Section Styles */
.section {
    margin-bottom: 2rem;
}

.section-title {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: #1f2937;
}

.section-header {
    text-align: center;
	font-size: 2rem;
	font-weight: normal;
	color: #1f2937;
	margin-bottom: 1rem;
}

/* Abstract */
.abstract-text {
    color: #374151;
    line-height: 1.7;
    text-align: left;
}

/* Contents List */
.contents-list {
    list-style: none;
}

.contents-list li {
    margin-bottom: 0.5rem;
}

.link {
    color: #2563eb;
    text-decoration: none;
}

.link:hover {
    text-decoration: underline;
}

/* Workflow Diagram */
.workflow-container {
    display: flex;
    justify-content: center;
    margin-bottom: 2rem;
}

.workflow-diagram {
    /* background-color: #f3f4f6; */
    padding: 0rem;
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 1.5rem;
    flex-wrap: wrap;
    justify-content: center;
    max-width: 90%;
}

.description-title {
    font-size: 1.2rem;
    font-weight: 550;
    margin-bottom: 0.5rem;
    color: #1f2937;
}

.description-text {
    color: #374151;
    line-height: 1.7;
    text-align: justify;
}

.workflow-step {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.step-box {
    border: 2px dashed #9ca3af;
    padding: 1rem;
    border-radius: 8px;
    text-align: center;
    width: 120px !important; /* 使用!important确保覆盖 */
    height: 80px !important; /* 使用!important确保覆盖 */
    min-width: auto !important; /* 覆盖之前的min-width设置 */
    display: flex;
    flex-direction: column;
    justify-content: center;
    background: white;
}

.input-box {
    border-style: dashed;
    border-color: #9ca3af;
}

.encoding-box, .decoding-box {
    background-color: #fed7aa;
    border-color: #fb923c;
    border-style: solid;
}

.safespeech-box {
    background-color: #fde68a;
    border-color: #f59e0b;
    border-style: solid;
    width: 160px !important; /* 使用!important确保覆盖 */
    height: 100px !important; /* 使用!important确保覆盖 */
    min-width: auto !important; /* 覆盖之前的min-width设置 */
}

.output-box {
    border-color: #4ade80;
    border-style: dashed;
}

.step-icon {
    font-size: 2rem;
    color: #6b7280;
    margin-bottom: 0.5rem;
}

.step-icon-placeholder {
    width: 2rem;
    height: 2rem;
    border-radius: 4px;
    margin: 0 auto 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.step-icon-placeholder.purple {
    background-color: #ddd6fe;
}

.step-icon-placeholder.blue {
    background-color: #bfdbfe;
}

.step-icon-placeholder.green {
    background-color: #bbf7d0;
}

.checkmark {
    color: #059669;
    font-weight: bold;
}

.step-label {
    font-size: 0.875rem;
    font-weight: 500;
}

.upload-label {
    font-size: 0.75rem;
    color: #059669;
    margin-top: 0.25rem;
}

.safespeech-content {
    text-align: center;
}

.safespeech-title {
    font-weight: 600;
    font-size: 0.875rem;
}

.safespeech-subtitle {
    font-size: 0.75rem;
    margin: 0.25rem 0;
}

.safespeech-process {
    font-size: 0.625rem;
    margin-top: 0.25rem;
}

/* Audio Sections */
.audio-sections {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.audio-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
}

.fine-tuning-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
}

.audio-column, .fine-tuning-column {
    display: flex;
    flex-direction: column;
}

.audio-section-title {
    font-size: 1.125rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: #1f2937;
}

.audio-samples {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.audio-sample {
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 1rem;
    background: white;
}

.audio-sample.protected {
    background-color: #f0fdf4;
    border-color: #bbf7d0;
}

.audio-sample.degraded {
    background-color: #fef2f2;
    border-color: #fecaca;
}

.audio-sample.failed {
    background-color: #fef2f2;
    border-color: #fecaca;
}

.sample-description {
    font-size: 0.875rem;
    color: #6b7280;
    margin-bottom: 0.5rem;
}

.audio-player {
    width: 100%;
    height: 40px;
}

/* Metrics */
.metrics-container {
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 1rem;
    background: white;
}

.metric-item {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.5rem;
    font-size: 0.875rem;
}

.metric-item:last-child {
    margin-bottom: 0;
}

.metric-label {
    color: #374151;
}

.metric-value.decrease {
    color: #dc2626;
    font-weight: 600;
}

.metric-value.increase {
    color: #059669;
    font-weight: 600;
}

/* Footer */
.footer {
    text-align: center;
    margin-top: 3rem;
    color: #6b7280;
    font-size: 0.875rem;
}

/* Image Modal Styles */
.image-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

.modal-content {
    position: relative;
    max-width: 90vw;
    max-height: 90vh;
    background: white;
    border-radius: 8px;
    padding: 1rem;
    box-shadow: 0 20px 25px rgba(0, 0, 0, 0.3);
}

.modal-close {
    position: absolute;
    top: -10px;
    right: -10px;
    width: 40px;
    height: 40px;
    border: none;
    background: #ef4444;
    color: white;
    border-radius: 50%;
    font-size: 1.5rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1001;
    transition: background-color 0.2s;
}

.modal-close:hover {
    background: #dc2626;
}

.modal-image {
    max-width: 100%;
    max-height: 80vh;
    height: auto;
    display: block;
    border-radius: 4px;
}

.modal-caption {
    text-align: center;
    margin-top: 1rem;
    color: #374151;
    font-size: 0.9rem;
    font-style: italic;
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 1rem;
    }
    
    .card-content {
        padding: 1.5rem;
    }
    
    .main-title {
        font-size: 2rem;
    }
    
    .subtitle {
        font-size: 1.125rem;
    }
    
    .section-header {
        font-size: 1.5rem;
    }
    
    .workflow-diagram {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .workflow-arrow {
        transform: rotate(90deg);
        margin: 0.5rem 0;
    }
    
    .audio-grid, .fine-tuning-grid {
        grid-template-columns: 1fr;
    }
    
    .links-section {
        flex-direction: column;
        align-items: center;
    }
}

@media (max-width: 480px) {
    .main-title {
        font-size: 1.75rem;
    }
    
    .subtitle {
        font-size: 1rem;
    }
    
    .step-box {
        min-width: 80px;
        padding: 0.75rem;
    }
    
    .safespeech-box {
        min-width: 120px;
    }
}

/* Smooth Scrolling */
html {
    scroll-behavior: smooth;
}

/* Focus Styles for Accessibility */
.btn:focus,
.link:focus,
.audio-player:focus {
    outline: 2px solid #2563eb;
    outline-offset: 2px;
}

/* Algorithm Section Styles */
.algorithm-description {
    margin-bottom: 2rem;
}

.algorithm-features {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
    margin-top: 1.5rem;
}

.feature-item {
    background-color: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 1.5rem;
    transition: all 0.3s ease;
}

.feature-item:hover {
    background-color: #f1f5f9;
    border-color: #cbd5e1;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.feature-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: #1e40af;
    margin-bottom: 0.75rem;
    display: flex;
    align-items: center;
}

.feature-title::before {
    content: '⚡';
    margin-right: 0.5rem;
    font-size: 1.2rem;
}

.feature-text {
    color: #4b5563;
    line-height: 1.6;
    font-size: 0.95rem;
}

/* TTS Evaluation Grid */
.tts-evaluation-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.tts-system {
    background-color: #f9fafb;
    border-radius: 8px;
    padding: 1.5rem;
    border: 1px solid #e5e7eb;
}

/* Quality Assessment Styles */
.quality-assessment {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.assessment-intro {
    text-align: center;
    padding: 1rem;
    background-color: #f0f9ff;
    border-radius: 8px;
    border: 1px solid #bae6fd;
}

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

.metrics-group {
    background-color: #f8fafc;
    border-radius: 8px;
    padding: 1.5rem;
    border: 1px solid #e2e8f0;
}

.metrics-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: #1f2937;
    margin-bottom: 1rem;
    text-align: center;
}

.metric-value.high {
    color: #059669;
    font-weight: 700;
    font-size: 1.1rem;
}

.metric-value.low {
    color: #dc2626;
    font-weight: 700;
    font-size: 1.1rem;
}

/* Evaluation Details */
.evaluation-details {
    margin-top: 2rem;
}

.details-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: #1f2937;
    margin-bottom: 1rem;
    text-align: center;
}

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

.detail-item {
    background-color: white;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 1.25rem;
    transition: all 0.3s ease;
}

.detail-item:hover {
    border-color: #3b82f6;
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.1);
}

.detail-title {
    font-size: 1rem;
    font-weight: 600;
    color: #3b82f6;
    margin-bottom: 0.5rem;
}

.detail-text {
    color: #6b7280;
    font-size: 0.9rem;
    line-height: 1.5;
}

/* Responsive adjustments for new sections */
@media (max-width: 768px) {
    .algorithm-features,
    .tts-evaluation-grid,
    .metrics-comparison,
    .details-grid {
        grid-template-columns: 1fr;
    }
    
    .feature-item,
    .tts-system,
    .metrics-group,
    .detail-item {
        padding: 1rem;
    }
}

/* Original and Protected Speech Comparison Styles */
.speech-comparison-container {
    margin-top: 1rem;
}

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

.speech-column {
    background-color: #fafafa;
    border-radius: 8px;
    padding: 1.5rem;
    border: 1px solid #e5e7eb;
}

.speech-column-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: #1f2937;
    margin-bottom: 1.5rem;
    text-align: center;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid #e5e7eb;
}

.speech-samples {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.speech-sample-item {
    background: white;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    padding: 1rem;
    transition: all 0.2s ease;
}

.speech-sample-item:hover {
    border-color: #9ca3af;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.speech-sample-item.protected-sample {
    background-color: #f0fdf4;
    border-color: #bbf7d0;
}

.speech-sample-item.protected-sample:hover {
    border-color: #86efac;
    box-shadow: 0 2px 4px rgba(34, 197, 94, 0.1);
}

.sample-info {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    margin-bottom: 0.75rem;
}

.sample-label {
    font-weight: 600;
    color: #374151;
    font-size: 0.875rem;
}

.sample-text {
    color: #6b7280;
    font-size: 0.8rem;
    font-style: italic;
}

.audio-control {
    width: 100%;
    height: 35px;
}

.audio-control:focus {
    outline: 2px solid #3b82f6;
    outline-offset: 2px;
}

/* Quality Summary Styles */
.quality-summary {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid #e5e7eb;
}

.summary-card {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 1.5rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.summary-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: #1f2937;
    margin-bottom: 1rem;
    text-align: center;
}

.summary-metrics {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

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

.metric-row:last-child {
    border-bottom: none;
}

.metric-name {
    color: #374151;
    font-size: 0.875rem;
    font-weight: 500;
}

.metric-value {
    font-weight: 600;
    font-size: 0.875rem;
}

.metric-value.high {
    color: #059669;
}

.metric-value.protection {
    color: #dc2626;
}

/* Responsive Design for Speech Comparison */
@media (max-width: 768px) {
    .comparison-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .quality-summary {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .speech-column {
        padding: 1rem;
    }
    
    .speech-column-title {
        font-size: 1.125rem;
    }
    
    .summary-card {
        padding: 1rem;
    }
}

@media (max-width: 480px) {
    .speech-sample-item {
        padding: 0.75rem;
    }
    
    .sample-info {
        gap: 0.125rem;
    }
    
    .sample-label {
        font-size: 0.8rem;
    }
    
    .sample-text {
        font-size: 0.75rem;
    }
    
    .audio-control {
        height: 32px;
    }
    
    .metric-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.25rem;
    }
}