/* 教学商城 - 公共样式（极简风格） */
* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: "Microsoft YaHei", Arial, sans-serif; background: #f5f6f8; color: #333; font-size: 14px; }
a { text-decoration: none; color: inherit; }

/* ---------- 顶部导航栏 ---------- */
#navbar { background: #2c3e50; color: #fff; }
.nav-inner { max-width: 1100px; margin: 0 auto; padding: 0 15px; height: 56px; display: flex; align-items: center; }
.logo { font-size: 18px; font-weight: bold; margin-right: 30px; color: #fff; }
.nav-links { display: flex; gap: 5px; flex: 1; }
.nav-links a { padding: 8px 14px; border-radius: 4px; color: #cfd8e3; }
.nav-links a:hover { background: #3d5166; color: #fff; }
.nav-links a.active { background: #3498db; color: #fff; }
.nav-right { display: flex; align-items: center; gap: 12px; }
.nav-right a { color: #ffd166; }
.nav-user { color: #cfd8e3; }

/* ---------- 通用容器 ---------- */
.container { max-width: 1100px; margin: 20px auto; padding: 0 15px; }
.panel { background: #fff; border-radius: 8px; padding: 20px; margin-bottom: 20px; box-shadow: 0 1px 3px rgba(0,0,0,.06); }
.panel h2 { font-size: 18px; margin-bottom: 16px; padding-bottom: 10px; border-bottom: 1px solid #eee; }

/* ---------- 表单 ---------- */
.form-item { margin-bottom: 14px; }
.form-item label { display: block; margin-bottom: 6px; color: #555; }
.input, input[type="text"], input[type="password"], input[type="number"], select, textarea {
    width: 100%; height: 38px; padding: 0 10px; border: 1px solid #dcdfe6;
    border-radius: 4px; font-size: 14px; outline: none; background: #fff;
}
textarea { height: auto; padding: 8px 10px; }
.input:focus, input:focus, select:focus, textarea:focus { border-color: #3498db; }
.form-inline { display: flex; gap: 10px; align-items: center; }
.form-inline .input, .form-inline input, .form-inline select { width: auto; }

/* ---------- 按钮 ---------- */
.btn { display: inline-block; height: 38px; padding: 0 18px; border: 1px solid #dcdfe6;
    border-radius: 4px; background: #fff; color: #333; font-size: 14px; cursor: pointer; }
.btn:hover { border-color: #3498db; color: #3498db; }
.btn-primary { background: #3498db; border-color: #3498db; color: #fff; }
.btn-primary:hover { background: #2e86c1; color: #fff; }
.btn-danger { color: #e74c3c; border-color: #f0b7ae; }
.btn-danger:hover { background: #e74c3c; border-color: #e74c3c; color: #fff; }
.btn-success { background: #27ae60; border-color: #27ae60; color: #fff; }
.btn-success:hover { background: #219a52; color: #fff; }
.btn-sm { height: 30px; padding: 0 12px; font-size: 13px; }
.btn-block { width: 100%; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

/* ---------- 工具栏 ---------- */
.toolbar { display: flex; gap: 10px; margin-bottom: 18px; flex-wrap: wrap; align-items: center; }
.toolbar select { width: 160px; }
.search-input { flex: 1; min-width: 200px; }

/* ---------- 商品卡片 ---------- */
.product-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
@media (max-width: 900px) { .product-grid { grid-template-columns: repeat(2, 1fr); } }
.card { background: #fff; border-radius: 8px; overflow: hidden; cursor: pointer;
    box-shadow: 0 1px 3px rgba(0,0,0,.06); transition: box-shadow .2s; position: relative; }
.card:hover { box-shadow: 0 4px 12px rgba(0,0,0,.12); }
.card img { width: 100%; height: 180px; object-fit: cover; display: block; background: #e9ecef; }
.card-body { padding: 12px; }
.card-name { font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin-bottom: 8px; }
.card-info { display: flex; justify-content: space-between; align-items: center; }
.price { color: #e74c3c; font-size: 16px; font-weight: bold; }
.stock { color: #999; font-size: 12px; }
.tag-off { position: absolute; top: 8px; right: 8px; background: rgba(0,0,0,.55); color: #fff;
    padding: 2px 8px; border-radius: 3px; font-size: 12px; }

/* ---------- 详情页 ---------- */
.detail-wrap { display: flex; gap: 24px; flex-wrap: wrap; }
.detail-img { width: 380px; max-width: 100%; border-radius: 8px; background: #e9ecef; }
.detail-info { flex: 1; min-width: 280px; }
.detail-name { font-size: 22px; margin-bottom: 12px; }
.detail-price { color: #e74c3c; font-size: 26px; font-weight: bold; margin-bottom: 12px; }
.detail-meta { color: #888; margin-bottom: 8px; }
.detail-desc { margin: 16px 0; line-height: 1.8; color: #555; }
.qty-box { display: flex; align-items: center; gap: 8px; margin: 16px 0; }
.qty-box input { width: 70px; text-align: center; }

/* ---------- 表格 ---------- */
.table { width: 100%; border-collapse: collapse; background: #fff; }
.table th, .table td { padding: 12px 10px; border-bottom: 1px solid #f0f0f0; text-align: left; }
.table th { background: #fafafa; color: #666; font-weight: normal; font-size: 13px; }
.status-0 { color: #e67e22; }
.status-1 { color: #27ae60; }
.status-2 { color: #999; }
.status-3 { color: #3498db; }

/* ---------- 分页 ---------- */
.pagination { display: flex; justify-content: center; gap: 6px; margin: 24px 0; flex-wrap: wrap; }
.page-btn { min-width: 36px; height: 32px; padding: 0 8px; border: 1px solid #dcdfe6;
    background: #fff; border-radius: 4px; cursor: pointer; font-size: 14px; }
.page-btn:hover:not(:disabled) { border-color: #3498db; color: #3498db; }
.page-btn.active { background: #3498db; border-color: #3498db; color: #fff; }
.page-btn:disabled { cursor: not-allowed; opacity: .5; }
.page-ellipsis { line-height: 32px; padding: 0 4px; color: #999; }

/* ---------- 登录页 ---------- */
.login-box { max-width: 380px; margin: 60px auto; background: #fff; border-radius: 8px;
    padding: 30px; box-shadow: 0 1px 4px rgba(0,0,0,.08); }
.login-box h2 { text-align: center; margin-bottom: 24px; font-size: 20px; }
.tips { margin-top: 14px; color: #999; font-size: 12px; text-align: center; }

/* ---------- 个人中心 ---------- */
.user-head { display: flex; align-items: center; gap: 18px; margin-bottom: 20px; }
.avatar { width: 72px; height: 72px; border-radius: 50%; object-fit: cover; background: #e9ecef; }
.user-head .name { font-size: 18px; font-weight: bold; }
.user-head .sub { color: #999; margin-top: 4px; }

/* ---------- 空状态 ---------- */
.empty { text-align: center; color: #999; padding: 60px 0; grid-column: 1 / -1; }
