/* 公共样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    overflow-x: hidden;
}

body {
    font-family: "Microsoft YaHei", "PingFang SC", sans-serif;
    font-size: 14px;
    color: #333;
    background-color: #f5f6f8;
}

a {
    text-decoration: none;
    color: inherit;
}

ul, ol {
    list-style: none;
}

input, button {
    outline: none;
    border: none;
}

/* 登录页样式 */
.login-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f5f5f5;
}

.login-box {
    width: 380px;
    padding: 40px;
    background: #fff;
    border-radius: 8px;
    border: 1px solid #eee;
}

.login-logo {
    text-align: center;
    margin-bottom: 30px;
}

.login-logo img {
    width: 60px;
    height: 60px;
}

.login-logo h1 {
    font-size: 22px;
    color: #333;
    font-weight: bold;
}

.login-form {
    margin-top: 20px;
}

.form-item {
    margin-bottom: 20px;
}

.form-item label {
    display: block;
    margin-bottom: 8px;
    color: #666;
    font-size: 14px;
}

.form-item input {
    width: 100%;
    height: 42px;
    padding: 0 15px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    transition: border-color 0.3s;
}

.form-item input:focus {
    border-color: #20B55B;
}

.form-item .error-msg {
    color: #e74c3c;
    font-size: 12px;
    margin-top: 5px;
    display: none;
}

.form-item.error input {
    border-color: #e74c3c;
}

.form-item.error .error-msg {
    display: block;
}

.login-btn {
    width: 100%;
    height: 42px;
    background: #20B55B;
    color: #fff;
    font-size: 16px;
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.3s;
}

.login-btn:hover {
    background: #1a9a4e;
}

/* 后台布局 */
.admin-wrapper {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* 后台头部 */
.admin-header {
    height: 60px;
    background: #fff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
}

.header-left {
    display: flex;
    align-items: center;
}

.header-logo {
    display: flex;
    align-items: center;
    font-size: 18px;
    color: #333;
    font-weight: bold;
}

.header-logo img {
    width: 36px;
    height: 36px;
}

.header-logo span {
    margin-left: 8px;
}

.header-right {
    display: flex;
    align-items: center;
    cursor: pointer;
    position: relative;
}

.user-info {
    display: flex;
    align-items: center;
    padding: 5px 10px;
    border-radius: 4px;
    transition: background 0.3s;
}

.user-info:hover {
    background: #f5f5f5;
}

.user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #20B55B;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    margin-right: 10px;
}

.user-name {
    font-size: 14px;
    color: #333;
}

.arrow-down {
    margin-left: 5px;
    font-size: 10px;
    color: #999;
}

.user-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 5px;
    background: #fff;
    border-radius: 4px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.15);
    display: none;
    min-width: 100px;
    white-space: nowrap;
}

.user-dropdown.show {
    display: block;
}

.user-dropdown a {
    display: block;
    padding: 8px 15px;
    color: #666;
    font-size: 14px;
    text-align: center;
    transition: background 0.3s;
}

.user-dropdown a:hover {
    background: #f5f5f5;
    color: #20B55B;
}

.user-dropdown a:first-child {
    border-radius: 4px 4px 0 0;
}

.user-dropdown a:last-child {
    border-radius: 0 0 4px 4px;
}

/* 后台主体 */
.admin-main {
    display: flex;
    margin-top: 60px;
    min-height: calc(100vh - 60px);
}

/* 左侧菜单 */
.admin-menu {
    width: 220px;
    background: #fff;
    box-shadow: 2px 0 8px rgba(0, 0, 0, 0.05);
    position: fixed;
    left: 0;
    top: 60px;
    bottom: 0;
    overflow-y: auto;
    padding: 10px 0;
}

.menu-link {
    display: flex;
    align-items: center;
    padding: 12px 20px;
    color: #333;
    font-size: 14px;
    transition: all 0.3s;
}

.menu-link:hover {
    background: #f5f6f8;
    color: #333;
}

.menu-link.active {
    background: #e8f5e9;
    color: #20B55B;
}

.menu-link .icon {
    margin-right: 10px;
    font-size: 18px;
}

/* 子菜单 */
.menu-item {
    position: relative;
}

.menu-item > .menu-link {
    cursor: pointer;
}

.menu-item > .menu-link .arrow {
    margin-left: auto;
    font-size: 10px;
    transition: transform 0.3s;
}

.menu-item.open > .menu-link .arrow {
    transform: rotate(180deg);
}

.submenu {
    display: none;
    background: #fafafa;
}

.menu-item.open > .submenu {
    display: block;
}

.submenu-link {
    display: block;
    padding: 10px 20px 10px 48px;
    color: #666;
    font-size: 13px;
    transition: all 0.3s;
}

.submenu-link:hover {
    background: #e8f5e9;
    color: #20B55B;
}

.submenu-link.active {
    background: #e8f5e9;
    color: #20B55B;
    font-weight: 500;
}

/* 右侧内容区 */
.admin-content {
    flex: 1;
    margin-left: 220px;
    padding: 20px;
}

/* 页面标题 */
.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0;
    padding-bottom: 15px;
    border-bottom: 1px solid #eee;
}

.page-title {
    font-size: 20px;
    color: #333;
    font-weight: normal;
}

.page-actions {
    display: flex;
    gap: 10px;
}

/* 按钮 */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 20px;
    border-radius: 4px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-primary {
    background: #333;
    color: #fff;
}

.btn-primary:hover {
    background: #555;
}

.btn-default {
    background: #fff;
    color: #666;
    border: 1px solid #ddd;
}

.btn-default:hover {
    border-color: #20B55B;
    color: #20B55B;
}

/* 筛选区域 */
.filter-bar {
    background: #fff;
    padding: 20px;
    border-radius: 4px;
    margin-bottom: 15px;
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    align-items: center;
}

.filter-form {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    align-items: center;
    flex: 1;
}

.filter-item {
    display: flex;
    align-items: center;
}

.filter-item label {
    margin-right: 8px;
    color: #666;
    font-size: 14px;
    white-space: nowrap;
}

.filter-item input,
.filter-item select {
    height: 32px;
    padding: 0 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    min-width: 120px;
}

.filter-item input:focus,
.filter-item select:focus {
    border-color: #20B55B;
}

/* 数据表格 */
.data-table {
    background: #fff;
    border-radius: 4px;
    overflow-x: auto;
    overflow-y: hidden;
}

.data-table table {
    min-width: 100%;
    white-space: nowrap;
}

.data-table table th,
.data-table table td {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 150px;
}

/* 内容区域横向滚动 */
.admin-content {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
}

table th,
table td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid #f0f0f0;
}

table th {
    background: #fafafa;
    color: #666;
    font-weight: 500;
    font-size: 14px;
}

table tr:hover {
    background: #f5f6f8;
}

table tr:last-child td {
    border-bottom: none;
}

/* 状态标签 */
.status-tag {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 3px;
    font-size: 12px;
}

.status-tag.active {
    background: #e8f5e9;
    color: #20B55B;
}

.status-tag.inactive {
    background: #f5f5f5;
    color: #999;
}

.status-tag.pending {
    background: #fff3e0;
    color: #ff9800;
}

/* 单元格分组 */
.cell-group {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 22px;
}

.cell-group + .cell-group {
    border-top: 1px dashed #f0f0f0;
    margin-top: 4px;
    padding-top: 4px;
}

.cell-label {
    color: #999;
    font-size: 12px;
    flex-shrink: 0;
}

.cell-value {
    color: #333;
    font-size: 13px;
    text-align: right;
}

/* 链接样式 */
.link {
    color: #20B55B;
    font-size: 13px;
}

.link:hover {
    text-decoration: underline;
}

/* 头像小图 */
.avatar-small {
    width: 28px;
    height: 28px;
    border-radius: 50%;
}

/* 分页 */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
    gap: 5px;
}

.pagination a,
.pagination span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 34px;
    height: 34px;
    padding: 0 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    color: #666;
    transition: all 0.3s;
}

.pagination a:hover {
    border-color: #20B55B;
    color: #20B55B;
}

.pagination span.current {
    background: #333;
    border-color: #333;
    color: #fff;
}

.pagination span.disabled {
    color: #ccc;
    cursor: not-allowed;
}

/* 密码修改弹窗 */
.user-info-display {
    background: #f5f6f8;
    border-radius: 4px;
    padding: 15px;
    margin-bottom: 20px;
}

.info-row {
    display: flex;
    align-items: center;
    margin-bottom: 8px;
}

.info-row:last-child {
    margin-bottom: 0;
}

.info-label {
    color: #666;
    font-size: 14px;
    width: 60px;
}

.info-value {
    color: #333;
    font-size: 14px;
}

.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 1000;
    justify-content: center;
    align-items: center;
}

.modal-overlay.show {
    display: flex;
}

.modal {
    background: #fff;
    border-radius: 8px;
    padding: 25px;
    width: 420px;
    box-sizing: border-box;
}

.modal-header {
    font-size: 18px;
    font-weight: bold;
    margin-bottom: 20px;
    color: #333;
}

.modal-body {
    margin-bottom: 20px;
}

.modal .form-row {
    margin-bottom: 15px;
}

.modal .form-row label {
    display: block;
    margin-bottom: 5px;
    color: #666;
    font-size: 14px;
}

.modal .form-row label .required {
    color: #ff4d4f;
}

.modal .form-row input,
.modal .form-row select {
    width: 100%;
    height: 36px;
    padding: 0 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    box-sizing: border-box;
}

.modal .form-row input:focus,
.modal .form-row select:focus {
    outline: none;
    border-color: #20B55B;
}

.modal .error-msg {
    color: #ff4d4f;
    font-size: 12px;
    margin-top: 5px;
}

.modal-footer {
    text-align: right;
}

.modal-footer .btn {
    margin-left: 10px;
}

.modal .btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 20px;
    border-radius: 4px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s;
    border: none;
}

.modal .btn-primary {
    background: #20B55B;
    color: #fff;
}

.modal .btn-primary:hover {
    background: #1a9a4e;
}

.modal .btn-default {
    background: #fff;
    color: #666;
    border: 1px solid #ddd;
}

.modal .btn-default:hover {
    border-color: #20B55B;
    color: #20B55B;
}

/* 提示信息 */
.alert {
    padding: 12px 20px;
    border-radius: 4px;
    margin-bottom: 15px;
    font-size: 14px;
    animation: alertFadeIn 0.3s ease-out;
}

.alert-success {
    background: #e8f5e9;
    color: #20B55B;
    border: 1px solid #c8e6c9;
}

.alert-error {
    background: #ffebee;
    color: #f44336;
    border: 1px solid #ffcdd2;
}

.alert.fade-out {
    animation: alertFadeOut 0.5s ease-out forwards;
}

@keyframes alertFadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes alertFadeOut {
    from {
        opacity: 1;
        transform: translateY(0);
    }
    to {
        opacity: 0;
        transform: translateY(-10px);
    }
}

/* 确认弹窗文字 */
.confirm-text {
    text-align: center;
    padding: 20px 0;
    font-size: 15px;
    color: #333;
}

/* 操作链接 */
.operate-link {
    color: #20B55B;
    cursor: pointer;
    margin: 0 5px;
}

.operate-link:hover {
    text-decoration: underline;
}

.operate-link.danger {
    color: #f44336;
}

/* 空数据 */
.empty-data {
    text-align: center;
    color: #999;
    padding: 40px 0 !important;
}

/* 筛选区域按钮 */
.filter-bar .btn-filter,
.filter-bar .btn-reset {
    height: 32px;
    padding: 0 20px;
    font-size: 14px;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s;
    margin-left: 5px;
}

.filter-bar .btn-filter {
    background: #20B55B;
    color: #fff;
    border: none;
}

.filter-bar .btn-filter:hover {
    background: #1a9a4e;
}

.filter-bar .btn-reset {
    background: #fff;
    color: #666;
    border: 1px solid #ddd;
}

.filter-bar .btn-reset:hover {
    border-color: #20B55B;
    color: #20B55B;
}

/* 添加管理员按钮 */
.filter-bar .btn-action {
    height: 32px;
    padding: 0 20px;
    font-size: 14px;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s;
    background: #20B55B;
    color: #fff;
    border: none;
    margin-left: auto;
}

.filter-bar .btn-action:hover {
    background: #1a9a4e;
}

/* 筛选行（保留兼容） */
.filter-row {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    width: 100%;
    align-items: center;
}

.filter-row + .filter-row {
    margin-top: 10px;
    padding-top: 15px;
    border-top: 1px dashed #eee;
}
