/* --- Appended Styles --- */

/* Flash Messages */
.flash-messages-container {
    padding-top: 20px;
    padding-bottom: 0;
}
.alert {
    /* Uses Bootstrap classes, customize if not using Bootstrap */
    border-radius: var(--border-radius);
}
.alert-dismissible .btn-close {
    padding: 0.85rem 1rem; /* Adjust close button padding */
}

/* Header Search */
.header-search {
    margin-left: auto; /* Push search to the right */
    padding-left: 20px;
}
.search-form-header {
    display: flex;
    border: 1px solid #ccc;
    border-radius: 20px; /* Rounded search */
    overflow: hidden;
    background-color: #fff;
}
.search-form-header input[type="search"] {
    border: none;
    padding: 8px 15px;
    outline: none;
    min-width: 180px;
    font-size: 0.9rem;
}
.search-form-header button {
    background-color: var(--primary-color);
    color: #fff;
    border: none;
    padding: 0 15px;
    cursor: pointer;
    transition: background-color 0.2s ease;
}
.search-form-header button:hover {
    background-color: var(--secondary-color);
}

/* Login Form */
.login-section {
    padding: 80px 0;
    background-color: var(--light-bg);
    min-height: 60vh; /* Ensure it takes some height */
    display: flex;
    align-items: center;
}
.login-form-container {
    max-width: 450px;
    margin: 0 auto;
    padding: 40px;
    background-color: #fff;
    border-radius: 8px;
    box-shadow: var(--box-shadow);
}
.login-form-container h2 {
    text-align: center;
    margin-bottom: 30px;
    color: var(--primary-color);
}
/* Style form fields using Bootstrap classes or custom */
.login-form-container .form-group {
    margin-bottom: 20px;
}
.login-form-container .form-control {
    padding: 12px 15px;
    height: auto;
}
.login-form-container .btn-primary {
    padding: 12px;
    font-size: 1rem;
}

/* Search Results Page */
.search-results-section {
    padding: 60px 0 80px;
}
.search-query-title {
    font-size: 1.6rem;
    margin-bottom: 30px;
    font-weight: 500;
}
.search-query-title .query-term {
    color: var(--primary-color);
    font-weight: 600;
}
.search-results-block {
    margin-bottom: 50px;
}
.results-type-title {
    font-size: 1.4rem;
    margin-bottom: 25px;
    color: var(--secondary-color);
    border-bottom: 1px solid #eee;
    padding-bottom: 10px;
}
.search-product-grid .product-card,
.search-news-grid .news-card {
    /* Adjust card styles if needed for search results */
}
.no-results {
    text-align: center;
    padding: 50px 20px;
    background-color: var(--light-bg);
    border-radius: 8px;
    margin-top: 30px;
}
.no-results p {
    font-size: 1.1rem;
    margin-bottom: 15px;
    color: #666;
}

/* Form Helpers */
.form-control.is-invalid {
    border-color: #dc3545; /* Bootstrap invalid color */
}
.invalid-feedback {
    color: #dc3545;
    font-size: 0.875em;
    margin-top: .25rem;
    display: block; /* Ensure it shows */
}

/* Error Pages */
.error-page {
    padding: 100px 0;
    min-height: 60vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--background-color);
}
.error-content {
    text-align: center;
}
.error-code {
    font-size: 8rem;
    font-weight: 700;
    line-height: 1;
    margin-bottom: 20px;
    color: var(--primary-color);
}
.error-content h1 {
    font-size: 2.5rem;
    margin-bottom: 15px;
    color: var(--text-color);
}
.error-content p {
    font-size: 1.1rem;
    color: var(--text-light);
    margin-bottom: 30px;
}
.error-actions .btn {
    margin: 0 10px;
}

/* Header Admin/Login Links */
.nav-item-admin a, .nav-item-logout a, .nav-item-login a {
    font-weight: 500;
    /* Add specific styling if needed */
}
.nav-item-logout a {
    color: #dc3545; /* Red for logout */
}
 .nav-item-logout a:hover {
    color: #a71d2a;
}

/* 全局变量 */
:root {
    --primary-color: #007bff;
    --secondary-color: #6c757d;
    --success-color: #28a745;
    --danger-color: #dc3545;
    --warning-color: #ffc107;
    --info-color: #17a2b8;
    --light-color: #f8f9fa;
    --dark-color: #343a40;
    --background-color: #ffffff;
    --text-color: #333333;
    --border-color: #dee2e6;
}

/* 全局样式 */
body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    background-color: var(--background-color);
}

/* 头部样式 */
.site-header {
    background-color: var(--background-color);
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.navbar-brand img {
    height: 40px;
}

.nav-link {
    color: var(--dark-color);
    font-weight: 500;
    padding: 0.5rem 1rem;
    transition: color 0.3s ease;
}

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

/* 页面内容 */
.main-content {
    min-height: calc(100vh - 200px);
    padding: 2rem 0;
}

/* 页面区块 */
.section-padding {
    padding: 4rem 0;
}

.section-title {
    font-size: 2rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: var(--dark-color);
}

.section-subtitle {
    font-size: 1.1rem;
    color: var(--secondary-color);
    margin-bottom: 2rem;
}

/* 卡片样式 */
.card {
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

/* 按钮样式 */
.btn {
    font-weight: 500;
    padding: 0.5rem 1.5rem;
    border-radius: 0.25rem;
    transition: all 0.3s ease;
}

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

.btn-primary:hover {
    background-color: #0056b3;
    border-color: #0056b3;
}

/* 表单样式 */
.form-control {
    border: 1px solid var(--border-color);
    border-radius: 0.25rem;
    padding: 0.5rem 1rem;
}

.form-control:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(0,123,255,0.25);
}

/* 页脚样式 */
.site-footer {
    background-color: var(--dark-color);
    color: var(--light-color);
    padding: 3rem 0;
    margin-top: 2rem;
}

.footer-title {
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 1rem;
}

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

.footer-links a {
    color: var(--light-color);
    text-decoration: none;
    transition: color 0.3s ease;
}

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

/* 响应式调整 */
@media (max-width: 768px) {
    .navbar-brand img {
        height: 30px;
    }
    
    .section-padding {
        padding: 2rem 0;
    }
    
    .section-title {
        font-size: 1.5rem;
    }
}

/* 轮播图样式 */
.carousel-item {
    height: 500px;
    background-size: cover;
    background-position: center;
}

.carousel-caption {
    background: rgba(0,0,0,0.5);
    padding: 2rem;
    border-radius: 0.5rem;
}

/* 产品卡片样式 */
.product-card {
    margin-bottom: 2rem;
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    overflow: hidden;
}

.product-image {
    height: 200px;
    overflow: hidden;
}

.product-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.product-content {
    padding: 1rem;
}

/* 服务卡片样式 */
.service-card {
    text-align: center;
    padding: 2rem;
    margin-bottom: 2rem;
    background: var(--light-color);
    border-radius: 0.5rem;
    transition: transform 0.3s ease;
}

.service-card:hover {
    transform: translateY(-5px);
}

.service-icon {
    font-size: 2.5rem;
    color: var(--primary-color);
    margin-bottom: 1rem;
}

/* 导航栏品牌区域样式 */
.navbar-brand-wrapper {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

/* LOGO样式 */
.logo-circle {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    overflow: hidden;
    background: #fff;
    padding: 5px;
    box-shadow: 0 2px 15px var(--shadow-color);
    transition: all 0.3s ease;
}

.main-logo {
    width: 100%;
    height: 100%;
    object-fit: contain;
    border-radius: 50%;
    transition: transform 0.3s ease;
}

/* 公司名称样式 */
.company-name {
    display: flex;
    flex-direction: column;
}

.company-name h1 {
    margin: 0;
    font-size: 1.5rem;
    color: var(--text-color);
    font-weight: 600;
    line-height: 1.2;
}

/* Hero section 样式 */
.hero-section {
    padding: 60px 0;
    background: linear-gradient(135deg, var(--gradient-start) 0%, var(--gradient-end) 100%);
    position: relative;
    overflow: hidden;
}

.hero-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, rgba(0, 102, 204, 0.03) 25%, transparent 25%),
                linear-gradient(-45deg, rgba(0, 102, 204, 0.03) 25%, transparent 25%);
    background-size: 60px 60px;
}

.hero-content {
    padding: 40px 0;
}

.slogan {
    font-size: 2rem;
    color: var(--primary-dark);
    font-weight: 500;
    margin-bottom: 0;
    text-shadow: 0 2px 4px rgba(0, 102, 204, 0.1);
}

/* 悬停效果 */
.logo-circle:hover {
    width: 160px;
    height: 160px;
    z-index: 1000;
}

.logo-circle:hover .main-logo {
    transform: scale(1);
}

/* 响应式调整 */
@media (max-width: 992px) {
    .logo-circle {
        width: 60px;
        height: 60px;
    }
    
    .logo-circle:hover {
        width: 120px;
        height: 120px;
    }
    
    .slogan {
        font-size: 1.5rem;
    }

    .company-name h1 {
        font-size: 1.2rem;
    }
}

@media (max-width: 768px) {
    .logo-circle {
        width: 60px;
        height: 60px;
    }
    
    .logo-circle:hover {
        width: 120px;
        height: 120px;
    }
    
    .slogan {
        font-size: 1.2rem;
    }

    .company-name h1 {
        font-size: 1rem;
    }
}

/* 暗色模式适配 */
@media (prefers-color-scheme: dark) {
    :root {
        --background-color: #1a1a1a;
        --background-light: #2d2d2d;
        --background-dark: #000000;
        --text-color: #ffffff;
        --text-light: #cccccc;
        --border-color: #404040;
        --gradient-start: #002b59;
        --gradient-end: #1a1a1a;
    }

    .main-header {
        background: var(--background-color);
        box-shadow: 0 2px 15px var(--shadow-color);
        border-bottom: 1px solid var(--border-color);
    }
    
    .logo-circle {
        background: var(--background-light);
    }
    
    .hero-section {
        background: linear-gradient(135deg, var(--gradient-start) 0%, var(--gradient-end) 100%);
    }

    .section-title,
    .feature-card h3,
    .news-card h3,
    .contact-item h4 {
        color: var(--primary-light);
    }

    a {
        color: var(--primary-light);
    }

    a:hover {
        color: var(--accent-color);
    }

    .slogan {
        color: var(--primary-light);
    }

    .company-name h1 {
        color: var(--text-color);
    }
}

/* 通用组件样式 */
.section-title {
    font-size: 2.5rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: var(--primary-dark);
}

.section-subtitle {
    font-size: 1.1rem;
    color: var(--text-light);
    margin-bottom: 2rem;
}

/* 按钮样式优化 */
.btn {
    padding: 0.5rem 1.5rem;
    font-weight: 500;
    border-radius: 5px;
    transition: all 0.3s ease;
}

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

.btn-outline-primary:hover {
    background: var(--primary-color);
    color: #ffffff;
}

/* 特色部分样式 */
.feature-icon {
    color: var(--primary-color);
    background: linear-gradient(135deg, var(--gradient-start) 0%, var(--gradient-end) 100%);
    padding: 20px;
    border-radius: 50%;
    box-shadow: 0 2px 15px var(--shadow-color);
}

.feature-card h3 {
    color: var(--primary-dark);
}

.feature-card p {
    color: var(--text-color);
}

/* 动画效果 */
@keyframes gradientShift {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

/* 导航栏样式优化 */
.nav-link {
    color: var(--text-color);
    font-weight: 500;
}

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

/* 链接样式 */
a {
    color: var(--primary-color);
    transition: color 0.3s ease;
}

a:hover {
    color: var(--primary-dark);
    text-decoration: none;
}

/* 特色部分样式 */
.features-section {
    background: var(--background-light);
}

/* 新闻部分样式 */
.news-section {
    background: var(--background-dark);
}

/* 联系部分样式 */
.contact-section {
    background: linear-gradient(135deg, var(--background-color) 0%, var(--background-light) 100%);
}

/* 文本颜色调整 */
.section-title,
.feature-card h3,
.news-card h3,
.contact-item h4 {
    color: var(--primary-dark);
}

.section-subtitle,
.feature-card p,
.news-card p,
.contact-item p {
    color: var(--text-light);
}

/* 表单元素适配 */
.form-control {
    background-color: var(--background-light);
    border-color: var(--border-color);
    color: var(--text-color);
}

.form-control:focus {
    background-color: var(--background-light);
    border-color: var(--primary-color);
    color: var(--text-color);
    box-shadow: 0 0 0 0.2rem rgba(0, 102, 204, 0.25);
} 