/* Open Questions Analysis styles */
/* ========== 全局样式 ========== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
    background: #f5f7fa;
    color: #333;
}

#app {
    min-height: 100vh;
}

.header {
    background: linear-gradient(135deg, #1e3a5f 0%, #2c3e50 100%);
    color: white;
    padding: 20px 40px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.header h1 {
    font-size: 24px;
    font-weight: 600;
}

.header p {
    opacity: 0.9;
    margin-top: 5px;
    font-size: 14px;
}

.main-container {
    display: flex;
    height: calc(100vh - 80px);
}

.sidebar {
    width: 300px;
    background: white;
    border-right: 1px solid #e8e8e8;
    padding: 20px;
    overflow-y: auto;
    box-shadow: 2px 0 8px rgba(0, 0, 0, 0.02);
}

.step-section {
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 1px solid #f0f0f0;
}

.step-section:last-child {
    border-bottom: none;
}

.step-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 16px;
    font-weight: 600;
    color: #333;
    margin-bottom: 15px;
}

.step-number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    background: #2c3e50;
    color: white;
    border-radius: 50%;
    font-size: 14px;
    font-weight: 500;
}

.upload-area {
    border: 2px dashed #d9d9d9;
    border-radius: 8px;
    padding: 30px 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
    background: #fafafa;
}

.upload-area:hover {
    border-color: #2c3e50;
    background: #eef1f5;
}

.upload-area.dragover {
    border-color: #2c3e50;
    background: #dce1e8;
}

.upload-icon {
    font-size: 48px;
    color: #bfbfbf;
    margin-bottom: 10px;
}

.upload-text {
    color: #666;
    font-size: 14px;
}

.upload-hint {
    color: #999;
    font-size: 12px;
    margin-top: 8px;
}

.upload-small {
    padding: 15px;
    margin-top: 10px;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 16px;
    border-radius: 6px;
    border: none;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s;
    gap: 6px;
}

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

.btn-primary {
    background: #2c3e50;
    color: white;
}

.btn-primary:hover:not(:disabled) {
    background: #34495e;
}

.btn-success {
    background: #27ae60;
    color: white;
}

.btn-success:hover {
    background: #219a52;
}

.btn-danger {
    background: #c0392b;
    color: white;
}

.btn-danger:hover {
    background: #e74c3c;
}

.btn-warning {
    background: #e67e22;
    color: white;
}

.btn-warning:hover {
    background: #f39c12;
}

.btn-secondary {
    background: #f0f0f0;
    color: #666;
}

.btn-secondary:hover {
    background: #e0e0e0;
}

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

.btn-xs {
    padding: 3px 8px;
    font-size: 11px;
}

.btn-block {
    width: 100%;
}

.btn-highlight {
    background: linear-gradient(135deg, #2c3e50, #34495e);
    font-weight: 600;
    font-size: 15px;
    padding: 12px;
    box-shadow: 0 4px 12px rgba(44, 62, 80, 0.3);
}

.btn-highlight:hover:not(:disabled) {
    background: linear-gradient(135deg, #34495e, #3b5998);
    box-shadow: 0 6px 16px rgba(44, 62, 80, 0.4);
}

.radio-group {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.radio-card {
    display: flex;
    align-items: center;
    padding: 12px;
    background: #eef2f7;
    border: 1px solid #cbd5e0;
    border-radius: 6px;
    cursor: pointer;
    transition: 0.2s;
}

.radio-card:hover {
    background: #dce3ec;
    border-color: #a0afc2;
}

.radio-card input {
    margin-right: 10px;
}

.radio-desc {
    display: block;
    color: #666;
    font-size: 12px;
}

.check-item {
    display: flex;
    align-items: center;
    padding: 8px;
    cursor: pointer;
    border-radius: 4px;
    transition: background 0.2s;
}

.check-item:hover {
    background: #f5f7fa;
}

.check-item input {
    margin-right: 8px;
}

.check-group-label {
    font-size: 13px;
    color: #666;
    margin-bottom: 8px;
}

.form-select {
    width: 100%;
    padding: 10px;
    border-radius: 6px;
    border: 1px solid #d9d9d9;
    background: white;
}

textarea,
input[type="text"] {
    width: 100%;
    padding: 8px;
    border-radius: 4px;
    border: 1px solid #d9d9d9;
    font-size: 13px;
}

textarea:focus,
input:focus {
    outline: none;
    border-color: #2c3e50;
}

.rule-group {
    background: #f8fafc;
    padding: 12px;
    border-radius: 6px;
}

.rule-label {
    font-size: 13px;
    color: #666;
    margin-bottom: 8px;
    font-weight: 500;
}

.rule-options {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
}

.rule-options label {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 13px;
    cursor: pointer;
}

.ai-tip {
    background: #eef1f5;
    padding: 12px;
    border-radius: 6px;
    margin-bottom: 15px;
    font-size: 12px;
    color: #4a5568;
    line-height: 1.6;
}

.forced-dim-card {
    border: 1px solid #cbd5e0;
    border-radius: 6px;
    margin-bottom: 15px;
    overflow: hidden;
}

.forced-dim-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px;
    background: #eef1f5;
    font-weight: 600;
    cursor: pointer;
}

.forced-dim-body {
    padding: 12px;
    background: white;
    border-top: 1px solid #cbd5e0;
}

.mode-switch {
    display: flex;
    gap: 10px;
    margin-bottom: 12px;
}

.mode-switch label {
    flex: 1;
    text-align: center;
    padding: 6px;
    border-radius: 4px;
    background: #f5f5f5;
    cursor: pointer;
    font-size: 13px;
    transition: 0.2s;
}

.mode-switch label.active {
    background: #2c3e50;
    color: white;
}

.mode-switch input {
    display: none;
}

.forced-dim-list {
    margin-bottom: 10px;
}

.forced-dim-item {
    display: flex;
    align-items: center;
    gap: 8px;
    background: #f9f9f9;
    padding: 6px 8px;
    border-radius: 4px;
    margin-bottom: 6px;
}

.dim-level-tag {
    font-size: 12px;
    background: #dce3ec;
    padding: 2px 6px;
    border-radius: 4px;
}

.dim-name {
    flex: 1;
    font-size: 13px;
}

.btn-icon {
    background: none;
    border: none;
    color: #999;
    cursor: pointer;
    font-size: 16px;
    line-height: 1;
    padding: 0 4px;
}

.btn-icon:hover {
    color: #c0392b;
}

.add-forced-dim {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.level-select {
    width: 70px;
    padding: 6px;
    border-radius: 4px;
    border: 1px solid #d9d9d9;
}

.content {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
}

.section-title {
    font-size: 14px;
    font-weight: 600;
    color: #666;
    margin-bottom: 15px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.card {
    background: white;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.04);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.card-title {
    font-size: 16px;
    font-weight: 600;
    color: #333;
}

.stats-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    margin-bottom: 20px;
}

.stat-card {
    flex: 1 1 180px;
    background: white;
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    text-align: center;
    transition: transform 0.2s, box-shadow 0.2s;
    cursor: pointer;
}

.stat-card:hover {
    transform: scale(1.02);
    box-shadow: 0 8px 16px rgba(44, 62, 80, 0.15);
}

.stat-value {
    font-size: 32px;
    font-weight: 700;
    color: #2c3e50;
}

.stat-label {
    font-size: 13px;
    color: #999;
    margin-top: 5px;
}

.stats-grid2 {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 12px;
    margin: 15px 0 20px;
}

.stat-card-sm {
    background: #f8fafc;
    padding: 16px 12px;
    border-radius: 10px;
    text-align: center;
    border-left: 3px solid #2c3e50;
    transition: transform 0.2s, box-shadow 0.2s;
    cursor: pointer;
}

.stat-card-sm:hover {
    transform: scale(1.02);
    box-shadow: 0 6px 12px rgba(44, 62, 80, 0.1);
}

.stat-card-sm .stat-value {
    font-size: 26px;
    color: #2c3e50;
}

.stat-card-sm .stat-label {
    font-size: 12px;
    color: #5a6d86;
}

.stat-card-sm .stat-percent {
    font-size: 13px;
    color: #2c3e50;
    margin-top: 6px;
    background: #eef1f5;
    display: inline-block;
    padding: 2px 10px;
    border-radius: 20px;
}

.tabs {
    display: flex;
    gap: 5px;
    border-bottom: 1px solid #e8e8e8;
    margin-bottom: 20px;
}

.tab {
    padding: 12px 20px;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    font-size: 14px;
    color: #666;
    transition: all 0.3s;
    position: relative;
}

.tab:hover {
    color: #2c3e50;
}

.tab.active {
    color: #2c3e50;
    border-bottom-color: #2c3e50;
    font-weight: 600;
}

.tab.active::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 100%;
    height: 2px;
    background: #2c3e50;
    animation: slideIn 0.2s;
}

@keyframes slideIn {
    from {
        transform: scaleX(0);
    }

    to {
        transform: scaleX(1);
    }
}

.data-preview {
    max-height: 300px;
    overflow: auto;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.data-table th {
    background: #f5f5f5;
    padding: 10px;
    text-align: left;
    font-weight: 600;
    color: #666;
    border-bottom: 2px solid #e8e8e8;
    position: sticky;
    top: 0;
}

.data-table td {
    padding: 10px;
    border-bottom: 1px solid #f0f0f0;
    max-width: 300px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.data-table tr:hover td {
    background: #f5f7fa;
}

.dim-tree {
    margin-top: 20px;
}

.dim-item {
    margin-bottom: 8px;
}

.dim-header {
    display: flex;
    align-items: center;
    padding: 10px 12px;
    background: #f5f7fa;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.2s;
}

.dim-header:hover {
    background: #e8ecf4;
}

.dim-header.level-1 {
    background: #e3edf7;
    border-left: 3px solid #2c3e50;
}

.dim-header.level-2 {
    background: #eef5ee;
    border-left: 3px solid #27ae60;
    margin-left: 20px;
}

.dim-header.level-3 {
    background: #fdf5e6;
    border-left: 3px solid #e67e22;
    margin-left: 40px;
}

.dim-toggle {
    width: 16px;
    margin-right: 8px;
    color: #999;
}

.dim-name {
    flex: 1;
    font-weight: 500;
}

.dim-count {
    background: rgba(0, 0, 0, 0.1);
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 12px;
    margin-right: 8px;
}

.dim-actions {
    display: flex;
    gap: 5px;
}

.dim-quotes-preview {
    margin: 10px 0 15px 60px;
    padding: 10px;
    background: #fafafa;
    border-radius: 8px;
    max-height: 400px;
    overflow-y: auto;
}

.dim-quote-item {
    background: white;
    border-left: 3px solid #2c3e50;
    padding: 12px 15px;
    margin-bottom: 10px;
    border-radius: 0 6px 6px 0;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.dim-quote-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
    flex-wrap: wrap;
    gap: 8px;
}

.dim-quote-uid {
    margin-bottom: 0;
}

.dim-quote-actions {
    display: flex;
    gap: 6px;
}

.dim-quote-text {
    font-size: 14px;
    color: #333;
    line-height: 1.6;
    margin-bottom: 6px;
}

.dim-quote-source {
    font-size: 11px;
    color: #999;
}

.dim-quote-empty {
    text-align: center;
    color: #999;
    padding: 20px;
    font-style: italic;
}

.uid-badge {
    display: inline-flex;
    align-items: center;
    background: linear-gradient(135deg, #2c3e50 0%, #34495e 100%);
    color: white;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
}

.quote-uid-badge {
    margin-bottom: 8px;
}

.quote-item {
    background: #f8f9fa;
    border-left: 3px solid #2c3e50;
    padding: 12px 15px;
    margin-bottom: 10px;
    border-radius: 0 6px 6px 0;
}

.quote-text {
    font-size: 14px;
    color: #333;
    line-height: 1.6;
}

.quote-meta {
    font-size: 12px;
    color: #999;
    margin-top: 8px;
}

.input-group {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
}

.input-group input {
    flex: 1;
    padding: 10px 15px;
    border: 1px solid #d9d9d9;
    border-radius: 6px;
    font-size: 14px;
}

.progress-bar {
    height: 8px;
    background: #f0f0f0;
    border-radius: 4px;
    overflow: hidden;
    margin-top: 10px;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #2c3e50, #34495e);
    border-radius: 4px;
    transition: width 0.3s;
}

.tag {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 12px;
    margin-right: 5px;
}

.tag-blue {
    background: #e3edf7;
    color: #2c3e50;
}

.tag-green {
    background: #eef5ee;
    color: #27ae60;
}

.tag-orange {
    background: #fdf5e6;
    color: #e67e22;
}

.alert {
    padding: 12px 16px;
    border-radius: 6px;
    margin-bottom: 15px;
}

.alert-info {
    background: #e3edf7;
    border: 1px solid #a0c4e8;
    color: #2c3e50;
}

.alert-success {
    background: #eef5ee;
    border: 1px solid #a3d7b5;
    color: #27ae60;
}

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

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    animation: fadeIn 0.3s ease;
}

.bar-fill {
    height: 100%;
    border-radius: 12px;
    transition: width 0.3s ease;
}

.chart-level-switch {
    display: flex;
    gap: 5px;
}

.chart-level-switch .btn {
    background: #f0f0f0;
    color: #666;
    border: none;
}

.chart-level-switch .btn.btn-primary {
    background: #2c3e50;
    color: white;
}

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal {
    background: white;
    border-radius: 12px;
    width: 90%;
    max-width: 800px;
    max-height: 80vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
}

.modal-header {
    padding: 20px;
    border-bottom: 1px solid #e8e8e8;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: linear-gradient(to right, #f8fafc, white);
}

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

.modal-footer {
    padding: 15px 20px;
    border-top: 1px solid #e8e8e8;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

.config-item {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.config-item label {
    font-size: 13px;
    color: #666;
    font-weight: 500;
}

.move-dim-tree {
    max-height: 400px;
    overflow-y: auto;
    border: 1px solid #e8e8e8;
    border-radius: 4px;
    padding: 10px;
}

.empty-state {
    text-align: center;
    padding: 60px;
}

.empty-icon {
    font-size: 64px;
    margin-bottom: 20px;
}

.empty-state h3 {
    color: #333;
    margin-bottom: 10px;
}

.empty-state p {
    color: #999;
}

textarea.custom-instruction {
    width: 100%;
    padding: 8px;
    border-radius: 4px;
    border: 1px solid #d9d9d9;
    font-size: 12px;
    resize: vertical;
    margin-top: 5px;
}

textarea.custom-instruction:focus {
    outline: none;
    border-color: #2c3e50;
}

.instruction-card {
    background: #ffffff;
    border-radius: 6px;
    padding: 16px;
    margin-bottom: 15px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.02);
    border: 1px solid #f0f0f0;
    transition: box-shadow 0.2s;
}

.instruction-card:hover {
    box-shadow: 0 4px 12px rgba(44, 62, 80, 0.08);
}

.instruction-label {
    display: flex;
    align-items: center;
    font-size: 14px;
    font-weight: 600;
    color: #333;
    margin-bottom: 12px;
    position: relative;
    padding-left: 12px;
}

.instruction-label::before {
    content: '';
    position: absolute;
    left: 0;
    top: 2px;
    bottom: 2px;
    width: 4px;
    background: linear-gradient(135deg, #2c3e50, #34495e);
    border-radius: 4px;
}

.label-icon {
    margin-right: 6px;
    font-size: 16px;
}

.optional {
    font-size: 12px;
    font-weight: 400;
    color: #999;
    margin-left: 6px;
}

.instruction-textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    font-size: 13px;
    line-height: 1.5;
    resize: vertical;
    background: #fafafa;
    transition: all 0.2s;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.02);
}

.instruction-textarea:focus {
    outline: none;
    border-color: #2c3e50;
    background: #ffffff;
    box-shadow: 0 0 0 3px rgba(44, 62, 80, 0.1), inset 0 1px 2px rgba(0, 0, 0, 0.02);
}

.paste-import-area {
    border: 2px solid #cbd5e0;
    border-radius: 8px;
    padding: 15px;
    background: #f8fafc;
    margin-top: 12px;
}

.paste-import-area .paste-label {
    font-size: 13px;
    font-weight: 600;
    color: #333;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.paste-import-area .paste-textarea {
    width: 100%;
    min-height: 120px;
    padding: 10px 12px;
    border: 1px solid #d9d9d9;
    border-radius: 6px;
    font-size: 12px;
    line-height: 1.5;
    resize: vertical;
    background: #fff;
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    transition: all 0.2s;
}

.paste-import-area .paste-textarea:focus {
    outline: none;
    border-color: #2c3e50;
    box-shadow: 0 0 0 3px rgba(44, 62, 80, 0.08);
}

.paste-import-area .paste-textarea::placeholder {
    color: #bbb;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

.paste-actions {
    display: flex;
    gap: 8px;
    margin-top: 10px;
    align-items: center;
    flex-wrap: wrap;
}

.paste-actions .btn-paste-import {
    background: #27ae60;
    color: white;
    font-weight: 600;
}

.paste-actions .btn-paste-import:hover {
    background: #219a52;
}

.paste-actions .btn-clear-paste {
    background: #f5f5f5;
    color: #999;
    font-size: 12px;
    padding: 4px 10px;
}

.paste-actions .btn-clear-paste:hover {
    background: #e8e8e8;
}

.paste-or-divider {
    font-size: 11px;
    color: #bbb;
    margin: 0 4px;
}

.btn-link-upload {
    background: none;
    border: none;
    color: #2c3e50;
    cursor: pointer;
    font-size: 12px;
    text-decoration: underline;
    padding: 4px 8px;
}

.btn-link-upload:hover {
    color: #34495e;
}

.copy-toast {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: #333;
    color: #fff;
    padding: 10px 24px;
    border-radius: 20px;
    font-size: 14px;
    z-index: 9999;
    animation: toastIn 0.3s ease, toastOut 0.3s ease 1.8s forwards;
    pointer-events: none;
    white-space: nowrap;
}

@keyframes toastIn {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(-20px);
    }

    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

@keyframes toastOut {
    from {
        opacity: 1;
    }

    to {
        opacity: 0;
        transform: translateX(-50%) translateY(-10px);
    }
}

@media (max-width: 1200px) {
    .main-container {
        flex-direction: column;
    }

    .sidebar {
        width: 100%;
        max-height: 400px;
    }

    .stats-grid2 {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .stats-grid2 {
        grid-template-columns: 1fr;
    }
}
