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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen',
        'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif;
    background: #1e1e1e;
    color: #d4d4d4;
    height: 100vh;
    overflow: hidden;
}

.container {
    display: flex;
    flex-direction: column;
    height: 100vh;
    max-width: 100%;
}

/* Header */
header {
    background: #2d2d30;
    padding: 15px 20px;
    border-bottom: 1px solid #3e3e42;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
}

header .header-title {
    flex: 1;
}

header h1 {
    font-size: 20px;
    font-weight: 600;
    color: #cccccc;
    margin-bottom: 5px;
}

header .slogan {
    font-size: 12px;
    color: #858585;
    margin: 0;
    line-height: 1.5;
}

body.light-theme header .slogan {
    color: #666666;
}

.header-controls {
    display: flex;
    gap: 15px;
    align-items: center;
}

.mode-switch {
    display: flex;
    gap: 5px;
    background: #1e1e1e;
    padding: 4px;
    border-radius: 6px;
}

.mode-btn {
    padding: 8px 16px;
    border: none;
    background: transparent;
    color: #cccccc;
    cursor: pointer;
    border-radius: 4px;
    font-size: 14px;
    transition: all 0.2s;
}

.mode-btn:hover {
    background: #2d2d30;
}

.mode-btn.active {
    background: #0e639c;
    color: #ffffff;
}

.icon-btn {
    padding: 8px 12px;
    border: none;
    background: #1e1e1e;
    color: #cccccc;
    cursor: pointer;
    border-radius: 4px;
    font-size: 18px;
    transition: all 0.2s;
}

.icon-btn:hover {
    background: #2d2d30;
}

/* Toolbar */
.toolbar {
    background: #252526;
    padding: 12px 20px;
    border-bottom: 1px solid #3e3e42;
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
    flex-shrink: 0;
}

.btn {
    padding: 8px 16px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s;
    white-space: nowrap;
}

.btn-primary {
    background: #0e639c;
    color: #ffffff;
}

.btn-primary:hover {
    background: #1177bb;
}

.btn-success {
    background: #16825d;
    color: #ffffff;
}

.btn-success:hover {
    background: #1a9970;
}

.btn-info {
    background: #0078d4;
    color: #ffffff;
}

.btn-info:hover {
    background: #1084d8;
}

.btn-secondary {
    background: #3e3e42;
    color: #cccccc;
}

.btn-secondary:hover {
    background: #4e4e52;
}

.btn-small {
    padding: 4px 12px;
    font-size: 12px;
}

.file-label {
    display: inline-block;
}

.status-message {
    margin-left: auto;
    padding: 8px 12px;
    border-radius: 4px;
    font-size: 13px;
    transition: all 0.3s;
}

.status-message.success {
    background: #16825d;
    color: #ffffff;
}

.status-message.error {
    background: #f14c4c;
    color: #ffffff;
}

.status-message.info {
    background: #0e639c;
    color: #ffffff;
}

/* Mode Container */
.mode-container {
    display: none;
    flex-direction: column;
    flex: 1;
    overflow: hidden;
}

.mode-container.active {
    display: flex;
}

/* Editor Wrapper */
.editor-wrapper {
    flex: 1;
    overflow: hidden;
    padding: 0;
}

.editor {
    width: 100%;
    height: 100%;
}

/* Format Content with Schema */
.format-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.editor-container-full {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border-bottom: 1px solid #3e3e42;
    min-height: 0;
}

.schema-section {
    flex: 2;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border-top: 2px solid #0078d4;
    min-height: 0;
    transition: all 0.3s ease;
}

.schema-section.fullscreen {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1000;
    flex: none;
    height: 100vh;
    width: 100vw;
    border-top: none;
}

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

/* Compare Mode */
.compare-wrapper {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.compare-input-section {
    display: flex;
    gap: 0;
    flex: 1;
    overflow: hidden;
}

.editor-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border-right: 1px solid #3e3e42;
}

.editor-container:last-child {
    border-right: none;
}

.editor-header {
    background: #2d2d30;
    padding: 8px 15px;
    border-bottom: 1px solid #3e3e42;
    font-size: 13px;
    font-weight: 600;
    color: #cccccc;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.diff-section {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border-top: 2px solid #0e639c;
}

.diff-count {
    display: none;
    padding: 2px 8px;
    background: #0e639c;
    color: #ffffff;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    margin-left: 8px;
}

body.light-theme .diff-count {
    background: #0078d4;
}

/* Footer */
footer {
    background: #2d2d30;
    padding: 10px 20px;
    border-top: 1px solid #3e3e42;
    text-align: center;
    font-size: 12px;
    color: #858585;
    flex-shrink: 0;
}

footer p {
    margin: 5px 0;
}

footer .icp-info {
    margin-top: 5px;
}

footer .icp-info a {
    color: #858585;
    text-decoration: none;
    transition: color 0.2s;
}

footer .icp-info a:hover {
    color: #0e639c;
    text-decoration: underline;
}

/* Loading Overlay */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid #3e3e42;
    border-top: 4px solid #0e639c;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loading-text {
    margin-top: 20px;
    font-size: 16px;
    color: #cccccc;
}

/* Light Theme */
body.light-theme {
    background: #ffffff;
    color: #333333;
}

body.light-theme header {
    background: #f3f3f3;
    border-bottom: 1px solid #e0e0e0;
}

body.light-theme header h1 {
    color: #333333;
}

body.light-theme .mode-switch {
    background: #ffffff;
}

body.light-theme .mode-btn {
    color: #333333;
}

body.light-theme .mode-btn:hover {
    background: #e8e8e8;
}

body.light-theme .mode-btn.active {
    background: #0e639c;
    color: #ffffff;
}

body.light-theme .icon-btn {
    background: #ffffff;
    color: #333333;
}

body.light-theme .icon-btn:hover {
    background: #e8e8e8;
}

body.light-theme .toolbar {
    background: #f8f8f8;
    border-bottom: 1px solid #e0e0e0;
}

body.light-theme .btn-secondary {
    background: #e0e0e0;
    color: #333333;
}

body.light-theme .btn-secondary:hover {
    background: #d0d0d0;
}

body.light-theme .editor-container {
    border-right: 1px solid #e0e0e0;
}

body.light-theme .editor-container-full {
    border-bottom: 1px solid #e0e0e0;
}

body.light-theme .editor-header {
    background: #f3f3f3;
    border-bottom: 1px solid #e0e0e0;
    color: #333333;
}

body.light-theme footer {
    background: #f3f3f3;
    border-top: 1px solid #e0e0e0;
    color: #666666;
}

body.light-theme footer .icp-info a {
    color: #666666;
}

body.light-theme footer .icp-info a:hover {
    color: #0e639c;
}

body.light-theme .loading-spinner {
    border: 4px solid #e0e0e0;
    border-top: 4px solid #0e639c;
}

body.light-theme .loading-text {
    color: #333333;
}

/* ER Diagram Styles */
.er-diagram-container {
    width: 100%;
    height: 100%;
    overflow: hidden;
    background: #1e1e1e;
    position: relative;
}

body.light-theme .er-diagram-container {
    background: #ffffff;
}

.er-diagram-container svg {
    width: 100%;
    height: 100%;
}

/* ER Diagram Node Styles */
.er-node {
    cursor: move;
}

.er-node-rect {
    fill: #2d2d30;
    stroke: #0e639c;
    stroke-width: 2px;
    rx: 8px;
    filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.3));
}

body.light-theme .er-node-rect {
    fill: #ffffff;
    stroke: #0e639c;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.1));
}

.er-node-rect:hover {
    stroke: #1177bb;
    stroke-width: 3px;
}

.er-node-title {
    fill: #4ec9b0;
    font-size: 14px;
    font-weight: 600;
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
}

body.light-theme .er-node-title {
    fill: #16825d;
}

.er-field-name {
    fill: #9cdcfe;
    font-size: 12px;
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
}

body.light-theme .er-field-name {
    fill: #0070c0;
}

.er-field-type {
    fill: #ce9178;
    font-size: 11px;
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
}

body.light-theme .er-field-type {
    fill: #a31515;
}

.er-field-separator {
    stroke: #3e3e42;
    stroke-width: 1px;
}

body.light-theme .er-field-separator {
    stroke: #e0e0e0;
}

/* ER Diagram Link Styles */
.er-link {
    fill: none;
    stroke: #858585;
    stroke-width: 2px;
    marker-end: url(#arrowhead);
}

.er-link:hover {
    stroke: #0e639c;
    stroke-width: 3px;
}

body.light-theme .er-link {
    stroke: #666666;
}

body.light-theme .er-link:hover {
    stroke: #0e639c;
}

/* Arrow marker */
.er-arrowhead {
    fill: #858585;
}

body.light-theme .er-arrowhead {
    fill: #666666;
}

/* Zoom Controls */
.zoom-controls {
    position: absolute;
    top: 10px;
    right: 10px;
    display: flex;
    flex-direction: column;
    gap: 5px;
    z-index: 10;
}

.zoom-btn {
    width: 32px;
    height: 32px;
    background: #2d2d30;
    border: 1px solid #3e3e42;
    border-radius: 4px;
    color: #cccccc;
    cursor: pointer;
    font-size: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.zoom-btn:hover {
    background: #3e3e42;
    border-color: #0e639c;
}

body.light-theme .zoom-btn {
    background: #ffffff;
    border: 1px solid #e0e0e0;
    color: #333333;
}

body.light-theme .zoom-btn:hover {
    background: #f3f3f3;
    border-color: #0e639c;
}

/* Responsive */
@media (max-width: 768px) {
    header {
        flex-direction: column;
        gap: 10px;
        align-items: flex-start;
    }
    
    header .slogan {
        font-size: 10px;
    }

    .header-controls {
        width: 100%;
        justify-content: space-between;
    }

    .toolbar {
        padding: 10px;
        gap: 8px;
    }

    .btn {
        padding: 6px 12px;
        font-size: 13px;
    }

    .compare-input-section {
        flex-direction: column;
    }

    .editor-container {
        border-right: none;
        border-bottom: 1px solid #3e3e42;
    }

    body.light-theme .editor-container {
        border-bottom: 1px solid #e0e0e0;
    }
}

/* ==================== Feedback Modal Styles ==================== */

/* 模态框遮罩层 */
.modal {
    display: none;
    position: fixed;
    z-index: 10000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    animation: fadeIn 0.3s ease;
}

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

/* 模态框内容 */
.modal-content {
    background-color: #2d2d30;
    margin: 5% auto;
    padding: 30px;
    border: 1px solid #3e3e42;
    border-radius: 8px;
    width: 90%;
    max-width: 500px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
    animation: slideDown 0.3s ease;
    position: relative;
}

@keyframes slideDown {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.modal-content h2 {
    color: #cccccc;
    margin-bottom: 10px;
    font-size: 24px;
    font-weight: 600;
}

.modal-description {
    color: #858585;
    margin-bottom: 20px;
    font-size: 14px;
    line-height: 1.5;
}

/* 关闭按钮 */
.close {
    position: absolute;
    right: 20px;
    top: 20px;
    color: #858585;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    transition: color 0.2s;
    line-height: 1;
}

.close:hover,
.close:focus {
    color: #cccccc;
}

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

#feedbackForm label {
    display: block;
    color: #cccccc;
    margin-bottom: 8px;
    font-size: 14px;
    font-weight: 500;
}

#feedbackForm .required {
    color: #f48771;
}

#feedbackForm textarea,
#feedbackForm input[type="email"] {
    width: 100%;
    padding: 12px;
    background-color: #1e1e1e;
    border: 1px solid #3e3e42;
    border-radius: 4px;
    color: #d4d4d4;
    font-size: 14px;
    font-family: inherit;
    transition: border-color 0.2s, box-shadow 0.2s;
    resize: vertical;
}

#feedbackForm textarea:focus,
#feedbackForm input[type="email"]:focus {
    outline: none;
    border-color: #007acc;
    box-shadow: 0 0 0 2px rgba(0, 122, 204, 0.2);
}

#feedbackForm textarea {
    min-height: 120px;
}

/* 表单操作按钮 */
.form-actions {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

.form-actions .btn {
    flex: 1;
    padding: 12px 20px;
    font-size: 14px;
    border-radius: 4px;
    cursor: pointer;
    border: none;
    transition: all 0.2s;
}

.form-actions .btn-primary {
    background-color: #007acc;
    color: white;
}

.form-actions .btn-primary:hover {
    background-color: #005a9e;
}

.form-actions .btn-secondary {
    background-color: #3e3e42;
    color: #cccccc;
}

.form-actions .btn-secondary:hover {
    background-color: #505050;
}

/* 反馈状态消息 */
.feedback-status {
    margin-top: 15px;
    padding: 12px;
    border-radius: 4px;
    font-size: 14px;
    display: none;
    animation: slideIn 0.3s ease;
}

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

.feedback-status.success {
    background-color: rgba(106, 153, 85, 0.2);
    border: 1px solid #6a9955;
    color: #6a9955;
    display: block;
}

.feedback-status.error {
    background-color: rgba(244, 135, 113, 0.2);
    border: 1px solid #f48771;
    color: #f48771;
    display: block;
}

/* 亮色主题样式 */
body.light-theme .modal-content {
    background-color: #ffffff;
    border: 1px solid #e0e0e0;
}

body.light-theme .modal-content h2 {
    color: #333333;
}

body.light-theme .modal-description {
    color: #666666;
}

body.light-theme .close {
    color: #999999;
}

body.light-theme .close:hover {
    color: #333333;
}

body.light-theme #feedbackForm label {
    color: #333333;
}

body.light-theme #feedbackForm textarea,
body.light-theme #feedbackForm input[type="email"] {
    background-color: #f5f5f5;
    border: 1px solid #e0e0e0;
    color: #333333;
}

body.light-theme #feedbackForm textarea:focus,
body.light-theme #feedbackForm input[type="email"]:focus {
    border-color: #007acc;
    box-shadow: 0 0 0 2px rgba(0, 122, 204, 0.1);
}

body.light-theme .form-actions .btn-secondary {
    background-color: #e0e0e0;
    color: #333333;
}

body.light-theme .form-actions .btn-secondary:hover {
    background-color: #d0d0d0;
}

body.light-theme .feedback-status.success {
    background-color: rgba(106, 153, 85, 0.1);
    color: #2d6a2d;
}

body.light-theme .feedback-status.error {
    background-color: rgba(244, 135, 113, 0.1);
    color: #c7372f;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .modal-content {
        width: 95%;
        margin: 10% auto;
        padding: 20px;
    }

    .modal-content h2 {
        font-size: 20px;
    }

    .form-actions {
        flex-direction: column;
    }

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

/* Monaco Diff Editor 折叠区域样式增强 */
.monaco-diff-editor .unchanged-region {
    background: rgba(128, 128, 128, 0.1);
}

body.light-theme .monaco-diff-editor .unchanged-region {
    background: rgba(0, 0, 0, 0.05);
}

/* 折叠提示样式 */
.folding-hint {
    opacity: 0.6 !important;
    font-style: italic !important;
    margin-left: 8px !important;
    color: #858585 !important;
    font-size: 12px !important;
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace !important;
}

body.light-theme .folding-hint {
    color: #666666 !important;
}

/* 折叠提示的类名样式（使用伪元素） */
.folding-hint-empty::after,
.folding-hint-single::after,
.folding-hint-array::after,
.folding-hint-object::after {
    opacity: 0.6;
    font-style: italic;
    margin-left: 8px;
    color: #858585;
    font-size: 12px;
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
}

body.light-theme .folding-hint-empty::after,
body.light-theme .folding-hint-single::after,
body.light-theme .folding-hint-array::after,
body.light-theme .folding-hint-object::after {
    color: #666666;
}

/* 行号区域的折叠装饰（不可见，仅用于标记） */
.folding-line-decoration {
    display: none;
}

/* Content Widget 折叠提示样式 */
.folding-hint-widget {
    opacity: 0.6 !important;
    font-style: italic !important;
    color: #858585 !important;
    font-size: 12px !important;
    line-height: 19px !important;
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace !important;
    margin-left: 4px !important;
    padding: 0 !important;
    pointer-events: none !important;
    white-space: nowrap !important;
    display: inline !important;
}

body.light-theme .folding-hint-widget {
    color: #666666 !important;
}

