/* ============================================================
   SSL 检查工具 - 站点自定义样式（纯本地，不依赖任何 CDN）
   ============================================================ */

:root {
    --primary: #0f3460;
    --secondary: #16213e;
    --accent: #e94560;
    --success: #4caf50;
    --warning: #ff9800;
    --danger: #f44336;
    --info: #2196f3;
    --light: #f5f5f5;
    --dark: #1a1a2e;
}

html, body {
    min-height: 100%;
}

body {
    font-family: Inter, system-ui, -apple-system, "Segoe UI", "Microsoft YaHei", "PingFang SC", sans-serif;
    -webkit-font-smoothing: antialiased;
}

/* ---------- 通用 ---------- */
.bg-gradient-primary {
    background: linear-gradient(135deg, #0f3460 0%, #16213e 100%);
}

.text-shadow {
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.transition-all-300 {
    transition: all 300ms ease-in-out;
}

.font-mono {
    font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
}

/* ---------- 首页 Hero 纹理 ---------- */
.hero-pattern {
    background-color: #0f3460;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='60' height='60' viewBox='0 0 60 60'%3E%3Cg fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.05'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
    background-attachment: fixed;
}

/* ---------- 搜索框 ---------- */
.search-box {
    transition: box-shadow 300ms ease-in-out, transform 300ms ease-in-out;
}

.search-box:focus-within {
    box-shadow: 0 10px 25px -5px rgba(15, 52, 96, 0.35);
}

/* ---------- 功能卡片 ---------- */
.feature-card {
    transition: transform 300ms ease-in-out, box-shadow 300ms ease-in-out;
}

.feature-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 18px 35px -12px rgba(15, 52, 96, 0.28);
}

.result-card {
    transition: box-shadow 300ms ease-in-out;
}

.result-card:hover {
    box-shadow: 0 12px 28px -12px rgba(15, 52, 96, 0.25);
}

/* ---------- 状态徽章 ---------- */
.status-badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 12px;
    border-radius: 9999px;
    font-size: 13px;
    font-weight: 500;
    line-height: 1.4;
    white-space: nowrap;
}

.status-badge-success {
    background-color: #e8f5e9;
    color: #2e7d32;
}

.status-badge-warning {
    background-color: #fff3e0;
    color: #e65100;
}

.status-badge-danger {
    background-color: #ffebee;
    color: #c62828;
}

.status-badge-info {
    background-color: #e3f2fd;
    color: #1565c0;
}

.status-badge-muted {
    background-color: #eceff1;
    color: #546e7a;
}

/* ---------- 进度条 ---------- */
.progress-bar {
    width: 100%;
    height: 8px;
    background-color: #e0e0e0;
    border-radius: 9999px;
    overflow: hidden;
}

.progress-bar-fill {
    height: 100%;
    border-radius: 9999px;
    background-color: #0f3460;
    transition: width 400ms ease-in-out;
}

/* ---------- 历史表格 ---------- */
.history-table {
    border-collapse: collapse;
    width: 100%;
    font-size: 14px;
}

.history-table thead tr {
    background-color: #0f3460;
    color: #ffffff;
}

.history-table th {
    padding: 12px 16px;
    text-align: left;
    font-weight: 500;
    white-space: nowrap;
}

.history-table td {
    padding: 12px 16px;
    border-bottom: 1px solid #eceff1;
    vertical-align: middle;
}

.history-table tbody tr:nth-child(even) {
    background-color: #fafafa;
}

.history-table tbody tr:hover {
    background-color: #eef2f7;
}

/* ---------- 信息项（键值列表） ---------- */
.info-item {
    border-bottom: 1px dashed #e4e7eb;
    padding: 10px 0;
}

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

.info-label {
    font-size: 13px;
    color: #78909c;
    margin-bottom: 4px;
}

.info-value {
    font-size: 14px;
    color: #263238;
    word-break: break-all;
}

/* ---------- 证书链 ---------- */
.chain-item {
    position: relative;
    border-left: 2px solid #cfd8dc;
    padding-left: 18px;
    padding-bottom: 16px;
}

.chain-item:last-child {
    border-left-color: transparent;
    padding-bottom: 0;
}

.chain-item::before {
    content: "";
    position: absolute;
    left: -7px;
    top: 6px;
    width: 12px;
    height: 12px;
    border-radius: 9999px;
    background-color: #0f3460;
    border: 2px solid #ffffff;
    box-shadow: 0 0 0 1px #cfd8dc;
}

.chain-item.is-root::before {
    background-color: #4caf50;
}

.chain-item.is-bad::before {
    background-color: #f44336;
}

/* ---------- 评分环形 ---------- */
.score-ring {
    width: 120px;
    height: 120px;
    border-radius: 9999px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    font-weight: 500;
    flex-shrink: 0;
}

.score-excellent { background: linear-gradient(135deg, #43a047, #66bb6a); }
.score-good      { background: linear-gradient(135deg, #1e88e5, #42a5f5); }
.score-fair      { background: linear-gradient(135deg, #fb8c00, #ffa726); }
.score-poor      { background: linear-gradient(135deg, #e53935, #ef5350); }

/* ---------- SAN 标签 ---------- */
.san-tag {
    display: inline-block;
    background-color: #eceff1;
    color: #37474f;
    font-size: 12px;
    padding: 3px 10px;
    border-radius: 6px;
    margin: 3px 4px 3px 0;
    font-family: "SFMono-Regular", Consolas, Menlo, monospace;
}

/* ---------- 复制按钮 ---------- */
.copy-btn {
    cursor: pointer;
    color: #90a4ae;
    transition: color 200ms ease-in-out;
}

.copy-btn:hover {
    color: #0f3460;
}

/* ---------- 加载遮罩 ---------- */
#loading-container {
    backdrop-filter: blur(2px);
}

/* ---------- Toast ---------- */
.toast {
    position: absolute;
    left: 50%;
    bottom: 24px;
    transform: translateX(-50%);
    background-color: rgba(26, 26, 46, 0.92);
    color: #ffffff;
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 14px;
    z-index: 60;
    opacity: 0;
    transition: opacity 300ms ease-in-out;
    pointer-events: none;
}

.toast.show {
    opacity: 1;
}

/* ---------- 代码块 ---------- */
.header-block {
    max-height: 260px;
    overflow-y: auto;
    background-color: #fafafa;
    border: 1px solid #eceff1;
    border-radius: 8px;
    padding: 12px 16px;
    font-family: "SFMono-Regular", Consolas, Menlo, monospace;
    font-size: 12px;
    line-height: 1.7;
    color: #37474f;
}

/* ---------- 小屏适配 ---------- */
@media (max-width: 640px) {
    .history-table th,
    .history-table td {
        padding: 10px 12px;
        font-size: 13px;
    }
}
