/* 智能监理通知单生成系统 - 样式表 */

/* ==================== 基础样式 ==================== */
* {
    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;
    font-size: 14px;
    line-height: 1.6;
    color: #333;
    background: #f5f7fa;
    min-height: 100vh;
}

/* ==================== 布局 ==================== */
.app-container {
    display: flex;
    min-height: 100vh;
}

/* 侧边栏 */
.sidebar {
    width: 260px;
    background: linear-gradient(180deg, #1a1a2e 0%, #16213e 100%);
    color: #fff;
    padding: 20px 0;
    position: fixed;
    height: 100vh;
    overflow-y: auto;
    z-index: 100;
}

.logo {
    padding: 20px 25px;
    font-size: 18px;
    font-weight: bold;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    margin-bottom: 20px;
}

.logo i {
    margin-right: 10px;
    color: #00d4ff;
}

.nav-menu {
    padding: 0 10px;
}

.nav-item {
    display: flex;
    align-items: center;
    padding: 14px 20px;
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    border-radius: 8px;
    margin-bottom: 5px;
    transition: all 0.3s ease;
}

.nav-item:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}

.nav-item.active {
    background: linear-gradient(90deg, #00d4ff 0%, #0099cc 100%);
    color: #fff;
    box-shadow: 0 4px 15px rgba(0, 212, 255, 0.3);
}

.nav-item i {
    width: 24px;
    margin-right: 12px;
    text-align: center;
}

/* 用户信息 */
.user-info {
    padding: 15px 20px;
    margin: 0 10px 15px 10px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    color: #fff;
}

.user-name {
    font-size: 14px;
    font-weight: bold;
    margin-bottom: 8px;
}

.user-usage {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.7);
}

.user-usage span {
    color: #00d4ff;
    font-weight: bold;
}

.btn-logout {
    width: 100%;
    margin-top: 10px;
    padding: 8px 12px;
    background: rgba(220, 53, 69, 0.8);
    color: #fff;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.btn-logout:hover {
    background: rgba(220, 53, 69, 1);
}

.admin-nav {
    margin-top: 10px;
    background: rgba(255, 193, 7, 0.2);
    border: 1px solid rgba(255, 193, 7, 0.3);
}

.admin-nav:hover {
    background: rgba(255, 193, 7, 0.3);
}

/* API状态 */
.api-status {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 20px;
    background: rgba(0, 0, 0, 0.2);
}

.api-status h4 {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 12px;
    color: rgba(255, 255, 255, 0.6);
}

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

.status-badge {
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 500;
}

.status-badge.available {
    background: #28a745;
    color: #fff;
}

.status-badge.unavailable {
    background: #dc3545;
    color: #fff;
}

.status-badge.unknown {
    background: #6c757d;
    color: #fff;
}

/* 主内容区 */
.main-content {
    flex: 1;
    margin-left: 260px;
    padding: 30px;
    min-height: 100vh;
}

/* 内容区块 */
.content-section {
    display: none;
}

.content-section.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

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

.content-section h2 {
    font-size: 24px;
    font-weight: 600;
    color: #1a1a2e;
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 2px solid #e9ecef;
}

.content-section h2 i {
    margin-right: 12px;
    color: #00d4ff;
}

/* ==================== 卡片 ==================== */
.card {
    background: #fff;
    border-radius: 12px;
    padding: 25px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
    margin-bottom: 20px;
}

/* ==================== 表单 ==================== */
.form-row {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
}

.form-group {
    flex: 1;
}

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

.form-group .required {
    color: #dc3545;
}

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

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #00d4ff;
    box-shadow: 0 0 0 3px rgba(0, 212, 255, 0.1);
}

.form-group textarea {
    resize: vertical;
    min-height: 100px;
}

/* ==================== 按钮 ==================== */
.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.btn-primary {
    background: linear-gradient(135deg, #00d4ff 0%, #0099cc 100%);
    color: #fff;
}

.btn-primary:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0, 212, 255, 0.4);
}

.btn-success {
    background: linear-gradient(135deg, #28a745 0%, #218838 100%);
    color: #fff;
}

.btn-success:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(40, 167, 69, 0.4);
}

.btn-danger {
    background: linear-gradient(135deg, #dc3545 0%, #c82333 100%);
    color: #fff;
}

.btn-danger:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(220, 53, 69, 0.4);
}

.btn-secondary {
    background: #6c757d;
    color: #fff;
}

.btn-secondary:hover:not(:disabled) {
    background: #5a6268;
}

.btn-info {
    background: linear-gradient(135deg, #17a2b8 0%, #138496 100%);
    color: #fff;
}

.btn-info:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(23, 162, 184, 0.4);
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #e9ecef;
}

/* ==================== 上传区域 ==================== */
.upload-area {
    border: 2px dashed #dee2e6;
    border-radius: 12px;
    padding: 60px 40px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    background: #f8f9fa;
}

.upload-area:hover {
    border-color: #00d4ff;
    background: #e8f4f8;
}

.upload-area.dragover {
    border-color: #00d4ff;
    background: #e0f7fa;
}

.upload-area i {
    font-size: 48px;
    color: #adb5bd;
    margin-bottom: 15px;
}

.upload-area p {
    color: #6c757d;
    margin-bottom: 15px;
}

.upload-preview {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    margin-top: 20px;
}

.upload-preview .preview-item {
    position: relative;
    width: 150px;
    height: 150px;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.upload-preview .preview-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.upload-preview .preview-item .remove-btn {
    position: absolute;
    top: 5px;
    right: 5px;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: rgba(220, 53, 69, 0.9);
    color: #fff;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
}

.upload-actions {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-top: 20px;
}

/* ==================== 问题分析 ==================== */
.analysis-toolbar,
.preview-toolbar {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    padding-bottom: 20px;
    border-bottom: 1px solid #e9ecef;
}

/* 左右分栏布局 */
.analysis-layout {
    display: flex;
    gap: 20px;
    min-height: 400px;
}

.analysis-images {
    width: 260px;
    flex-shrink: 0;
    border-right: 1px solid #e9ecef;
    padding-right: 20px;
}

.analysis-images h4 {
    font-size: 14px;
    color: #495057;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid #e9ecef;
}

.analysis-images h4 i {
    margin-right: 6px;
    color: #00d4ff;
}

.analysis-image-list {
    max-height: 450px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.analysis-image-item {
    position: relative;
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    border: 2px solid transparent;
    transition: all 0.2s ease;
}

.analysis-image-item:hover {
    border-color: #00d4ff;
}

.analysis-image-item.active {
    border-color: #00d4ff;
    box-shadow: 0 0 0 2px rgba(0, 212, 255, 0.3);
}

.analysis-image-item img {
    width: 100%;
    height: 160px;
    object-fit: cover;
    display: block;
}

.analysis-image-item .image-label {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(0, 0, 0, 0.6);
    color: #fff;
    font-size: 11px;
    padding: 4px 8px;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.analysis-problems {
    flex: 1;
    min-width: 0;
}

.problems-container {
    max-height: 500px;
    overflow-y: auto;
}

.problem-item {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 15px;
    border-left: 4px solid #00d4ff;
    transition: all 0.3s ease;
    display: flex;
    gap: 15px;
    align-items: flex-start;
}

.problem-item:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.problem-thumb {
    width: 200px;
    height: 160px;
    object-fit: cover;
    border-radius: 6px;
    flex-shrink: 0;
    border: 1px solid #dee2e6;
    cursor: pointer;
}

.problem-content {
    flex: 1;
    min-width: 0;
}

.problem-item.severity-严重 {
    border-left-color: #dc3545;
}

.problem-item.severity-一般 {
    border-left-color: #ffc107;
}

.problem-item.severity-轻微 {
    border-left-color: #28a745;
}

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

.problem-type {
    font-weight: 600;
    color: #495057;
}

.problem-severity {
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 12px;
}

.problem-severity.severity-严重 {
    background: #f8d7da;
    color: #721c24;
}

.problem-severity.severity-一般 {
    background: #fff3cd;
    color: #856404;
}

.problem-severity.severity-轻微 {
    background: #d4edda;
    color: #155724;
}

.problem-description {
    color: #495057;
    line-height: 1.6;
}

.problem-location {
    margin-top: 8px;
    font-size: 13px;
    color: #6c757d;
}

.problem-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid #e9ecef;
}

/* ==================== 模型选择器 ==================== */
.model-selector {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 15px;
    background: #f8f9fa;
    border-radius: 8px;
}

.model-selector label {
    font-size: 14px;
    font-weight: 500;
    color: #495057;
    white-space: nowrap;
}

.model-selector select {
    padding: 8px 12px;
    border: 2px solid #e9ecef;
    border-radius: 6px;
    font-size: 14px;
    background: white;
    cursor: pointer;
    min-width: 200px;
}

.model-selector select:focus {
    outline: none;
    border-color: #00d4ff;
}

/* ==================== 空状态 ==================== */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #adb5bd;
}

.empty-state i {
    font-size: 48px;
    margin-bottom: 15px;
}

.empty-state p {
    font-size: 14px;
}

/* ==================== 预览区域 ==================== */
.notice-preview {
    background: #fff;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 40px;
    max-height: 700px;
    overflow-y: auto;
}

.notice-preview .notice-header {
    text-align: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid #333;
}

.notice-preview .notice-number {
    font-size: 12px;
    color: #666;
}

.notice-preview .notice-title {
    font-size: 28px;
    font-weight: bold;
    margin: 15px 0;
}

.notice-preview .notice-info {
    display: grid;
    grid-template-columns: 80px 1fr;
    gap: 10px;
    margin-bottom: 30px;
}

.notice-preview .notice-info div:first-child {
    font-weight: 600;
}

.notice-preview .notice-content {
    line-height: 2;
    text-align: justify;
    text-indent: 2em;
}

.notice-preview .notice-footer {
    margin-top: 40px;
    padding-top: 20px;
}

/* ==================== 规范查询 ==================== */
.search-box {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.search-box input {
    flex: 1;
    padding: 12px 15px;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    font-size: 14px;
}

.search-box input:focus {
    outline: none;
    border-color: #00d4ff;
}

.specs-container {
    max-height: 500px;
    overflow-y: auto;
}

.spec-item {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 15px;
    border-left: 4px solid #00d4ff;
}

.spec-code {
    font-weight: 600;
    color: #00d4ff;
    margin-bottom: 5px;
}

.spec-name {
    font-weight: 500;
    margin-bottom: 5px;
}

.spec-category {
    display: inline-block;
    padding: 2px 10px;
    background: #e9ecef;
    border-radius: 12px;
    font-size: 12px;
    color: #6c757d;
}

/* ==================== 通知弹窗 ==================== */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1000;
}

.toast {
    background: #fff;
    border-radius: 8px;
    padding: 15px 20px;
    margin-bottom: 10px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
    display: flex;
    align-items: center;
    gap: 12px;
    animation: slideIn 0.3s ease;
    min-width: 300px;
}

@keyframes slideIn {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

.toast.success {
    border-left: 4px solid #28a745;
}

.toast.error {
    border-left: 4px solid #dc3545;
}

.toast.warning {
    border-left: 4px solid #ffc107;
}

.toast.info {
    border-left: 4px solid #17a2b8;
}

.toast i {
    font-size: 20px;
}

.toast.success i { color: #28a745; }
.toast.error i { color: #dc3545; }
.toast.warning i { color: #ffc107; }
.toast.info i { color: #17a2b8; }

/* ==================== 加载动画 ==================== */
.loading-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: 2000;
}

.loading-spinner {
    background: #fff;
    padding: 40px 60px;
    border-radius: 12px;
    text-align: center;
}

.loading-spinner i {
    font-size: 48px;
    color: #00d4ff;
    margin-bottom: 15px;
}

.loading-spinner p {
    color: #6c757d;
}

/* ==================== 响应式设计 ==================== */
@media (max-width: 1024px) {
    .sidebar {
        width: 70px;
    }
    
    .sidebar .logo span,
    .sidebar .nav-item span,
    .api-status {
        display: none;
    }
    
    .sidebar .nav-item {
        justify-content: center;
    }
    
    .sidebar .nav-item i {
        margin-right: 0;
    }
    
    .main-content {
        margin-left: 70px;
    }
}

@media (max-width: 768px) {
    .form-row {
        flex-direction: column;
        gap: 15px;
    }
    
    .analysis-toolbar,
    .preview-toolbar {
        flex-wrap: wrap;
    }
    
    .btn {
        padding: 10px 16px;
        font-size: 13px;
    }
}
