/**
 * 信鸽之家 - 主样式表
 * 
 * 响应式设计：Mobile First
 * 色彩方案：深蓝主色 + 橙色强调
 */

/* =============================================
   基础重置与变量
   ============================================= */
:root {
    --primary-color: #1e3a8a;      /* 深蓝色 */
    --primary-dark: #1e293b;       /* 深蓝灰 */
    --secondary-color: #f97316;     /* 橙色 */
    --secondary-dark: #ea580c;      /* 深橙色 */
    --success-color: #10b981;       /* 绿色 */
    --danger-color: #ef4444;        /* 红色 */
    --warning-color: #f59e0b;       /* 黄色 */
    --info-color: #3b82f6;          /* 蓝色 */
    
    --gray-50: #f9fafb;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-300: #d1d5db;
    --gray-500: #6b7280;
    --gray-700: #374151;
    --gray-900: #111827;
    
    --font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", 
                   "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
    --border-radius: 8px;
    --box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    --box-shadow-hover: 0 10px 25px rgba(0, 0, 0, 0.15);
}

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

body {
    font-family: var(--font-family);
    font-size: 16px;
    line-height: 1.6;
    color: var(--gray-900);
    background-color: var(--gray-100);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

a {
    color: var(--primary-color);
    text-decoration: none;
    transition: color 0.3s;
}

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

img {
    max-width: 100%;
    height: auto;
}

/* =============================================
   工具类
   ============================================= */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
}

@media (min-width: 768px) {
    .container {
        padding: 0 30px;
    }
}

.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

.bg-white { background-color: white; }
.bg-primary { background-color: var(--primary-color); }
.bg-secondary { background-color: var(--secondary-color); }

.text-white { color: white; }
.text-primary { color: var(--primary-color); }
.text-secondary { color: var(--secondary-color); }
.text-gray { color: var(--gray-500); }

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

.grid { display: grid; }
.gap-4 { gap: 1rem; }

/* =============================================
   按钮
   ============================================= */
.btn {
    display: inline-block;
    padding: 10px 24px;
    border: none;
    border-radius: var(--border-radius);
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    text-align: center;
}

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

.btn-primary:hover {
    background-color: #1e40af;
    transform: translateY(-2px);
    box-shadow: var(--box-shadow);
}

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

.btn-secondary:hover {
    background-color: var(--secondary-dark);
    transform: translateY(-2px);
}

.btn-outline {
    background-color: transparent;
    border: 2px solid var(--primary-color);
    color: var(--primary-color);
}

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

.btn-sm {
    padding: 6px 16px;
    font-size: 14px;
}

.btn-lg {
    padding: 14px 32px;
    font-size: 18px;
}

/* =============================================
   卡片
   ============================================= */
.card {
    background-color: white;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    padding: 20px;
    transition: all 0.3s;
}

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

/* =============================================
   导航栏（PC端）
   ============================================= */
.navbar {
    background-color: white;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.navbar .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 70px;
}

.navbar-brand {
    display: flex;
    align-items: center;
    font-size: 24px;
    font-weight: bold;
    color: var(--primary-color);
}

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

.navbar-menu {
    display: flex;
    list-style: none;
    gap: 30px;
}

.navbar-menu a {
    color: var(--gray-700);
    font-weight: 500;
    transition: color 0.3s;
}

.navbar-menu a:hover {
    color: var(--secondary-color);
}

.navbar-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
}

/* 移动端导航 */
@media (max-width: 768px) {
    .navbar-menu {
        display: none;
        position: absolute;
        top: 70px;
        left: 0;
        right: 0;
        background-color: white;
        flex-direction: column;
        padding: 20px;
        box-shadow: 0 5px 10px rgba(0, 0, 0, 0.1);
    }
    
    .navbar-menu.active {
        display: flex;
    }
    
    .navbar-toggle {
        display: block;
        margin-right: 12px;
    }
}

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

.search-bar input {
    width: 100%;
    padding: 12px 50px 12px 20px;
    border: 2px solid var(--gray-200);
    border-radius: 50px;
    font-size: 16px;
    transition: border-color 0.3s;
}

.search-bar input:focus {
    outline: none;
    border-color: var(--primary-color);
}

.search-bar button {
    position: absolute;
    right: 5px;
    top: 50%;
    transform: translateY(-50%);
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    cursor: pointer;
    transition: background-color 0.3s;
}

.search-bar button:hover {
    background-color: var(--secondary-color);
}

/* =============================================
   轮播图
   ============================================= */
.carousel {
    position: relative;
    overflow: hidden;
    border-radius: var(--border-radius);
}

.carousel-item {
    display: none;
    height: 400px;
    background-size: cover;
    background-position: center;
    align-items: center;
    justify-content: center;
    color: white;
    text-align: center;
    padding: 40px;
}

.carousel-item.active {
    display: flex;
}

.carousel-item h2 {
    font-size: 48px;
    margin-bottom: 20px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

.carousel-item p {
    font-size: 20px;
    margin-bottom: 30px;
}

.carousel-controls {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 10px;
}

.carousel-controls button {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    border: none;
    background-color: rgba(255, 255, 255, 0.5);
    cursor: pointer;
    transition: background-color 0.3s;
}

.carousel-controls button.active {
    background-color: white;
}

@media (max-width: 768px) {
    .carousel-item {
        height: 250px;
    }
    
    .carousel-item h2 {
        font-size: 28px;
    }
    
    .carousel-item p {
        font-size: 16px;
    }
}

/* =============================================
   功能入口网格
   ============================================= */
.func-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 20px;
    margin: 30px 0;
}

.func-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 20px;
    background-color: white;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    cursor: pointer;
    transition: all 0.3s;
}

.func-item:hover {
    transform: translateY(-5px);
    box-shadow: var(--box-shadow-hover);
}

.func-icon {
    width: 60px;
    height: 60px;
    border-radius: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    margin-bottom: 10px;
}

.func-item span {
    font-weight: 600;
    color: var(--gray-700);
}

@media (max-width: 768px) {
    .func-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 10px;
    }
    
    .func-item {
        padding: 15px 10px;
    }
    
    .func-icon {
        width: 48px;
        height: 48px;
        font-size: 22px;
    }
    
    .func-item span {
        font-size: 14px;
    }
}

/* =============================================
   文章列表
   ============================================= */
.article-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.article-item {
    display: flex;
    gap: 20px;
    padding: 20px;
    background-color: white;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    transition: all 0.3s;
}

.article-item:hover {
    box-shadow: var(--box-shadow-hover);
}

.article-thumb {
    width: 200px;
    height: 150px;
    object-fit: cover;
    border-radius: var(--border-radius);
    flex-shrink: 0;
}

.article-content {
    flex: 1;
}

.article-title {
    font-size: 20px;
    font-weight: bold;
    margin-bottom: 10px;
    color: var(--gray-900);
}

.article-summary {
    color: var(--gray-500);
    margin-bottom: 10px;
    line-height: 1.6;
}

.article-meta {
    display: flex;
    gap: 20px;
    font-size: 14px;
    color: var(--gray-500);
}

@media (max-width: 768px) {
    .article-item {
        flex-direction: column;
    }
    
    .article-thumb {
        width: 100%;
        height: 200px;
    }
}

/* =============================================
   商品网格
   ============================================= */
.product-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
}

.product-card {
    background-color: white;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    overflow: hidden;
    transition: all 0.3s;
}

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

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

.product-info {
    padding: 15px;
}

.product-title {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 10px;
    color: var(--gray-900);
}

.product-price {
    font-size: 24px;
    font-weight: bold;
    color: var(--danger-color);
    margin-bottom: 10px;
}

.product-price small {
    font-size: 14px;
    color: var(--gray-500);
    text-decoration: line-through;
}

@media (max-width: 768px) {
    .product-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
    
    .product-image {
        height: 180px;
    }
}

/* =============================================
   底部导航（移动端）
   ============================================= */
.mobile-bottom-nav {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background-color: white;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
    z-index: 1000;
}

.mobile-bottom-nav .nav-items {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    height: 60px;
}

.mobile-bottom-nav .nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--gray-500);
    cursor: pointer;
    transition: color 0.3s;
}

.mobile-bottom-nav .nav-item.active {
    color: var(--primary-color);
}

.mobile-bottom-nav .nav-item i {
    font-size: 20px;
    margin-bottom: 2px;
}

.mobile-bottom-nav .nav-item span {
    font-size: 12px;
}

.mobile-bottom-nav .nav-item.publish {
    position: relative;
}

.mobile-bottom-nav .nav-item.publish i {
    width: 48px;
    height: 48px;
    background-color: var(--secondary-color);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    position: absolute;
    top: -20px;
    font-size: 24px;
    box-shadow: 0 4px 10px rgba(249, 115, 22, 0.4);
}

@media (max-width: 768px) {
    .mobile-bottom-nav {
        display: block;
    }
    
    body {
        padding-bottom: 60px;
    }
}

/* =============================================
   页脚
   ============================================= */
.footer {
    background-color: var(--gray-900);
    color: white;
    padding: 60px 0 30px;
    margin-top: 60px;
}

.footer-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 40px;
    margin-bottom: 40px;
}

.footer-title {
    font-size: 18px;
    font-weight: bold;
    margin-bottom: 20px;
}

.footer-links {
    list-style: none;
}

.footer-links li {
    margin-bottom: 10px;
}

.footer-links a {
    color: rgba(255, 255, 255, 0.7);
    transition: color 0.3s;
}

.footer-links a:hover {
    color: white;
}

.footer-bottom {
    text-align: center;
    padding-top: 30px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.5);
    font-size: 14px;
}

@media (max-width: 768px) {
    .footer-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 30px;
    }
}

@media (max-width: 480px) {
    .footer-grid {
        grid-template-columns: 1fr;
    }
}

/* =============================================
   表单
   ============================================= */
.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--gray-700);
}

.form-control {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid var(--gray-200);
    border-radius: var(--border-radius);
    font-size: 16px;
    transition: border-color 0.3s;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-color);
}

/* =============================================
   分页
   ============================================= */
.pagination {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin: 40px 0;
}

.pagination a, .pagination span {
    display: inline-block;
    padding: 8px 15px;
    background-color: white;
    border-radius: var(--border-radius);
    color: var(--gray-700);
    transition: all 0.3s;
}

.pagination a:hover {
    background-color: var(--primary-color);
    color: white;
}

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

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

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

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

.alert-success {
    background-color: #d1fae5;
    color: #065f46;
    border: 1px solid #a7f3d0;
}

.alert-danger {
    background-color: #fee2e2;
    color: #991b1b;
    border: 1px solid #fca5a5;
}

.alert-warning {
    background-color: #fef3c7;
    color: #92400e;
    border: 1px solid #fcd34d;
}

/* =============================================
   响应式工具类
   ============================================= */
@media (max-width: 768px) {
    .hide-mobile {
        display: none !important;
    }
    .show-mobile {
        display: inline-flex !important;
    }
}

@media (min-width: 769px) {
    .hide-desktop {
        display: none !important;
    }
    .show-mobile {
        display: none !important;
    }
}

/* =============================================
   打印样式
   ============================================= */
@media print {
    .navbar, .footer, .mobile-bottom-nav {
        display: none;
    }
}
