/* 主页特定样式 */
.section-title {
    margin: 30px 0 15px;
    font-size: 1.5rem;
    font-weight: 600;
    color: #2c3e50;
    border-left: 4px solid #3498db;
    padding-left: 15px;
}

/* 设备卡片信息样式 */
.device-info p {
    margin: 8px 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
    position: relative;
    cursor: help;
}

.device-card {
    min-width: 300px;
    max-width: 100%;
}

.device-card .card-body {
    padding: 15px;
}

/* 设备详情模态框样式 */
.device-detail-modal {
    max-width: 800px;
    height: auto;
    max-height: 90vh;
}

.device-detail-modal .modal-body {
    overflow-y: auto;
    max-height: calc(90vh - 60px); /* 减去头部高度 */
}

.device-detail-container {
    padding: 10px;
}

.device-detail-header {
    margin-bottom: 20px;
    border-bottom: 1px solid var(--medium-gray);
    padding-bottom: 10px;
}

.device-detail-header h2 {
    margin: 0 0 5px 0;
    font-size: 1.6rem;
    color: var(--primary-color);
}

.device-id {
    color: var(--text-muted);
    font-size: 0.9rem;
}

.detail-section {
    margin-bottom: 25px;
}

.detail-section h4 {
    margin: 0 0 15px 0;
    font-size: 1.2rem;
    color: var(--primary-color);
    border-left: 3px solid var(--primary-color);
    padding-left: 10px;
}

.detail-section h5 {
    margin: 15px 0 10px 0;
    font-size: 1rem;
    color: var(--text-color);
}

.detail-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 15px;
    margin-bottom: 15px;
}

.detail-item {
    background-color: rgba(0, 0, 0, 0.02);
    border-radius: 5px;
    padding: 10px;
}

.detail-label {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-bottom: 5px;
}

.detail-value {
    font-size: 1.1rem;
    font-weight: 500;
}

.details-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 10px;
}

.details-table th, .details-table td {
    padding: 8px 12px;
    text-align: left;
    border-bottom: 1px solid var(--medium-gray);
}

.details-table th {
    background-color: rgba(0, 0, 0, 0.03);
    font-weight: 600;
}

.details-table tr:hover {
    background-color: rgba(0, 0, 0, 0.02);
}

.notes-content {
    padding: 15px;
    background-color: rgba(0, 0, 0, 0.02);
    border-radius: 5px;
    min-height: 60px;
}

.no-data {
    padding: 15px;
    text-align: center;
    color: var(--text-muted);
    font-style: italic;
}

/* 加载遮罩样式 */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 2000;
    display: none;
    justify-content: center;
    align-items: center;
}

.loading-spinner-container {
    background-color: white;
    padding: 20px 30px;
    border-radius: 8px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
    text-align: center;
}

.loading-spinner {
    font-size: 2rem;
    color: var(--primary-color);
    margin-bottom: 10px;
}

.loading-message {
    font-size: 1rem;
    color: var(--text-color);
}

/* 深色模式下的加载遮罩样式 */
[data-theme="dark"] .loading-spinner-container {
    background-color: #2c3e50;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.4);
}

[data-theme="dark"] .loading-message {
    color: #ecf0f1;
}

/* 优化模态框关闭按钮 */
.modal-close {
    background: none;
    border: none;
    font-size: 1.2rem;
    cursor: pointer;
    color: white; /* 修改为白色，与模态框标题颜色协调 */
    padding: 5px;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.modal-close:hover {
    background-color: rgba(255, 255, 255, 0.1);
    color: #f8f9fa; /* 悬停时稍微变亮 */
}

.device-detail-modal .modal-header {
    position: sticky;
    top: 0;
    background-color: var(--background-color);
    z-index: 10;
    border-bottom: 1px solid var(--medium-gray);
}

/* 克隆按钮样式 */
.btn-clone {
    background-color: #3498db;
    color: white;
}

.btn-clone:hover {
    background-color: #2980b9;
}

/* 设备卡片按钮间距 */
.card-actions {
    display: flex;
    gap: 5px;
    justify-content: center;
}

/* 图标按钮样式 */
.btn-icon {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    border: none;
    cursor: pointer;
    color: white;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.btn-icon i {
    font-size: 1rem;
}

.btn-icon:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.btn-icon.view-device {
    background-color: #2ecc71;
}

.btn-icon.view-device:hover {
    background-color: #27ae60;
}

.btn-icon.btn-edit {
    background-color: #f39c12;
}

.btn-icon.btn-edit:hover {
    background-color: #d35400;
}

.btn-icon.btn-clone {
    background-color: #3498db;
}

.btn-icon.btn-clone:hover {
    background-color: #2980b9;
}

.btn-icon.btn-danger {
    background-color: #e74c3c;
}

.btn-icon.btn-danger:hover {
    background-color: #c0392b;
}

/* 设备卡片底部样式 */
.card-footer {
    padding: 10px;
    border-top: 1px solid rgba(0, 0, 0, 0.05);
    background-color: rgba(0, 0, 0, 0.01);
}

/* 轻量级提示框样式 */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
}

.toast {
    background-color: rgba(46, 204, 113, 0.9);
    color: white;
    padding: 12px 20px;
    border-radius: 4px;
    margin-bottom: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
    display: flex;
    align-items: center;
    animation: fadeInRight 0.3s ease, fadeOut 0.5s ease 2.5s forwards;
    max-width: 300px;
}

.toast.error {
    background-color: rgba(231, 76, 60, 0.9);
}

.toast-icon {
    margin-right: 10px;
    font-size: 1.2rem;
}

.toast-message {
    font-size: 0.95rem;
}

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

@keyframes fadeOut {
    from {
        opacity: 1;
    }
    to {
        opacity: 0;
    }
}

/* 工具提示样式 */
.tooltip {
    position: absolute;
    background-color: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 5px 10px;
    border-radius: 4px;
    font-size: 0.85rem;
    z-index: 1000;
    max-width: 300px;
    word-wrap: break-word;
    bottom: 100%;
    left: 0;
    margin-bottom: 5px;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s, visibility 0.3s;
    pointer-events: none;
}

.device-info p:hover .tooltip {
    opacity: 1;
    visibility: visible;
}

.memory-summary, .disk-summary {
    margin-top: 15px;
    padding: 10px;
    background-color: #f8f9fa;
    border-radius: 5px;
    border: 1px dashed #dee2e6;
}

/* 深色模式下的内存和硬盘摘要样式 */
[data-theme="dark"] .memory-summary, 
[data-theme="dark"] .disk-summary {
    background-color: #2d3748;
    border-color: #4a5568;
}

.input-with-unit {
    display: flex;
    align-items: center;
}

input[readonly] {
    background-color: #f8f9fa;
    cursor: not-allowed;
}

/* 深色模式下的只读输入框样式 */
[data-theme="dark"] input[readonly] {
    background-color: #2d3748;
    color: #e2e8f0;
    border-color: #4a5568;
}

.form-text {
    display: block;
    margin-top: 5px;
    font-size: 0.85rem;
    color: #6c757d;
}

/* 深色模式下的辅助文本样式 */
[data-theme="dark"] .form-text {
    color: #a0aec0;
}

.input-unit {
    padding: 8px 12px;
    background-color: #e9ecef;
    border: 1px solid #ced4da;
    border-left: none;
    border-radius: 0 4px 4px 0;
    color: #495057;
    font-weight: 500;
}

/* 深色模式下的单位样式 */
[data-theme="dark"] .input-unit {
    background-color: #4a5568;
    border-color: #2d3748;
    color: #e2e8f0;
}

.memory-size-display {
    display: flex;
    align-items: center;
}

.memory-size-display input {
    flex: 1;
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
    background-color: #f8f9fa;
}

/* 深色模式下的内存大小显示 */
[data-theme="dark"] .memory-size-display input {
    background-color: #2d3748;
    color: #e2e8f0;
    border-color: #4a5568;
}

#totalMemorySizeUnit, #totalDiskSizeUnit {
    padding: 8px 12px;
    background-color: #e9ecef;
    border: 1px solid #ced4da;
    border-left: none;
    border-radius: 0 4px 4px 0;
    color: #495057;
    font-weight: 500;
}

/* 深色模式下的总容量单位样式 */
[data-theme="dark"] #totalMemorySizeUnit,
[data-theme="dark"] #totalDiskSizeUnit {
    background-color: #4a5568;
    border-color: #2d3748;
    color: #e2e8f0;
}