* {
    box-sizing: border-box;
}

:root {
    --bg: #f5f7fb;
    --card: #ffffff;
    --border: #e5e7eb;
    --text: #111827;
    --muted: #6b7280;
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --success: #16a34a;
    --danger: #dc2626;
    --hover: #f8fafc;
    --soft: #eff6ff;
    --shadow: 0 8px 30px rgba(15, 23, 42, .07);
}

body {
    margin: 0;
    font-family:
        Inter,
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        Roboto,
        Arial,
        sans-serif;
    background: var(--bg);
    color: var(--text);
}

button,
input,
select {
    font: inherit;
}

button {
    cursor: pointer;
}

.header {
    background: #fff;
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 10;
}

.header-inner {
    max-width: 1400px;
    margin: auto;
    padding: 16px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

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

.logo {
    width: 42px;
    height: 42px;
    border-radius: 11px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--primary);
    color: #fff;
    font-weight: 800;
    font-size: 20px;
}

.brand-title {
    font-weight: 800;
    font-size: 19px;
}

.brand-subtitle {
    color: var(--muted);
    font-size: 12px;
    margin-top: 2px;
}

.badge {
    background: #ecfdf5;
    color: #15803d;
    border-radius: 999px;
    padding: 7px 12px;
    font-size: 12px;
    font-weight: 700;
}

.container {
    max-width: 1400px;
    margin: auto;
    padding: 28px 24px 60px;
}

.hero {
    margin-bottom: 22px;
}

.hero h1 {
    margin: 0 0 7px;
    font-size: 30px;
}

.hero p {
    margin: 0;
    color: var(--muted);
    line-height: 1.6;
}

.card {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 16px;
    box-shadow: var(--shadow);
}

.upload-card {
    padding: 20px;
    margin-bottom: 18px;
}

.dropzone {
    min-height: 185px;
    border: 2px dashed #cbd5e1;
    border-radius: 14px;
    background: #fafcff;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    transition: .2s;
    padding: 30px;
}

.dropzone.dragover {
    border-color: var(--primary);
    background: var(--soft);
}

.drop-icon {
    font-size: 43px;
    margin-bottom: 10px;
}

.drop-title {
    font-weight: 800;
    font-size: 18px;
}

.drop-description {
    color: var(--muted);
    font-size: 13px;
    margin: 7px 0 16px;
}

.primary-btn {
    border: 0;
    border-radius: 9px;
    padding: 10px 17px;
    background: var(--primary);
    color: #fff;
    font-weight: 700;
}

.primary-btn:hover {
    background: var(--primary-dark);
}

.secondary-btn {
    border: 1px solid var(--border);
    background: #fff;
    border-radius: 9px;
    padding: 9px 14px;
    font-weight: 600;
}

.secondary-btn:hover {
    background: var(--hover);
}

.danger-btn {
    border: 0;
    background: #fef2f2;
    color: var(--danger);
    border-radius: 9px;
    padding: 9px 14px;
    font-weight: 700;
}

input[type="file"] {
    display: none;
}

.file-info {
    display: none;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
    border: 1px solid var(--border);
    padding: 12px 14px;
    border-radius: 10px;
    margin-top: 14px;
}

.file-info.show {
    display: flex;
}

.file-name {
    font-weight: 700;
    word-break: break-all;
}

.file-size {
    color: var(--muted);
    font-size: 12px;
    margin-top: 3px;
}

.controls {
    display: grid;
    grid-template-columns: 1fr auto auto auto;
    gap: 10px;
    padding: 18px;
    margin-bottom: 18px;
}

.search-input {
    width: 100%;
    border: 1px solid var(--border);
    border-radius: 9px;
    padding: 11px 13px;
    outline: none;
}

.search-input:focus {
    border-color: var(--primary);
}

.checkbox {
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 0 6px;
    font-size: 13px;
    color: #374151;
    white-space: nowrap;
}

.stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 14px;
    margin-bottom: 18px;
}

.stat {
    padding: 16px;
}

.stat-label {
    font-size: 12px;
    color: var(--muted);
    font-weight: 600;
}

.stat-value {
    font-size: 21px;
    font-weight: 800;
    margin-top: 6px;
}

.results-card {
    overflow: hidden;
}

.results-header {
    padding: 15px 18px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.results-title {
    font-weight: 800;
}

.results-count {
    color: var(--muted);
    font-size: 12px;
}

.results {
    min-height: 300px;
    max-height: 700px;
    overflow: auto;
}

.empty {
    min-height: 300px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: var(--muted);
    padding: 40px;
}

.result {
    padding: 16px 18px;
    border-bottom: 1px solid var(--border);
}

.result:last-child {
    border-bottom: 0;
}

.result-top {
    display: flex;
    align-items: flex-start;
    gap: 10px;
}

.result-icon {
    font-size: 20px;
}

.result-main {
    flex: 1;
    min-width: 0;
}

.result-path {
    font-weight: 800;
    word-break: break-all;
}

.result-meta {
    margin-top: 4px;
    color: var(--muted);
    font-size: 11px;
}

.result-actions {
    display: flex;
    gap: 7px;
}

.icon-btn {
    width: 34px;
    height: 34px;
    border: 1px solid var(--border);
    background: #fff;
    border-radius: 7px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.icon-btn:hover {
    background: var(--soft);
    border-color: #bfdbfe;
}

.matches {
    margin-top: 11px;
    display: flex;
    flex-direction: column;
    gap: 7px;
}

.match {
    border: 1px solid var(--border);
    background: #fafafa;
    border-radius: 8px;
    padding: 9px 11px;
    font-family:
        ui-monospace,
        SFMono-Regular,
        Menlo,
        Monaco,
        Consolas,
        monospace;
    font-size: 12px;
    line-height: 1.55;
    overflow: auto;
}

.match-line {
    color: #64748b;
    margin-right: 8px;
    user-select: none;
}

mark {
    background: #fef08a;
    color: #111827;
    border-radius: 2px;
    padding: 1px 2px;
}

.progress {
    display: none;
    margin-bottom: 18px;
    padding: 16px 18px;
}

.progress.show {
    display: block;
}

.progress-top {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 9px;
}

.progress-title {
    font-size: 13px;
    font-weight: 800;
}

.progress-percent {
    font-size: 13px;
    font-weight: 800;
}

.track {
    height: 9px;
    border-radius: 999px;
    background: #e5e7eb;
    overflow: hidden;
}

.bar {
    height: 100%;
    width: 0;
    background: var(--primary);
    transition: width .15s;
}

.progress-detail {
    color: var(--muted);
    font-size: 11px;
    margin-top: 7px;
}

.notice {
    margin-top: 18px;
    background: #eff6ff;
    color: #1e40af;
    border: 1px solid #bfdbfe;
    border-radius: 10px;
    padding: 13px 15px;
    font-size: 12px;
    line-height: 1.6;
}

.footer {
    text-align: center;
    color: var(--muted);
    font-size: 12px;
    margin-top: 28px;
}

@media(max-width:850px) {

    .controls {
        grid-template-columns: 1fr 1fr;
    }

    .stats {
        grid-template-columns: repeat(2, 1fr);
    }

}

@media(max-width:600px) {

    .container,
    .header-inner {
        padding-left: 14px;
        padding-right: 14px;
    }

    .hero h1 {
        font-size: 25px;
    }

    .controls {
        grid-template-columns: 1fr;
    }

    .stats {
        grid-template-columns: 1fr 1fr;
    }

    .result-top {
        flex-wrap: wrap;
    }

}