* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', sans-serif;
    background: #f5f7fa;
    color: #333;
}

/* --- 登录页面样式 --- */
.login-container {
    display: flex;
    height: 100vh;
}

.login-left {
    flex: 1;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
}

.login-illustration {
    text-align: center;
}

.login-illustration h1 {
    font-size: 2.5rem;
    margin-bottom: 20px;
}

.net-text {
    font-size: 6rem;
    font-weight: bold;
    opacity: 0.3;
    margin: 20px 0;
}

.tagline {
    font-size: 1.2rem;
    opacity: 0.9;
}

.login-right {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    background: white;
}

.login-form {
    width: 80%;
    max-width: 400px;
}

.login-form h2 {
    color: #333;
    margin-bottom: 10px;
    font-size: 1.8rem;
}

.login-form p {
    color: #666;
    margin-bottom: 30px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: #555;
    font-size: 14px;
}

.form-group input {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    transition: border-color 0.3s;
}

.form-group input:focus {
    outline: none;
    border-color: #667eea;
}

.form-options {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    font-size: 14px;
}

.form-options a {
    color: #667eea;
    text-decoration: none;
}

.btn-primary, .btn-secondary {
    width: 100%;
    padding: 12px;
    border: none;
    border-radius: 4px;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.3s;
    margin-bottom: 10px;
}

.btn-primary {
    background: #667eea;
    color: white;
}

.btn-primary:hover {
    background: #5a67d8;
}

.btn-secondary {
    background: white;
    color: #667eea;
    border: 1px solid #667eea;
}

.btn-secondary:hover {
    background: #f7f8fc;
}

.language-switch {
    display: flex;
    gap: 10px;
    margin-top: 20px;
    justify-content: center;
}

.lang-btn {
    padding: 8px 16px;
    border: 1px solid #ddd;
    background: white;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s;
}

.lang-btn.active {
    background: #667eea;
    color: white;
    border-color: #667eea;
}

/* --- 主界面样式 --- */
.header {
    background: white;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 30px;
}

.header h1 {
    font-size: 1.5rem;
    color: #333;
}

.top-nav {
    display: flex;
    gap: 30px;
    align-items: center;
}

.top-nav a {
    color: #666;
    text-decoration: none;
    transition: color 0.3s;
}

.top-nav a:hover {
    color: #667eea;
}

.logout-btn {
    padding: 8px 20px;
    background: #ff4757;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

.main-container {
    display: flex;
    min-height: calc(100vh - 70px);
}

.sidebar {
    width: 200px;
    background: white;
    box-shadow: 2px 0 10px rgba(0,0,0,0.05);
}

.side-nav {
    padding: 20px 0;
}

.nav-item {
    width: 100%;
    padding: 15px 20px;
    border: none;
    background: none;
    text-align: left;
    cursor: pointer;
    transition: all 0.3s;
    position: relative;
}

.nav-item:hover {
    background: #f7f8fc;
}

.nav-item.active {
    background: #f0f2ff;
    color: #667eea;
    border-left: 3px solid #667eea;
}

.beta-tag {
    background: #ff6b6b;
    color: white;
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 10px;
    margin-left: 5px;
}

.content {
    flex: 1;
    padding: 30px;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.refresh-btn {
    padding: 8px 20px;
    background: #667eea;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

/* --- 设备表格 --- */
.device-table {
    width: 100%;
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.device-table thead {
    background: #f7f8fc;
}

.device-table th,
.device-table td {
    padding: 15px;
    text-align: left;
    border-bottom: 1px solid #eee;
}

.device-table tbody tr:hover {
    background: #f9f9fc;
}

.view-link {
    color: #667eea;
    text-decoration: none;
    cursor: pointer;
}

.view-link:hover {
    text-decoration: underline;
}

/* --- 设备卡片 --- */
.device-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
    margin-top: 30px;
}

.device-card {
    background: white;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    transition: transform 0.3s;
}

.device-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 20px rgba(0,0,0,0.1);
}

.device-card h3 {
    color: #333;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid #f0f0f0;
}

.device-info {
    margin-bottom: 10px;
    display: flex;
    justify-content: space-between;
}

.device-info label {
    color: #666;
    font-weight: 500;
}

.device-info span {
    color: #333;
}

.status-online {
    color: #4CAF50;
    font-weight: bold;
}

.status-offline {
    color: #f44336;
    font-weight: bold;
}

.view-btn {
    width: 100%;
    padding: 10px;
    margin-top: 15px;
    background: #667eea;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.3s;
}

.view-btn:hover {
    background: #5a67d8;
}

/* --- 模态框 (已优化适配仪表盘) --- */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
    animation: fadeIn 0.3s;
}

.modal-content {
    background-color: white;
    margin: 5% auto;
    padding: 30px;
    border-radius: 8px;
    /* 修改：加宽弹窗以容纳仪表盘 */
    width: 90%; 
    max-width: 900px; 
    position: relative;
    animation: slideIn 0.3s;
    max-height: 90vh;
    overflow-y: auto;
}

.close {
    position: absolute;
    right: 20px;
    top: 20px;
    font-size: 28px;
    font-weight: bold;
    color: #aaa;
    cursor: pointer;
    z-index: 10;
}

.close:hover {
    color: #000;
}

/* --- 设备概览/监控面板 --- */
.overview-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 20px;
}

.monitor-panel {
    background: white;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    transition: all 0.3s;
}

/* 弹窗内的面板不需要阴影，加个边框 */
.modal-content .monitor-panel {
    box-shadow: none;
    border: 1px solid #eee;
}

.monitor-panel h3 {
    color: #333;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid #f0f0f0;
}

.monitor-data {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
}

.data-item {
    padding: 15px;
    background: #f7f8fc;
    border-radius: 6px;
    display: flex;
    flex-direction: column;
}

.data-item label {
    display: block;
    color: #666;
    font-size: 12px;
    margin-bottom: 5px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.data-item .value {
    font-size: 22px;
    font-weight: bold;
    color: #333;
}

.data-item .unit {
    font-size: 14px;
    color: #999;
    margin-left: 5px;
    font-weight: normal;
}

/* --- DTU监控 --- */
.dtu-monitor {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 300px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 20px rgba(0,0,0,0.1);
    padding: 15px;
    z-index: 999;
}

.dtu-monitor h3 {
    color: #333;
    margin-bottom: 10px;
    font-size: 14px;
}

.dtu-data {
    max-height: 150px;
    overflow-y: auto;
    padding: 10px;
    background: #f7f8fc;
    border-radius: 4px;
    font-family: monospace;
    font-size: 12px;
    color: #666;
}

.dtu-entry {
    padding: 8px;
    margin-bottom: 8px;
    background: white;
    border-radius: 4px;
    border-left: 3px solid #667eea;
}

/* --- 动画 --- */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideIn {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* --- 响应式 --- */
@media (max-width: 768px) {
    .login-container { flex-direction: column; }
    .login-left { display: none; }
    .main-container { flex-direction: column; }
    .sidebar { width: 100%; }
    .side-nav { display: flex; overflow-x: auto; padding: 10px; }
    .device-cards { grid-template-columns: 1fr; }
    .modal-content { width: 95%; margin: 10% auto; padding: 15px; }
    .monitor-data { grid-template-columns: 1fr; }
}
/* =========================================================
   新增：油罐详情全屏页面专属样式 (适配宽屏)
========================================================= */
.tank-detail-header {
    background: #f7f8fc;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 30px;
    display: flex;
    justify-content: space-around;
    align-items: center;
    box-shadow: 0 2px 5px rgba(0,0,0,0.02);
}

.tank-detail-header p {
    color: #555;
    font-size: 16px;
    margin: 0;
}

.tank-layout-container {
    display: flex;
    flex-direction: column;
    gap: 30px; /* 增加卡片间距 */
}

.tank-row {
    display: grid;
    grid-template-columns: 1fr 2fr; 
    gap: 30px;
    /* 改为按顶部对齐，取消强制拉伸高度，避免图表被无限拉高 */
    align-items: start; 
}

.tank-chart-wrapper {
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    background-color: white;
    padding: 20px 10px 10px 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.03);
    display: flex;
    flex-direction: column;
    /* 固定一个优雅的高度，让它不会显得太巨大 */
    height: 320px; 
}

.tank-chart-wrapper .chart-title {
    text-align: center;
    font-size: 16px;
    font-weight: 600;
    color: #333;
    margin-bottom: 10px;
}

.tank-chart-wrapper canvas {
    flex: 1;
    width: 100% !important;
    /* 限制图表绘制区域的最大高度 */
    max-height: 250px !important; 
    margin: 0 auto;
}

.tank-card {
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 30px;
    background-color: white;
    box-shadow: 0 2px 10px rgba(0,0,0,0.03);
    display: grid;
    grid-template-columns: 1fr 1fr; /* 数据项分两列显示，利用宽屏空间 */
    gap: 20px 40px;
    align-content: center;
}

.tank-card h5 {
    grid-column: 1 / -1; /* 标题跨满两列 */
    color: #667eea;
    font-size: 20px;
    margin-bottom: 10px;
    padding-bottom: 15px;
    border-bottom: 1px dashed #eee;
}

.tank-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 16px;
    padding: 10px;
    background: #f9f9fc;
    border-radius: 6px;
}

.tank-item .label { color: #666; }
.tank-item .value { color: #111; font-weight: bold; font-size: 18px; }

/* 响应式：屏幕较小时回退为上下单列 */
@media (max-width: 1024px) {
    .tank-row { grid-template-columns: 1fr; }
    .tank-card { grid-template-columns: 1fr; }
    .tank-detail-header { flex-direction: column; gap: 10px; text-align: center; }
}

@keyframes rotate { 100% { transform: rotate(360deg); } }
@keyframes dash { 0% { stroke-dasharray: 1, 200; stroke-dashoffset: 0; } 50% { stroke-dasharray: 89, 200; stroke-dashoffset: -35px; } 100% { stroke-dasharray: 89, 200; stroke-dashoffset: -124px; } }

/* --- 设备搜索功能样式 --- */
.search-container {
    display: flex;
    gap: 10px;
    align-items: center;
}

.search-input {
    padding: 8px 15px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    width: 200px;
    transition: border-color 0.3s, box-shadow 0.3s;
}

.search-input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.search-btn {
    padding: 8px 20px;
    background: #667eea;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: background 0.3s;
}

.search-btn:hover {
    background: #5a67d8;
}

.clear-btn {
    padding: 8px 15px;
    background: #e2e8f0;
    color: #666;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: background 0.3s, color 0.3s;
}

.clear-btn:hover {
    background: #cbd5e1;
    color: #333;
}

/* ==================== 机卡管理 - 密码修改样式 ==================== */
.card-management-container {
    max-width: 600px;
    margin: 20px auto;
    padding: 0 20px;
}

.card-panel {
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    overflow: hidden;
}

.card-panel-header {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 24px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.card-panel-icon {
    width: 48px;
    height: 48px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.card-panel-icon svg {
    width: 24px;
    height: 24px;
    stroke: white;
}

.card-panel-header h3 {
    margin: 0 0 4px 0;
    font-size: 18px;
    font-weight: 600;
}

.card-panel-header p {
    margin: 0;
    font-size: 13px;
    opacity: 0.9;
}

.password-form {
    padding: 24px;
}

.form-row {
    margin-bottom: 20px;
}

.form-row label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    color: #374151;
    margin-bottom: 8px;
}

.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.form-row input {
    width: 100%;
    padding: 12px 44px 12px 14px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 14px;
    transition: border-color 0.2s, box-shadow 0.2s;
    box-sizing: border-box;
}

.form-row input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.toggle-password {
    position: absolute;
    right: 12px;
    background: none;
    border: none;
    padding: 4px;
    cursor: pointer;
    color: #9ca3af;
    transition: color 0.2s;
}

.toggle-password:hover {
    color: #6b7280;
}

.toggle-password svg {
    width: 18px;
    height: 18px;
}

/* 密码强度指示器 */
.password-strength {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 24px;
    padding: 12px;
    background: #f9fafb;
    border-radius: 8px;
}

.strength-label {
    font-size: 12px;
    color: #6b7280;
    white-space: nowrap;
}

.strength-bar {
    display: flex;
    gap: 4px;
    flex: 1;
}

.strength-segment {
    height: 6px;
    flex: 1;
    border-radius: 3px;
    background: #e2e8f0;
    transition: background-color 0.3s;
}

.strength-text {
    font-size: 12px;
    font-weight: 500;
    color: #94a3b8;
    min-width: 40px;
    text-align: right;
}

/* 表单操作按钮 */
.form-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    padding-top: 8px;
}

.btn-reset {
    padding: 12px 24px;
    background: #f3f4f6;
    color: #6b7280;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-reset:hover {
    background: #e5e7eb;
    color: #4b5563;
}

.btn-submit {
    padding: 12px 32px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 2px 4px rgba(102, 126, 234, 0.3);
}

.btn-submit:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(102, 126, 234, 0.4);
}

.btn-submit:active {
    transform: translateY(0);
}

/* 消息提示 */
.form-message {
    margin-top: 16px;
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 14px;
    text-align: center;
    display: none;
}

.form-message.success {
    display: block;
    background: #d1fae5;
    color: #065f46;
    border: 1px solid #a7f3d0;
}

.form-message.error {
    display: block;
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

/* ==================== 密码修改成功提示框样式 ==================== */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    z-index: 9999;
    justify-content: center;
    align-items: center;
    animation: fadeIn 0.3s ease;
}

.modal-overlay.show {
    display: flex;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.8);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.success-modal {
    background: linear-gradient(145deg, #ffffff 0%, #f8fafc 100%);
    border-radius: 20px;
    padding: 40px 50px;
    text-align: center;
    box-shadow: 0 25px 80px rgba(0, 0, 0, 0.25);
    animation: scaleIn 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    max-width: 400px;
    width: 90%;
}

.modal-icon {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 24px;
}

.modal-icon svg {
    width: 40px;
    height: 40px;
}

.success-icon {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    box-shadow: 0 8px 30px rgba(16, 185, 129, 0.4);
}

.success-icon svg {
    color: white;
}

.modal-title {
    font-size: 24px;
    font-weight: 600;
    color: #1e293b;
    margin: 0 0 12px;
}

.modal-text {
    font-size: 16px;
    color: #64748b;
    margin: 0 0 8px;
}

.modal-hint {
    font-size: 14px;
    color: #94a3b8;
    margin: 0 0 28px;
}

.modal-btn {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    border: none;
    padding: 14px 48px;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(16, 185, 129, 0.3);
}

.modal-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(16, 185, 129, 0.4);
}

.modal-btn:active {
    transform: translateY(0);
}

/* 响应式适配 */
@media (max-width: 640px) {
    .card-management-container {
        padding: 0 12px;
    }
    
    .card-panel-header {
        padding: 20px;
    }
    
    .password-form {
        padding: 20px;
    }
    
    .form-actions {
        flex-direction: column;
    }
    
    .btn-reset,
    .btn-submit {
        width: 100%;
    }
    
    .success-modal {
        padding: 30px 25px;
    }
    
    .modal-icon {
        width: 70px;
        height: 70px;
    }
    
    .modal-title {
        font-size: 20px;
    }
}