/* ============================================
   AI 全自动开发系统 · 高级简约白色 UI
   PC + 移动端响应式
   ============================================ */

/* ---------- 重置与变量 ---------- */
* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
    --primary: #0f172a;
    --primary-light: #1e293b;
    --accent: #2563eb;
    --accent-hover: #1d4ed8;
    --accent-light: #eff6ff;
    --accent-lighter: #f8fafc;
    --text: #0f172a;
    --text-secondary: #475569;
    --text-muted: #94a3b8;
    --border: #e2e8f0;
    --border-light: #f1f5f9;
    --bg: #f8fafc;
    --white: #ffffff;
    --success: #10b981;
    --success-light: #ecfdf5;
    --warning: #f59e0b;
    --warning-light: #fffbeb;
    --danger: #ef4444;
    --danger-light: #fef2f2;
    --radius-sm: 6px;
    --radius: 10px;
    --radius-lg: 14px;
    --radius-xl: 20px;
    --shadow-xs: 0 1px 2px rgba(15, 23, 42, 0.04);
    --shadow-sm: 0 1px 3px rgba(15, 23, 42, 0.06), 0 1px 2px rgba(15, 23, 42, 0.04);
    --shadow: 0 4px 12px rgba(15, 23, 42, 0.06);
    --shadow-md: 0 8px 24px rgba(15, 23, 42, 0.08);
    --shadow-lg: 0 16px 40px rgba(15, 23, 42, 0.1);
    --shadow-xl: 0 24px 60px rgba(15, 23, 42, 0.12);
    --transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

html { -webkit-text-size-adjust: 100%; }

body {
    font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    font-size: 14px;
    min-height: 100vh;
}

a { color: var(--accent); text-decoration: none; transition: var(--transition); }
a:hover { opacity: 0.85; }

img { max-width: 100%; display: block; }

button, input, select, textarea {
    font-family: inherit;
    font-size: inherit;
    color: inherit;
}

/* ---------- 滚动条 ---------- */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
    border: 2px solid transparent;
    background-clip: content-box;
}
::-webkit-scrollbar-thumb:hover { background: #94a3b8; background-clip: content-box; }

/* ---------- 顶部导航 ---------- */
.navbar {
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: saturate(180%) blur(20px);
    -webkit-backdrop-filter: saturate(180%) blur(20px);
    border-bottom: 1px solid var(--border);
    padding: 0 32px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 100;
}

.navbar-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 16px;
    font-weight: 600;
    color: var(--primary);
    letter-spacing: -0.01em;
}

.navbar-brand .brand-icon {
    width: 32px;
    height: 32px;
    background: linear-gradient(135deg, var(--accent), #3b82f6);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 15px;
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.3);
}

.navbar-brand .brand-icon i { color: #fff; }

.navbar-nav {
    display: flex;
    align-items: center;
    gap: 4px;
}

.nav-link {
    padding: 8px 14px;
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    transition: var(--transition);
    white-space: nowrap;
}

.nav-link i { font-size: 13px; }

.nav-link:hover {
    background: var(--border-light);
    color: var(--text);
    opacity: 1;
}

.nav-link.active {
    background: var(--accent-light);
    color: var(--accent);
}

/* ---------- 容器 ---------- */
.container {
    max-width: 1240px;
    margin: 0 auto;
    padding: 32px;
}

.page-header { margin-bottom: 28px; }

.page-header h1 {
    font-size: 24px;
    font-weight: 700;
    color: var(--primary);
    letter-spacing: -0.025em;
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 4px;
}

.page-header h1 i {
    color: var(--accent);
    font-size: 20px;
}

.page-header p {
    color: var(--text-secondary);
    font-size: 13.5px;
}

/* ---------- 按钮 ---------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding: 9px 18px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--white);
    color: var(--text);
    font-size: 13.5px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
    white-space: nowrap;
    user-select: none;
    line-height: 1.4;
}

.btn i { font-size: 13px; }

.btn:hover {
    border-color: #cbd5e1;
    background: var(--border-light);
    opacity: 1;
}

.btn:active { transform: scale(0.98); }

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

.btn-primary {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}
.btn-primary:hover {
    background: var(--primary-light);
    border-color: var(--primary-light);
    color: #fff;
}

.btn-accent {
    background: var(--accent);
    color: #fff;
    border-color: var(--accent);
    box-shadow: 0 1px 2px rgba(37, 99, 235, 0.2), 0 4px 12px rgba(37, 99, 235, 0.15);
}
.btn-accent:hover {
    background: var(--accent-hover);
    border-color: var(--accent-hover);
    color: #fff;
    box-shadow: 0 2px 4px rgba(37, 99, 235, 0.25), 0 6px 16px rgba(37, 99, 235, 0.2);
}

.btn-danger { color: var(--danger); border-color: #fecaca; }
.btn-danger:hover { background: var(--danger-light); border-color: var(--danger); }

.btn-ghost { border-color: transparent; background: transparent; }
.btn-ghost:hover { background: var(--border-light); }

.btn-sm { padding: 6px 12px; font-size: 12.5px; }
.btn-sm i { font-size: 12px; }
.btn-lg { padding: 12px 24px; font-size: 14.5px; }
.btn-lg i { font-size: 14px; }
.btn-block { width: 100%; }

/* ---------- 卡片 ---------- */
.card {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xs);
    transition: var(--transition);
}

.card-header {
    padding: 18px 22px;
    border-bottom: 1px solid var(--border-light);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.card-header h3 {
    font-size: 14.5px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--primary);
}

.card-header h3 i { color: var(--accent); font-size: 14px; }

.card-body { padding: 22px; }

/* ---------- 项目网格 ---------- */
.project-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
}

.project-card {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 22px;
    transition: var(--transition-slow);
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.project-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--accent), #3b82f6, #60a5fa);
    opacity: 0;
    transition: var(--transition);
}

.project-card:hover {
    border-color: #cbd5e1;
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.project-card:hover::before { opacity: 1; }

.project-card .star {
    position: absolute;
    top: 16px;
    right: 16px;
    color: #cbd5e1;
    cursor: pointer;
    font-size: 15px;
    transition: var(--transition);
    padding: 4px;
    border-radius: 4px;
    z-index: 2;
}

.project-card .star:hover { color: #f59e0b; background: #fffbeb; }
.project-card .star.active { color: #f59e0b; }

.project-card-icon {
    width: 44px;
    height: 44px;
    background: linear-gradient(135deg, var(--accent-light), #dbeafe);
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--accent);
    font-size: 18px;
    margin-bottom: 16px;
}

.project-card h3 {
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 6px;
    color: var(--primary);
    letter-spacing: -0.01em;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    padding-right: 24px;
}

.project-card .meta {
    font-size: 12.5px;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 4px;
}

.project-card .meta i { font-size: 11px; }

.project-card .tech {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: var(--border-light);
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 11.5px;
    color: var(--text-secondary);
    margin-top: 12px;
    font-weight: 500;
}

.project-card .tech i { font-size: 10px; color: var(--accent); }

/* 新建卡片 */
.project-card.new {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 178px;
    border-style: dashed;
    border-color: #cbd5e1;
    color: var(--text-muted);
    background: transparent;
}

.project-card.new:hover {
    border-color: var(--accent);
    color: var(--accent);
    background: var(--accent-light);
}

.project-card.new::before { display: none; }

.project-card.new i {
    font-size: 26px;
    margin-bottom: 10px;
    transition: var(--transition);
}

.project-card.new:hover i { transform: scale(1.1); }

.project-card.new span { font-size: 13.5px; font-weight: 500; }

/* ---------- 表单 ---------- */
.form-group { margin-bottom: 18px; }

.form-label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    margin-bottom: 7px;
    color: var(--text);
}

.form-label .required { color: var(--danger); margin-left: 2px; }

.form-control {
    width: 100%;
    padding: 10px 13px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 13.5px;
    transition: var(--transition);
    background: var(--white);
    color: var(--text);
    line-height: 1.5;
}

.form-control::placeholder { color: var(--text-muted); }

.form-control:hover { border-color: #cbd5e1; }

.form-control:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

select.form-control {
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%2364748b' d='M6 8L2 4h8z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 13px center;
    padding-right: 34px;
}

textarea.form-control { resize: vertical; min-height: 80px; }

.form-hint {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 6px;
    line-height: 1.5;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}

/* ---------- 弹窗 ---------- */
.modal-mask {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.5);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    animation: fadeIn 0.2s ease;
}

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.modal {
    background: var(--white);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-xl);
    width: 100%;
    max-width: 520px;
    max-height: 90vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    animation: slideUp 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes slideUp {
    from { opacity: 0; transform: translateY(20px) scale(0.98); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.modal-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-light);
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
}

.modal-header h3 {
    font-size: 16px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 9px;
    color: var(--primary);
}

.modal-header h3 i { color: var(--accent); }

.modal-close {
    background: none;
    border: none;
    font-size: 16px;
    color: var(--text-muted);
    cursor: pointer;
    padding: 6px 8px;
    border-radius: 6px;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-close:hover { background: var(--border-light); color: var(--text); }

.modal-body {
    padding: 24px;
    overflow-y: auto;
    flex: 1;
}

.modal-footer {
    padding: 16px 24px;
    border-top: 1px solid var(--border-light);
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    flex-shrink: 0;
    background: var(--accent-lighter);
}

/* ---------- 工作台布局 ---------- */
.workspace {
    display: grid;
    grid-template-columns: 280px 1fr;
    height: calc(100vh - 60px);
    background: var(--white);
}

.sidebar {
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: var(--white);
}

.sidebar-header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-light);
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
}

.sidebar-header h3 {
    font-size: 13.5px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--primary);
}

.sidebar-header h3 i { color: var(--accent); font-size: 13px; }

.sidebar-header span {
    font-size: 11.5px;
    color: var(--text-muted);
    background: var(--border-light);
    padding: 2px 8px;
    border-radius: 10px;
}

.file-tree {
    flex: 1;
    overflow-y: auto;
    padding: 8px 0;
}

.tree-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 7px 20px;
    font-size: 13px;
    color: var(--text-secondary);
    cursor: pointer;
    border: none;
    background: none;
    width: 100%;
    text-align: left;
    font-family: inherit;
    transition: var(--transition);
    line-height: 1.5;
}

.tree-item:hover { background: var(--border-light); color: var(--text); }

.tree-item.active {
    background: var(--accent-light);
    color: var(--accent);
    font-weight: 500;
}

.tree-item i {
    font-size: 12px;
    color: var(--text-muted);
    width: 14px;
    text-align: center;
    flex-shrink: 0;
}

.tree-item.dir { font-weight: 500; color: var(--text); }
.tree-item.dir i { color: var(--accent); }

.tree-children { padding-left: 14px; }

/* ---------- 对话区 ---------- */
.chat-area {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: var(--bg);
}

.chat-header {
    padding: 14px 24px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--white);
    flex-shrink: 0;
}

.chat-header h2 {
    font-size: 14.5px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 9px;
    color: var(--primary);
}

.chat-header h2 i { color: var(--accent); }

.chat-header .actions {
    display: flex;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
}

.chat-header .actions span {
    font-size: 12px;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 5px;
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 24px;
    background: var(--bg);
}

.message {
    margin-bottom: 20px;
    display: flex;
    gap: 12px;
    animation: messageIn 0.3s ease;
}

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

.message.user { flex-direction: row-reverse; }

.message-avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 14px;
}

.message.user .message-avatar {
    background: var(--primary);
    color: #fff;
}

.message.ai .message-avatar {
    background: linear-gradient(135deg, var(--accent-light), #dbeafe);
    color: var(--accent);
}

.message-bubble {
    max-width: 720px;
    padding: 12px 16px;
    border-radius: var(--radius);
    font-size: 13.5px;
    line-height: 1.7;
    white-space: pre-wrap;
    word-break: break-word;
}

.message.user .message-bubble {
    background: var(--primary);
    color: #fff;
    border-bottom-right-radius: 4px;
}

.message.ai .message-bubble {
    background: var(--white);
    border: 1px solid var(--border);
    border-bottom-left-radius: 4px;
    color: var(--text);
}

.message-bubble pre {
    background: #0f172a;
    color: #e2e8f0;
    padding: 12px;
    border-radius: 8px;
    overflow-x: auto;
    font-size: 12px;
    margin: 8px 0;
    font-family: 'SF Mono', 'Monaco', 'Menlo', monospace;
}

.message-bubble code {
    background: rgba(37, 99, 235, 0.08);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 12.5px;
    font-family: 'SF Mono', 'Monaco', 'Menlo', monospace;
    color: var(--accent);
}

/* 变更卡片 */
.change-card {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    margin-top: 10px;
    overflow: hidden;
}

.change-card-header {
    padding: 11px 16px;
    background: var(--accent-light);
    color: var(--accent);
    font-weight: 600;
    font-size: 12.5px;
    display: flex;
    align-items: center;
    gap: 7px;
}

.change-list { padding: 6px 0; }

.change-item {
    padding: 9px 16px;
    display: flex;
    align-items: center;
    gap: 9px;
    font-size: 12.5px;
    border-bottom: 1px solid var(--border-light);
}

.change-item:last-child { border-bottom: none; }

.action-badge {
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 10.5px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.02em;
    flex-shrink: 0;
}

.action-badge.create { background: #d1fae5; color: #065f46; }
.action-badge.modify { background: #dbeafe; color: #1e40af; }
.action-badge.rewrite { background: #fed7aa; color: #92400e; }
.action-badge.delete { background: #fecaca; color: #991b1b; }

.change-card-footer {
    padding: 12px 16px;
    background: var(--accent-lighter);
    display: flex;
    gap: 8px;
    justify-content: flex-end;
}

/* ---------- 输入区 ---------- */
.chat-input {
    padding: 14px 24px 18px;
    border-top: 1px solid var(--border);
    background: var(--white);
    display: flex;
    gap: 10px;
    align-items: flex-end;
    flex-shrink: 0;
}

.chat-input textarea {
    flex: 1;
    resize: none;
    min-height: 42px;
    max-height: 160px;
    padding: 11px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-family: inherit;
    font-size: 13.5px;
    line-height: 1.5;
    background: var(--bg);
    color: var(--text);
    transition: var(--transition);
}

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

.chat-input textarea:focus {
    outline: none;
    border-color: var(--accent);
    background: var(--white);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

/* ---------- 进度条 ---------- */
.progress-bar {
    height: 3px;
    background: var(--border-light);
    border-radius: 2px;
    overflow: hidden;
    margin: 10px 0;
}

.progress-bar-inner {
    height: 100%;
    background: linear-gradient(90deg, var(--accent), #60a5fa);
    border-radius: 2px;
    transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
}

.progress-bar-inner::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.4), transparent);
    animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

/* ---------- 预览页 ---------- */
.preview-toolbar {
    background: var(--white);
    border-bottom: 1px solid var(--border);
    padding: 12px 24px;
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    flex-shrink: 0;
}

.device-switcher {
    display: flex;
    background: var(--bg);
    border-radius: var(--radius-sm);
    padding: 3px;
    gap: 2px;
    border: 1px solid var(--border);
}

.device-switcher button {
    padding: 7px 14px;
    border: none;
    background: transparent;
    border-radius: 5px;
    cursor: pointer;
    font-size: 12.5px;
    font-family: inherit;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 6px;
    transition: var(--transition);
    font-weight: 500;
    white-space: nowrap;
}

.device-switcher button i { font-size: 12px; }

.device-switcher button:hover { color: var(--text); }

.device-switcher button.active {
    background: var(--white);
    color: var(--accent);
    box-shadow: var(--shadow-xs);
    font-weight: 600;
}

.preview-stage {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    gap: 24px;
    padding: 28px;
    background: var(--bg);
    min-height: calc(100vh - 60px - 62px);
    overflow: auto;
}

.frame-pc {
    flex: 1;
    max-width: 1200px;
    height: calc(100vh - 200px);
    min-height: 500px;
    background: var(--white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    overflow: hidden;
    border: 1px solid var(--border);
    transition: var(--transition);
}

.frame-mobile {
    width: 390px;
    height: 780px;
    border: 11px solid #0f172a;
    border-radius: 44px;
    background: #000;
    overflow: hidden;
    position: relative;
    box-shadow: var(--shadow-xl);
    flex-shrink: 0;
}

.frame-mobile::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 110px;
    height: 24px;
    background: #0f172a;
    border-radius: 0 0 14px 14px;
    z-index: 10;
}

.frame-mobile iframe { border-radius: 33px; }

.frame-tablet {
    width: 768px;
    height: 1024px;
    border: 13px solid #0f172a;
    border-radius: 26px;
    background: #000;
    overflow: hidden;
    box-shadow: var(--shadow-xl);
    flex-shrink: 0;
}

.frame-pc iframe,
.frame-mobile iframe,
.frame-tablet iframe {
    width: 100%;
    height: 100%;
    border: 0;
    background: var(--white);
    display: block;
}

.hidden { display: none !important; }

/* ---------- 设置页 ---------- */
.settings-grid {
    display: grid;
    grid-template-columns: 220px 1fr;
    gap: 28px;
}

.settings-nav {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.settings-nav button {
    padding: 10px 14px;
    border: none;
    background: transparent;
    border-radius: var(--radius-sm);
    text-align: left;
    cursor: pointer;
    font-size: 13.5px;
    font-family: inherit;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 10px;
    transition: var(--transition);
    font-weight: 500;
}

.settings-nav button i { font-size: 13px; width: 16px; }

.settings-nav button:hover { background: var(--border-light); color: var(--text); }

.settings-nav button.active {
    background: var(--accent-light);
    color: var(--accent);
    font-weight: 600;
}

/* 模型配置项 */
.model-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    margin-bottom: 10px;
    background: var(--white);
    transition: var(--transition);
}

.model-item:hover { border-color: #cbd5e1; box-shadow: var(--shadow-xs); }

.model-item .model-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: linear-gradient(135deg, var(--accent-light), #dbeafe);
    color: var(--accent);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 17px;
    flex-shrink: 0;
}

.model-item .model-info { flex: 1; min-width: 0; }
.model-item .model-info h4 {
    font-size: 13.5px;
    font-weight: 600;
    margin-bottom: 2px;
    color: var(--primary);
}

.model-item .model-info p {
    font-size: 12px;
    color: var(--text-muted);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ---------- 空状态 ---------- */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-secondary);
}

.empty-state i {
    font-size: 44px;
    color: #cbd5e1;
    margin-bottom: 18px;
    display: block;
}

.empty-state h3 {
    font-size: 15.5px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 8px;
}

.empty-state p {
    font-size: 13.5px;
    margin-bottom: 20px;
    color: var(--text-secondary);
    line-height: 1.6;
}

.empty-state .prompt-buttons {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: center;
    margin-top: 16px;
}

/* ---------- 加载动画 ---------- */
.spinner {
    display: inline-block;
    width: 14px;
    height: 14px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
    vertical-align: middle;
}

.spinner-dark {
    border-color: rgba(37, 99, 235, 0.2);
    border-top-color: var(--accent);
}

@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Toast ---------- */
.toast {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%) translateY(120px);
    background: var(--primary);
    color: #fff;
    padding: 12px 22px;
    border-radius: var(--radius);
    box-shadow: var(--shadow-xl);
    font-size: 13.5px;
    z-index: 2000;
    transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
    display: flex;
    align-items: center;
    gap: 9px;
    max-width: 90vw;
    font-weight: 500;
}

.toast i { font-size: 14px; }

.toast.show { transform: translateX(-50%) translateY(0); }
.toast.success { background: var(--success); }
.toast.error { background: var(--danger); }

/* ---------- 分隔线 ---------- */
.divider {
    height: 1px;
    background: var(--border-light);
    margin: 20px 0;
    border: none;
}

/* ---------- 响应式：移动端 ---------- */
@media (max-width: 900px) {
    .container { padding: 20px 16px; }

    .navbar {
        padding: 0 16px;
        height: 56px;
    }

    .navbar-brand { font-size: 15px; }
    .navbar-brand .brand-icon { width: 28px; height: 28px; font-size: 13px; }

    .navbar-nav { gap: 2px; }

    .nav-link {
        padding: 7px 10px;
        font-size: 12px;
        gap: 5px;
    }

    .nav-link span { display: none; }

    .page-header h1 { font-size: 20px; }
    .page-header h1 i { font-size: 17px; }
    .page-header p { font-size: 12.5px; }

    .project-grid { grid-template-columns: 1fr; gap: 12px; }
    .project-card { padding: 18px; }

    .workspace { grid-template-columns: 1fr; height: calc(100vh - 56px); }

    .sidebar {
        position: fixed;
        left: 0;
        top: 56px;
        bottom: 0;
        width: 280px;
        transform: translateX(-100%);
        transition: transform 0.3s;
        z-index: 200;
        box-shadow: var(--shadow-xl);
    }

    .sidebar.open { transform: translateX(0); }

    .chat-header {
        padding: 12px 16px;
        flex-wrap: wrap;
        gap: 10px;
    }

    .chat-header .actions { gap: 8px; }

    .chat-messages { padding: 16px; }

    .message-bubble { max-width: 88%; font-size: 13px; }

    .chat-input { padding: 12px 16px; }

    .chat-input textarea {
        font-size: 15px; /* 移动端避免缩放 */
    }

    .settings-grid { grid-template-columns: 1fr; gap: 16px; }

    .settings-nav {
        flex-direction: row;
        overflow-x: auto;
        padding-bottom: 4px;
        gap: 6px;
    }

    .settings-nav button {
        white-space: nowrap;
        flex-shrink: 0;
        padding: 8px 14px;
        font-size: 13px;
    }

    .preview-toolbar {
        padding: 10px 16px;
        gap: 8px;
    }

    .device-switcher button {
        padding: 6px 10px;
        font-size: 11.5px;
    }

    .device-switcher button i { font-size: 11px; }

    .preview-stage {
        padding: 16px;
        gap: 16px;
        flex-direction: column;
        align-items: center;
    }

    .frame-pc {
        width: 100%;
        height: 60vh;
        min-height: 400px;
    }

    .frame-mobile {
        width: 320px;
        height: 640px;
        border-width: 9px;
    }

    .frame-mobile::before {
        width: 90px;
        height: 20px;
    }

    .frame-tablet {
        width: 90vw;
        height: 70vh;
    }

    .modal { max-width: calc(100vw - 24px); border-radius: var(--radius-lg); }

    .modal-header { padding: 16px 18px; }
    .modal-body { padding: 18px; }
    .modal-footer { padding: 14px 18px; }

    .form-row { grid-template-columns: 1fr; }

    .toast { bottom: 20px; padding: 11px 18px; font-size: 13px; }
}

@media (max-width: 480px) {
    .navbar { padding: 0 12px; }
    .container { padding: 16px 12px; }

    .page-header h1 { font-size: 18px; }

    .btn { padding: 8px 14px; font-size: 13px; }
    .btn-lg { padding: 10px 18px; font-size: 13.5px; }

    .project-card { padding: 16px; }
    .project-card-icon { width: 40px; height: 40px; font-size: 16px; }

    .chat-header h2 { font-size: 13.5px; }

    .device-switcher { width: 100%; justify-content: space-between; }
    .device-switcher button { flex: 1; justify-content: center; }

    .preview-stage { padding: 12px; }

    .frame-mobile {
        width: 280px;
        height: 560px;
    }
}

/* 平滑滚动 */
html { scroll-behavior: smooth; }

/* 深色模式支持 */
@media (prefers-color-scheme: dark) {
    /* 保持白色主题为主，深色模式可选 */
}

/* 打印时隐藏无关元素 */
@media print {
    .navbar, .chat-input, .preview-toolbar, .btn { display: none !important; }
}
/* ============================================
   AI 思考过程可视化
   ============================================ */
.thinking-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 14px;
    font-size: 13.5px;
    color: var(--text);
}

.thinking-stages {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding-left: 2px;
}

.think-stage {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 5px 0;
    font-size: 13px;
    color: var(--text-muted);
    opacity: 0.5;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.think-stage.active {
    color: var(--text);
    opacity: 1;
    transform: translateX(2px);
}

.think-stage.done {
    color: var(--text-secondary);
    opacity: 1;
}

.think-stage > i {
    width: 14px;
    font-size: 12px;
    text-align: center;
    color: var(--text-muted);
    flex-shrink: 0;
}

.think-stage.active > i {
    color: var(--accent);
}

.think-stage.done > i {
    color: var(--success);
}

.think-stage .think-dot {
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: var(--border);
    flex-shrink: 0;
    transition: all 0.3s;
}

.think-stage.active .think-dot {
    background: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-light);
    animation: pulse 1.4s infinite;
}

.think-stage.done .think-dot {
    background: var(--success);
}

.think-stage .think-text {
    flex: 1;
}

.think-status {
    margin-left: auto;
    display: flex;
    align-items: center;
    font-size: 12px;
    min-width: 16px;
    justify-content: flex-end;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.4); opacity: 0.6; }
}