/* 激光检测页面样式 */

/* 基础样式重置 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    line-height: 1.5;
    color: #333;
    background: #f8f9fa;
}

/* 顶部标题栏 */
.top-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 60px;
    background: linear-gradient(135deg, #2c3e50, #2980b9);
    color: white;
    z-index: 1000;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.header-content {
    display: flex;
    align-items: center;
    height: 100%;
    padding: 0 20px;
    justify-content: space-between;
}

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

.logo-link {
    display: flex;
    align-items: center;
    text-decoration: none;
    color: white;
}

.logo {
    height: 40px;
    margin-right: 10px;
    filter: brightness(0) invert(1);
}

.header-title {
    font-size: 20px;
    font-weight: 600;
    margin: 0;
}

/* 搜索框容器 */
.search-container {
    position: relative;
    display: flex;
    align-items: center;
}

.search-icon {
    position: absolute;
    left: 15px;
    color: #95a5a6;
}

#search-input {
    width: 250px;
    height: 36px;
    padding: 0 20px 0 40px;
    border: none;
    border-radius: 18px;
    background-color: #ecf0f1;
    color: #2c3e50;
    font-size: 14px;
    transition: width 0.3s ease-in-out, background-color 0.2s;
}

#search-input::placeholder {
    color: #95a5a6;
}

#search-input:focus {
    outline: none;
    width: 300px;
    background-color: #fff;
}

/* 主容器 */
.main-container {
    margin-top: 80px;
    padding: 20px;
    min-height: calc(100vh - 80px);
}

/* 激光器网格 */
.laser-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 20px;
    max-width: 1200px;
    margin: 0 auto;
}

/* 激光器卡片 */
.laser-card {
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    transition: all 0.3s ease;
    position: relative;
    cursor: pointer;
}

.laser-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

/* 卡片操作按钮 */
.card-actions {
    position: absolute;
    top: 10px;
    right: 10px;
    display: flex;
    gap: 5px;
    opacity: 1;
    transition: opacity 0.3s ease;
    z-index: 10;
}

.laser-card:hover .card-actions {
    opacity: 1;
}

.action-btn {
    background: rgba(255, 255, 255, 0.9);
    border: none;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    color: #666;
}

.action-btn:hover {
    background: white;
    transform: scale(1.1);
}

.btn-edit {
    color: #3498db;
}

.btn-delete {
    color: #e74c3c;
}

/* 鼠标拖尾特效样式 */
body {
    cursor: none;
}

#laser-cursor {
    position: fixed;
    width: 10px;
    height: 10px;
    background-color: red;
    border-radius: 50%;
    pointer-events: none;
    transform: translate(-50%, -50%);
    z-index: 9999;
    display: none;
}

.trail-dot {
    position: fixed;
    width: 10px;
    height: 10px;
    background-color: red;
    border-radius: 50%;
    pointer-events: none;
    transform: translate(-50%, -50%);
    z-index: 9998;
    opacity: 1;
    transition: opacity 0.1s linear, transform 0.1s linear;
    animation: trail-fade-out 0.5s linear forwards;
}

@keyframes trail-fade-out {
    from {
        opacity: 1;
        transform: scale(1.1) translate(-50%, -50%);
    }
    to {
        opacity: 0;
        transform: scale(0.1) translate(-50%, -50%);
    }
}

/* 仅在支持精细指针输入的设备（如鼠标）上显示自定义光标 */
@media (pointer: fine) {
    html {
        cursor: none;
    }
    
    #laser-cursor {
        display: block;
    }
}

/* 激光器图片 */
.laser-image {
    height: 200px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.laser-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.laser-card:hover .laser-image img {
    transform: scale(1.05);
}

.laser-image::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, rgba(52, 152, 219, 0.3), rgba(155, 89, 182, 0.3));
    z-index: 1;
}

/* 激光器信息 */
.laser-info {
    padding: 20px;
}

.laser-info h3 {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 10px;
    color: #2c3e50;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.laser-title-section {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
}

.laser-title-left {
    display: flex;
    align-items: center;
    gap: 15px;
}

.laser-title-right {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 5px;
    font-size: 12px;
    color: #666;
}

.laser-location-inline {
    display: flex;
    align-items: center;
    gap: 5px;
}

.laser-manager-inline {
    display: flex;
    align-items: center;
    gap: 5px;
}

.laser-status {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
    margin-bottom: 15px;
}

.status-normal {
    background: #d4edda;
    color: #155724;
}

.status-maintenance {
    background: #fff3cd;
    color: #856404;
}

.status-fault {
    background: #f8d7da;
    color: #721c24;
}

.status-off {
    background: #e2e3e5;
    color: #383d41;
}

.laser-params {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-bottom: 15px;
}

.param-item {
    display: flex;
    flex-direction: column;
}

.param-label {
    font-size: 12px;
    color: #666;
    margin-bottom: 2px;
}

.param-value {
    font-size: 14px;
    font-weight: 500;
    color: #2c3e50;
}

.laser-location {
    font-size: 12px;
    color: #666;
    margin-top: 10px;
}

.laser-manager {
    font-size: 12px;
    color: #666;
    margin-top: 5px;
}

.laser-manager {
    font-size: 12px;
    color: #666;
    margin-top: 8px;
}

/* 悬浮添加按钮 */
.fab {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, #3498db, #2980b9);
    border: none;
    color: white;
    font-size: 24px;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(52, 152, 219, 0.4);
    transition: all 0.3s ease;
    z-index: 1000;
}

.fab:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(52, 152, 219, 0.6);
}

/* 模态框样式 */
.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
}

.modal-content {
    background-color: white;
    margin: 3% auto;
    padding: 30px;
    border-radius: 12px;
    width: 95%;
    max-width: 900px;
    max-height: 85vh;
    overflow-y: auto;
    position: relative;
    animation: modalSlideIn 0.3s ease;
}

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

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

.close-button {
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 28px;
    font-weight: bold;
    color: #aaa;
    cursor: pointer;
    transition: color 0.2s;
}

.close-button:hover {
    color: #333;
}

.modal-content h2 {
    margin-bottom: 20px;
    color: #2c3e50;
    font-size: 24px;
}

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

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
    color: #2c3e50;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    font-size: 14px;
    transition: border-color 0.3s ease;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #3498db;
}

.form-group button {
    background: linear-gradient(135deg, #3498db, #2980b9);
    color: white;
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.3s ease;
    width: 100%;
}

.form-group button:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(52, 152, 219, 0.4);
}

/* 激光器详情样式 */
.laser-detail {
    text-align: center;
}

.laser-detail-image {
    width: 100%;
    height: 250px;
    object-fit: cover;
    border-radius: 8px;
    margin-bottom: 20px;
}

.laser-detail-info {
    text-align: left;
}

.detail-param {
    display: flex;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px solid #eee;
}

.detail-param:last-child {
    border-bottom: none;
}

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

.detail-value {
    font-weight: 600;
    color: #2c3e50;
}

/* 检测信息样式 */
.detection-info {
    margin-top: 20px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
}

.detection-info h3 {
    margin-bottom: 15px;
    color: #2c3e50;
    font-size: 18px;
}

.latest-detection {
    display: flex;
    align-items: center;
    margin-bottom: 15px;
    padding: 10px;
    background: white;
    border-radius: 6px;
    border-left: 4px solid #3498db;
}

.latest-detection i {
    margin-right: 10px;
    color: #3498db;
}

.history-detection-btn {
    background: linear-gradient(135deg, #27ae60, #2ecc71);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s ease;
}

.history-detection-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(46, 204, 113, 0.4);
}

.detection-actions {
    display: flex;
    gap: 10px;
    margin-top: 15px;
}

.add-detection-btn {
    background: linear-gradient(135deg, #e74c3c, #c0392b);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
}

.add-detection-btn:hover {
    background: linear-gradient(135deg, #c0392b, #a93226);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(231, 76, 60, 0.4);
}

/* 图片展示区域 */
.laser-images-section {
    margin-top: 30px;
}

.laser-images-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-top: 15px;
}

.laser-image-item {
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.laser-image-item img {
    width: 100%;
    height: 200px;
    object-fit: cover;
}

.laser-image-caption {
    padding: 15px;
    background: #f8f9fa;
}

.laser-image-caption h4 {
    margin-bottom: 8px;
    color: #2c3e50;
    font-size: 16px;
}

.laser-image-caption p {
    color: #666;
    font-size: 14px;
    line-height: 1.5;
}

/* 历史检测弹窗样式 */
.history-modal .modal-content {
    max-width: 800px;
}

.history-list {
    max-height: 400px;
    overflow-y: auto;
}

.history-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    margin-bottom: 10px;
    background: #f8f9fa;
    border-radius: 6px;
    border-left: 4px solid #3498db;
}

.history-item:hover {
    background: #e9ecef;
}

.history-date {
    font-weight: 600;
    color: #2c3e50;
}

.history-status {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
}

.history-status.normal {
    background: #d4edda;
    color: #155724;
}

.history-status.warning {
    background: #fff3cd;
    color: #856404;
}

.history-status.error {
    background: #f8d7da;
    color: #721c24;
}

/* 加载动画 */
.loader-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.9);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 3000;
}

.loader-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #3498db;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 15px;
}

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

    100% {
        transform: rotate(360deg);
    }
}

.loader-container p {
    color: #666;
    font-size: 16px;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .main-container {
        padding: 15px;
        margin-top: 70px;
    }

    .laser-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    .laser-card {
        margin-bottom: 15px;
    }

    .laser-image {
        height: 150px;
    }

    .laser-info {
        padding: 15px;
    }

    .laser-info h3 {
        font-size: 16px;
    }

    .laser-title-section {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .laser-title-right {
        align-items: flex-start;
    }

    .laser-params {
        grid-template-columns: 1fr;
        gap: 8px;
    }

    .detection-actions {
        flex-direction: column;
        gap: 8px;
    }

    .fab {
        bottom: 20px;
        right: 20px;
        width: 50px;
        height: 50px;
        font-size: 20px;
    }

    .modal-content {
        margin: 10% auto;
        padding: 20px;
        width: 95%;
    }

    .header-title {
        font-size: 18px;
    }

    #search-input {
        width: 200px;
    }

    #search-input:focus {
        width: 220px;
    }
}

@media (max-width: 480px) {
    .header-content {
        padding: 0 15px;
    }

    .header-title {
        font-size: 16px;
    }

    .logo {
        height: 30px;
    }

    #search-input {
        width: 150px;
    }

    #search-input:focus {
        width: 170px;
    }
}