/* Layui风格样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: "Helvetica Neue", Helvetica, "Microsoft YaHei", Arial, sans-serif;
    background: #f2f2f2;
    color: #333;
    font-size: 14px;
}

/* 主容器 */
.container {
    display: flex;
    height: 100vh;
    overflow: hidden;
}

/* 左侧导航菜单 - Layui风格 */
.sidebar {
    width: 200px;
    background: #393D49;
    color: #c2c2c2;
    overflow-y: auto;
    overflow-x: hidden;
}

.logo {
    height: 60px;
    line-height: 60px;
    padding: 0 20px;
    font-size: 16px;
    font-weight: 600;
    color: #fff;
    background: #23262E;
    text-align: center;
    border-bottom: 1px solid #2B2E37;
}

.nav-menu {
    list-style: none;
    padding: 0;
    margin: 0;
}

.nav-item {
    height: 45px;
    line-height: 45px;
    padding: 0 20px;
    cursor: pointer;
    transition: all 0.3s;
    border-left: 3px solid transparent;
    position: relative;
}

.nav-item:hover {
    background: #4E5465;
    color: #fff;
}

.nav-item.active {
    background: #009688;
    color: #fff;
    border-left-color: #5FB878;
}

.nav-item span {
    display: block;
    font-size: 14px;
}

/* 主内容区 */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: #f2f2f2;
}

/* 顶部导航栏 - Layui风格 */
.top-header {
    height: 60px;
    line-height: 60px;
    background: #fff;
    border-bottom: 1px solid #e6e6e6;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.top-header .header-title {
    font-size: 16px;
    color: #333;
    font-weight: 500;
}

.top-header .user-info {
    font-size: 14px;
    color: #666;
    display: flex;
    align-items: center;
}

/* 顶部标签页 - Layui风格 */
.tabs {
    display: flex;
    background: #fff;
    border-bottom: 1px solid #e6e6e6;
    padding: 0;
    overflow-x: auto;
}

.tab {
    padding: 0 20px;
    height: 40px;
    line-height: 40px;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    transition: all 0.3s;
    white-space: nowrap;
    color: #666;
    font-size: 14px;
}

.tab:hover {
    background: #f8f8f8;
    color: #333;
}

.tab.active {
    border-bottom-color: #009688;
    color: #009688;
    font-weight: 500;
}

/* 内容区域 */
.content-area {
    flex: 1;
    padding: 15px;
    overflow-y: auto;
    background: #f2f2f2;
}

.page {
    display: none;
}

.page.active {
    display: block;
}

/* Layui卡片样式 */
.layui-card {
    background: #fff;
    border-radius: 2px;
    box-shadow: 0 1px 2px 0 rgba(0,0,0,.05);
    margin-bottom: 15px;
}

.layui-card-header {
    height: 42px;
    line-height: 42px;
    padding: 0 15px;
    border-bottom: 1px solid #f6f6f6;
    color: #333;
    font-size: 14px;
    font-weight: 500;
}

.layui-card-body {
    padding: 15px;
}

/* 搜索区域 */
.search-section {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
    align-items: center;
}

.search-input {
    flex: 1;
    height: 38px;
    line-height: 38px;
    padding: 0 15px;
    border: 1px solid #e6e6e6;
    border-radius: 2px;
    font-size: 14px;
    background: #fff;
    transition: all 0.3s;
}

.search-input:focus {
    border-color: #009688;
    outline: none;
}

/* Layui按钮样式 */
.btn {
    display: inline-block;
    height: 38px;
    line-height: 38px;
    padding: 0 18px;
    background-color: #009688;
    color: #fff;
    white-space: nowrap;
    text-align: center;
    font-size: 14px;
    border: none;
    border-radius: 2px;
    cursor: pointer;
    transition: all 0.3s;
    box-sizing: border-box;
    vertical-align: middle;
}

.btn:hover {
    opacity: 0.8;
}

.btn-primary {
    background-color: #009688;
}

.btn-primary:hover {
    background-color: #33ABA0;
}

.btn-normal {
    background-color: #1E9FFF;
}

.btn-normal:hover {
    background-color: #4AB8FF;
}

.btn-warm {
    background-color: #FFB800;
}

.btn-warm:hover {
    background-color: #FFC933;
}

.btn-danger {
    background-color: #FF5722;
}

.btn-danger:hover {
    background-color: #FF7852;
}

.btn-disabled {
    background-color: #C2C2C2;
    cursor: not-allowed;
}

.btn-disabled:hover {
    opacity: 1;
}

/* Layui表格样式 */
.table-container {
    overflow-x: auto;
    margin-top: 15px;
}

table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
    border: 1px solid #e6e6e6;
}

table th,
table td {
    padding: 9px 15px;
    text-align: left;
    border: 1px solid #e6e6e6;
    font-size: 14px;
}

table th {
    background: #f8f8f8;
    font-weight: 500;
    color: #333;
}

table tr:hover {
    background: #f8f8f8;
}

table tr:nth-child(even) {
    background: #fafafa;
}

table tr:nth-child(even):hover {
    background: #f8f8f8;
}

/* 分页 - Layui风格 */
.pagination {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 15px;
    padding: 10px 0;
}

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

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

.pagination-controls button {
    height: 32px;
    line-height: 32px;
    padding: 0 12px;
    border: 1px solid #e6e6e6;
    background: #fff;
    color: #666;
    cursor: pointer;
    border-radius: 2px;
    font-size: 14px;
    transition: all 0.3s;
}

.pagination-controls button:hover:not(:disabled) {
    background: #f8f8f8;
    border-color: #009688;
    color: #009688;
}

.pagination-controls button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background: #f8f8f8;
}

.pagination-controls span {
    padding: 0 10px;
    color: #666;
    font-size: 14px;
}

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

.form-group label {
    display: block;
    margin-bottom: 5px;
    color: #333;
    font-size: 14px;
    font-weight: 500;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    height: 38px;
    line-height: 38px;
    padding: 0 15px;
    border: 1px solid #e6e6e6;
    border-radius: 2px;
    font-size: 14px;
    box-sizing: border-box;
    background: #fff;
    transition: all 0.3s;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    border-color: #009688;
    outline: none;
}

.form-group textarea {
    height: auto;
    line-height: 1.5;
    padding: 10px 15px;
    resize: vertical;
    min-height: 80px;
}

.form-row {
    display: flex;
    gap: 15px;
}

.form-row .form-group {
    flex: 1;
}

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

.modal-content {
    background: #fff;
    margin: 50px auto;
    padding: 0;
    border-radius: 2px;
    width: 90%;
    max-width: 600px;
    max-height: 80vh;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.modal-header {
    height: 42px;
    line-height: 42px;
    padding: 0 15px;
    border-bottom: 1px solid #f6f6f6;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #f8f8f8;
}

.modal-header h3 {
    margin: 0;
    font-size: 14px;
    font-weight: 500;
    color: #333;
}

.close {
    font-size: 20px;
    font-weight: normal;
    color: #999;
    cursor: pointer;
    width: 30px;
    height: 30px;
    line-height: 30px;
    text-align: center;
    border-radius: 2px;
    transition: all 0.3s;
}

.close:hover {
    background: #f0f0f0;
    color: #333;
}

.modal-body {
    padding: 15px;
    max-height: calc(80vh - 150px);
    overflow-y: auto;
}

.modal-footer {
    min-height: 50px;
    padding: 15px;
    border-top: 1px solid #f6f6f6;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
    background: #fafafa;
    flex-wrap: wrap;
}

/* 操作按钮组 */
.action-buttons {
    display: flex;
    gap: 5px;
}

.action-buttons button {
    height: 28px;
    line-height: 28px;
    padding: 0 12px;
    font-size: 12px;
}

/* 统计卡片 - Layui风格 */
.stats-grid {
    display: flex;
    flex-wrap: nowrap;
    gap: 15px;
    margin-bottom: 15px;
    overflow-x: auto;
}

.stat-card {
    background: #fff;
    padding: 20px;
    border-radius: 2px;
    box-shadow: 0 1px 2px 0 rgba(0,0,0,.05);
    border-left: 4px solid #009688;
    flex: 1;
    min-width: 0;
    white-space: nowrap;
}

.stat-card h4 {
    color: #999;
    font-size: 12px;
    margin-bottom: 10px;
    font-weight: normal;
}

.stat-card .value {
    font-size: 28px;
    font-weight: 600;
    color: #009688;
    line-height: 1;
}

/* 图表容器 */
.analysis-chart {
    margin-top: 20px;
    padding: 15px;
    background: #fafafa;
    border-radius: 4px;
}

.analysis-chart canvas {
    max-height: 300px !important;
}

#comparison-chart {
    max-height: 400px !important;
}

.analysis-chart-title {
    font-size: 13px;
    color: #666;
    margin-bottom: 8px;
}

.analysis-chart-bars {
    display: flex;
    align-items: flex-end;
    gap: 12px;
    height: 180px;
    padding: 10px 5px 0;
    border-top: 1px dashed #e6e6e6;
}

.analysis-chart-bar-wrap {
    flex: 1;
    min-width: 60px;
    text-align: center;
}

.analysis-chart-bar {
    width: 100%;
    border-radius: 3px 3px 0 0;
    background: linear-gradient(180deg, #4facfe 0%, #009688 100%);
    transition: height 0.3s ease;
}

.analysis-chart-label {
    margin-top: 6px;
    font-size: 12px;
    color: #666;
    white-space: nowrap;
}

.analysis-chart-value {
    margin-top: 2px;
    font-size: 11px;
    color: #999;
    white-space: nowrap;
}

/* 出入库表单 */
.inventory-form {
    background: #fafafa;
    padding: 15px;
    border-radius: 2px;
    border: 1px solid #e6e6e6;
}

/* 已选药品标签 */
.selected-drug-tag {
    display: inline-block;
    margin: 5px;
    padding: 5px 10px;
    background: #fff;
    border: 1px solid #e6e6e6;
    border-radius: 2px;
    font-size: 12px;
}

.selected-drug-tag .remove-btn {
    margin-left: 5px;
    color: #FF5722;
    cursor: pointer;
    font-weight: bold;
}

.selected-drug-tag .remove-btn:hover {
    color: #FF7852;
}

.inventory-form h3 {
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 15px;
    color: #333;
}

.inventory-item {
    display: flex;
    gap: 10px;
    margin-bottom: 10px;
    align-items: flex-end;
    padding: 10px;
    background: #fff;
    border: 1px solid #e6e6e6;
    border-radius: 2px;
}

.inventory-item input {
    flex: 1;
    height: 38px;
    line-height: 38px;
    padding: 0 15px;
    border: 1px solid #e6e6e6;
    border-radius: 2px;
    font-size: 14px;
    background: #fff;
}

.inventory-item input:focus {
    border-color: #009688;
    outline: none;
}

.inventory-item .btn-remove {
    height: 38px;
    line-height: 38px;
    padding: 0 15px;
    background: #FF5722;
    color: #fff;
    border: none;
    border-radius: 2px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s;
}

.inventory-item .btn-remove:hover {
    background: #FF7852;
}

/* 消息提示 - Layui风格 */
.message {
    padding: 12px 15px;
    border-radius: 2px;
    margin-bottom: 15px;
    font-size: 14px;
}

.message.success {
    background: #F0F9FF;
    color: #009688;
    border-left: 4px solid #009688;
}

.message.error {
    background: #FFF0F0;
    color: #FF5722;
    border-left: 4px solid #FF5722;
}

/* 工具条 */
.toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding: 15px;
    background: #fff;
    border-radius: 2px;
    box-shadow: 0 1px 2px 0 rgba(0,0,0,.05);
}

.toolbar-left {
    display: flex;
    gap: 10px;
    align-items: center;
    flex: 1;
}

.toolbar-right {
    display: flex;
    gap: 10px;
}

/* 空状态 */
.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: #999;
    font-size: 14px;
}

/* 响应式 */
@media (max-width: 768px) {
    .container {
        flex-direction: column;
    }
    
    .sidebar {
        width: 100%;
        height: auto;
        max-height: 200px;
    }
    
    .form-row {
        flex-direction: column;
    }
    
    .stats-grid {
        flex-wrap: wrap;
    }
    
    .stat-card {
        flex: 1 1 calc(50% - 7.5px);
        min-width: 150px;
    }
}

/* 滚动条样式 */
.sidebar::-webkit-scrollbar,
.content-area::-webkit-scrollbar,
.modal-body::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

.sidebar::-webkit-scrollbar-track,
.content-area::-webkit-scrollbar-track,
.modal-body::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.sidebar::-webkit-scrollbar-thumb,
.content-area::-webkit-scrollbar-thumb,
.modal-body::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 3px;
}

.sidebar::-webkit-scrollbar-thumb:hover,
.content-area::-webkit-scrollbar-thumb:hover,
.modal-body::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}
