/* 全局样式 */
body {
    font-family: 'PingFang SC', 'Helvetica Neue', Arial, sans-serif;
    color: #333;
    background: #f5f7fa;
}

/* 表单控件 */
input[type="text"], textarea, select {
    width: 100%;
    padding: 12px;
    border: 1px solid #e1e4e8;
    border-radius: 8px;
    background: #fff;
    transition: all 0.3s ease;
    font-size: 14px;
}

input[type="text"]:focus, textarea:focus, select:focus {
    /* border-color: #6366f1; */
    /* box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1); */
    outline: none;
}

/* 按钮样式 */
.button, .submit-button, .confirm-button, .generate-button {
    display: block;
    width: 60%; /* 调整宽度 */
    max-width: 280px; /* 最大宽度 */
    padding: 14px 28px; /* 调整内边距 */
    margin: 1.5rem auto; /* 调整上下间距 */
    background: linear-gradient(145deg, #667eea 0%, #8a63d2 100%); /* 渐变紫色 */
    color: white;
    border: none;
    border-radius: 12px; /* 更大圆角 */
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.25);
    position: relative;
    overflow: hidden;
}

.button:hover, .submit-button:hover, .confirm-button:hover, .generate-button:hover {
    background: linear-gradient(145deg, #7687ed 0%, #9b74e0 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(102, 126, 234, 0.35);
}

.button:active, .submit-button:active, .confirm-button:active, .generate-button:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.2);
}

/* 添加光效 */
.button::after, .submit-button::after, .confirm-button::after, .generate-button::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 300%;
    height: 300%;
    background: radial-gradient(circle, rgba(255,255,255,0.3) 10%, transparent 10.01%);
    transform: translate(-50%, -50%) scale(0);
    transition: transform 0.5s ease;
}

.button:hover::after, .submit-button:hover::after, .confirm-button:hover::after, .generate-button:hover::after {
    transform: translate(-50%, -50%) scale(1);
}

/* 章节大纲 */
.chapter {
    background: white;
    border-radius: 12px;
    margin: 16px 0;
    padding: 20px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
}

.chapter-title {
    font-size: 18px;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.section {
    margin: 12px 0;
    padding: 16px;
    background: #f8fafc;
    border-radius: 8px;
}

.section-name {
    font-size: 16px;
    font-weight: 500;
    color: #334155;
}

/* 模板选择 */
.template-item {
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.3s ease;
    background: white;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
}

.template-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.1);
}

.template-item img {
    width: 100%;
    height: 180px;
    object-fit: cover;
}

.template-item p {
    padding: 16px;
    margin: 0;
    font-size: 14px;
    color: #1e293b;
}

/* 分页样式 */
.pagination-container {
    display: flex;
    justify-content: center;
    margin: 24px 0;
}

.pagination-container button {
    margin: 0 4px;
    padding: 8px 16px;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    background: white;
    color: #64748b;
    cursor: pointer;
    transition: all 0.3s ease;
}

.pagination-container button:hover {
    background: #f1f5f9;
    color: #475569;
}

.pagination-container button:disabled {
    background: #6366f1;
    color: white;
    cursor: default;
}

/* 弹窗样式 */
.modal {
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
}

.modal-content {
    border-radius: 16px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
}

/* 响应式设计 */
@media (max-width: 768px) {
    .chapter-title {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .template-item img {
        height: 120px;
    }
}

/* 表单容器样式 */
.thesis-container {
    width: 95%;
    max-width: 1200px;
    margin: 1.5rem auto;
    padding: 2rem;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
}

/* 表单组样式优化 */
.form-group {
    margin-bottom: 15px; /* 减小底部间距 */
    position: relative;
}

.form-group label {
    display: inline-block;
    font-size: 14px;
    font-weight: 500;
    color: #4a5568;
    margin-bottom: 6px; /* 减小标签底部间距 */
    width: 120px;
}

.form-group input[type="text"],
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 10px 14px; /* 减小内边距 */
    border: 1px solid #e2e8f0;
    border-radius: 6px; /* 稍微减小圆角 */
    font-size: 14px;
    line-height: 1.4; /* 减小行高 */
    color: #2d3748;
    background-color: #fff;
    transition: all 0.3s ease;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
    box-sizing: border-box;
}

.form-group input[type="text"]:focus,
.form-group textarea:focus,
.form-group select:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
    outline: none;
}

/* 移动端适配优化 */
@media (max-width: 768px) {
    .thesis-container {
        width: 95%;
        margin: 0.8rem auto;
        padding: 1rem;
    }

    .form-group {
        /* padding: 0.6rem 0.8rem; */
        gap: 10px;
    }

    .form-group label {
        font-size: 0.85rem;
        min-width: 75px;
    }

    .form-group input[type="text"],
    .form-group textarea,
    .form-group select {
        padding: 0.5rem 0.7rem;
        font-size: 0.85rem;
    }

    .radio {
        padding: 0.5rem 1rem;
    }
}

/* 自定义滑动开关样式 for 文献引用 */
.switch-label {
    display: inline-flex;
    align-items: center;
    margin-right: 18px;
    font-size: 14px;
    cursor: pointer;
    user-select: none;
    position: relative;
}
.switch-label input[type="checkbox"] {
    display: none;
}
.switch-slider-ui {
    width: 36px;
    height: 20px;
    background: #e4e7ed;
    border-radius: 12px;
    position: relative;
    margin-right: 8px;
    transition: background 0.3s;
    display: inline-block;
    vertical-align: middle;
}
.switch-slider-ui:before {
    content: '';
    position: absolute;
    left: 2px;
    top: 2px;
    width: 16px;
    height: 16px;
    background: #fff;
    border-radius: 50%;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
    transition: left 0.3s;
}
.switch-label input[type="checkbox"]:checked + .switch-slider-ui {
    background: linear-gradient(90deg, #667eea 0%, #8a63d2 100%);
}
.switch-label input[type="checkbox"]:checked + .switch-slider-ui:before {
    /* left: 18px; */
}
/* 让开关和文字对齐 */
.literature-network-switches {
    margin: 10px 0 0 0;
    display: flex;
    gap: 18px;
    flex-wrap: wrap;
    align-items: center;
}

/* 摘要折叠按钮样式，适配PC和移动端 */
.abstract-toggle-btn {
    background: none;
    border: none;
    outline: none;
    cursor: pointer;
    margin-left: 8px;
    font-size: 16px;
    color: #6366f1;
    vertical-align: middle;
    padding: 2px 6px;
    display: inline-block;
    line-height: 1;
}
@media (max-width: 768px) {
    .abstract-toggle-btn {
        font-size: 20px;
        margin-left: 10px;
        padding: 4px 10px;
        color: #6366f1;
        background: none;
        display: inline-block;
    }
}

.literature-network-abstract {
    display: flex;
    align-items: center;
    gap: 6px;
    margin: 8px 0 0 0;
    position: relative;
}
.literature-network-abstract .abstract-label {
    font-weight: 500;
    color: #4a5568;
    font-size: 15px;
    margin-right: 2px;
    display: inline-block;
}
.literature-network-abstract .abstract-toggle-btn {
    margin-left: 2px;
    position: relative;
    top: 1px;
}
.literature-network-abstract .abstract-content {
    display: none;
    margin-left: 10px;
    color: #333;
    font-size: 14px;
    line-height: 1.7;
    background: #f8fafc;
    border-radius: 6px;
    padding: 8px 12px;
    max-width: 100%;
    word-break: break-all;
    max-height: 60vh;
    overflow-y: auto;
    box-sizing: border-box;
}
@media (max-width: 768px) {
    .literature-network-abstract {
        gap: 8px;
        margin: 10px 0 0 0;
    }
    .literature-network-abstract .abstract-label {
        font-size: 16px;
    }
    .literature-network-abstract .abstract-toggle-btn {
        font-size: 22px;
        margin-left: 4px;
        top: 2px;
    }
    .literature-network-abstract .abstract-content {
        font-size: 15px;
        padding: 10px 12px;
    }
}

.switch-recommend {
    color: #f59e42;
    font-size: 13px;
    margin-left: 6px;
    display: inline-flex;
    align-items: center;
    font-weight: 500;
    background: #fffbe8;
    border-radius: 8px;
    padding: 2px 8px 2px 5px;
    box-shadow: 0 1px 2px rgba(245,158,66,0.08);
}
.switch-recommend i {
    margin-right: 3px;
    font-size: 15px;
}

.selected-network-container {
    background: #f8fafc;
    border-radius: 8px;
    margin: 0 0 18px 0;
    padding: 10px 16px 8px 16px;
    box-shadow: 0 2px 8px rgba(99,102,241,0.06);
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.selected-network-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 8px 0 0;
}
.selected-network-header .selected-network-title-group {
    display: flex;
    align-items: center;
    gap: 8px;
}
.selected-network-header i {
    font-size: 17px;
    margin-right: 4px;
}
.selected-network-header .selected-count {
    background: #38bdf8;
    color: #fff;
    border-radius: 50%;
    font-size: 13px;
    min-width: 22px;
    height: 22px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-left: 4px;
    font-weight: 600;
}
.selected-network-header .selected-network-actions {
    margin-left: 0;
}
.selected-network-item {
    display: inline-flex;
    align-items: center;
    background: #fff;
    border-radius: 6px;
    padding: 4px 12px 4px 8px;
    margin-right: 10px;
    margin-bottom: 4px;
    font-size: 14px;
    color: #333;
    box-shadow: 0 1px 3px rgba(99,102,241,0.07);
    position: relative;
    transition: box-shadow 0.2s;
}
.selected-network-title {
    max-width: 180px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    display: inline-block;
}
.selected-network-remove {
    color: #f87171;
    margin-left: 8px;
    cursor: pointer;
    font-size: 15px;
    transition: color 0.2s;
}
.selected-network-remove:hover {
    color: #b91c1c;
}
.selected-network-empty {
    color: #aaa;
    font-size: 14px;
    padding: 4px 0 4px 2px;
}
@media (max-width: 768px) {
    .selected-network-container {
        padding: 8px 6px 6px 6px;
    }
    .selected-network-title {
        max-width: 110px;
        font-size: 13px;
    }
    .selected-network-header {
        font-size: 14px;
    }
}

.selected-network-collapsible {
    transition: max-height 0.3s;
    overflow: hidden;
}
.selected-network-collapsible.collapsed {
    max-height: 44px;
    padding-bottom: 0;
}
.selected-network-collapsible.visible {
    max-height: 400px;
}
.selected-network-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.selected-network-actions {
    margin-left: 10px;
}
.selected-network-grid {
    margin-top: 4px;
    display: flex;
    flex-wrap: wrap;
    gap: 4px 8px;
} 