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

:root {
    --primary-color: #6366f1;
    --secondary-color: #8b5cf6;
    --accent-color: #ec4899;
    --bg-color: #0f172a;
    --sidebar-bg: #1e293b;
    --card-bg: #1e293b;
    --text-primary: #f1f5f9;
    --text-secondary: #94a3b8;
    --border-color: #334155;
    --success-color: #10b981;
    --warning-color: #f59e0b;
    --error-color: #ef4444;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', sans-serif;
    background: linear-gradient(135deg, var(--bg-color) 0%, #1a1f3a 100%);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
}

.app-container {
    display: flex;
    min-height: 100vh;
}

/* 侧边栏样式 */
.sidebar {
    width: 280px;
    background: var(--sidebar-bg);
    padding: 2rem 0;
    box-shadow: 4px 0 20px rgba(0, 0, 0, 0.3);
    position: fixed;
    height: 100vh;
    overflow-y: auto;
    z-index: 100;
}

.logo {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 2rem 2rem;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 2rem;
}

.logo i {
    font-size: 2.5rem;
    color: var(--primary-color);
    margin-right: 1rem;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

.logo span {
    font-size: 1.5rem;
    font-weight: bold;
    background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.nav-menu {
    list-style: none;
}

.nav-item {
    padding: 1rem 2rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    position: relative;
    overflow: hidden;
}

.nav-item::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    width: 4px;
    background: var(--primary-color);
    transform: translateX(-100%);
    transition: transform 0.3s ease;
}

.nav-item:hover::before,
.nav-item.active::before {
    transform: translateX(0);
}

.nav-item:hover {
    background: rgba(99, 102, 241, 0.1);
}

.nav-item.active {
    background: rgba(99, 102, 241, 0.2);
}

.nav-item i {
    font-size: 1.2rem;
    margin-right: 1rem;
    color: var(--text-secondary);
    transition: color 0.3s ease;
}

.nav-item.active i,
.nav-item:hover i {
    color: var(--primary-color);
}

.nav-item span {
    font-size: 1rem;
    color: var(--text-secondary);
    transition: color 0.3s ease;
}

.nav-item.active span,
.nav-item:hover span {
    color: var(--text-primary);
}

/* 主内容区域 */
.main-content {
    flex: 1;
    margin-left: 280px;
    padding: 2rem;
    max-width: 1200px;
    width: 100%;
}

.page {
    display: none;
    animation: fadeIn 0.5s ease;
}

.page.active {
    display: block;
}

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

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

.page-header h1 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.page-header p {
    color: var(--text-secondary);
    font-size: 1.1rem;
}

/* 表单样式 */
.form-container {
    background: var(--card-bg);
    border-radius: 20px;
    padding: 2.5rem;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    border: 1px solid var(--border-color);
    margin-bottom: 2rem;
}

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

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
    font-weight: 500;
}

.form-group input[type="text"] {
    width: 100%;
    padding: 0.8rem 1rem;
    background: var(--bg-color);
    border: 2px solid var(--border-color);
    border-radius: 10px;
    color: var(--text-primary);
    font-size: 1rem;
    transition: all 0.3s ease;
}

.form-group input[type="text"]:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

/* 单选按钮组 */
.radio-group {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.radio-btn {
    position: relative;
    cursor: pointer;
    padding: 0.5rem 1.5rem;
    background: var(--bg-color);
    border: 2px solid var(--border-color);
    border-radius: 10px;
    transition: all 0.3s ease;
}

.radio-btn input[type="radio"] {
    position: absolute;
    opacity: 0;
}

.radio-btn span {
    color: var(--text-secondary);
    transition: color 0.3s ease;
}

.radio-btn:hover {
    border-color: var(--primary-color);
    background: rgba(99, 102, 241, 0.1);
}

.radio-btn input[type="radio"]:checked + span {
    color: var(--primary-color);
}

.radio-btn input[type="radio"]:checked ~ .radio-btn {
    border-color: var(--primary-color);
    background: rgba(99, 102, 241, 0.2);
}

/* 交互式输入框 */
.date-input,
.location-input,
.industry-input {
    padding: 0.8rem 1rem;
    background: var(--bg-color);
    border: 2px solid var(--border-color);
    border-radius: 10px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 1rem;
    transition: all 0.3s ease;
}

.date-input:hover,
.location-input:hover,
.industry-input:hover {
    border-color: var(--primary-color);
    background: rgba(99, 102, 241, 0.05);
}

.date-input i,
.location-input i,
.industry-input i {
    color: var(--primary-color);
}

.date-input span,
.location-input span,
.industry-input span {
    color: var(--text-secondary);
}

/* 提交按钮 */
.submit-btn {
    width: 100%;
    padding: 1rem;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    border: none;
    border-radius: 10px;
    color: white;
    font-size: 1.1rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 2rem;
}

.submit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(99, 102, 241, 0.3);
}

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

/* 结果展示区域 - 网格布局设置 */
.results-container {
    display: grid;
    grid-template-columns: repeat(3, 1fr); /* 一排显示3个卡片 */
    gap: 1.5rem; /* 卡片之间的间距 */
    margin-top: 2rem;
}

/* 响应式调整 */
@media (max-width: 1200px) {
    .results-container {
        grid-template-columns: repeat(2, 1fr); /* 中等屏幕一排显示2个 */
    }
}

@media (max-width: 768px) {
    .results-container {
        grid-template-columns: 1fr; /* 移动设备一排显示1个 */
    }
}

/* 结果卡片样式 */
.result-card {
    background: var(--card-bg);
    border-radius: 15px;
    padding: 1.5rem; /* 优化内边距，使卡片更紧凑 */
    transition: all 0.3s ease;
    animation: slideUp 0.5s ease;
    position: relative;
    border: none;
    overflow: hidden;
}

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

.result-card:hover {
    transform: translateY(-5px) scale(1.02);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.4);
}

.result-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
}

.result-name {
    font-size: 1.6rem; /* 适当减小字体大小 */
    font-weight: bold;
    background: linear-gradient(45deg, #667eea, #764ba2, #f093fb);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: textShimmer 3s ease-in-out infinite;
}

@keyframes textShimmer {
    0%, 100% { filter: brightness(1); }
    50% { filter: brightness(1.2); }
}

.result-english {
    color: var(--text-secondary);
    font-style: italic;
    font-size: 0.9rem;
}

.rating {
    display: flex;
    gap: 0.25rem;
}

.star {
    background: linear-gradient(45deg, #ffd700, #ffed4e);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: 0 0 10px rgba(255, 215, 0, 0.5);
    font-size: 1.2rem;
}

.star.empty {
    background: linear-gradient(45deg, #4a5568, #718096);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.result-details {
    display: grid;
    gap: 1.2rem; /* 增加详情项间距，使布局更清晰 */
}

.detail-item {
    /* 移除flex布局，让内容自然堆叠 */
    margin-bottom: 0.5rem;
}

.detail-label {
    font-weight: bold;
    background: linear-gradient(45deg, #fef3c7, #fde68a);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    display: block;
    margin-bottom: 4px;
}

.detail-value {
    color: var(--text-primary);
    line-height: 1.6;
}

/* 彩色边框效果 - 使用伪元素 */
.result-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border-radius: 15px;
    padding: 3px;
    background: linear-gradient(45deg, 
        #ff6b6b, #4ecdc4, #45b7d1, #96ceb4, 
        #feca57, #ff9ff3, #54a0ff, #48dbfb);
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    opacity: 0.8;
    animation: borderAnimation 3s linear infinite;
}

@keyframes borderAnimation {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* 不同卡片的独特边框颜色 */
.result-card:nth-child(1)::before {
    background: linear-gradient(45deg, #667eea, #764ba2, #f093fb);
    animation: borderAnimation1 4s ease-in-out infinite;
}

.result-card:nth-child(2)::before {
    background: linear-gradient(45deg, #f093fb, #f5576c, #ff6b6b);
    animation: borderAnimation2 4s ease-in-out infinite;
}

.result-card:nth-child(3)::before {
    background: linear-gradient(45deg, #4facfe, #00f2fe, #43e97b);
    animation: borderAnimation3 4s ease-in-out infinite;
}

.result-card:nth-child(4)::before {
    background: linear-gradient(45deg, #fa709a, #fee140, #feca57);
    animation: borderAnimation4 4s ease-in-out infinite;
}

.result-card:nth-child(5)::before {
    background: linear-gradient(45deg, #30cfd0, #330867, #a8edea);
    animation: borderAnimation5 4s ease-in-out infinite;
}

.result-card:nth-child(6)::before {
    background: linear-gradient(45deg, #ff9a9e, #fecfef, #fecfef);
    animation: borderAnimation6 4s ease-in-out infinite;
}

/* 不同动画效果 */
@keyframes borderAnimation1 {
    0%, 100% { opacity: 0.6; transform: scale(1); }
    50% { opacity: 1; transform: scale(1.01); }
}

@keyframes borderAnimation2 {
    0%, 100% { opacity: 0.7; filter: hue-rotate(0deg); }
    50% { opacity: 1; filter: hue-rotate(30deg); }
}

@keyframes borderAnimation3 {
    0%, 100% { opacity: 0.8; }
    50% { opacity: 1; }
}

@keyframes borderAnimation4 {
    0%, 100% { opacity: 0.6; }
    50% { opacity: 1; }
}

@keyframes borderAnimation5 {
    0%, 100% { opacity: 0.7; }
    50% { opacity: 1; }
}

@keyframes borderAnimation6 {
    0%, 100% { opacity: 0.8; }
    50% { opacity: 1; }
}

/* 悬停效果增强 */
.result-card:hover::before {
    opacity: 1;
    animation-duration: 2s;
}

/* 卡片内容区域 - 确保内容不被边框覆盖 */
.result-card > * {
    position: relative;
    z-index: 1;
}

/* 为不同页面添加不同的边框主题 */
#company-results .result-card::before {
    background: linear-gradient(45deg, #667eea, #764ba2, #6a11cb);
}

#shop-results .result-card::before {
    background: linear-gradient(45deg, #f093fb, #f5576c, #ff6b6b);
}

#baby-results .result-card::before {
    background: linear-gradient(45deg, #4facfe, #00f2fe, #43e97b);
}

#analysis-results .result-card::before {
    background: linear-gradient(45deg, #fa709a, #fee140, #feca57);
}

/* 添加发光效果 */
.result-card.glow {
    animation: glow 2s ease-in-out infinite alternate;
}

@keyframes glow {
    from {
        box-shadow: 0 0 20px rgba(99, 102, 241, 0.3);
    }
    to {
        box-shadow: 0 0 30px rgba(99, 102, 241, 0.6), 0 0 40px rgba(139, 92, 246, 0.3);
    }
}

/* 根据不同页面设置不同的标签颜色 */
#company-results .detail-label {
    border-image: linear-gradient(45deg, #667eea, #764ba2) 1;
}

#shop-results .detail-label {
    border-image: linear-gradient(45deg, #f093fb, #f5576c) 1;
}

#baby-results .detail-label {
    border-image: linear-gradient(45deg, #4facfe, #00f2fe) 1;
}

#analysis-results .detail-label {
    border-image: linear-gradient(45deg, #fa709a, #fee140) 1;
}

/* 弹窗样式 */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(5px);
    animation: fadeIn 0.3s ease;
}

.modal.show {
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: var(--card-bg);
    border-radius: 20px;
    width: 90%;
    max-width: 600px;
    max-height: 80vh;
    overflow-y: auto;
    animation: slideUp 0.3s ease;
    border: 1px solid var(--border-color);
}

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

.modal-header h3 {
    color: var(--text-primary);
    font-size: 1.5rem;
}

.close {
    color: var(--text-secondary);
    font-size: 2rem;
    cursor: pointer;
    transition: color 0.3s ease;
}

.close:hover {
    color: var(--error-color);
}

.modal-body {
    padding: 1.5rem;
}

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

.btn {
    padding: 0.8rem 2rem;
    border: none;
    border-radius: 10px;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(99, 102, 241, 0.3);
}

.btn-secondary {
    background: var(--bg-color);
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
}

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

/* 日期选择器 */
.calendar-type {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.date-selectors,
.location-selectors {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 1rem;
}

.date-selectors select,
.location-selectors select {
    padding: 0.8rem;
    background: var(--bg-color);
    border: 2px solid var(--border-color);
    border-radius: 10px;
    color: var(--text-primary);
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.date-selectors select:focus,
.location-selectors select:focus {
    outline: none;
    border-color: var(--primary-color);
}

/* 行业选择网格 */
.industry-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 1rem;
    max-height: 400px;
    overflow-y: auto;
}

/* 增加样式特异性，确保边框颜色生效 */
.industry-grid .industry-item {
    padding: 1rem;
    background: var(--card-bg);
    border: 2px solid #334155; /* 直接使用具体颜色值，避免变量问题 */
    border-radius: 10px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    color: var(--text-secondary);
    box-shadow: none; /* 确保没有阴影模拟的"白色边框"效果 */
}

.industry-grid .industry-item:hover {
    border-color: var(--primary-color);
    background: rgba(99, 102, 241, 0.1);
    color: var(--text-primary);
}

.industry-grid .industry-item.selected {
    border-color: var(--primary-color);
    background: rgba(99, 102, 241, 0.2);
    color: var(--primary-color);
}

/* 加载动画 */
.loading-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    z-index: 2000;
    align-items: center;
    justify-content: center;
}

.loading-overlay.show {
    display: flex;
}

.loading-spinner {
    text-align: center;
}

.loading-spinner i {
    font-size: 3rem;
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.loading-spinner p {
    color: var(--text-primary);
    font-size: 1.2rem;
}

/* 添加彩虹加载边框效果 */
.loading-border {
    position: relative;
    overflow: hidden;
}

.loading-border::after {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: linear-gradient(45deg, 
        #ff0000, #ff7f00, #ffff00, #00ff00, 
        #0000ff, #4b0082, #9400d3, #ff0000);
    background-size: 400% 400%;
    border-radius: 15px;
    z-index: -1;
    animation: rainbowBorder 3s ease infinite;
}

@keyframes rainbowBorder {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* 响应式设计 */
@media (max-width: 768px) {
    .sidebar {
        width: 70px;
        padding: 1rem 0;
    }
    
    .logo span,
    .nav-item span {
        display: none;
    }
    
    .logo {
        padding: 0 0.5rem 1rem;
    }
    
    .logo i {
        font-size: 1.8rem;
        margin-right: 0;
    }
    
    .nav-item {
        padding: 1rem;
        justify-content: center;
    }
    
    .nav-item i {
        margin-right: 0;
    }
    
    .main-content {
        margin-left: 70px;
        padding: 1rem;
    }
    
    .page-header h1 {
        font-size: 2rem;
    }
    
    .form-container {
        padding: 1.5rem;
    }
    
    .radio-group {
        flex-direction: column;
    }
    
    .date-selectors,
    .location-selectors {
        grid-template-columns: 1fr;
    }

    .result-card {
        padding: 1.2rem;
    }
    
    .result-card::before {
        animation-duration: 5s;
    }
    
    .result-name {
        font-size: 1.3rem;
    }
}

/* 滚动条样式 */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-color);
}

::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--primary-color);
}
