/* 全局样式 */
:root {
    --primary-color: #4e73df;
    --primary-light: #6f8be8;
    --primary-dark: #3a56b0;
    --secondary-color: #f8f9fc;
    --text-color: #5a5c69;
    --border-color: #e3e6f0;
    --success-color: #1cc88a;
    --warning-color: #f6c23e;
    --danger-color: #e74a3b;
    --box-shadow: 0 .15rem 1.75rem 0 rgba(58,59,69,.15);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', '微软雅黑', sans-serif;
}

body {
    min-height: 100vh;
    display: flex;
    background-color: #f8f9fc;
    color: var(--text-color);
}

a {
    text-decoration: none;
    color: inherit;
}

/* 左右分栏主布局 */
.main-wrapper {
    display: flex;
    width: 100%;
    min-height: 100vh;
    justify-content: center;
    gap: 32px;
    padding: 20px 40px;
}

/* 左侧编辑区域（已迁移为就地编辑，仅保留占位） */
.edit-panel {
    display: none;
}

.edit-panel.legacy-hidden {
    display: none !important;
}

.edit-form {
    margin-top: 20px;
}

/* 表单元素样式 */
.form-group {
    margin-bottom: 20px;
}

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

.form-control {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-size: 14px;
    transition: all 0.3s;
}

.form-control:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(78, 115, 223, 0.25);
    outline: none;
}

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

/* 右侧预览区域 */
.content {
    flex: none;
    width: 100%;
    max-width: 960px;
    padding: 0 0 60px;
    overflow: visible;
}

/* 表单分组标题 */
.form-section-title {
    margin: 30px 0 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border-color);
    color: var(--primary-dark);
    font-size: 18px;
    font-weight: 600;
}

/* 底部按钮 */
.form-section-actions {
    display: flex;
    justify-content: flex-end;
    margin-top: 15px;
}

.form-section-actions .btn {
    flex: 1;
    text-align: center;
    max-height: 40px;
}
/* 角色平台选择区域 */
/* 文件上传区域 */
.file-upload {
    border: 2px dashed var(--border-color);
    padding: 20px;
    text-align: center;
    border-radius: 5px;
    margin-bottom: 10px;
    cursor: pointer;
    transition: all 0.3s;
}

.file-upload:hover {
    border-color: var(--primary-color);
    background-color: rgba(78, 115, 223, 0.05);
}

.file-upload i {
    font-size: 24px;
    color: var(--primary-color);
    margin-bottom: 10px;
}

.upload-preview {
    margin-top: 10px;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.upload-item {
    position: relative;
    width: 80px;
    height: 80px;
    border-radius: 4px;
    overflow: hidden;
    border: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
}

.upload-item img {
    width: 100%;
    height: 60px;
    object-fit: cover;
}

.upload-item .remove-btn {
    position: absolute;
    top: 2px;
    right: 2px;
    background: rgba(255, 255, 255, 0.7);
    border: none;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 10px;
    color: var(--danger-color);
}

/* 文件名显示样式 */
.upload-item .file-name {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    font-size: 9px;
    padding: 2px 4px;
    text-align: center;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    line-height: 1.2;
}

/* 服务项目行 */
.service-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    margin-bottom: 10px;
    background-color: white;
}

.service-item input[type="text"],
.service-item input[type="number"] {
    border: 1px solid transparent;
    background-color: transparent;
    padding: 5px;
}

.service-item input[type="text"]:focus,
.service-item input[type="number"]:focus {
    border-color: var(--border-color);
    background-color: white;
}

.service-item .remove-service {
    color: var(--danger-color);
    background: none;
    border: none;
    cursor: pointer;
}

/* 强化版按钮样式 */
.btn-add {
    background-color: #f8f9fc;
    color: var(--primary-color);
    border: 1px dashed var(--primary-color);
    padding: 8px 15px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    display: inline-flex;
    align-items: center;
    transition: all 0.3s;
}

.btn-add i {
    margin-right: 5px;
}

.btn-add:hover {
    background-color: rgba(78, 115, 223, 0.1);
}

/* 语音输入按钮 */
.voice-input-btn {
    background-color: white;
    border: 1px solid var(--border-color);
    color: var(--primary-color);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s;
    position: absolute;
    right: 10px;
    bottom: 10px;
}

.voice-input-btn:hover {
    background-color: var(--primary-color);
    color: white;
}

.voice-input-container {
    position: relative;
}

/* 响应式设计调整 */
@media (max-width: 1200px) {
    .main-wrapper {
        flex-direction: column;
        padding: 20px;
    }
    
    .content {
        max-height: none;
        padding-bottom: 140px;
    }

    .floating-tools {
        position: fixed;
        top: auto;
        bottom: 16px;
        right: 16px;
        flex-direction: row;
        gap: 8px;
        padding: 10px;
        border-radius: 18px;
        backdrop-filter: blur(6px);
        background-color: rgba(255,255,255,.92);
        box-shadow: 0 8px 24px rgba(58,59,69,.18);
    }

    .tool-button {
        width: auto;
        min-width: 100px;
        padding: 10px 12px;
    }
}

/* 侧边栏样式 */
.sidebar {
    width: 240px;
    min-height: 100vh;
    background: linear-gradient(180deg, var(--primary-color) 10%, var(--primary-dark) 100%);
    color: white;
    transition: all 0.3s;
}

.sidebar-brand {
    height: 70px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 15px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-brand h2 {
    font-size: 20px;
    display: flex;
    align-items: center;
}

.sidebar-brand i {
    font-size: 24px;
    margin-right: 10px;
}

.sidebar-menu {
    padding: 20px 0;
}

.sidebar-menu ul {
    list-style: none;
}

.sidebar-menu li {
    margin-bottom: 5px;
}

.sidebar-menu a {
    display: flex;
    align-items: center;
    padding: 12px 20px;
    color: rgba(255, 255, 255, 0.8);
    transition: all 0.3s;
}

.sidebar-menu a:hover,
.sidebar-menu a.active {
    color: white;
    background-color: rgba(255, 255, 255, 0.1);
    border-left: 4px solid white;
}

.sidebar-menu a.active {
    font-weight: bold;
}

.sidebar-menu i {
    width: 20px;
    margin-right: 10px;
    text-align: center;
}

.sidebar-divider {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    margin: 15px 0;
}

.sidebar-heading {
    padding: 0 20px;
    margin-top: 10px;
    font-size: 12px;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.5);
}

/* 主要内容区域 */
.content {
    flex: 1;
    padding: 20px;
}

.topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border-color);
}

.toggle-sidebar {
    background: none;
    border: none;
    color: var(--text-color);
    font-size: 20px;
    cursor: pointer;
}

.user-profile {
    display: flex;
    align-items: center;
}

.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    margin-right: 10px;
    object-fit: cover;
}

.user-name {
    font-weight: 500;
    color: var(--text-color);
}

.dropdown-toggle {
    background: none;
    border: none;
    color: var(--text-color);
    cursor: pointer;
    margin-left: 5px;
}

/* 页面标题 */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.page-title {
    color: var(--text-color);
    font-weight: bold;
}

.preview-controls {
    display: flex;
    gap: 10px;
}

/* 卡片样式 */
.card {
    background-color: white;
    border-radius: 10px;
    box-shadow: var(--box-shadow);
    margin-bottom: 25px;
    overflow: hidden;
}

/* 预览文档容器 */
.preview-container {
    padding: 30px;
    position: relative;
    min-height: 80vh;
    border-radius: 12px;
}

/* 预览文档页面 */
.preview-document {
    background-color: white;
    width: 210mm;
    margin: 0 auto;
    box-shadow: 0 5px 25px rgba(0, 0, 0, 0.1);
    padding: 30mm 20mm;
    position: relative;
    border-radius: 4px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border: 1px solid #e0e0e0;
}

.preview-document:hover {
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.15);
}

/* 预览文档样式 */
.document-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 40px;
    padding-bottom: 20px;
    border-bottom: 2px solid var(--secondary-color);
}

.company-logo img {
    max-width: 200px;
    height: auto;
}

.document-id {
    text-align: right;
    color: var(--text-color);
    font-size: 14px;
    line-height: 1.5;
}

.document-title {
    text-align: center;
    margin: 40px 0;
    position: relative;
    padding-bottom: 15px;
}

.document-title h1 {
    font-size: 28px;
    color: var(--primary-dark);
    margin-bottom: 10px;
    font-weight: 600;
}

.document-title p {
    font-size: 16px;
    color: var(--text-color);
}

.document-title:after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 3px;
    background: linear-gradient(to right, var(--primary-color), var(--primary-light));
    border-radius: 2px;
}

.document-content {
    margin-bottom: 40px;
}

.document-section {
    margin-bottom: 35px;
    animation: fadeIn 0.5s ease-in-out;
}

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

.document-section h2 {
    font-size: 20px;
    color: var(--primary-color);
    padding-bottom: 10px;
    border-bottom: 2px solid var(--primary-light);
    margin-bottom: 20px;
    display: flex;
    align-items: center;
}

.document-section h2:before {
    content: '';
    display: inline-block;
    width: 5px;
    height: 20px;
    background: linear-gradient(to bottom, var(--primary-color), var(--primary-light));
    margin-right: 10px;
    border-radius: 3px;
}

.client-info {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 20px;
    margin-bottom: 20px;
    background-color: var(--secondary-color);
    padding: 20px;
    border-radius: 8px;
}

.client-info div {
    display: flex;
    flex-direction: column;
}

.client-info label {
    font-weight: bold;
    margin-bottom: 5px;
    color: var(--primary-dark);
}

.module-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 20px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    border-radius: 8px;
    overflow: hidden;
}

.module-table th, .module-table td {
    padding: 15px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.module-table th {
    background-color: var(--primary-dark);
    color: white;
    font-weight: 500;
    text-transform: uppercase;
    font-size: 14px;
}

.module-table tr:nth-child(even) {
    background-color: rgba(78, 115, 223, 0.05);
}

.module-table tr:hover {
    background-color: rgba(78, 115, 223, 0.1);
}

.module-table tr:last-child td {
    border-bottom: none;
}

.module-table td:first-child {
    font-weight: 600;
    color: var(--primary-dark);
}

.price-column {
    text-align: right;
    font-weight: 600;
}

.total-row td {
    padding-top: 20px;
    font-weight: bold;
    background-color: rgba(78, 115, 223, 0.1);
    border-top: 2px solid var(--primary-color);
}

.total-row .price-column {
    color: var(--primary-color);
    font-size: 18px;
}

.service-list {
    margin-bottom: 20px;
    list-style: none;
}

.service-list li {
    margin-bottom: 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 15px;
    background-color: white;
    border-radius: 8px;
    border-left: 4px solid var(--primary-light);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
}

.service-list li:hover {
    transform: translateX(5px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.payment-info {
    background-color: var(--secondary-color);
    padding: 25px;
    border-radius: 8px;
    margin-bottom: 20px;
    border-left: 4px solid var(--primary-color);
}

.payment-title {
    font-weight: 600;
    margin-bottom: 15px;
    color: var(--primary-dark);
    font-size: 16px;
    display: flex;
    align-items: center;
}

.payment-title:before {
    content: '\f3d1';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    margin-right: 10px;
    color: var(--primary-color);
}

.payment-stages {
    padding-left: 30px;
}

.payment-stages li {
    margin-bottom: 10px;
    position: relative;
}

.payment-stages li:before {
    content: '\f058';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    margin-right: 10px;
    color: var(--success-color);
    position: absolute;
    left: -25px;
}

.document-footer {
    margin-top: 60px;
    border-top: 2px solid var(--secondary-color);
    padding-top: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: var(--text-color);
}

.company-contact {
    font-size: 14px;
    line-height: 1.6;
}

/* 公司介绍布局样式 */
.company-intro {
    display: flex;
    align-items: flex-start;
    gap: 30px;
    margin: 20px 0;
}

.company-intro .company-image {
    flex: 0 0 40%;
    min-height: 200px;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    border-radius: 8px;
}

.company-intro .company-intro-text {
    flex: 1;
    padding-left: 20px;
    line-height: 1.8;
    font-size: 16px;
    color: #333;
}

.document-page-number {
    font-size: 12px;
    color: #888;
    background-color: var(--secondary-color);
    padding: 6px 12px;
    border-radius: 15px;
}

/* A4纸分页标记样式 - 仅在屏幕预览时显示 */
.page-break {
    width: 100%;
    border-top: 1px dashed #ccc;
    margin: 20mm 0;
    position: relative;
    display: none; /* 默认不显示 */
}

.preview-document .page-break.preview-only {
    display: block; /* 只在预览模式显示 */
}



/* 按钮样式 */
.btn {
    display: inline-flex;
    align-items: center;
    padding: 10px 20px;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.3s;
    font-weight: 500;
    font-size: 14px;
}

.btn-primary {
    background: linear-gradient(to right, var(--primary-color), var(--primary-light));
    color: white;
    border: none;
    box-shadow: 0 4px 6px rgba(78, 115, 223, 0.2);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 8px rgba(78, 115, 223, 0.3);
}

.btn-secondary {
    background-color: #858796;
    color: white;
    border: none;
}

.btn-secondary:hover {
    background-color: #717384;
}

.btn-outline {
    background: transparent;
    color: var(--primary-color);
    border: 1px solid var(--primary-color);
}

.btn-outline:hover {
    background-color: rgba(78, 115, 223, 0.1);
}

.btn-success {
    background: linear-gradient(to right, var(--success-color), #28dd98);
    color: white;
    border: none;
    box-shadow: 0 4px 6px rgba(28, 200, 138, 0.2);
}

.btn-success:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 8px rgba(28, 200, 138, 0.3);
}

.btn i {
    margin-right: 8px;
}

.inline-editable {
    border-bottom: 1px dashed rgba(111,118,131,0.5);
    cursor: text;
    transition: background-color .2s ease, border-color .2s ease;
}

.inline-editable:focus {
    outline: none;
    border-bottom-color: var(--primary-color);
    background-color: rgba(78,115,223,.08);
}

.inline-editable[data-placeholder]:empty:before {
    content: attr(data-placeholder);
    color: #b5b5c3;
}

.inline-add-btn {
    margin-top: 10px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 20px;
    border: 1px dashed var(--primary-color);
    color: var(--primary-color);
    font-size: 13px;
    cursor: pointer;
    background-color: rgba(78,115,223,.05);
    transition: all .2s ease;
}

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

.inline-add-btn.secondary {
    border-style: solid;
    border-color: var(--primary-color);
    background-color: transparent;
    color: var(--primary-color);
}

.inline-add-btn.secondary:hover {
    background-color: rgba(78,115,223,.08);
    color: var(--primary-dark);
}

.inline-remove-btn {
    border: none;
    background: transparent;
    color: var(--danger-color);
    cursor: pointer;
    margin-left: 6px;
    font-size: 14px;
}

.interactive-image {
    position: relative;
    cursor: pointer;
}

.interactive-image:after {
    content: attr(data-hint);
    position: absolute;
    bottom: 8px;
    right: 8px;
    background: rgba(0,0,0,0.5);
    color: #fff;
    font-size: 12px;
    padding: 4px 8px;
    border-radius: 12px;
    opacity: 0;
    transition: opacity .2s ease;
}

.interactive-image:hover:after {
    opacity: 1;
}
.roles-empty-state {
    border: 2px dashed var(--border-color);
    border-radius: 12px;
    padding: 40px 20px;
    text-align: center;
    color: var(--text-color);
    background-color: #fff;
    margin-bottom: 20px;
}

.roles-empty-state i {
    font-size: 36px;
    color: var(--primary-color);
    margin-bottom: 10px;
}

.roles-empty-state h3 {
    margin-bottom: 10px;
    font-size: 20px;
}

.roles-empty-state p {
    margin-bottom: 16px;
    color: #6c757d;
}

.roles-empty-actions {
    display: flex;
    justify-content: center;
    gap: 12px;
    flex-wrap: wrap;
}

.role-actions-panel {
    display: flex;
    gap: 12px;
    margin: 10px 0 30px;
    flex-wrap: wrap;
}

.role-actions-panel .inline-add-btn {
    margin-top: 0;
}

.role-designer-modal {
    width: 100%;
    background: transparent;
}

.role-designer-modal__body {
    background: #fff;
    border-radius: 16px;
    padding: 18px;
    box-shadow: 0 12px 34px rgba(58,59,69,.16);
    border: 1px solid rgba(78,115,223,0.12);
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.role-designer-modal__note {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border-radius: 10px;
    background: rgba(78,115,223,0.08);
    color: var(--primary-dark);
    font-size: 12px;
    line-height: 1.4;
}

.role-designer-modal__note i {
    color: var(--primary-color);
}

.role-designer-modal__grid {
    display: grid;
    grid-template-columns: repeat(auto-fit,minmax(220px,1fr));
    gap: 12px;
}

.role-designer-modal .modal-section {
    background: #fdfdff;
    border-radius: 12px;
    padding: 12px;
    border: 1px solid rgba(227,230,240,0.8);
    margin-bottom: 0;
}

.role-designer-modal .modal-section--name {
    margin-bottom: 2px;
}

.role-designer-modal .field-label {
    font-weight: 600;
    color: var(--primary-dark);
    display: block;
    margin-bottom: 6px;
    font-size: 13px;
}

.role-designer-modal .field-input {
    width: 100%;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 8px 11px;
    font-size: 13px;
    transition: border-color .2s ease, box-shadow .2s ease;
    background: #fff;
}

.role-designer-modal .field-input:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 1px rgba(78,115,223,0.18);
    outline: none;
}

.role-designer-modal__section-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 8px;
    gap: 8px;
}

.role-designer-modal__section-head .section-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--primary-dark);
}

.role-designer-modal__section-head p {
    margin-top: 2px;
    color: #7a7f9a;
    font-size: 12px;
    line-height: 1.3;
}

.role-designer-modal__hint {
    font-size: 11px;
    color: var(--primary-dark);
    background: rgba(78,115,223,0.12);
    padding: 3px 8px;
    border-radius: 999px;
    white-space: nowrap;
}

.role-designer-modal .option-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit,minmax(130px,1fr));
    gap: 8px;
    margin-bottom: 8px;
}

.role-designer-modal .checkbox-card {
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 8px 10px;
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    background: #fff;
    transition: border-color .2s ease, box-shadow .2s ease, background .2s ease;
    font-weight: 500;
    color: var(--text-color);
    box-shadow: 0 4px 10px rgba(90,92,105,.06);
    min-height: 34px;
}

.role-designer-modal .checkbox-card span {
    flex: 1;
    font-size: 12px;
}

.role-designer-modal .checkbox-card:hover {
    border-color: var(--primary-color);
    box-shadow: 0 8px 16px rgba(78,115,223,0.12);
}

.role-designer-modal .checkbox-card.is-checked {
    border-color: var(--primary-color);
    box-shadow: 0 10px 20px rgba(78,115,223,0.18);
    background: linear-gradient(135deg, rgba(78,115,223,0.08), rgba(255,255,255,1));
}

.role-designer-modal .checkbox-card input {
    width: 16px;
    height: 16px;
    accent-color: var(--primary-color);
}

.role-designer-modal .checkbox-card.is-checked span {
    color: var(--primary-dark);
    font-weight: 600;
}

@media (max-width: 640px) {
    .role-designer-modal__grid {
        grid-template-columns: 1fr;
    }
}

.form-actions {
    display: flex;
    justify-content: space-between;
    margin-top: 30px;
}

/* 侧边浮动工具栏 */
.floating-tools {
    position: fixed;
    right: 24px;
    top: 120px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    z-index: 150;
}

.tool-button {
    width: 144px;
    padding: 10px 14px;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    background-color: #fff;
    color: var(--text-color);
    font-size: 13px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    box-shadow: 0 8px 18px rgba(58,59,69,.15);
    transition: transform .2s ease, box-shadow .2s ease, background-color .2s ease;
}

.tool-button i {
    font-size: 16px;
    color: var(--primary-color);
}

.tool-button span {
    flex: 1;
    text-align: left;
}

.tool-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 22px rgba(58,59,69,.2);
    background-color: var(--primary-color);
    color: #fff;
}

.tool-button:hover i {
    color: #fff;
}

.tool-button.vip {
    background: linear-gradient(135deg, #f9f3d8, #f1c40f);
    border-color: #f1c40f;
    color: #8a6d00;
}

.tool-button.vip i {
    color: #8a6d00;
}


/* 技术栈展示样式 */
.tech-stack-display {
    display: flex;
    gap: 30px;
    margin-top: 15px;
}

.tech-stack-section {
    flex: 1;
    background-color: #f8f9fc;
    padding: 20px;
    border-radius: 8px;
    border: 1px solid #e3e6f0;
    transition: all 0.3s ease;
}

.tech-stack-section:hover {
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.08);
    transform: translateY(-2px);
}

.tech-stack-section h3 {
    color: var(--primary-color);
    margin-bottom: 15px;
    font-size: 16px;
    font-weight: 600;
    display: flex;
    align-items: center;
}

.tech-stack-section h3:before {
    content: '\f7d9';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    margin-right: 10px;
    color: var(--primary-color);
}

.tech-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px;
    background-color: white;
    border-radius: 8px;
    font-size: 14px;
    color: var(--text-color);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
}

.tech-item:hover {
    transform: translateX(5px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.tech-item i {
    font-size: 18px;
    color: var(--primary-color);
}

/* 角色和适用平台样式 */
.roles-summary {
    margin-bottom: 30px;
    background-color: var(--secondary-color);
    padding: 25px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    transition: all 0.3s ease;
}

.roles-summary:hover {
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.08);
}

.roles-summary h3 {
    color: var(--primary-color);
    margin-bottom: 15px;
    font-size: 16px;
    font-weight: 600;
    display: flex;
    align-items: center;
}

.roles-summary h3:before {
    content: '\f0c0';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    margin-right: 10px;
    color: var(--primary-color);
}

.roles-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 15px;
}

.role-card {
    background-color: white;
    padding: 20px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    transition: all 0.3s ease;
}

.role-meta-actions {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 8px;
}

.role-meta-actions .inline-add-btn {
    margin-top: 0;
    padding: 4px 10px;
    font-size: 12px;
}

.role-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.08);
}

.role-title {
    font-weight: 600;
    margin-bottom: 12px;
    color: var(--primary-dark);
    font-size: 16px;
    display: flex;
    align-items: center;
}

.role-title:before {
    content: '\f007';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    margin-right: 10px;
    color: var(--primary-color);
    font-size: 14px;
}

.platforms-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.platform-tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    background-color: rgba(78, 115, 223, 0.1);
    color: var(--primary-color);
    border-radius: 20px;
    font-size: 12px;
    transition: all 0.2s ease;
}

.platform-tag:hover {
    background-color: var(--primary-color);
    color: white;
}

.platform-tag i {
    font-size: 14px;
}

/* 加强版表格样式 */
.highlight-row td {
    background-color: rgba(231, 74, 59, 0.08);
    color: var(--danger-color);
    font-weight: 500;
}

/* 收费项增强样式 */
.fee-label {
    display: flex;
    align-items: center;
    gap: 10px;
}

.fee-label i {
    color: var(--primary-color);
    font-size: 16px;
}

/* 合作流程步骤美化 */
.process-steps {
    counter-reset: step-counter;
    margin-top: 25px;
}

.process-step {
    position: relative;
    margin-bottom: 20px;
    padding-left: 50px;
    min-height: 40px;
    display: flex;
    align-items: center;
    transition: all 0.3s ease;
}

.process-step:hover {
    transform: translateX(5px);
}

.process-step:before {
    counter-increment: step-counter;
    content: counter(step-counter);
    position: absolute;
    left: 0;
    width: 36px;
    height: 36px;
    background: linear-gradient(to right, var(--primary-color), var(--primary-light));
    color: white;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 16px;
    font-weight: bold;
    box-shadow: 0 3px 8px rgba(78, 115, 223, 0.2);
}

.process-step-title {
    font-weight: 600;
    color: var(--primary-dark);
}

/* 响应式设计调整 */
@media (max-width: 992px) {
    .sidebar {
        width: 70px;
        overflow: hidden;
    }

    .sidebar-brand h2 span,
    .sidebar-menu a span {
        display: none;
    }

    .sidebar-brand i {
        margin-right: 0;
    }

    .sidebar-menu a {
        justify-content: center;
        padding: 12px;
    }

    .sidebar-menu i {
        margin-right: 0;
        font-size: 18px;
    }

    .sidebar-heading,
    .sidebar-divider {
        display: none;
    }
}

@media (max-width: 768px) {
    .preview-document {
        width: 100%;
        padding: 16px;
    }

    .floating-tools {
        right: 8px;
        left: 8px;
        bottom: 12px;
        width: auto;
        flex-wrap: wrap;
        justify-content: center;
    }

    .tool-button {
        flex: 1 1 calc(50% - 10px);
        min-width: 140px;
    }

    .form-actions {
        flex-direction: column;
        gap: 10px;
    }

    .form-actions .btn {
        width: 100%;
    }

    .tech-stack-display,
    .roles-grid {
        grid-template-columns: 1fr;
    }

    .client-info {
        grid-template-columns: 1fr;
        gap: 15px;
    }
}

.file-types {
    font-size: 12px;
    color: #888;
    margin-top: 5px;
}

.upload-item {
    position: relative;
    width: 80px;
    height: 80px;
    border-radius: 4px;
    overflow: hidden;
    border: 1px solid var(--border-color);
}

.upload-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* 预览顶部操作 */
.preview-actions .btn {
    font-size: 14px !important;
}

.upload-item .remove-btn {
    position: absolute;
    top: 2px;
    right: 2px;
    background: rgba(255, 255, 255, 0.7);
    border: none;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 10px;
    color: var(--danger-color);
}

/* 文件预览样式 */
.file-preview {
    width: 100%;
    height: 60px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background-color: #f8f9fc;
    padding: 5px;
}

.file-preview i {
    font-size: 20px;
    color: var(--primary-color);
    margin-bottom: 2px;
}

.file-preview span {
    font-size: 8px;
    text-align: center;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    width: 100%;
    line-height: 1.1;
}

/* 生成功能清单按钮样式 */
#generate-features-btn {
    /* margin-bottom: 15px; */
    padding: 8px 16px;
    background: linear-gradient(to right, var(--primary-color), var(--primary-light));
    font-weight: 500;
    transition: all 0.3s ease;
}

#generate-features-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(78, 115, 223, 0.25);
}

#generate-features-btn i {
    margin-right: 8px;
}

/* 效果图展示样式 */
.mockup-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 15px;
    margin-top: 20px;
}

.mockup-upload-inline {
    margin-bottom: 15px;
}

.mockup-upload-inline .file-upload {
    margin-bottom: 8px;
}

.mockup-upload-inline .upload-count {
    margin-top: 4px;
    text-align: right;
}

.mockup-item {
    position: relative;
    width: 100%;
    height: 100%;
    border-radius: 5px;
    overflow: hidden;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.mockup-item:hover {
    transform: scale(1.03);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.15);
}

.mockup-item img {
    width: 100%;
    height: 100%;
    max-height: 450px;
    object-fit: cover;
}

.mockup-placeholder {
    grid-column: 1 / -1;
    text-align: center;
    color: #aaa;
    font-style: italic;
    padding: 30px;
    background-color: #f8f9fc;
    border-radius: 5px;
    border: 1px dashed #ddd;
}

.upload-count {
    font-size: 12px;
    color: #777;
    margin-top: 5px;
    text-align: right;
}

/* 效果图预览区样式 */
#mockup-images-preview {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 10px;
}

#mockup-images-preview .upload-item {
    width: 100px;
    height: 80px;
}

.summary-discount-editor {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 6px;
}

.summary-discount-editor .currency-label {
    color: var(--danger-color);
    font-weight: 600;
}

.summary-discount-input {
    max-width: 180px;
}

.tech-stack-editor {
    margin-bottom: 15px;
    padding: 12px;
    background: #f8f9fc;
    border: 1px solid var(--border-color);
    border-radius: 6px;
}

/* 全屏预览样式 */
.fullscreen-preview {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.fullscreen-preview img {
    max-width: 90%;
    max-height: 90%;
    object-fit: contain;
}

.fullscreen-close {
    position: absolute;
    top: 20px;
    right: 20px;
    color: white;
    font-size: 30px;
    cursor: pointer;
    background: none;
    border: none;
}

/* 输入组样式 */
.input-group {
    display: flex;
    align-items: center;
}

.input-group-text {
    padding: 10px 12px;
    border: 1px solid var(--border-color);
    border-radius: 4px 0 0 4px;
    background-color: #f8f9fc;
    color: var(--text-color);
}

.input-group .form-control {
    border-radius: 0 4px 4px 0;
}

.form-text {
    font-size: 12px;
    margin-top: 5px;
    color: #888;
}

/* 添加CSS样式，美化需求描述显示 */
.requirement-box {
    margin: 20px 0 30px;
    background-color: #f8f9fc;
    border-radius: 8px;
    border-left: 5px solid var(--primary-color);
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.05);
    overflow: hidden;
    transition: all 0.3s ease;
}

.requirement-box:hover {
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}

.requirement-header {
    background-color: rgba(78, 115, 223, 0.1);
    padding: 12px 20px;
    border-bottom: 1px solid rgba(78, 115, 223, 0.2);
    display: flex;
    align-items: center;
    font-weight: 600;
    color: var(--primary-dark);
}

.requirement-header i {
    margin-right: 10px;
    color: var(--primary-color);
    font-size: 18px;
}

.requirement-content {
    padding: 28px 32px;
    line-height: 1.7;
    color: #444;
    font-size: 15px;
    border-radius: 0 0 8px 0;
    background-image: linear-gradient(to right, rgba(78, 115, 223, 0.03), transparent);
}

/* 添加百分比标签样式 */
.payment-percent {
    display: inline-block;
    background-color: var(--primary-color);
    color: white;
    font-weight: bold;
    padding: 3px 8px;
    border-radius: 15px;
    margin-left: 8px;
    min-width: 40px;
    text-align: center;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

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

.payment-stages li {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
    position: relative;
}

.action-column {
    width: 60px;
    text-align: center;
}

.row-action-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 5px;
    font-size: 14px;
    color: #888;
    transition: all 0.2s;
}

.delete-row:hover {
    color: var(--danger-color);
}

.table-actions {
    margin: 15px 0;
    display: flex;
    justify-content: flex-end;
}

[contenteditable] {
    outline: none;
    padding: 3px;
    transition: all 0.2s;
}

[contenteditable]:hover {
    background-color: rgba(78, 115, 223, 0.08);
}

[contenteditable]:focus {
    background-color: rgba(78, 115, 223, 0.15);
    box-shadow: inset 0 0 0 2px rgba(78, 115, 223, 0.3);
}

#add-feature-row {
    margin-bottom: 10px;
}

/* 页面预览专用样式 */
.preview-only {
    display: block; /* 在屏幕预览模式下显示 */
}


/* 保存按钮禁用状态样式 */
.saving-disabled {
    pointer-events: none !important;
    opacity: 0.6 !important;
    cursor: not-allowed !important;
    background-color: #ccc !important;
    border-color: #ccc !important;
    color: #666 !important;
}

.saving-disabled:hover {
    background-color: #ccc !important;
    border-color: #ccc !important;
    transform: none !important;
    box-shadow: none !important;
}

/* AI对话框样式 */
.ai-chat-container {
    margin-top: 20px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background-color: #f8f9fc;
    box-shadow: var(--box-shadow);
    overflow: hidden;
    transition: all 0.3s ease;
}

.ai-chat-container.minimized {
    height: auto;
}

.ai-chat-container.minimized .chat-body {
    display: none;
}

 .mode-create .ai-chat-container,
 .mode-edit .ai-chat-container {
     position: fixed;
     left: 24px;
     bottom: 24px;
     width: 320px;
     max-height: calc(100vh - 80px);
     z-index: 1000;
     border-radius: 12px;
     box-shadow: 0 15px 40px rgba(15,23,42,0.2);
 }

 .mode-create .ai-chat-container.minimized,
 .mode-edit .ai-chat-container.minimized {
     max-height: none;
 }

 .mode-view .ai-chat-container {
     display: none;
 }

@media (max-width: 768px) {
    .mode-create .ai-chat-container,
    .mode-edit .ai-chat-container {
        left: 12px;
        bottom: 12px;
        width: calc(100% - 24px);
    }
}

.chat-header {
    background-color: var(--primary-color);
    color: white;
    padding: 12px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.chat-header h4 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
}

.chat-header h4 i {
    margin-right: 8px;
}

.btn-minimize {
    background: none;
    border: none;
    color: white;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
    transition: background-color 0.2s;
}

.btn-minimize:hover {
    background-color: rgba(255, 255, 255, 0.2);
}

.chat-body {
    background-color: white;
    display: flex;
    flex-direction: column;
    height: 500px; /* 调整为 500px 以获得更大的对话可视区域 */
}

.chat-messages {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    background-color: #fafbfc;
    min-height: 200px;
}

.chat-message {
    margin-bottom: 15px;
    padding: 12px 16px;
    border-radius: 8px;
    animation: fadeIn 0.3s ease;
}

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

.chat-message.system {
    background-color: #e3f2fd;
    color: #1565c0;
    border-left: 4px solid #2196f3;
}

.chat-message.user {
    background-color: #e8f5e9;
    color: #2e7d32;
    margin-left: 20%;
    text-align: right;
}

.chat-message.ai {
    background-color: #f3e5f5;
    color: #6a1b9a;
    margin-right: 20%;
}

.chat-message i {
    margin-right: 8px;
}

/* 角色选择器样式 */
.role-selector-container {
    padding: 15px 20px;
    border-top: 1px solid var(--border-color);
    background-color: #f8f9fc;
}

.role-selector-label {
    font-size: 13px;
    color: #666;
    margin-bottom: 10px;
    font-weight: 500;
}

.role-selector-label i {
    color: var(--primary-color);
    margin-right: 5px;
}

.role-selector-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.role-tag {
    display: inline-flex;
    align-items: center;
    padding: 6px 14px;
    background-color: white;
    border: 1px solid #ddd;
    border-radius: 20px;
    font-size: 13px;
    color: #333;
    cursor: pointer;
    transition: all 0.2s ease;
    user-select: none;
}

.role-tag:hover {
    background-color: #f0f4f8;
    border-color: var(--primary-color);
}

.role-tag.active {
    background-color: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.role-tag.all-roles {
    background-color: #f0f4f8;
    border-color: #999;
    font-weight: 500;
}

.role-tag.all-roles.active {
    background-color: #666;
    border-color: #666;
}

.role-tag i {
    margin-right: 5px;
    font-size: 12px;
}

/* 角色选择器高亮闪烁效果 */
@keyframes highlight-flash {
    0%, 100% {
        background-color: #f8f9fc;
    }
    50% {
        background-color: #fff3cd;
        box-shadow: 0 0 10px rgba(255, 193, 7, 0.5);
    }
}

.role-selector-container.highlight-flash {
    animation: highlight-flash 1s ease-in-out 2;
}

/* 功能生成进度条样式 */
.generation-progress-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    z-index: 9999;
    justify-content: center;
    align-items: center;
}

.generation-progress-container {
    background: white;
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    max-width: 500px;
    width: 90%;
    text-align: center;
}

.generation-progress-title {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 20px;
    color: #333;
}

.generation-progress-bar {
    width: 100%;
    height: 8px;
    background: #f0f0f0;
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 15px;
}

.generation-progress-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #4CAF50 0%, #45a049 100%);
    width: 0%;
    transition: width 0.3s ease;
    border-radius: 4px;
}

.generation-progress-text {
    font-size: 14px;
    color: #666;
    margin-bottom: 10px;
}

.generation-progress-timer {
    font-size: 13px;
    color: #999;
}

.generation-progress-roles {
    margin-top: 15px;
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 8px;
}

.generation-role-status {
    padding: 4px 12px;
    border-radius: 15px;
    font-size: 12px;
    background: #f5f5f5;
    color: #666;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.generation-role-status.processing {
    background: #e3f2fd;
    color: #1976d2;
}

.generation-role-status.completed {
    background: #e8f5e9;
    color: #4caf50;
}

.generation-role-status.failed {
    background: #ffebee;
    color: #f44336;
}

.generation-role-status i {
    font-size: 10px;
}

.chat-input-container {
    padding: 15px 20px;
    border-top: 1px solid var(--border-color);
    background-color: white;
}

.chat-input {
    width: 100%;
    padding: 10px 15px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    resize: vertical;
    font-size: 14px;
    min-height: 60px;
    max-height: 120px;
    transition: border-color 0.2s;
}

.chat-input:focus {
    outline: none;
    border-color: var(--primary-color);
}

.chat-actions {
    margin-top: 10px;
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

.chat-actions .btn {
    padding: 8px 16px;
    font-size: 14px;
}

.chat-actions .btn i {
    margin-right: 6px;
}

/* 加载动画 */
.chat-message.loading {
    background-color: #f5f5f5;
    display: flex;
    align-items: center;
}

.typing-indicator {
    display: flex;
    gap: 4px;
}

.typing-indicator span {
    width: 8px;
    height: 8px;
    background-color: #999;
    border-radius: 50%;
    animation: typing 1.4s infinite;
}

.typing-indicator span:nth-child(2) {
    animation-delay: 0.2s;
}

.typing-indicator span:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes typing {
    0%, 60%, 100% {
        transform: translateY(0);
    }
    30% {
        transform: translateY(-10px);
    }
}

/* AI优化按钮样式 */
#optimize-features-btn {
    background-color: #28a745;
    border-color: #28a745;
    color: white;
    transition: all 0.3s ease;
}

#optimize-features-btn:hover {
    background-color: #218838;
    border-color: #1e7e34;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(40, 167, 69, 0.3);
}

#optimize-features-btn i {
    margin-right: 8px;
    animation: sparkle 2s infinite;
}

@keyframes sparkle {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.6;
        transform: rotate(180deg);
    }
}


    /* 模块组删除按钮样式 */
    .module-group-header {
        position: relative;
    }
    
    .module-group-header .module-delete-btn {
        position: absolute;
        right: 10px;
        top: 50%;
        transform: translateY(-50%);
        background: #dc3545;
        border: none;
        color: white;
        padding: 2px 6px;
        border-radius: 3px;
        font-size: 12px;
        cursor: pointer;
        opacity: 0.7;
        transition: all 0.3s ease;
    }
    
    .module-group-header:hover .module-delete-btn {
        opacity: 1;
    }
    
    .module-group-header .module-delete-btn:hover {
        background: #c82333;
        transform: translateY(-50%) scale(1.05);
    }
    
    /* 在查看模式下隐藏模块删除按钮 */
    .mode-view .module-delete-btn {
        display: none !important;
    }

    /* PDF导出推荐标志样式 */
    .tool-button.recommended {
        position: relative;
        background: linear-gradient(135deg, #4e73df, #6f8be8);
        border: 2px solid #4e73df;
        animation: pulse-glow 2s infinite;
    }
    
    .tool-button.recommended:hover {
        background: linear-gradient(135deg, #3a56b0, #4e73df);
        transform: translateY(-2px);
        box-shadow: 0 4px 15px rgba(78, 115, 223, 0.4);
    }
    
    .recommended-badge {
        position: absolute;
        top: -8px;
        right: -8px;
        background: #e74a3b;
        color: white;
        font-size: 10px;
        padding: 2px 6px;
        border-radius: 10px;
        font-weight: bold;
        white-space: nowrap;
        z-index: 10;
        animation: badge-bounce 3s infinite;
    }
    
    /* 推荐按钮发光动画 */
    @keyframes pulse-glow {
        0%, 100% {
            box-shadow: 0 0 5px rgba(78, 115, 223, 0.3);
        }
        50% {
            box-shadow: 0 0 20px rgba(78, 115, 223, 0.6);
        }
    }
    
    /* 推荐标志跳动动画 */
    @keyframes badge-bounce {
        0%, 80%, 100% {
            transform: scale(1);
        }
        40% {
            transform: scale(1.1);
        }
    }
}
