:root {
    --accent: #f6821f;
    --accent-hover: #e8700a;
    --accent-soft: #fff4eb;
    --link: #2563eb;
    --bg: #f4f6f8;
    --sidebar-bg: #eef1f4;
    --surface: #ffffff;
    --border: #e2e8f0;
    --text: #1f2937;
    --text-muted: #64748b;
    --nav-active: #1e293b;
    --success: #059669;
    --success-bg: #ecfdf5;
    --error: #dc2626;
    --error-bg: #fef2f2;
    --info-bg: #eff6ff;
    --radius: 16px;
    --radius-sm: 10px;
    --radius-pill: 999px;
    --shadow:
        0 1px 2px rgba(15, 23, 42, 0.04), 0 8px 24px rgba(15, 23, 42, 0.06);
    --font: "Roboto", -apple-system, BlinkMacSystemFont, sans-serif;
    --mono: "JetBrains Mono", ui-monospace, monospace;
    --sidebar-width: 260px;
}

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

body {
    margin: 0;
    min-height: 100vh;
    font-family: var(--font);
    font-size: 15px;
    line-height: 1.5;
    color: var(--text);
    background: var(--bg);
}

h1 {
    margin: 0;
    font-size: 1.875rem;
    font-weight: 650;
    letter-spacing: -0.02em;
}

.app {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: var(--sidebar-width);
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    background: var(--sidebar-bg);
    border-right: 1px solid var(--border);
    padding: 1.25rem 0.875rem;
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    padding: 0 0.5rem 1rem;
}

.brand-icon {
    width: 28px;
    height: 28px;
    color: var(--accent);
    flex-shrink: 0;
}

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

.brand-name {
    font-size: 0.9375rem;
    font-weight: 650;
    color: var(--text);
    line-height: 1.2;
}

.brand-tag {
    font-size: 0.6875rem;
    color: var(--text-muted);
}

.sidebar-card {
    margin: 0 0.375rem 1.25rem;
    padding: 0.875rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
}

.sidebar-card-title {
    margin: 0 0 0.25rem;
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--text);
}

.sidebar-card-copy {
    margin: 0;
    font-size: 0.75rem;
    color: var(--text-muted);
    line-height: 1.45;
}

.sidebar-nav {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.125rem;
}

.nav-group {
    margin: 0.875rem 0.5rem 0.375rem;
    font-size: 0.6875rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #94a3b8;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    width: 100%;
    padding: 0.5625rem 0.75rem;
    border: none;
    border-radius: var(--radius-sm);
    background: transparent;
    color: var(--text-muted);
    font-size: 0.875rem;
    font-weight: 500;
    font-family: inherit;
    text-align: left;
    cursor: pointer;
    transition:
        background 0.15s,
        color 0.15s;
}

.nav-item svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

.nav-item:hover {
    background: rgba(255, 255, 255, 0.65);
    color: var(--text);
}

.nav-item.active {
    background: var(--nav-active);
    color: #fff;
}

.sidebar-footer {
    padding: 0.75rem 0.5rem 0;
    border-top: 1px solid var(--border);
    margin-top: 0.75rem;
}

.sidebar-host {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.main {
    flex: 1;
    min-width: 0;
    padding: 2rem 2.5rem 3rem;
    overflow-y: auto;
}

.page-header {
    margin-bottom: 1.5rem;
}

.page-subtitle {
    margin: 0.375rem 0 0;
    font-size: 0.9375rem;
    color: var(--text-muted);
    max-width: 42rem;
}

.upload-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.5rem;
    box-shadow: var(--shadow);
}

.dropzone {
    border: 1.5px dashed #cbd5e1;
    border-radius: var(--radius-sm);
    padding: 2.5rem 1.5rem 1.75rem;
    text-align: center;
    background: #fafbfc;
    transition:
        border-color 0.15s,
        background 0.15s;
}

.dropzone.dragging {
    border-color: var(--accent);
    background: var(--accent-soft);
}

.dropzone-icon {
    width: 56px;
    height: 56px;
    color: #94a3b8;
    margin: 0 auto 1rem;
    display: block;
}

.dropzone-title {
    margin: 0 0 0.5rem;
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--text);
}

.dropzone-formats,
.dropzone-limit {
    margin: 0;
    font-size: 0.8125rem;
    color: var(--text-muted);
}

.dropzone-limit {
    margin-top: 0.25rem;
    font-size: 0.75rem;
}

.dropzone-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.625rem;
    margin-top: 1.25rem;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4375rem;
    padding: 0.5625rem 1.125rem;
    font-size: 0.875rem;
    font-weight: 500;
    font-family: inherit;
    border-radius: var(--radius-sm);
    border: 1px solid transparent;
    cursor: pointer;
    transition:
        background 0.15s,
        border-color 0.15s,
        transform 0.1s;
}

.btn svg {
    width: 16px;
    height: 16px;
}

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

.btn-primary {
    background: var(--accent);
    color: #fff;
}

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

.btn-outline {
    background: var(--surface);
    color: var(--text);
    border-color: var(--border);
}

.btn-outline:hover {
    background: var(--bg);
    border-color: #cbd5e1;
}

#fileInput,
#folderInput {
    display: none;
}

.text-upload-container {
    padding: 0.25rem 0;
}

.text-input {
    width: 100%;
    padding: 0.875rem 1rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
    font-family: var(--font);
    line-height: 1.5;
    resize: vertical;
    margin-bottom: 0.875rem;
    background: #fafbfc;
    transition:
        border-color 0.15s,
        box-shadow 0.15s;
}

.text-input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(246, 130, 31, 0.15);
    background: var(--surface);
}

.upload-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 1rem 1.5rem;
    margin-top: 1.25rem;
    padding-top: 1.25rem;
    border-top: 1px solid var(--border);
}

.toolbar-item {
    display: inline-flex;
    align-items: center;
    gap: 0.4375rem;
    cursor: pointer;
    font-size: 0.8125rem;
    color: var(--text-muted);
}

.toolbar-item.disabled {
    cursor: not-allowed;
    opacity: 0.55;
}

.toolbar-select {
    cursor: default;
}

.toolbar-select .field-select {
    cursor: pointer;
}

.checkbox-input {
    width: 15px;
    height: 15px;
    accent-color: var(--accent);
    cursor: pointer;
}

.option-panel {
    margin-top: 0.875rem;
}

.field-input,
.field-select {
    padding: 0.4375rem 0.625rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 0.8125rem;
    font-family: inherit;
    background: #fafbfc;
    transition:
        border-color 0.15s,
        box-shadow 0.15s;
}

.field-input:focus,
.field-select:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(246, 130, 31, 0.12);
    background: var(--surface);
}

.password-input {
    width: 100%;
    max-width: 20rem;
}

.meta-text {
    margin: 0.5rem 0 0;
    font-size: 0.75rem;
    color: var(--text-muted);
}

.upload-status {
    margin-top: 0.875rem;
    padding: 0.625rem 0.875rem;
    border-radius: var(--radius-sm);
    font-size: 0.8125rem;
    display: none;
    border: 1px solid;
}

.upload-status.success {
    display: block;
    background: var(--success-bg);
    color: var(--success);
    border-color: #a7f3d0;
}

.upload-status.error {
    display: block;
    background: var(--error-bg);
    color: var(--error);
    border-color: #fecaca;
}

.upload-status.uploading {
    display: block;
    background: var(--info-bg);
    color: var(--link);
    border-color: #bfdbfe;
}

.progress-bar {
    width: 100%;
    height: 5px;
    background: var(--border);
    border-radius: var(--radius-pill);
    overflow: hidden;
    margin-top: 0.625rem;
    display: none;
}

.progress-fill {
    height: 100%;
    background: var(--accent);
    width: 0%;
    transition: width 0.2s ease;
    border-radius: var(--radius-pill);
}

.file-list {
    margin-top: 0.875rem;
}

.file-item {
    background: #fafbfc;
    border: 1px solid var(--border);
    padding: 0.75rem 0.875rem;
    margin: 0.5rem 0;
    border-radius: var(--radius-sm);
}

.file-item-notice {
    font-size: 0.75rem;
    margin-bottom: 0.375rem;
}

.file-item-notice.warning {
    color: #b45309;
}

.file-item-notice.danger {
    color: var(--error);
}

.file-item-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 0.625rem;
    flex-wrap: wrap;
}

.file-url {
    word-break: break-all;
    font-size: 0.8125rem;
    flex: 1;
    min-width: 0;
}

.file-url a {
    color: var(--link);
    text-decoration: none;
}

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

.copy-button {
    background: var(--text);
    color: #fff;
    border: none;
    padding: 0.3125rem 0.625rem;
    border-radius: var(--radius-pill);
    cursor: pointer;
    font-size: 0.75rem;
    font-family: inherit;
    white-space: nowrap;
    flex-shrink: 0;
}

.copy-button:hover {
    background: #374151;
}

.help-panel {
    margin-top: 1.25rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
}

.help-panel summary {
    padding: 0.875rem 1.125rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-muted);
    cursor: pointer;
    list-style: none;
    user-select: none;
}

.help-panel summary::-webkit-details-marker {
    display: none;
}

.help-panel summary::after {
    content: "+";
    float: right;
    font-weight: 400;
    color: #9ca3af;
}

.help-panel[open] summary::after {
    content: "\2212";
}

.help-panel summary:hover {
    color: var(--text);
    background: #fafbfc;
}

.help-body {
    padding: 0 1.125rem 1.125rem;
    border-top: 1px solid var(--border);
}

.help-note {
    margin: 0;
    font-size: 0.8125rem;
    color: var(--text-muted);
    line-height: 1.55;
}

.copy-hint {
    margin: 0.875rem 0 0.5rem;
    font-size: 0.75rem;
    color: var(--text-muted);
}

.command-list {
    list-style: none;
    margin: 0 0 0.75rem;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.command-copy {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    width: 100%;
    min-width: 0;
    text-align: left;
    margin: 0;
    padding: 0.6rem 0.75rem;
    background: #f8fafc;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-family: inherit;
    transition:
        border-color 0.15s ease,
        background 0.15s ease;
}

.command-copy:hover {
    background: var(--accent-soft);
    border-color: var(--accent);
}

.command-copy code {
    flex: 1;
    min-width: 0;
    font-family: var(--mono);
    font-size: 0.75rem;
    line-height: 1.5;
    color: #334155;
    white-space: nowrap;
    overflow-x: auto;
    scrollbar-width: thin;
}

.copy-feedback {
    flex-shrink: 0;
    font-size: 0.6875rem;
    font-weight: 600;
    color: var(--accent);
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

@media (max-width: 900px) {
    .app {
        flex-direction: column;
    }

    .sidebar {
        width: 100%;
        border-right: none;
        border-bottom: 1px solid var(--border);
        padding: 1rem;
    }

    .sidebar-card {
        display: none;
    }

    .sidebar-nav {
        flex-direction: row;
        flex-wrap: wrap;
        gap: 0.375rem;
    }

    .nav-group {
        display: none;
    }

    .nav-item {
        width: auto;
        flex: 1;
        min-width: fit-content;
        justify-content: center;
    }

    .sidebar-footer {
        display: none;
    }

    .main {
        padding: 1.25rem 1rem 2rem;
    }

    .page-header h1 {
        font-size: 1.5rem;
    }
}
