/**
 * 通用样式表
 * 电缆检测数据管理系统
 * 采用极光UI (Aurora UI) 设计风格
 */

/* 引入极光UI样式 */
@import url('./aurora-ui.css');

* {
    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: #000000;
    background: 
        radial-gradient(ellipse at top left, rgba(240, 240, 255, 0.4) 0%, transparent 50%),
        radial-gradient(ellipse at bottom right, rgba(220, 220, 255, 0.3) 0%, transparent 50%),
        radial-gradient(ellipse at center, rgba(230, 230, 255, 0.2) 0%, transparent 50%),
        linear-gradient(135deg, #f0f0ff 0%, #e6e6ff 50%, #f5f5ff 100%);
    background-size: 200% 200%, 100% 100%, 150% 150%, 100% 100%;
    animation: auroraShift 15s ease-in-out infinite;
    background-attachment: fixed;
    min-height: 100vh;
    line-height: 1.6;
    position: relative;
    overflow-x: hidden;
}

/* 添加极光装饰元素 - 淡色系 */
body::before {
    content: '';
    position: fixed;
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(240, 240, 255, 0.4) 0%, transparent 70%);
    border-radius: 50%;
    filter: blur(40px);
    opacity: 0.4;
    top: -200px;
    right: -200px;
    animation: auroraFloat 20s ease-in-out infinite;
    pointer-events: none;
    z-index: -1;
}

body::after {
    content: '';
    position: fixed;
    width: 300px;
    height: 300px;
    background: radial-gradient(circle, rgba(220, 220, 255, 0.4) 0%, transparent 70%);
    border-radius: 50%;
    filter: blur(40px);
    opacity: 0.4;
    bottom: -150px;
    left: -150px;
    animation: auroraFloat 25s ease-in-out infinite reverse;
    pointer-events: none;
    z-index: -1;
}

/* 布局 */
.container {
    display: flex;
    min-height: calc(100vh - 60px);
}

.header {
    background: 
        radial-gradient(ellipse at center, rgba(240, 240, 255, 0.2) 0%, transparent 70%),
        linear-gradient(135deg, rgba(240, 240, 255, 0.8), rgba(220, 220, 255, 0.8));
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.3);
    color: #000000;
    padding: 15px 20px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    position: relative;
    overflow: hidden;
}

.header::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(
        45deg,
        transparent 20%,
        rgba(240, 240, 255, 0.1) 30%,
        rgba(220, 220, 255, 0.1) 40%,
        rgba(230, 230, 255, 0.1) 50%,
        rgba(240, 240, 255, 0.1) 60%,
        transparent 80%
    );
    animation: auroraRotate 25s linear infinite;
    pointer-events: none;
    z-index: 1;
}

.header-content {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header-logo-title {
    display: flex;
    align-items: center;
    gap: 12px;
}

.header-logo {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 10px;
    overflow: hidden;
    padding: 2px;
    box-sizing: border-box;
    flex-shrink: 0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.header-logo img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    border-radius: 8px;
    display: block;
}

.header-logo svg {
    width: 24px;
    height: 24px;
    color: white;
    display: block;
}

.header h1 {
    font-size: 24px;
    font-weight: 600;
    margin: 0;
}

.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: 
        radial-gradient(ellipse at top, rgba(240, 240, 255, 0.2) 0%, transparent 50%),
        radial-gradient(ellipse at bottom, rgba(220, 220, 255, 0.2) 0%, transparent 50%),
        linear-gradient(180deg, rgba(255, 255, 255, 0.9), rgba(240, 240, 255, 0.95));
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-right: 1px solid rgba(255, 255, 255, 0.2);
    min-height: calc(100vh - 60px);
    padding: 20px 0;
    box-shadow: 4px 0 24px rgba(0, 0, 0, 0.1);
    position: relative;
    overflow: hidden;
}

.sidebar::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(
        45deg,
        transparent 20%,
        rgba(240, 240, 255, 0.1) 30%,
        rgba(220, 220, 255, 0.1) 40%,
        rgba(230, 230, 255, 0.1) 50%,
        rgba(240, 240, 255, 0.1) 60%,
        transparent 80%
    );
    animation: auroraRotate 30s linear infinite;
    pointer-events: none;
    z-index: 1;
}

.main-nav ul {
    list-style: none;
}

.main-nav li {
    margin: 0;
}

.main-nav a {
    display: block;
    padding: 12px 20px;
    color: #000000;
    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: 12px 24px;
    border: none;
    border-radius: 16px;
    cursor: pointer;
    font-size: 14px;
    text-decoration: none;
    transition: all 0.3s;
    text-align: center;
    background: 
        radial-gradient(ellipse at center, rgba(255, 255, 255, 0.3) 0%, transparent 70%),
        linear-gradient(135deg, rgba(240, 240, 255, 0.4), rgba(220, 220, 255, 0.4));
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.4);
    color: #000000;
    font-weight: 600;
    position: relative;
    overflow: hidden;
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.5);
}

.btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.3),
        transparent
    );
    transition: left 0.5s;
}

.btn:hover::before {
    left: 100%;
}

.btn-primary {
    background: 
        radial-gradient(ellipse at center, rgba(255, 255, 255, 0.3) 0%, transparent 70%),
        linear-gradient(135deg, rgba(240, 240, 255, 0.4), rgba(220, 220, 255, 0.4));
}

.btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: 
        0 8px 25px rgba(0, 0, 0, 0.2),
        0 0 30px rgba(240, 240, 255, 0.3);
    background: 
        radial-gradient(ellipse at center, rgba(255, 255, 255, 0.4) 0%, transparent 70%),
        linear-gradient(135deg, rgba(240, 240, 255, 0.6), rgba(220, 220, 255, 0.6));
}

.btn-success {
    background: 
        radial-gradient(ellipse at center, rgba(255, 255, 255, 0.3) 0%, transparent 70%),
        linear-gradient(135deg, rgba(240, 255, 240, 0.4), rgba(220, 255, 220, 0.4));
}

.btn-success:hover {
    transform: translateY(-3px);
    box-shadow: 
        0 8px 25px rgba(0, 0, 0, 0.2),
        0 0 30px rgba(240, 255, 240, 0.3);
    background: 
        radial-gradient(ellipse at center, rgba(255, 255, 255, 0.4) 0%, transparent 70%),
        linear-gradient(135deg, rgba(240, 255, 240, 0.6), rgba(220, 255, 220, 0.6));
}

.btn-danger {
    background: 
        radial-gradient(ellipse at center, rgba(255, 255, 255, 0.3) 0%, transparent 70%),
        linear-gradient(135deg, rgba(255, 240, 240, 0.4), rgba(255, 220, 220, 0.4));
}

.btn-danger:hover {
    transform: translateY(-3px);
    box-shadow: 
        0 8px 25px rgba(0, 0, 0, 0.2),
        0 0 30px rgba(255, 240, 240, 0.3);
    background: 
        radial-gradient(ellipse at center, rgba(255, 255, 255, 0.4) 0%, transparent 70%),
        linear-gradient(135deg, rgba(255, 240, 240, 0.6), rgba(255, 220, 220, 0.6));
}

.btn-warning {
    background: 
        radial-gradient(ellipse at center, rgba(255, 255, 255, 0.3) 0%, transparent 70%),
        linear-gradient(135deg, rgba(255, 245, 240, 0.4), rgba(255, 235, 220, 0.4));
}

.btn-warning:hover {
    transform: translateY(-3px);
    box-shadow: 
        0 8px 25px rgba(0, 0, 0, 0.2),
        0 0 30px rgba(255, 245, 240, 0.3);
    background: 
        radial-gradient(ellipse at center, rgba(255, 255, 255, 0.4) 0%, transparent 70%),
        linear-gradient(135deg, rgba(255, 245, 240, 0.6), rgba(255, 235, 220, 0.6));
}

.btn-secondary {
    background: 
        radial-gradient(ellipse at center, rgba(255, 255, 255, 0.3) 0%, transparent 70%),
        linear-gradient(135deg, rgba(240, 240, 240, 0.4), rgba(220, 220, 220, 0.4));
}

.btn-secondary:hover {
    transform: translateY(-3px);
    box-shadow: 
        0 8px 25px rgba(0, 0, 0, 0.2),
        0 0 30px rgba(240, 240, 240, 0.3);
    background: 
        radial-gradient(ellipse at center, rgba(255, 255, 255, 0.4) 0%, transparent 70%),
        linear-gradient(135deg, rgba(240, 240, 240, 0.6), rgba(220, 220, 220, 0.6));
}

.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: #000000;
}

.form-control {
    width: 100%;
    padding: 16px 20px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 12px;
    font-size: 14px;
    transition: all 0.3s;
    background: 
        radial-gradient(ellipse at top left, rgba(240, 240, 255, 0.15) 0%, transparent 50%),
        rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    color: #000000;
    box-shadow: inset 0 0 20px rgba(240, 240, 255, 0.05);
}

.form-control::placeholder {
    color: rgba(0, 0, 0, 0.6);
}

.form-control:focus {
    outline: none;
    background: 
        radial-gradient(ellipse at center, rgba(240, 240, 255, 0.2) 0%, transparent 70%),
        rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.5);
    box-shadow: 
        0 0 30px rgba(240, 240, 255, 0.2),
        inset 0 0 20px rgba(220, 220, 255, 0.1);
    transform: translateY(-2px);
}

select.form-control {
    cursor: pointer;
}

textarea.form-control {
    resize: vertical;
    min-height: 100px;
}

/* 表格 */
.data-table {
    width: 100%;
    border-collapse: collapse;
    background: 
        radial-gradient(ellipse at top left, rgba(240, 240, 255, 0.1) 0%, transparent 50%),
        rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 
        0 8px 32px rgba(0, 0, 0, 0.1),
        0 0 60px rgba(240, 240, 255, 0.1);
}

.data-table thead {
    background: 
        radial-gradient(ellipse at center, rgba(240, 240, 255, 0.2) 0%, transparent 70%),
        linear-gradient(135deg, rgba(240, 240, 255, 0.4), rgba(220, 220, 255, 0.4));
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    color: #000000;
}

.data-table th {
    padding: 16px;
    text-align: left;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.5);
}

.data-table td {
    padding: 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    color: #000000;
    white-space: nowrap;
    vertical-align: middle;
    overflow: visible;
}

.data-table tbody tr:hover {
    background: 
        radial-gradient(ellipse at center, rgba(240, 240, 255, 0.1) 0%, transparent 70%),
        rgba(255, 255, 255, 0.1);
}

.data-table tbody tr:last-child td {
    border-bottom: none;
}

/* 卡片 */
.card {
    background: 
        radial-gradient(ellipse at top left, rgba(240, 240, 255, 0.15) 0%, transparent 50%),
        radial-gradient(ellipse at bottom right, rgba(220, 220, 255, 0.15) 0%, transparent 50%),
        rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.25);
    border-radius: 20px;
    padding: 24px;
    margin-bottom: 20px;
    box-shadow: 
        0 8px 32px rgba(0, 0, 0, 0.1),
        0 0 60px rgba(240, 240, 255, 0.1);
    transition: transform 0.3s, box-shadow 0.3s;
    position: relative;
    overflow: hidden;
}

.card::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(
        45deg,
        transparent 30%,
        rgba(240, 240, 255, 0.15) 40%,
        rgba(220, 220, 255, 0.15) 50%,
        rgba(230, 230, 255, 0.15) 60%,
        transparent 70%
    );
    animation: auroraRotate 20s linear infinite;
    pointer-events: none;
    z-index: 1;
}

.card:hover {
    transform: translateY(-6px);
    box-shadow: 
        0 12px 40px rgba(0, 0, 0, 0.15),
        0 0 80px rgba(240, 240, 255, 0.2);
}

.card-header {
    margin-bottom: 15px;
    padding-bottom: 15px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.15);
}

.card-header h3 {
    font-size: 18px;
    color: #000000;
    text-shadow: 0 0 10px rgba(240, 240, 255, 0.3);
}

/* 提示框 */
.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: "📅 "; }

/* ==================== 移动端响应式设计 ==================== */
/* 只影响移动设备，不影响桌面端 */

/* 平板和中等屏幕 (≤768px) */
@media (max-width: 768px) {
    /* 布局调整 */
    .container {
        flex-direction: column;
    }
    
    .sidebar {
        width: 100%;
        min-height: auto;
        border-right: none;
        border-bottom: 1px solid rgba(255, 255, 255, 0.2);
        padding: 10px 0;
    }
    
    .main-content {
        padding: 15px;
        width: 100%;
    }
    
    /* 头部调整 */
    .header {
        padding: 12px 15px;
    }
    
    .header-content {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .header h1 {
        font-size: 20px;
    }
    
    .header-logo {
        width: 32px;
        height: 32px;
    }
    
    .user-info {
        flex-wrap: wrap;
        gap: 10px;
        width: 100%;
        justify-content: space-between;
    }
    
    /* 导航菜单调整 */
    .main-nav a {
        padding: 10px 15px;
        font-size: 14px;
    }
    
    .main-nav a i {
        width: 18px;
        margin-right: 8px;
    }
    
    /* 按钮调整 */
    .btn {
        padding: 10px 20px;
        font-size: 14px;
        min-height: 44px; /* 触摸友好 */
    }
    
    /* 表单调整 */
    .form-control {
        padding: 14px 16px;
        font-size: 16px; /* 防止iOS自动缩放 */
        -webkit-appearance: none;
        appearance: none;
    }
    
    /* 表格调整 */
    .data-table {
        font-size: 13px;
        display: block;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    .data-table th,
    .data-table td {
        padding: 10px 8px;
        white-space: nowrap;
    }
    
    /* 卡片调整 */
    .card {
        padding: 16px;
        border-radius: 16px;
    }
    
    .card-header h3 {
        font-size: 16px;
    }
    
    /* 分页调整 */
    .pagination {
        flex-wrap: wrap;
        gap: 4px;
    }
    
    .pagination a,
    .pagination span {
        padding: 8px 12px;
        font-size: 13px;
        min-width: 40px;
        text-align: center;
    }
    
    /* 页面标题调整 */
    .page-header h2 {
        font-size: 20px;
    }
}

/* 手机小屏幕 (≤480px) */
@media (max-width: 480px) {
    /* 布局调整 */
    .main-content {
        padding: 12px;
    }
    
    /* 头部调整 */
    .header {
        padding: 10px 12px;
    }
    
    .header h1 {
        font-size: 18px;
    }
    
    .header-logo {
        width: 28px;
        height: 28px;
    }
    
    .user-info {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
    
    .btn-logout {
        padding: 6px 12px;
        font-size: 12px;
    }
    
    /* 导航菜单调整 */
    .sidebar {
        padding: 8px 0;
    }
    
    .main-nav a {
        padding: 8px 12px;
        font-size: 13px;
    }
    
    /* 按钮调整 */
    .btn {
        padding: 12px 18px;
        font-size: 14px;
        min-height: 48px; /* 更大的触摸区域 */
        width: 100%;
    }
    
    .btn-block {
        width: 100%;
    }
    
    /* 表单调整 */
    .form-group {
        margin-bottom: 12px;
    }
    
    .form-group label {
        font-size: 13px;
        margin-bottom: 6px;
    }
    
    .form-control {
        padding: 12px 14px;
        font-size: 16px;
        border-radius: 10px;
    }
    
    /* 表格调整 */
    .data-table {
        font-size: 12px;
        border-radius: 12px;
    }
    
    .data-table th,
    .data-table td {
        padding: 8px 6px;
        font-size: 12px;
    }
    
    .data-table th {
        font-size: 11px;
        padding: 10px 6px;
    }
    
    /* 卡片调整 */
    .card {
        padding: 12px;
        border-radius: 12px;
        margin-bottom: 15px;
    }
    
    .card-header {
        margin-bottom: 12px;
        padding-bottom: 12px;
    }
    
    .card-header h3 {
        font-size: 15px;
    }
    
    /* 提示框调整 */
    .alert {
        padding: 10px 12px;
        font-size: 13px;
        margin-bottom: 12px;
    }
    
    /* 分页调整 */
    .pagination a,
    .pagination span {
        padding: 6px 10px;
        font-size: 12px;
        min-width: 36px;
    }
    
    /* 页面标题调整 */
    .page-header {
        margin-bottom: 15px;
    }
    
    .page-header h2 {
        font-size: 18px;
        margin-bottom: 8px;
    }
    
    /* 工具类调整 */
    .mt-20 {
        margin-top: 15px;
    }
    
    .mb-20 {
        margin-bottom: 15px;
    }
}

/* 超小屏幕手机 (≤360px) */
@media (max-width: 360px) {
    .main-content {
        padding: 10px;
    }
    
    .header {
        padding: 8px 10px;
    }
    
    .header h1 {
        font-size: 16px;
    }
    
    .page-header h2 {
        font-size: 16px;
    }
    
    .btn {
        padding: 10px 16px;
        font-size: 13px;
    }
    
    .form-control {
        padding: 10px 12px;
        font-size: 16px;
    }
    
    .card {
        padding: 10px;
    }
}

/* 横屏适配 */
@media (max-width: 768px) and (orientation: landscape) {
    .sidebar {
        max-height: 200px;
        overflow-y: auto;
    }
    
    .main-content {
        padding: 12px;
    }
}

/* 触摸设备优化 */
@media (hover: none) and (pointer: coarse) {
    .btn:hover {
        transform: none;
    }
    
    .card:hover {
        transform: none;
    }
    
    .main-nav a:hover {
        background: transparent;
    }
    
    /* 增加触摸目标大小 */
    .main-nav a {
        min-height: 44px;
        display: flex;
        align-items: center;
    }
}

