* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary: #6366f1;
    --primary-dark: #4f46e5;
    --secondary: #8b5cf6;
    --accent: #06b6d4;
    --success: #10b981;
    --danger: #ef4444;
    --warning: #f59e0b;
    --bg-gradient-start: #667eea;
    --bg-gradient-end: #764ba2;
    --card-bg: #ffffff;
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --text-muted: #94a3b8;
    --border-color: #e2e8f0;
    --surface: #f8fafc;
    --surface-hover: #f1f5f9;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, 'Noto Sans SC', sans-serif;
    background: linear-gradient(135deg, var(--bg-gradient-start) 0%, var(--bg-gradient-end) 100%);
    min-height: 100vh;
    padding: 24px 20px 60px;
    color: var(--text-primary);
    line-height: 1.6;
}

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

/* ========== Header ========== */
.header {
    text-align: center;
    color: white;
    margin-bottom: 28px;
    padding-top: 10px;
}

.header h1 {
    font-size: 2.2rem;
    font-weight: 700;
    margin-bottom: 8px;
    letter-spacing: -0.02em;
    text-shadow: 0 2px 12px rgba(0,0,0,0.15);
}

.header p {
    font-size: 1rem;
    opacity: 0.88;
    font-weight: 400;
    letter-spacing: 0.3px;
}

/* ========== Stats Bar ========== */
.stats-bar {
    display: flex;
    justify-content: center;
    gap: 16px;
    margin-bottom: 22px;
    flex-wrap: wrap;
}

.stat-item {
    background: rgba(255,255,255,0.18);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    padding: 10px 22px;
    border-radius: 50px;
    color: white;
    font-size: 0.88rem;
    font-weight: 500;
    border: 1px solid rgba(255,255,255,0.15);
    transition: all 0.25s ease;
}

.stat-item:hover {
    background: rgba(255,255,255,0.26);
    transform: translateY(-1px);
}

/* ========== Tool Navigation ========== */
.tool-nav {
    display: flex;
    gap: 12px;
    margin-bottom: 0;
    padding: 6px;
    background: rgba(255,255,255,0.14);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-radius: 18px 18px 0 0;
    overflow: hidden;
    border-bottom: none;
}

.tool-nav-btn {
    flex: 1;
    padding: 14px 20px;
    border: none;
    border-radius: 13px;
    background: transparent;
    color: rgba(255,255,255,0.72);
    font-size: 0.98rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    position: relative;
}

.tool-nav-btn span {
    font-size: 1.15rem;
}

.tool-nav-btn:hover {
    background: rgba(255,255,255,0.12);
    color: white;
}

.tool-nav-btn.active {
    background: white;
    color: var(--primary-dark);
    box-shadow: 0 4px 15px rgba(0,0,0,0.12), 0 2px 4px rgba(0,0,0,0.04);
    transform: translateY(-1px);
}

/* ========== Tool Section Toggle ========== */
.tool-section {
    display: none;
    animation: fadeIn 0.35s ease;
}

.tool-section.active {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ========== Main Card ========== */
.main-card {
    background: var(--card-bg);
    border-radius: 20px;
    box-shadow: 0 25px 60px -12px rgba(0,0,0,0.25), 0 0 0 1px rgba(255,255,255,0.05) inset;
    overflow: hidden;
}

/* ========== Tabs (HTML Cleaner inner tabs) ========== */
.tabs {
    display: flex;
    border-bottom: 1px solid var(--border-color);
    background: var(--surface);
}

.tab {
    flex: 1;
    padding: 15px;
    text-align: center;
    cursor: pointer;
    background: transparent;
    border: none;
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--text-secondary);
    transition: all 0.25s ease;
    position: relative;
}

.tab::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--primary), var(--secondary));
    border-radius: 3px 3px 0 0;
    transition: width 0.25s ease;
}

.tab.active {
    background: white;
    color: var(--primary);
}

.tab.active::after {
    width: 60%;
}

.tab:hover:not(.active) {
    background: var(--surface-hover);
    color: var(--text-primary);
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

/* ========== Upload Section ========== */
.upload-section {
    padding: 36px 40px;
}

.upload-wrapper {
    position: relative;
    display: block;
    cursor: pointer;
}

.upload-input {
    position: absolute;
    top: 0;
    left: 0;
    width: 0;
    height: 0;
    opacity: 0;
    pointer-events: none;
}

.upload-area {
    border: 2.5px dashed var(--primary);
    border-radius: 16px;
    padding: 52px 40px;
    text-align: center;
    transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    background: linear-gradient(135deg, #eef2ff 0%, #f0ebff 100%);
    position: relative;
    pointer-events: none;
    position: relative;
    overflow: hidden;
}

.upload-area::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: radial-gradient(circle at center, rgba(99,102,241,0.08) 0%, transparent 70%);
    opacity: 0;
    transition: opacity 0.35s ease;
}

.upload-wrapper:hover .upload-area,
.upload-wrapper.drag-active .upload-area {
    border-color: var(--secondary);
    background: linear-gradient(135deg, #e0e7ff 0%, #ede9fe 100%);
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(99,102,241,0.15);
}

.upload-wrapper:hover .upload-area::before,
.upload-wrapper.drag-active .upload-area::before {
    opacity: 1;
}

.upload-wrapper.drag-active .upload-area {
    transform: scale(1.01);
    border-color: var(--primary);
}

.upload-icon {
    font-size: 3.5rem;
    margin-bottom: 16px;
    pointer-events: none;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.08));
    animation: floatIcon 3s ease-in-out infinite;
}

@keyframes floatIcon {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-6px); }
}

.upload-text {
    font-size: 1.12rem;
    color: var(--text-primary);
    margin-bottom: 8px;
    font-weight: 500;
    pointer-events: none;
}

.upload-hint {
    color: var(--text-muted);
    font-size: 0.85rem;
    pointer-events: none;
}

/* ========== Options Section ========== */
.options-section {
    padding: 22px 40px;
    background: var(--surface);
    border-bottom: 1px solid var(--border-color);
}

.options-title {
    font-size: 0.95rem;
    color: var(--text-primary);
    margin-bottom: 14px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 6px;
}

.options-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
    gap: 12px;
}

.option-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    border-radius: 10px;
    transition: background 0.2s ease;
}

.option-item:hover {
    background: white;
}

.option-item input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: var(--primary);
    border-radius: 4px;
}

.option-item label {
    cursor: pointer;
    color: var(--text-secondary);
    font-size: 0.88rem;
    font-weight: 500;
}

/* ========== Prepend Input Section ========== */
.prepend-input-section {
    padding: 28px 40px 18px;
    background: var(--surface);
    border-bottom: 1px solid var(--border-color);
}

.prepend-label {
    font-size: 0.95rem;
    color: var(--text-primary);
    margin-bottom: 12px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 6px;
}

.prepend-input {
    width: 100%;
    padding: 14px 16px;
    border: 2px solid var(--border-color);
    border-radius: 12px;
    font-family: 'Consolas', 'Monaco', 'Noto Sans SC', monospace;
    font-size: 0.92rem;
    resize: vertical;
    transition: all 0.3s ease;
    min-height: 80px;
    line-height: 1.6;
    color: var(--text-primary);
    background: white;
}

.prepend-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(99,102,241,0.1);
}

.prepend-input::placeholder {
    color: var(--text-muted);
}

.prepend-hint {
    color: var(--text-muted);
    font-size: 0.82rem;
    margin-top: 10px;
    margin-bottom: 4px;
    display: flex;
    align-items: center;
    gap: 4px;
}

/* ========== Text Input Section ========== */
.text-input-section {
    padding: 36px 40px;
}

.text-input {
    width: 100%;
    min-height: 200px;
    padding: 16px;
    border: 2px solid var(--border-color);
    border-radius: 12px;
    font-family: 'Consolas', 'Monaco', monospace;
    font-size: 0.9rem;
    resize: vertical;
    transition: all 0.3s ease;
    line-height: 1.65;
    color: var(--text-primary);
    background: white;
}

.text-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(99,102,241,0.1);
}

.text-input::placeholder {
    color: var(--text-muted);
}

.text-output {
    width: 100%;
    min-height: 200px;
    padding: 16px;
    border: 2px solid var(--border-color);
    border-radius: 12px;
    font-family: 'Consolas', 'Monaco', monospace;
    font-size: 0.9rem;
    background: var(--surface);
    margin-top: 20px;
    white-space: pre-wrap;
    word-break: break-all;
    line-height: 1.65;
    color: var(--text-primary);
}

/* ========== File List Section ========== */
.file-list-section {
    padding: 28px 40px;
    max-height: 380px;
    overflow-y: auto;
}

.file-list-section::-webkit-scrollbar {
    width: 6px;
}

.file-list-section::-webkit-scrollbar-track {
    background: transparent;
}

.file-list-section::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 3px;
}

.section-title {
    font-size: 1rem;
    color: var(--text-primary);
    margin-bottom: 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 600;
}

.file-count {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
    padding: 4px 14px;
    border-radius: 50px;
    font-size: 0.82rem;
    font-weight: 600;
}

.file-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.file-item {
    display: flex;
    align-items: center;
    padding: 14px 18px;
    background: var(--surface);
    border-radius: 12px;
    border-left: 4px solid var(--primary);
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.file-item::after {
    content: '';
    position: absolute;
    left: 0; top: 0; bottom: 0;
    width: 4px;
    background: var(--primary);
    transition: all 0.25s ease;
}

.file-item:hover {
    background: #f1f5f9;
    transform: translateX(4px);
    box-shadow: 0 2px 12px rgba(0,0,0,0.06);
}

.file-item.completed {
    border-left-color: var(--success);
}

.file-item.completed::after {
    background: var(--success);
}

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

.file-item.error::after {
    background: var(--danger);
}

.file-icon {
    font-size: 1.4rem;
    margin-right: 14px;
    flex-shrink: 0;
}

.file-info {
    flex: 1;
    min-width: 0;
}

.file-name {
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 3px;
    font-size: 0.92rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.file-meta {
    font-size: 0.82rem;
    color: var(--text-muted);
}

.file-status {
    padding: 4px 12px;
    border-radius: 50px;
    font-size: 0.78rem;
    font-weight: 600;
    margin-right: 12px;
    flex-shrink: 0;
}

.status-pending {
    background: #f1f5f9;
    color: #64748b;
}

.status-completed {
    background: #d1fae5;
    color: #065f46;
}

.status-error {
    background: #fee2e2;
    color: #991b1b;
}

.file-actions {
    display: flex;
    gap: 6px;
    flex-shrink: 0;
}

.btn-icon {
    width: 34px;
    height: 34px;
    border: none;
    border-radius: 9px;
    cursor: pointer;
    font-size: 0.95rem;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-icon:hover {
    transform: scale(1.1);
}

.btn-preview {
    background: #dbeafe;
    color: #2563eb;
}

.btn-preview:hover {
    background: #bfdbfe;
    box-shadow: 0 2px 8px rgba(37,99,235,0.2);
}

.btn-download {
    background: #d1fae5;
    color: #059669;
}

.btn-download:hover {
    background: #a7f3d0;
    box-shadow: 0 2px 8px rgba(5,150,105,0.2);
}

.btn-delete {
    background: #fee2e2;
    color: #dc2626;
}

.btn-delete:hover {
    background: #fecaca;
    box-shadow: 0 2px 8px rgba(220,38,38,0.2);
}

/* ========== Action Buttons ========== */
.action-section {
    padding: 24px 40px 38px;
    display: flex;
    gap: 14px;
    justify-content: center;
    flex-wrap: wrap;
}

.btn {
    padding: 13px 32px;
    border: none;
    border-radius: 12px;
    font-size: 0.94rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: inline-flex;
    align-items: center;
    gap: 8px;
    letter-spacing: 0.01em;
}

.btn span {
    font-size: 1rem;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(99,102,241,0.3);
}

.btn-primary:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(99,102,241,0.4);
}

.btn-primary:active:not(:disabled) {
    transform: translateY(0);
}

.btn-primary:disabled {
    opacity: 0.55;
    cursor: not-allowed;
    box-shadow: none;
}

.btn-secondary {
    background: var(--surface);
    color: var(--text-secondary);
    border: 1.5px solid var(--border-color);
}

.btn-secondary:hover:not(:disabled) {
    background: var(--surface-hover);
    color: var(--text-primary);
    border-color: #cbd5e1;
    transform: translateY(-1px);
}

.btn-secondary:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

.btn-success {
    background: linear-gradient(135deg, #059669 0%, #10b981 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(16,185,129,0.3);
}

.btn-success:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(16,185,129,0.4);
}

.btn-success:disabled {
    opacity: 0.55;
    cursor: not-allowed;
    box-shadow: none;
}

/* ========== Progress Bar ========== */
.progress-section {
    padding: 0 40px 18px;
}

.progress-bar {
    width: 100%;
    height: 10px;
    background: #e2e8f0;
    border-radius: 10px;
    overflow: hidden;
    display: none;
    box-shadow: inset 0 1px 3px rgba(0,0,0,0.06);
}

.progress-bar.active {
    display: block;
    animation: progressShow 0.3s ease;
}

@keyframes progressShow {
    from { opacity: 0; transform: scaleY(0.5); }
    to { opacity: 1; transform: scaleY(1); }
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary) 0%, var(--secondary) 50%, var(--accent) 100%);
    background-size: 200% 100%;
    width: 0%;
    border-radius: 10px;
    transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    animation: shimmer 2s infinite linear;
}

@keyframes shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

.progress-text {
    text-align: center;
    margin-top: 10px;
    color: var(--text-secondary);
    font-size: 0.88rem;
    font-weight: 500;
    display: none;
}

.progress-text.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

/* ========== Modal ========== */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15,23,42,0.6);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal.active {
    display: flex;
    animation: modalIn 0.25s ease;
}

@keyframes modalIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal.active .modal-content {
    animation: modalSlide 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes modalSlide {
    from { opacity: 0; transform: translateY(30px) scale(0.96); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.modal-content {
    background: white;
    border-radius: 20px;
    width: 90%;
    max-width: 820px;
    max-height: 82vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 25px 70px -12px rgba(0,0,0,0.35);
}

.modal-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--surface);
}

.modal-title {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text-primary);
}

.modal-close {
    width: 36px;
    height: 36px;
    border: none;
    border-radius: 10px;
    background: white;
    font-size: 1.4rem;
    cursor: pointer;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    line-height: 1;
}

.modal-close:hover {
    background: #fee2e2;
    color: var(--danger);
    transform: rotate(90deg);
}

.modal-body {
    padding: 24px;
    overflow-y: auto;
    flex: 1;
}

.modal-body::-webkit-scrollbar {
    width: 6px;
}

.modal-body::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 3px;
}

.preview-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.preview-box {
    background: var(--surface);
    border-radius: 14px;
    padding: 18px;
    border: 1px solid var(--border-color);
}

.preview-label {
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 12px;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 6px;
}

.preview-content {
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 14px;
    font-size: 0.84rem;
    max-height: 320px;
    overflow-y: auto;
    white-space: pre-wrap;
    word-break: break-all;
    font-family: 'Consolas', 'Monaco', monospace;
    line-height: 1.6;
    color: var(--text-secondary);
}

/* ========== SEO Section ========== */
.seo-section {
    background: var(--surface);
    padding: 56px 40px;
    margin-top: 32px;
    border-radius: 20px 20px 0 0;
}

.seo-content {
    max-width: 900px;
    margin: 0 auto;
}

.seo-content h2 {
    color: var(--text-primary);
    font-size: 1.7rem;
    font-weight: 700;
    margin-bottom: 18px;
    text-align: center;
    letter-spacing: -0.02em;
}

.seo-content > p {
    color: var(--text-secondary);
    font-size: 1rem;
    line-height: 1.8;
    margin-bottom: 42px;
    text-align: center;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
    gap: 24px;
    margin-bottom: 48px;
}

.feature-item {
    background: white;
    padding: 26px;
    border-radius: 16px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.05);
    border: 1px solid var(--border-color);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.feature-item:hover {
    transform: translateY(-6px);
    box-shadow: 0 12px 32px rgba(0,0,0,0.1);
    border-color: rgba(99,102,241,0.2);
}

.feature-item h3 {
    color: var(--primary);
    font-size: 1.05rem;
    font-weight: 700;
    margin-bottom: 12px;
}

.feature-item p {
    color: var(--text-secondary);
    font-size: 0.9rem;
    line-height: 1.65;
}

.use-cases, .tech-info, .faq-section {
    background: white;
    padding: 30px;
    border-radius: 16px;
    margin-bottom: 24px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.05);
    border: 1px solid var(--border-color);
}

.use-cases h3, .tech-info h3, .faq-section h3 {
    color: var(--text-primary);
    font-size: 1.15rem;
    font-weight: 700;
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 2px solid var(--primary);
    display: inline-block;
}

.use-cases ul {
    list-style: none;
    padding: 0;
}

.use-cases li {
    padding: 11px 0;
    border-bottom: 1px solid #f1f5f9;
    color: var(--text-secondary);
    line-height: 1.65;
    font-size: 0.93rem;
    position: relative;
    padding-left: 18px;
}

.use-cases li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 19px;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--primary);
}

.use-cases li:last-child {
    border-bottom: none;
}

.use-cases strong {
    color: var(--primary);
    font-weight: 600;
}

.tech-info p {
    color: var(--text-secondary);
    line-height: 1.75;
    font-size: 0.93rem;
}

.faq-item {
    margin-bottom: 18px;
    padding-bottom: 18px;
    border-bottom: 1px solid #f1f5f9;
}

.faq-item:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.faq-item h4 {
    color: var(--text-primary);
    font-size: 0.98rem;
    font-weight: 600;
    margin-bottom: 8px;
}

.faq-item p {
    color: var(--text-secondary);
    line-height: 1.65;
    font-size: 0.9rem;
}

/* ========== Footer ========== */
.footer {
    background: linear-gradient(135deg, var(--bg-gradient-start) 0%, var(--bg-gradient-end) 100%);
    color: white;
    padding: 32px 40px;
    text-align: center;
    border-radius: 0 0 20px 20px;
}

.footer-content p {
    margin: 6px 0;
    opacity: 0.9;
    font-size: 0.92rem;
}

.footer-content p:first-child {
    font-size: 1rem;
    font-weight: 600;
    letter-spacing: 0.02em;
}

/* ========== Back To Top ========== */
.back-to-top {
    position: fixed;
    bottom: 28px;
    right: 28px;
    width: 48px;
    height: 48px;
    border-radius: 14px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    color: white;
    border: none;
    font-size: 1.3rem;
    cursor: pointer;
    box-shadow: 0 6px 20px rgba(99,102,241,0.35);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    opacity: 0;
    visibility: hidden;
    z-index: 999;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.back-to-top:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 30px rgba(99,102,241,0.45);
}

.back-to-top.visible {
    opacity: 1;
    visibility: visible;
    animation: bounceUp 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes bounceUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ========== Scrollbar Global ========== */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* ========== Selection ========== */
::selection {
    background: rgba(99,102,241,0.2);
    color: var(--text-primary);
}

/* ========== Responsive ========== */
@media (max-width: 768px) {
    body {
        padding: 16px 12px 50px;
    }

    .header h1 {
        font-size: 1.6rem;
    }

    .header p {
        font-size: 0.88rem;
    }

    .stats-bar {
        gap: 10px;
    }

    .stat-item {
        padding: 8px 16px;
        font-size: 0.8rem;
    }

    .tool-nav {
        gap: 8px;
        padding: 5px;
        border-radius: 14px 14px 0 0;
    }

    .tool-nav-btn {
        padding: 12px 12px;
        font-size: 0.86rem;
        border-radius: 10px;
    }

    .tool-nav-btn span {
        font-size: 1rem;
    }

    .main-card {
        border-radius: 16px;
    }

    .tabs .tab {
        padding: 12px 10px;
        font-size: 0.87rem;
    }

    .upload-section,
    .text-input-section {
        padding: 24px 20px;
    }

    .upload-area {
        padding: 36px 24px;
    }

    .upload-icon {
        font-size: 2.8rem;
    }

    .options-section,
    .prepend-input-section {
        padding: 18px 20px;
    }

    .file-list-section {
        padding: 20px;
        max-height: 300px;
    }

    .action-section {
        padding: 18px 20px 28px;
        gap: 10px;
    }

    .btn {
        padding: 11px 22px;
        font-size: 0.87rem;
        border-radius: 10px;
    }

    .progress-section {
        padding: 0 20px 14px;
    }

    .preview-container {
        grid-template-columns: 1fr;
    }

    .modal-content {
        border-radius: 16px;
        max-height: 85vh;
    }

    .seo-section {
        padding: 36px 20px;
        margin-top: 24px;
        border-radius: 16px 16px 0 0;
    }

    .seo-content h2 {
        font-size: 1.3rem;
    }

    .features-grid {
        grid-template-columns: 1fr;
        gap: 16px;
        margin-bottom: 32px;
    }

    .use-cases, .tech-info, .faq-section {
        padding: 20px;
        border-radius: 12px;
    }

    .footer {
        padding: 24px 20px;
        border-radius: 0 0 16px 16px;
    }

    .back-to-top {
        bottom: 20px;
        right: 20px;
        width: 44px;
        height: 44px;
        border-radius: 12px;
    }
}

/* ========== Option Group (Radio) ========== */
.option-group {
    padding: 10px 14px;
    background: white;
    border-radius: 12px;
    border: 1px solid var(--border-color);
}

.option-group-label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 10px;
}

.option-radio-group {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.option-radio {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 6px 12px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    background: var(--surface);
    border: 1.5px solid transparent;
    font-size: 0.84rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.option-radio:hover {
    background: #eef2ff;
    border-color: var(--primary);
}

.option-radio input[type="radio"] {
    accent-color: var(--primary);
    cursor: pointer;
    width: 15px;
    height: 15px;
}

.option-radio input[type="radio"]:checked + span {
    color: var(--primary-dark);
    font-weight: 600;
}

.option-radio:has(input:checked) {
    background: #eef2ff;
    border-color: var(--primary);
}

/* ========== Variables Hint ========== */
.variables-hint {
    margin-top: 14px;
    padding: 12px 16px;
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    border-radius: 10px;
    font-size: 0.82rem;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}

.variables-title {
    font-weight: 600;
    color: #92400e;
}

.variables-hint code {
    background: rgba(255,255,255,0.7);
    padding: 2px 8px;
    border-radius: 5px;
    font-family: 'Consolas', 'Monaco', monospace;
    font-size: 0.78rem;
    color: #78350f;
    font-weight: 600;
}

/* ========== Prepend Header & Char Stat ========== */
.prepend-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.char-stat {
    font-size: 0.8rem;
    color: var(--text-muted);
    background: var(--surface);
    padding: 4px 12px;
    border-radius: 20px;
    font-weight: 500;
    white-space: nowrap;
}

.char-stat span {
    color: var(--primary);
    font-weight: 700;
}

/* ========== Template Bar ========== */
.template-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
    flex-wrap: wrap;
}

.template-label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary);
    white-space: nowrap;
}

.template-btn {
    padding: 5px 14px;
    border: 1.5px solid var(--border-color);
    border-radius: 20px;
    background: white;
    color: var(--text-secondary);
    font-size: 0.8rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.template-btn:hover {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
    border-color: transparent;
    transform: translateY(-1px);
    box-shadow: 0 3px 10px rgba(99,102,241,0.25);
}

.template-btn[data-template="clear"]:hover {
    background: linear-gradient(135deg, var(--danger), #f87171);
    border-color: transparent;
    box-shadow: 0 3px 10px rgba(239,68,68,0.25);
}

/* ========== Custom Separator Input ========== */
.custom-separator-input {
    width: 100%;
    max-width: 280px;
    margin-top: 10px;
    padding: 8px 14px;
    border: 2px solid var(--border-color);
    border-radius: 10px;
    font-family: 'Consolas', 'Monaco', monospace;
    font-size: 0.85rem;
    color: var(--text-primary);
    background: white;
    transition: all 0.25s ease;
}

.custom-separator-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(99,102,241,0.1);
}

.custom-separator-input::placeholder {
    color: var(--text-muted);
}

/* ========== Option Checkbox Group ========== */
.option-checkbox-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.option-checkbox {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    background: var(--surface);
    border: 1.5px solid transparent;
    font-size: 0.84rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.option-checkbox:hover {
    background: #eef2ff;
    border-color: var(--primary);
}

.option-checkbox input[type="checkbox"] {
    accent-color: var(--primary);
    cursor: pointer;
    width: 16px;
    height: 16px;
}

.option-checkbox input[type="checkbox"]:checked + span {
    color: var(--primary-dark);
    font-weight: 600;
}

.option-checkbox:has(input:checked) {
    background: #eef2ff;
    border-color: var(--primary);
}

/* ========== Remove Hint ========== */
.remove-hint {
    margin-top: 14px;
    padding: 12px 16px;
    background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%);
    border-radius: 10px;
    font-size: 0.82rem;
    color: #1e40af;
    line-height: 1.5;
}