/* Basic reset */
body {
    background-color: #1d1e1f;
    font-family: "Noto Sans TC", sans-serif;
    font-weight: 400;
    color: white;
    margin: 0;
    padding: 20px;
}

/* Heading */
h1, h2, h3 {
    font-weight: 800;
}

/* Typography */
p, form, button, input {
    font-weight: 500;
}

/* Navigation bar */
nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    width: 100%;
}

/* Logout button */
.logoutButton {
    background: none;
    border: 1px white solid;
    color: white;
    padding: 1px 20px;
    border-radius: 100px;
}

.logoutButton:hover {
    background: white;
    color: #000;
}

/* Login box */
.login-box {
    background: #000;
    color: white;
    border-radius: 16px;
    box-shadow: 2px 2px 12px rgba(0, 0, 0, 0.195);
    padding: 58px 38px 70px;
    width: 100%;
    max-width: 340px;
}

.login-title {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 18px;
    text-align: center;
    color: #222;
}

.login-box label {
    display: block;
    margin-bottom: 6px;
    font-size: 0.98rem;
    color: white;
}

.login-box input[type="email"],
.login-box input[type="password"] {
    width: 100%;
    padding: 8px 10px;
    margin-bottom: 16px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 1rem;
    box-sizing: border-box;
}

.login-box button {
    width: 100%;
    padding: 10px 0;
    background: #008080;
    color: #fff;
    border: none;
    border-radius: 4px;
    font-size: 1.08rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

.login-box button:hover {
    background: #006666;
}

/* Notice */
.notice {
    color: #4caf50;
    font-weight: bold;
    margin-bottom: 10px;
}

/* Buttons */
.btn,
.btn:visited,
.btn:active,
input.btn,
button.btn {
    display: inline-block;
    padding: 6px 12px;
    background: #008080;
    color: #fff;
    border: none;
    border-radius: 4px;
    text-decoration: none;
    font-weight: bold;
    transition: background 0.3s;
    font-size: 0.9rem;
    cursor: pointer;
    font-family: inherit;
    appearance: none;
    -webkit-appearance: none;
}

.btn:hover {
    background: #006666;
}

/* Inventory table (desktop) */
.inventory-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
    font-size: 0.95rem;
}

.inventory-table th,
.inventory-table td {
    border: 1px solid #444;
    padding: 10px;
    text-align: left;
    color: #eee;
}

.inventory-table th {
    background: #111;
    font-weight: bold;
}

.inventory-table tr:nth-child(even) {
    background: #222;
}

.inventory-table tr:nth-child(odd) {
    background: #1a1a1a;
}

/* Filter bar */
.filter-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: flex-end;
}

.filter-bar label {
    font-size: 0.95rem;
    margin-right: 4px;
    white-space: nowrap;
}

.filter-bar select,
.filter-bar input[type="submit"] {
    padding: 6px 10px;
    border-radius: 4px;
    font-size: 0.95rem;
    border: 1px solid #ccc;
    min-width: 120px;
}
.ysd {
    width:invalid%;
}
/* Responsive */
@media screen and (max-width: 768px) {
    body {
        padding: 10px;
    }

    h1 {
        font-size: 1.5rem;
        text-align: center;
    }

    .btn,
    input.btn,
    button.btn {
        font-size: 1rem;
        margin-top: 8px;
        width: 100%;
    }
.ysd {
        width: calc(100% - 24px);
    }

    .userInfo {
        display: none;
    }

    .filter-bar {
        flex-direction: column;
        align-items: stretch;
    }

    .filter-bar label {
        margin: 0;
    }

    .filter-bar select,
    .filter-bar input[type="submit"] {
        width: 100%;
    }

    /* Responsive table as cards */
    .inventory-table {
        font-size: 0.7rem;
        display: block;
        overflow-x: auto;
        white-space: nowrap;

    }

    .inventory-table thead {
        display: none;
    }

    .inventory-table tr {
        display: block;
        width: 100%;
        background: #111;
        border-radius: 8px;
        margin-bottom: 16px;
        padding: 10px;
        box-sizing: border-box;
    }

    .inventory-table td {
        display: flex;
        justify-content: space-between;
        padding: 10px;
        border: none;
        border-bottom: 1px solid #333;
        width: 100%;
        box-sizing: border-box;
    }

    .inventory-table td:last-child {
        border-bottom: none;
    }

    .inventory-table td::before {
        content: attr(data-label);
        color: #aaa;
        font-weight: bold;
        margin-right: 10px;
    }

    .inventory-table td button.btn,
    .inventory-table td a.btn {
        flex: 1;
        margin: 4px;
        text-align: center;
    }
}
