/* 全局样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'PingFang SC', 'Microsoft YaHei', sans-serif;
    background: linear-gradient(135deg, #1a1a1a 0%, #2d2d2d 100%);
    color: #ffffff;
    min-height: 100vh;
    line-height: 1.6;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

/* 头部样式 */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 30px 0;
    border-bottom: 2px solid #333;
    margin-bottom: 40px;
}

.logo h1 {
    font-size: 28px;
    font-weight: 700;
    color: #ffffff;
    margin-bottom: 5px;
    letter-spacing: 2px;
}

.logo p {
    font-size: 14px;
    color: #888;
    font-weight: 300;
}

.title h2 {
    font-size: 32px;
    font-weight: 600;
    color: #ffffff;
    margin-bottom: 8px;
    text-align: right;
}

.title p {
    font-size: 16px;
    color: #aaa;
    text-align: right;
}

.nav-links {
    display: flex;
    gap: 15px;
}

.nav-link {
    color: #ffffff;
    text-decoration: none;
    padding: 8px 16px;
    border: 1px solid #555;
    border-radius: 6px;
    font-size: 14px;
    transition: all 0.3s ease;
    background: rgba(255, 255, 255, 0.05);
}

.nav-link:hover {
    background-color: #ffffff;
    color: #333;
    border-color: #ffffff;
}

/* 主要内容布局 */
.main-content {
    display: grid;
    grid-template-columns: 300px 1fr;
    gap: 16px;
    min-height: 600px;
}

/* 控制面板 */
.control-panel {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    padding: 16px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    height: fit-content;
}

.panel-section {
    margin-bottom: 14px;
}

.panel-section:last-child {
    margin-bottom: 0;
}

.panel-section h3 {
    font-size: 18px;
    font-weight: 600;
    color: #ffffff;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid #333;
}

/* 文本填充区域 */
.text-fill-section {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.text-fill-section textarea {
    width: 100%;
    padding: 10px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 6px;
    color: #ffffff;
    font-size: 14px;
    font-family: inherit;
    resize: vertical;
    min-height: 60px;
    transition: all 0.3s ease;
}

.text-fill-section textarea:focus {
    outline: none;
    border-color: #4a9eff;
    background: rgba(74, 158, 255, 0.1);
}

.text-fill-section textarea::placeholder {
    color: rgba(255, 255, 255, 0.4);
}

.text-fill-section input[type="number"] {
    padding: 8px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 6px;
    color: #ffffff;
    font-size: 14px;
    transition: all 0.3s ease;
}

.text-fill-section input[type="number"]:focus {
    outline: none;
    border-color: #4a9eff;
    background: rgba(74, 158, 255, 0.1);
}

.form-group-inline {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.form-group-inline label {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.8);
    font-weight: 500;
}

/* 预览操作按钮组 */
#previewActions {
    display: none;
    margin-top: 10px;
}

#previewActions.flex {
    display: flex;
}

#confirmFillBtn {
    background: linear-gradient(135deg, #4CAF50 0%, #45a049 100%) !important;
}

#confirmFillBtn:hover {
    background: linear-gradient(135deg, #45a049 0%, #3d8b40 100%) !important;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(76, 175, 80, 0.4);
}

#cancelFillBtn {
    background: linear-gradient(135deg, #f44336 0%, #da190b 100%) !important;
}

#cancelFillBtn:hover {
    background: linear-gradient(135deg, #da190b 0%, #c41700 100%) !important;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(244, 67, 54, 0.4);
}

/* 禁用输入框样式 */
.text-fill-section textarea:disabled,
.text-fill-section input[type="number"]:disabled {
    background: rgba(255, 255, 255, 0.03);
    border-color: rgba(255, 255, 255, 0.1);
    cursor: not-allowed;
    opacity: 0.6;
}

/* 上传区域 */
.upload-area {
    border: 2px dashed #555;
    border-radius: 8px;
    padding: 40px 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    background: rgba(255, 255, 255, 0.02);
}

.upload-area:hover {
    border-color: #888;
    background: rgba(255, 255, 255, 0.05);
}

.upload-area.dragover {
    border-color: #007acc;
    background: rgba(0, 122, 204, 0.1);
}

.upload-placeholder svg {
    color: #888;
    margin-bottom: 15px;
}

.upload-placeholder p {
    color: #aaa;
    margin-bottom: 5px;
}

.upload-hint {
    font-size: 12px;
    color: #666 !important;
}

/* 参数控制 */
.parameter-group {
    margin-bottom: 20px;
}

.parameter-group label {
    display: block;
    margin-bottom: 10px;
    color: #ccc;
    font-weight: 500;
}

#confidenceSlider {
    width: 100%;
    height: 6px;
    background: #333;
    border-radius: 3px;
    outline: none;
    -webkit-appearance: none;
    appearance: none;
    margin-bottom: 10px;
}

#confidenceSlider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 20px;
    height: 20px;
    background: #007acc;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}

#confidenceSlider::-moz-range-thumb {
    width: 20px;
    height: 20px;
    background: #007acc;
    border-radius: 50%;
    cursor: pointer;
    border: none;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}

.slider-labels {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    color: #666;
}

/* 按钮样式 */
.detect-btn, .download-btn, .tool-btn {
    width: 100%;
    padding: 12px 20px;
    border: none;
    border-radius: 6px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-bottom: 10px;
}

.detect-btn {
    background: linear-gradient(135deg, #007acc 0%, #005a9e 100%);
    color: white;
}

.detect-btn:hover:not(:disabled) {
    background: linear-gradient(135deg, #005a9e 0%, #004080 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 122, 204, 0.3);
}

.detect-btn:disabled {
    background: #444;
    color: #666;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.detect-btn.stop-mode {
    background: linear-gradient(135deg, #dc3545 0%, #c82333 100%);
}

.detect-btn.stop-mode:hover:not(:disabled) {
    background: linear-gradient(135deg, #c82333 0%, #a71e2a 100%);
    box-shadow: 0 4px 12px rgba(220, 53, 69, 0.3);
}

.download-btn {
    background: linear-gradient(135deg, #28a745 0%, #1e7e34 100%);
    color: white;
}

.download-btn:hover:not(:disabled) {
    background: linear-gradient(135deg, #1e7e34 0%, #155724 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(40, 167, 69, 0.3);
}

.download-btn:disabled {
    background: #444;
    color: #666;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* 工具按钮样式 */
.tool-btn {
    background: linear-gradient(135deg, #007acc 0%, #005a9e 100%); /* 和开始分割按钮相同的深蓝色 */
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.tool-btn:hover:not(:disabled) {
    background: linear-gradient(135deg, #005a9e 0%, #004080 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 122, 204, 0.3);
}

.tool-btn:disabled {
    background: #444;
    color: #666;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.tool-btn.active {
    background: linear-gradient(135deg, #28a745 0%, #1e7e34 100%);
    box-shadow: 0 0 0 2px rgba(40, 167, 69, 0.3);
}

.tool-btn.active:hover {
    background: linear-gradient(135deg, #1e7e34 0%, #155724 100%);
}

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

.btn-text {
    font-size: 14px;
}

.tool-buttons { margin-bottom: 10px; }

.actions-grid { display: flex; flex-direction: column; gap: 8px; }
.mode-row { display: flex; gap: 8px; }

.tool-hint {
    background: rgba(255, 255, 255, 0.03);
    border-radius: 4px;
    padding: 10px;
    font-size: 12px;
    color: #aaa;
    line-height: 1.4;
}

.tool-hint p {
    margin: 0 0 4px 0;
}

.tool-hint p:last-child {
    margin-bottom: 0;
}

/* 布局预览样式 */
.layout-preview-container {
    margin: 15px 0;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 6px;
    padding: 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.layout-info {
    font-size: 13px;
}

.layout-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 8px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.layout-title {
    color: #ffffff;
    font-weight: 600;
    font-size: 14px;
}

.layout-summary {
    color: #aaa;
    font-size: 12px;
}

.column-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(255, 255, 255, 0.05);
    padding: 3px 6px;
    border-radius: 3px;
    font-size: 11px;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.column-info:hover {
    background: rgba(255, 215, 0, 0.2);
    transform: scale(1.05);
}

.column-info.highlighted {
    background: rgba(255, 215, 0, 0.4);
    border: 1px solid #FFD700;
    box-shadow: 0 0 10px rgba(255, 215, 0, 0.5);
}

.highlight-all-btn {
    padding: 4px 12px;
    background: rgba(255, 215, 0, 0.2);
    border: 1px solid #FFD700;
    border-radius: 4px;
    color: #FFD700;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-left: auto;
}

.highlight-all-btn:hover {
    background: rgba(255, 215, 0, 0.3);
    transform: scale(1.05);
}

.highlight-all-btn.active {
    background: rgba(255, 215, 0, 0.5);
    color: #fff;
    font-weight: 600;
}

/* 布局切换按钮样式 */
.toggle-layout-btn {
    padding: 4px 12px;
    background: rgba(100, 149, 237, 0.2);
    border: 1px solid #6495ED;
    border-radius: 4px;
    color: #6495ED;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-left: 8px;
}

.toggle-layout-btn:hover {
    background: rgba(100, 149, 237, 0.3);
    transform: scale(1.05);
}

/* 备选字符样式 */
.alternatives-list {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 8px;
}

.alt-char-btn {
    padding: 6px 12px;
    background: rgba(64, 150, 255, 0.15);
    border: 1px solid rgba(64, 150, 255, 0.3);
    border-radius: 6px;
    color: #4096ff;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.alt-char-btn:hover {
    background: rgba(64, 150, 255, 0.25);
    border-color: rgba(64, 150, 255, 0.5);
    transform: scale(1.05);
}

.column-label {
    color: #ccc;
}

.column-count {
    color: #ffffff;
    font-weight: 600;
}

.no-data {
    color: #888;
    font-style: italic;
}

/* 识别进度条样式 */
.recognition-progress {
    margin: 15px 0;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 6px;
    padding: 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.progress-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
    font-size: 13px;
}

.progress-text {
    color: #ccc;
}

.progress-percentage {
    color: #ffffff;
    font-weight: 600;
}

.progress-bar {
    width: 100%;
    height: 6px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(135deg, #007acc 0%, #005a9e 100%);
    border-radius: 3px;
    transition: width 0.3s ease;
}

.progress-mode {
    text-align: center;
    margin-bottom: 8px;
}

.mode-text {
    color: #FFD600;
    font-size: 12px;
    background: rgba(255, 214, 0, 0.1);
    padding: 2px 8px;
    border-radius: 3px;
    font-weight: 500;
}

/* 识别字符表格样式 */
.char-cell {
    text-align: center;
    padding: 8px;
}

.recognized-char {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.1);
    color: #FFD600;
    font-weight: 600;
    font-size: 16px;
    min-width: 20px;
    text-align: center;
}

.recognized-char.corrected {
    background: rgba(46, 125, 50, 0.3);
    color: #4CAF50;
    border: 1px solid rgba(76, 175, 80, 0.5);
}

/* 识别设置样式 */
.recognition-settings {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.setting-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* 紧凑设置区 */
.settings-compact { display: flex; flex-direction: column; gap: 8px; }
.settings-compact .row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.settings-compact label { color: #ccc; font-size: 13px; }

.setting-group label {
    color: #ccc;
    font-size: 14px;
    font-weight: 500;
}

.setting-select {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 6px;
    color: #ffffff;
    padding: 8px 12px;
    font-size: 14px;
    outline: none;
    transition: all 0.3s ease;
}

.setting-select:focus {
    border-color: #007acc;
    background: rgba(255, 255, 255, 0.15);
    box-shadow: 0 0 0 2px rgba(0, 122, 204, 0.2);
}

.setting-select option {
    background: #2d2d2d;
    color: #ffffff;
}

.setting-group input[type="range"] {
    width: 100%;
    margin: 5px 0;
}

.setting-group span {
    color: #ffffff;
    font-weight: 600;
    font-size: 14px;
    text-align: center;
    background: rgba(255, 255, 255, 0.1);
    padding: 4px 8px;
    border-radius: 4px;
    min-width: 40px;
}

/* 模型信息样式 */
.model-info {
    background: rgba(255, 255, 255, 0.03);
    border-radius: 6px;
    padding: 15px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.model-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    padding: 8px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.model-item:last-of-type {
    border-bottom: none;
    margin-bottom: 15px;
}

.model-label {
    color: #ccc;
    font-size: 14px;
}

.model-value {
    color: #ffffff;
    font-weight: 600;
    font-size: 14px;
}

.upgrade-notice {
    color: #FFD600;
    font-size: 12px;
    background: rgba(255, 214, 0, 0.1);
    padding: 2px 6px;
    border-radius: 3px;
    margin-left: 8px;
}

.upgrade-info {
    background: linear-gradient(135deg, rgba(0, 122, 204, 0.1) 0%, rgba(0, 90, 158, 0.1) 100%);
    border-radius: 6px;
    padding: 12px;
    border-left: 3px solid #007acc;
}

.upgrade-info p {
    margin: 0;
    color: #ffffff;
    font-size: 13px;
    line-height: 1.4;
}

/* 右侧显示区域样式 */
.display-area {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

/* 布局预览容器样式 */
.layout-preview-container {
    background: rgba(255, 255, 255, 0.03);
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 12px 16px;
}

.layout-info {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
}

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

.layout-title {
    color: #000000;
    font-size: 14px;
    font-weight: 600;
    white-space: nowrap;
}

.layout-summary {
    color: #FFD600;
    font-size: 13px;
    font-weight: 500;
    white-space: nowrap;
}

.layout-details {
    display: flex;
    align-items: center;
    gap: 5px;
    flex-wrap: wrap;
}

.column-info {
    display: flex;
    align-items: center;
    gap: 5px;
    white-space: nowrap;
}

.column-label {
    color: #ccc;
    font-size: 12px;
}

.column-count {
    color: #007acc;
    font-size: 12px;
    font-weight: 600;
}

.no-data {
    color: #888;
    font-size: 13px;
}

/* 图片容器样式 */
.image-container {
    position: relative;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    min-height: 1000px; /* 改为min-height，让容器可以自适应内容 */
    max-height: calc(100vh - 100px); /* 最大高度为视窗高度减去100px */
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: auto; /* 保持auto以支持滚动和拖动 */
}

.image-display {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.image-display img {
    max-width: 100%;
    max-height: 100%;
    border-radius: 8px;
}

/* 完整识别结果区域 */
.recognition-result-container {
    background: rgba(255, 255, 255, 0.72);
    border-radius: 12px;
    border: 1px solid rgba(107, 161, 91, 0.20);
    padding: 20px;
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    box-shadow: 0 18px 48px rgba(38, 70, 50, 0.10);
}

.result-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid rgba(107, 161, 91, 0.20);
}

.result-header h3 {
    color: #1f2a1f;
    font-size: 16px;
    font-weight: 600;
    margin: 0;
}

.copy-btn {
    background: rgba(181, 216, 255, 0.55);
    color: #1f2a1f;
    border: 1px solid rgba(91, 123, 184, 0.35);
    border-radius: 12px;
    padding: 8px 16px;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
}

.copy-btn:hover {
    background: rgba(181, 216, 255, 0.72);
    transform: translateY(-1px);
    box-shadow: 0 12px 28px rgba(38, 70, 50, 0.14);
    border-color: rgba(91, 123, 184, 0.45);
}

.copy-btn:active {
    transform: translateY(0);
    background: rgba(181, 216, 255, 0.62);
}

.result-content {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.result-text {
    background: rgba(255, 255, 255, 0.78);
    border-radius: 8px;
    padding: 15px;
    font-family: 'Courier New', monospace;
    font-size: 16px;
    line-height: 1.8;
    color: #1f2a1f;
    white-space: pre-wrap;
    word-break: break-all;
    min-height: 100px;
    border: 1px solid rgba(107, 161, 91, 0.18);
}

.corrected-char {
    position: relative;
}

.corrected-char::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    bottom: -1px;
    border-bottom: 2px solid rgba(186, 104, 200, 0.9); /* 淡紫色 */
}

.layout-features {
    background: rgba(197, 219, 179, 0.22);
    border-radius: 8px;
    padding: 12px;
    border-left: 3px solid rgba(107, 161, 91, 0.65);
}

.layout-features h4 {
    color: #1f2a1f;
    font-size: 14px;
    font-weight: 600;
    margin: 0 0 8px 0;
}

.layout-features p {
    color: rgba(31, 42, 31, 0.72);
    font-size: 13px;
    margin: 4px 0;
    line-height: 1.4;
}

/* 字符修正对话框样式 */
/* 炫酷侧边小面板样式 */
.correction-modal {
    position: fixed;
    inset: 0;
    background: transparent; /* 不要遮罩 */
    backdrop-filter: none;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: flex-end; /* 向右对齐 */
    padding: 24px;
    padding-right: 60px; /* 距离右边缘60px */
    pointer-events: none; /* 允许点击穿透到页面；面板本身可点击 */
}

.correction-content {
    position: relative;
    width: clamp(320px, 30vw, 400px);
    max-height: 85vh;
    pointer-events: auto;
    background: linear-gradient(145deg, #1c1c1c, #2a2a2a);
    border-radius: 18px;
    border: 1px solid rgba(64, 150, 255, 0.28);
    box-shadow: 0 10px 30px rgba(0,0,0,0.5), 0 0 20px rgba(64,150,255,0.1);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    animation: modalSlideIn 0.32s ease-out;
}

@keyframes modalSlideIn {
    from { opacity: 0; transform: translateX(20px) translateY(-10px) scale(0.98); }
    to { opacity: 1; transform: translateX(0) translateY(0) scale(1); }
}
.btn-delete {
    background: linear-gradient(135deg, #dc3545, #c82333);
    color:#fff;
    border:none;
    border-radius:6px;
    padding:8px 14px;
    font-weight:600;
    font-size:13px;
    transition: all 0.3s ease;
}
.btn-delete:hover {
    background: linear-gradient(135deg, #c82333, #a71e2a);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(220,53,69,0.3);
}

/* legacy modal overlay removed: use left-top side panel */

.correction-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 25px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.05);
}

.correction-header h3 {
    color: #ffffff;
    font-size: 18px;
    font-weight: 600;
    margin: 0;
}

.close-btn {
    background: none;
    border: none;
    color: #aaa;
    font-size: 24px;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.close-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #ffffff;
}

.correction-body {
    padding: 25px;
    display: flex;
    gap: 20px;
}

.char-preview {
    flex-shrink: 0;
    width: 120px;
    height: 120px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid rgba(255, 255, 255, 0.1);
}

.char-preview img {
    max-width: 100%;
    max-height: 100%;
    border-radius: 4px;
}

.correction-form {
    flex: 1;
}

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

.form-group label {
    display: block;
    color: #ccc;
    font-weight: 500;
    margin-bottom: 8px;
    font-size: 14px;
}

.original-char {
    display: inline-block;
    background: rgba(255, 255, 255, 0.1);
    color: #FFD600;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 18px;
    font-weight: 600;
    min-width: 40px;
    text-align: center;
}

.confidence-value {
    color: #ffffff;
    font-weight: 600;
    font-size: 16px;
}

#correctedChar {
    width: 100%;
    padding: 12px 15px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 6px;
    color: #ffffff;
    font-size: 16px;
    font-weight: 600;
    text-align: center;
    outline: none;
    transition: all 0.3s ease;
}

#correctedChar:focus {
    border-color: #007acc;
    background: rgba(255, 255, 255, 0.15);
    box-shadow: 0 0 0 2px rgba(0, 122, 204, 0.2);
}

.correction-footer {
    padding: 20px 25px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    gap: 15px;
    justify-content: flex-end;
    background: rgba(255, 255, 255, 0.02);
}

.btn-cancel, .btn-confirm {
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 80px;
}

.btn-cancel {
    background: rgba(255, 255, 255, 0.1);
    color: #ccc;
}

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

.btn-confirm {
    background: linear-gradient(135deg, #28a745 0%, #1e7e34 100%);
    color: white;
}

.btn-confirm:hover {
    background: linear-gradient(135deg, #1e7e34 0%, #155724 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(40, 167, 69, 0.3);
}

/* 结果显示 */
.result-info {
    background: rgba(255, 255, 255, 0.03);
    border-radius: 6px;
    padding: 15px;
    margin-bottom: 15px;
}

.info-item {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
}

.info-item:last-child {
    margin-bottom: 0;
}

.label {
    color: #aaa;
    font-weight: 500;
}

.value {
    color: #ffffff;
    font-weight: 600;
}

/* 显示区域 */
.display-area {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    padding: 30px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.image-container {
    margin-bottom: 30px;
}

.image-placeholder {
    border: 2px dashed #555;
    border-radius: 8px;
    padding: 60px 20px;
    text-align: center;
    color: #888;
    background: rgba(255, 255, 255, 0.02);
}

.annotated-image {
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

#resultImage {
    width: 100%;
    height: auto;
    display: block;
}

/* 数据表格 */
.data-table-container {
    margin-top: 30px;
}

.data-table-container h3 {
    font-size: 18px;
    font-weight: 600;
    color: #ffffff;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 1px solid #333;
}

.table-wrapper {
    background: rgba(255, 255, 255, 0.03);
    border-radius: 8px;
    overflow: hidden;
    max-height: 300px;
    overflow-y: auto;
}

.detection-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.detection-table th {
    background: rgba(255, 255, 255, 0.1);
    color: #ffffff;
    font-weight: 600;
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid #333;
    position: sticky;
    top: 0;
}

.detection-table td {
    padding: 10px 15px;
    border-bottom: 1px solid #222;
    color: #ccc;
}

.detection-table tr:hover {
    background: rgba(255, 255, 255, 0.05);
}

.color-indicator {
    display: inline-block;
    width: 16px;
    height: 16px;
    border-radius: 3px;
    margin-right: 8px;
    vertical-align: middle;
}

/* 可点击的颜色项 */
.color-item-clickable {
    user-select: none;
}

.color-item-clickable:hover {
    background-color: rgba(255, 255, 255, 0.1) !important;
    transform: translateX(2px);
}

.color-item-clickable.active {
    background-color: rgba(76, 175, 80, 0.3) !important;
    border: 1px solid #4CAF50;
    box-shadow: 0 0 8px rgba(76, 175, 80, 0.5);
}

.color-item-clickable:active {
    transform: scale(0.98);
}

/* 加载指示器 */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    backdrop-filter: blur(5px);
}

.loading-content {
    text-align: center;
    color: white;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-top: 4px solid #007acc;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

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

.loading-content p {
    font-size: 16px;
    color: #ccc;
}

/* 响应式设计 */
@media (max-width: 1200px) {
    .main-content {
        grid-template-columns: 1fr;
        gap: 30px;
    }

    .control-panel {
        order: 2;
    }

    .display-area {
        order: 1;
    }
}

/* 显示模式按钮样式 */
.display-mode-buttons {
    display: flex;
    gap: 8px;
    margin: 10px 0;
}

.mode-btn {
    flex: 1;
    padding: 8px 12px;
    border: 2px solid #e0e0e0;
    background: white;
    color: #666;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.mode-btn:hover {
    border-color: #667eea;
    color: #667eea;
}

.mode-btn.active {
    background: #667eea;
    border-color: #667eea;
    color: white;
}

.mode-btn:disabled {
    background: #f5f5f5;
    border-color: #ddd;
    color: #999;
    cursor: not-allowed;
}

/* 按列显示样式 */
.column-display-container {
    background: white;
    border-radius: 12px;
    padding: 20px;
    margin-top: 20px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.column-display-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid #f0f0f0;
}

.column-display-header h3 {
    margin: 0;
    color: #333;
    font-size: 18px;
}

.back-btn {
    background: #667eea;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s ease;
}

.back-btn:hover {
    background: #5a6fd8;
    transform: translateY(-1px);
}

.column-display-content {
    display: flex;
    flex-direction: row-reverse; /* 从右到左显示列 */
    gap: 20px;
    overflow-x: auto;
    padding: 10px 0;
}

.column-item {
    min-width: 120px;
    text-align: center;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    padding: 15px 10px;
    background: #fafafa;
    position: relative;
}

.column-header {
    background: #667eea;
    color: white;
    padding: 8px;
    margin: -15px -10px 10px -10px;
    border-radius: 6px 6px 0 0;
    font-weight: bold;
    font-size: 16px;
}

.column-chars {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.char-item {
    background: white;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 8px;
    font-size: 18px;
    font-weight: bold;
    color: #333;
    min-height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.char-item:hover {
    background: #f0f8ff;
    border-color: #667eea;
    transform: scale(1.05);
}

.char-item.high-confidence {
    background: #e8f5e8;
    border-color: #4caf50;
}

.char-item.medium-confidence {
    background: #fff3cd;
    border-color: #ffc107;
}

.char-item.low-confidence {
    background: #f8d7da;
    border-color: #dc3545;
}

@media (max-width: 768px) {
    .container {
        padding: 15px;
    }

    .header {
        flex-direction: column;
        text-align: center;
        gap: 20px;
    }

    .title h2, .title p {
        text-align: center;
    }

    .control-panel, .display-area {
        padding: 20px;
    }
}

/* 通用模态弹窗（操作指南等） */
.modal {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 100% !important;
    height: 100% !important;
    background: rgba(0, 0, 0, 0.65) !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    z-index: 9999 !important;
}

.modal.hidden {
    display: none !important;
}

.modal .modal-content {
    position: relative !important;
    background: #1e1e1e !important;
    border-radius: 12px !important;
    padding: 24px 28px !important;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.7) !important;
    color: #ffffff !important;
    max-width: 720px !important;
    max-height: 80vh !important;
    overflow-y: auto !important;
    margin: 20px !important;
}

.modal .modal-content h2 {
    margin-top: 0 !important;
    margin-bottom: 12px !important;
    font-size: 20px !important;
    color: #00bcd4 !important;
}

.modal .modal-content h3 {
    margin-top: 16px !important;
    margin-bottom: 8px !important;
    font-size: 16px !important;
    color: #26c6da !important;
}

.modal .modal-content ul {
    margin: 0 0 8px 20px !important;
    padding: 0 !important;
    font-size: 14px !important;
    line-height: 1.8 !important;
}

.modal .modal-content li {
    margin-bottom: 4px !important;
}

.modal .modal-content button {
    margin-top: 16px !important;
    padding: 8px 20px !important;
    background: linear-gradient(135deg, #00bcd4, #26c6da) !important;
    border: none !important;
    border-radius: 6px !important;
    color: #fff !important;
    font-size: 14px !important;
    cursor: pointer !important;
    transition: all 0.2s ease !important;
}

.modal .modal-content button:hover {
    background: linear-gradient(135deg, #26c6da, #4dd0e1) !important;
    transform: translateY(-1px) !important;
    box-shadow: 0 4px 12px rgba(0, 188, 212, 0.3) !important;
}