/* 全局样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
    background: #f5f5f5;
    color: #333;
    line-height: 1.6;
}

/* 顶部导航栏 */
.top-bar {
    background: #2c3e50;
    color: #ecf0f1;
    padding: 0 24px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    position: sticky;
    top: 0;
    z-index: 100;
}

.top-bar .logo {
    font-size: 1.3em;
    font-weight: 600;
    color: #ecf0f1;
    display: flex;
    align-items: center;
    gap: 8px;
}

.top-bar .user-info {
    display: flex;
    align-items: center;
    gap: 16px;
    font-size: 0.9em;
}

.top-bar .user-info a {
    color: #ecf0f1;
    opacity: 0.8;
    transition: opacity .15s;
    text-decoration: none;
}

.top-bar .user-info a:hover {
    opacity: 1;
}

/* 侧边栏布局 */
.layout-with-sidebar {
    display: flex;
    height: calc(100vh - 60px);
}

.sidebar {
    width: 220px;
    background: #34495e;
    padding: 20px 0;
    overflow-y: auto;
}

.sidebar nav {
    display: flex;
    flex-direction: column;
}

.sidebar nav a {
    color: #ecf0f1;
    text-decoration: none;
    padding: 12px 24px;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: background .15s;
    opacity: 0.8;
}

.sidebar nav a:hover {
    background: rgba(255,255,255,0.1);
    opacity: 1;
}

.sidebar nav a.active {
    background: rgba(255,255,255,0.15);
    opacity: 1;
    border-left: 3px solid #3498db;
}

.sidebar nav a span {
    font-size: 1.2em;
}

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

/* 容器 */
.container {
    max-width: 1200px;
    margin: 0 auto;
}

/* 卡片 */
.card {
    background: white;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    margin-bottom: 20px;
}

.card-header {
    font-size: 1.2em;
    font-weight: 600;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 2px solid #f0f0f0;
}

/* 按钮 */
.btn {
    display: inline-block;
    padding: 10px 20px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    text-decoration: none;
    transition: all .15s;
    font-size: 0.95em;
}

.btn-primary {
    background: #3498db;
    color: white;
}

.btn-primary:hover {
    background: #2980b9;
}

.btn-success {
    background: #27ae60;
    color: white;
}

.btn-success:hover {
    background: #229954;
}

.btn-danger {
    background: #e74c3c;
    color: white;
}

.btn-danger:hover {
    background: #c0392b;
}

.btn-secondary {
    background: #95a5a6;
    color: white;
}

.btn-secondary:hover {
    background: #7f8c8d;
}

/* 表单 */
.form-group {
    margin-bottom: 16px;
}

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

.form-control {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 0.95em;
}

.form-control:focus {
    outline: none;
    border-color: #3498db;
}

/* 表格 */
.table {
    width: 100%;
    border-collapse: collapse;
}

.table th,
.table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #f0f0f0;
}

.table th {
    background: #f8f9fa;
    font-weight: 600;
}

.table tr:hover {
    background: #f8f9fa;
}

/* 工具提示 */
.text-muted {
    color: #7f8c8d;
    font-size: 0.9em;
}

.text-success {
    color: #27ae60;
}

.text-danger {
    color: #e74c3c;
}

/* 响应式 */
@media (max-width: 768px) {
    .layout-with-sidebar {
        flex-direction: column;
    }
    
    .sidebar {
        width: 100%;
        height: auto;
    }
    
    .main-content {
        padding: 16px;
    }
}
