/* 村级服装作坊产业展示平台 - 核心样式 */
:root {
    --primary: #2c3e50;
    --accent: #e67e22;
    --bg: #f8f9fa;
    --card-bg: #ffffff;
    --text: #333333;
    --text-light: #666666;
    --border: #e0e0e0;
    --success: #27ae60;
    --warning: #f39c12;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif; background: var(--bg); color: var(--text); line-height: 1.6; }
a { text-decoration: none; color: inherit; }
img { max-width: 100%; height: auto; display: block; }
.container { max-width: 1200px; margin: 0 auto; padding: 0 15px; }

/* 导航栏 */
.navbar { background: var(--primary); color: #fff; padding: 0; position: sticky; top: 0; z-index: 1000; box-shadow: 0 2px 8px rgba(0,0,0,0.1); }
.nav-inner { display: flex; justify-content: space-between; align-items: center; height: 60px; }
.logo { font-size: 20px; font-weight: bold; color: #fff; }
.nav-links { display: flex; gap: 20px; }
.nav-links a { color: rgba(255,255,255,0.85); padding: 8px 12px; border-radius: 4px; transition: 0.2s; }
.nav-links a:hover, .nav-links a.active { background: rgba(255,255,255,0.15); color: #fff; }
.mobile-menu-btn { display: none; background: none; border: none; color: #fff; font-size: 24px; cursor: pointer; }

/* 用户下拉菜单 */
.nav-user { position: relative; }
.nav-user-link { color: rgba(255,255,255,0.95); padding: 8px 12px; border-radius: 20px; background: rgba(255,255,255,0.1); font-weight: 500; }
.nav-user-link:hover { background: rgba(255,255,255,0.2); color: #fff; }
.nav-dropdown { position: absolute; top: 100%; right: 0; background: #fff; border-radius: 8px; box-shadow: 0 4px 16px rgba(0,0,0,0.15); min-width: 160px; padding: 6px 0; z-index: 1100; }
.nav-dropdown a { display: block; padding: 10px 16px; color: #333; font-size: 14px; }
.nav-dropdown a:hover { background: #f5f5f5; }

/* 切换控制区 */
.control-bar { background: #fff; padding: 15px 0; border-bottom: 1px solid var(--border); position: sticky; top: 60px; z-index: 900; }
.control-inner { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.toggle-btn { padding: 8px 16px; border: 2px solid var(--primary); background: #fff; color: var(--primary); border-radius: 20px; cursor: pointer; font-weight: 500; transition: 0.2s; }
.toggle-btn.active { background: var(--primary); color: #fff; }
.refresh-btn { padding: 8px 16px; border: 2px solid var(--accent); background: #fff; color: var(--accent); border-radius: 20px; cursor: pointer; font-weight: 500; transition: 0.2s; }
.refresh-btn:hover { background: var(--accent); color: #fff; }

/* 优先推荐区 */
.featured-section { margin: 20px 0; }
.section-title { font-size: 22px; margin-bottom: 15px; padding-left: 12px; border-left: 4px solid var(--accent); display: flex; align-items: center; gap: 8px; }
.badge-featured { background: var(--accent); color: #fff; font-size: 12px; padding: 2px 8px; border-radius: 10px; }
.grid-featured { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 20px; }

/* 卡片样式 */
.card { background: var(--card-bg); border-radius: 8px; overflow: hidden; box-shadow: 0 2px 8px rgba(0,0,0,0.06); transition: transform 0.2s; }
.card:hover { transform: translateY(-4px); box-shadow: 0 6px 16px rgba(0,0,0,0.1); }
.card-img { height: 180px; object-fit: cover; width: 100%; background: #eee; }
.card-body { padding: 15px; }
.card-title { font-size: 16px; font-weight: 600; margin-bottom: 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card-meta { font-size: 13px; color: var(--text-light); margin-bottom: 8px; }
.card-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.tag { background: #f0f2f5; color: var(--text-light); padding: 2px 8px; border-radius: 4px; font-size: 12px; }

/* 随机展示区 */
.random-section { margin: 30px 0; }
.grid-random { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 18px; }

/* 分页 */
.pagination { display: flex; justify-content: center; gap: 8px; margin: 30px 0; }
.pagination a, .pagination span { padding: 8px 14px; border: 1px solid var(--border); border-radius: 4px; background: #fff; }
.pagination .active { background: var(--primary); color: #fff; border-color: var(--primary); }

/* 表单 */
.form-group { margin-bottom: 16px; }
.form-label { display: block; margin-bottom: 6px; font-weight: 500; }
.form-input, .form-textarea, .form-select { width: 100%; padding: 10px 12px; border: 1px solid var(--border); border-radius: 6px; font-size: 14px; }
.form-textarea { min-height: 100px; resize: vertical; }
.btn { display: inline-block; padding: 10px 24px; border: none; border-radius: 6px; cursor: pointer; font-size: 14px; font-weight: 500; transition: 0.2s; }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: #1a252f; }
.btn-accent { background: var(--accent); color: #fff; }
.btn-accent:hover { background: #d35400; }
.btn-block { width: 100%; }

/* 详情页 */
.detail-header { background: #fff; padding: 20px; border-radius: 8px; margin-bottom: 20px; }
.detail-title { font-size: 24px; margin-bottom: 10px; }
.detail-info { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 15px; margin: 15px 0; }
.info-item { padding: 10px; background: var(--bg); border-radius: 6px; }
.info-label { font-size: 12px; color: var(--text-light); }
.info-value { font-size: 15px; font-weight: 500; }

/* 留言区 */
.message-box { background: #fff; padding: 20px; border-radius: 8px; margin-top: 20px; }
.message-item { padding: 12px; border-bottom: 1px solid var(--border); }
.message-item:last-child { border-bottom: none; }
.message-meta { font-size: 12px; color: var(--text-light); margin-bottom: 4px; }

/* 底部 */
.footer { background: var(--primary); color: rgba(255,255,255,0.8); padding: 40px 0 20px; margin-top: 40px; }
.footer-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 30px; margin-bottom: 20px; }
.footer h3 { color: #fff; margin-bottom: 15px; font-size: 16px; }
.footer a { color: rgba(255,255,255,0.7); }
.footer a:hover { color: #fff; }
.copyright { text-align: center; padding-top: 20px; border-top: 1px solid rgba(255,255,255,0.1); font-size: 13px; }

/* 响应式 */
@media (max-width: 768px) {
    .nav-links { display: none; position: absolute; top: 60px; left: 0; right: 0; background: var(--primary); flex-direction: column; padding: 10px; }
    .nav-links.show { display: flex; }
    .mobile-menu-btn { display: block; }
    .grid-featured, .grid-random { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 12px; }
    .card-img { height: 120px; }
    .control-inner { justify-content: center; }
    .detail-info { grid-template-columns: 1fr; }
}

/* 加载动画 */
.loading { text-align: center; padding: 40px; color: var(--text-light); }
.loading::after { content: ''; display: inline-block; width: 20px; height: 20px; border: 2px solid var(--primary); border-top-color: transparent; border-radius: 50%; animation: spin 0.8s linear infinite; margin-left: 10px; vertical-align: middle; }
@keyframes spin { to { transform: rotate(360deg); } }
.toast { position: fixed; top: 80px; right: 20px; background: #333; color: #fff; padding: 12px 20px; border-radius: 6px; z-index: 9999; opacity: 0; transition: 0.3s; }
.toast.show { opacity: 1; }
.toast.success { background: var(--success); }
.toast.error { background: #e74c3c; }
