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

body {
    min-height: 100vh;
    background: linear-gradient(135deg, #f0faf4 0%, #e8f5e9 50%, #f9fffe 100%);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', sans-serif;
    padding-left: 240px;
}

/* 侧边栏样式 */
.sidebar {
    position: fixed;
    left: 0;
    top: 0;
    width: 240px;
    height: 100vh;
    background: linear-gradient(180deg, rgba(248, 252, 249, 0.98) 0%, rgba(243, 248, 244, 0.98) 100%);
    border-right: 1px solid rgba(148, 163, 184, 0.12);
    display: flex;
    flex-direction: column;
    box-shadow: 8px 0 24px rgba(15, 23, 42, 0.05);
    z-index: 1000;
    color: #1f2937;
}

.sidebar-header {
    padding: 18px 16px 16px;
    border-bottom: 1px solid rgba(148, 163, 184, 0.10);
}

.nav-logo {
    display: flex;
    align-items: center;
    gap: 10px;
}

.nav-logo-icon {
    width: 34px;
    height: 34px;
    background: linear-gradient(135deg, #48bb78, #38a169);
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(72, 187, 120, 0.30);
}

.nav-logo-icon svg {
    width: 18px;
    height: 18px;
    fill: #fff;
}

.nav-logo-title {
    color: #1f2937;
    font-size: 15px;
    font-weight: 700;
    letter-spacing: 0;
}

.sidebar-menu {
    flex: 1;
    padding: 12px 10px 14px;
    overflow-y: auto;
}

.menu-group {
    margin-bottom: 6px;
}

.menu-item {
    display: flex;
    align-items: center;
    min-height: 42px;
    padding: 0 12px;
    color: #475569;
    font-size: 14px;
    border-radius: 10px;
    cursor: pointer;
    transition: background 0.16s ease, box-shadow 0.16s ease, color 0.16s ease, transform 0.16s ease;
    gap: 12px;
    position: relative;
    margin: 3px 4px;
}

.menu-item:hover {
    background: rgba(148, 163, 184, 0.08);
    color: #1f2937;
}

.menu-item.active {
    background: linear-gradient(135deg, rgba(224, 242, 231, 0.95), rgba(241, 248, 243, 0.95));
    box-shadow: inset 0 0 0 1px rgba(148, 163, 184, 0.08);
    color: #25603d;
    font-weight: 600;
}

.menu-item.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 10px;
    bottom: 10px;
    width: 3px;
    border-radius: 999px;
    background: #9cc8ad;
}

.menu-icon {
    width: 24px;
    height: 24px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0.95;
}

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

.menu-text {
    flex: 1;
    line-height: 1;
}

.menu-arrow {
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s;
}

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

.submenu {
    margin: 0 4px 6px 34px;
    background: rgba(255, 255, 255, 0.58);
    border: 1px solid rgba(148, 163, 184, 0.10);
    border-radius: 10px;
    overflow: hidden;
    max-height: 0;
    transition: max-height 0.32s ease, opacity 0.2s ease, transform 0.2s ease;
    opacity: 0;
    transform: translateY(-4px);
}

.submenu.active {
    max-height: 600px;
    opacity: 1;
    transform: translateY(0);
}

.submenu-item {
    padding: 9px 12px 9px 14px;
    color: #64748b;
    font-size: 13px;
    cursor: pointer;
    transition: background 0.18s ease, color 0.18s ease, transform 0.18s ease;
    border-radius: 8px;
    margin: 4px;
}

.submenu-item:hover {
    background: rgba(148, 163, 184, 0.08);
    color: #1f2937;
}

.submenu-item.active {
    background: rgba(224, 242, 231, 0.9);
    box-shadow: inset 0 0 0 1px rgba(156, 200, 173, 0.12);
    color: #25603d;
    font-weight: 600;
}

.sidebar-footer {
    padding: 16px;
    border-top: 1px solid rgba(148, 163, 184, 0.10);
    background: rgba(255, 255, 255, 0.52);
}

.sidebar-footer .user-info {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #1f2937;
    margin-bottom: 12px;
    padding: 10px 12px;
    border-radius: 14px;
    background: rgba(255,255,255,0.72);
    border: 1px solid rgba(148, 163, 184, 0.10);
}

.sidebar-footer .user-avatar {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, #eef6f0, #e4f0e7);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.12);
    overflow: hidden;
}

.sidebar-footer .user-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}

.user-details {
    flex: 1;
}

.user-name {
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 2px;
}

.user-role {
    font-size: 11px;
    opacity: 0.8;
}

.sidebar-footer .logout-btn {
    width: 100%;
    padding: 10px 12px;
    background: #f8fafc;
    color: #334155;
    border: none;
    border-radius: 12px;
    font-size: 12px;
    cursor: pointer;
    transition: background 0.18s ease, transform 0.18s ease, box-shadow 0.18s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.sidebar-footer .logout-btn:hover {
    background: #eef6f0;
    transform: translateY(-1px);
    box-shadow: 0 8px 16px rgba(15, 23, 42, 0.06);
}

.main-container {
    padding: 24px;
    max-width: 1200px;
    margin: 0 auto;
}

.page-card {
    background: #ffffff;
    border-radius: 20px;
    padding: 32px;
    box-shadow: 0 8px 40px rgba(72, 187, 120, 0.12), 0 2px 12px rgba(0, 0, 0, 0.06);
    position: relative;
    overflow: hidden;
}

.page-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #48bb78, #38a169, #68d391);
}

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.page-title {
    font-size: 20px;
    font-weight: 700;
    color: #1a202c;
}

.search-bar {
    display: flex;
    gap: 12px;
    margin-bottom: 20px;
}

.search-input-wrap {
    flex: 1;
    position: relative;
    display: flex;
    align-items: center;
}

.search-input-icon {
    position: absolute;
    left: 14px;
    color: #a0aec0;
}

.search-input-icon svg {
    width: 18px;
    height: 18px;
}

.search-input {
    width: 100%;
    height: 44px;
    border: 1.5px solid #e2e8f0;
    border-radius: 10px;
    padding: 0 14px 0 42px;
    font-size: 14px;
    background: #fafffe;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.search-input:focus {
    border-color: #48bb78;
    box-shadow: 0 0 0 3px rgba(72, 187, 120, 0.12);
    background: #fff;
}

.btn-primary {
    height: 44px;
    padding: 0 20px;
    border: none;
    border-radius: 10px;
    background: linear-gradient(135deg, #48bb78, #38a169);
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: opacity 0.2s, transform 0.1s;
    box-shadow: 0 4px 14px rgba(72, 187, 120, 0.3);
}

.btn-primary:hover {
    opacity: 0.9;
}

.btn-primary:active {
    transform: scale(0.98);
}

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

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

thead {
    background: #f7fafc;
}

th {
    padding: 14px 12px;
    text-align: left;
    font-size: 13px;
    font-weight: 600;
    color: #4a5568;
    border-bottom: 1.5px solid #e2e8f0;
}

td {
    padding: 14px 12px;
    font-size: 14px;
    color: #2d3748;
    border-bottom: 1px solid #f0f4f0;
}

tr:hover td {
    background: #fafffa;
}

.status-tag {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 500;
}

.status-tag.active {
    background: #f0faf4;
    color: #38a169;
}

.status-tag.disabled {
    background: #fff5f5;
    color: #e53e3e;
}

.action-btns {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.btn-sm {
    padding: 6px 12px;
    border: none;
    border-radius: 6px;
    font-size: 12px;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-sm-view {
    background: #ebf8ff;
    color: #3182ce;
}

.btn-sm-view:hover {
    background: #bee3f8;
}

.btn-sm-edit {
    background: #fef6e4;
    color: #dd6b20;
}

.btn-sm-edit:hover {
    background: #fed7aa;
}

.btn-sm-recharge {
    background: #f0fff4;
    color: #38a169;
}

.btn-sm-recharge:hover {
    background: #c6f6d5;
}

.btn-sm-ban {
    background: #fff5f5;
    color: #e53e3e;
}

.btn-sm-ban:hover {
    background: #fed7d7;
}

.btn-sm-delete {
    background: #fff5f5;
    color: #e53e3e;
}

.btn-sm-delete:hover {
    background: #fed7d7;
}

.btn-sm-rate {
    background: #ebf8ff;
    color: #3182ce;
}

.btn-sm-rate:hover {
    background: #bee3f8;
}

.btn-sm-toggle {
    background: #f0fff4;
    color: #38a169;
}

.btn-sm-toggle:hover {
    background: #c6f6d5;
}

.pagination {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 24px;
}

.page-btn {
    width: 36px;
    height: 36px;
    border: 1.5px solid #e2e8f0;
    border-radius: 8px;
    background: #fff;
    color: #4a5568;
    font-size: 13px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.page-btn:hover:not(:disabled) {
    border-color: #48bb78;
    color: #38a169;
}

.page-btn.active {
    background: linear-gradient(135deg, #48bb78, #38a169);
    border-color: transparent;
    color: #fff;
}

.page-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.msg-box {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 9999;
    display: none;
    min-width: 240px;
    max-width: min(92vw, 640px);
    padding: 12px 20px;
    border-radius: 10px;
    font-size: 14px;
    text-align: center;
    box-shadow: 0 12px 32px rgba(15, 23, 42, 0.16);
    backdrop-filter: blur(8px);
}

.msg-box.success {
    background: rgba(16, 185, 129, 0.96);
    color: #fff;
}

.msg-box.error {
    background: rgba(239, 68, 68, 0.96);
    color: #fff;
}

.msg-box.info {
    background: rgba(59, 130, 246, 0.96);
    color: #fff;
}

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

.form-label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: #4a5568;
    margin-bottom: 7px;
}

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

.input-wrap {
    position: relative;
    display: flex;
    align-items: center;
}

.input-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: #a0aec0;
    display: flex;
    align-items: center;
}

.input-icon svg {
    width: 17px;
    height: 17px;
}

input[type="text"],
input[type="number"] {
    width: 100%;
    height: 48px;
    border: 1.5px solid #e2e8f0;
    border-radius: 10px;
    padding: 0 14px 0 40px;
    font-size: 15px;
    color: #2d3748;
    background: #fafffe;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
    -moz-appearance: textfield;
}

input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button {
    -webkit-appearance: none;
}

input:focus {
    border-color: #48bb78;
    box-shadow: 0 0 0 3px rgba(72, 187, 120, 0.12);
    background: #fff;
}

.input-unit {
    position: absolute;
    right: 14px;
    color: #a0aec0;
    font-size: 14px;
}

.input-with-unit {
    padding-right: 50px;
}

.password-wrap {
    position: relative;
}

.toggle-visibility {
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    cursor: pointer;
    color: #a0aec0;
}

.toggle-visibility:hover {
    color: #48bb78;
}

.divider {
    margin: 24px 0;
    border: none;
    border-top: 1px solid #edf2f7;
}

.btn-group {
    display: flex;
    gap: 12px;
}

.btn-secondary {
    flex: 1;
    height: 50px;
    border: 1.5px solid #48bb78;
    border-radius: 12px;
    background: transparent;
    color: #38a169;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-secondary:hover {
    background: #f0faf4;
}

.btn-back {
    padding: 8px 16px;
    border: 1.5px solid #48bb78;
    border-radius: 8px;
    background: transparent;
    color: #38a169;
    font-size: 13px;
    cursor: pointer;
    transition: background 0.2s;
    display: flex;
    align-items: center;
    gap: 6px;
}

.btn-back:hover {
    background: #f0faf4;
}

/* 公共分页组件样式 */
.pagination-container {
    margin-top: 24px;
}

.pagination-wrapper {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.pagination-info {
    font-size: 14px;
    color: #6b7280;
}

.pagination-empty {
    font-size: 14px;
    color: #6b7280;
    text-align: center;
    padding: 16px 0;
}

.pagination-controls {
    display: flex;
    align-items: center;
    gap: 12px;
}

.pagination-page-size {
    border: 1px solid #d1d5db;
    border-radius: 8px;
    padding: 6px 10px;
    font-size: 14px;
    color: #374151;
    background: #fff;
    cursor: pointer;
    outline: none;
    transition: border-color 0.2s;
}

.pagination-page-size:hover,
.pagination-page-size:focus {
    border-color: #48bb78;
}

.pagination-btn {
    width: 36px;
    height: 36px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    background: #fff;
    color: #374151;
    font-size: 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.pagination-btn:hover:not(:disabled) {
    border-color: #48bb78;
    color: #48bb78;
}

.pagination-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.pagination-pages {
    display: flex;
    align-items: center;
    gap: 4px;
}

.pagination-page {
    min-width: 36px;
    height: 36px;
    padding: 0 8px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    background: #fff;
    color: #374151;
    font-size: 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.pagination-page:hover {
    border-color: #48bb78;
    color: #48bb78;
}

.pagination-page.active {
    background: #f0faf4;
    border-color: #9cc8ad;
    color: #25603d;
    box-shadow: inset 0 0 0 1px rgba(156, 200, 173, 0.18);
}

.pagination-ellipsis {
    padding: 0 4px;
    color: #6b7280;
    font-size: 14px;
}

@media (max-width: 768px) {
    .navbar {
        padding: 0 16px;
    }
    .nav-menu {
        display: none;
    }
    
    .pagination-wrapper {
        flex-direction: column;
        gap: 16px;
        align-items: flex-start;
    }
}
