/* FraudLens - 全维度反欺诈检测系统样式 (style.css) */

:root {
    --bg-dark: #090d16;
    --card-bg: rgba(17, 24, 39, 0.88);
    --card-border: rgba(255, 255, 255, 0.08);
    --card-border-hover: rgba(56, 189, 248, 0.35);
    --text-main: #f3f4f6;
    --text-muted: #9ca3af;
    --primary: #38bdf8;
    --primary-glow: rgba(56, 189, 248, 0.25);
    --success: #10b981;
    --success-glow: rgba(16, 185, 129, 0.25);
    --warning: #f59e0b;
    --warning-glow: rgba(245, 158, 11, 0.25);
    --danger: #ef4444;
    --danger-glow: rgba(239, 68, 68, 0.25);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    -webkit-tap-highlight-color: transparent;
}

body {
    background-color: var(--bg-dark);
    background-image: 
        radial-gradient(at 10% 15%, rgba(56, 189, 248, 0.08) 0px, transparent 50%),
        radial-gradient(at 90% 85%, rgba(16, 185, 129, 0.06) 0px, transparent 50%);
    background-attachment: fixed;
    color: var(--text-main);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    min-height: 100vh;
    padding: 24px 20px max(28px, env(safe-area-inset-bottom)) 20px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
}

/* ================= Header ================= */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--card-border);
    margin-bottom: 24px;
    gap: 16px;
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
}

.brand-icon {
    font-size: 28px;
    background: linear-gradient(135deg, #38bdf8, #818cf8);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    filter: drop-shadow(0 2px 8px var(--primary-glow));
    flex-shrink: 0;
}

.brand-text {
    display: flex;
    flex-direction: column;
}

.brand-header-line {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.brand-title {
    font-size: 24px;
    font-weight: 800;
    letter-spacing: -0.5px;
    background: linear-gradient(180deg, #ffffff, #e2e8f0);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.brand-badge {
    background: rgba(56, 189, 248, 0.15);
    color: #38bdf8;
    border: 1px solid rgba(56, 189, 248, 0.25);
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 999px;
    font-weight: 600;
    letter-spacing: 0.5px;
}

.brand-sub {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 3px;
    line-height: 1.35;
}

.header-actions {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-shrink: 0;
}

.btn {
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 13.5px;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    white-space: nowrap;
    user-select: none;
}

.btn:active {
    transform: scale(0.96);
}

.btn-primary {
    background: linear-gradient(135deg, #0284c7, #2563eb);
    color: #fff;
    box-shadow: 0 4px 14px rgba(37, 99, 235, 0.35);
}

.btn-primary:hover {
    background: linear-gradient(135deg, #0369a1, #1d4ed8);
    transform: translateY(-1px);
    box-shadow: 0 6px 18px rgba(37, 99, 235, 0.45);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-main);
    border: 1px solid var(--card-border);
    backdrop-filter: blur(8px);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.15);
}

/* ================= Radar Hero Card ================= */
.hero-radar {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    backdrop-filter: blur(16px);
    border-radius: 18px;
    padding: 28px 32px;
    display: flex;
    align-items: center;
    justify-content: space-around;
    gap: 28px;
    margin-bottom: 24px;
    box-shadow: 0 12px 36px rgba(0, 0, 0, 0.45);
    position: relative;
    overflow: hidden;
}

.hero-radar::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(56, 189, 248, 0.3), transparent);
}

.radar-circle-wrap {
    position: relative;
    width: 170px;
    height: 170px;
    flex-shrink: 0;
}

.radar-svg {
    width: 100%;
    height: 100%;
    transform: rotate(-90deg);
}

.radar-circle-bg {
    fill: none;
    stroke: rgba(255, 255, 255, 0.06);
    stroke-width: 8;
}

.radar-circle-fill {
    fill: none;
    stroke: var(--success);
    stroke-width: 8;
    stroke-linecap: round;
    transition: stroke-dashoffset 0.9s cubic-bezier(0.4, 0, 0.2, 1), stroke 0.4s ease;
}

.radar-score-content {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.radar-score-num {
    font-size: 46px;
    font-weight: 800;
    line-height: 1;
    letter-spacing: -1px;
}

.radar-score-label {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 5px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.radar-info {
    flex: 1;
    min-width: 260px;
}

.radar-status-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
    flex-wrap: wrap;
}

.radar-summary-pills {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    align-items: center;
}

.pill {
    padding: 3px 10px;
    border-radius: 999px;
    font-size: 11.5px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    user-select: none;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.pill:hover {
    transform: translateY(-1px);
}

.pill:active {
    transform: scale(0.95);
}

.pill-critical {
    background: rgba(239, 68, 68, 0.15);
    color: #f87171;
    border: 1px solid rgba(239, 68, 68, 0.3);
}
.pill-critical:hover {
    background: rgba(239, 68, 68, 0.25);
    box-shadow: 0 0 10px rgba(239, 68, 68, 0.3);
}

.pill-warn {
    background: rgba(245, 158, 11, 0.15);
    color: #fbbf24;
    border: 1px solid rgba(245, 158, 11, 0.3);
}
.pill-warn:hover {
    background: rgba(245, 158, 11, 0.25);
    box-shadow: 0 0 10px rgba(245, 158, 11, 0.3);
}

.pill-pass {
    background: rgba(16, 185, 129, 0.15);
    color: #34d399;
    border: 1px solid rgba(16, 185, 129, 0.3);
}
.pill-pass:hover {
    background: rgba(16, 185, 129, 0.25);
    box-shadow: 0 0 10px rgba(16, 185, 129, 0.3);
}

.badge-level {
    padding: 4px 14px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.3px;
}

.radar-verdict {
    font-size: 14.5px;
    color: #e5e7eb;
    margin-bottom: 14px;
    line-height: 1.55;
}

.scan-status-text {
    font-size: 12px;
    color: var(--primary);
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

/* ================= Grid Layout ================= */
.grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 18px;
    margin-bottom: 24px;
}

.card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    backdrop-filter: blur(12px);
    border-radius: 14px;
    padding: 18px 20px;
    transition: all 0.25s ease;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
}

.card:hover {
    border-color: var(--card-border-hover);
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
}

.card-title {
    font-size: 14.5px;
    font-weight: 700;
    margin-bottom: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
    color: #f1f5f9;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    padding-bottom: 10px;
}

.prop-row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    font-size: 13px;
    padding: 7px 0;
    border-bottom: 1px dashed rgba(255, 255, 255, 0.04);
    gap: 12px;
}

.prop-row:last-child {
    border-bottom: none;
    padding-bottom: 2px;
}

.prop-label {
    color: var(--text-muted);
    font-size: 12.5px;
    flex-shrink: 0;
}

.prop-val {
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    color: #f3f4f6;
    text-align: right;
    word-break: break-all;
    overflow-wrap: anywhere;
    font-size: 12.5px;
    line-height: 1.4;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.font-bold { font-weight: 700; }
.font-mono { font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace; }

.badge {
    padding: 2px 7px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    white-space: nowrap;
}

.badge-success {
    background: rgba(16, 185, 129, 0.15);
    color: #34d399;
    border: 1px solid rgba(16, 185, 129, 0.25);
}

.badge-warning {
    background: rgba(245, 158, 11, 0.15);
    color: #fbbf24;
    border: 1px solid rgba(245, 158, 11, 0.25);
}

.badge-danger {
    background: rgba(239, 68, 68, 0.15);
    color: #f87171;
    border: 1px solid rgba(239, 68, 68, 0.25);
}

.badge-info {
    background: rgba(56, 189, 248, 0.15);
    color: #38bdf8;
    border: 1px solid rgba(56, 189, 248, 0.25);
}

.badge-purple {
    background: rgba(192, 132, 252, 0.15);
    color: #c084fc;
    border: 1px solid rgba(192, 132, 252, 0.25);
}

.text-success { color: #34d399; }
.text-warning { color: #fbbf24; }
.text-danger { color: #f87171; }
.text-info { color: #38bdf8; }
.text-purple { color: #c084fc; }

/* ================= Checklist Section ================= */
.checklist-section {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    backdrop-filter: blur(16px);
    border-radius: 18px;
    padding: 24px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
}

.checklist-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 18px;
    gap: 14px;
    flex-wrap: wrap;
}

.checklist-title {
    font-size: 16.5px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 8px;
    color: #f8fafc;
}

.checklist-filters {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.filter-tab {
    padding: 5px 12px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    background: rgba(255, 255, 255, 0.04);
    color: var(--text-muted);
    border: 1px solid var(--card-border);
    transition: all 0.2s;
    user-select: none;
}

.filter-tab:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
}

.filter-tab.active {
    background: rgba(56, 189, 248, 0.15);
    color: #38bdf8;
    border-color: rgba(56, 189, 248, 0.4);
    box-shadow: 0 0 10px rgba(56, 189, 248, 0.2);
}

.filter-tab.tab-critical.active {
    background: rgba(239, 68, 68, 0.2);
    color: #f87171;
    border-color: rgba(239, 68, 68, 0.4);
}

.filter-tab.tab-warn.active {
    background: rgba(245, 158, 11, 0.2);
    color: #fbbf24;
    border-color: rgba(245, 158, 11, 0.4);
}

.filter-tab.tab-pass.active {
    background: rgba(16, 185, 129, 0.2);
    color: #34d399;
    border-color: rgba(16, 185, 129, 0.4);
}

.check-item {
    padding: 14px 16px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.04);
    margin-bottom: 10px;
    transition: all 0.2s;
}

.check-item:last-child {
    margin-bottom: 0;
}

.check-critical {
    border-left: 4px solid var(--danger);
    background: rgba(239, 68, 68, 0.05);
}

.check-warn {
    border-left: 4px solid var(--warning);
    background: rgba(245, 158, 11, 0.05);
}

.check-pass {
    border-left: 4px solid var(--success);
}

.check-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 6px;
    flex-wrap: wrap;
}

.check-header-left {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.score-deduct-badge {
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 11.5px;
    font-weight: 700;
}

.deduct-critical {
    background: rgba(239, 68, 68, 0.2);
    color: #f87171;
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.deduct-warn {
    background: rgba(245, 158, 11, 0.2);
    color: #fbbf24;
    border: 1px solid rgba(245, 158, 11, 0.3);
}

.check-title {
    font-weight: 600;
    font-size: 13.5px;
}

.check-detail {
    font-size: 12.5px;
    color: var(--text-muted);
    line-height: 1.45;
}

.check-suggestion {
    margin-top: 8px;
    font-size: 12px;
    padding: 8px 12px;
    border-radius: 6px;
    line-height: 1.45;
}

.sug-critical {
    background: rgba(239, 68, 68, 0.08);
    border: 1px solid rgba(239, 68, 68, 0.2);
    color: #fca5a5;
}

.sug-warn {
    background: rgba(245, 158, 11, 0.08);
    border: 1px solid rgba(245, 158, 11, 0.2);
    color: #fcd34d;
}

.sug-pass {
    background: rgba(56, 189, 248, 0.08);
    border: 1px solid rgba(56, 189, 248, 0.2);
    color: #7dd3fc;
}

/* ================= 手机端深度响应式适配 (Mobile Optimization) ================= */
@media (max-width: 640px) {
    body {
        padding: 14px 12px max(24px, env(safe-area-inset-bottom)) 12px;
    }

    /* 1. Header 在移动端自适应重构 */
    .header {
        flex-direction: column;
        align-items: stretch;
        gap: 14px;
        padding-bottom: 16px;
        margin-bottom: 18px;
    }

    .brand {
        gap: 10px;
    }

    .brand-icon {
        font-size: 26px;
    }

    .brand-title {
        font-size: 21px;
    }

    .brand-sub {
        font-size: 11px;
        margin-top: 2px;
    }

    .header-actions {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 10px;
        width: 100%;
    }

    .btn {
        width: 100%;
        padding: 9px 12px;
        font-size: 13px;
        border-radius: 8px;
    }

    /* 2. Hero Radar 卡片紧凑而富有层次 */
    .hero-radar {
        padding: 20px 16px;
        flex-direction: column;
        text-align: center;
        gap: 18px;
        margin-bottom: 18px;
        border-radius: 14px;
    }

    .radar-circle-wrap {
        width: 140px;
        height: 140px;
    }

    .radar-score-num {
        font-size: 38px;
    }

    .radar-score-label {
        font-size: 10px;
    }

    .radar-info {
        width: 100%;
        min-width: unset;
    }

    .radar-status-bar {
        justify-content: center;
        margin-bottom: 12px;
        flex-direction: column;
        gap: 8px;
    }

    .radar-summary-pills {
        justify-content: center;
        width: 100%;
        gap: 6px;
    }

    .pill {
        padding: 3px 8px;
        font-size: 11px;
    }

    .badge-level {
        font-size: 12.5px;
        padding: 4px 12px;
    }

    .radar-verdict {
        font-size: 13.5px;
        line-height: 1.5;
        margin-bottom: 10px;
        padding: 10px 12px;
        background: rgba(255, 255, 255, 0.03);
        border: 1px solid rgba(255, 255, 255, 0.05);
        border-radius: 10px;
        text-align: left;
    }

    .scan-status-text {
        font-size: 11.5px;
    }

    /* 3. 网格卡片全面单列紧凑排版 */
    .grid {
        grid-template-columns: 1fr;
        gap: 14px;
        margin-bottom: 18px;
    }

    .card {
        padding: 16px 14px;
        border-radius: 12px;
    }

    .card-title {
        font-size: 14px;
        margin-bottom: 12px;
        padding-bottom: 8px;
    }

    /* 4. 属性行在移动端自适应：短值横排对齐，长值折行靠右 */
    .prop-row {
        padding: 7px 0;
        font-size: 12.5px;
        gap: 8px;
    }

    .prop-label {
        font-size: 12px;
        color: #94a3b8;
    }

    .prop-val {
        font-size: 12px;
        max-width: 65%;
    }

    /* 5. Checklist 移动端优化 */
    .checklist-section {
        padding: 18px 14px;
        border-radius: 14px;
    }

    .checklist-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .checklist-title {
        font-size: 15px;
        margin-bottom: 0;
    }

    .checklist-filters {
        width: 100%;
        display: grid;
        grid-template-columns: repeat(4, 1fr);
        gap: 6px;
    }

    .filter-tab {
        padding: 6px 2px;
        font-size: 11px;
        text-align: center;
        border-radius: 6px;
    }

    .check-item {
        padding: 12px 12px;
    }

    .check-title {
        font-size: 13px;
    }

    .check-detail {
        font-size: 12px;
        line-height: 1.4;
    }

    .check-suggestion {
        font-size: 11.5px;
        padding: 6px 9px;
    }
}

/* 超窄屏幕额外适配 (如 iPhone SE / 375px) */
@media (max-width: 380px) {
    .brand-title {
        font-size: 19px;
    }
    .brand-badge {
        font-size: 10px;
        padding: 1px 6px;
    }
    .btn {
        font-size: 12px;
        padding: 8px 10px;
    }
    .prop-val {
        max-width: 60%;
        font-size: 11.5px;
    }
}
