/* ========== 全局重置 & 基础样式（复用IP查询样式） ========== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: "Microsoft YaHei", "PingFang SC", sans-serif;
}

body {
    background-color: #f5f7fa;
    padding: 0;
    min-width: 1200px; /* 电脑端最小宽度 */
}

/* ========== 导航栏样式（完全保留IP查询的绿色导航栏） ========== */
.navbar {
    background-color: #28a745;
    color: #fff;
    padding: 15px 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    position: sticky;
    top: 0;
    z-index: 999;
}
.navbar-container {
    max-width: 1920px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.navbar-logo {
    font-size: 20px;
    font-weight: 700;
}
.navbar-menu {
    display: flex;
    gap: 30px;
}
.navbar-menu a {
    color: #fff;
    text-decoration: none;
    font-size: 14px;
    transition: opacity 0.3s;
}
.navbar-menu a:hover {
    opacity: 0.8;
    text-decoration: underline;
}

/* ========== 页脚样式（复用IP查询样式） ========== */
.footer {
    background-color: #333;
    color: #ccc;
    padding: 20px 15px;
    margin-top: 40px;
}
.footer-container {
    max-width: 1920px;
    margin: 0 auto;
}
.footer-copyright {
    text-align: center;
    font-size: 12px;
    color: #999;
    line-height: 1.6;
}

/* ========== 主容器样式（核心布局和IP查询一致） ========== */
.page-wrapper {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}
.page-container {
    margin-top: 30px;
}
.main-card {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.05);
    padding: 30px;
    margin-bottom: 20px;
}

/* ========== 标题区域样式（和IP查询一致） ========== */
.tool-header {
    margin-bottom: 25px;
    border-bottom: 1px solid #eee;
    padding-bottom: 15px;
}
.tool-title {
    font-size: 22px;
    color: #2c3e50;
    margin-bottom: 8px;
    font-weight: 600;
}
.tool-desc {
    font-size: 14px;
    color: #666;
    line-height: 1.6;
}

/* ========== 表单区域样式（核心和IP查询一致） ========== */
.query-form {
    display: flex;
    gap: 12px;
    align-items: center;
    margin-bottom: 25px;
    flex-wrap: wrap;
}
.form-group {
    flex: 1;
    min-width: 280px;
}
.form-group label {
    display: block;
    margin-bottom: 6px;
    color: #333;
    font-weight: 500;
    font-size: 14px;
}
.form-control {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid #e5e9f0;
    border-radius: 6px;
    font-size: 14px;
    color: #333;
    transition: all 0.2s ease;
}
.form-control:focus {
    outline: none;
    border-color: #28a745;
    box-shadow: 0 0 0 3px rgba(40, 167, 69, 0.1);
}
.submit-btn {
    padding: 12px 30px;
    background-color: #28a745;
    color: #fff;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
    height: 44px;
}
.submit-btn:hover {
    background-color: #218838;
    transform: translateY(-1px);
}
.submit-btn:active {
    transform: translateY(0);
}

/* ========== 提示信息样式（和IP查询一致） ========== */
.alert {
    padding: 12px 15px;
    border-radius: 6px;
    font-size: 14px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 8px;
}
.alert-success { 
    background: #ECFDF5; 
    color: #065F46; 
    border: 1px solid #D1FAE5;
}
.alert-error { 
    background: #FEF2F2; 
    color: #DC2626; 
    border: 1px solid #FEE2E2;
}
.alert-icon {
    font-size: 18px;
}

/* ========== 结果展示区域（和IP查询一致） ========== */
.result-section {
    margin-top: 30px;
    display: none;
}
.result-section.show {
    display: block;
}
.result-header {
    font-size: 18px;
    color: #28a745;
    margin-bottom: 20px;
    font-weight: 600;
    padding-bottom: 10px;
    border-bottom: 2px solid #f0f8f2;
}
.result-card {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 25px;
    margin-bottom: 20px;
}

/* ========== 历史记录区域（和IP查询完全一致） ========== */
.history-section {
    margin-top: 30px;
}
.history-header {
    font-size: 16px;
    color: #2c3e50;
    margin-bottom: 15px;
    font-weight: 600;
}
.history-card {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 20px;
    border: 1px solid #f0f0f0;
}
.history-list {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    max-height: 180px;
    overflow-y: auto;
    padding-right: 8px;
}
.history-item {
    padding: 8px 15px;
    background: #fff;
    border: 1px solid #e5e9f0;
    border-radius: 6px;
    font-size: 13px;
    color: #333;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}
.history-item:hover {
    background: #f0f8f2;
    border-color: #28a745;
    color: #28a745;
}
.history-empty {
    padding: 20px;
    text-align: center;
    color: #999;
    font-size: 14px;
    background: #fff;
    border-radius: 6px;
}

/* ========== SSL专用样式（保留核心功能样式，适配新布局） ========== */
.use-desc-container {
    background: #f0f8fb;
    border-left: 4px solid #10b981;
    padding: 15px 20px;
    margin: 15px 0;
    border-radius: 0 4px 4px 0;
    line-height: 1.8;
    color: #333;
}
.use-desc-container h3 {
    margin: 0 0 10px 0;
    font-size: 16px;
    font-weight: 600;
    color: #2d3748;
}
.use-desc-container p {
    margin: 5px 0;
    font-size: 14px;
}

/* SSL证书结果表格样式（适配新布局） */
.result-table {
    width: 100%;
    border-collapse: collapse;
    margin: 10px 0;
}
.result-table th, .result-table td {
    padding: 12px 15px;
    border: 1px solid #e5e9f0;
    text-align: left;
}
.result-table th {
    background-color: #f0f8f4;
    color: #28a745;
    font-weight: 600;
}
.result-table tr:nth-child(even) {
    background-color: #f8f9fa;
}

/* SSL证书链样式（适配新布局） */
.cert-chain-container {
    margin-top: 20px;
    padding: 20px;
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
    border: 1px solid #f0f2f5;
}
.cert-chain-title {
    font-size: 18px;
    font-weight: 600;
    color: #1f2937;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}
.cert-chain-title::before {
    content: '';
    display: inline-block;
    width: 4px;
    height: 20px;
    background: #2563eb;
    border-radius: 2px;
}
.cert-chain-item {
    padding: 16px;
    background: #f9fafb;
    border-radius: 8px;
    margin-bottom: 12px;
    position: relative;
    padding-left: 24px;
}
.cert-chain-item:last-child {
    margin-bottom: 0;
}
.cert-chain-item::before {
    content: '';
    position: absolute;
    left: 8px;
    top: 20px;
    bottom: 20px;
    width: 2px;
    background: #e5e7eb;
}
.cert-chain-item:first-child::before {
    background: #2563eb;
}
.cert-chain-item h5 {
    font-size: 16px;
    font-weight: 600;
    color: #111827;
    margin: 0 0 8px 0;
}
.cert-chain-item .cert-meta {
    font-size: 14px;
    color: #4b5563;
    line-height: 1.6;
    margin: 4px 0;
}
.cert-chain-item .cert-meta strong {
    color: #1f2937;
    font-weight: 500;
}
.cert-chain-status {
    margin-top: 12px;
    font-size: 14px;
    color: #22c55e;
    display: flex;
    align-items: center;
    gap: 6px;
}
.cert-chain-status.warning {
    color: #f59e0b;
}
.cert-empty-tip {
    padding: 20px;
    text-align: center;
    color: #9ca3af;
    font-size: 14px;
    background: #f9fafb;
    border-radius: 8px;
    margin-top: 20px;
}

/* SSL结果提示样式（适配新布局） */
.ssl-result-tip {
    padding: 16px 20px;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 500;
    text-align: center;
    margin-bottom: 20px;
}
.ssl-tip-success {
    background: #dcfce7;
    color: #166534;
    border: 1px solid #bbf7d0;
}
.ssl-tip-error {
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #fecaca;
}
.ssl-tip-expire {
    background: #fffbeb;
    color: #92400e;
    border: 1px solid #fef3c7;
}

/* PEM证书样式（适配新布局） */
.pem-block {
    background:#f8f9fa; 
    padding:10px; 
    border-radius:5px; 
    font-family:monospace; 
    font-size:12px; 
    max-height:300px; 
    overflow:auto; 
    margin:10px 0;
    white-space: pre-wrap;
}
.text-break { word-break: break-all; }
.mt-3 { margin-top: 15px !important; }

/* ========== 响应式适配（和IP查询完全一致） ========== */
@media only screen and (max-width: 768px) {
    body {
        min-width: unset;
        width: 100%;
        overflow-x: hidden;
    }
    /* 导航栏移动端样式 */
    .navbar {
        padding: 10px 15px !important;
    }
    .navbar-container {
        flex-direction: column !important;
        gap: 10px !important;
        align-items: flex-start !important;
    }
    .navbar-menu {
        gap: 10px !important;
        flex-wrap: wrap !important;
        width: 100% !important;
    }
    .navbar-menu a {
        font-size: 12px !important;
    }
    /* 主容器移动端样式 */
    .main-card {
        padding: 20px 15px;
    }
    .tool-title {
        font-size: 18px;
    }
    .query-form {
        flex-direction: column;
        gap: 15px;
    }
    .form-group {
        min-width: 100%;
    }
    .submit-btn {
        width: 100%;
    }
    /* 历史记录移动端 */
    .history-list {
        max-height: 150px;
    }
    /* SSL专用移动端样式 */
    .result-table {
        display: block;
        width: 100% !important;
        overflow-x: auto;
        font-size: 12px;
        -webkit-overflow-scrolling: touch;
    }
    .result-table th,
    .result-table td {
        padding: 8px 10px;
        white-space: pre-wrap;
        word-break: break-all;
        min-width: 100px;
    }
    .pem-block {
        max-height: 220px !important;
        font-size: 11px !important;
        padding: 8px !important;
        white-space: pre-wrap !important;
        word-break: break-all !important;
        overflow-x: hidden !important;
    }
    .cert-chain-container {
        padding: 12px !important;
        margin-top: 15px !important;
    }
    .cert-chain-item {
        padding: 12px !important;
        padding-left: 20px !important;
    }
    .cert-chain-item h5 {
        font-size: 14px !important;
    }
    .cert-meta {
        font-size: 12px !important;
        line-height: 1.5 !important;
    }
    .ssl-result-tip {
        padding: 12px !important;
        font-size: 14px !important;
    }
}
/* 在style.css末尾添加 */
.back-btn {
    display: inline-block;
    text-decoration: none;
    padding: 8px 20px;
    margin: 10px 0;
    border: none;
    border-radius: 4px;
    background-color: #28a745; /* 和提交按钮一致的绿色 */
    color: #fff !important; /* 白色文字 */
    font-size: 14px;
    cursor: pointer;
    transition: background-color 0.3s;
}

.back-btn:hover {
    background-color: #218838; /* hover时加深绿色 */
    color: #fff !important;
    text-decoration: none;
}
/* 加载中美化 */
.loading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 22px;
    font-size: 15px;
    color: #28a745;
    background: rgba(40, 167, 69, 0.05);
    border-radius: 8px;
    margin: 10px 0;
}
.loading-spinner {
    width: 18px;
    height: 18px;
    border: 2px solid #28a745;
    border-top-color: transparent;
    border-radius: 50%;
    animation: loading-rotate 0.8s linear infinite;
}
@keyframes loading-rotate {
    to { transform: rotate(360deg); }
}