/*
 * 腾浪(Tilla)平台 - 全局样式
 * 支持12种语言的国际化供需信息平台
 */

:root {
    --primary-color: #2563eb;
    --primary-dark: #1d4ed8;
    --secondary-color: #f59e0b;
    --success-color: #10b981;
    --danger-color: #ef4444;
    --warning-color: #f59e0b;
    --info-color: #3b82f6;
    --dark-color: #1f2937;
    --light-color: #f3f4f6;
    --white: #ffffff;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-300: #d1d5db;
    --gray-400: #9ca3af;
    --gray-500: #6b7280;
    --gray-600: #4b5563;
    --gray-700: #374151;
    --gray-800: #1f2937;
    --gray-900: #111827;
    
    --gradient-primary: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
    --gradient-secondary: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    --gradient-dark: linear-gradient(135deg, #1f2937 0%, #111827 100%);
    
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    
    --border-radius-sm: 0.375rem;
    --border-radius: 0.5rem;
    --border-radius-lg: 0.75rem;
    --border-radius-xl: 1rem;
    --border-radius-full: 9999px;
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', sans-serif;
    line-height: 1.6;
    color: var(--gray-800);
    background-color: var(--gray-100);
    min-height: 100vh;
}

/* 导航栏 */
.navbar {
    background: var(--white);
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.navbar-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 64px;
}

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

.logo-icon {
    width: 40px;
    height: 40px;
    background: var(--gradient-primary);
    border-radius: var(--border-radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--white);
    font-size: 1.25rem;
}

.nav-menu {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    list-style: none;
}

.nav-link {
    padding: 0.5rem 1rem;
    text-decoration: none;
    color: var(--gray-600);
    font-weight: 500;
    border-radius: var(--border-radius);
    transition: all 0.2s;
}

.nav-link:hover,
.nav-link.active {
    color: var(--primary-color);
    background: var(--gray-100);
}

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

/* 语言选择器 */
.lang-selector {
    position: relative;
}

.lang-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border: 1px solid var(--gray-200);
    background: var(--white);
    border-radius: var(--border-radius);
    cursor: pointer;
    font-size: 0.875rem;
    transition: all 0.2s;
}

.lang-btn:hover {
    border-color: var(--primary-color);
}

.lang-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 0.5rem;
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-lg);
    min-width: 200px;
    max-height: 400px;
    overflow-y: auto;
    display: none;
}

.lang-dropdown.show {
    display: block;
}

.lang-option {
    padding: 0.75rem 1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    transition: background 0.2s;
}

.lang-option:hover {
    background: var(--gray-100);
}

.lang-option.active {
    background: var(--primary-color);
    color: var(--white);
}

/* 按钮样式 */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.625rem 1.25rem;
    font-size: 0.875rem;
    font-weight: 600;
    text-decoration: none;
    border: none;
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: all 0.2s;
}

.btn-primary {
    background: var(--gradient-primary);
    color: var(--white);
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

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

.btn-outline {
    background: transparent;
    border: 1px solid var(--gray-300);
    color: var(--gray-700);
}

.btn-outline:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.btn-lg {
    padding: 0.875rem 2rem;
    font-size: 1rem;
}

/* 主容器 */
.main-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem 1.5rem;
}

/* 页面标题 */
.page-header {
    margin-bottom: 2rem;
}

.page-title {
    font-size: 1.875rem;
    font-weight: 700;
    color: var(--gray-900);
    margin-bottom: 0.5rem;
}

.page-subtitle {
    color: var(--gray-500);
}

/* 卡片 */
.card {
    background: var(--white);
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow);
    overflow: hidden;
    transition: all 0.3s;
}

.card:hover {
    box-shadow: var(--shadow-lg);
}

.card-header {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--gray-200);
}

.card-body {
    padding: 1.5rem;
}

.card-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--gray-200);
    background: var(--gray-50);
}

/* 网格布局 */
.grid {
    display: grid;
    gap: 1.5rem;
}

.grid-cols-1 { grid-template-columns: repeat(1, 1fr); }
.grid-cols-2 { grid-template-columns: repeat(2, 1fr); }
.grid-cols-3 { grid-template-columns: repeat(3, 1fr); }
.grid-cols-4 { grid-template-columns: repeat(4, 1fr); }
.grid-cols-5 { grid-template-columns: repeat(5, 1fr); }
.grid-cols-6 { grid-template-columns: repeat(6, 1fr); }
.grid-cols-7 { grid-template-columns: repeat(7, 1fr); }

/* 分类卡片 */
.category-card {
    background: var(--white);
    border-radius: var(--border-radius-xl);
    padding: 1.5rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
    border: 2px solid transparent;
}

.category-card:hover {
    transform: translateY(-4px);
    border-color: var(--primary-color);
    box-shadow: var(--shadow-xl);
}

.category-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto 1rem;
    border-radius: var(--border-radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.75rem;
}

.category-icon.craftsman { background: linear-gradient(135deg, #8b5cf6 0%, #7c3aed 100%); }
.category-icon.marriage { background: linear-gradient(135deg, #ec4899 0%, #db2777 100%); }
.category-icon.realestate { background: linear-gradient(135deg, #10b981 0%, #059669 100%); }
.category-icon.automotive { background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%); }
.category-icon.goods { background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%); }
.category-icon.services { background: linear-gradient(135deg, #06b6d4 0%, #0891b2 100%); }
.category-icon.freight { background: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%); }

.category-name {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--gray-800);
    margin-bottom: 0.25rem;
}

.category-desc {
    font-size: 0.875rem;
    color: var(--gray-500);
}

/* 信息卡片 */
.info-card {
    background: var(--white);
    border-radius: var(--border-radius-lg);
    padding: 1.25rem;
    border: 1px solid var(--gray-200);
    transition: all 0.2s;
}

.info-card:hover {
    border-color: var(--primary-color);
    box-shadow: var(--shadow-md);
}

.info-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 0.75rem;
}

.info-type {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.75rem;
    border-radius: var(--border-radius-full);
    font-size: 0.75rem;
    font-weight: 600;
}

.info-type.supply {
    background: #dbeafe;
    color: #1e40af;
}

.info-type.demand {
    background: #fce7f3;
    color: #9d174d;
}

.info-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--gray-800);
    margin-bottom: 0.5rem;
    line-height: 1.4;
}

.info-content {
    font-size: 0.875rem;
    color: var(--gray-600);
    margin-bottom: 0.75rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.info-meta {
    display: flex;
    align-items: center;
    gap: 1rem;
    font-size: 0.75rem;
    color: var(--gray-500);
}

.info-meta span {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

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

.form-label {
    display: block;
    margin-bottom: 0.5rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--gray-700);
}

.form-input,
.form-select,
.form-textarea {
    width: 100%;
    padding: 0.625rem 0.875rem;
    border: 1px solid var(--gray-300);
    border-radius: var(--border-radius);
    font-size: 0.875rem;
    transition: all 0.2s;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.form-textarea {
    resize: vertical;
    min-height: 120px;
}

/* 搜索框 */
.search-box {
    position: relative;
    max-width: 600px;
    margin: 0 auto;
}

.search-input {
    width: 100%;
    padding: 1rem 3rem 1rem 1.25rem;
    border: 2px solid var(--gray-200);
    border-radius: var(--border-radius-full);
    font-size: 1rem;
    transition: all 0.2s;
}

.search-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.1);
}

.search-btn {
    position: absolute;
    right: 0.5rem;
    top: 50%;
    transform: translateY(-50%);
    padding: 0.625rem 1.5rem;
    background: var(--gradient-primary);
    color: var(--white);
    border: none;
    border-radius: var(--border-radius-full);
    cursor: pointer;
    font-weight: 600;
}

/* Hero区域 */
.hero {
    background: linear-gradient(135deg, #1e3a8a 0%, #3b82f6 50%, #2563eb 100%);
    color: var(--white);
    padding: 4rem 0;
    text-align: center;
}

.hero-title {
    font-size: 2.5rem;
    font-weight: 800;
    margin-bottom: 1rem;
}

.hero-subtitle {
    font-size: 1.125rem;
    opacity: 0.9;
    margin-bottom: 2rem;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.hero-stats {
    display: flex;
    justify-content: center;
    gap: 3rem;
    margin-top: 3rem;
}

.stat-item {
    text-align: center;
}

.stat-value {
    font-size: 2rem;
    font-weight: 700;
}

.stat-label {
    font-size: 0.875rem;
    opacity: 0.8;
}

/* 特色功能区 */
.feature-section {
    padding: 4rem 0;
}

.section-title {
    text-align: center;
    margin-bottom: 3rem;
}

.section-title h2 {
    font-size: 1.875rem;
    font-weight: 700;
    color: var(--gray-900);
    margin-bottom: 0.5rem;
}

.section-title p {
    color: var(--gray-500);
}

.feature-card {
    background: var(--white);
    border-radius: var(--border-radius-xl);
    padding: 2rem;
    text-align: center;
    transition: all 0.3s;
    border: 1px solid var(--gray-200);
}

.feature-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-xl);
}

.feature-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 1.5rem;
    border-radius: var(--border-radius-xl);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
}

.feature-icon.gratitude { background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%); }
.feature-icon.huoleme { background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%); }
.feature-icon.debt { background: linear-gradient(135deg, #10b981 0%, #059669 100%); }
.feature-icon.lookalike { background: linear-gradient(135deg, #8b5cf6 0%, #7c3aed 100%); }

.feature-title {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
    color: var(--gray-800);
}

.feature-desc {
    color: var(--gray-500);
    font-size: 0.875rem;
    line-height: 1.6;
}

/* 底部 */
.footer {
    background: var(--gray-900);
    color: var(--gray-300);
    padding: 3rem 0 1.5rem;
    margin-top: 4rem;
}

.footer-content {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 1.5rem;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 2rem;
    margin-bottom: 2rem;
}

.footer-section h4 {
    color: var(--white);
    font-size: 1rem;
    margin-bottom: 1rem;
}

.footer-section ul {
    list-style: none;
}

.footer-section li {
    margin-bottom: 0.5rem;
}

.footer-section a {
    color: var(--gray-400);
    text-decoration: none;
    font-size: 0.875rem;
    transition: color 0.2s;
}

.footer-section a:hover {
    color: var(--white);
}

.footer-bottom {
    border-top: 1px solid var(--gray-800);
    padding-top: 1.5rem;
    text-align: center;
    font-size: 0.875rem;
    color: var(--gray-500);
}

/* 响应式设计 */
@media (max-width: 1024px) {
    .grid-cols-4 { grid-template-columns: repeat(2, 1fr); }
    .grid-cols-5 { grid-template-columns: repeat(3, 1fr); }
    .grid-cols-6 { grid-template-columns: repeat(3, 1fr); }
    .grid-cols-7 { grid-template-columns: repeat(4, 1fr); }
    
    .footer-content {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .navbar-container {
        padding: 0 1rem;
    }
    
    .nav-menu {
        display: none;
    }
    
    .hero-title {
        font-size: 1.875rem;
    }
    
    .hero-stats {
        flex-direction: column;
        gap: 1.5rem;
    }
    
    .grid-cols-2,
    .grid-cols-3,
    .grid-cols-4,
    .grid-cols-5,
    .grid-cols-6,
    .grid-cols-7 {
        grid-template-columns: 1fr;
    }
    
    .footer-content {
        grid-template-columns: 1fr;
    }
    
    .main-container {
        padding: 1rem;
    }
}

/* 动画 */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    animation: fadeIn 0.3s ease-out;
}

/* 标签 */
.tag {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.75rem;
    border-radius: var(--border-radius-full);
    font-size: 0.75rem;
    font-weight: 500;
}

.tag-primary {
    background: #dbeafe;
    color: #1e40af;
}

.tag-success {
    background: #d1fae5;
    color: #065f46;
}

.tag-warning {
    background: #fef3c7;
    color: #92400e;
}

.tag-danger {
    background: #fee2e2;
    color: #991b1b;
}

/* 徽章 */
.badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    background: var(--danger-color);
    color: var(--white);
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: var(--border-radius-full);
}

/* 加载动画 */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid var(--gray-300);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* 消息提示 */
.toast {
    position: fixed;
    top: 80px;
    right: 20px;
    padding: 1rem 1.5rem;
    background: var(--white);
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-xl);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    z-index: 9999;
    animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.toast.success {
    border-left: 4px solid var(--success-color);
}

.toast.error {
    border-left: 4px solid var(--danger-color);
}

.toast.warning {
    border-left: 4px solid var(--warning-color);
}

/* 模态框 */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s;
}

.modal.show {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    background: var(--white);
    border-radius: var(--border-radius-xl);
    width: 90%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    transform: scale(0.9);
    transition: all 0.3s;
}

.modal.show .modal-content {
    transform: scale(1);
}

.modal-header {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--gray-200);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.modal-body {
    padding: 1.5rem;
}

.modal-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--gray-200);
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--gray-400);
    transition: color 0.2s;
}

.modal-close:hover {
    color: var(--gray-600);
}
/* ========== 紧急修复 ========== */
.ai-publish-card { margin-bottom: 8px !important; padding: 12px !important; }
.feature-section { margin-bottom: 8px !important; }
.category-section { margin-bottom: 8px !important; }
.search-section { margin-bottom: 8px !important; padding: 8px 0 !important; }
.feature-slider { gap: 8px !important; margin-bottom: 8px !important; }
.feature-item { padding: 12px !important; }
.section-header { margin-bottom: 8px !important; }

/* 布局紧凑化 */
.ai-publish-card { margin-bottom: 8px !important; padding: 12px !important; }
.feature-section { margin-bottom: 8px !important; }
.category-section { margin-bottom: 8px !important; }
.search-section { margin-bottom: 8px !important; padding: 8px 0 !important; }
.feature-slider { gap: 8px !important; margin-bottom: 8px !important; }
.feature-item { padding: 12px !important; min-height: auto !important; }
.section-header { margin-bottom: 8px !important; }
.category-grid { gap: 8px !important; }

/* 布局紧凑化 */
.ai-publish-card { margin-bottom: 8px !important; padding: 12px !important; }
.feature-section { margin-bottom: 8px !important; }
.category-section { margin-bottom: 8px !important; }
.search-section { margin-bottom: 8px !important; padding: 8px 0 !important; }
.feature-slider { gap: 8px !important; margin-bottom: 8px !important; }
.feature-item { padding: 12px !important; min-height: auto !important; }
.section-header { margin-bottom: 8px !important; }
.category-grid { gap: 8px !important; }
.modal { display: none; position: fixed; top: 0; left: 0; right: 0; bottom: 0; background: rgba(0,0,0,0.8); z-index: 9999; align-items: flex-end; justify-content: center; }
.modal.active { display: flex !important; }
.modal-content { background: linear-gradient(180deg,#1a1a2e,#16213e); border-radius: 24px 24px 0 0; width: 100%; max-height: 80vh; overflow-y: auto; }
.lang-item { padding: 15px; cursor: pointer; color: #fff; border-bottom: 1px solid rgba(255,255,255,0.1); }
.lang-item:hover { background: rgba(255,255,255,0.1); }
.country-item, .city-item { padding: 15px; cursor: pointer; color: #fff; border-bottom: 1px solid rgba(255,255,255,0.1); display: flex; align-items: center; gap: 10px; }
.country-item:hover, .city-item:hover { background: rgba(255,255,255,0.1); }
.ai-publish-card { margin: 8px 0 !important; padding: 12px !important; }
.feature-section, .category-section { margin-bottom: 8px !important; }
.search-section { margin-bottom: 8px !important; padding: 8px 0 !important; }
.feature-slider { gap: 8px !important; margin-bottom: 8px !important; }
.section-header { margin-bottom: 8px !important; }

/* 修复模态框显示 */
.modal.show,
.modal.active {
    opacity: 1;
    visibility: visible;
}
.modal.show, .modal.active { opacity: 1 !important; visibility: visible !important; }
.search-section { padding: 8px 0 !important; }
.section-header { margin-bottom: 8px !important; }
.category-section { margin-bottom: 12px !important; }
.feature-section { margin-bottom: 12px !important; }
