/**
 * 通用样式表
 * 电缆检测数据管理系统
 */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    font-size: 14px;
    color: #333;
    background-color: #f5f5f5;
    line-height: 1.6;
}

/* 布局 */
.container {
    display: flex;
    min-height: calc(100vh - 60px);
}

.header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 15px 20px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.header-content {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header h1 {
    font-size: 24px;
    font-weight: 600;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 15px;
}

.role-badge {
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
}

.role-admin {
    background: #ff6b6b;
}

.role-technician {
    background: #f39c12;
}

.role-inspector {
    background: #4ecdc4;
}

.role-viewer {
    background: #95a5a6;
}

.btn-logout {
    color: white;
    text-decoration: none;
    padding: 6px 15px;
    border: 1px solid rgba(255,255,255,0.3);
    border-radius: 4px;
    transition: background 0.3s;
}

.btn-logout:hover {
    background: rgba(255,255,255,0.1);
}

/* 侧边栏 */
.sidebar {
    width: 220px;
    background: #2c3e50;
    min-height: calc(100vh - 60px);
    padding: 20px 0;
}

.main-nav ul {
    list-style: none;
}

.main-nav li {
    margin: 0;
}

.main-nav a {
    display: block;
    padding: 12px 20px;
    color: #bdc3c7;
    text-decoration: none;
    transition: all 0.3s;
    border-left: 3px solid transparent;
}

.main-nav a:hover,
.main-nav a.active {
    background: #34495e;
    color: white;
    border-left-color: #3498db;
}

.main-nav a i {
    margin-right: 10px;
    width: 20px;
    display: inline-block;
    font-style: normal;
}

/* 主内容区 */
.main-content {
    flex: 1;
    padding: 20px;
    max-width: 1400px;
    margin: 0 auto;
    width: 100%;
}

.page-header {
    margin-bottom: 20px;
}

.page-header h2 {
    font-size: 24px;
    color: #2c3e50;
    margin-bottom: 10px;
}

/* 按钮 */
.btn {
    display: inline-block;
    padding: 8px 16px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    text-decoration: none;
    transition: all 0.3s;
    text-align: center;
}

.btn-primary {
    background: #3498db;
    color: white;
}

.btn-primary:hover {
    background: #2980b9;
}

.btn-success {
    background: #27ae60;
    color: white;
}

.btn-success:hover {
    background: #229954;
}

.btn-danger {
    background: #e74c3c;
    color: white;
}

.btn-danger:hover {
    background: #c0392b;
}

.btn-warning {
    background: #f39c12;
    color: white;
}

.btn-warning:hover {
    background: #e67e22;
}

.btn-secondary {
    background: #95a5a6;
    color: white;
}

.btn-secondary:hover {
    background: #7f8c8d;
}

.btn-block {
    display: block;
    width: 100%;
}

.btn-sm {
    padding: 4px 8px;
    font-size: 12px;
}

/* 表单 */
.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
    color: #555;
}

.form-control {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    transition: border-color 0.3s;
}

.form-control:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 2px rgba(52, 152, 219, 0.2);
}

select.form-control {
    cursor: pointer;
}

textarea.form-control {
    resize: vertical;
    min-height: 100px;
}

/* 表格 */
.data-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: 4px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.data-table thead {
    background: #34495e;
    color: white;
}

.data-table th {
    padding: 12px;
    text-align: left;
    font-weight: 600;
}

.data-table td {
    padding: 12px;
    border-bottom: 1px solid #eee;
    white-space: nowrap;
    vertical-align: middle;
    overflow: visible;
}

.data-table tbody tr:hover {
    background: #f8f9fa;
}

.data-table tbody tr:last-child td {
    border-bottom: none;
}

/* 卡片 */
.card {
    background: white;
    border-radius: 4px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.card-header {
    margin-bottom: 15px;
    padding-bottom: 15px;
    border-bottom: 1px solid #eee;
}

.card-header h3 {
    font-size: 18px;
    color: #2c3e50;
}

/* 提示框 */
.alert {
    padding: 12px 15px;
    border-radius: 4px;
    margin-bottom: 15px;
}

.alert-success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.alert-error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.alert-warning {
    background: #fff3cd;
    color: #856404;
    border: 1px solid #ffeaa7;
}

.alert-info {
    background: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
}

/* 工具类 */
.text-center {
    text-align: center;
}

.text-right {
    text-align: right;
}

.text-left {
    text-align: left;
}

.mt-10 {
    margin-top: 10px;
}

.mt-20 {
    margin-top: 20px;
}

.mb-10 {
    margin-bottom: 10px;
}

.mb-20 {
    margin-bottom: 20px;
}

.hidden {
    display: none;
}

/* 分页 */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 5px;
    margin-top: 20px;
}

.pagination a,
.pagination span {
    padding: 6px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    text-decoration: none;
    color: #333;
}

.pagination a:hover {
    background: #f8f9fa;
}

.pagination .active {
    background: #3498db;
    color: white;
    border-color: #3498db;
}

/* 加载动画 */
.loading {
    text-align: center;
    padding: 20px;
    color: #999;
}

/* 图标字体（使用Unicode符号作为占位符） */
[class^="icon-"],
[class*=" icon-"] {
    font-style: normal;
    font-weight: normal;
}

.icon-home::before { content: "🏠 "; }
.icon-edit::before { content: "✏️ "; }
.icon-database::before { content: "💾 "; }
.icon-search::before { content: "🔍 "; }
.icon-chart::before { content: "📊 "; }
.icon-dashboard::before { content: "📈 "; }
.icon-settings::before { content: "⚙️ "; }
.icon-file::before { content: "📄 "; }
.icon-print::before { content: "🖨️ "; }
.icon-check::before { content: "✓ "; }
.icon-close::before { content: "✗ "; }
.icon-calendar::before { content: "📅 "; }

