/* ============================================================
   AI赋能IP产业 - 智能化服务平台
   Design System: Warm Minimal — Claude-inspired palette
   ============================================================ */

:root {
    /* Palette — warm cream/beige inspired by Claude */
    --bg:            #FAF9F7;
    --bg-warm:       #F5F0EB;
    --bg-card:       #FFFFFF;
    --bg-card-hover: #FDFCFB;
    --bg-input:      #F5F0EB;
    --bg-input-focus:#FFFFFF;
    --bg-overlay:    rgba(60, 50, 40, 0.45);

    /* Brand */
    --brand:         #C96442;
    --brand-light:   #E8A889;
    --brand-dark:    #A04E30;
    --brand-bg:      #FDF2ED;

    /* Semantic */
    --success:       #3D8B6E;
    --success-bg:    #EDF7F2;
    --warning:       #C49A2A;
    --warning-bg:    #FDF8EC;
    --danger:        #C44B3F;
    --danger-bg:     #FDF0EE;
    --info:          #5B7FA4;
    --info-bg:       #EFF4F9;

    /* Text */
    --text:          #2D2A26;
    --text-secondary:#6B6560;
    --text-muted:    #9C958E;
    --text-inverse:  #FFFFFF;

    /* Borders */
    --border:        #E8E3DD;
    --border-light:  #F0ECE7;
    --border-focus:  #C96442;

    /* Shadows */
    --shadow-sm:     0 1px 2px rgba(60, 50, 40, 0.05);
    --shadow:        0 2px 8px rgba(60, 50, 40, 0.08);
    --shadow-lg:     0 8px 30px rgba(60, 50, 40, 0.12);
    --shadow-xl:     0 20px 60px rgba(60, 50, 40, 0.15);

    /* Radius */
    --radius-sm:     6px;
    --radius:        10px;
    --radius-lg:     16px;
    --radius-xl:     24px;

    /* Transitions */
    --ease:          cubic-bezier(0.4, 0, 0.2, 1);
    --duration:      0.2s;

    /* Typography */
    --font-sans:     -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
    --font-display:  Georgia, 'Noto Serif SC', 'Times New Roman', serif;
    --font-mono:     'Cascadia Code', 'Fira Code', Consolas, monospace;
}

/* ============ Reset ============ */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

html { font-size: 16px; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }

body {
    font-family: var(--font-sans);
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    line-height: 1.6;
    overflow-x: hidden;
}

::selection { background: var(--brand-bg); color: var(--brand-dark); }

/* ============ Header ============ */
.header {
    background: var(--bg-card);
    border-bottom: 1px solid var(--border);
    padding: 0 48px;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-logo {
    display: flex;
    align-items: center;
    gap: 14px;
}

.header-logo .icon {
    width: 36px;
    height: 36px;
    background: var(--brand);
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    color: white;
    flex-shrink: 0;
}

.header-logo h1 {
    font-size: 16px;
    font-weight: 600;
    color: var(--text);
    letter-spacing: -0.01em;
}

.header-logo .subtitle {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 1px;
    letter-spacing: 0.02em;
}

.header-actions {
    display: flex;
    gap: 8px;
    align-items: center;
}

.points-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: var(--warning-bg);
    color: var(--warning);
    padding: 6px 14px;
    border-radius: 100px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--duration) var(--ease);
    border: 1px solid transparent;
}
.points-badge:hover {
    border-color: var(--warning);
}

/* ============ Steps Indicator ============ */
.steps-container {
    max-width: 720px;
    margin: 48px auto 0;
    padding: 0 48px;
}

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

.step-item {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    transition: all var(--duration) var(--ease);
    padding: 8px 4px;
}

.step-number {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 600;
    background: var(--bg);
    border: 1.5px solid var(--border);
    color: var(--text-muted);
    transition: all var(--duration) var(--ease);
    flex-shrink: 0;
}

.step-label {
    font-size: 13px;
    color: var(--text-muted);
    white-space: nowrap;
    transition: all var(--duration) var(--ease);
    font-weight: 500;
}

.step-line {
    width: 48px;
    height: 1.5px;
    background: var(--border);
    margin: 0 12px;
    transition: all 0.4s var(--ease);
    flex-shrink: 0;
}

.step-item.active .step-number {
    background: var(--brand);
    border-color: var(--brand);
    color: white;
}
.step-item.active .step-label {
    color: var(--text);
}

.step-item.completed .step-number {
    background: var(--success);
    border-color: var(--success);
    color: white;
}
.step-item.completed .step-label {
    color: var(--success);
}

.step-line.completed { background: var(--success); }
.step-line.active { background: linear-gradient(90deg, var(--success), var(--brand)); }

/* ============ Main Content ============ */
.main-content {
    max-width: 960px;
    margin: 40px auto 80px;
    padding: 0 48px;
}

.step-panel {
    display: none;
    animation: fadeIn 0.35s var(--ease);
}
.step-panel.active { display: block; }

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

/* ============ Card ============ */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 36px;
    box-shadow: var(--shadow-sm);
    transition: all var(--duration) var(--ease);
}

.card-title {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--text);
    letter-spacing: -0.01em;
    line-height: 1.3;
}

.card-desc {
    color: var(--text-secondary);
    font-size: 14px;
    margin-bottom: 28px;
    line-height: 1.7;
}

/* ============ Form Elements ============ */
.form-group { margin-bottom: 20px; }

.form-label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--text);
    letter-spacing: 0.01em;
}
.form-label .hint {
    font-weight: 400;
    color: var(--text-muted);
    font-size: 12px;
}

textarea, input[type="text"], input[type="password"], input[type="url"], input[type="number"], input[type="tel"], select {
    width: 100%;
    padding: 12px 16px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text);
    font-size: 14px;
    font-family: var(--font-sans);
    transition: all var(--duration) var(--ease);
    outline: none;
    line-height: 1.5;
}

textarea {
    resize: vertical;
    min-height: 120px;
}

textarea:focus, input:focus, select:focus {
    background: var(--bg-input-focus);
    border-color: var(--border-focus);
    box-shadow: 0 0 0 3px rgba(201, 100, 66, 0.1);
}

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

/* ============ Buttons ============ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 20px;
    border: 1px solid transparent;
    border-radius: var(--radius);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--duration) var(--ease);
    font-family: var(--font-sans);
    text-decoration: none;
    white-space: nowrap;
    line-height: 1.4;
}

.btn-primary {
    background: var(--brand);
    color: white;
    border-color: var(--brand);
}
.btn-primary:hover {
    background: var(--brand-dark);
    border-color: var(--brand-dark);
    box-shadow: var(--shadow);
}

.btn-secondary {
    background: var(--bg-card);
    color: var(--text-secondary);
    border-color: var(--border);
}
.btn-secondary:hover {
    background: var(--bg-warm);
    border-color: var(--text-muted);
    color: var(--text);
}

.btn-success {
    background: var(--success);
    color: white;
    border-color: var(--success);
}

.btn-accent {
    background: var(--brand-bg);
    color: var(--brand);
    border-color: var(--brand-light);
}
.btn-accent:hover {
    background: var(--brand);
    color: white;
}

.btn-ghost {
    background: transparent;
    color: var(--text-secondary);
    border-color: transparent;
}
.btn-ghost:hover {
    background: var(--bg-warm);
    color: var(--text);
}

.btn-lg {
    padding: 14px 28px;
    font-size: 15px;
    font-weight: 600;
    border-radius: var(--radius);
}

.btn-sm {
    padding: 6px 14px;
    font-size: 12px;
    border-radius: var(--radius-sm);
}

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

.btn-group {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

/* ============ Image Grid ============ */
.image-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
    margin-top: 28px;
}

.image-card {
    background: var(--bg-card);
    border: 2px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    cursor: pointer;
    transition: all var(--duration) var(--ease);
    position: relative;
}
.image-card:hover {
    border-color: var(--brand-light);
    box-shadow: var(--shadow-lg);
    transform: translateY(-2px);
}
.image-card.selected {
    border-color: var(--brand);
    box-shadow: 0 0 0 3px rgba(201, 100, 66, 0.15);
}
.image-card.selected::after {
    content: '';
    position: absolute;
    top: 12px;
    right: 12px;
    width: 28px;
    height: 28px;
    background: var(--brand);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='20 6 9 17 4 12'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: center;
}

.image-card img {
    width: 100%;
    aspect-ratio: 1;
    object-fit: cover;
    display: block;
}

.image-label {
    padding: 12px 16px;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    text-align: center;
    border-top: 1px solid var(--border-light);
}

/* ============ Views ============ */
.view-selector {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
}
.view-checkbox {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 10px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    cursor: pointer;
    transition: all var(--duration) var(--ease);
    font-size: 13px;
    user-select: none;
}
.view-checkbox:hover {
    border-color: var(--brand-light);
    background: var(--brand-bg);
}
.view-checkbox:has(input:checked) {
    border-color: var(--brand);
    background: var(--brand-bg);
}
.view-checkbox input { margin: 0; accent-color: var(--brand); }
.view-cb-label { white-space: nowrap; }

.views-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 16px;
    margin-top: 28px;
}

.view-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: all var(--duration) var(--ease);
}
.view-card:hover {
    box-shadow: var(--shadow);
}

.view-card img {
    width: 100%;
    aspect-ratio: 1;
    object-fit: cover;
}

.view-label {
    padding: 10px;
    text-align: center;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    border-top: 1px solid var(--border-light);
}

/* ============ Character Card ============ */
.character-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 36px;
    margin-top: 24px;
}

.character-name {
    font-family: var(--font-display);
    font-size: 28px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 4px;
    letter-spacing: -0.02em;
}

.character-tagline {
    font-family: var(--font-display);
    font-size: 16px;
    color: var(--brand);
    font-style: italic;
    margin-bottom: 24px;
    padding-bottom: 24px;
    border-bottom: 1px solid var(--border-light);
}

.character-section {
    margin-top: 20px;
}
.character-section h4 {
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-weight: 600;
}
.character-section p {
    font-size: 14px;
    line-height: 1.7;
    color: var(--text-secondary);
}

.tags { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 4px; }
.tag {
    padding: 4px 12px;
    background: var(--bg-warm);
    border: 1px solid var(--border);
    border-radius: 100px;
    font-size: 12px;
    color: var(--text-secondary);
    font-weight: 500;
}

/* ============ 3D Model ============ */
.model-files {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 16px;
}

.file-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    background: var(--bg-warm);
    border: 1px solid var(--border);
    border-radius: 100px;
    font-size: 13px;
    color: var(--text-secondary);
    text-decoration: none;
    transition: all var(--duration) var(--ease);
    font-weight: 500;
}
.file-badge:hover {
    border-color: var(--brand);
    color: var(--brand);
    background: var(--brand-bg);
}

.model-view-btn.active {
    background: var(--brand) !important;
    color: white !important;
    border-color: var(--brand) !important;
}

/* ============ Loading Overlay ============ */
.loading-overlay {
    display: none;
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: var(--bg-overlay);
    backdrop-filter: blur(8px);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 20px;
}
.loading-overlay.active { display: flex; }

.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--border);
    border-top-color: var(--brand);
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.loading-text {
    font-size: 16px;
    color: var(--text-inverse);
    font-weight: 500;
}
.loading-subtext {
    font-size: 13px;
    color: rgba(255,255,255,0.6);
}

.progress-bar {
    width: 240px;
    height: 3px;
    background: rgba(255,255,255,0.15);
    border-radius: 2px;
    overflow: hidden;
}
.progress-bar .fill {
    height: 100%;
    background: var(--brand);
    border-radius: 2px;
    animation: progressPulse 2s ease-in-out infinite;
}
@keyframes progressPulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* ============ Slide Panels (Settings / Task List) ============ */
.settings-panel {
    display: none;
    position: fixed;
    top: 0; right: 0;
    width: 440px;
    height: 100%;
    background: var(--bg-card);
    border-left: 1px solid var(--border);
    z-index: 200;
    overflow-y: auto;
    padding: 36px;
    box-shadow: var(--shadow-xl);
    animation: slideIn 0.3s var(--ease);
}
.settings-panel.active { display: block; }

@keyframes slideIn {
    from { transform: translateX(100%); }
    to   { transform: translateX(0); }
}

.settings-backdrop {
    display: none;
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: var(--bg-overlay);
    z-index: 199;
}
.settings-backdrop.active { display: block; }

.settings-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 32px;
}
.settings-header h2 {
    font-size: 18px;
    font-weight: 600;
}

.settings-close {
    width: 32px;
    height: 32px;
    border: 1px solid var(--border);
    background: var(--bg);
    border-radius: 50%;
    color: var(--text-secondary);
    font-size: 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--duration) var(--ease);
}
.settings-close:hover {
    background: var(--danger-bg);
    border-color: var(--danger);
    color: var(--danger);
}

.settings-section {
    margin-bottom: 28px;
    padding-bottom: 28px;
    border-bottom: 1px solid var(--border-light);
}
.settings-section:last-of-type { border-bottom: none; }
.settings-section h3 {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 16px;
    color: var(--text);
}

/* ============ Toast ============ */
.toast {
    position: fixed;
    bottom: 32px;
    right: 32px;
    padding: 14px 24px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    z-index: 300;
    animation: toastIn 0.3s var(--ease);
    max-width: 400px;
    font-size: 14px;
    color: var(--text);
}
.toast.success { border-left: 3px solid var(--success); }
.toast.error   { border-left: 3px solid var(--danger); }
.toast.info    { border-left: 3px solid var(--info); }

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

/* ============ Placeholder ============ */
.placeholder-img {
    width: 100%;
    aspect-ratio: 1;
    background: var(--bg-warm);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    font-size: 48px;
}

/* ============ Task Cards ============ */
.task-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px;
    cursor: pointer;
    transition: all var(--duration) var(--ease);
    position: relative;
}
.task-card:hover {
    border-color: var(--brand-light);
    box-shadow: var(--shadow);
}

.task-card-name {
    font-size: 15px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 6px;
    padding-right: 30px;
}
.task-card-meta {
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 10px;
}
.task-card-steps {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.task-step-badge {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    padding: 3px 10px;
    border-radius: 100px;
    font-size: 11px;
    font-weight: 500;
}
.task-step-badge.done    { background: var(--success-bg); color: var(--success); }
.task-step-badge.pending { background: var(--bg-warm); color: var(--text-muted); }
.task-step-badge.running { background: var(--warning-bg); color: var(--warning); animation: pulse 1.5s infinite; }

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.task-card-delete {
    position: absolute;
    top: 12px; right: 12px;
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 14px;
    padding: 4px;
    border-radius: 4px;
    transition: all var(--duration) var(--ease);
}
.task-card-delete:hover {
    color: var(--danger);
    background: var(--danger-bg);
}

.task-current-badge {
    display: inline-block;
    background: var(--brand);
    color: white;
    font-size: 10px;
    padding: 2px 8px;
    border-radius: 100px;
    margin-left: 8px;
    vertical-align: middle;
    font-weight: 600;
}

/* ============ Quick Prompt Chips ============ */
.quick-prompt {
    background: var(--bg-warm) !important;
    border-color: var(--border) !important;
    color: var(--text-secondary) !important;
    font-size: 13px !important;
    border-radius: 100px !important;
    padding: 8px 16px !important;
}
.quick-prompt:hover {
    background: var(--brand-bg) !important;
    border-color: var(--brand-light) !important;
    color: var(--brand) !important;
}

/* ============ Empty States ============ */
.empty-state {
    text-align: center;
    padding: 80px 20px;
    color: var(--text-muted);
}
.empty-state .empty-icon {
    width: 64px;
    height: 64px;
    background: var(--bg-warm);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    margin: 0 auto 20px;
}

/* ============ Responsive ============ */
@media (max-width: 768px) {
    .header { padding: 0 20px; }
    .main-content { padding: 0 20px; }
    .steps-container { padding: 0 20px; }
    .image-grid { grid-template-columns: 1fr; }
    .views-grid { grid-template-columns: 1fr; }
    .view-selector { grid-template-columns: repeat(2, 1fr); }
    .card { padding: 24px; }
    .settings-panel { width: 100%; }
    .step-label { display: none; }
    .step-line { width: 24px; margin: 0 6px; }
    .character-card { padding: 24px; }
}

@media (max-width: 480px) {
    .header-actions { gap: 4px; }
    .btn-sm { padding: 5px 10px; font-size: 11px; }
}
