*,
*::before,
*::after {
    box-sizing: border-box;
}

body {
    margin: 0;
    padding: 0;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background: #0f172a;
    color: #e5e7eb;
}

.container {
    max-width: 960px;
    margin: 32px auto;
    padding: 0 16px 32px;
}

h1 {
    text-align: center;
    margin-bottom: 24px;
    font-size: 2rem;
    color: #f9fafb;
}

h2 {
    margin-top: 0;
    font-size: 1.25rem;
    color: #f9fafb;
}

.card {
    background: rgba(15, 23, 42, 0.9);
    border-radius: 12px;
    padding: 20px 20px 16px;
    margin-bottom: 20px;
    box-shadow: 0 18px 45px rgba(15, 23, 42, 0.8);
    border: 1px solid rgba(148, 163, 184, 0.3);
    backdrop-filter: blur(14px);
}

.upload-form {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
}

.file-input-label {
    position: relative;
    overflow: hidden;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 16px;
    border-radius: 999px;
    background: #020617;
    border: 1px solid rgba(148, 163, 184, 0.7);
    color: #e5e7eb;
    font-size: 0.9rem;
    cursor: pointer;
    transition: background 0.2s, transform 0.1s, box-shadow 0.2s, border-color 0.2s;
}

.file-input-label span {
    pointer-events: none;
}

.file-input-label input[type="file"] {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
}

.file-input-label:hover {
    background: #020617;
    border-color: #38bdf8;
    box-shadow: 0 0 0 1px rgba(56, 189, 248, 0.4);
}

.file-input-label:active {
    transform: scale(0.98);
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 9px 18px;
    border-radius: 999px;
    border: none;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
    letter-spacing: 0.01em;
    transition: background 0.15s, box-shadow 0.15s, transform 0.1s, color 0.15s;
}

.btn.primary {
    background: linear-gradient(135deg, #0ea5e9, #6366f1);
    color: #f9fafb;
    box-shadow: 0 14px 32px rgba(37, 99, 235, 0.6);
}

.btn.primary:hover {
    box-shadow: 0 18px 38px rgba(37, 99, 235, 0.75);
    transform: translateY(-1px);
}

.btn.primary:active {
    transform: translateY(0);
    box-shadow: 0 10px 22px rgba(37, 99, 235, 0.7);
}

.btn.danger {
    background: rgba(248, 113, 113, 0.16);
    color: #fecaca;
    border: 1px solid rgba(248, 113, 113, 0.5);
}

.btn.danger:hover {
    background: rgba(248, 113, 113, 0.24);
}

.btn.small {
    padding: 5px 12px;
    font-size: 0.8rem;
}

.hint {
    margin-top: 10px;
    font-size: 0.85rem;
    color: #9ca3af;
}

.alert {
    padding: 10px 14px;
    margin-bottom: 20px;
    border-radius: 8px;
    font-size: 0.9rem;
}

.alert-error {
    background: rgba(239, 68, 68, 0.12);
    border: 1px solid rgba(248, 113, 113, 0.9);
    color: #fecaca;
}

.file-list {
    list-style: none;
    margin: 8px 0 0;
    padding: 0;
}

.file-list li {
    padding: 10px 0;
    border-bottom: 1px solid rgba(31, 41, 55, 0.9);
}

.file-list li:last-child {
    border-bottom: none;
}

.file-main {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.file-name {
    font-weight: 500;
    color: #e5e7eb;
}

.file-url {
    font-size: 0.85rem;
    color: #93c5fd;
    word-break: break-all;
}

.file-url:hover {
    text-decoration: underline;
}

.file-meta {
    margin-top: 4px;
    font-size: 0.8rem;
    color: #9ca3af;
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.history-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
}

.history-table th,
.history-table td {
    padding: 8px 8px;
    border-bottom: 1px solid rgba(31, 41, 55, 0.9);
    text-align: left;
    vertical-align: middle;
}

.history-table th {
    font-weight: 600;
    color: #d1d5db;
    background: rgba(15, 23, 42, 0.9);
    position: sticky;
    top: 0;
    z-index: 1;
}

.history-table a {
    color: #93c5fd;
    text-decoration: none;
}

.history-table a:hover {
    text-decoration: underline;
}

.inline-form {
    margin: 0;
}

.muted {
    color: #9ca3af;
    font-size: 0.9rem;
}

.batch-id {
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
    font-size: 0.75rem;
    color: #9ca3af;
    max-width: 130px;
    word-break: break-all;
}

.footer {
    margin-top: 20px;
    font-size: 0.8rem;
    color: #6b7280;
    text-align: center;
}

@media (max-width: 640px) {
    .upload-form {
        flex-direction: column;
        align-items: stretch;
    }

    .history-table th:nth-child(5),
    .history-table td:nth-child(5) {
        display: none;
    }
}


