/* 通用样式 - 所有页面共享 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Microsoft YaHei', Arial, sans-serif;
    background: linear-gradient(135deg, #f0f4f8 0%, #d9e2ec 100%);
    color: #333;
    min-height: 100vh;
}

.container {
    display: flex;
    min-height: 100vh;
}

/* 左侧菜单样式 */
.sidebar {
    width: 200px;
    background: white;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    color: rgba(0, 0, 0, 0.8);
    padding: 20px 0;
    transition: width 0.3s ease;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
    position: relative;
}

.sidebar-header {
    padding: 0 20px 20px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
    margin-bottom: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.sidebar-header img {
    height: 40px;
    width: auto;
}

.logo {
    font-size: 18px;
    font-weight: 400;
    color: #4068f8;
}

.toggle-btn {
    cursor: pointer;
    font-size: 16px;
    transition: transform 0.3s ease;
    padding: 5px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
}

.toggle-btn:hover {
    background: rgba(255, 255, 255, 0.2);
}

.sidebar-menu {
    list-style: none;
    margin-top: 20px;
    flex: 1;
}

.sidebar-menu li {
    color: rgba(0, 0, 0, 0.8);
    padding: 12px 0;
    cursor: pointer;
    position: relative;
    border-radius: 0;
    margin: 0 20px;
}

.sidebar-menu li.sidebar-bottom-item {
    margin-top: auto;
    position: absolute;
    bottom: 20px;
    left: 0;
    right: 0;
    margin-left: 20px;
    margin-right: 20px;
}

.sidebar-menu li:hover {
    background: rgba(0, 0, 0, 0.04);
    border-radius: 12px;
}

.sidebar-menu li.active {
    background: rgba(64, 104, 248, 0.95);
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(64, 104, 248, 0.2);
    color: white;
}

.sidebar-menu .menu-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-left: 20px;
    min-height: 24px;
}

.sidebar-menu .menu-item > span:first-child {
    margin-right: 8px;
}

.sidebar-menu .menu-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    margin-right: 8px;
    flex-shrink: 0;
}

.sidebar-menu .menu-icon svg {
    width: 18px;
    height: 18px;
}

.sidebar-menu .menu-text {
    flex: 1;
}

.sidebar-menu .arrow {
    font-size: 12px;
    transition: transform 0.3s ease;
    color: rgba(0, 0, 0, 0.5);
}

.sidebar-menu li.has-active-child .arrow {
    color: rgba(0, 0, 0, 0.5);
    transform: rotate(180deg);
}

.sidebar-menu li.has-active-child > .menu-item {
    /* 移除背景，保持与无子菜单的一级菜单一致 */
}

.sidebar-menu li.active .arrow {
    color: white;
    transform: rotate(180deg);
}

.sidebar-menu .arrow.expanded {
    transform: rotate(180deg);
}

.sidebar-menu li.expanded-parent > .menu-item {
    /* 移除背景，保持与无子菜单的一级菜单一致 */
}

.sidebar-menu .submenu {
    list-style: none;
    margin-left: 0;
    margin-top: 8px;
    font-size: 14px;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.sidebar-menu .submenu.expanded {
    max-height: 500px;
}

.sidebar-menu .submenu li {
    padding: 10px 25px;
    margin-bottom: 8px;
}

.sidebar-menu .submenu li:last-child {
    margin-bottom: 0;
}

.sidebar-menu .submenu li.active {
    background: rgba(64, 104, 248, 0.95);
    border-radius: 12px;
    color: white;
}

/* 主内容区样式 */
.main-content {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
}

/* 主内容区顶部头部样式 */
.top-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.breadcrumb {
    font-size: 14px;
    color: #64748b;
}

.breadcrumb .separator {
    margin: 0 8px;
}

.breadcrumb .current {
    color: #111827;
    font-weight: 500;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 15px;
}

.role-badge {
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 12px;
    color: white;
}

.logout-btn {
    padding: 8px 16px;
    border: 1px solid #e2e8f0;
    background: white;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
}

.logout-btn:hover {
    border-color: #ef4444;
    color: #ef4444;
}

.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.header h2 {
    font-size: 24px;
    font-weight: normal;
    color: #333;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 15px;
}

.tenant-info {
    position: relative;
}

.tenant-name {
    padding: 8px 12px;
    background: rgba(255, 255, 255, 0.6);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, #4068f8 0%, #5b8ef9 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: normal;
    cursor: pointer;
}

.dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 8px;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    padding: 8px 0;
    min-width: 150px;
    z-index: 1000;
    display: none;
}

.dropdown.show {
    display: block;
}

.dropdown-item {
    padding: 10px 15px;
    cursor: pointer;
    font-size: 14px;
    color: #333;
    transition: background 0.2s;
}

.dropdown-item:hover {
    background: rgba(64, 104, 248, 0.1);
}

/* 确认弹窗样式 */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 2000;
    justify-content: center;
    align-items: center;
}

.modal.show {
    display: flex;
}

.modal-content {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: 16px;
    padding: 30px;
    max-width: 400px;
    width: 90%;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
}

.modal-title {
    font-size: 20px;
    font-weight: normal;
    color: #333;
    margin-bottom: 15px;
}

.modal-body {
    font-size: 16px;
    color: #666;
    margin-bottom: 25px;
    line-height: 1.5;
}

.modal-footer {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

.btn {
    padding: 10px 20px;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s;
}

.btn-cancel {
    background: rgba(0, 0, 0, 0.05);
    color: #666;
}

.btn-cancel:hover {
    background: rgba(0, 0, 0, 0.1);
}

.btn-confirm {
    background: #4068f8;
    color: white;
}

.btn-confirm:hover {
    background: #3558d9;
}

/* 查询区域样式 */
.query-area {
    background: rgba(255, 255, 255, 0.6);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: none;
}

.query-form {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 15px;
}

.query-item {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.query-item label {
    font-size: 13px;
    color: rgba(0, 0, 0, 0.6);
}

.query-item input,
.query-item select {
    padding: 8px 12px;
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    font-size: 14px;
}

.query-actions {
    display: flex;
    gap: 10px;
    margin-top: 15px;
}

.btn-query {
    background: #4068f8;
    color: white;
    padding: 8px 20px;
}

.btn-query:hover {
    background: #3558d9;
}

.btn-reset {
    background: rgba(0, 0, 0, 0.05);
    color: #666;
    padding: 8px 20px;
}

.btn-reset:hover {
    background: rgba(0, 0, 0, 0.1);
}

/* 列表区域样式 */
.list-area {
    background: rgba(255, 255, 255, 0.6);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-radius: 12px;
    padding: 20px;
    box-shadow: none;
}

.table-container {
    overflow-x: auto;
}

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

thead tr {
    background: rgba(0, 0, 0, 0.03);
}

th {
    padding: 12px;
    text-align: left;
    font-size: 14px;
    color: rgba(0, 0, 0, 0.6);
    border-bottom: 2px solid rgba(0, 0, 0, 0.05);
}

th:first-child {
    border-top-left-radius: 12px;
}

th:last-child {
    border-top-right-radius: 12px;
}

td {
    padding: 12px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    font-size: 14px;
}

tbody tr:hover {
    background: rgba(64, 104, 248, 0.05);
}

.status {
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
}

.status-pending {
    background: rgba(255, 193, 7, 0.2);
    color: #ff9800;
}

.status-active {
    background: rgba(76, 175, 80, 0.2);
    color: #4caf50;
}

.status-expired {
    background: rgba(158, 158, 158, 0.2);
    color: #9e9e9e;
}

.pagination {
    display: flex;
    justify-content: flex-end;
    gap: 5px;
    margin-top: 20px;
}

.pagination button {
    padding: 6px 12px;
    border: 1px solid rgba(0, 0, 0, 0.1);
    background: rgba(255, 255, 255, 0.8);
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    transition: all 0.2s;
}

.pagination button:hover {
    background: #4068f8;
    color: white;
    border-color: #4068f8;
}

.pagination button.active {
    background: #4068f8;
    color: white;
    border-color: #4068f8;
}
