:root {
    --bg: #0f1115;
    --bg-elev: #161a21;
    --bg-elev-2: #1d222b;
    --border: #262c38;
    --border-strong: #364056;
    --text: #e7ecf3;
    --text-muted: #9aa4b6;
    --accent: #5b8cff;
    --accent-hover: #7aa2ff;
    --accent-contrast: #0a0d14;
    --danger: #ff6b6b;
    --success: #4ade80;
    --radius: 10px;
    --radius-lg: 16px;
    --shadow: 0 6px 24px rgba(0, 0, 0, 0.25);
    --max-width: 1080px;
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    padding: 0;
    background: var(--bg);
    color: var(--text);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
}

body { min-height: 100vh; }

.container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 24px;
}

a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-hover); }

h1, h2, h3 { line-height: 1.2; margin: 0 0 0.6em; }
h1 { font-size: clamp(2rem, 4vw, 3rem); letter-spacing: -0.02em; }
h2 { font-size: 1.6rem; letter-spacing: -0.01em; }
h3 { font-size: 1.15rem; }

p { margin: 0 0 1em; color: var(--text); }
label { display: block; }
input[type="file"],
input[type="text"] {
    width: 100%;
    padding: 12px 14px;
    border-radius: var(--radius);
    border: 1px solid var(--border-strong);
    background: var(--bg-elev-2);
    color: var(--text);
    font: inherit;
}

.muted { color: var(--text-muted); }
.small { font-size: 0.9rem; }

.site-header {
    border-bottom: 1px solid var(--border);
    background: rgba(15, 17, 21, 0.85);
    backdrop-filter: blur(8px);
    position: sticky;
    top: 0;
    z-index: 10;
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 24px;
}

.logo {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-weight: 700;
    color: var(--text);
}

.logo:hover { color: var(--text); }
.logo-mark { font-size: 1.4rem; color: var(--accent); }

.site-nav a {
    color: var(--text-muted);
    margin-left: 22px;
    font-size: 0.95rem;
}

.site-nav a:hover { color: var(--text); }

.hero {
    padding: 80px 0 56px;
    text-align: center;
    background: radial-gradient(circle at 50% 0%, rgba(91, 140, 255, 0.18), transparent 60%);
}

.hero-sub {
    font-size: 1.15rem;
    color: var(--text-muted);
    max-width: 720px;
    margin: 0 auto 28px;
}

.tool-hero { padding: 56px 0 24px; }
.tool-hero p {
    color: var(--text-muted);
    max-width: 760px;
    font-size: 1.05rem;
}

.btn {
    display: inline-block;
    padding: 12px 22px;
    border-radius: var(--radius);
    border: 1px solid transparent;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.15s, border-color 0.15s, color 0.15s, transform 0.05s;
    font-family: inherit;
}

.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--accent); color: var(--accent-contrast); }
.btn-primary:hover { background: var(--accent-hover); color: var(--accent-contrast); }
.btn-secondary {
    background: var(--bg-elev-2);
    color: var(--text);
    border-color: var(--border-strong);
}
.btn-secondary:hover { background: #232a36; }
.btn-ghost {
    background: transparent;
    color: var(--text-muted);
}
.btn-small { padding: 8px 12px; font-size: 0.9rem; }

.tools-section, .about-section { padding: 56px 0; }
.tools-section h2, .about-section h2 { margin-bottom: 24px; }

.tool-grid,
.detail-grid,
.history-list,
.feature-grid {
    display: grid;
    gap: 18px;
}

.tool-grid { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.detail-grid { grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); }

.tool-card,
.history-card,
.feature,
.tool-form {
    background: var(--bg-elev);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
}

.tool-card {
    display: block;
    padding: 22px;
    color: var(--text);
    transition: border-color 0.15s, transform 0.15s, background-color 0.15s;
}

.tool-card:hover {
    border-color: var(--border-strong);
    transform: translateY(-2px);
    color: var(--text);
}

.tool-card p,
.feature p { color: var(--text-muted); font-size: 0.95rem; }

.tool-icon { font-size: 1.8rem; }
.tool-cta { color: var(--accent); font-weight: 600; font-size: 0.95rem; }

.history-card,
.feature { padding: 22px; }

.history-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.tool-workspace { padding: 16px 0 80px; }
.tool-form { padding: 24px; }

.dropzone {
    border: 2px dashed var(--border-strong);
    border-radius: var(--radius-lg);
    background: var(--bg-elev);
    padding: 56px 24px;
    text-align: center;
    cursor: pointer;
    transition: border-color 0.15s, background-color 0.15s;
}

.dropzone:hover,
.dropzone:focus,
.dropzone.is-dragover {
    border-color: var(--accent);
    background: rgba(91, 140, 255, 0.06);
    outline: none;
}

.dropzone-icon { font-size: 2.4rem; margin-bottom: 8px; }
.dropzone-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin: 0 0 4px;
}
.dropzone-sub { color: var(--text-muted); margin: 0 0 12px; }

.file-list-wrap { margin-top: 28px; }
.file-list-header { margin-bottom: 12px; }
.file-list-header h2 { margin-bottom: 4px; }

.file-list {
    list-style: none;
    margin: 0;
    padding: 0;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    background: var(--bg-elev);
}

.file-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    border-bottom: 1px solid var(--border);
    background: var(--bg-elev);
    cursor: grab;
    user-select: none;
}

.static-item { cursor: default; }
.file-item:last-child { border-bottom: none; }
.file-item.dragging { opacity: 0.4; cursor: grabbing; }
.file-item.drag-over { border-top: 2px solid var(--accent); }

.file-handle {
    color: var(--text-muted);
    font-size: 1rem;
    cursor: grab;
    line-height: 1;
}

.file-index {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--bg-elev-2);
    color: var(--text-muted);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    font-weight: 600;
    flex-shrink: 0;
}

.file-name {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-weight: 500;
}

.file-meta {
    color: var(--text-muted);
    font-size: 0.85rem;
    flex-shrink: 0;
}

.file-remove {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 1.2rem;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 6px;
    line-height: 1;
}

.file-remove:hover { color: var(--danger); background: rgba(255, 107, 107, 0.08); }

.options {
    margin-top: 22px;
    padding: 18px 18px 8px;
    background: var(--bg-elev);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}

.options-title {
    margin: 0 0 12px;
    font-size: 1rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-weight: 600;
}

.option-row {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 10px 0;
    cursor: pointer;
    border-bottom: 1px solid var(--border);
}

.option-row:last-of-type { border-bottom: none; }
.option-row input[type="radio"] {
    margin-top: 4px;
    accent-color: var(--accent);
    flex-shrink: 0;
}

.actions {
    margin-top: 22px;
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.status {
    margin-top: 16px;
    padding: 12px 14px;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    background: rgba(91, 140, 255, 0.08);
}

.status.success { color: var(--success); border-color: rgba(74, 222, 128, 0.35); }
.status.error { color: var(--danger); border-color: rgba(255, 107, 107, 0.35); }
.status.info { color: var(--text); }

.flash-wrap { padding-top: 18px; }
.pill {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.pill-completed { background: rgba(74, 222, 128, 0.14); color: var(--success); }
.pill-failed { background: rgba(255, 107, 107, 0.14); color: var(--danger); }
.pill-pending { background: rgba(91, 140, 255, 0.14); color: var(--accent-hover); }

.range-input { margin-top: 18px; }
.range-label { margin-bottom: 8px; font-weight: 600; }
.range-help { margin-top: 8px; }

@media (max-width: 720px) {
    .header-inner {
        align-items: flex-start;
        flex-direction: column;
        gap: 12px;
    }

    .site-nav a:first-child { margin-left: 0; }
    .tool-form { padding: 18px; }
    .file-item { flex-wrap: wrap; }
    .file-meta { width: 100%; }
}
