* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 0px;
    color: #333;
}

/* Navbar */
.navbar {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    margin-bottom: 30px;
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-brand h2 {
    color: #667eea;
    font-size: 1.5rem;
}

/* Mobile Menu Toggle */
.nav-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 5px;
    z-index: 1001;
}

.nav-toggle span {
    display: block;
    width: 25px;
    height: 3px;
    background: #667eea;
    border-radius: 3px;
    transition: all 0.3s;
}

.nav-toggle.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.nav-toggle.active span:nth-child(2) {
    opacity: 0;
}

.nav-toggle.active span:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -6px);
}

.nav-menu {
    display: flex;
    align-items: center;
    gap: 20px;
}

.nav-link {
    text-decoration: none;
    color: #555;
    font-weight: 500;
    transition: color 0.3s;
}

.nav-link:hover {
    color: #667eea;
}

.nav-user {
    display: flex;
    align-items: center;
    gap: 15px;
    padding-left: 20px;
    border-left: 1px solid #ddd;
}

.nav-user span {
    color: #666;
}

.btn-logout {
    padding: 6px 15px;
    background: #ff6b6b;
    color: white;
    border-radius: 6px;
    text-decoration: none;
    font-size: 0.9rem;
    transition: background 0.3s;
}

.btn-logout:hover {
    background: #ee5a5a;
}

/* Container */
.container {
    max-width: 1200px;
    margin: 0 auto;
}

/* Page Header */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
}

.page-header h1 {
    color: white;
    font-size: 2rem;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
}

/* Table */
.table-container {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.1);
}

.table {
    width: 100%;
    border-collapse: collapse;
}

.table thead {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.table th {
    padding: 5px;
    text-align: left;
    font-weight: 600;
    font-size: 0.95rem;
    text-align: center;
}

.table td {
    padding: 5px;
    border-bottom: 1px solid #eee;
    text-align: center;
}

.table tbody tr:hover {
    background: #f8f9fa;
}

.table tbody tr:last-child td {
    border-bottom: none;text-align: center;
}

.table .thumbnail {
    width: 50px;
    height: 50px;
    object-fit: cover;
    border-radius: 8px;
}

.table .no-image {
    color: #ccc;
    font-size: 2rem;
}

.table .order-id {
    font-weight: 600;
    color: #667eea;
}

.table .date-info {
    min-width: 80px;
}

.table .text-small {
    font-size: 0.8rem;
    color: #999;
}

.table .order-user {
    font-size: 0.75rem;
    color: #999;
    margin-top: 2px;
}

/* Buttons */
.btn {
    padding: 8px 20px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.3s;
    text-decoration: none;
    display: inline-block;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.btn-secondary {
    background: #6c757d;
    color: white;
}

.btn-secondary:hover {
    background: #5a6268;
}

.btn-sm {
    padding: 5px 12px;
    font-size: 0.85rem;
}

.btn-delete {
    background: #dc3545;
    color: white;
}

.btn-delete:hover {
    background: #c82333;
}

.btn.active {
    background: #667eea;
    color: white;
}

.delete-form {
    display: inline;
}

.btn-block {
    width: 100%;
    padding: 12px;
}

/* Pagination */
.pagination {
    margin-top: 25px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: white;
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.pagination-info {
    color: #666;
    font-size: 0.95rem;
}

.pagination-links {
    display: flex;
    gap: 8px;
}

/* Search */
.search-container {
    /* background: white; */
    padding: 10px;
    border-radius: 12px;
    margin-bottom: 25px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.search-form {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}

.search-input {
    flex: 1;
    min-width: 200px;
    padding: 12px 16px;
    border: 2px solid #e8e8e8;
    border-radius: 8px;
    font-size: 0.95rem;
    transition: all 0.3s;
}

.search-input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.search-input:hover {
    border-color: #d0d0d0;
}

.search-btn {
    padding: 12px 24px;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.1);
}

.empty-state p {
    font-size: 1.2rem;
    color: #999;
    margin-bottom: 20px;
}

/* Login */
.login-container {
    min-height: calc(100vh - 40px);
    display: flex;
    align-items: center;
    justify-content: center;
}

.login-box {
    background: white;
    padding: 50px;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
    width: 100%;
    max-width: 400px;
}

.login-title {
    color: #667eea;
    font-size: 1.8rem;
    text-align: center;
    margin-bottom: 10px;
}

.login-subtitle {
    text-align: center;
    color: #999;
    margin-bottom: 30px;
}

.login-form {
    margin-bottom: 20px;
}

.login-hint {
    text-align: center;
    color: #999;
    font-size: 0.9rem;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #eee;
}

/* Form Container */
.form-container {
    background: white;
    padding: 40px;
    border-radius: 12px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.1);
    animation: fadeIn 0.3s ease-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.order-form {
    margin: 0 auto;
}

.form-group {
    margin-bottom: 28px;
    position: relative;
}

.form-group label {
    display: block;
    margin-bottom: 10px;
    color: #555;
    font-weight: 600;
    font-size: 0.95rem;
}

.form-group label .required {
    color: #dc3545;
    margin-left: 2px;
}

.form-hint {
    display: block;
    margin-top: 6px;
    font-size: 0.85rem;
    color: #999;
}

.form-control {
    width: 100%;
    padding: 14px 16px;
    border: 2px solid #e8e8e8;
    border-radius: 10px;
    font-size: 1rem;
    transition: all 0.3s;
    background: #fafafa;
}

.form-control:focus {
    outline: none;
    border-color: #667eea;
    background: white;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.form-control:hover {
    border-color: #d0d0d0;
}

.form-control::placeholder {
    color: #bbb;
}

select.form-control {
    cursor: pointer;
    background: #fafafa url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23999' d='M6 9L1 4h10z'/%3E%3C/svg%3E") no-repeat right 16px center;
    padding-right: 40px;
    appearance: none;
}

textarea.form-control {
    resize: vertical;
    min-height: 100px;
    line-height: 1.6;
}

.form-actions {
    display: flex;
    gap: 15px;
    margin-top: 35px;
    padding-top: 30px;
    border-top: 1px solid #eee;
}

/* Image Upload */
.image-upload-area {
    border-radius: 12px;
    padding: 30px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
    background: #fafafa;
    position: relative;
}

.image-upload-area:hover {
    border-color: #667eea;
    background: #f8f9ff;
}

.image-upload-area.dragover {
    border-color: #667eea;
    background: #f0f3ff;
    transform: scale(1.02);
}

.upload-icon {
    font-size: 32px;
    margin-bottom: 6px;
    color: #bbb;
    transition: color 0.3s;
}

.image-upload-area:hover .upload-icon {
    color: #667eea;
}

.upload-hint {
    color: #666;
    font-size: 12px;
    margin: 2px 0;
}

.upload-hint strong {
    color: #333;
    font-size: 20px;
}

input[type="file"].form-control {
    padding: 10px;
    background: white;
    cursor: pointer;
}

/* Image Preview */
.image-preview {
    /* padding: 8px;
    text-align: center;
    border: 1px solid #ddd;
    border-radius: 6px;
    background: white;
    width: 100%; */
}

.image-preview img {
    width: 100%;
    height: 140px;
    object-fit: contain;
    cursor: pointer;
}

.image-preview img:hover {
    opacity: 0.8;
}

#currentImageDiv {
    /* padding: 8px;
    text-align: center;
    border: 1px solid #ddd;
    border-radius: 6px;
    background: white;
    width: 100%; */
}

#currentImageDiv img {
    width: 100%;
    height: 140px;
    object-fit: contain;
    cursor: pointer;
}

#currentImageDiv img:hover {
    opacity: 0.8;
}

.image-tooltip {
    font-size: 11px;
    color: #999;
    margin-top: 4px;
}

/* Custom Form Styles for Order Form */
.t1 {
    font-size: 12px;
    display: grid;
    grid-template-columns: 35% 1fr;
    gap: 10px;
}

.t2 {
    font-size: 12px;
    display: grid;
    grid-template-columns: 130px 1fr;
}

.tb2 {
    font-size: 12px;
    width: 100%;
}

.tb3 {
    border-collapse: collapse;
    margin: 10px 0px;
    width: 100%;
}

.tb3 td {
    padding: 3px 5px;
    border: 1px solid #666;
    text-align: center;
    height: 17px;
    font-size: 12px;
}

.nos {
    white-space: nowrap;
}

.inps {
    border: 0px;
    float: left;
    width: 95%;
    outline: none;
    padding-left: 5px;
    background: none;
    font-size: 12px;
}

.result1 {
    border: 0px;
    float: left;
    width: 95%;
    outline: none;
    padding-left: 5px;
    background: none;
    resize: none;
    height: 45px;
    font-family: Arial;
    color: #000;
}

.vvc {
    border-bottom: 1px solid #666;
}

/* Alert */
#alertContainer {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    margin-bottom: 0;
    backdrop-filter: blur(4px);
}

.alert {
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(10px);
    padding: 40px 50px;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    font-weight: 500;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    max-width: 420px;
    text-align: center;
    transform: scale(1);
    color: #333;
    position: relative;
    animation: alertSlideIn 0.3s ease-out;
}

@keyframes alertSlideIn {
    from {
        opacity: 0;
        transform: scale(0.8) translateY(-20px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.alert-icon {
    font-size: 48px;
    margin-bottom: 20px;
    display: block;
}

.alert-message {
    font-size: 18px;
    line-height: 1.6;
    color: #2c3e50;
    font-weight: 600;
}

.alert-close {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 28px;
    height: 28px;
    border: none;
    background: rgba(0, 0, 0, 0.05);
    border-radius: 50%;
    font-size: 18px;
    color: #999;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    /* line-height: 1; */
}

.alert-close:hover {
    background: rgba(0, 0, 0, 0.1);
    color: #666;
    transform: scale(1.1);
}

.alert.alert-success .alert-icon {
    background: linear-gradient(135deg, #66bb6a 0%, #43a047 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.alert.alert-danger .alert-icon {
    background: linear-gradient(135deg, #ef5350 0%, #e53935 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.alert.alert-warning .alert-icon {
    background: linear-gradient(135deg, #ffa726 0%, #fb8c00 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.alert.alert-info .alert-icon {
    background: linear-gradient(135deg, #42a5f5 0%, #1e88e5 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Print Styles */
@media print {
    .v-h {
        display: none;
      
    }
  /* .form-container {padding: 0px;} */
}

/* ==================== Responsive Design ==================== */

/* Tablet (768px - 1024px) */
@media (max-width: 1024px) {
    /* Container */
    .container,
    .nav-container {
        max-width: 95%;
        padding-left: 15px;
        padding-right: 15px;
    }

    /* Alert */
    .alert {
        padding: 35px 40px;
        max-width: 380px;
    }

    .alert-icon {
        font-size: 42px;
        margin-bottom: 18px;
    }

    .alert-message {
        font-size: 16px;
    }

    /* Navbar */
    .nav-container {
        padding: 12px 15px;
    }

    .nav-brand h2 {
        font-size: 1.3rem;
    }

    .nav-menu {
        gap: 12px;
    }

    .nav-link {
        font-size: 0.9rem;
        padding: 5px 10px;
    }

    /* Page Header */
    .page-header {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }

    .page-header h1 {
        font-size: 1.6rem;
    }

    /* Table */
    .table th,
    .table td {
        padding: 5px;
        font-size: 0.9rem;
    }

    .table .thumbnail {
        width: 50px;
        height: 50px;
    }

    /* Buttons */
    .btn {
        padding: 6px 16px;
        font-size: 0.85rem;
    }

    /* Form */
    .form-container {
        padding: 30px 20px;
    }

    .form-control {
        padding: 12px 14px;
        font-size: 0.95rem;
    }

    /* Login Box */
    .login-box {
        padding: 40px 30px;
        max-width: 450px;
    }

    /* Search */
    .search-container {
        padding: 15px;
    }

    .search-form {
        flex-direction: column;
        align-items: stretch;
    }

    .search-input {
        width: 100%;
    }

    .search-btn {
        width: 100%;
    }
}

/* Mobile (<768px) */
@media (max-width: 600px) {
    /* Container */
    .container,
    .nav-container {
        max-width: 100%;
        padding-left: 10px;
        padding-right: 10px;
    }

    /* Alert */
    .alert {
        padding: 30px 35px;
        max-width: 300px;
    }

    .alert-icon {
        font-size: 36px;
        margin-bottom: 16px;
    }

    .alert-message {
        font-size: 15px;
    }

    /* Navbar */
    .navbar {
        margin-bottom: 20px;
        padding-bottom: 15px;
    }

    .nav-container {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        gap: 10px;
        padding: 12px 10px;
    }

    /* Show hamburger menu toggle */
    .nav-toggle {
        display: flex;
    }

    .nav-brand h2 {
        font-size: 1.2rem;
    }

    /* Mobile Menu */
    .nav-menu {
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        flex-direction: column;
        gap: 10px;
        width: 100%;
        background: white;
        padding: 15px 10px;
        box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
        display: none;
        z-index: 1000;
    }

    .nav-menu.active {
        display: flex;
    }

    .nav-link {
        text-align: center;
        padding: 8px;
        background: #f8f9ff;
        border-radius: 6px;
    }

    .nav-user {
        width: 100%;
        flex-direction: column;
        padding-left: 0;
        border-left: none;
        border-top: 1px solid #ddd;
        padding-top: 10px;
    }

    .btn-logout {
        width: 100%;
        text-align: center;
        padding: 8px;
    }

    /* Page Header */
    .page-header h1 {
        font-size: 1.4rem;
    }

    .page-header .btn {
        width: 100%;
        padding: 10px;
    }

    /* Table - Card Layout for Mobile */
    .table-container {
        overflow-x: auto;
        border-radius: 8px;
    }

    .table {
        font-size: 0.85rem;
        /* min-width: 600px; */
    }

    .table th,
    .table td {
        padding: 5px;
    }

    .table .thumbnail {
        width: 50px;
        height: 50px;
        border-radius: 4px;
    }

    .table .order-info {
        min-width: 150px;
    }

    .table .order-info strong {
        font-size: 0.9rem;
    }

    .table .tag {
        font-size: 0.7rem;
        padding: 2px 6px;
    }

    /* Pagination */
    .pagination {
        flex-direction: column;
        gap: 15px;
        padding: 15px;
    }

    .pagination-info {
        text-align: center;
        font-size: 0.85rem;
    }

    .pagination-links {
        flex-wrap: wrap;
        justify-content: center;
        gap: 5px;
    }

    .pagination-links .btn {
        padding: 6px 10px;
        font-size: 0.8rem;
    }

    /* Search */
    .search-container {
        padding: 12px;
        border-radius: 8px;
    }

    .search-btn {
        padding: 10px 20px;
        font-size: 0.9rem;
    }

    /* Buttons */
    .btn {
        padding: 8px 12px;
        font-size: 0.85rem;
    }

    .btn-sm {
        padding: 4px 10px;
        font-size: 0.75rem;
    }

    .btn-delete {
        margin-bottom: 5px;
        display: block;
        width: 100%;
    }

    .delete-form {
        display: block;
        width: 100%;
    }

    /* Form */
    .form-container {
        padding: 20px 15px;
        border-radius: 8px;
    }

    .form-group {
        margin-bottom: 20px;
    }

    .form-group label {
        font-size: 0.9rem;
    }

    .form-control {
        padding: 10px 12px;
        font-size: 0.9rem;
    }

    .form-actions {
        flex-direction: column;
        margin-top: 25px;
    }

    .form-actions .btn {
        width: 100%;
        margin-bottom: 10px;
    }

    /* Login */
    .login-container {
        padding: 20px 10px;
    }

    .login-box {
        padding: 30px 20px;
        border-radius: 12px;
    }

    .login-title {
        font-size: 1.5rem;
    }

    .login-subtitle {
        font-size: 0.9rem;
        margin-bottom: 20px;
    }

    /* Order Form - Custom Table */
    .t1 {
        grid-template-columns: 1fr;
        gap: 5px;
    }

    .t2 {
        grid-template-columns: 1fr;
        gap: 5px;
    }

    .tb2 tr {
        display: block;
        margin-bottom: 10px;
    }

    .tb2 td {
        display: block;
        width: 100%;
        text-align: left;
        border-bottom: none;
        padding: 5px 0;
    }

    .tb3 {
        font-size: 11px;
    }

    .tb3 td {
        padding: 2px 3px;
        font-size: 11px;
    }

    .inps {
        width: 100%;
        font-size: 11px;
    }

    .result1 {
        font-size: 11px;
    }

    /* Status */
    .status {
        font-size: 0.75rem;
        padding: 3px 10px;
    }

    /* Empty State */
    .empty-state {
        padding: 40px 20px;
    }

    .empty-state p {
        font-size: 1rem;
    }

    /* Alert */
    .alert {
        padding: 10px 15px;
        font-size: 0.9rem;
    }
}

/* Extra Small Mobile (<480px) */
@media (max-width: 479px) {
    /* Page Header */
    .page-header h1 {
        font-size: 1.2rem;
    }

    /* Navbar */
    .nav-brand h2 {
        font-size: 1rem;
    }

    /* Table */
    .table th,
    .table td {
        padding: 5px;
        font-size: 0.75rem;
    }

    .table .thumbnail {
        width: 50px;
        height: 50px;
    }

    .table .order-id {
        font-size: 0.85rem;
    }

    /* Pagination */
    .pagination-links .btn {
        padding: 5px 8px;
        font-size: 0.75rem;
    }

    /* Form */
    .form-container {
        padding: 15px 12px;
    }

    .form-control {
        padding: 8px 10px;
        font-size: 0.85rem;
    }

    /* Login Box */
    .login-box {
        padding: 25px 15px;
    }

    .login-title {
        font-size: 1.3rem;
    }

    /* Search */
    .search-input {
        font-size: 0.85rem;
        padding: 10px 12px;
    }
}

/* 订单状态样式 */
.status-select {
    padding: 6px 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    background-color: #fff;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s;
    width: 120px;
}

.status-select:hover {
    border-color: #667eea;
    box-shadow: 0 2px 5px rgba(102, 126, 234, 0.2);
}

.status-select:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.status-select option {
    padding: 8px 10px;
}

.status-form {
    margin: 0;
}

.status-form form {
    margin: 0;
}

/* 订单状态标签样式 (可选，用于显示) */
.status-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 0.85rem;
    font-weight: 500;
    text-align: center;
}

.status-badge.received {
    background-color: #e3f2fd;
    color: #1976d2;
}

.status-badge.processing {
    background-color: #fff3e0;
    color: #f57c00;
}

.status-badge.paused {
    background-color: #fce4ec;
    color: #c2185b;
}

.status-badge.shipped {
    background-color: #e8f5e9;
    color: #388e3c;
}

.status-badge.deleted {
    background-color: #ffebee;
    color: #d32f2f;
}
