﻿/* CSS Document */
/*
编写者：享健丽科技
时间：2025年9月11日
*/

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body, html {
    height: 100%;
    width: 100%;
    overflow: hidden;
    background: #f5f7fa;
    color: #333;
}

.container {
    display: flex;
    height: 100vh;
}

/* 左侧边栏样式 */
.sidebar {
    width: 260px;
    background: linear-gradient(135deg, #2c3e50 0%, #3498db 100%);
    color: white;
    padding: 20px;
    display: flex;
    flex-direction: column;
    box-shadow: 0 0 15px rgba(0, 0, 0, 0.1);
}

.user-info {
    text-align: center;
    padding: 20px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}

.user-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: #ecf0f1;
    margin: 0 auto 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    color: #3498db;
}

.title-name {
    font-size: 1.2rem;
    margin-bottom: 5px;
}

.nav-buttons {
    padding: 20px 0;
    flex: 1;
}

.nav-btn {
    display: flex;
    align-items: center;
    padding: 12px 15px;
    margin-bottom: 8px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s;
    user-select: none;
}

.nav-btn:hover {
    background: rgba(255, 255, 255, 0.1);
}

.nav-btn i {
    margin-right: 10px;
    font-size: 1.2rem;
}

.company-info {
    padding: 15px 0 0;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
    font-size: 0.8rem;
    opacity: 0.7;
}
.company-info a, a:visited, a:hover, a:link {
    color:#fff;
    text-decoration:none;
}

/* 右侧主内容区样式 */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.top-bar {
    background: white;
    padding: 10px 25px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.search-box {
    display: flex;
    align-items: center;
    background: #f5f7fa;
    border-radius: 10px;
    padding: 5px 15px;
    width: calc(100%-10px);
}

.search-box input {
    border: none;
    background: transparent;
    padding: 8px;
    width: 100%;
    outline: none;
}

.tools {
    display: flex;
    gap: 15px;
    margin-left:auto;
}

.tool-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #f2f3f7;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s;
}

.tool-btn:hover {
    background: #3498db;
    color: white;
}

.workspace {
    flex: 1;
    padding: 25px;
    
}

.ocr-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 25px;
    height: calc(100% - 5px);
}

.upload-section, .result-section {
    background: white;
    border-radius: 12px;
    padding: 25px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    height: calc(100vh - 110px);
}

.section-title {
    font-size: 1.2rem;
    margin-bottom: 20px;
    color: #2c3e50;
    padding-bottom: 10px;
    border-bottom: 2px solid #3498db;
}

#file-input {
    display: none;
}

.upload-area {
    flex: 1;
    border: 3px dashed #3498db;
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 30px;
    text-align: center;
    transition: all 0.3s;
    cursor: pointer;
}

.upload-area:hover {
    background: rgba(52, 152, 219, 0.05);
}

.upload-icon {
    font-size: 3.5rem;
    color: #3498db;
    margin-bottom: 20px;
}

.upload-text {
    margin-bottom: 20px;
    color: #7f8c8d;
    user-select: none;
}

.btn {
    background: #3498db;
    color: white;
    border: none;
    padding: 12px 25px;
    border-radius: 50px;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin:10px auto;
    user-select: none;
}

.btn i {
    margin-right: 8px;
}

.btn:hover {
    background: #2980b9;
    transform: translateY(-2px);
    box-shadow: 0 5px 10px rgba(0, 0, 0, 0.1);
}

.image-preview {
    max-width: 100%;
    max-height: 450px;
    margin-top: 20px;
    border-radius: 8px;
    display: block;
    object-fit: contain;
}

.result-area {
    flex: 1;
    padding: 15px;
    background: #f9f9f9;
    border-radius: 8px;
    border: 1px solid #e0e0e0;
    margin-bottom: 15px;
    overflow-y: auto;
}

.edit-tools {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
    flex-wrap: wrap;
}

.edit-btn {
    padding: 8px 15px;
    background: #ecf0f1;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    display: flex;
    align-items: center;
    transition: all 0.3s;
    user-select: none;
}

.edit-btn i {
    margin-right: 5px;
}

.edit-btn:hover {
    /*background: #3498db;
    color: white;*/
    background: #000;
    color:yellow;
}

.keyword-highlight {
    background: #fff8e1;
    padding: 2px 4px;
    border-radius: 3px;
    border: 1px solid #ffd54f;
}

.preview-container {
    position: relative;
    width: 100%;
    height: 100%;
    margin-top: 20px;
    overflow: hidden;
    border-radius: 8px;
    display: none;
    align-items: center;
    justify-content: center;
    user-select: none;
}

.image-controls {
    position: absolute;
    bottom: 10px;
    right: 10px;
    display: flex;
    gap: 8px;
    background: #d0d0d0;
    padding: 6px;
    border-radius: 4px;
}

.control-btn {
    width: 32px;
    height: 32px;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.2);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
}

.control-btn:hover {
    background: #3498db;
}

.scanner {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 100px; /* 扫描线的高度 */
  background: linear-gradient(
    to bottom,
    rgba(10, 200, 10, 0.1) 0%,   /* 上部透明 */
    rgba(0, 250, 0, 0.5) 50%,   /* 中部浓 */
    rgba(10, 200, 10, 0.1) 100%    /* 下部透明 */
  ); /* 扫描线颜色 */
  animation: scanning 1s linear infinite;
  z-index: 20; /* 确保扫描线在其它层之上 */
  display:none;
}

/* 扫描线移动动画 */
@keyframes scanning {
  0% {
    top: 0;
  }
  100% {
    top:100%;
  }
}

@media (max-width: 992px) {
    .ocr-container {
        grid-template-columns: 1fr;
    }
    
    .sidebar {
        width: 80px;
    }
    
    .user-info, .company-info, .nav-btn span {
        display: none;
    }
    
    .nav-btn {
        justify-content: center;
    }
    
    .nav-btn i {
        margin-right: 0;
        font-size: 1.5rem;
    }
    .workspace{
        overflow-y: auto;
    }
}

/* 下拉菜单样式 */
.dropdown-menu {
    position: absolute;
    top: 50px;
    right: 0;
    background: white;
    width: 150px;
    border-radius: 8px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.15);
    padding: 10px 0;
    margin-top: 10px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: all 0.3s ease;
    z-index: 101;
}

.active {
   /* opacity: 1;
    visibility: visible;*/
    transform: translateY(0);
}

.dropdown-menu ul {
    list-style: none;
}

.dropdown-menu li {
    padding: 10px 20px;
    transition: all 0.3s ease;
    color:#333;
}

.dropdown-menu li:hover {
    background-color: #e5e7ea;
}

.dropdown-menu a {
    color: #333;
    text-decoration: none;
    display: flex;
    align-items: center;
}

.dropdown-menu i {
    margin-right: 10px;
    color: #4b6cb7;
}

/* 模态框样式 */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    justify-content: center;
    align-items: center;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: white;
    width: 400px;
    max-width: 90%;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 5px 30px rgba(0, 0, 0, 0.2);
    animation: modalFadeIn 0.3s ease;
}

@keyframes modalFadeIn {
    from {
        opacity: 0;
        transform: translateY(-50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.modal-header {
    background: linear-gradient(90deg, #4b6cb7 0%, #182848 100%);
    color: white;
    padding: 20px;
    text-align: center;
    position: relative;
}

.close-modal {
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 24px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.close-modal:hover {
    color: #ffcc00;
}

.modal-body {
    padding: 30px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #555;
}

.form-group input {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 16px;
    transition: all 0.3s ease;
}

.form-group input:focus {
    border-color: #4b6cb7;
    box-shadow: 0 0 0 2px rgba(75, 108, 183, 0.2);
    outline: none;
}

.input-with-button {
    display: flex;
}

.input-with-button input {
    flex: 1;
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
}

.get-code-btn {
    background: #4b6cb7;
    color: white;
    border: none;
    padding: 0 15px;
    border-top-right-radius: 6px;
    border-bottom-right-radius: 6px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.3s ease;
}

.get-code-btn:hover:not(.disabled) {
    background: #3a5999;
}

.get-code-btn.disabled {
    background: #ccc;
    cursor: not-allowed;
}

.submit-btn {
    width: 100%;
    background: linear-gradient(90deg, #4b6cb7 0%, #182848 100%);
    color: white;
    border: none;
    padding: 14px;
    border-radius: 6px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 10px;
}

.submit-btn:hover {
    opacity: 0.9;
    transform: translateY(-2px);
}

