﻿* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Microsoft JhengHei', Arial, sans-serif;
    background: linear-gradient(135deg, #4facfe, #00f2fe);
    min-height: 100vh;
    color: #333;
}

.navbar {
    background: rgba(255,255,255,0.95);
    padding: 1.5rem 2rem;
    margin: 1rem 2rem;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.navbar-brand {
    font-size: 1.5rem;
    font-weight: 700;
    color: #2c3e50;
    text-decoration: none;
    flex: 1;
}

.navbar-status {
    color: #64748b;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.sound-control-btn {
    background: rgba(102, 126, 234, 0.1);
    border: 1px solid #667eea;
    border-radius: 50%;
    width: 35px;
    height: 35px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1rem;
    transition: all 0.3s ease;
    margin-left: 0.5rem;
}

    .sound-control-btn:hover {
        transform: scale(1.1);
        background: rgba(102, 126, 234, 0.2);
    }

    .sound-control-btn.muted {
        background: rgba(255, 0, 0, 0.1);
        border-color: #dc2626;
        color: #dc2626;
    }

        .sound-control-btn.muted:hover {
            background: rgba(255, 0, 0, 0.2);
        }

.navbar-nav {
    display: flex;
    list-style: none;
    gap: 2rem;
}

    .navbar-nav a {
        color: #64748b;
        text-decoration: none;
        padding: 0.5rem 1rem;
        border-radius: 6px;
        transition: background-color 0.2s ease;
    }

        .navbar-nav a:hover, .navbar-nav a.active {
            background-color: #f1f5f9;
            color: #2c3e50;
        }

.connection-status {
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 500;
}

.connected {
    background: #10b981;
    color: white;
}

.disconnected {
    background: #ef4444;
    color: white;
}

.main {
    max-width: 1500px;
    margin: 0 auto;
    padding: 0 2rem;
}

.alert {
    position: fixed;
    top: 1rem;
    right: 1rem;
    background: white;
    border-left: 4px solid #ef4444;
    padding: 1rem;
    border-radius: 8px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.1);
    transform: translateX(400px);
    transition: transform 0.3s ease;
    z-index: 1000;
    max-width: 300px;
    margin-top: 60px;
}

    .alert.show {
        transform: translateX(0);
    }

.alert-title {
    font-weight: 600;
    color: #ef4444;
    margin-bottom: 0.25rem;
}

.alert-message {
    font-size: 0.85rem;
    color: #6b7280;
}

.stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: white;
    padding: 1.5rem;
    border-radius: 12px;
    text-align: center;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    cursor: pointer;
    transition: transform 0.2s ease;
}

    .stat-card:hover {
        transform: translateY(-3px);
    }

.stat-number {
    font-size: 2.5rem;
    font-weight: bold;
    margin-bottom: 0.5rem;
}

.stat-label {
    color: #64748b;
    font-size: 0.9rem;
}

.fault {
    color: #ef4444;
}

.repair {
    color: #f59e0b;
}

.pending {
    color: #8b5cf6;
}

.normal {
    color: #10b981;
}

.card {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    margin-bottom: 2rem;
}

.card-header {
    background: #f8fafc;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid #e5e7eb;
    font-weight: 600;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.card-body {
    padding: 1.5rem;
}

.fault-table {
    width: 100%;
    border-collapse: collapse;
}

    .fault-table th, .fault-table td {
        padding: 0.75rem;
        text-align: left;
        border-bottom: 1px solid #f1f5f9;
    }

    .fault-table th {
        background: #f8fafc;
        font-size: 0.8rem;
        color: #6b7280;
        text-transform: uppercase;
    }

    .fault-table tr:hover {
        background: #f9fafb;
    }

.status-badge {
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 500;
}

.status-fault {
    background: #fef2f2;
    color: #dc2626;
}

.status-repair {
    background: #fefbf2;
    color: #d97706;
}

.status-pending {
    background: #faf5ff;
    color: #7c3aed;
}

.btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    margin-right: 1rem;
    margin-bottom: 0.5rem;
    transition: all 0.2s ease;
    font-size: 0.9rem;
}

.btn-primary {
    background: #3b82f6;
    color: white;
}

    .btn-primary:hover {
        background: #2563eb;
    }

.btn-danger {
    background: #ef4444;
    color: white;
}

    .btn-danger:hover {
        background: #dc2626;
    }

@media (max-width: 768px) {
    .main {
        padding: 0 1rem;
    }

    .stats {
        grid-template-columns: repeat(2, 1fr);
    }

    .navbar {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }

    .navbar-brand {
        font-size: 1.2rem;
    }

    .navbar-status {
        font-size: 0.8rem;
    }

    .navbar-nav {
        gap: 1rem;
    }
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Microsoft JhengHei', sans-serif;
    background-color: #f5f5f5;
    padding: 20px;
}

.container {
    max-width: 1500px;
    margin: 0 auto;
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    overflow: hidden;
}

.header {
    background-color: #2563eb;
    color: white;
    padding: 20px;
    text-align: center;
}

    .header h1 {
        font-size: 24px;
        font-weight: normal;
    }

.nav-menu {
    margin-top: 1rem;
    display: flex;
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap;
}

.nav-link {
    color: white;
    text-decoration: none;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    transition: background-color 0.2s;
}

    .nav-link:hover {
        background: rgba(255,255,255,0.3);
    }

    .nav-link.active {
        background: rgba(255,255,255,0.4);
        font-weight: bold;
    }

.search-section {
    padding: 30px;
    background-color: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
}

.search-title {
    font-size: 18px;
    font-weight: bold;
    margin-bottom: 20px;
    color: #1e293b;
}

.search-form {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
}

.form-group {
    display: flex;
    flex-direction: column;
}

    .form-group label {
        font-weight: bold;
        margin-bottom: 5px;
        color: #374151;
    }

    .form-group input,
    .form-group select {
        padding: 10px;
        border: 1px solid #d1d5db;
        border-radius: 6px;
        font-size: 14px;
    }

        .form-group input:focus,
        .form-group select:focus {
            outline: none;
            border-color: #2563eb;
            box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
        }

.search-buttons {
    grid-column: 1 / -1;
    display: flex;
    gap: 10px;
    margin-top: 10px;
}

.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: bold;
    transition: background-color 0.2s;
    text-decoration: none;
    display: inline-block;
}

.btn-primary {
    background-color: #2563eb;
    color: white;
}

    .btn-primary:hover {
        background-color: #1d4ed8;
    }

.btn-secondary {
    background-color: #6b7280;
    color: white;
}

    .btn-secondary:hover {
        background-color: #4b5563;
    }

.list-section {
    padding: 30px;
}

.list-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.list-title {
    font-size: 18px;
    font-weight: bold;
    color: #1e293b;
}

.add-btn {
    background-color: #059669;
    color: white;
}

    .add-btn:hover {
        background-color: #047857;
    }

.table-container {
    overflow-x: auto;
}

table {
    width: 100%;
    min-width: 1200px;
    border-collapse: collapse;
    background-color: white;
}
/* 操作 */

th, td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #e2e8f0;
}

th {
    background-color: #f1f5f9;
    font-weight: bold;
    color: #374151;
    position: sticky;
    top: 0;
}

tr:hover {
    background-color: #f8fafc;
}

.status-active {
    color: #059669;
    font-weight: bold;
}

.status-inactive {
    color: #dc2626;
    font-weight: bold;
}

.actions {
    display: flex;
    gap: 8px;
}

.btn-sm {
    padding: 8px 16px;
    font-size: 14px;
}

.btn-edit {
    background-color: #f59e0b;
    color: white;
}

    .btn-edit:hover {
        background-color: #d97706;
    }

.btn-delete {
    background-color: #dc2626;
    color: white;
}

    .btn-delete:hover {
        background-color: #b91c1c;
    }

.btn-disabled {
    background-color: #9ca3af;
    color: #6b7280;
    cursor: not-allowed;
}

    .btn-disabled:hover {
        background-color: #9ca3af;
    }

.delete-info {
    font-size: 11px;
    color: #6b7280;
    margin-top: 2px;
}

.btn-view {
    background-color: #3b82f6;
    color: white;
}

    .btn-view:hover {
        background-color: #2563eb;
    }

.btn-manage {
    background-color: #7c3aed;
    color: white;
}

    .btn-manage:hover {
        background-color: #6d28d9;
    }

.alert {
    padding: 12px 16px;
    margin-bottom: 20px;
    border-radius: 6px;
    font-weight: 500;
}

.alert-success {
    background-color: #d1fae5;
    color: #065f46;
    border: 1px solid #a7f3d0;
}

.alert-error {
    background-color: #fee2e2;
    color: #991b1b;
    border: 1px solid #fca5a5;
}

.no-data {
    text-align: center;
    padding: 40px;
    color: #6b7280;
    font-size: 16px;
}

.description {
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: bold;
    color: white;
}

.badge-primary {
    background-color: #3b82f6;
}

.badge-success {
    background-color: #10b981;
}
