html, body {
    margin: 0;
    padding: 0;
    height: 100%;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

#app {
    height: 100%;
}

/* 滚动条样式 */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* 导航栏样式 */
.main-container {
    display: flex;
    height: 100vh;
    overflow: hidden;
}

.sidebar {
    width: 200px;
    background: #ffffff;
    border-right: 1px solid #e8e8e8;
    display: flex;
    flex-direction: column;
    box-shadow: 2px 0 8px rgba(0, 0, 0, 0.02);
}

.logo-section {
    padding: 24px 16px;
    text-align: center;
    border-bottom: 1px solid #f5f5f5;
}

.logo-icon {
    width: 50px;
    height: 50px;
    margin: 0 auto;
    background: linear-gradient(135deg, #29B6F6 0%, #0277BD 100%);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(2, 136, 209, 0.4);
}

.logo-icon svg {
    width: 28px;
    height: 28px;
}

.logo {
    font-size: 16px;
    font-weight: 600;
    color: #333333;
    margin-top: 12px;
}

.nav-menu {
    flex: 1;
    padding: 16px 0;
}

.nav-menu ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.nav-menu li {
    margin-bottom: 2px;
}

.nav-menu li a {
    display: flex;
    align-items: center;
    padding: 12px 20px;
    color: #666666;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s ease;
    background: transparent;
    gap: 10px;
}

.nav-menu li a:hover {
    background: #f5f7fa;
    color: #333333;
}

.nav-menu li a.nav-active {
    background: #e6f4ff !important;
    color: #1890ff !important;
    border-right: 3px solid #1890ff;
}



.content-area {
    flex: 1;
    background: #f5f7fa;
    overflow: auto;
}

/* 表格样式 */
.instance-table {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
}

.instance-table th,
.instance-table td {
    padding: 12px 16px;
    text-align: left;
    font-size: 14px;
    vertical-align: middle;
    white-space: normal;
    word-break: break-all;
    overflow-wrap: break-word;
}

.instance-table th {
    background: #fafafa;
    color: #666666;
    font-weight: 500;
    font-size: 13px;
}

.instance-table th:nth-child(1),
.instance-table td:nth-child(1) { width: 12%; }

.instance-table th:nth-child(2),
.instance-table td:nth-child(2) { width: 25%; }

.instance-table th:nth-child(3),
.instance-table td:nth-child(3) { width: 10%; }

.instance-table th:nth-child(4),
.instance-table td:nth-child(4) { width: 10%; }

.instance-table th:nth-child(5),
.instance-table td:nth-child(5) { width: 28%; }

.instance-table th:nth-child(6),
.instance-table td:nth-child(6) { width: 15%; }

.instance-table tbody tr {
    border-bottom: 1px solid #f0f0f0;
    transition: background 0.15s ease;
}

.instance-table tbody tr:hover {
    background: #fafafa;
}

.instance-table td {
    color: #333333;
}

.instance-id {
    font-family: monospace;
    font-size: 13px;
    color: #666666;
}

.visit-count {
    display: inline-block;
    padding: 2px 8px;
    background: #f6ffed;
    color: #52c41a;
    border-radius: 4px;
    font-size: 12px;
}

.update-content {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.instance-table td.action-buttons {
    display: flex;
    gap: 8px;
    white-space: normal;
    overflow: visible;
    text-overflow: clip;
}

/* 操作按钮 */
.btn-action {
    padding: 4px 10px;
    border: none;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    white-space: nowrap;
    min-width: 50px;
}

.btn-action.btn-edit {
    background: #52c41a !important;
    color: #ffffff !important;
}

.btn-action.btn-edit:hover {
    background: #3d9e14 !important;
}

.btn-action.btn-delete {
    background: #ff4d4f !important;
    color: #ffffff !important;
}

.btn-action.btn-delete:hover {
    background: #d9363e !important;
}

/* 表格容器 */
.table-wrapper {
    flex: 1;
    overflow-x: auto;
    overflow-y: auto;
}

/* Blazor错误UI */
#blazor-error-ui {
    background: #fff3cd;
    padding: 12px 20px;
    color: #856404;
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10000;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    font-size: 14px;
    display: none;
    align-items: center;
    gap: 12px;
    max-width: 90%;
}

#blazor-error-ui .reload {
    color: #667eea;
    font-weight: 500;
    text-decoration: none;
    padding: 4px 12px;
    border: 1px solid #667eea;
    border-radius: 4px;
}

#blazor-error-ui .dismiss {
    cursor: pointer;
    font-size: 16px;
    opacity: 0.6;
}

#blazor-error-ui .dismiss:hover {
    opacity: 1;
}

.data-table {
    width: 100% !important;
    border-collapse: collapse !important;
    table-layout: fixed !important;
}

.data-table th,
.data-table td {
    padding: 12px 16px !important;
    text-align: left !important;
    font-size: 14px !important;
    vertical-align: middle !important;
    white-space: normal !important;
    word-break: break-all !important;
    overflow-wrap: break-word !important;
    line-height: 1.5 !important;
}

.data-table th:nth-child(1),
.data-table td:nth-child(1) { width: 6% !important; }

.data-table th:nth-child(2),
.data-table td:nth-child(2) { width: 25% !important; }

.data-table th:nth-child(3),
.data-table td:nth-child(3) { width: 10% !important; }

.data-table th:nth-child(4),
.data-table td:nth-child(4) { width: 15% !important; }

.data-table th:nth-child(5),
.data-table td:nth-child(5) { width: 15% !important; }

.data-table th:nth-child(6),
.data-table td:nth-child(6) { width: 14% !important; }

.data-table th:nth-child(7),
.data-table td:nth-child(7) { width: 15% !important; }

/* ========== 响应式设计 ========== */

.header-user-email {
    font-size: 14px;
    color: #595959;
    font-weight: 400;
}

.mobile-user-email {
    display: none;
    font-size: 14px;
    color: #666;
    font-weight: 500;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 180px;
}

.mobile-page-title {
    display: none;
    font-size: 15px;
    color: #262626;
    font-weight: 600;
    white-space: nowrap;
}

/* 平板端适配（768px以下） */
@media (max-width: 768px) {
    .sidebar {
        width: 60px;
        overflow: hidden;
    }

    .sidebar .logo {
        display: none;
    }

    .logo-section {
        padding: 16px 8px;
    }

    .logo-icon {
        width: 36px;
        height: 36px;
        margin: 0 auto;
    }

    .nav-link {
        justify-content: center;
        padding: 12px 8px;
    }

    .nav-link span {
        display: none;
    }

    .nav-link svg {
        width: 20px;
        height: 20px;
    }

    .top-header {
        padding: 0 16px;
    }

    .page-title {
        font-size: 16px;
    }

    .user-details {
        display: none;
    }

    .content-area {
        padding: 16px;
    }

    .search-bar {
        flex-wrap: wrap;
        gap: 8px;
    }

    .search-bar .form-group {
        flex: 1 1 calc(50% - 8px);
        min-width: 120px;
    }

    .data-table th,
    .data-table td {
        padding: 8px 10px;
        font-size: 12px;
    }

    .table-wrapper {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .data-table {
        min-width: 600px;
    }
}

/* 手机端适配（480px以下） */
@media (max-width: 480px) {
    .main-container {
        flex-direction: column;
    }

    .sidebar {
        width: 100%;
        height: 56px;
        flex-direction: row;
        position: fixed;
        bottom: 0;
        left: 0;
        z-index: 1000;
        border-right: none;
        border-top: 1px solid #e8e8e8;
        box-shadow: 0 -2px 8px rgba(0, 0, 0, 0.06);
    }

    .logo-section {
        display: none;
    }

    .nav-menu {
        width: 100%;
        padding: 0;
    }

    .nav-menu ul {
        display: flex;
        flex-direction: row;
        justify-content: space-around;
        align-items: center;
        height: 56px;
        width: 100%;
    }

    .nav-menu ul li {
        flex: 1;
    }

    .nav-link {
        flex-direction: column;
        gap: 2px;
        padding: 8px 4px;
        font-size: 10px;
        border-radius: 0;
    }

    .nav-link span {
        display: block;
        font-size: 10px;
        white-space: nowrap;
    }

    .nav-link svg {
        width: 18px;
        height: 18px;
    }

    .nav-active {
        background: transparent;
        color: #1890ff;
        border-bottom: 2px solid #1890ff;
    }

    .main-content {
        width: 100%;
        padding-bottom: 56px;
    }

    .top-header {
        height: 52px;
        padding: 0 12px;
    }

    .page-title {
        display: none;
    }

    .header-left {
        display: flex;
        align-items: center;
    }

    .mobile-page-title {
        display: block !important;
        margin-right: 8px;
    }

    .mobile-user-email {
        display: block !important;
        font-size: 13px;
        color: #666;
        font-weight: 400;
        margin-left: 0;
        padding-left: 8px;
        border-left: 1px solid #ddd;
    }

    .header-user-email {
        display: none;
    }

    .header-right {
        gap: 8px;
    }

    .user-header-info {
        gap: 8px;
    }

    .user-details {
        display: none;
    }

    .logout-text {
        display: none;
    }

    .btn-logout {
        padding: 6px 10px;
        font-size: 12px;
    }

    .btn-logout svg {
        width: 14px;
        height: 14px;
    }

    .content-area {
        padding: 12px;
        padding-bottom: 70px;
    }

    .search-bar {
        flex-direction: column;
        gap: 8px;
    }

    .search-bar .form-group {
        width: 100%;
    }

    .data-table {
        min-width: 500px;
    }

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

    .pagination .page-info {
        font-size: 12px;
    }

    .btn-add {
        padding: 6px 12px;
        font-size: 12px;
    }
}