* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    overflow: hidden;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background: #fff;
    min-height: 100vh;
    overflow: hidden;
}

/* 顶部导航栏 */
.header {
    background: #fff;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 10px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.05);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 16px;
    min-width: fit-content;
}

.back-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: #666;
    cursor: pointer;
    padding: 8px 12px;
    border-radius: 6px;
    transition: background 0.2s;
}

.back-btn:hover {
    background: #f5f5f5;
}

.script-name {
    font-size: 15px;
    font-weight: 500;
    color: #333;
}

.logo-icon {
    width: 28px;
    height: 28px;
    background: #333;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 14px;
}

.logo-text {
    font-size: 18px;
    font-weight: 600;
    color: #333;
}

.steps-container {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

.steps-indicator {
    display: flex;
    align-items: center;
    gap: 16px;
}

.step {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: #999;
}

.step.active {
    color: #7c3aed;
}

.step.completed {
    color: #333;
}

.step-number {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: #f0f0f0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 500;
}

.step.active .step-number {
    background: #7c3aed;
    color: #fff;
}

.step.completed .step-number {
    background: #c4b5fd;
    color: #fff;
}

.step-arrow {
    color: #ccc;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 24px;
}

.header-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    color: #666;
    cursor: pointer;
    position: relative;
}

.header-btn .badge {
    background: #7c3aed;
    color: #fff;
    padding: 2px 10px;
    border-radius: 12px;
    font-size: 14px;
}

/* 积分弹窗 */
.points-popup {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 10px;
    width: 280px;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
    z-index: 1000;
    display: none;
}

.points-popup.active {
    display: block;
}

.points-popup-content {
    padding: 20px;
}

.points-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}

.points-label {
    font-size: 13px;
    color: #999;
}

.points-value {
    font-size: 32px;
    font-weight: 600;
    color: #7c3aed;
}

.btn-buy-points {
    padding: 8px 16px;
    border: 1px solid #e0e0e0;
    border-radius: 20px;
    background: #fff;
    font-size: 13px;
    color: #333;
    cursor: pointer;
}

.btn-buy-points:hover {
    border-color: #7c3aed;
    color: #7c3aed;
}

.points-records-title {
    font-size: 14px;
    font-weight: 500;
    color: #333;
    margin-bottom: 12px;
    padding-bottom: 10px;
    border-bottom: 1px solid #f0f0f0;
}

.points-records {
    max-height: 240px;
    overflow-y: auto;
}

.points-record {
    padding: 12px 0;
    border-bottom: 1px solid #f5f5f5;
}

.points-record:last-child {
    border-bottom: none;
}

.record-title {
    font-size: 14px;
    color: #333;
    margin-bottom: 4px;
}

.record-meta {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 12px;
    color: #999;
}

.record-points {
    float: right;
    font-size: 14px;
    font-weight: 500;
    margin-top: -20px;
}

.record-points.positive {
    color: #22c55e;
}

.record-points.negative {
    color: #ef4444;
}

/* 用户下拉菜单 */
.user-menu {
    position: relative;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    padding: 6px 12px;
    border-radius: 6px;
    transition: background 0.2s;
}

.user-info:hover {
    background: #f5f5f5;
}

.user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #ddd;
    overflow: hidden;
}

.user-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.user-name {
    font-size: 14px;
    color: #333;
}

.user-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 8px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.12);
    min-width: 120px;
    z-index: 1000;
    display: none;
}

.user-dropdown.active {
    display: block;
}

.dropdown-item {
    padding: 12px 16px;
    font-size: 14px;
    color: #333;
    cursor: pointer;
    transition: background 0.2s;
    text-decoration: none;
    display: block;
}

.dropdown-item:hover {
    background: #f5f5f5;
    text-decoration: none;
}

.logo-link {
    display: flex;
    align-items: center;
    gap: 16px;
    text-decoration: none;
}

/* 主内容区 */
.main-content {
    padding-top: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: calc(100vh - 60px);
}

.loading-container {
    text-align: center;
}

.loading-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 24px;
    position: relative;
}

.loading-icon-inner {
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #e0d4f7 0%, #c4b5fd 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.loading-icon-inner svg {
    width: 40px;
    height: 40px;
    color: #7c3aed;
}

.loading-title {
    font-size: 18px;
    font-weight: 500;
    color: #333;
    margin-bottom: 12px;
}

.loading-desc {
    font-size: 14px;
    color: #999;
}

/* 动画 */
@keyframes pulse {
    0%, 100% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.05);
        opacity: 0.8;
    }
}

.loading-icon-inner {
    animation: pulse 2s ease-in-out infinite;
}

/* 剧本大纲页面样式 */
.main-content.outline-page {
    background: #f5f5f7;
    align-items: center;
    padding-top: 80px;
}

.outline-container {
    width: 100%;
    max-width: 800px;
    padding: 0 20px;
}

.outline-card {
    background: #fff;
    border-radius: 16px;
    padding: 40px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.08);
}

.outline-title {
    font-size: 20px;
    font-weight: 600;
    color: #333;
    margin-bottom: 32px;
}

.form-group {
    margin-bottom: 28px;
}

.form-label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    color: #333;
    margin-bottom: 12px;
}

.required {
    color: #ef4444;
    margin-left: 2px;
}

.input-wrapper {
    position: relative;
}

.form-input {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    font-size: 14px;
    color: #333;
    transition: border-color 0.2s;
}

.form-input:focus {
    outline: none;
    border-color: #7c3aed;
}

.char-count {
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 12px;
    color: #999;
}

/* 风格选项 */
.style-options {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.style-option {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    width: calc(33.333% - 6.667px);
    box-sizing: border-box;
}

.style-option:hover {
    border-color: #d0d0d0;
}

.style-option.selected {
    border-color: #7c3aed;
    background: #f5f3ff;
}

.radio-dot {
    width: 14px;
    height: 14px;
    border: 2px solid #d0d0d0;
    border-radius: 50%;
    flex-shrink: 0;
    position: relative;
}

.radio-dot.active {
    border-color: #7c3aed;
}

.radio-dot.active::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 6px;
    height: 6px;
    background: #7c3aed;
    border-radius: 50%;
}

.style-text {
    font-size: 14px;
    color: #333;
}

.custom-style-input {
    flex: 1;
    border: none;
    background: transparent;
    font-size: 14px;
    color: #333;
    outline: none;
}

.custom-style-input::placeholder {
    color: #999;
}

.btn-add-custom {
    margin-top: 10px;
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    background: #f5f5f7;
    border: 1px dashed #d0d0d0;
    border-radius: 6px;
    font-size: 13px;
    color: #666;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-add-custom:hover {
    background: #ebebeb;
    border-color: #b0b0b0;
}

.plus-icon {
    font-size: 18px;
    font-weight: 300;
}

/* 比例选项 */
.ratio-options {
    display: flex;
    gap: 16px;
}

.ratio-option {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 20px;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
}

.ratio-option:hover {
    border-color: #d0d0d0;
}

.ratio-option.selected {
    border-color: #7c3aed;
    background: #f5f3ff;
}

.ratio-option.selected .radio-dot {
    border-color: #7c3aed;
}

.ratio-option.selected .radio-dot::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 6px;
    height: 6px;
    background: #7c3aed;
    border-radius: 50%;
}

.ratio-icon {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1.5px solid #d0d0d0;
    border-radius: 4px;
}

.ratio-icon.vertical {
    width: 16px;
    height: 24px;
}

.ratio-icon.horizontal {
    width: 24px;
    height: 16px;
}

.ratio-box {
    width: 8px;
    height: 8px;
    background: #d0d0d0;
}

.ratio-text {
    font-size: 14px;
    color: #333;
}

.custom-input-option.selected .radio-dot {
    border-color: #7c3aed;
}

.custom-input-option.selected .radio-dot::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 6px;
    height: 6px;
    background: #7c3aed;
    border-radius: 50%;
}

/* 确认按钮 */
.form-actions {
    display: flex;
    justify-content: flex-end;
    margin-top: 36px;
}

/* 公共按钮样式 */
.btn {
    padding: 9px 24px;
    background: #7c3aed;
    color: #fff;
    border: none;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: opacity 0.2s;
}

.btn:hover {
    opacity: 0.9;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-confirm {
    padding: 9px 24px;
    background: #7c3aed;
    color: #fff;
    border: none;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: opacity 0.2s;
}

.btn-confirm:hover {
    opacity: 0.9;
}

.btn-confirm:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* 主内容区 */
.main-content.content-page {
    background: #f5f5f7;
    align-items: flex-start;
    padding-top: 60px;
}

.content-container {
    width: 100%;
    margin: 0 auto;
    padding: 0 20px;
    box-sizing: border-box;
    max-width: calc(100vw - 40px);
}

/* 基本信息区域 */
.info-section {
    background: #fff;
    border-radius: 12px;
    padding: 10px 0px;
    margin-bottom: 0;
}

.info-row {
    display: flex;
    align-items: center;
    margin-bottom: 16px;
}

.info-row:last-child {
    margin-bottom: 0;
}

.info-label {
    font-size: 14px;
    color: #666;
    margin-right: 12px;
}

.info-value {
    font-size: 14px;
    color: #333;
    font-weight: 500;
}

/* 区域标题 */
.section-title {
    font-size: 16px;
    font-weight: 600;
    color: #333;
    margin-bottom: 16px;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

/* 剧本摘要卡片 */
.summary-card {
    background: #f8f8f8;
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 32px;
}

.summary-row {
    display: flex;
    align-items: flex-start;
    margin-bottom: 20px;
}

.summary-row:last-child {
    margin-bottom: 0;
}

.summary-label {
    width: 90px;
    flex-shrink: 0;
    font-size: 14px;
    color: #666;
    align-self: flex-start;
}

.summary-value {
    flex: 1;
    font-size: 14px;
    color: #333;
    line-height: 1.6;
}

.summary-value.story-summary {
    line-height: 1.8;
}

/* 内容卡片 */
.content-card {
    background: #f8f8f8;
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 32px;
}

.episode-title {
    font-size: 15px;
    font-weight: 600;
    color: #333;
    margin-bottom: 16px;
}

.episode-info {
    font-size: 14px;
    color: #666;
    margin-bottom: 12px;
}

.episode-desc {
    font-size: 12px;
    color: #666;
    line-height: 1.6;
    margin-bottom: 16px;
}

.episode-dialog {
    margin-top: 16px;
}

.dialog-line {
    font-size: 13px;
    color: #333;
    line-height: 1.8;
    margin-bottom: 10px;
}

.dialog-line:last-child {
    margin-bottom: 0;
}

/* 改写按钮 */
.btn-convert {
    padding: 6px 16px;
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    font-size: 13px;
    color: #666;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-convert:hover {
    border-color: #7c3aed;
    color: #7c3aed;
}

/* 底部固定区域 */
.bottom-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: #fff;
    border-top: 1px solid #e0e0e0;
    padding: 16px 40px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 100;
}

.bottom-hint {
    font-size: 14px;
    color: #666;
}

/* 底部区域 */
.bottom-section {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 16px;
}

.bottom-hint {
    font-size: 13px;
    color: #999;
}

.btn-next {
    padding: 9px 24px;
    background: #7c3aed;
    color: #fff;
    border: none;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: opacity 0.2s;
}

.btn-next:hover {
    opacity: 0.9;
}

/* 视频生成提示词页面 */
.main-container {
    padding-top: 80px;
    padding-bottom: 20px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    background: #f5f5f7;
    box-sizing: border-box;
}

.prompt-page {
    background: #fff;
    border-radius: 16px;
    padding: 40px;
    width: 100%;
    max-width: 600px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.08);
}

.prompt-title {
    font-size: 20px;
    font-weight: 600;
    color: #333;
    margin-bottom: 24px;
    text-align: center;
}

.prompt-message {
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 14px;
    margin-bottom: 20px;
    text-align: center;
}

.prompt-message.success {
    background: #f0fdf4;
    color: #16a34a;
    border: 1px solid #bbf7d0;
}

.prompt-message.error {
    background: #fef2f2;
    color: #dc2626;
    border: 1px solid #fecaca;
}

.prompt-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.prompt-textarea {
    width: 100%;
    min-height: 200px;
    padding: 16px;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    font-size: 14px;
    color: #333;
    resize: vertical;
    font-family: inherit;
    line-height: 1.6;
}

.prompt-textarea:focus {
    outline: none;
    border-color: #7c3aed;
}

.prompt-save-btn {
    padding: 12px 24px;
    background: #7c3aed;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: opacity 0.2s;
    align-self: flex-end;
}

.prompt-save-btn:hover {
    opacity: 0.9;
}

.prompt-btn-group {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
}

.prompt-back-btn {
    padding: 12px 24px;
    background: #fff;
    color: #666;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-block;
    line-height: 1;
}

.prompt-back-btn:hover {
    border-color: #7c3aed;
    color: #7c3aed;
}
