/* 全局样式 */
:root {
    --primary-color: #3498db;
    --secondary-color: #2980b9;
    --accent-color: #e74c3c;
    --light-color: #ecf0f1;
    --dark-color: #2c3e50;
    --success-color: #2ecc71;
    --warning-color: #f39c12;
    --danger-color: #e74c3c;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Microsoft YaHei', Arial, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f8f9fa;
}

.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
}

/* 网站公告样式 */
.site-announcement {
    background-color: #e8f4fc;
    padding: 10px 15px;
    margin-bottom: 20px;
    text-align: center;
    color: #333;
    border-radius: 4px;
}

/* 主要内容区域 */
.main-content {
    padding: 30px 0;
    min-height: calc(100vh - 200px);
    margin-bottom: 100px; /* 为固定的页脚留出空间 */
}

.page-title {
    text-align: center;
    margin-bottom: 30px;
    color: var(--dark-color);
}

.subtitle {
    font-size: 18px;
    color: #777;
    text-align: center;
    margin-bottom: 30px;
}

/* 选项卡样式 */
.tabs {
    display: flex;
    justify-content: center;
    margin-bottom: 30px;
    border-bottom: 1px solid #ddd;
}

.tab-item {
    padding: 10px 20px;
    cursor: pointer;
    border-bottom: 3px solid transparent;
    transition: all 0.3s;
}

.tab-item.active {
    border-bottom: 3px solid var(--primary-color);
    color: var(--primary-color);
    font-weight: bold;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* 配置选择区域 */
.config-section {
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    padding: 20px;
    margin-bottom: 30px;
}

.config-title {
    font-size: 18px;
    color: var(--dark-color);
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid #eee;
}

.config-item {
    margin-bottom: 15px;
}

.config-item label {
    display: block;
    margin-bottom: 5px;
    color: #555;
}

.config-item select {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    background-color: white;
}

/* 价格显示 */
.price-display {
    background-color: var(--light-color);
    padding: 15px;
    border-radius: 8px;
    margin-top: 20px;
    text-align: center;
    font-size: 20px;
}

.price-display .total {
    color: var(--accent-color);
    font-weight: bold;
}

/* 按钮样式 */
.btn {
    display: inline-block;
    padding: 10px 20px;
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    text-decoration: none;
    transition: background-color 0.3s;
}

.btn:hover {
    background-color: var(--secondary-color);
}

.btn-block {
    display: block;
    width: 100%;
}

.btn-success {
    background-color: var(--success-color);
}

.btn-success:hover {
    background-color: #27ae60;
}

.btn-danger {
    background-color: var(--danger-color);
}

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

/* 表单样式 */
.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    color: #555;
}

.form-control {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
}

/* 表格样式 */
.table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 20px;
}

.table th, .table td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid #ddd;
}

.table th {
    background-color: #f8f9fa;
    font-weight: bold;
    color: #555;
}

.table tr:hover {
    background-color: #f5f5f5;
}

/* 推荐配置卡片 */
.recommendation-cards {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-top: 20px;
}

.recommendation-card {
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    padding: 20px;
    transition: all 0.3s;
    border: 1px solid #eee;
    display: flex;
    flex-direction: row;
    align-items: flex-start;
}

.recommendation-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.15);
    border-color: var(--primary-color);
}

.recommendation-card h3 {
    color: var(--primary-color);
    margin-bottom: 10px;
    font-size: 20px;
    border-bottom: 1px solid #eee;
    padding-bottom: 10px;
    text-align: left;
}

.recommendation-card .price-range {
    color: var(--accent-color);
    font-weight: bold;
    margin-bottom: 15px;
    font-size: 18px;
    background-color: #f8f9fa;
    padding: 8px 12px;
    border-radius: 4px;
    text-align: left;
    display: inline-block;
}

.recommendation-card ul {
    list-style: none;
    margin-bottom: 15px;
    flex-grow: 1;
}

.recommendation-card ul li {
    padding: 8px 0;
    border-bottom: 1px dashed #eee;
    text-align: left;
}

.recommendation-card ul li:before {
    content: "•";
    color: var(--primary-color);
    margin-right: 8px;
}

.recommendation-card .note {
    background-color: #f8f9fa;
    padding: 10px;
    margin: 10px 0;
    border-radius: 4px;
    font-style: italic;
    font-size: 14px;
    color: #666;
    text-align: left;
}

.card-left {
    flex: 1;
    padding-right: 20px;
    display: flex;
    flex-direction: column;
    min-width: 250px;
}

.card-right {
    flex: 2;
    border-left: 1px solid #eee;
    padding-left: 20px;
}

.card-buttons {
    display: flex;
    gap: 10px;
    margin-top: 15px;
}

.card-buttons .btn {
    flex: 1;
}

/* 响应式调整 */
@media (max-width: 768px) {
    .recommendation-card {
        flex-direction: column;
    }
    
    .card-left {
        padding-right: 0;
        margin-bottom: 20px;
        width: 100%;
    }
    
    .card-right {
        border-left: none;
        border-top: 1px solid #eee;
        padding-left: 0;
        padding-top: 20px;
        width: 100%;
    }
}

/* 预算筛选样式 */
.budget-filter {
    background-color: #f8f9fa;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
    border: 1px solid #eee;
}

.budget-filter h3 {
    margin-top: 0;
    margin-bottom: 15px;
    font-size: 16px;
    color: var(--dark-color);
}

.budget-inputs {
    display: flex;
    gap: 15px;
    margin-bottom: 15px;
}

.budget-inputs .form-group {
    flex: 1;
}

@media (max-width: 768px) {
    .budget-inputs {
        flex-direction: column;
        gap: 10px;
    }
}

/* 页脚样式 */
footer {
    background-color: var(--dark-color);
    color: white;
    padding: 20px 0;
    text-align: center;
    width: 100%;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .header-container {
        flex-direction: column;
    }
    
    .nav-menu {
        margin-top: 15px;
    }
    
    .nav-menu li {
        margin: 0 10px;
    }
    
    .recommendation-cards {
        grid-template-columns: 1fr;
    }
}

/* 后台管理头部样式 */
header {
    background-color: var(--dark-color);
    color: white;
    padding: 15px 0;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.header-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 20px;
    font-weight: bold;
    text-decoration: none;
    color: white;
}

.nav-menu {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
}

.nav-menu li {
    margin-left: 15px;
}

.nav-menu a {
    color: white;
    text-decoration: none;
    padding: 5px 10px;
    border-radius: 4px;
    transition: background-color 0.3s;
    font-size: 14px;
}

.nav-menu a:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

/* 后台管理样式 */
.admin-container {
    display: flex;
}

.admin-sidebar {
    width: 250px;
    background-color: var(--dark-color);
    color: white;
    min-height: calc(100vh - 60px);
    padding: 20px 0;
}

.admin-sidebar ul {
    list-style: none;
}

.admin-sidebar li {
    margin-bottom: 5px;
}

.admin-sidebar a {
    display: block;
    padding: 10px 20px;
    color: white;
    text-decoration: none;
    transition: background-color 0.3s;
}

.admin-sidebar a:hover, .admin-sidebar a.active {
    background-color: rgba(255, 255, 255, 0.1);
}

.admin-content {
    flex: 1;
    padding: 20px;
}

/* 提示框 */
.alert {
    padding: 15px;
    margin-bottom: 20px;
    border-radius: 4px;
}

.alert-success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.alert-danger {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* 加载中动画 */
.loading {
    text-align: center;
    padding: 20px;
}

.loading::after {
    content: "加载中...";
    display: inline-block;
    animation: dots 1.5s infinite;
}

@keyframes dots {
    0%, 20% {
        content: "加载中.";
    }
    40% {
        content: "加载中..";
    }
    60%, 100% {
        content: "加载中...";
    }
}

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

.modal-content {
    background-color: white;
    margin: 5% auto;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
    width: 80%;
    max-width: 600px;
    position: relative;
}

.modal-content.large {
    max-width: 850px;
}

.close {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
}

.close:hover {
    color: black;
}

.image-container {
    margin: 20px 0;
    text-align: center;
    overflow: auto;
}

.image-container canvas {
    max-width: 100%;
    border: 1px solid #ddd;
    background-color: white;
}

.modal-buttons {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 20px;
}

.buttons-container {
    margin-top: 20px;
    text-align: center;
}

