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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Microsoft YaHei', 'PingFang SC', 'Hiragino Sans GB', sans-serif;
    background: #0f0f0f;
    color: #e0e0e0;
    height: 100vh;
    overflow: hidden;
}

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

/* 侧边栏 */
.sidebar {
    width: 280px;
    background: #1a1a1a;
    padding: 20px;
    border-right: 1px solid #333;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
}

.logo h1 {
    font-size: 20px;
    margin-bottom: 30px;
    color: #fff;
}

.project-delete-btn {
    background: none;
    border: none;
    color: #555;
    font-size: 14px;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
    transition: all 0.2s;
    line-height: 1;
}
.project-delete-btn:hover {
    color: #e74c3c;
    background: rgba(231, 76, 60, 0.1);
}

.workflow-steps h3 {
    font-size: 14px;
    color: #888;
    margin-bottom: 10px;
}
.project-delete-btn {
    background: none;
    border: none;
    color: #555;
    font-size: 14px;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
    transition: all 0.2s;
    line-height: 1;
}
.project-delete-btn:hover {
    color: #e74c3c;
    background: rgba(231, 76, 60, 0.1);
}

.step {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px;
    margin-bottom: 5px;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.2s;
}

.step:hover {
    background: #2a2a2a;
}

.step.active {
    background: #6366f1;
}

.step.done {
    background: #1a3a1a;
}

.step-number {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: #333;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: bold;
}

.step.active .step-number {
    background: #fff;
    color: #6366f1;
}

.step.done .step-number {
    background: #4caf50;
    color: #fff;
}

.step-name {
    flex: 1;
    font-size: 14px;
}

.step-status {
    font-size: 16px;
}

/* 主内容区 */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.top-bar {
    padding: 20px 30px;
    background: #1a1a1a;
    border-bottom: 1px solid #333;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.top-bar-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.btn-back {
    background: none;
    border: 1px solid #444;
    color: #aaa;
    padding: 4px 12px;
    border-radius: 6px;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}
.btn-back:hover {
    background: #2a2a2a;
    color: #fff;
    border-color: #888;
}

.top-bar h2 {
    font-size: 18px;
}

.project-info {
    font-size: 14px;
    color: #888;
}

.creative-input {
    padding: 30px;
    background: #1a1a1a;
    border-bottom: 1px solid #333;
}

.creative-input h3 {
    margin-bottom: 15px;
    font-size: 16px;
}

.style-selector-inline {
    display: flex;
    gap: 12px;
    margin-bottom: 16px;
}

.style-radio {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    background: #1a1a1a;
    border: 1px solid #333;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s;
}
.style-radio:hover {
    border-color: #6366f1;
    background: #222;
}
.style-radio input[type="radio"] {
    accent-color: #6366f1;
}
.style-radio:has(input:checked) {
    border-color: #6366f1;
    background: rgba(99, 102, 241, 0.1);
}

#idea-input {
    width: 100%;
    height: 120px;
    background: #0f0f0f;
    border: 1px solid #333;
    border-radius: 8px;
    padding: 15px;
    color: #e0e0e0;
    font-size: 14px;
    resize: vertical;
    margin-bottom: 15px;
}

#idea-input:focus {
    outline: none;
    border-color: #6366f1;
}

.stage-content {
    flex: 1;
    padding: 30px;
    overflow-y: auto;
}

.stage {
    max-width: 900px;
}

.stage h3 {
    margin-bottom: 20px;
    font-size: 18px;
}

.stage-output {
    background: #0f0f0f;
    border: 1px solid #333;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
    max-height: 500px;
    overflow-y: auto;
    white-space: pre-wrap;
    word-wrap: break-word;
    font-size: 14px;
    line-height: 1.6;
}

.stage-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
}

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

.btn-primary {
    background: #6366f1;
    color: #fff;
}

.btn-primary:hover:not(:disabled) {
    background: #4f46e5;
}

.btn-secondary {
    background: #333;
    color: #e0e0e0;
}

.btn-secondary:hover:not(:disabled) {
    background: #444;
}

.btn-success {
    background: #4caf50;
    color: #fff;
}

.btn-success:hover:not(:disabled) {
    background: #388e3c;
}

.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #6366f1;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-right: 10px;
    vertical-align: middle;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* 滚动条 */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #0f0f0f;
}

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

::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* 字幕开关 */
.subtitle-option {
    margin-bottom: 20px;
    padding: 15px;
    background: #1a1a1a;
    border: 1px solid #333;
    border-radius: 8px;
}

.toggle-label {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    font-size: 14px;
}

.toggle-label input[type="checkbox"] {
    accent-color: #6366f1;
    width: 18px;
    height: 18px;
}
.shot-card {
    background: #1a1a1a;
    border: 1px solid #333;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 15px;
}

.shot-card h4 {
    color: #6366f1;
    margin-bottom: 10px;
}
.project-delete-btn {
    background: none;
    border: none;
    color: #555;
    font-size: 14px;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
    transition: all 0.2s;
    line-height: 1;
}
.project-delete-btn:hover {
    color: #e74c3c;
    background: rgba(231, 76, 60, 0.1);
}

.character-img, .frame-img {
    max-width: 300px;
    border-radius: 8px;
    margin: 10px 0;
}

.video-result {
    background: #1a1a1a;
    border: 1px solid #333;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 15px;
}

.video-result video {
    max-width: 100%;
    border-radius: 8px;
    margin-top: 10px;
}

/* ─── Progress Bar ─────────── */
.video-progress-card {
    background: #1e1e1e;
    border: 1px solid #333;
    border-radius: 8px;
    padding: 12px 16px;
    margin-bottom: 10px;
}
.project-delete-btn {
    background: none;
    border: none;
    color: #555;
    font-size: 14px;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
    transition: all 0.2s;
    line-height: 1;
}
.project-delete-btn:hover {
    color: #e74c3c;
    background: rgba(231, 76, 60, 0.1);
}
.video-progress-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
    color: #ccc;
    font-size: 13px;
}
.video-status {
    font-weight: bold;
}
.progress-bar-bg {
    width: 100%;
    height: 8px;
    background: #333;
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 4px;
}
.progress-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #e74c3c, #f39c12, #2ecc71);
    border-radius: 4px;
    width: 0%;
    transition: width 0.5s ease;
}
.progress-label {
    font-size: 12px;
    color: #888;
    text-align: right;
}

/* ─── Subtitle Editor ──────── */
.subtitle-section {
    margin: 20px 0;
    background: #1a1a1a;
    border-radius: 8px;
    padding: 16px;
    border: 1px solid #2a2a2a;
}
.subtitle-section h4 {
    color: #ccc;
    margin-bottom: 10px;
    font-size: 14px;
}
.subtitle-editor textarea {
    width: 100%;
    min-height: 200px;
    background: #111;
    color: #ddd;
    border: 1px solid #333;
    border-radius: 6px;
    padding: 12px;
    font-family: 'Courier New', monospace;
    font-size: 13px;
    line-height: 1.6;
    resize: vertical;
}
.subtitle-editor textarea:focus {
    outline: none;
    border-color: #e74c3c;
}
.subtitle-actions {
    display: flex;
    gap: 10px;
    margin-top: 10px;
    align-items: center;
}
.subtitle-line-count {
    color: #666;
    font-size: 13px;
    margin-left: auto;
}

/* ─── Project List ─────────── */
.project-list-view {
    padding: 20px;
}
.project-list-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}
.project-list-desc {
    color: #666;
    font-size: 14px;
}
.project-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
}
.project-card {
    background: #1a1a1a;
    border: 1px solid #2a2a2a;
    border-radius: 10px;
    padding: 0;
    overflow: hidden;
}
.project-card:hover {
    border-color: #4a4a4a;
}
.project-card-body {
    padding: 18px;
    cursor: pointer;
    transition: background 0.2s;
}
.project-card-body:hover {
    background: #222;
}
.project-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 18px 0 18px;
}
.project-style-badge {
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 12px;
}
.project-style-badge.anime {
    background: #2c3e50;
    color: #8e44ad;
}
.project-style-badge.cinematic {
    background: #1a252f;
    color: #e74c3c;
}
.project-progress {
    font-size: 12px;
    color: #888;
}
.project-card-title {
    font-size: 15px;
    color: #eee;
    margin-bottom: 8px;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.project-card-meta {
    font-size: 12px;
    color: #555;
    display: flex;
    justify-content: space-between;
}
.project-card-stats {
    margin-top: 8px;
    font-size: 12px;
    color: #2ecc71;
}
.loading-projects {
    color: #666;
    padding: 40px;
    text-align: center;
}
.empty-state {
    text-align: center;
    padding: 60px 20px;
}
.creation-actions {
    display: flex;
    gap: 12px;
    margin-top: 15px;
}

/* ─── Keyboard Shortcut Hints ── */
.keyboard-hint {
    position: fixed;
    bottom: 10px;
    right: 10px;
    background: rgba(0,0,0,0.6);
    color: #666;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 11px;
    z-index: 100;
    pointer-events: none;
}
.keyboard-hint kbd {
    background: #333;
    color: #aaa;
    padding: 1px 5px;
    border-radius: 3px;
    font-size: 10px;
    border: 1px solid #444;
}
@media (max-width: 768px) {
    .keyboard-hint { display: none; }
    .sidebar { width: 220px; padding: 15px; }
    .sidebar h1 { font-size: 16px; }
    .stage-content { padding: 15px; }
    .project-cards { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 480px) {
    .app-container { flex-direction: column; overflow-y: auto; }
    .sidebar { 
        width: 100%; 
        position: static; 
        height: auto; 
        padding: 12px 15px;
        flex-direction: row;
        align-items: center;
        gap: 8px;
        border-right: none;
        border-bottom: 1px solid #333;
        overflow-y: visible;
    }
    .sidebar .logo h1 { font-size: 16px; margin-bottom: 0; }
    .sidebar .workflow-steps { display: none; }
    .main-content { margin-left: 0; overflow-y: visible; }
    .top-bar { padding: 10px 15px; }
    .top-bar h2 { font-size: 14px; }
    .btn-back { font-size: 12px; padding: 3px 8px; }
    .stage-content { padding: 10px; }
    .stage h3 { font-size: 15px; }
    .btn { padding: 8px 14px; font-size: 12px; }
    .project-cards { grid-template-columns: 1fr; }
    .stage-actions { flex-direction: column; }
    .stage-actions .btn { width: 100%; text-align: center; }
}
