/* 按摩应用后台管理系统样式 */
/* 黑色系为主，搭配绿色、红色、蓝色 */

/* 全局样式 */
:root {
    --primary-bg: #121212;
    --secondary-bg: #1e1e1e;
    --card-bg: #252525;
    --text-primary: #ffffff;
    --text-secondary: #b3b3b3;
    --accent-green: #4caf50;
    --accent-red: #f44336;
    --accent-blue: #2196f3;
    --border-color: #333333;
    --hover-bg: #333333;
}

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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--primary-bg);
    color: var(--text-primary);
    line-height: 1.6;
}

a {
    text-decoration: none;
    color: var(--text-primary);
}

ul {
    list-style: none;
}

/* 顶部导航栏 */
.top-navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: var(--secondary-bg);
    padding: 0 20px;
    height: 60px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
}

.logo h1 {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--accent-green);
}

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

.user-name {
    margin-right: 15px;
    font-weight: 500;
}

.dropdown {
    position: relative;
}

.dropdown-toggle {
    background: none;
    border: none;
    color: var(--text-primary);
    font-size: 1.2rem;
    cursor: pointer;
}

.dropdown-menu {
    position: absolute;
    right: 0;
    top: 100%;
    background-color: var(--card-bg);
    min-width: 150px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
    display: none;
    z-index: 1001;
}

.dropdown:hover .dropdown-menu {
    display: block;
}

.dropdown-menu a {
    display: block;
    padding: 10px 15px;
    color: var(--text-primary);
}

.dropdown-menu a:hover {
    background-color: var(--hover-bg);
}

/* 容器 */
.container {
    display: flex;
    margin-top: 60px;
    min-height: calc(100vh - 60px);
}

/* 侧边栏 */
.sidebar {
    width: 250px;
    background-color: var(--secondary-bg);
    height: calc(100vh - 60px);
    position: fixed;
    overflow-y: auto;
    transition: all 0.3s ease;
}

.nav-menu {
    padding: 20px 0;
}

.nav-item {
    margin-bottom: 5px;
}

.nav-item a {
    display: flex;
    align-items: center;
    padding: 12px 20px;
    color: var(--text-secondary);
    transition: all 0.3s ease;
}

.nav-item a i {
    margin-right: 10px;
    font-size: 1.1rem;
}

.nav-item a:hover {
    background-color: var(--hover-bg);
    color: var(--text-primary);
}

.nav-item.active a {
    background-color: var(--accent-green);
    color: white;
}

/* 主内容区域 */
.main-content {
    flex: 1;
    padding: 20px;
    margin-left: 250px;
    transition: all 0.3s ease;
}

/* 卡片样式 */
.card {
    background-color: var(--card-bg);
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    margin-bottom: 20px;
    overflow: hidden;
}

.card-header {
    padding: 15px 20px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.card-title {
    font-size: 1.2rem;
    font-weight: 500;
}

.card-body {
    padding: 20px;
}

/* 仪表盘卡片 */
.dashboard-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    padding: 20px;
    border-radius: 8px;
    display: flex;
    align-items: center;
}

.stat-card i {
    font-size: 2.5rem;
    margin-right: 15px;
}

.stat-card.green {
    background-color: rgba(76, 175, 80, 0.2);
    border-left: 4px solid var(--accent-green);
}

.stat-card.red {
    background-color: rgba(244, 67, 54, 0.2);
    border-left: 4px solid var(--accent-red);
}

.stat-card.blue {
    background-color: rgba(33, 150, 243, 0.2);
    border-left: 4px solid var(--accent-blue);
}

.stat-card.purple {
    background-color: rgba(156, 39, 176, 0.2);
    border-left: 4px solid #9c27b0;
}

.stat-info h3 {
    font-size: 1.8rem;
    margin-bottom: 5px;
}

.stat-info p {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

/* 表格样式 */
.table-container {
    overflow-x: auto;
}

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

table th, table td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

table th {
    background-color: var(--secondary-bg);
    color: var(--text-primary);
    font-weight: 500;
}

table tr:hover {
    background-color: var(--hover-bg);
}

/* 按钮样式 */
.btn {
    display: inline-block;
    padding: 8px 15px;
    border-radius: 4px;
    font-weight: 500;
    cursor: pointer;
    border: none;
    transition: all 0.3s ease;
}

.btn-primary {
    background-color: var(--accent-green);
    color: white;
}

.btn-danger {
    background-color: var(--accent-red);
    color: white;
}

.btn-info {
    background-color: var(--accent-blue);
    color: white;
}

.btn-sm {
    padding: 5px 10px;
    font-size: 0.9rem;
}

/* 图表容器 */
.chart-container {
    height: 300px;
    margin-bottom: 20px;
}

/* 页脚 */
.footer {
    background-color: var(--secondary-bg);
    text-align: center;
    padding: 15px;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

/* 模态框样式 */
.modal {
    display: none;
    position: fixed;
    z-index: 1050;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.5);
}

.modal-content {
    background-color: var(--card-bg);
    margin: 10% auto;
    padding: 20px;
    border-radius: 8px;
    width: 60%;
    max-width: 600px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    position: relative;
}

.close-modal {
    position: absolute;
    right: 20px;
    top: 15px;
    font-size: 1.5rem;
    cursor: pointer;
}

.modal-header {
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 15px;
    margin-bottom: 15px;
}

.modal-title {
    font-size: 1.3rem;
    font-weight: 500;
}

.modal-body {
    margin-bottom: 20px;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding-top: 15px;
    border-top: 1px solid var(--border-color);
}

/* 表单样式 */
.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
}

.form-control {
    width: 100%;
    padding: 10px;
    border-radius: 4px;
    border: 1px solid var(--border-color);
    background-color: var(--secondary-bg);
    color: var(--text-primary);
}

.form-control:focus {
    outline: none;
    border-color: var(--accent-blue);
}

/* 响应式设计 */
@media (max-width: 992px) {
    .sidebar {
        width: 70px;
    }
    
    .nav-item a span {
        display: none;
    }
    
    .nav-item a i {
        margin-right: 0;
        font-size: 1.3rem;
    }
    
    .main-content {
        margin-left: 70px;
    }
}

@media (max-width: 768px) {
    .dashboard-cards {
        grid-template-columns: 1fr;
    }
    
    .modal-content {
        width: 90%;
    }
}

/* 加载动画 */
.loader {
    border: 4px solid rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    border-top: 4px solid var(--accent-green);
    width: 30px;
    height: 30px;
    animation: spin 1s linear infinite;
    margin: 20px auto;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* 提示消息 */
.alert {
    padding: 12px 15px;
    border-radius: 4px;
    margin-bottom: 20px;
}

.alert-success {
    background-color: rgba(76, 175, 80, 0.2);
    border-left: 4px solid var(--accent-green);
}

.alert-danger {
    background-color: rgba(244, 67, 54, 0.2);
    border-left: 4px solid var(--accent-red);
}

.alert-info {
    background-color: rgba(33, 150, 243, 0.2);
    border-left: 4px solid var(--accent-blue);
}