/* ========================================
   继电保护装置定检作业数据管理系统 - 公共样式
   ========================================
   色彩系统:
   - 主色(Primary): #3b82f6 蓝色系 - 用于导航、主要按钮、链接
   - 辅助色(Accent): #22c55e 绿色系 - 用于成功状态、完成标记
   - 警告色(Warn):   #f59e0b 琥珀色 - 用于警告提示
   - 危险色(Danger):  #ef4444 红色系 - 用于风险提示、删除操作
   - 中性色(Neutral): #64748b 灰色系 - 用于文本、边框、背景
   ======================================== */

/* 表单控件统一样式 */
.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.375rem;
}
.form-label {
    font-size: 0.8125rem;
    font-weight: 500;
    color: #475569;
}
.form-input, .form-select, .form-textarea {
    width: 100%;
    padding: 0.5rem 0.75rem;
    border: 1px solid #e2e8f0;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    color: #1e293b;
    background-color: #fff;
    transition: all 0.2s;
    outline: none;
}
.form-input:focus, .form-select:focus, .form-textarea:focus {
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59,130,246,0.1);
}
.form-textarea {
    resize: vertical;
    min-height: 80px;
}

/* 按钮样式 */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.375rem;
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
    outline: none;
}
.btn-primary {
    background-color: #3b82f6;
    color: white;
}
.btn-primary:hover {
    background-color: #2563eb;
}
.btn-success {
    background-color: #22c55e;
    color: white;
}
.btn-success:hover {
    background-color: #16a34a;
}
.btn-outline {
    background-color: transparent;
    border: 1px solid #e2e8f0;
    color: #475569;
}
.btn-outline:hover {
    background-color: #f8fafc;
    border-color: #cbd5e1;
}

/* 表格样式 */
.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
}
.data-table th {
    background-color: #f1f5f9;
    color: #475569;
    font-weight: 600;
    padding: 0.625rem 0.75rem;
    text-align: center;
    border: 1px solid #e2e8f0;
    white-space: nowrap;
}
.data-table td {
    padding: 0.5rem 0.75rem;
    border: 1px solid #e2e8f0;
    text-align: center;
    vertical-align: middle;
}
.data-table td input,
.data-table td select {
    width: 100%;
    padding: 0.25rem 0.375rem;
    border: 1px solid #e2e8f0;
    border-radius: 0.375rem;
    font-size: 0.8125rem;
    text-align: center;
    outline: none;
    background: transparent;
}
.data-table td input:focus,
.data-table td select:focus {
    border-color: #3b82f6;
    box-shadow: 0 0 0 2px rgba(59,130,246,0.1);
}
.data-table tbody tr:hover {
    background-color: #f8fafc;
}

/* 卡片内部导航 */
.sub-nav {
    display: flex;
    gap: 0.25rem;
    background: #f1f5f9;
    padding: 0.25rem;
    border-radius: 0.75rem;
    overflow-x: auto;
}
.sub-nav a, .sub-nav button {
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    font-size: 0.8125rem;
    font-weight: 500;
    color: #64748b;
    white-space: nowrap;
    transition: all 0.2s;
    text-decoration: none;
    border: none;
    background: transparent;
    cursor: pointer;
}
.sub-nav a:hover, .sub-nav button:hover {
    color: #3b82f6;
    background: white;
}
.sub-nav a.active, .sub-nav button.active {
    color: #3b82f6;
    background: white;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

/* 返回按钮 */
.back-link {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    color: #64748b;
    font-size: 0.875rem;
    text-decoration: none;
    margin-bottom: 1rem;
    transition: color 0.2s;
}
.back-link:hover {
    color: #3b82f6;
}

/* 状态标签 */
.status-tag {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.125rem 0.5rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 500;
}
.status-pass { background: #dcfce7; color: #166534; }
.status-fail { background: #fee2e2; color: #991b1b; }
.status-pending { background: #f1f5f9; color: #475569; }

/* 响应式表格容器 */
.table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border-radius: 0.75rem;
    border: 1px solid #e2e8f0;
}

/* 风险项样式 */
.risk-item {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 0.75rem;
    padding: 1rem;
    transition: all 0.2s;
}
.risk-item:hover {
    border-color: #fbbf24;
    box-shadow: 0 2px 8px rgba(251,191,36,0.1);
}

/* 检查项样式 */
.check-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 0.5rem;
    margin-bottom: 0.5rem;
    flex-wrap: wrap;
    transition: all 0.2s;
}
.check-item:hover {
    background: #f1f5f9;
    border-color: #cbd5e1;
}
.check-item label {
    flex: 1;
    min-width: 200px;
    font-size: 0.875rem;
    color: #334155;
    cursor: pointer;
}
.check-item select {
    min-width: 120px;
}

/* Toast 通知 */
.toast {
    position: fixed;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: #1e293b;
    color: white;
    padding: 0.75rem 1.5rem;
    border-radius: 0.75rem;
    font-size: 0.875rem;
    z-index: 9999;
    opacity: 0;
    transition: all 0.3s ease;
    box-shadow: 0 10px 25px rgba(0,0,0,0.2);
}
.toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* 移动端适配 */
@media (max-width: 640px) {
    .data-table {
        font-size: 0.75rem;
    }
    .data-table th, .data-table td {
        padding: 0.375rem 0.5rem;
    }
    .btn {
        padding: 0.375rem 0.75rem;
        font-size: 0.8125rem;
    }
    .check-item {
        flex-direction: column;
        align-items: flex-start;
    }
    .check-item select {
        width: 100%;
    }
}

/* 日期输入框样式修复 */
input[type="date"] {
    appearance: auto;
    -webkit-appearance: auto;
    min-height: 38px;
}
input[type="date"]::-webkit-calendar-picker-indicator {
    cursor: pointer;
}
