body, html {
    margin: 0;
    padding: 0;
    font-family: sans-serif;
    background: #f9f9f9;
    height: 100%;
}

body.login-page {background:#253a47; display:flex; align-items:center; justify-content:center; height:100vh;}
.login-box {background:#fff; padding:28px; border-radius:10px; box-shadow:0 0 10px #0002; display:flex; flex-direction:column; width:90%; max-width:320px;}
.login-box input {margin-bottom:16px; padding:9px; font-size:16px; border:1px solid #ccc; border-radius:5px;}
.login-box button {padding:9px; background:#273043; color:#fff; border:none; border-radius:5px; font-size:16px;}
.login-box .error {color:red; margin-bottom:10px;}


.main-header {
    display: flex;
    align-items: center;
    height: 54px;
    background: #273043;
    color: #fff;
    padding: 0 18px;
    position: fixed;
    top: 0; left: 0; right: 0;
    z-index: 1100;
    width: 100%;
}
.logo { font-size: 20px; font-weight: bold; margin-right: auto; }
.user-bar { margin-left: auto; }
.sidebar-toggle { background: none; border: none; color: #fff; font-size: 26px; margin-right: 18px; cursor: pointer; }

.main-sidebar {
    width: 180px;
    background: #202830;
    color: #fff;
    position: fixed;
    top: 54px;
    bottom: 0;
    left: 0;
    padding-top: 20px;
    transition: width 0.25s;
    z-index: 1000;
    overflow-x: hidden;
    overflow-y: auto;
}
.main-sidebar .sidebar-menu { list-style: none; padding: 0; margin: 0; }
.main-sidebar .sidebar-menu li { margin: 16px 0; }
.main-sidebar .sidebar-menu a {
    color: #fff;
    text-decoration: none;
    padding: 8px 18px;
    display: flex;
    align-items: center;
    transition: background 0.15s;
    border-radius: 5px;
}
.main-sidebar .sidebar-menu a:hover,
.main-sidebar .sidebar-menu a.active { background: #344050; }
.main-sidebar i { margin-right: 10px; font-size: 19px; min-width: 22px; display: inline-block; }

body.sidebar-collapsed .main-sidebar { width: 52px; }
body.sidebar-collapsed .main-sidebar .menu-text { display: none; }
body.sidebar-collapsed .main-sidebar .sidebar-menu a,
body.sidebar-collapsed .main-sidebar .sidebar-menu li {
    text-align: center;
    padding-left: 0 !important;
    padding-right: 0 !important;
    white-space: nowrap;
    overflow: hidden;
}
body.sidebar-collapsed .main-sidebar i {
    margin: 0 auto;
    font-size: 22px;
    min-width: 0;
}
body.sidebar-collapsed .main-content { margin-left: 52px; }

.main-content {
    margin-left: 180px;
    margin-top: 54px;
    padding: 32px 22px 32px 22px;
    min-height: calc(100vh - 54px);
    background: #fafbfc;
    transition: margin-left 0.25s;
    box-sizing: border-box;
}

@media (max-width: 768px) {
    .main-sidebar,
    body.sidebar-collapsed .main-sidebar {
        width: 80vw;
        left: 0;
        top: 54px;
        height: 100vh;
        z-index: 1000;
        padding-top: 8px;
        transition: left 0.2s;
    }
    .main-content,
    body.sidebar-collapsed .main-content {
        margin-left: 0 !important;
        padding: 16px 4vw;
    }
    body:not(.sidebar-collapsed) .main-sidebar {
        left: 0;
    }
    body.sidebar-collapsed .main-sidebar {
        left: -82vw;
    }
    body:not(.sidebar-collapsed) {
        overflow: hidden; /* 阻止侧栏展开时内容滚动 */
    }
}

/* 隐藏滚动条美化 */
::-webkit-scrollbar { width: 8px; background: #f1f1f1; }
::-webkit-scrollbar-thumb { background: #e0e0e0; border-radius: 8px; }

.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 16px;
    margin-top: 14px;
}
.btn-primary {
    background: #1976d2;
    color: #fff;
    border: none;
    padding: 8px 26px;
    border-radius: 6px;
    font-size: 15px;
    cursor: pointer;
    transition: background .18s;
}
.btn-primary:hover { background: #155aa8; }
.btn-cancel {
    background: #fff;
    color: #273043;
    border: 1px solid #c1c6d2;
    padding: 8px 26px;
    border-radius: 6px;
    font-size: 15px;
    cursor: pointer;
    transition: border-color .18s;
}
.btn-cancel:hover { border-color: #1976d2; color: #1976d2; }


.table-list {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 2px 12px #0001;
    overflow: hidden;
}
.table-list th, .table-list td {
    border: 1px solid #e3e6ec;
    padding: 12px 10px;
    text-align: left;
}
.table-list th {
    background: #f8fafb;
    font-weight: bold;
}
.table-list tr:hover {
    background: #f3f6fa;
}
.form-group label {
  display: block;
  margin-bottom: 7px;
  font-size: 15px;
  color: #333;
}

.form-group input,
.form-group select {
  width: 100%;
  box-sizing: border-box;
  padding: 8px 10px;
  border: 1px solid #ccc;
  border-radius: 6px;
  font-size: 15px;
  background: #f9f9f9;
  margin-bottom: 0;
  outline: none;
}
.form-group input:focus,
.form-group select:focus {
  border-color: #1976d2;
}

.modal {
  display: none;
  position: fixed;
  left: 0; top: 0; right: 0; bottom: 0;
  width: 100vw;
  background: rgba(0,0,0,0.15);
  z-index: 9999;
  align-items: center;
  justify-content: center;
}

.modal.show { display: flex; }

.modal-form {
  background: #fff;
  max-width: 360px;
  width: 100%;
  padding: 32px 26px;
  border-radius: 12px;
  box-shadow: 0 6px 32px #0002;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

@media (max-width: 600px) {
  .modal-form {
    max-width: 96vw;
    width: 66vw;
    min-width: 0;
    padding: 14px 4vw;
    font-size: 16px;
    max-height: 90vh;
    overflow-y: auto;
    box-sizing: border-box;
  }
  .modal {
    align-items: flex-start;
    justify-content: center;
    padding-top: 40vw;
    padding-bottom: 8vw;
  }
}



