/**
 * SignalRural Custom Styles
 * Version: 2026.04.04
 * Description: 自定义样式，用于扩展Bootstrap和现有样式
 */

/* ===== 全局样式 ===== */
:root {
    --sr-primary: #198754;
    --sr-primary-dark: #146c43;
    --sr-secondary: #6c757d;
    --sr-warning: #ffc107;
    --sr-light: #f8f9fa;
    --sr-dark: #212529;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    line-height: 1.7;
    color: #333;
}

/* ===== 导航栏优化 ===== */
.navbar {
    padding: 0.75rem 0;
}

.navbar-brand {
    font-size: 1.5rem;
    font-weight: 700;
}

.nav-link {
    font-weight: 500;
    padding: 0.5rem 1rem !important;
    transition: color 0.2s ease;
}

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

.dropdown-menu {
    border: none;
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.1);
    border-radius: 0.5rem;
}

.dropdown-item {
    padding: 0.5rem 1.25rem;
    font-size: 0.9rem;
}

.dropdown-item:hover {
    background-color: var(--sr-light);
    color: var(--sr-primary);
}

/* ===== 面包屑导航 ===== */
.breadcrumb {
    font-size: 0.875rem;
}

.breadcrumb-item a {
    color: var(--sr-secondary);
    text-decoration: none;
}

.breadcrumb-item a:hover {
    color: var(--sr-primary);
}

/* ===== Hero区域 ===== */
.hero-section {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    padding: 4rem 0;
    margin-bottom: 2rem;
}

.hero-title {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--sr-primary);
    margin-bottom: 1rem;
}

.hero-subtitle {
    font-size: 1.25rem;
    color: var(--sr-secondary);
    margin-bottom: 2rem;
}

/* ===== 卡片样式 ===== */
.content-card {
    background: #fff;
    border-radius: 0.75rem;
    box-shadow: 0 0.125rem 0.5rem rgba(0, 0, 0, 0.08);
    border: 1px solid rgba(0, 0, 0, 0.05);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    margin-bottom: 1.5rem;
}

.content-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 0.25rem 1rem rgba(0, 0, 0, 0.12);
}

.content-card .card-body {
    padding: 1.5rem;
}

/* ===== 运营商卡片 ===== */
.carrier-card {
    border-left: 4px solid var(--sr-primary);
    transition: all 0.3s ease;
}

.carrier-card.verizon {
    border-left-color: #cd040b;
}

.carrier-card.att {
    border-left-color: #00a8e0;
}

.carrier-card.tmobile {
    border-left-color: #e20074;
}

.carrier-card.uscellular {
    border-left-color: #0066b2;
}

/* ===== 信号强度指示器 ===== */
.signal-strength {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.signal-bar {
    display: flex;
    gap: 2px;
    align-items: flex-end;
    height: 20px;
}

.signal-bar span {
    width: 4px;
    background: #dee2e6;
    border-radius: 2px;
}

.signal-bar span:nth-child(1) { height: 25%; }
.signal-bar span:nth-child(2) { height: 50%; }
.signal-bar span:nth-child(3) { height: 75%; }
.signal-bar span:nth-child(4) { height: 100%; }

.signal-bar.excellent span { background: #198754; }
.signal-bar.good span:nth-child(-n+3) { background: #198754; }
.signal-bar.fair span:nth-child(-n+2) { background: #ffc107; }
.signal-bar.poor span:nth-child(1) { background: #dc3545; }

/* ===== CPS推荐模块 ===== */
.recommendation-section {
    background: var(--sr-light);
    padding: 2rem;
    border-radius: 0.75rem;
    margin: 2rem 0;
}

.recommendation-card {
    background: #fff;
    border-radius: 0.5rem;
    padding: 1.5rem;
    border: 1px solid #dee2e6;
    transition: all 0.2s ease;
    height: 100%;
}

.recommendation-card:hover {
    border-color: var(--sr-primary);
    box-shadow: 0 0.25rem 0.75rem rgba(25, 135, 84, 0.15);
}

.recommendation-card .card-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--sr-dark);
    margin-bottom: 0.75rem;
}

.recommendation-card .price {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--sr-primary);
}

.recommendation-card .price small {
    font-size: 0.875rem;
    font-weight: 400;
    color: var(--sr-secondary);
}

/* ===== 广告位样式 ===== */
.ad-container {
    background: #f8f9fa;
    border: 1px dashed #dee2e6;
    border-radius: 0.5rem;
    padding: 1rem;
    text-align: center;
    min-height: 100px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ad-container ins {
    display: block;
}

.ad-label {
    font-size: 0.7rem;
    color: var(--sr-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* ===== 内容页面样式 ===== */
.article-content {
    font-size: 1.05rem;
    line-height: 1.8;
}

.article-content h2 {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--sr-dark);
    margin-top: 2rem;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--sr-primary);
}

.article-content h3 {
    font-size: 1.35rem;
    font-weight: 600;
    color: var(--sr-dark);
    margin-top: 1.5rem;
    margin-bottom: 0.75rem;
}

.article-content p {
    margin-bottom: 1.25rem;
}

.article-content ul, .article-content ol {
    margin-bottom: 1.25rem;
    padding-left: 1.5rem;
}

.article-content li {
    margin-bottom: 0.5rem;
}

.article-content a {
    color: var(--sr-primary);
    text-decoration: underline;
}

.article-content a:hover {
    color: var(--sr-primary-dark);
}

/* ===== 州页面样式 ===== */
.state-header {
    background: #fff;
    color: #212529;
    padding: 3rem 0;
    margin-bottom: 2rem;
    border-bottom: 1px solid #dee2e6;
}

.state-header h1 {
    font-size: 2.25rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: #212529;
}

.state-header p {
    font-size: 1.1rem;
    color: #6c757d;
}

.breadcrumb-item a {
    color: var(--sr-primary);
}

.breadcrumb-item.active {
    color: #6c757d;
}

.state-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
    margin: 2rem 0;
}

.state-stat {
    background: #fff;
    padding: 1.25rem;
    border-radius: 0.5rem;
    text-align: center;
    box-shadow: 0 0.125rem 0.5rem rgba(0, 0, 0, 0.08);
}

.state-stat .value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--sr-primary);
}

.state-stat .label {
    font-size: 0.875rem;
    color: var(--sr-secondary);
}

/* ===== FAQ样式 ===== */
.faq-section .accordion-item {
    margin-bottom: 1rem;
    border: 1px solid #dee2e6;
    border-radius: 0.5rem !important;
    overflow: hidden;
}

.faq-section .accordion-button {
    font-weight: 600;
    font-size: 1rem;
    padding: 1.25rem;
}

.faq-section .accordion-button:not(.collapsed) {
    background-color: var(--sr-light);
    color: var(--sr-primary);
}

.faq-section .accordion-body {
    padding: 1.25rem;
    line-height: 1.7;
}

/* ===== 表格样式 ===== */
.comparison-table {
    width: 100%;
    margin: 1.5rem 0;
}

.comparison-table th {
    background: var(--sr-light);
    font-weight: 600;
    text-align: left;
    padding: 1rem;
    border-bottom: 2px solid var(--sr-primary);
}

.comparison-table td {
    padding: 1rem;
    border-bottom: 1px solid #dee2e6;
    vertical-align: middle;
}

.comparison-table tr:hover {
    background: #f8f9fa;
}

/* ===== 按钮样式优化 ===== */
.btn-success {
    background-color: var(--sr-primary);
    border-color: var(--sr-primary);
}

.btn-success:hover {
    background-color: var(--sr-primary-dark);
    border-color: var(--sr-primary-dark);
}

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

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

/* ===== 徽章样式 ===== */
.aff-badge {
    font-size: 0.65em;
    padding: 0.2em 0.5em;
    vertical-align: middle;
}

.badge-best {
    background-color: #198754;
    color: #fff;
}

.badge-popular {
    background-color: #0d6efd;
    color: #fff;
}

.badge-no-ssn {
    background-color: #6f42c1;
    color: #fff;
}

/* ===== 侧边栏样式 ===== */
.sidebar {
    position: sticky;
    top: 100px;
}

.sidebar-card {
    background: #fff;
    border-radius: 0.5rem;
    padding: 1.25rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 0.125rem 0.5rem rgba(0, 0, 0, 0.08);
}

.sidebar-card h4 {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid #dee2e6;
}

.sidebar-card ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.sidebar-card li {
    padding: 0.5rem 0;
    border-bottom: 1px solid #f0f0f0;
}

.sidebar-card li:last-child {
    border-bottom: none;
}

.sidebar-card a {
    color: var(--sr-dark);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.sidebar-card a:hover {
    color: var(--sr-primary);
}

/* ===== 响应式设计 ===== */
@media (max-width: 991.98px) {
    .hero-title {
        font-size: 2rem;
    }
    
    .state-header {
        padding: 2rem 0;
    }
    
    .state-header h1 {
        font-size: 1.75rem;
    }
    
    .sidebar {
        position: static;
        margin-top: 2rem;
    }
}

@media (max-width: 767.98px) {
    .hero-section {
        padding: 2rem 0;
    }
    
    .hero-title {
        font-size: 1.75rem;
    }
    
    .recommendation-section {
        padding: 1.5rem;
    }
    
    .article-content {
        font-size: 1rem;
    }
    
    .article-content h2 {
        font-size: 1.5rem;
    }
    
    .state-stats {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 575.98px) {
    .navbar-brand {
        font-size: 1.25rem;
    }
    
    .content-card .card-body {
        padding: 1rem;
    }
    
    .recommendation-card {
        padding: 1rem;
    }
}

/* ===== 打印样式 ===== */
@media print {
    .navbar, .footer, .ad-container, .btn {
        display: none !important;
    }
    
    .content-card {
        box-shadow: none;
        border: 1px solid #ddd;
    }
}

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

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

/* ===== 覆盖 Bootstrap 默认颜色 ===== */
.text-primary { color: var(--sr-primary) !important; }
.bg-primary { background-color: var(--sr-primary) !important; }
.bg-primary:hover { background-color: var(--sr-primary-dark) !important; }
.btn-primary { 
    background-color: var(--sr-primary) !important; 
    border-color: var(--sr-primary) !important;
}
.btn-primary:hover { 
    background-color: var(--sr-primary-dark) !important; 
    border-color: var(--sr-primary-dark) !important;
}
.btn-outline-primary {
    color: var(--sr-primary) !important;
    border-color: var(--sr-primary) !important;
}
.btn-outline-primary:hover {
    background-color: var(--sr-primary) !important;
    border-color: var(--sr-primary) !important;
}
.badge-primary {
    background-color: var(--sr-primary) !important;
}
.spinner-border.text-primary {
    color: var(--sr-primary) !important;
}

/* ===== 工具类 ===== */
.bg-primary-light { background-color: rgba(25, 135, 84, 0.1) !important; }
.border-primary { border-color: var(--sr-primary) !important; }
