body {
    font-family: Arial, sans-serif;
    margin: 0;
    padding: 0;
    min-height: 100vh;
    display: flex;
    background-color: #f5f5f5;
}

.content-wrapper {
    width: 70%;
    height: 100vh;
    overflow-y: auto;
    padding: 20px;
    box-sizing: border-box;
    background-color: white;
    box-shadow: 2px 0 5px rgba(0, 0, 0, 0.1);
}

.sidebar {
    width: 30%;
    height: 100vh;
    overflow-y: auto;
    padding: 20px;
    box-sizing: border-box;
    background-color: white;
    border-left: 1px solid #eee;
}

.subtitle {
    text-align: center; 
    font-size: 16px;
    color: #555;
    margin: 10px 0;
}

.alert-container {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1000;
}

.alert {
    padding: 10px 20px;
    border-radius: 5px;
    margin-bottom: 10px;
    font-weight: bold;
}

.alert.error {
    background-color: #ffcccc;
    color: #cc0000;
}

.alert.success {
    background-color: #ccffcc;
    color: #006600;
}

/* Scrollbar Styling */
.content-wrapper::-webkit-scrollbar,
.sidebar::-webkit-scrollbar {
    width: 8px;
}

.content-wrapper::-webkit-scrollbar-track,
.sidebar::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.content-wrapper::-webkit-scrollbar-thumb,
.sidebar::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 4px;
}

.content-wrapper::-webkit-scrollbar-thumb:hover,
.sidebar::-webkit-scrollbar-thumb:hover {
    background: #555;
}

h2 {
    color: #333;
    text-align: center;
    margin-bottom: 1.5rem;
    font-size: 1.8rem;
}

.small-links {
    display: flex;
    justify-content: center;
    gap: 25px;
    margin-bottom: 20px;
}

.small-links a {
    color: #666;
    text-decoration: none;
    transition: color 0.3s;
}

.small-links a:hover {
    color: #007bff;
}

.form-wrapper {
    width: 100%;
    max-width: 600px;
    margin: 0 auto;
    background-color: #fff;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.form-row {
    display: flex;
    align-items: center;
    margin-bottom: 20px;
    justify-content: center;
    margin-left: 115px;
    flex-wrap: nowrap;
}

.form-row label {
    min-width: 45px;
    margin-right: 15px;
    color: #555;
    font-weight: 500;
}

.form-row > div {
    flex: 1;
    display: flex;
    gap: 10px;
}

select, input[type="text"] {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    transition: border-color 0.3s;
}

select:focus, input[type="text"]:focus {
    border-color: #007bff;
    outline: none;
    box-shadow: 0 0 0 2px rgba(0,123,255,0.25);
}

.button-group {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-top: 25px;
}

.button-group button {
    padding: 10px 20px;
    border: none;
    border-radius: 4px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s;
    background-color: #007bff;
    color: white;
}

.button-group button:hover {
    background-color: #0056b3;
    transform: translateY(-1px);
}

#generateBtn { background-color: #28a745; }
#generateBtn:hover { background-color: #218838; }

#clearBtn { background-color: #dc3545; }
#clearBtn:hover { background-color: #c82333; }

#copyBtn { background-color: #17a2b8; }
#copyBtn:hover { background-color: #138496; }

#uploadBtn { background-color: #6610f2; }
#uploadBtn:hover { background-color: #520dc2; }

.history-title {
    color: #333;
    text-align: center;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid #eee;
}

#historyContent {
    font-size: 14px;
    line-height: 1.6;
    color: #666;
}

/* Updated Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
}

.modal-content {
    background-color: #FFFFFF;
    margin: 2rem auto;
    padding: 2rem;
    border-radius: 1rem;
    width: 90%;
    max-width: 600px;
    max-height: 85vh;
    position: relative;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
    overflow-y: auto;
}

/* Modal Content Scrollbar */
.modal-content::-webkit-scrollbar {
    width: 6px;
}

.modal-content::-webkit-scrollbar-track {
    background: transparent;
}

.modal-content::-webkit-scrollbar-thumb {
    background-color: #CBD5E1;
    border-radius: 3px;
}

.modal-content::-webkit-scrollbar-thumb:hover {
    background-color: #94A3B8;
}

/* Modal Header */
.modal-header {
    position: sticky;
    top: 0;
    background-color: #FFFFFF;
    padding: 0.5rem 0;
    margin-bottom: 1.5rem;
    z-index: 1;
}

.title {
    font-size: 1.8rem;
    font-weight: 700;
    color: #4F46E5;
    margin: 0;
    letter-spacing: -0.025em;
}

/* Close Button */
.close-btn {
    position: absolute;
    right: 1.5rem;
    top: 1.5rem;
    font-size: 1.5rem;
    cursor: pointer;
    color: #6B7280;
    transition: color 0.2s ease;
    z-index: 2;
}

.close-btn:hover {
    color: #1F2937;
}

/* Section Styling */
.section {
    border-left: 2px solid #E5E7EB;
    padding-left: 1rem;
    margin-bottom: 1.5rem;
}

.section-title {
    font-weight: 600;
    color: #4F46E5;
    margin-bottom: 1rem;
    font-size: 1.1rem;
}

/* Content List Styling */
.content-list {
    list-style: none;
    padding-left: 0;
    margin: 0;
}

.content-list li {
    position: relative;
    padding-left: 1rem;
    margin-bottom: 0.75rem;
    color: #4B5563;
}

.content-list li::before {
    content: "◦";
    position: absolute;
    left: 0;
    color: #6B7280;
}

.content-list ul {
    list-style: none;
    padding-left: 1rem;
    margin-top: 0.5rem;
}

/* Highlight Text */
.highlight {
    color: #EF4444;
    font-weight: 500;
    padding: 0.5rem;
    border: 1px solid #FCA5A5;
    border-radius: 0.5rem;
    background-color: #FEF2F2;
    display: inline-block;
    margin: 0.25rem 0;
}

/* Responsive Design */
@media (max-width: 768px) {
    body {
        flex-direction: column;
        margin: 0;
    }

    .modal { 
        padding: 20px; 
        box-sizing: border-box; 
    }

    .modal-content { 
        width: 90%; 
        max-width: none; 
        margin: 2rem auto;
        padding: 1rem; 
    } 

    .content-wrapper, .sidebar {
        width: 100%;
        height: auto;
        min-height: 50vh; /* 确保有最小高度 */
        padding: 15px;
        box-sizing: border-box;
        background-color: white;
        margin-bottom: 10px; /* 添加底部间距 */
    }

    .sidebar {
        border-top: 1px solid #eee;
        box-shadow: 0 -2px 5px rgba(0, 0, 0, 0.05);
        padding: 15px;
        margin: 0;
        border-radius: 15px 15px 0 0; /* 添加圆角 */
    }

    .subtitle {
        text-align: center;
        font-size: 14px;
        margin: 8px 0;
    }

    .form-wrapper {
        width: 95%; /* 稍微收窄一点 */
        max-width: none;
        margin: 10px auto;
        padding: 15px;
        border-radius: 8px;
        box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    }

    .form-row {
        flex-direction: column;
        align-items: flex-start;
        margin-left: 0;
        margin-bottom: 15px;
        width: 100%;
        padding: 0 10px; /* 添加左右内边距 */
    }

    .form-row label {
        margin-bottom: 5px; /* 标签下方添加间距 */
        font-weight: 500;
    }

    .form-row > div {
        width: 100%;
    }

    select, input[type="text"] {
        width: 100%;
        padding: 8px 10px;
        font-size: 14px;
        margin-bottom: 5px;
    }

    .button-group {
        flex-direction: column;
        gap: 10px;
        padding: 0 10px;
    }

    .button-group button {
        width: 100%;
        margin: 0;
        padding: 12px;
    }

    /* 历史记录部分样式优化 */
    .history-title {
        font-size: 1.2rem;
        padding: 10px 0;
        margin: 0 0 10px 0;
    }

    #historyContent {
        padding: 10px;
        background-color: #f8f9fa;
        border-radius: 8px;
        margin: 0 5px;
    }

}