<template>
  <div class="content-area">
    <!-- 页面标题 -->
    <div class="page-header">
      <h1 class="page-title">{{ title }}</h1>
      <div class="page-actions">
        <slot name="actions" />
      </div>
    </div>

    <!-- 内容区域 -->
    <div class="content-container">
      <div class="content-card">
        <div class="card-header">
          <h3 class="card-title">{{ cardTitle }}</h3>
          <div class="card-tools">
            <slot name="card-tools" />
          </div>
        </div>
        
        <div class="card-body">
          <slot name="content">
            <!-- 默认内容占位 -->
            <div class="empty-state">
              <i class="fas fa-cube"></i>
              <h3>功能开发中</h3>
              <p>该功能正在开发中，敬请期待</p>
            </div>
          </slot>
        </div>
        
        <div class="card-footer" v-if="$slots.footer">
          <slot name="footer" />
        </div>
      </div>
    </div>
  </div>
</template>

<script setup>
import { defineProps } from 'vue'

defineProps({
  title: {
    type: String,
    default: 'CAD 管理'
  },
  cardTitle: {
    type: String,
    default: '操作区域'
  }
})
</script>

<style scoped>
.content-area {
  height: 100%;
  display: flex;
  flex-direction: column;
  background: transparent;
}

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

.page-title {
  font-size: 24px;
  font-weight: 600;
  color: var(--color-text-primary);
  margin: 0;
}

.page-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.content-container {
  flex: 1;
  overflow: hidden;
}

.content-card {
  background: var(--color-bg-dark-8);
  border: 1px solid var(--color-white-rgb-1);
  border-radius: 12px;
  height: 100%;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid var(--color-white-rgb-1);
  background: var(--color-white-rgb-05);
  flex-shrink: 0;
}

.card-title {
  font-size: 18px;
  font-weight: 600;
  color: var(--color-text-primary);
  margin: 0;
}

.card-tools {
  display: flex;
  align-items: center;
  gap: 8px;
}

.card-body {
  flex: 1;
  padding: 24px;
  overflow-y: auto;
  background: transparent;
}

.card-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--color-white-rgb-1);
  background: var(--color-white-rgb-05);
  flex-shrink: 0;
}

.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 400px;
  color: var(--color-text-tertiary);
  text-align: center;
}

.empty-state i {
  font-size: 64px;
  margin-bottom: 16px;
  opacity: 0.5;
}

.empty-state h3 {
  font-size: 18px;
  font-weight: 500;
  margin: 0 0 8px 0;
  color: var(--color-text-secondary);
}

.empty-state p {
  font-size: 14px;
  margin: 0;
  color: var(--color-text-tertiary);
}

/* 滚动条样式 */
.card-body::-webkit-scrollbar {
  width: 6px;
}

.card-body::-webkit-scrollbar-track {
  background: transparent;
}

.card-body::-webkit-scrollbar-thumb {
  background: var(--color-white-rgb-2);
  border-radius: 3px;
}

.card-body::-webkit-scrollbar-thumb:hover {
  background: var(--color-white-rgb-3);
}

/* 按钮基础样式 */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  border: 1px solid var(--color-white-rgb-2);
  border-radius: 6px;
  background: var(--color-white-rgb-05);
  color: var(--color-text-primary);
  font-size: 14px;
  cursor: pointer;
  transition: all 0.3s ease;
  text-decoration: none;
}

.btn:hover {
  background: var(--color-white-rgb-1);
  border-color: var(--color-white-rgb-3);
}

.btn-primary {
  background: var(--color-primary-gradient);
  border-color: transparent;
  color: var(--color-text-primary);
}

.btn-primary:hover {
  background: var(--color-primary-gradient-hover);
  box-shadow: 0 4px 15px var(--color-primary-rgb-3);
}

.btn-secondary {
  background: var(--color-white-rgb-1);
  border-color: var(--color-white-rgb-2);
  color: var(--color-text-secondary);
}

.btn-secondary:hover {
  background: var(--color-white-rgb-15);
  color: var(--color-text-primary);
}
</style>