/* 「商贸拾光」Web端样式 —— 青春简约校园风：活力橙+纯净白+浅灰 */
* { margin: 0; padding: 0; box-sizing: border-box; }
:root {
  --primary: #FF7A1A;
  --primary-light: #FFF3E8;
  --bg: #F7F8FA;
  --text: #333;
  --text2: #888;
  --line: #EEE;
}
body { background: var(--bg); color: var(--text); font-size: 14px; font-family: "PingFang SC", "Microsoft YaHei", sans-serif; }
a { text-decoration: none; color: inherit; cursor: pointer; }
img { max-width: 100%; }
.wrap { max-width: 1100px; margin: 0 auto; padding: 0 16px; }

/* 顶栏 */
.topbar { background: #fff; border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 100; }
.topbar .wrap { display: flex; align-items: center; height: 56px; gap: 18px; }
.logo { font-size: 20px; font-weight: bold; color: var(--primary); white-space: nowrap; }
.nav { display: flex; gap: 4px; flex: 1; }
.nav a { padding: 6px 12px; border-radius: 18px; color: #555; white-space: nowrap; }
.nav a.active, .nav a:hover { color: var(--primary); background: var(--primary-light); font-weight: bold; }
.searchbox { display: flex; align-items: center; border: 1px solid var(--line); border-radius: 18px; overflow: hidden; }
.searchbox input { border: none; outline: none; padding: 6px 12px; width: 160px; font-size: 13px; }
.searchbox button { border: none; background: var(--primary); color: #fff; padding: 7px 14px; cursor: pointer; }
.userbox { display: flex; align-items: center; gap: 10px; }
.userbox .avatar { width: 34px; height: 34px; border-radius: 50%; object-fit: cover; cursor: pointer; border: 2px solid var(--primary-light); }
.userbox .btn-mini { padding: 6px 14px; }

/* 公告条 */
.announce { background: var(--primary-light); color: #B4560A; }
.announce .wrap { display: flex; align-items: center; gap: 8px; height: 36px; overflow: hidden; font-size: 13px; }
.announce .tag { background: var(--primary); color: #fff; border-radius: 4px; padding: 1px 6px; font-size: 12px; flex-shrink: 0; }

/* 主布局 */
.main-grid { display: grid; grid-template-columns: 1fr 300px; gap: 16px; padding: 16px; }
.side-col { display: flex; flex-direction: column; gap: 12px; }
@media (max-width: 860px) { .main-grid { grid-template-columns: 1fr; } }

/* 手机端适配：顶栏三行布局——logo+头像 / 搜索框独占一行 / 导航横滑 */
@media (max-width: 860px) {
  .topbar .wrap { flex-wrap: wrap; height: auto; padding-top: 10px; padding-bottom: 10px; row-gap: 10px; }
  .logo { font-size: 18px; }
  .userbox { margin-left: auto; }
  .searchbox { order: 4; width: 100%; margin-left: 0; }
  .searchbox input { flex: 1; width: auto; min-width: 0; }
  .nav { order: 5; width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; flex-wrap: nowrap; scrollbar-width: none; }
  .nav::-webkit-scrollbar { display: none; }
  .nav a { flex-shrink: 0; padding: 5px 11px; font-size: 13px; }
  .main-grid { padding: 10px; gap: 10px; }
  .banner-box img { height: 160px; }
}
@media (max-width: 480px) {
  .nav a { padding: 5px 9px; font-size: 12px; }
}

.card { background: #fff; border-radius: 12px; padding: 16px; box-shadow: 0 1px 4px rgba(0,0,0,.04); }
.side-card h3 { font-size: 15px; margin-bottom: 10px; padding-left: 8px; border-left: 3px solid var(--primary); }

.btn { display: inline-block; background: var(--primary); color: #fff; border: none; border-radius: 8px; padding: 9px 20px; font-size: 14px; cursor: pointer; text-align: center; }
.btn:hover { opacity: .9; }
.btn-plain { background: #fff; color: var(--primary); border: 1px solid var(--primary); }
.btn-mini { font-size: 12px; padding: 4px 12px; border-radius: 6px; background: var(--primary); color: #fff; border: none; cursor: pointer; }
.btn-gray { background: #F0F0F0; color: #666; }
.btn-red { background: #F5484D; }

/* 公告列表 */
.ann-item { padding: 10px 0; border-bottom: 1px dashed var(--line); }
.ann-item h4 { font-size: 14px; margin-bottom: 4px; }
.ann-item p { color: var(--text2); font-size: 13px; }
.ann-item .time { color: #bbb; font-size: 12px; }

/* 轮播 */
.banner-box { border-radius: 12px; overflow: hidden; position: relative; margin-bottom: 16px; background: #fff; }
.banner-box img { width: 100%; height: 220px; object-fit: cover; display: block; }

/* 宫格 */
.grid8 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 16px; }
.grid8 .g-item { background: #fff; border-radius: 12px; padding: 18px 0; text-align: center; cursor: pointer; transition: .2s; box-shadow: 0 1px 4px rgba(0,0,0,.04); }
.grid8 .g-item:hover { transform: translateY(-2px); box-shadow: 0 4px 12px rgba(255,122,26,.15); }
.g-item .ico { width: 44px; height: 44px; line-height: 44px; margin: 0 auto 8px; border-radius: 12px; background: var(--primary-light); font-size: 22px; }
.g-item span { font-size: 13px; color: #555; }

/* 帖子卡片 */
.post-item { display: flex; gap: 12px; background: #fff; border-radius: 12px; padding: 14px; margin-bottom: 10px; box-shadow: 0 1px 4px rgba(0,0,0,.04); cursor: pointer; }
.post-item .avatar { width: 42px; height: 42px; border-radius: 50%; object-fit: cover; background: var(--primary-light); flex-shrink: 0; }
.post-item .p-body { flex: 1; min-width: 0; }
.p-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.p-name { font-weight: bold; }
.p-tag { font-size: 11px; color: var(--primary); background: var(--primary-light); border-radius: 4px; padding: 1px 6px; }
.p-tag.gray { color: #999; background: #F2F2F2; }
.p-cat { font-size: 11px; color: #4A90D9; background: #EAF3FC; border-radius: 4px; padding: 1px 6px; }
.p-cat.red { color: #F5484D; background: #FDECEC; }
.p-cat.green { color: #2BA471; background: #E8F7F0; }
.p-time { color: #bbb; font-size: 12px; margin-left: auto; }
.p-content { margin: 8px 0; line-height: 1.6; word-break: break-word; }
.p-content .title { font-weight: bold; font-size: 15px; margin-bottom: 4px; }
.p-imgs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin-bottom: 8px; }
.p-imgs img { width: 100%; height: 110px; object-fit: cover; border-radius: 8px; cursor: zoom-in; }
.p-imgs.one img { width: 60%; height: auto; max-height: 260px; }
.p-video video { width: 100%; max-height: 320px; border-radius: 8px; background: #000; }
.p-foot { display: flex; gap: 18px; color: var(--text2); font-size: 13px; }
.p-foot span { cursor: pointer; display: inline-flex; align-items: center; gap: 4px; }
.p-foot span.on { color: var(--primary); }
.p-badges { display: flex; gap: 6px; margin: 4px 0; flex-wrap: wrap; }
.badge { font-size: 11px; border-radius: 4px; padding: 1px 6px; background: #F2F2F2; color: #999; }
.badge.top { color: var(--primary); background: var(--primary-light); }
.badge.done { color: #2BA471; background: #E8F7F0; }
.badge.warn { color: #E6A23C; background: #FDF6EC; }
.badge.reject { color: #F5484D; background: #FDECEC; }

/* 表白墙 */
.confession-item { background: linear-gradient(180deg, #FFF6EF, #fff); border: 1px solid #FFE3C8; }
.lost-card .info { background: #F8F9FB; border-radius: 8px; padding: 8px 10px; margin: 8px 0; font-size: 13px; color: #555; line-height: 1.8; }
.lost-card .info b { color: var(--primary); }

/* 筛选条 */
.filter-bar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.chip { padding: 5px 14px; border-radius: 16px; background: #fff; border: 1px solid var(--line); font-size: 13px; cursor: pointer; color: #666; }
.chip.on { background: var(--primary); border-color: var(--primary); color: #fff; }
.filter-bar input, .filter-bar select { padding: 6px 10px; border: 1px solid var(--line); border-radius: 8px; outline: none; font-size: 13px; }

/* 用户卡片(扩列) */
.user-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
@media (max-width: 640px) { .user-grid { grid-template-columns: 1fr; } }
.user-card { background: #fff; border-radius: 12px; padding: 16px; box-shadow: 0 1px 4px rgba(0,0,0,.04); }
.user-card .u-top { display: flex; align-items: center; gap: 10px; }
.user-card .u-top img { width: 48px; height: 48px; border-radius: 50%; object-fit: cover; background: var(--primary-light); }
.user-card .u-info h4 { font-size: 15px; }
.user-card .u-info p { color: var(--text2); font-size: 12px; margin-top: 2px; }
.u-tags { margin: 10px 0; display: flex; flex-wrap: wrap; gap: 6px; }
.u-tags span { font-size: 11px; background: var(--primary-light); color: var(--primary); border-radius: 4px; padding: 2px 8px; }
.u-foot { display: flex; align-items: center; gap: 8px; }
.match-bar { flex: 1; height: 6px; border-radius: 3px; background: #F0F0F0; overflow: hidden; }
.match-bar i { display: block; height: 100%; background: linear-gradient(90deg, #FFB37A, var(--primary)); }
.match-num { font-size: 12px; color: var(--primary); font-weight: bold; }
.verified { font-size: 11px; color: #2BA471; background: #E8F7F0; border-radius: 4px; padding: 1px 6px; }

/* 话题 */
.topic-item { display: flex; justify-content: space-between; align-items: center; padding: 10px 0; border-bottom: 1px dashed var(--line); cursor: pointer; }
.topic-item:last-child { border: none; }
.topic-item h4 { font-size: 14px; }
.topic-item small { color: var(--text2); }
.topic-item .cnt { color: var(--text2); font-size: 12px; }

/* 用户主页 */
.profile-head { display: flex; gap: 16px; align-items: center; }
.profile-head img { width: 72px; height: 72px; border-radius: 50%; object-fit: cover; background: var(--primary-light); }
.profile-head h2 { font-size: 18px; display: flex; align-items: center; gap: 8px; }
.profile-head .meta { color: var(--text2); font-size: 13px; margin-top: 6px; line-height: 1.8; }
.stat-row { display: flex; gap: 24px; margin-left: auto; text-align: center; }
.stat-row b { font-size: 18px; display: block; }
.stat-row span { font-size: 12px; color: var(--text2); }

/* 消息 */
.msg-layout { display: grid; grid-template-columns: 300px 1fr; gap: 12px; min-height: 480px; }
@media (max-width: 720px) { .msg-layout { grid-template-columns: 1fr; } }
.msg-list { background: #fff; border-radius: 12px; overflow-y: auto; max-height: 560px; }
.msg-item { display: flex; gap: 10px; padding: 12px; border-bottom: 1px solid var(--line); cursor: pointer; align-items: center; }
.msg-item:hover, .msg-item.on { background: var(--primary-light); }
.msg-item img { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; }
.msg-item .m-info { flex: 1; min-width: 0; }
.msg-item .m-info h5 { font-size: 14px; }
.msg-item .m-info p { color: var(--text2); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.msg-item .unread { background: #F5484D; color: #fff; font-size: 11px; border-radius: 9px; min-width: 18px; height: 18px; line-height: 18px; text-align: center; padding: 0 4px; }
.chat-box { background: #fff; border-radius: 12px; display: flex; flex-direction: column; }
.chat-msgs { flex: 1; overflow-y: auto; padding: 14px; max-height: 460px; }
.chat-line { display: flex; margin-bottom: 12px; gap: 8px; }
.chat-line img { width: 34px; height: 34px; border-radius: 50%; object-fit: cover; }
.chat-line .bubble { background: #F2F3F5; padding: 8px 12px; border-radius: 4px 12px 12px 12px; max-width: 70%; line-height: 1.5; }
.chat-line.me { flex-direction: row-reverse; }
.chat-line.me .bubble { background: var(--primary); color: #fff; border-radius: 12px 4px 12px 12px; }
.chat-input { display: flex; gap: 8px; padding: 10px; border-top: 1px solid var(--line); }
.chat-input input { flex: 1; padding: 9px 12px; border: 1px solid var(--line); border-radius: 8px; outline: none; }
.noti-item { display: flex; gap: 10px; padding: 12px; border-bottom: 1px solid var(--line); align-items: center; }
.noti-item img { width: 36px; height: 36px; border-radius: 50%; }

/* 弹窗 */
.mask { position: fixed; left: 0; top: 0; right: 0; bottom: 0; background: rgba(0,0,0,.45); z-index: 200; display: none; }
.mask.show { display: block; }
.modal { position: fixed; z-index: 201; left: 50%; top: 50%; transform: translate(-50%,-50%); background: #fff; border-radius: 14px; width: 92%; max-width: 560px; max-height: 86vh; overflow-y: auto; padding: 22px; display: none; }
.modal.show { display: block; }
.modal h3 { margin-bottom: 14px; font-size: 17px; }
.modal .close { position: absolute; right: 16px; top: 14px; font-size: 20px; color: #999; cursor: pointer; }

/* 表单 */
.form-item { margin-bottom: 14px; }
.form-item label { display: block; font-size: 13px; color: #666; margin-bottom: 6px; }
.form-item input[type=text], .form-item input[type=password], .form-item textarea, .form-item select { width: 100%; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; outline: none; font-size: 14px; font-family: inherit; }
.form-item textarea { min-height: 90px; resize: vertical; }
.form-item input:focus, .form-item textarea:focus { border-color: var(--primary); }
.form-row { display: flex; gap: 10px; }
.form-row .form-item { flex: 1; }
.switch-label { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: #666; cursor: pointer; }
.switch-label input { accent-color: var(--primary); }
.upload-grid { display: flex; flex-wrap: wrap; gap: 8px; }
.upload-grid .up-item { width: 88px; height: 88px; border-radius: 8px; object-fit: cover; position: relative; }
.upload-grid .up-del { position: absolute; right: -6px; top: -6px; width: 20px; height: 20px; border-radius: 50%; background: #F5484D; color: #fff; border: none; cursor: pointer; font-size: 12px; line-height: 1; }
.upload-grid .up-add { width: 88px; height: 88px; border-radius: 8px; border: 1px dashed #ccc; background: #FAFAFA; color: #999; font-size: 26px; cursor: pointer; }

/* 发帖 @好友 / #话题 */
.pub-tools { display: flex; gap: 10px; margin-top: 8px; }
.pub-tool { padding: 5px 14px; background: #FFF3E8; color: #FF7A1A; border-radius: 16px; font-size: 13px; cursor: pointer; user-select: none; }
.pub-panel { margin-top: 8px; max-height: 200px; overflow-y: auto; background: #FAFAFA; border-radius: 8px; padding: 8px; }
.at-list { display: flex; flex-wrap: wrap; gap: 8px; }
.at-chip { padding: 6px 14px; background: #fff; border: 1px solid var(--line); border-radius: 16px; font-size: 13px; color: #333; cursor: pointer; }
.at-chip:hover { background: #FFF3E8; color: #FF7A1A; border-color: #FF7A1A; }

/* 评论 */
.comment-box { margin-top: 14px; border-top: 1px solid var(--line); padding-top: 12px; }
.c-item { display: flex; gap: 10px; margin-bottom: 14px; }
.c-item img { width: 34px; height: 34px; border-radius: 50%; object-fit: cover; flex-shrink: 0; }
.c-body { flex: 1; min-width: 0; }
.c-head { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.c-head .name { font-weight: bold; }
.c-head .time { color: #bbb; font-size: 12px; }
.c-content { margin: 4px 0; line-height: 1.5; }
.c-actions { color: var(--text2); font-size: 12px; display: flex; gap: 14px; }
.c-actions span { cursor: pointer; }
.c-actions .on { color: var(--primary); }
.c-children { margin-top: 8px; padding-left: 10px; border-left: 2px solid var(--primary-light); }
.c-children .c-item { margin-bottom: 8px; }
.c-children img { width: 26px; height: 26px; }
.c-input { display: flex; gap: 8px; margin-top: 10px; }
.c-input input { flex: 1; padding: 9px 12px; border: 1px solid var(--line); border-radius: 8px; outline: none; }

/* 空状态与分页 */
.empty { text-align: center; color: #bbb; padding: 50px 0; }
.empty .e-ico { font-size: 40px; margin-bottom: 10px; }
.load-more { text-align: center; color: var(--text2); padding: 14px; cursor: pointer; font-size: 13px; }
.fab { position: fixed; right: 30px; bottom: 40px; width: 54px; height: 54px; border-radius: 50%; background: var(--primary); color: #fff; font-size: 28px; border: none; cursor: pointer; box-shadow: 0 4px 14px rgba(255,122,26,.4); z-index: 90; }
.fab:hover { transform: scale(1.06); }
