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

body {
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    background: #0f0f1a;
    color: #e0e0e0;
    min-height: 100vh;
}

.navbar {
    background: rgba(15, 15, 26, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 100;
}

.logo {
    font-size: 1.5rem;
    font-weight: 700;
    background: linear-gradient(135deg, #6366f1, #a855f7);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.nav-links {
    display: flex;
    gap: 1.5rem;
}

.nav-links a {
    color: #999;
    text-decoration: none;
    font-size: 0.9rem;
    transition: color 0.2s;
}

.nav-links a:hover,
.nav-links a.active {
    color: #a855f7;
}

.hero-compact {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 2rem;
    gap: 1rem;
    flex-wrap: wrap;
}

.hero-left h1 {
    font-size: 1.5rem;
    margin-bottom: 0.25rem;
    background: linear-gradient(135deg, #fff, #a855f7);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero-left p {
    color: #888;
    font-size: 0.9rem;
}

.hero-right {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.top-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 2rem 0.75rem;
    gap: 1rem;
    flex-wrap: wrap;
}

.ad-space-inline {
    background: rgba(255, 255, 255, 0.02);
    border: 1px dashed rgba(255, 255, 255, 0.06);
    border-radius: 6px;
    padding: 0.5rem 1.5rem;
    color: #444;
    font-size: 0.7rem;
    white-space: nowrap;
}

.mode-toggle {
    display: flex;
    gap: 0.5rem;
}

.mode-btn {
    padding: 0.75rem 2rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.03);
    color: #999;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1rem;
    transition: all 0.3s;
}

.mode-btn:hover {
    border-color: rgba(168, 85, 247, 0.3);
    color: #ccc;
}

.mode-btn.active {
    background: linear-gradient(135deg, #6366f1, #a855f7);
    color: #fff;
    border-color: transparent;
}

.workspace {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 2rem 3rem;
}

/* Upload Zone */
.upload-zone {
    border: 2px dashed rgba(168, 85, 247, 0.3);
    border-radius: 16px;
    padding: 3rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
    background: rgba(168, 85, 247, 0.02);
    margin-bottom: 1.5rem;
}

.upload-zone:hover,
.upload-zone.dragover {
    border-color: #a855f7;
    background: rgba(168, 85, 247, 0.06);
}

.upload-zone svg {
    width: 48px;
    height: 48px;
    color: #666;
    margin-bottom: 1rem;
}

.upload-zone h3 {
    color: #ccc;
    margin-bottom: 0.5rem;
}

.upload-zone p {
    color: #666;
    font-size: 0.85rem;
}

/* Canvas Area */
.editor-area {
    display: none;
    gap: 1.5rem;
    margin-top: 1.5rem;
}

.editor-area.visible {
    display: grid;
    grid-template-columns: 1fr 280px;
}

.canvas-container {
    position: relative;
    background: #1a1a2e;
    border-radius: 12px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 400px;
}

.canvas-container canvas {
    max-width: 100%;
    max-height: 70vh;
    cursor: crosshair;
}

.canvas-hint {
    position: absolute;
    top: 12px;
    left: 12px;
    background: rgba(0, 0, 0, 0.7);
    color: #ccc;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 0.75rem;
    pointer-events: none;
}

.zoom-controls {
    position: absolute;
    bottom: 12px;
    right: 12px;
    display: flex;
    align-items: center;
    gap: 4px;
    background: rgba(0, 0, 0, 0.7);
    padding: 4px 8px;
    border-radius: 6px;
}

.zoom-controls button {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #ccc;
    width: 28px;
    height: 28px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.zoom-controls button:hover {
    background: rgba(255, 255, 255, 0.2);
}

.zoom-controls span {
    color: #aaa;
    font-size: 0.75rem;
    min-width: 40px;
    text-align: center;
}

/* Controls Panel */
.controls {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 12px;
    padding: 1.25rem;
}

.controls h3 {
    font-size: 0.95rem;
    margin-bottom: 1rem;
    color: #ccc;
}

.control-group {
    margin-bottom: 1.25rem;
}

.control-group label {
    display: block;
    font-size: 0.8rem;
    color: #888;
    margin-bottom: 0.4rem;
}

.control-group input[type="range"] {
    width: 100%;
    accent-color: #a855f7;
}

.control-group input[type="text"],
.control-group input[type="color"],
.control-group select {
    width: 100%;
    padding: 0.5rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    color: #e0e0e0;
    font-size: 0.9rem;
}

.control-group input[type="color"] {
    height: 36px;
    padding: 2px;
    cursor: pointer;
}

.control-group select {
    cursor: pointer;
}

.range-value {
    float: right;
    font-size: 0.8rem;
    color: #a855f7;
}

/* Buttons */
.btn {
    width: 100%;
    padding: 0.75rem;
    border: none;
    border-radius: 8px;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.2s;
    margin-bottom: 0.5rem;
}

.btn-primary {
    background: linear-gradient(135deg, #6366f1, #a855f7);
    color: #fff;
}

.btn-primary:hover {
    opacity: 0.9;
    transform: translateY(-1px);
}

.btn-primary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.06);
    color: #ccc;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.1);
}

.btn-danger {
    background: rgba(239, 68, 68, 0.15);
    color: #ef4444;
    border: 1px solid rgba(239, 68, 68, 0.2);
}

/* Progress Bar */
.progress-container {
    display: none;
    margin: 1rem 0;
}

.progress-container.visible {
    display: block;
}

.progress-bar {
    height: 4px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 2px;
    overflow: hidden;
}

.progress-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #6366f1, #a855f7);
    border-radius: 2px;
    transition: width 0.3s;
    width: 0%;
}

.progress-text {
    font-size: 0.8rem;
    color: #888;
    margin-top: 0.4rem;
    text-align: center;
}

/* Batch file list */
.file-list {
    margin: 1rem 0;
}

.file-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0.75rem;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 6px;
    margin-bottom: 0.4rem;
    font-size: 0.85rem;
}

.file-item .name {
    color: #ccc;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 200px;
}

.file-item .size {
    color: #666;
    font-size: 0.75rem;
}

.file-item .remove-file {
    color: #ef4444;
    cursor: pointer;
    background: none;
    border: none;
    font-size: 1.1rem;
    padding: 0 4px;
}

/* Result area */
.result-area {
    display: none;
    text-align: center;
    margin-top: 1.5rem;
}

.result-area.visible {
    display: block;
}

.result-viewer {
    position: relative;
    overflow: hidden;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: #1a1a2e;
    max-height: 70vh;
    cursor: grab;
    display: inline-block;
}

.result-viewer:active {
    cursor: grabbing;
}

.result-viewer img {
    max-width: 100%;
    max-height: 70vh;
    display: block;
    transform-origin: 0 0;
    transition: none;
    user-select: none;
    -webkit-user-drag: none;
}

.result-zoom {
    position: absolute;
    bottom: 12px;
    right: 12px;
}

.result-actions {
    margin-top: 1rem;
    display: flex;
    gap: 0.75rem;
    justify-content: center;
}

.result-actions .btn {
    width: auto;
    padding: 0.6rem 1.5rem;
}

/* Footer */
.footer {
    padding: 2rem;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    margin-top: 3rem;
}

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

.footer-main {
    text-align: center;
    margin-bottom: 1.5rem;
}

.footer-main p {
    color: #555;
    font-size: 0.8rem;
    line-height: 1.6;
}

.footer-main a {
    color: #666;
    text-decoration: none;
}

.footer-main a:hover {
    color: #a855f7;
}

.footer-seo {
    border-top: 1px solid rgba(255, 255, 255, 0.03);
    padding-top: 1.25rem;
}

.footer-seo h4 {
    color: #444;
    font-size: 0.8rem;
    margin-bottom: 0.5rem;
}

.footer-seo p {
    color: #3a3a3a;
    font-size: 0.75rem;
    line-height: 1.7;
}

.disclaimer {
    max-width: 700px;
    margin: 1.5rem auto;
    padding: 1rem;
    background: rgba(234, 179, 8, 0.05);
    border: 1px solid rgba(234, 179, 8, 0.15);
    border-radius: 8px;
    color: #a88a2a;
    font-size: 0.8rem;
    text-align: center;
}

/* Ad placeholder */
.ad-space {
    background: rgba(255, 255, 255, 0.02);
    border: 1px dashed rgba(255, 255, 255, 0.06);
    border-radius: 8px;
    padding: 2rem;
    text-align: center;
    color: #444;
    font-size: 0.75rem;
    margin: 1.5rem 0;
}

/* Page layout with side ads */
.page-layout {
    display: flex;
    justify-content: center;
    gap: 1rem;
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 1rem;
}

.side-ad {
    flex-shrink: 0;
    width: 160px;
    position: sticky;
    top: 80px;
    align-self: flex-start;
    height: fit-content;
}

.ad-space-side {
    background: rgba(255, 255, 255, 0.02);
    border: 1px dashed rgba(255, 255, 255, 0.06);
    border-radius: 8px;
    padding: 1rem 0.5rem;
    text-align: center;
    color: #444;
    font-size: 0.7rem;
    min-height: 600px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Responsive */
@media (max-width: 1200px) {
    .side-ad {
        display: none;
    }
}

@media (max-width: 768px) {
    .hero-compact {
        flex-direction: column;
        text-align: center;
        padding: 0.75rem 1rem;
    }

    .hero-left h1 {
        font-size: 1.3rem;
    }

    .top-bar {
        flex-direction: column;
        align-items: stretch;
        padding: 0 1rem 0.5rem;
    }

    .ad-space-inline {
        text-align: center;
    }

    .editor-area.visible {
        grid-template-columns: 1fr;
    }

    .mode-toggle {
        justify-content: center;
    }

    .navbar {
        padding: 0.75rem 1rem;
    }

    .workspace {
        padding: 0 1rem 2rem;
    }
}

/* Brush size preview */
.brush-preview {
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0.5rem 0;
}

.brush-circle {
    border: 2px solid rgba(168, 85, 247, 0.5);
    border-radius: 50%;
    background: rgba(168, 85, 247, 0.15);
}

/* Checkbox toggle */
.toggle-group {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.toggle-group input[type="checkbox"] {
    accent-color: #a855f7;
    width: 16px;
    height: 16px;
}

.toggle-group label {
    font-size: 0.85rem;
    color: #ccc;
    cursor: pointer;
}

/* Batch navigation */
.batch-nav {
    display: none;
    margin-bottom: 0.75rem;
    padding: 0.75rem;
    background: rgba(168, 85, 247, 0.05);
    border: 1px solid rgba(168, 85, 247, 0.15);
    border-radius: 8px;
}

.batch-nav.visible {
    display: block;
}

.tips-box {
    background: rgba(99, 102, 241, 0.08);
    border: 1px solid rgba(99, 102, 241, 0.2);
    border-radius: 8px;
    padding: 0.75rem;
    margin-bottom: 1rem;
    font-size: 0.78rem;
}

.tips-box h4 {
    color: #a5b4fc;
    margin-bottom: 0.4rem;
    font-size: 0.82rem;
}

.tips-box ul {
    padding-left: 1.1rem;
    margin: 0;
}

.tips-box li {
    color: #888;
    line-height: 1.5;
}

.tips-box li strong {
    color: #a5b4fc;
}

.batch-result-nav {
    display: none;
    max-width: 500px;
    margin: 0 auto 1rem;
}

.batch-result-nav.visible {
    display: block;
}

/* Hero badges */
.hero-badge {
    display: inline-block;
    padding: 0.3rem 0.75rem;
    background: rgba(168, 85, 247, 0.08);
    border: 1px solid rgba(168, 85, 247, 0.2);
    border-radius: 20px;
    color: #a855f7;
    font-size: 0.75rem;
    font-weight: 500;
}
