/* ===== 柳州外贸平台 - 全站样式 ===== */
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: 'Segoe UI', 'Microsoft YaHei', 'PingFang SC', sans-serif;
  background: #f4f7f6; color: #2c3e50; font-size: 14px; line-height: 1.6;
  min-height: 100vh; display: flex; flex-direction: column;
}
a { color: #0a3d62; text-decoration: none; }
a:hover { opacity: .85; }
.container { max-width: 1200px; margin: 0 auto; padding: 0 20px; width: 100%; }
.main-content { flex: 1; padding: 24px 0 40px; }

/* 导航 */
.navbar { background: linear-gradient(90deg, #0a3d62, #1e3799); color: #fff; position: sticky; top: 0; z-index: 50; box-shadow: 0 2px 8px rgba(0,0,0,.15); }
.nav-inner { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; padding: 12px 20px; }
.logo { font-size: 22px; font-weight: 800; color: #fff; letter-spacing: .5px; }
.logo span { color: #f1c40f; font-size: 13px; font-weight: 500; margin-left: 4px; }
.nav-links { list-style: none; display: flex; gap: 4px; margin: 0; padding: 0; flex-wrap: wrap; }
.nav-links a { color: #eaf2f8; padding: 8px 12px; border-radius: 6px; display: inline-block; }
.nav-links a:hover { background: rgba(255,255,255,.12); color: #fff; }
.nav-links a.active { background: rgba(241,196,15,.18); color: #f1c40f; }
.nav-right { display: flex; align-items: center; gap: 10px; }
.user-area { display: flex; align-items: center; gap: 12px; }
.user-area a { color: #eaf2f8; padding: 6px 10px; border-radius: 6px; }
.user-area a:hover { background: rgba(255,255,255,.12); color: #fff; }
.whoami { color: #f1c40f; font-weight: 600; max-width: 160px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* 按钮 */
.btn { display: inline-block; border: none; border-radius: 6px; padding: 9px 18px; cursor: pointer; font-size: 14px; background: #0a3d62; color: #fff; }
.btn:hover { opacity: .9; }
.btn-yellow { background: #f1c40f; color: #333; font-weight: 700; }
.btn-gray { background: #7f8c8d; color: #fff; }
.btn-red { background: #e74c3c; color: #fff; }
.btn-green { background: #27ae60; color: #fff; }
.btn-outline { background: #fff; color: #0a3d62; border: 1px solid #0a3d62; }
.btn-sm { padding: 5px 12px; font-size: 13px; border-radius: 5px; }
.btn-block { width: 100%; }
button { font-family: inherit; }
input, select, textarea {
  width: 100%; padding: 9px 12px; border: 1px solid #d5dbdb; border-radius: 6px;
  font-size: 14px; font-family: inherit; background: #fff; color: #2c3e50;
}
textarea { resize: vertical; min-height: 90px; }
input:focus, select:focus, textarea:focus { outline: none; border-color: #0a3d62; box-shadow: 0 0 0 2px rgba(10,61,98,.12); }

/* 卡片与布局 */
.card { background: #fff; border-radius: 10px; padding: 20px; box-shadow: 0 1px 4px rgba(0,0,0,.06); }
.card + .card { margin-top: 16px; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
@media (max-width: 800px) { .grid-2, .grid-3 { grid-template-columns: 1fr; } }
h1 { font-size: 24px; margin: 0 0 16px; }
h2 { font-size: 19px; margin: 0 0 12px; }
h3 { font-size: 16px; margin: 0 0 8px; }
.muted { color: #95a5a6; font-size: 13px; }
.empty-hint { text-align: center; color: #aab7b8; padding: 28px 10px; }
.page-head { display: flex; justify-content: space-between; align-items: flex-end; flex-wrap: wrap; gap: 10px; margin-bottom: 16px; }
.page-head p { margin: 4px 0 0; color: #7f8c8d; }

/* Hero */
.hero { background: linear-gradient(120deg, #0a3d62 0%, #1e3799 55%, #2f54eb 100%); color: #fff; border-radius: 12px; padding: 46px 40px; position: relative; overflow: hidden; margin-bottom: 20px; }
.hero::after { content: ''; position: absolute; right: -80px; top: -80px; width: 260px; height: 260px; border-radius: 50%; background: rgba(241,196,15,.18); }
.hero::before { content: ''; position: absolute; right: 60px; bottom: -120px; width: 200px; height: 200px; border-radius: 50%; background: rgba(255,255,255,.08); }
.hero h1 { font-size: 32px; margin: 0 0 10px; }
.hero p { margin: 0; opacity: .92; font-size: 15px; max-width: 560px; }
.hero .btn-yellow { margin-top: 18px; font-size: 15px; padding: 11px 22px; }

/* 统计条 */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 14px; margin-bottom: 20px; }
.stat-card { background: #fff; border-radius: 10px; padding: 18px 16px; text-align: center; box-shadow: 0 1px 4px rgba(0,0,0,.05); border-top: 3px solid #0a3d62; }
.stat-card .num { font-size: 28px; font-weight: 800; color: #0a3d62; }
.stat-card .lab { color: #7f8c8d; font-size: 13px; }
.stat-card.alt1 { border-top-color: #f1c40f; } .stat-card.alt1 .num { color: #b7950b; }
.stat-card.alt2 { border-top-color: #27ae60; } .stat-card.alt2 .num { color: #1e8449; }
.stat-card.alt3 { border-top-color: #e67e22; } .stat-card.alt3 .num { color: #ca6f1e; }

/* 徽标 */
.badge { display: inline-block; padding: 3px 9px; border-radius: 20px; font-size: 12px; line-height: 1.5; }
.badge-success { background: #d4efdf; color: #1e8449; }
.badge-warning { background: #fef9e7; color: #b7950b; }
.badge-info { background: #d6eaf8; color: #1f618d; }
.badge-red { background: #fadbd8; color: #c0392b; }
.badge-gray { background: #eaecee; color: #7f8c8d; }

/* 企业/产品卡片 */
.thumb { width: 100%; aspect-ratio: 4/3; border-radius: 8px; display: flex; align-items: center; justify-content: center; color: rgba(255,255,255,.92); font-size: 30px; font-weight: 800; letter-spacing: 2px; margin-bottom: 10px; user-select: none; }
.ent-card h3, .prod-card h3 { margin-bottom: 6px; }
.ent-card p, .prod-card p { margin: 4px 0; color: #5d6d7e; }
.ent-card .tags, .prod-card .tags { margin-top: 8px; }
.tag { display: inline-block; background: #eaf2f8; color: #1f618d; font-size: 12px; padding: 2px 8px; border-radius: 4px; margin: 2px 4px 2px 0; }
.link-more { text-align: right; }
.intro-line { color: #5d6d7e; font-size: 13px; min-height: 42px; }

/* 筛选条 */
.filter-bar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.chip { display: inline-block; padding: 6px 14px; border-radius: 20px; background: #fff; border: 1px solid #d5dbdb; cursor: pointer; font-size: 13px; color: #34495e; }
.chip.active { background: #0a3d62; color: #fff; border-color: #0a3d62; }
.search-row { display: flex; gap: 8px; margin-top: 10px; }
.search-row input { flex: 1; }

/* 表格 */
.table-wrap { overflow-x: auto; }
table.table { width: 100%; border-collapse: collapse; }
.table th, .table td { padding: 10px 12px; border-bottom: 1px solid #ecf0f1; text-align: left; vertical-align: top; }
.table th { background: #f8f9fa; color: #34495e; white-space: nowrap; }
.table tr:hover td { background: #fbfdff; }
.table .ops { display: flex; gap: 6px; flex-wrap: wrap; }

/* 后台布局 */
.admin-layout { display: flex; gap: 18px; align-items: flex-start; }
.admin-side { width: 190px; flex-shrink: 0; background: #fff; border-radius: 10px; padding: 10px; box-shadow: 0 1px 4px rgba(0,0,0,.06); }
.side-item { display: block; padding: 10px 14px; border-radius: 6px; color: #34495e; cursor: pointer; }
.side-item:hover { background: #f2f6f9; }
.side-item.active { background: #0a3d62; color: #fff; font-weight: 600; }
.admin-main { flex: 1; min-width: 0; }
@media (max-width: 900px) { .admin-layout { flex-direction: column; } .admin-side { width: 100%; display: flex; flex-wrap: wrap; gap: 4px; } }

/* 表单 */
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
@media (max-width: 760px) { .form-grid { grid-template-columns: 1fr; } }
.form-row { margin: 10px 0; }
.form-row label { display: block; font-weight: 600; margin-bottom: 4px; font-size: 13px; }
.form-row label .req { color: #e74c3c; }
.hint { color: #95a5a6; font-size: 12px; margin-top: 4px; }
.msg-error { color: #e74c3c; margin: 8px 0 0; font-size: 13px; }
.msg-ok { color: #27ae60; margin: 8px 0 0; font-size: 13px; }

/* 详情页 */
.detail-head { display: flex; gap: 18px; align-items: flex-start; flex-wrap: wrap; }
.detail-head .thumb { width: 180px; aspect-ratio: 4/3; margin: 0; }
.detail-info { flex: 1; min-width: 260px; }
.detail-info h1 { margin: 0 0 8px; }
.meta-line { color: #7f8c8d; font-size: 13px; margin: 3px 0; }
.divider { border: none; border-top: 1px solid #ecf0f1; margin: 16px 0; }
.kv { display: grid; grid-template-columns: 90px 1fr; row-gap: 8px; }
.kv .k { color: #7f8c8d; }

/* 询盘/回复样式 */
.inq-item { border: 1px solid #ecf0f1; border-radius: 8px; padding: 14px; margin-bottom: 12px; }
.inq-head { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.inq-reply { background: #f4fbf7; border-left: 3px solid #27ae60; padding: 10px 12px; border-radius: 4px; margin-top: 10px; }

/* 页脚/Toast */
.footer { background: #0a3d62; color: #d5e8f0; text-align: center; padding: 20px 0; margin-top: 20px; }
.footer p { margin: 4px 0; }
.footer .muted { color: #9bb8cc; }
.toast { position: fixed; top: 18px; left: 50%; transform: translateX(-50%) translateY(-80px); background: #2c3e50; color: #fff; padding: 11px 22px; border-radius: 8px; z-index: 99; transition: transform .25s; font-size: 14px; box-shadow: 0 4px 14px rgba(0,0,0,.25); max-width: 90vw; }
.toast.show { transform: translateX(-50%) translateY(0); }
.toast.ok { background: #1e8449; }
.toast.err { background: #c0392b; }
.mt8 { margin-top: 8px; } .mt16 { margin-top: 16px; }
.req-meta { color: #95a5a6; font-size: 13px; }
.empty-inline { color: #aab7b8; padding: 12px 0; }

/* 评价框 */
.review-box { background: #fef9e7; border: 1px solid #f9e79f; border-radius: 6px; padding: 10px 12px; margin-top: 10px; }

/* 在线客服浮窗 */
.chat-fab { position: fixed; right: 22px; bottom: 26px; z-index: 88; background: linear-gradient(135deg, #f1c40f, #e67e22); color: #fff; border: none; border-radius: 50px; padding: 13px 20px; font-size: 15px; font-weight: 700; cursor: pointer; box-shadow: 0 6px 18px rgba(0,0,0,.25); }
.chat-fab:hover { transform: translateY(-2px); }
/* AI 智能助手悬浮球（首页/全局直达，参考百雀客服入口设计） */
.aihub-fab { position: fixed; right: 186px; bottom: 26px; z-index: 88; display: inline-block; background: linear-gradient(135deg, #0a3d62, #2e86c1); color: #fff; border-radius: 50px; padding: 13px 20px; font-size: 15px; font-weight: 700; text-decoration: none; box-shadow: 0 6px 18px rgba(0,0,0,.25); animation: aihubPulse 2.4s ease-in-out infinite; }
.aihub-fab:hover { transform: translateY(-2px); color: #fff; }
@keyframes aihubPulse { 0%,100% { box-shadow: 0 6px 18px rgba(46,134,193,.35); } 50% { box-shadow: 0 6px 26px rgba(46,134,193,.75); } }
@media (max-width: 640px) { .aihub-fab { right: 22px; bottom: 84px; } }
.chat-panel { position: fixed; right: 22px; bottom: 84px; z-index: 89; width: 330px; max-width: calc(100vw - 44px); background: #fff; border-radius: 12px; box-shadow: 0 10px 34px rgba(0,0,0,.28); overflow: hidden; display: none; flex-direction: column; }
.chat-panel.open { display: flex; }
.chat-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; background: #0a3d62; color: #fff; padding: 12px 14px; }
.chat-head .muted { color: #bcd9ee; }
.chat-close { background: none; border: none; color: #fff; font-size: 16px; cursor: pointer; padding: 0 4px; }
.chat-body { max-height: 60vh; overflow-y: auto; padding: 12px 14px; font-size: 13px; }
.chat-sec-title { font-weight: 700; margin: 4px 0 8px; color: #34495e; }
.chat-faq details { border-bottom: 1px dashed #ecf0f1; padding: 6px 0; }
.chat-faq summary { cursor: pointer; color: #0a3d62; font-weight: 600; }
.chat-a { color: #5d6d7e; background: #f4fbf7; border-left: 3px solid #27ae60; padding: 8px 10px; border-radius: 4px; margin-top: 6px; white-space: pre-line; }
.chat-tickets textarea { margin-top: 8px; min-height: 60px; }
.chat-ticket { border: 1px solid #ecf0f1; border-radius: 6px; padding: 8px 10px; margin: 8px 0; }
.chat-ticket .chat-q { color: #2c3e50; }
.chat-q { font-weight: 500; }

/* AI 智能助手补充样式 */
.tag-ai { background: #f4ecf7; color: #6c3483; border: 1px solid #d7bde2; }
.tag-hs { background: #fef9e7; color: #7d6608; border: 1px solid #f7dc6f; }
.report-box { background: #f4f9f9; border-left: 4px solid #2e86c1; border-radius: 6px; padding: 12px; margin-top: 10px; }
