:root {
    --primary-color: #10B981;
    --primary-gradient: linear-gradient(135deg, #10B981 0%, #059669 100%);
    --secondary-color: #064E3B;
    --accent-color: #059669;
    --text-color: #1F2937;
    --text-light: #6B7280;
    --background: #ffffff;
    --surface: rgba(255, 255, 255, 0.95);
    --border: #E5E7EB;
    --shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 25px 50px rgba(16, 185, 129, 0.15);
    --success-color: #10B981;
    --warning-color: #F59E0B;
    --error-color: #EF4444;
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    background: linear-gradient(135deg, #f0fdf4 0%, #d1fae5 50%, #ecfdf5 100%);
    min-height: 100vh;
}

/* 导航栏 */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border);
    z-index: 1000;
    padding: 1rem 0;
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
    text-decoration: none;
}

.nav-links {
    display: flex;
    gap: 2rem;
    list-style: none;
}

.nav-links a {
    color: var(--text-color);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s ease;
}

.nav-links a:hover {
    color: var(--primary-color);
}

.back-button {
    background: transparent;
    color: var(--primary-color);
    padding: 0.5rem 1rem;
    border: 2px solid var(--primary-color);
    border-radius: 20px;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s ease;
}

.back-button:hover {
    background: var(--primary-color);
    color: white;
}

/* 主容器 */
.main-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 6rem 2rem 2rem;
    min-height: 100vh;
}

.page-header {
    text-align: center;
    margin-bottom: 3rem;
}

.page-title {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.page-subtitle {
    font-size: 1.1rem;
    color: var(--text-light);
    max-width: 600px;
    margin: 0 auto;
}

/* 配置器界面 */
.config-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    margin-bottom: 2rem;
}

.input-section, .output-section {
    background: var(--surface);
    border-radius: 20px;
    padding: 2rem;
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
}

.section-title {
    font-size: 1.3rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: var(--text-color);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

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

.form-label {
    display: block;
    font-weight: 500;
    margin-bottom: 0.5rem;
    color: var(--text-color);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.form-select, .form-input {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid var(--border);
    border-radius: 12px;
    font-family: inherit;
    font-size: 0.95rem;
    transition: all 0.3s ease;
    background: white;
}

.form-select:focus, .form-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.1);
}

.form-hint {
    color: var(--text-light);
    font-size: 0.85rem;
    margin-top: 0.5rem;
}

.generate-button {
    width: 100%;
    background: var(--primary-gradient);
    color: white;
    padding: 1rem 2rem;
    border: none;
    border-radius: 12px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(16, 185, 129, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.generate-button:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 25px rgba(16, 185, 129, 0.4);
}

.generate-button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.loading-spinner {
    width: 20px;
    height: 20px;
    border: 2px solid transparent;
    border-top: 2px solid currentColor;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* 分享功能样式 */
.share-section {
    text-align: center;
    margin-top: 2rem;
    padding: 1.5rem;
    background: linear-gradient(135deg, #10B981 0%, #059669 100%);
    border-radius: 12px;
    color: white;
}

.share-btn {
    background: rgba(255, 255, 255, 0.2);
    border: 2px solid rgba(255, 255, 255, 0.3);
    color: white;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    backdrop-filter: blur(10px);
}

.share-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    border-color: rgba(255, 255, 255, 0.5);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
}

.share-btn:active {
    transform: translateY(0);
}

.share-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

.share-btn i {
    font-size: 16px;
}

.share-hint {
    display: block;
    margin-top: 8px;
    font-size: 14px;
    opacity: 0.9;
}

/* 分享弹窗样式 */
.share-modal .modal-content {
    max-width: 500px;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.share-modal-content {
    animation: slideInDown 0.4s ease-out;
}

@keyframes slideInDown {
    from {
        opacity: 0;
        transform: translateY(-50px) scale(0.9);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.share-modal-header {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    text-align: center;
    padding: 24px 20px 20px;
    position: relative;
}

.share-modal-header.error-header {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
}

.success-icon, .error-icon {
    font-size: 48px;
    margin-bottom: 12px;
    opacity: 0.9;
}

.share-modal-header h3 {
    margin: 0;
    font-size: 24px;
    font-weight: 600;
}

.share-modal-header .close {
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 24px;
    color: rgba(255, 255, 255, 0.8);
    cursor: pointer;
    transition: color 0.2s;
}

.share-modal-header .close:hover {
    color: white;
}

.share-modal .modal-body {
    padding: 30px 25px;
    text-align: center;
}

.share-modal .modal-body p {
    font-size: 16px;
    color: #4a5568;
    margin-bottom: 24px;
    line-height: 1.5;
}

.share-tips, .error-tips {
    background: #f7fafc;
    border-radius: 12px;
    padding: 20px;
    margin: 20px 0;
    text-align: left;
}

.tip-item {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
    font-size: 14px;
    color: #2d3748;
}

.tip-item:last-child {
    margin-bottom: 0;
}

.tip-item i {
    color: #10b981;
    font-size: 16px;
    width: 20px;
    flex-shrink: 0;
}

.error-tips .tip-item i {
    color: #ef4444;
}

.share-modal-btn {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    border: none;
    padding: 12px 32px;
    border-radius: 25px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-top: 10px;
}

.share-modal-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(16, 185, 129, 0.4);
}

.share-modal-btn.error-btn {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
}

.share-modal-btn.error-btn:hover {
    box-shadow: 0 8px 25px rgba(239, 68, 68, 0.4);
}

.share-modal-btn i {
    font-size: 16px;
}

/* 输出区域 */
.output-content {
    min-height: 300px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: var(--text-light);
    border: 2px dashed var(--border);
    border-radius: 12px;
    padding: 2rem;
    background: #f9fafb;
}

.output-content.has-result {
    border: 2px solid var(--success-color);
    background: white;
    align-items: flex-start;
    text-align: left;
    display: block;
}

.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

.empty-icon {
    font-size: 3rem;
    opacity: 0.5;
}

/* 配置结果展示 */
.config-summary {
    background: var(--primary-gradient);
    color: white;
    padding: 1.5rem;
    border-radius: 12px;
    margin-bottom: 2rem;
    text-align: center;
}

.config-summary h3 {
    font-size: 1.3rem;
    margin-bottom: 0.5rem;
}

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

.config-card {
    background: #ecfdf5;
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1.5rem;
    transition: all 0.3s ease;
}

.config-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

.config-card.featured {
    background: var(--primary-gradient);
    color: white;
    border-color: var(--primary-color);
}

.config-card h3 {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.config-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
    padding: 0.5rem 0;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

.config-card.featured .config-item {
    border-bottom-color: rgba(255, 255, 255, 0.2);
}

.config-item:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

.config-label {
    font-weight: 500;
}

.config-value {
    color: var(--primary-color);
    font-weight: 600;
}

.config-card.featured .config-value {
    color: white;
}

/* 其他区域 */
.recommendation-reason, .budget-estimate {
    background: var(--surface);
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    border-left: 4px solid var(--primary-color);
}

.recommendation-reason h3, .budget-estimate h3 {
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.budget-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

.budget-item {
    background: white;
    padding: 1rem;
    border-radius: 8px;
    text-align: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.budget-price {
    font-size: 1.3rem;
    font-weight: bold;
    color: var(--primary-color);
}

/* AI咨询区域 */
.ai-consultation {
    background: var(--surface);
    border-radius: 20px;
    padding: 2rem;
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
    margin-top: 2rem;
}

.consultation-form textarea {
    width: 100%;
    padding: 1rem;
    border: 2px solid var(--border);
    border-radius: 12px;
    font-family: inherit;
    font-size: 0.95rem;
    resize: vertical;
    min-height: 80px;
    transition: all 0.3s ease;
}

.consultation-form textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.1);
}

.ai-btn {
    background: var(--primary-gradient);
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 1rem;
}

.ai-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(16, 185, 129, 0.3);
}

.ai-response {
    background: #ecfdf5;
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1.5rem;
    margin-top: 1rem;
}

.ai-response h3 {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.response-content {
    color: var(--text-light);
    line-height: 1.6;
    white-space: pre-line;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .nav-container {
        padding: 0 1rem;
    }

    .nav-links {
        display: none;
    }

    .main-container {
        padding: 5rem 1rem 2rem;
    }

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

    .input-section, .output-section {
        padding: 1.5rem;
    }

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

/* 动画效果 */
.fade-in {
    animation: fadeIn 0.5s ease-in;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* 错误提示 */
.error-message {
    background: #FEF2F2;
    border: 1px solid #FECACA;
    color: #DC2626;
    padding: 1rem;
    border-radius: 8px;
    margin-top: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* 结果区域样式 */
.result-section {
    background: var(--surface);
    border-radius: 20px;
    padding: 2rem;
    margin-top: 2rem;
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
}

.reason-point {
    background: #ecfdf5;
    padding: 0.75rem;
    margin-bottom: 0.5rem;
    border-radius: 8px;
    border-left: 3px solid var(--primary-color);
}

.ai-suggestions {
    background: var(--surface);
    border-radius: 12px;
    padding: 1.5rem;
    margin-top: 1.5rem;
    border-left: 4px solid var(--success-color);
}

.suggestion-item {
    background: #d1fae5;
    padding: 1rem;
    margin-bottom: 1rem;
    border-radius: 8px;
    border-left: 3px solid var(--success-color);
}

.suggestion-title {
    font-weight: 600;
    color: var(--text-color);
    margin-bottom: 0.5rem;
}

.ai-enhanced-badge {
    background: var(--success-color);
    color: white;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    margin-left: 0.5rem;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
}

/* 弹出框样式 */
.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(5px);
}

.modal-content {
    background-color: white;
    margin: 10% auto;
    padding: 0;
    border-radius: 20px;
    width: 90%;
    max-width: 500px;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.25);
    animation: modalSlideIn 0.3s ease;
    overflow: hidden;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-50px) scale(0.8);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.modal-header {
    background: var(--primary-gradient);
    color: white;
    padding: 20px 25px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    margin: 0;
    font-size: 1.3rem;
    font-weight: 600;
}

.close {
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    color: white;
    transition: all 0.3s ease;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

.close:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.1);
}

.modal-body {
    padding: 30px 25px;
    text-align: center;
}

.modal-body p {
    margin: 0 0 20px 0;
    color: var(--text-color);
    font-size: 1.1rem;
}

.contact-info {
    background: #ecfdf5;
    padding: 20px;
    border-radius: 12px;
    line-height: 1.8;
    color: var(--text-light);
    font-size: 0.95rem;
    margin-top: 20px;
}

.contact-info a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
}

.contact-info a:hover {
    text-decoration: underline;
}

/* 二维码容器样式 */
.qr-container {
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 20px 0;
    padding: 15px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    border: 2px solid #d1fae5;
}

.qr-code {
    max-width: 180px;
    max-height: 180px;
    width: 100%;
    height: auto;
    border-radius: 8px;
    display: block;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* 响应式二维码 */
@media (max-width: 480px) {
    .qr-code {
        max-width: 150px;
        max-height: 150px;
    }
    
    .qr-container {
        margin: 15px 0;
        padding: 12px;
    }
}

/* 问号提示样式 */
.help-tooltip {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.help-icon {
    width: 16px;
    height: 16px;
    background: var(--primary-color);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    font-weight: bold;
    cursor: help;
    transition: all 0.3s ease;
    position: relative;
}

.help-icon:hover {
    background: var(--accent-color);
    transform: scale(1.1);
}

.tooltip-content {
    position: absolute;
    bottom: 25px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--text-color);
    color: white;
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: normal;
    line-height: 1.4;
    white-space: normal;
    min-width: 280px;
    max-width: 400px;
    width: max-content;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    pointer-events: none;
}

.tooltip-content::before {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 50%;
    transform: translateX(-50%);
    border-left: 5px solid transparent;
    border-right: 5px solid transparent;
    border-top: 5px solid var(--text-color);
}

.help-icon:hover .tooltip-content {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(-5px);
}

/* 响应式提示框 */
@media (max-width: 768px) {
    .tooltip-content {
        position: fixed;
        top: 60px;
        bottom: auto;
        left: 20px;
        right: 20px;
        transform: none;
        min-width: auto;
        max-width: none;
        width: calc(100vw - 40px);
        white-space: normal;
    }
    
    .tooltip-content::before {
        top: -5px;
        bottom: auto;
        left: 50%;
        transform: translateX(-50%);
        border-bottom: 5px solid var(--text-color);
        border-top: none;
    }
    
    .help-icon:hover .tooltip-content {
        transform: translateY(5px);
    }
}

/* 加载中覆盖层 */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(5px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.loading-content {
    text-align: center;
    color: white;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 5px solid rgba(255, 255, 255, 0.3);
    border-top: 5px solid white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}
