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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #fafafa;
}

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

/* Header */
.header {
    background: #fff;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    z-index: 100;
}

.nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 0;
}

.nav-brand {
    font-size: 1.5rem;
    font-weight: bold;
    color: #217346;
    margin-right: 2rem;
}

.nav-brand {
    font-size: 1.5rem;
    font-weight: bold;
    color: #217346;
}

.nav-info {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.nav-info span {
    background: #f1f5f9;
    color: #475569;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.875rem;
    font-weight: 500;
}

/* Dropdown Menu */
.nav-dropdown {
    position: relative;
    display: inline-block;
    margin-left: auto;
}

.dropdown-btn {
    background: #ffffff;
    border: 2px solid #e5e7eb;
    color: #374151;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 500;
    font-size: 0.875rem;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.dropdown-btn:hover {
    border-color: #3b82f6;
    color: #3b82f6;
}

.dropdown-content {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    background: #ffffff;
    min-width: 200px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
    border-radius: 8px;
    border: 1px solid #e5e7eb;
    z-index: 1000;
    margin-top: 0.5rem;
}

/* 添加下拉菜单样式 */
.dropdown {
    position: relative;
}

.dropdown-toggle {
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.dropdown-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    background: #ffffff;
    min-width: 200px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
    border-radius: 8px;
    border: 1px solid #e5e7eb;
    z-index: 1000;
    margin-top: 0.5rem;
    list-style: none;
    padding: 0;
}

.dropdown-menu li {
    margin: 0;
}

.dropdown-menu a {
    display: block;
    padding: 0.75rem 1rem;
    color: #374151;
    text-decoration: none;
    border-bottom: 1px solid #f3f4f6;
    transition: background-color 0.2s ease;
}

.dropdown-menu a:last-child {
    border-bottom: none;
}

.dropdown-menu a:hover {
    background-color: #f8fafc;
    color: #3b82f6;
}

/* 移除hover触发，仅保留点击控制 */
.dropdown:hover .dropdown-menu {
    display: none !important;
}

.nav-dropdown .dropdown-content.show {
    display: block;
}

.dropdown-content a {
    color: #374151;
    padding: 0.75rem 1rem;
    text-decoration: none;
    display: block;
    transition: background-color 0.2s ease;
    border-bottom: 1px solid #f3f4f6;
}

.dropdown-content a:last-child {
    border-bottom: none;
}

.dropdown-content a:hover {
    background-color: #f8fafc;
    color: #3b82f6;
}

/* Hero Section */
.hero {
    background: linear-gradient(135deg, #3e5e96 0%, #62799b 100%);
    color: white;
    padding: 4rem 0;
    text-align: center;
}

.hero h1 {
    font-size: 2.5rem;
    font-weight: bold;
    margin-bottom: 1rem;
    line-height: 1.2;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
}

.hero-subtitle {
    font-size: 1.25rem;
    margin-bottom: 2rem;
    opacity: 0.9;
    max-width: 900px;
    /* 增加宽度 */
    margin-left: auto;
    margin-right: auto;
    line-height: 1.5;
    /* 增加行高 */

    /* 更好的换行控制 */
    word-wrap: break-word;
    hyphens: auto;
}

/* 响应式优化 */
@media (max-width: 768px) {
    .hero-subtitle {
        font-size: 1.1rem;
        max-width: 95%;
        line-height: 1.6;
    }
}

.hero-features {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    /* 2x2网格 */
    gap: 16px;
    max-width: 600px;
    margin: 0 auto 2.5rem;
}

.hero-features span {
    background: #e2e8f0;
    color: #475569;
    padding: 12px 20px;
    border-radius: 25px;
    font-weight: 500;
    text-align: center;
    /* 文字居中 */
    min-height: 20px;
    /* 统一高度 */
}

.hero-cta {
    margin-top: 2rem;
}

.hero-note {
    display: block;
    margin-top: 1rem;
    font-size: 0.875rem;
    opacity: 0.8;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 6px;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 1rem;
}

.btn-primary {
    background: #13385b;
    color: white;
}

.btn-primary:hover {
    background: #02336b;
    transform: translateY(-1px);
}

.btn-secondary {
    background: #6b7280;
    color: white;
}

.btn-secondary:hover {
    background: #4b5563;
}

.btn-success {
    background: #059669;
    color: white;
}

.btn-success:hover {
    background: #047857;
}

.btn-info {
    background: #0ea5e9;
    color: white;
}

.btn-info:hover {
    background: #0284c7;
}

.btn-warning {
    background: #f59e0b;
    color: white;
}

.btn-warning:hover {
    background: #d97706;
}

.btn-danger {
    background: #dc2626;
    color: white;
}

.btn-danger:hover {
    background: #b91c1c;
}

.btn-large {
    padding: 1rem 2rem;
    font-size: 1.125rem;
}

/* Demo Section */
.demo-section {
    padding: 4rem 0;
    background: white;
}

.demo-section h2 {
    text-align: center;
    font-size: 2rem;
    margin-bottom: 3rem;
    color: #1f2937;
}

.demo-grid {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 2rem;
    align-items: center;
}

.demo-table-container {
    text-align: center;
}

.demo-table-container h4 {
    margin-bottom: 1rem;
    color: #374151;
}

.demo-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    border-radius: 8px;
    overflow: hidden;
}

.demo-table th,
.demo-table td {
    padding: 0.75rem;
    text-align: left;
    border-bottom: 1px solid #e5e7eb;
}

.demo-table th {
    background: #f9fafb;
    font-weight: 600;
    color: #374151;
}

.demo-caption {
    margin-top: 1rem;
    font-weight: 500;
}

.demo-arrow {
    text-align: center;
    font-size: 2rem;
    color: #059669;
}

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

.conversion-time {
    font-size: 0.875rem;
    text-align: center;
}

.conversion-time strong {
    display: block;
    color: #059669;
    font-size: 1rem;
}

.arrow-mobile {
    display: none;
}

/* Main Tool Sections */
.main {
    padding: 4rem 0;
}

.tool-section,
.config-section,
.results-section {
    background: white;
    border-radius: 12px;
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
}

.tool-section h2,
.config-section h2,
.results-section h2 {
    font-size: 1.75rem;
    margin-bottom: 0.5rem;
    color: #1f2937;
}

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

/* Method Tabs */
.method-tabs {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
}

.tab-btn {
    padding: 0.75rem 1.5rem;
    border: 2px solid #e5e7eb;
    background: white;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.2s;
}

.tab-btn.active {
    border-color: #2563eb;
    background: #eff6ff;
    color: #2563eb;
}

/* Input Methods */
.input-method {
    display: none;
}

.input-method.active {
    display: block;
}

/* Paste Area */
.paste-area {
    border: 2px dashed #d1d5db;
    border-radius: 8px;
    padding: 1.5rem;
}

.paste-instruction {
    margin-bottom: 1rem;
    color: #6b7280;
}

.table-container {
    overflow-x: auto;
    margin-bottom: 1rem;
}

#data-grid {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1rem;
    background: white;
    border: 2px solid #d1d5db;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    min-height: 200px;
}

#data-grid td {
    border: 1px solid #d1d5db;
    padding: 0.75rem;
    position: relative;
    min-height: 40px;
    height: 40px;
}

#data-grid td::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border: 1px solid #e5e7eb;
    pointer-events: none;
}

#data-grid td:focus {
    outline: 2px solid #3b82f6;
    outline-offset: -2px;
    background-color: #f8fafc;
}

#data-grid tr:first-child td {
    background-color: #f9fafb;
    font-weight: 600;
    color: #374151;
}

/* Upload Area */
.upload-area {
    text-align: center;
}

.upload-zone {
    border: 2px dashed #d1d5db;
    border-radius: 12px;
    padding: 3rem 2rem;
    cursor: pointer;
    transition: all 0.2s;
    margin-bottom: 2rem;
}

.upload-zone:hover {
    border-color: #2563eb;
    background: #f8faff;
}

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

.upload-formats {
    font-size: 0.875rem;
    color: #6b7280;
    margin-top: 0.5rem;
}

.privacy-note {
    background: #f0f9ff;
    border: 1px solid #0ea5e9;
    border-radius: 8px;
    padding: 1.5rem;
    text-align: left;
}

.privacy-note h4 {
    margin-bottom: 1rem;
    color: #0c4a6e;
}

.privacy-note ul {
    list-style: none;
}

.privacy-note li {
    margin-bottom: 0.5rem;
    color: #0c4a6e;
}

/* Configuration Panel */
.config-panel {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    margin-bottom: 2rem;
}

.config-group h3 {
    margin-bottom: 1rem;
    color: #374151;
}

.checkbox-group {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.checkbox-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.checkbox-item input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: #2563eb;
}

.checkbox-item label {
    font-weight: 500;
    cursor: pointer;
}

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

.name-input label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: #374151;
}

.name-input input {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 1rem;
}

.name-input input:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.action-buttons {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

/* Results Section */
.results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.results-info {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.results-info span {
    font-weight: 500;
}

.time-saved {
    color: #059669;
    background: #dcfce7;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.875rem;
}

.results-actions {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.results-preview {
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    overflow: hidden;
}

.results-table {
    max-height: 400px;
    overflow: auto;
}

.results-table table {
    width: 100%;
    border-collapse: collapse;
}

.results-table th,
.results-table td {
    padding: 0.75rem;
    text-align: left;
    border-bottom: 1px solid #e5e7eb;
}

.results-table th {
    background: #f9fafb;
    font-weight: 600;
    color: #374151;
    position: sticky;
    top: 0;
}

/* Benefits Section */
.benefits-section {
    padding: 4rem 0;
    background: #f9fafb;
}

.benefits-section h2 {
    text-align: center;
    font-size: 2rem;
    margin-bottom: 3rem;
    color: #1f2937;
}

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

.benefit-card {
    background: white;
    padding: 2rem;
    border-radius: 12px;
    text-align: center;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    transition: transform 0.2s;
}

.benefit-card:hover {
    transform: translateY(-2px);
}

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

.benefit-card h3 {
    font-size: 1.25rem;
    margin-bottom: 1rem;
    color: #1f2937;
}

.benefit-card p {
    color: #6b7280;
    line-height: 1.6;
}

/* Use Cases Section */
.use-cases-section {
    padding: 4rem 0;
    background: white;
}

.use-cases-section h2 {
    text-align: center;
    font-size: 2rem;
    margin-bottom: 3rem;
    color: #1f2937;
}

.use-cases-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 2rem;
}

.use-case {
    padding: 2rem;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    transition: box-shadow 0.2s;
}

.use-case:hover {
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
}

.use-case-icon {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

.use-case h3 {
    font-size: 1.25rem;
    margin-bottom: 1rem;
    color: #1f2937;
}

.use-case p {
    margin-bottom: 0.75rem;
    color: #6b7280;
}

.use-case strong {
    color: #374151;
}

/* FAQ Section */
.faq-section {
    padding: 4rem 0;
    background: #f9fafb;
}

.faq-section h2 {
    text-align: center;
    font-size: 2rem;
    margin-bottom: 3rem;
    color: #1f2937;
}

.faq-grid {
    max-width: 1200px;
    margin: 0 auto;
}

.faq-item {
    background: white;
    border-radius: 8px;
    margin-bottom: 1rem;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.faq-question {
    padding: 1.5rem;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: background-color 0.2s;
}

.faq-question:hover {
    background: #f9fafb;
}

.faq-question.active {
    background: #eff6ff;
}

.faq-question h3 {
    font-size: 1.125rem;
    color: #1f2937;
    margin: 0;
}

.faq-toggle {
    font-size: 1.5rem;
    font-weight: bold;
    color: #2563eb;
}

.faq-answer {
    display: none;
    padding: 0 1.5rem 1.5rem;
    border-top: 1px solid #e5e7eb;
}

.faq-answer p {
    color: #6b7280;
    line-height: 1.6;
}

/* Footer */
.footer {
    background: #1f2937;
    color: white;
    padding: 3rem 0 1rem;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.footer-section h4 {
    margin-bottom: 1rem;
    font-size: 1.125rem;
}

.footer-section p {
    color: #d1d5db;
    line-height: 1.6;
}

.footer-section ul {
    list-style: none;
}

.footer-section li {
    margin-bottom: 0.5rem;
    color: #d1d5db;
}

.footer-bottom {
    border-top: 1px solid #374151;
    padding-top: 2rem;
    text-align: center;
    color: #9ca3af;
}

/* Responsive Design */
@media (max-width: 768px) {
    .hero h1 {
        font-size: 2rem;
        line-height: 1.2;
    }

    .hero-subtitle {
        font-size: 1rem;
        line-height: 1.5;
    }

    .hero-features {
        grid-template-columns: 1fr;
        /* 手机端垂直排列 */
        gap: 12px;
        max-width: 100%;
    }

    .hero-features span {
        font-size: 0.875rem;
        padding: 10px 16px;
    }

    .demo-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .arrow-desktop {
        display: none;
    }

    .arrow-mobile {
        display: block;
    }

    .config-panel {
        grid-template-columns: 1fr;
    }

    .config-names {
        grid-template-columns: 1fr;
    }

    .results-header {
        flex-direction: column;
        align-items: stretch;
    }

    .results-actions {
        justify-content: center;
    }

    .nav {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }

    .nav-info {
        justify-content: center;
    }

    .nav-info span {
        font-size: 0.75rem;
        padding: 0.25rem 0.5rem;
    }

    .method-tabs {
        flex-direction: column;
    }

    .action-buttons {
        justify-content: center;
    }

    /* Mobile dropdown */
    .nav-dropdown {
        width: 100%;
    }

    .dropdown-btn {
        width: 100%;
        justify-content: center;
        font-size: 0.875rem;
        padding: 0.75rem 1rem;
    }

    .dropdown-content {
        position: static;
        box-shadow: none;
        border: 1px solid #e5e7eb;
        margin-top: 0.5rem;
    }

    .dropdown-content a {
        padding: 0.875rem 1rem;
        font-size: 0.875rem;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 15px;
    }

    .tool-section,
    .config-section,
    .results-section {
        padding: 1.5rem;
    }

    .hero {
        padding: 3rem 0;
    }

    .demo-section,
    .benefits-section,
    .use-cases-section,
    .faq-section {
        padding: 3rem 0;
    }
}

/* ===== 模态框样式 ===== */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.modal-content {
    background-color: #ffffff;
    border-radius: 8px;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    width: 90%;
    max-width: 1000px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    border-bottom: 1px solid #e5e7eb;
}

.modal-header h3 {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 600;
    color: #111827;
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #6b7280;
    padding: 0.5rem;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.modal-close:hover {
    background-color: #f3f4f6;
    color: #111827;
}

.modal-body {
    flex: 1;
    overflow: auto;
    padding: 1.5rem;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    padding: 1.5rem;
    border-top: 1px solid #e5e7eb;
}

/* 大表格容器 */
.large-grid-container {
    min-height: 400px;
    max-height: 600px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    overflow: auto;
    background-color: #ffffff;
}

.large-grid-container table {
    width: 100%;
    border-collapse: collapse;
    border: 2px solid #d1d5db;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    min-height: 300px;
}

.large-grid-container table td {
    padding: 0.75rem;
    border: 1px solid #d1d5db;
    background: white;
    position: relative;
    min-height: 40px;
    height: 40px;
}

.large-grid-container table td::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border: 1px solid #e5e7eb;
    pointer-events: none;
}

/* 浮动操作按钮：打开全屏编辑器 */
.fab {
    position: fixed;
    right: 24px;
    bottom: 24px;
    z-index: 1100;
    display: none;
    background: #13385b;
    color: #ffffff;
    padding: 0.75rem 1rem;
    border-radius: 9999px;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.15);
    border: none;
    font-weight: 600;
    cursor: pointer;
}

.fab:hover {
    background: #02336b;
}

/* 数据预处理模态框样式 */
.merge-option {
    margin-bottom: 1.5rem;
    padding: 1rem;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    background-color: #f9fafb;
}

.merge-option:hover {
    background-color: #f3f4f6;
}

.merge-checkbox-label {
    display: flex;
    align-items: center;
    cursor: pointer;
    font-weight: 500;
    color: #374151;
    margin-bottom: 0.75rem;
    position: relative;
    padding-left: 2rem;
}

.merge-checkbox-label input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    cursor: pointer;
    height: 0;
    width: 0;
}

.checkmark {
    position: absolute;
    top: 0;
    left: 0;
    height: 20px;
    width: 20px;
    background-color: #ffffff;
    border: 2px solid #d1d5db;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.merge-checkbox-label:hover .checkmark {
    border-color: #3b82f6;
}

.merge-checkbox-label input:checked~.checkmark {
    background-color: #3b82f6;
    border-color: #3b82f6;
}

.checkmark:after {
    content: "";
    position: absolute;
    display: none;
    left: 6px;
    top: 2px;
    width: 6px;
    height: 10px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.merge-checkbox-label input:checked~.checkmark:after {
    display: block;
}

.connector-group {
    margin-top: 0.75rem;
    padding-left: 2rem;
}

.connector-label {
    display: block;
    font-size: 0.875rem;
    color: #6b7280;
    margin-bottom: 0.5rem;
    font-weight: 500;
}

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

.radio-label {
    display: flex;
    align-items: center;
    cursor: pointer;
    font-size: 0.875rem;
    color: #374151;
    position: relative;
    padding-left: 1.5rem;
}

.radio-label input[type="radio"] {
    position: absolute;
    opacity: 0;
    cursor: pointer;
    height: 0;
    width: 0;
}

.radio-label::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    height: 16px;
    width: 16px;
    background-color: #ffffff;
    border: 2px solid #d1d5db;
    border-radius: 50%;
    transition: all 0.2s ease;
}

.radio-label:hover::before {
    border-color: #3b82f6;
}

.radio-label:has(input:checked)::before,
.radio-label input:checked~.radio-label::before {
    border-color: #3b82f6;
}

.radio-label::after {
    content: "";
    position: absolute;
    top: 4px;
    left: 4px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: #3b82f6;
    opacity: 0;
    transition: all 0.2s ease;
}

.radio-label:has(input:checked)::after,
.radio-label input:checked~.radio-label::after {
    opacity: 1;
}

.preview-section {
    margin-top: 1.5rem;
    padding: 1rem;
    background-color: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
}

.preview-section h4 {
    margin: 0 0 0.75rem 0;
    font-size: 1rem;
    font-weight: 600;
    color: #374151;
}

.merge-preview-table {
    max-height: 200px;
    overflow: auto;
    border: 1px solid #e5e7eb;
    border-radius: 4px;
}

.modal-footer .btn {
    min-width: 120px;
}

/* FAQ 两列布局 */
.faq-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2.5rem;
    margin-top: 2rem;
}

.faq-column {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.faq-item {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    min-height: 80px;
    display: flex;
    flex-direction: column;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .modal {
        padding: 0.5rem;
    }

    .modal-content {
        width: 95%;
    }

    .modal-header,
    .modal-body,
    .modal-footer {
        padding: 1rem;
    }

    .radio-group {
        flex-direction: column;
        gap: 0.5rem;
    }

    .modal-footer {
        flex-direction: column;
    }

    .faq-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
}

/* Alert 提示样式 */
.alert {
    padding: 1rem;
    margin-bottom: 1rem;
    border-radius: 6px;
    font-weight: 500;
    position: relative;
    animation: slideIn 0.3s ease-out;
}

.alert-success {
    background-color: #d1fae5;
    color: #065f46;
    border: 1px solid #a7f3d0;
}

.alert-error {
    background-color: #fee2e2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

.alert-info {
    background-color: #dbeafe;
    color: #1e40af;
    border: 1px solid #bfdbfe;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 响应式设计 */

/* Tools Overview */
.tools-overview-section {
    padding: 4rem 0;
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
}

.tools-overview-section h2 {
    text-align: center;
    font-size: 2rem;
    margin-bottom: 3rem;
    color: #1f2937;
}

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

.tool-card {
    background: white;
    padding: 2rem;
    border-radius: 16px;
    text-align: center;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.tool-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
    border-color: #3b82f6;
}

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

.tool-card h3 {
    font-size: 1.25rem;
    margin-bottom: 1rem;
    color: #1f2937;
    font-weight: 600;
}

.tool-card p {
    color: #6b7280;
    line-height: 1.6;
    margin-bottom: 1.5rem;
}

.tool-card .btn {
    width: 100%;
    margin-top: auto;
}

/* 响应式设计 */

/* ===== Editable grid: merged placeholder visuals (shared) ===== */
/* 现阶段按需求不再在首页显示任何合并占位视觉，保留类但不渲染明显样式 */
.merged-cell {
    outline: none;
}

.merged-cell-placeholder {
    outline: none;
}

/* Grid stability for editable table */
#data-grid {
    table-layout: fixed;
    width: 100%;
    border-collapse: collapse;
}

#data-grid td {
    min-height: 40px;
    height: 40px;
    overflow: hidden;
    word-wrap: break-word;
    transition: none;
}

/* 空单元格高亮（仅视觉，不修改数据） */
.empty-cell {
    background: #fffbea !important;
    /* Yellow-50 */
    border: 2px dashed #facc15 !important;
    /* Amber-400 */
}

/* ===== Week 2 Improvements: Button Loading States ===== */
.btn.loading {
    position: relative;
    color: transparent !important;
    pointer-events: none;
    cursor: not-allowed;
}

.btn.loading::after {
    content: "⏳ Processing...";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-weight: 600;
}

.btn-primary.loading::after {
    color: white;
}

.btn-secondary.loading::after {
    color: white;
}

.btn-success.loading::after {
    color: white;
}

/* Loading animation for better visual feedback */
@keyframes spin {
    0% {
        transform: translate(-50%, -50%) rotate(0deg);
    }

    100% {
        transform: translate(-50%, -50%) rotate(360deg);
    }
}

.btn.loading.spinning::after {
    content: "⏳";
    animation: spin 1s linear infinite;
}

/* ===== Week 2 Improvements: Better Mobile Experience ===== */
/* Improved touch targets for mobile */
@media (max-width: 768px) {
    .btn {
        min-height: 44px;
        /* Apple's recommended minimum touch target */
        padding: 0.875rem 1.25rem;
        font-size: 1rem;
    }

    .btn-large {
        min-height: 50px;
        padding: 1.125rem 1.5rem;
        font-size: 1.125rem;
    }

    /* Better spacing for action buttons */
    .action-buttons {
        gap: 0.75rem;
        justify-content: stretch;
    }

    .action-buttons .btn {
        flex: 1;
        min-width: 0;
    }

    /* Improved results actions layout */
    .results-actions {
        gap: 0.5rem;
        justify-content: stretch;
    }

    .results-actions .btn {
        flex: 1;
        min-width: 0;
        font-size: 0.875rem;
        padding: 0.75rem 0.5rem;
    }

    /* Better table scrolling on mobile */
    .table-container {
        -webkit-overflow-scrolling: touch;
        border-radius: 8px;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    }

    .results-table {
        -webkit-overflow-scrolling: touch;
    }
}

/* ===== Week 2 Improvements: Enhanced Table Experience ===== */
/* Better visual feedback for editable cells */
#data-grid td:hover {
    background-color: #f8fafc;
    border-color: #3b82f6;
    transition: all 0.2s ease;
}

#data-grid td:focus {
    outline: 2px solid #3b82f6;
    outline-offset: -2px;
    background-color: #eff6ff;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

/* Improved upload zone visual feedback */
.upload-zone {
    transition: all 0.3s ease;
}

.upload-zone:hover {
    border-color: #3b82f6;
    background: #f8faff;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.15);
}

.upload-zone.dragover {
    border-color: #10b981;
    background: #f0fdf4;
    transform: scale(1.02);
    box-shadow: 0 8px 25px rgba(16, 185, 129, 0.2);
}

/* Better visual hierarchy for sections */
.tool-section,
.config-section,
.results-section {
    transition: box-shadow 0.3s ease;
}

.tool-section:hover,
.config-section:hover,
.results-section:hover {
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.08);
}

/* Improved checkbox and radio button styling */
.checkbox-item input[type="checkbox"]:focus {
    outline: 2px solid #3b82f6;
    outline-offset: 2px;
}

.checkbox-item label:hover {
    color: #3b82f6;
    cursor: pointer;
}

/* Better form input focus states */
.name-input input:focus {
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
    transform: translateY(-1px);
}