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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    margin: 0;
    padding: 0;
}

.container {
    width: 100%;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    padding-top: 70px;
}

/* ==================== 固定横幅样式（现代化设计） ==================== */
.sticky-banner {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    padding: 12px 40px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    border-bottom: 1px solid rgba(255, 255, 255, 0.3);
}

.banner-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 100%;
}

/* 左侧：Logo 和标签 */
.banner-left {
    display: flex;
    align-items: center;
    gap: 15px;
}

.logo-text {
    font-size: 28px;
    font-weight: 800;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 50%, #f093fb 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -1px;
    margin: 0;
}

.tag-badge {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.15) 0%, rgba(118, 75, 162, 0.15) 100%);
    color: #667eea;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    border: 1px solid rgba(102, 126, 234, 0.3);
    backdrop-filter: blur(5px);
}

/* 右侧：操作按钮 */
.banner-right {
    display: flex;
    align-items: center;
    gap: 12px;
    position: relative;
}

/* 文档按钮样式 - 改为紫色主题与页面一致 */
.doc-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.doc-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

.doc-btn:active {
    transform: translateY(0);
}

/* 文档按钮悬停提示框 */
.doc-btn-tooltip {
    position: absolute;
    top: calc(100% + 10px);
    right: 80px;
    width: 320px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    padding: 16px;
    z-index: 2000;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    border: 1px solid rgba(102, 126, 234, 0.2);
}

.doc-btn-tooltip::before {
    content: '';
    position: absolute;
    top: -8px;
    right: 60px;
    width: 0;
    height: 0;
    border-left: 8px solid transparent;
    border-right: 8px solid transparent;
    border-bottom: 8px solid white;
}

.doc-btn:hover + .doc-btn-tooltip,
.doc-btn-tooltip:hover {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.tooltip-title {
    font-size: 14px;
    font-weight: 700;
    color: #667eea;
    margin-bottom: 10px;
}

.tooltip-subtitle {
    font-size: 13px;
    font-weight: 600;
    color: #444;
    margin-bottom: 10px;
}

.tooltip-divider {
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(102, 126, 234, 0.3), transparent);
    margin: 12px 0;
}

.tooltip-content p {
    font-size: 13px;
    color: #555;
    margin-bottom: 10px;
    line-height: 1.5;
}

.tooltip-content p:last-child {
    margin-bottom: 0;
}

.tooltip-content strong {
    color: #333;
    font-weight: 600;
}

/* 配置按钮样式 */
.toggle-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.toggle-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

.toggle-btn:active {
    transform: translateY(0);
}

.btn-icon {
    font-size: 16px;
}

.btn-text {
    font-weight: 600;
}

/* 保留原有 header 类以兼容其他可能的使用 */
.header {
    background: rgba(255, 255, 255, 0.95);
    padding: 15px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    z-index: 100;
    flex-shrink: 0;
}

.header h1 {
    font-size: 24px;
    color: #333;
}

.models-grid {
    flex: 1;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    padding: 10px;
    overflow: auto;
}

.model-frame {
    background: white;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    display: flex;
    flex-direction: column;
    min-width: 400px;
    min-height: 400px;
    cursor: grab;
    transition: transform 0.2s, box-shadow 0.2s;
    position: relative;
}

.model-frame.dragging {
    opacity: 0.5;
    cursor: grabbing;
    z-index: 1000;
}

.model-frame.drag-over {
    border: 3px dashed #667eea;
    transform: scale(1.02);
}

.model-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 8px 15px;
    font-size: 14px;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.model-name {
    text-shadow: 
        -1px -1px 0 #000,  
         1px -1px 0 #000,
        -1px  1px 0 #000,
         1px  1px 0 #000;
}

.model-drag-handle {
    cursor: grab;
    font-size: 16px;
    opacity: 0.7;
    user-select: none;
}

.model-drag-handle:hover {
    opacity: 1;
}

.model-iframe {
    flex: 1;
    border: none;
    width: 100%;
    height: 600px;
    min-height: 400px;
}

/* ==================== 配置面板样式 ==================== */
.config-panel {
    position: fixed;
    top: 80px;
    left: 30px;
    width: 380px;
    background: rgba(255, 255, 255, 0.98);
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    z-index: 1000;
    overflow: hidden;
    display: none;
}

.config-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 12px 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.config-title {
    font-size: 16px;
    font-weight: 600;
}

.config-content {
    padding: 20px;
    max-height: 500px;
    overflow-y: auto;
}

.model-list {
    margin-bottom: 20px;
}

.model-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px;
    background: #f8f9fa;
    border-radius: 8px;
    margin-bottom: 10px;
    cursor: grab;
    transition: transform 0.2s, box-shadow 0.2s;
    border: 2px solid transparent;
}

.model-item:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.model-item.dragging {
    opacity: 0.5;
    cursor: grabbing;
}

.model-item.drag-over {
    border: 2px dashed #667eea;
    transform: scale(1.02);
    background: #e3f2fd;
}

.model-item-info {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
}

.model-item-color {
    width: 20px;
    height: 20px;
    border-radius: 4px;
    border: 2px solid rgba(0, 0, 0, 0.1);
    flex-shrink: 0;
}

.model-item-name {
    font-weight: 600;
    color: #333;
}

.model-item-drag-handle {
    color: #999;
    cursor: grab;
    padding: 0 8px;
    user-select: none;
}

.model-item-drag-handle:hover {
    color: #667eea;
}

.model-item-controls {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
}

.toggle-visibility-btn,
.remove-btn {
    width: 32px;
    height: 32px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 16px;
    transition: all 0.2s;
}

.toggle-visibility-btn {
    background: #e3f2fd;
}

.toggle-visibility-btn:hover {
    background: #90caf9;
}

.remove-btn {
    background: #ffebee;
}

.remove-btn:hover {
    background: #ef9a9a;
}

.add-model-section {
    border-top: 2px solid #e0e0e0;
    padding-top: 20px;
}

.add-model-section h3 {
    font-size: 16px;
    color: #333;
    margin-bottom: 15px;
}

.form-group {
    margin-bottom: 12px;
}

.form-group input[type="text"],
.form-group input[type="url"] {
    width: 100%;
    padding: 10px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 14px;
    transition: border-color 0.2s;
}

.form-group input[type="text"]:focus,
.form-group input[type="url"]:focus {
    outline: none;
    border-color: #667eea;
}

.form-group input[type="color"] {
    width: 50px;
    height: 40px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    cursor: pointer;
    vertical-align: middle;
}

.form-group label {
    margin-left: 10px;
    color: #666;
    font-size: 14px;
}

.add-btn {
    width: 100%;
    padding: 12px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    margin-top: 10px;
}

.add-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

/* 配置操作按钮 */
.config-actions {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 2px solid #e0e0e0;
}

.reset-config-btn {
    width: 100%;
    padding: 12px;
    background: linear-gradient(135deg, #f44336 0%, #e91e63 100%);
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.2s;
}

.reset-config-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(244, 67, 54, 0.4);
}

/* ==================== 文档编辑器面板样式 ==================== */
.doc-panel {
    position: fixed;
    top: 80px;
    right: 30px;
    width: 900px;
    height: 600px;
    background: rgba(255, 255, 255, 0.98);
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    z-index: 1000;
    overflow: hidden;
    display: none;
    flex-direction: column;
}

.doc-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 12px 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: move;
}

.doc-header-left {
    display: flex;
    align-items: center;
}

.doc-header-right {
    display: flex;
    align-items: center;
    gap: 10px;
}

.doc-title {
    font-size: 16px;
    font-weight: 600;
}

.download-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    background: rgba(255, 255, 255, 0.25);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.4);
    border-radius: 8px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    transition: all 0.3s ease;
}

.download-btn:hover {
    background: rgba(255, 255, 255, 0.35);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.control-btn {
    width: 32px;
    height: 32px;
    background: rgba(255, 255, 255, 0.2);
    border: none;
    border-radius: 6px;
    color: white;
    font-size: 20px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.control-btn:hover {
    background: rgba(255, 255, 255, 0.3);
}

.doc-content {
    flex: 1;
    overflow: hidden;
    padding: 15px;
}

.doc-editor-container {
    display: flex;
    height: 100%;
    gap: 15px;
}

.doc-input-wrapper {
    position: relative;
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 300px;
}

.doc-label {
    font-size: 13px;
    font-weight: 600;
    color: #666;
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.doc-input {
    flex: 1;
    width: 100%;
    padding: 15px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 14px;
    line-height: 1.6;
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    resize: none;
    outline: none;
    transition: border-color 0.2s;
    overflow-y: auto;
}

.doc-input:focus {
    border-color: #667eea;
}

.resize-handle {
    position: absolute;
    right: -8px;
    top: 30px;
    bottom: 0;
    width: 16px;
    cursor: col-resize;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
}

.resize-handle::before {
    content: '';
    width: 4px;
    height: 40px;
    background: linear-gradient(180deg, #ddd 0%, #bbb 50%, #ddd 100%);
    border-radius: 2px;
    transition: background 0.2s;
}

.resize-handle:hover::before {
    background: linear-gradient(180deg, #667eea 0%, #764ba2 100%);
}

.doc-preview-wrapper {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 300px;
    overflow: hidden;
}

.doc-preview {
    flex: 1;
    padding: 20px;
    background: #fafafa;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    overflow-y: auto;
    font-size: 14px;
    line-height: 1.8;
}

.doc-preview h1,
.doc-preview h2,
.doc-preview h3,
.doc-preview h4,
.doc-preview h5,
.doc-preview h6 {
    margin-top: 24px;
    margin-bottom: 16px;
    font-weight: 600;
    line-height: 1.25;
    color: #333;
}

.doc-preview h1 {
    font-size: 2em;
    border-bottom: 2px solid #e0e0e0;
    padding-bottom: 10px;
}

.doc-preview h2 {
    font-size: 1.5em;
    border-bottom: 1px solid #e0e0e0;
    padding-bottom: 8px;
}

.doc-preview h3 {
    font-size: 1.25em;
}

.doc-preview p {
    margin-bottom: 16px;
    color: #444;
}

.doc-preview ul,
.doc-preview ol {
    margin-bottom: 16px;
    padding-left: 2em;
}

.doc-preview li {
    margin-bottom: 8px;
}

.doc-preview strong {
    font-weight: 600;
    color: #222;
}

.doc-preview em {
    font-style: italic;
    color: #555;
}

.doc-preview code {
    background: #f0f0f0;
    padding: 2px 6px;
    border-radius: 4px;
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    font-size: 0.9em;
    color: #e83e8c;
}

.doc-preview pre {
    background: #f5f5f5;
    padding: 16px;
    border-radius: 8px;
    overflow-x: auto;
    margin-bottom: 16px;
}

.doc-preview pre code {
    background: none;
    padding: 0;
    color: #333;
}

.doc-preview blockquote {
    border-left: 4px solid #667eea;
    padding-left: 16px;
    margin-left: 0;
    margin-bottom: 16px;
    color: #666;
    font-style: italic;
}

.doc-preview a {
    color: #667eea;
    text-decoration: none;
}

.doc-preview a:hover {
    text-decoration: underline;
}

.doc-preview table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 16px;
}

.doc-preview th,
.doc-preview td {
    border: 1px solid #ddd;
    padding: 8px 12px;
    text-align: left;
}

.doc-preview th {
    background: #f5f5f5;
    font-weight: 600;
}

.doc-preview hr {
    border: none;
    border-top: 2px solid #e0e0e0;
    margin: 24px 0;
}

/* ==================== 响应式设计 ==================== */
@media (max-width: 1400px) {
    .doc-panel {
        width: calc(100% - 60px);
        right: 30px;
        left: 30px;
    }
}

@media (max-width: 1200px) {
    .models-grid {
        grid-template-columns: 1fr;
        grid-template-rows: repeat(4, 1fr);
    }
    
    .float-dialog {
        width: 350px;
        right: 20px;
    }
    
    .doc-panel {
        width: calc(100% - 40px);
        right: 20px;
        left: 20px;
    }
    
    .doc-editor-container {
        flex-direction: column;
    }
    
    .resize-handle {
        display: none;
    }
}

@media (max-width: 768px) {
    .sticky-banner {
        padding: 10px 15px;
    }
    
    .logo-text {
        font-size: 22px;
    }
    
    .tag-badge {
        display: none;
    }
    
    .btn-text {
        display: none;
    }
    
    .doc-btn,
    .toggle-btn {
        padding: 10px;
    }
    
    .header h1 {
        font-size: 18px;
    }
    
    .float-dialog {
        width: 90%;
        right: 5%;
        top: 80px;
    }
    
    .config-panel {
        width: calc(100% - 30px);
        left: 15px;
        right: 15px;
    }
    
    .doc-panel {
        width: calc(100% - 30px);
        right: 15px;
        left: 15px;
        height: calc(100vh - 100px);
        top: 70px;
    }
}
