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

body {
    font-family: 'Segoe UI', Arial, sans-serif;
    background: #0a0a1a;
    color: #fff;
    min-height: 100vh;
    padding: 20px;
}

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

header {
    text-align: center;
    padding: 30px 0;
    border-bottom: 2px solid gold;
    margin-bottom: 30px;
}

header h1 {
    color: gold;
    font-size: 36px;
}

header p {
    color: #aaa;
    font-size: 18px;
    margin-top: 10px;
}

.step {
    background: #12122a;
    padding: 25px;
    border-radius: 12px;
    margin-bottom: 25px;
    border: 1px solid #2a2a4a;
}

.step h2 {
    color: gold;
    margin-bottom: 15px;
}

.step h3 {
    color: #ffd700;
    margin: 15px 0 10px 0;
}

.form-group {
    margin-bottom: 12px;
}

.form-group label {
    display: block;
    color: #ccc;
    font-size: 14px;
    margin-bottom: 4px;
}

input[type="text"], input[type="number"], input[type="file"] {
    width: 100%;
    padding: 12px;
    border: 1px solid #333;
    border-radius: 6px;
    background: #1a1a2e;
    color: #fff;
    font-size: 16px;
}

input[type="text"]:focus {
    outline: none;
    border-color: gold;
}

button {
    padding: 12px 30px;
    border: none;
    border-radius: 6px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: 0.3s;
}

.btn-gold {
    background: gold;
    color: #0a0a1a;
}

.btn-gold:hover {
    background: #ffd700;
    transform: scale(1.02);
}

button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

hr {
    border: 1px solid #2a2a4a;
    margin: 30px 0;
}

.result-box {
    margin-top: 15px;
    padding: 15px;
    background: #0a0a1a;
    border-radius: 6px;
    border: 1px solid #2a2a4a;
    white-space: pre-wrap;
    word-break: break-all;
    max-height: 300px;
    overflow-y: auto;
    font-size: 13px;
    display: none;
}

.result-box.show {
    display: block;
}

/* Mode Selector */
.mode-selector {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
}

.mode-btn {
    padding: 12px 30px;
    background: #1a1a2e;
    color: #aaa;
    border: 2px solid #333;
    border-radius: 8px;
    font-size: 16px;
    cursor: pointer;
    transition: 0.3s;
}

.mode-btn.active {
    background: gold;
    color: #0a0a1a;
    border-color: gold;
}

.mode-btn:hover {
    border-color: gold;
}

.mode-content {
    display: none;
}

.mode-content.active {
    display: block;
}

/* Title Container */
.title-container {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 10px 0;
    max-height: 200px;
    overflow-y: auto;
    padding: 10px;
    background: #0a0a1a;
    border-radius: 6px;
    border: 1px solid #2a2a4a;
}

.title-item {
    background: #1a1a2e;
    padding: 10px 15px;
    border-radius: 6px;
    border: 2px solid #333;
    cursor: pointer;
    transition: 0.3s;
    user-select: none;
    font-size: 14px;
}

.title-item:hover {
    border-color: gold;
}

.title-item.selected {
    border-color: gold;
    background: #2a2a4a;
}

.title-item.disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

/* Options */
.options {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    margin: 15px 0;
    padding: 15px;
    background: #0a0a1a;
    border-radius: 6px;
    border: 1px solid #2a2a4a;
}

.options h4 {
    width: 100%;
    color: gold;
    margin-bottom: 5px;
}

.options label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    color: #ddd;
    font-size: 14px;
}

.options input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: gold;
}

/* Progress Log */
.progress-log {
    background: #0a0a1a;
    padding: 15px;
    border-radius: 6px;
    font-family: 'Courier New', monospace;
    font-size: 13px;
    max-height: 200px;
    overflow-y: auto;
    border: 1px solid #2a2a4a;
    margin: 10px 0;
    display: none;
}

.progress-log.show {
    display: block;
}

.progress-log .log-line {
    padding: 3px 0;
    border-bottom: 1px solid #1a1a2e;
}

.progress-log .log-line.done {
    color: #0f0;
}

.progress-log .log-line.process {
    color: #ffd700;
}

.progress-log .log-line.error {
    color: #ff4444;
}

/* History */
#historyContainer {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 15px;
}

.history-card {
    background: #1a1a2e;
    padding: 15px;
    border-radius: 8px;
    border-left: 4px solid gold;
}

.history-card .mode {
    font-weight: bold;
    color: gold;
    font-size: 14px;
}

.history-card .title-text {
    color: #fff;
    font-size: 16px;
    margin: 5px 0;
}

.history-card .date {
    color: #666;
    font-size: 12px;
}

.history-card .actions {
    margin-top: 10px;
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.history-card .actions button {
    padding: 6px 12px;
    font-size: 12px;
    background: #2a2a4a;
    color: #fff;
    border-radius: 4px;
}

.history-card .actions button:hover {
    background: gold;
    color: #0a0a1a;
}

/* Upload Area */
.upload-area {
    display: flex;
    gap: 15px;
    align-items: center;
    flex-wrap: wrap;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.8);
    overflow: auto;
}

.modal.show {
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: #12122a;
    padding: 25px;
    border-radius: 12px;
    border: 2px solid gold;
    width: 90%;
    max-width: 1200px;
    max-height: 90vh;
    position: relative;
}

.close-btn {
    position: absolute;
    top: 10px;
    right: 20px;
    font-size: 30px;
    color: #fff;
    cursor: pointer;
}

.close-btn:hover {
    color: gold;
}

.preview-actions {
    display: flex;
    gap: 10px;
    margin: 10px 0;
}

.preview-frame {
    width: 100%;
    height: 70vh;
    border: 1px solid #2a2a4a;
    border-radius: 6px;
    background: #fff;
}

@media (max-width: 768px) {
    header h1 { font-size: 24px; }
    .step { padding: 15px; }
    .options { flex-direction: column; }
    #historyContainer { grid-template-columns: 1fr; }
    .mode-selector { flex-direction: column; }
    .upload-area { flex-direction: column; }
}
