/* 全局样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f5f7fa;
    color: #333;
    height: 100vh;
    display: flex;
    flex-direction: column;
}

/* 澶撮儴鏍峰紡 */
.header {
    background-color: #4a6cf7;
    color: white;
    padding: 0.8rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.header h1 {
    font-size: 1.5rem;
    font-weight: 600;
}

.light-text {
    font-weight: 300;
}

.header-controls {
    display: flex;
    gap: 1rem;
}

/* 按钮样式 */
.btn {
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.2s ease;
}

.btn-primary {
    background-color: #4a6cf7;
    color: white;
}

.btn-primary:hover {
    background-color: #3a5ce5;
}

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

.btn-secondary:hover {
    background-color: #5a6268;
}

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

.btn-danger:hover {
    background-color: #c82333;
}

/* 主容器样式 */
.main-container {
    display: flex;
    flex-direction: column;
    flex: 1;
    overflow: hidden;
}

/* 网页浏览容器样式 */
.browsers-container {
    display: flex;
    flex: 1;
    padding: 1rem;
    gap: 1rem;
    overflow: hidden;
}

.browser-wrapper {
    flex: 1;
    display: flex;
    flex-direction: column;
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    min-width: 0;
}

.browser-header {
    padding: 0.75rem 1rem;
    background-color: #f8f9fa;
    border-bottom: 1px solid #e9ecef;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.browser-title {
    font-weight: 600;
    font-size: 0.9rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 70%;
}

.browser-controls {
    display: flex;
    gap: 0.5rem;
}

.browser-controls button {
    background: none;
    border: none;
    cursor: pointer;
    color: #6c757d;
    font-size: 0.8rem;
    padding: 0.25rem;
    border-radius: 3px;
}

.browser-controls button:hover {
    background-color: #e9ecef;
    color: #495057;
}

.browser-content {
    flex: 1;
    position: relative;
    overflow: hidden;
}

.browser-iframe {
    width: 100%;
    height: 100%;
    border: none;
}

/* 输入区域样式 */
.input-section {
    padding: 1rem;
    background-color: white;
    border-top: 1px solid #e9ecef;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.05);
}

.single-input-container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    height: 80px;
}

.prompt-input {
    flex: 1;
    padding: 0.75rem;
    border: 1px solid #ced4da;
    border-radius: 4px;
    font-family: inherit;
    font-size: 0.95rem;
    resize: none;
    min-height: 100%;
}

.prompt-input:focus {
    outline: none;
    border-color: #4a6cf7;
    box-shadow: 0 0 0 2px rgba(74, 108, 247, 0.2);
}

.input-controls {
    display: flex;
    gap: 0.5rem;
}

.btn-outline {
    background-color: transparent;
    border: 1px solid #4a6cf7;
    color: #4a6cf7;
}

.btn-outline:hover {
    background-color: #4a6cf7;
    color: white;
}

/* 模板列表样式 */
.template-list {
    max-height: 300px;
    overflow-y: auto;
}

.template-item {
    padding: 0.75rem;
    border-bottom: 1px solid #e9ecef;
    cursor: pointer;
    transition: background-color 0.2s;
}

.template-item:hover {
    background-color: #f8f9fa;
}

.template-item:last-child {
    border-bottom: none;
}

.template-name {
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.template-preview {
    font-size: 0.9rem;
    color: #6c757d;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .single-input-container {
        flex-direction: column;
        height: auto;
        align-items: stretch;
    }
    
    .input-controls {
        margin-top: 0.5rem;
    }
    
    .prompt-input {
        min-height: 80px;
    }
}

/* 文件上传样式 */
.file-upload-container {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.file-upload-label {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background-color: #f8f9fa;
    border: 1px dashed #ced4da;
    border-radius: 4px;
    cursor: pointer;
    width: fit-content;
    transition: all 0.2s ease;
}

.file-upload-label:hover {
    background-color: #e9ecef;
}

#file-upload {
    display: none;
}

.file-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.file-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.25rem 0.5rem;
    background-color: #e9ecef;
    border-radius: 4px;
    font-size: 0.85rem;
}

.file-item button {
    background: none;
    border: none;
    color: #dc3545;
    cursor: pointer;
    font-size: 0.8rem;
}

/* 模态框样式 */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    overflow: auto;
}

.modal-content {
    background-color: white;
    margin: 5% auto;
    padding: 0;
    border-radius: 8px;
    width: 80%;
    max-width: 800px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}

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

.modal-header h2 {
    font-size: 1.25rem;
    color: #495057;
}

.close {
    color: #aaa;
    font-size: 1.5rem;
    font-weight: bold;
    cursor: pointer;
}

.close:hover {
    color: #000;
}

.modal-body {
    padding: 1.5rem;
}

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

/* 设置页面样式 */
.settings-section {
    margin-bottom: 2rem;
}

.settings-section h3 {
    margin-bottom: 1rem;
    color: #495057;
    font-size: 1.1rem;
}

.website-list {
    margin-bottom: 1rem;
    max-height: 200px;
    overflow-y: auto;
    border: 1px solid #e9ecef;
    border-radius: 4px;
    padding: 0.5rem;
}

.website-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem;
    border-bottom: 1px solid #f1f3f5;
}

.website-item:last-child {
    border-bottom: none;
}

.website-info {
    flex: 1;
}

.website-name {
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.website-url {
    font-size: 0.85rem;
    color: #6c757d;
}

.website-controls {
    display: flex;
    gap: 0.25rem;
}

.website-controls button {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.25rem;
    border-radius: 3px;
    color: #6c757d;
    transition: all 0.2s ease;
}

.website-controls button:hover {
    background-color: #f1f3f5;
    color: #495057;
}

.website-controls button:disabled {
    color: #dee2e6;
    cursor: not-allowed;
}

.website-controls button:disabled:hover {
    background-color: transparent;
}

.sort-btn {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.sort-btn:hover:not(:disabled) {
    background-color: #e9ecef;
    color: #007bff;
}

.add-website {
    display: flex;
    gap: 0.5rem;
}

.add-website input {
    flex: 1;
    padding: 0.5rem;
    border: 1px solid #ced4da;
    border-radius: 4px;
}

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

.display-settings select {
    padding: 0.5rem;
    border: 1px solid #ced4da;
    border-radius: 4px;
}

/* 导出页面样式 */
.export-options {
    margin-bottom: 1.5rem;
}

.export-options h3 {
    margin-bottom: 1rem;
    color: #495057;
}

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

.radio-group label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
}

.export-preview {
    border: 1px solid #e9ecef;
    border-radius: 4px;
    padding: 1rem;
    max-height: 300px;
    overflow-y: auto;
}

/* 保存模板弹窗样式 */
.save-template-modal {
    max-width: 600px;
}

.save-template-modal .modal-header h2 {
    color: #4a6cf7;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.save-template-modal .form-group {
    margin-bottom: 1.5rem;
}

.save-template-modal .form-group label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: #495057;
}

.save-template-modal .form-control {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #ced4da;
    border-radius: 4px;
    font-family: inherit;
    font-size: 0.95rem;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.save-template-modal .form-control:focus {
    outline: none;
    border-color: #4a6cf7;
    box-shadow: 0 0 0 2px rgba(74, 108, 247, 0.2);
}

.save-template-modal .form-text {
    display: block;
    margin-top: 0.25rem;
    font-size: 0.85rem;
    color: #6c757d;
}

.save-template-modal .form-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 0.5rem;
}

.save-template-modal .char-count {
    font-size: 0.85rem;
    color: #6c757d;
}

.save-template-modal .btn-sm {
    padding: 0.25rem 0.5rem;
    font-size: 0.85rem;
}

/* 模板列表样式 */
.template-item {
    padding: 1rem;
    border: 1px solid #e9ecef;
    border-radius: 4px;
    margin-bottom: 0.75rem;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
}

.template-item:hover {
    border-color: #4a6cf7;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.template-name {
    font-weight: 600;
    margin-bottom: 0.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.template-preview {
    color: #6c757d;
    font-size: 0.9rem;
    white-space: pre-wrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-height: 3.6em;
    line-height: 1.2;
}

.template-category {
    display: inline-block;
    padding: 0.25rem 0.5rem;
    background-color: #e9ecef;
    color: #495057;
    border-radius: 4px;
    font-size: 0.8rem;
    margin-top: 0.5rem;
}

.template-actions {
    display: flex;
    gap: 0.5rem;
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.template-item:hover .template-actions {
    opacity: 1;
}

.template-action-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.25rem;
    border-radius: 3px;
    color: #6c757d;
    transition: all 0.2s ease;
}

.template-action-btn:hover {
    background-color: #f1f3f5;
}

.template-action-btn.favorite {
    color: #adb5bd; /* 未收藏时使用灰色 */
    font-size: 1rem;
    transition: all 0.2s ease;
}

.template-action-btn.favorite.active {
    color: #ffc107; /* 收藏时使用金黄色 */
    transform: scale(1.2); /* 收藏时放大 */
    text-shadow: 0 0 3px rgba(255, 193, 7, 0.5); /* 添加光晕效果 */
}

.template-action-btn.favorite:hover {
    color: #ffc107; /* 悬停时显示金黄色 */
    transform: scale(1.1); /* 悬停时轻微放大 */
}

.template-action-btn.favorite.active:hover {
    transform: scale(1.3); /* 已收藏状态下悬停时进一步放大 */
}

.template-action-btn.delete {
    color: #dc3545;
}

.template-action-btn.delete:hover {
    color: #c82333;
}

.template-tabs {
    display: flex;
    border-bottom: 1px solid #e9ecef;
    margin-bottom: 1rem;
}

.template-tab {
    padding: 0.75rem 1rem;
    background: none;
    border: none;
    cursor: pointer;
    color: #6c757d;
    font-weight: 500;
    transition: all 0.2s ease;
    position: relative;
}

.template-tab:hover {
    color: #495057;
}

.template-tab.active {
    color: #4a6cf7;
}

.template-tab.active::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    width: 100%;
    height: 2px;
    background-color: #4a6cf7;
}

.no-templates {
    text-align: center;
    padding: 2rem;
    color: #6c757d;
}

.no-templates i {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

/* 响应式设计 */
@media (max-width: 1200px) {
    .browsers-container {
        flex-wrap: wrap;
    }
    
    .browser-wrapper {
        min-width: 48%;
    }
}

@media (max-width: 768px) {
    .header {
        padding: 1rem;
        flex-direction: column;
        gap: 1rem;
    }
    
    .header h1 {
        font-size: 1.25rem;
    }
    
    .browsers-container {
        flex-direction: column;
    }
    
    .browser-wrapper {
        min-width: 100%;
        height: 300px;
    }
    
    .input-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
    
    .add-website {
        flex-direction: column;
    }
    
    .modal-content {
        width: 95%;
        margin: 2% auto;
    }
}

/* 通知容器样式 */
.notification-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 10px;
    pointer-events: none;
}

.notification {
    background-color: white;
    border-radius: 4px;
    padding: 12px 16px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 250px;
    max-width: 350px;
    pointer-events: auto;
    opacity: 0;
    transform: translateX(100%);
    transition: all 0.3s ease;
}

.notification.show {
    opacity: 1;
    transform: translateX(0);
}

.notification.success {
    border-left: 4px solid #28a745;
}

.notification.error {
    border-left: 4px solid #dc3545;
}

.notification.warning {
    border-left: 4px solid #ffc107;
}

.notification.info {
    border-left: 4px solid #17a2b8;
}

.notification i {
    font-size: 1.2rem;
}

.notification.success i {
    color: #28a745;
}

.notification.error i {
    color: #dc3545;
}

.notification.warning i {
    color: #ffc107;
}

.notification.info i {
    color: #17a2b8;
}

.notification-message {
    flex: 1;
    font-size: 0.9rem;
    line-height: 1.4;
}

.notification-close {
    background: none;
    border: none;
    color: #6c757d;
    cursor: pointer;
    font-size: 0.8rem;
    padding: 0;
    margin-left: 5px;
}

.notification-close:hover {
    color: #495057;
}

/* 页脚样式 */
.footer {
    width: 100%;
    padding: 0.1rem 0 0.5rem 0;
    text-align: center;
    margin-top: 0;
}

.beian {
    display: inline-block;
}

.beian a {
    color: #adb5bd; /* 浅灰色文字 */
    font-size: 0.75rem; /* 小字体 */
    text-decoration: none;
    transition: color 0.2s ease;
}

.beian a:hover {
    color: #6c757d; /* 悬停时稍微深一点的灰色 */
    text-decoration: underline;
}