/* ===== 全局重置 ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
    background: #f5f7fa;
    color: #333;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

/* ===== 顶部导航 ===== */
.header {
    background: linear-gradient(135deg, #1e40af 0%, #2563eb 100%);
    color: #fff;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.header-inner {
    max-width: 1100px;
    margin: 0 auto;
    padding: 14px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 18px;
    font-weight: 600;
}

.logo-icon {
    font-size: 22px;
}

.nav {
    display: flex;
    gap: 12px;
}

.nav-btn {
    color: #fff;
    background: rgba(255,255,255,0.15);
    padding: 6px 14px;
    border-radius: 6px;
    text-decoration: none;
    font-size: 13px;
    transition: background 0.2s;
}

.nav-btn:hover {
    background: rgba(255,255,255,0.25);
}

/* ===== Banner ===== */
.banner {
    text-align: center;
    padding: 40px 20px 30px;
    background: #fff;
}

.banner h1 {
    font-size: 28px;
    color: #1e40af;
    margin-bottom: 8px;
}

.banner-sub {
    color: #ef4444;
    font-size: 14px;
    margin-bottom: 6px;
}

.banner-tip {
    color: #666;
    font-size: 13px;
}

.banner-tip kbd {
    background: #e5e7eb;
    border: 1px solid #d1d5db;
    border-radius: 4px;
    padding: 1px 6px;
    font-size: 12px;
    font-family: monospace;
}

/* ===== 主容器 ===== */
.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 20px;
}

/* ===== 免责声明 ===== */
.disclaimer {
    background: #fef3c7;
    border: 1px solid #fde68a;
    border-radius: 8px;
    padding: 12px 16px;
    font-size: 13px;
    color: #92400e;
    margin-bottom: 20px;
}

/* ===== 卡片 ===== */
.card {
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
    padding: 24px;
    margin-bottom: 20px;
}

/* ===== 提示框 ===== */
.tip-box {
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    border-left: 4px solid #3b82f6;
    border-radius: 6px;
    padding: 10px 14px;
    font-size: 13px;
    color: #1e40af;
    margin-bottom: 20px;
}

/* ===== 表单通用 ===== */
.form-row {
    display: flex;
    align-items: center;
    margin-bottom: 16px;
    flex-wrap: wrap;
    gap: 12px;
}

.form-block {
    margin-bottom: 20px;
}

.form-label {
    font-weight: 600;
    color: #374151;
    font-size: 14px;
    margin-right: 8px;
    display: inline-block;
    margin-bottom: 8px;
}

.radio-group {
    display: flex;
    gap: 18px;
    flex-wrap: wrap;
}

.radio-group label {
    display: flex;
    align-items: center;
    gap: 4px;
    cursor: pointer;
    font-size: 14px;
    color: #4b5563;
}

.radio-group input[type="radio"] {
    cursor: pointer;
}

/* ===== 城市平铺选择 ===== */
.city-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 22px;
    margin-top: 6px;
}

.city-item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: #374151;
    cursor: pointer;
    user-select: none;
}

.city-item input[type="checkbox"] {
    width: 15px;
    height: 15px;
    margin: 0;
    cursor: pointer;
    accent-color: #3b82f6;
}

/* ===== 号段网格 ===== */
.segment-grid {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    gap: 6px;
    margin-top: 6px;
}

.segment-item {
    background: #f3f4f6;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    padding: 6px 6px;
    text-align: center;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.15s;
    user-select: none;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.segment-item .seg-check {
    display: none;
    width: 14px;
    height: 14px;
    line-height: 14px;
    font-size: 11px;
    background: rgba(255,255,255,0.25);
    border-radius: 3px;
    font-weight: bold;
}

.segment-item.selected .seg-check {
    display: inline-block;
}

.segment-item:hover {
    background: #e0e7ff;
    border-color: #818cf8;
}

.segment-item.selected {
    background: #3b82f6;
    color: #fff;
    border-color: #3b82f6;
    box-shadow: 0 1px 3px rgba(59,130,246,0.4);
}

.segment-item.selected:hover {
    background: #2563eb;
}

/* ===== 加载弹窗 ===== */
.loading-box {
    background: #fff;
    border-radius: 16px;
    padding: 32px 48px;
    text-align: center;
    box-shadow: 0 25px 80px rgba(0,0,0,0.2);
}

.loading-spinner {
    width: 40px;
    height: 40px;
    margin: 0 auto 16px;
    border: 4px solid #e5e7eb;
    border-top-color: #3b82f6;
    border-radius: 50%;
    animation: loadingSpin 0.8s linear infinite;
}

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

.loading-title {
    font-size: 15px;
    font-weight: 600;
    color: #1f2937;
}

/* 运营商颜色标识 */
.segment-item.yidong {
    border-left: 3px solid #22c55e;
}

.segment-item.liantong {
    border-left: 3px solid #ef4444;
}

.segment-item.dianxin {
    border-left: 3px solid #3b82f6;
}

/* ===== 第四位数字 ===== */
.digit-group {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 8px;
}

.digit-group label {
    display: flex;
    align-items: center;
    gap: 4px;
    cursor: pointer;
    font-size: 14px;
    color: #4b5563;
}

/* ===== 复选框行内 ===== */
.checkbox-inline {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    color: #4b5563;
    cursor: pointer;
    margin-bottom: 8px;
}

/* ===== 文本输入 ===== */
.text-input {
    width: 260px;
    padding: 8px 12px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 14px;
    transition: border-color 0.2s;
}

.text-input:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59,130,246,0.1);
}

.text-input:disabled {
    background: #f9fafb;
    color: #9ca3af;
}

/* ===== 下拉和数字输入 ===== */
.select-input,
.number-input {
    padding: 8px 12px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 14px;
    background: #fff;
    transition: border-color 0.2s;
}

.select-input:focus,
.number-input:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59,130,246,0.1);
}

/* ===== 内联字段 ===== */
.inline-fields {
    gap: 24px;
}

.field-item {
    display: flex;
    align-items: center;
    gap: 8px;
}

.field-item .form-label {
    margin-bottom: 0;
}

/* ===== 按钮区 ===== */
.btn-row {
    display: flex;
    gap: 12px;
    justify-content: center;
    margin-top: 28px;
    padding-top: 20px;
    border-top: 1px solid #f3f4f6;
}

.btn-primary {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    color: #fff;
    border: none;
    padding: 12px 32px;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 2px 8px rgba(59,130,246,0.3);
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(59,130,246,0.4);
}

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

.btn-primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.btn-secondary {
    background: #fff;
    color: #374151;
    border: 1px solid #d1d5db;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-secondary:hover:not(:disabled) {
    background: #f9fafb;
    border-color: #9ca3af;
}

.btn-secondary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* ===== 预览卡片 ===== */
.preview-card h3 {
    font-size: 16px;
    color: #1e40af;
    margin-bottom: 12px;
}

.result-stats {
    display: flex;
    gap: 24px;
    padding: 10px 14px;
    background: #f0fdf4;
    border-radius: 6px;
    font-size: 14px;
    color: #166534;
    margin-bottom: 16px;
}

.result-stats strong {
    color: #15803d;
}

.preview-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 8px;
    max-height: 400px;
    overflow-y: auto;
    padding: 8px;
    background: #fafafa;
    border-radius: 6px;
}

.preview-item {
    padding: 6px 10px;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 4px;
    font-family: "Consolas", "Monaco", monospace;
    font-size: 13px;
    color: #374151;
    text-align: center;
}

.preview-more {
    text-align: center;
    padding: 12px;
    color: #6b7280;
    font-size: 13px;
}

/* ===== FAQ ===== */
.faq-section {
    margin-top: 30px;
}

.faq-title {
    text-align: center;
    font-size: 22px;
    color: #1f2937;
    margin-bottom: 8px;
}

.faq-sub {
    text-align: center;
    color: #6b7280;
    font-size: 14px;
    margin-bottom: 24px;
}

.faq-list {
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
    overflow: hidden;
}

.faq-item {
    border-bottom: 1px solid #f3f4f6;
}

.faq-item:last-child {
    border-bottom: none;
}

.faq-item summary {
    padding: 16px 20px;
    font-weight: 600;
    color: #374151;
    cursor: pointer;
    list-style: none;
    position: relative;
    padding-left: 34px;
    transition: background 0.15s;
}

.faq-item summary:hover {
    background: #f9fafb;
}

.faq-item summary::before {
    content: "|";
    position: absolute;
    left: 16px;
    color: #3b82f6;
    font-weight: bold;
}

.faq-item summary::after {
    content: "+";
    position: absolute;
    right: 20px;
    color: #9ca3af;
    font-weight: normal;
    font-size: 18px;
}

.faq-item[open] summary::after {
    content: "-";
}

.faq-content {
    padding: 0 20px 20px;
    color: #6b7280;
    font-size: 14px;
    line-height: 1.8;
}

.link-text {
    color: #3b82f6;
    cursor: pointer;
}

.link-text:hover {
    text-decoration: underline;
}

.carrier-info p {
    margin-bottom: 8px;
}

.carrier-info strong {
    color: #374151;
}

/* ===== 页脚 ===== */
.footer {
    background: #1f2937;
    color: #9ca3af;
    padding: 30px 20px;
    margin-top: 40px;
}

.footer-inner {
    max-width: 1100px;
    margin: 0 auto;
    text-align: center;
}

.footer-warning {
    font-size: 13px;
    color: #d1d5db;
    margin-bottom: 16px;
}

.footer-links {
    display: flex;
    justify-content: center;
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 16px;
}

.footer-links a {
    color: #9ca3af;
    text-decoration: none;
    font-size: 13px;
    transition: color 0.2s;
}

.footer-links a:hover {
    color: #fff;
}

.footer-copy {
    font-size: 12px;
    margin-bottom: 6px;
}

.footer-icp {
    font-size: 12px;
}

/* ===== 响应式 ===== */
@media (max-width: 768px) {
    .segment-grid {
        grid-template-columns: repeat(6, 1fr);
    }

    .preview-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .banner h1 {
        font-size: 22px;
    }

    .btn-row {
        flex-direction: column;
    }

    .btn-row button {
        width: 100%;
    }

    .inline-fields {
        flex-direction: column;
        align-items: flex-start;
    }

    .nav {
        gap: 6px;
    }

    .nav-btn {
        padding: 4px 10px;
        font-size: 12px;
    }
}
