/* FatsClick 全站样式 - 响应式 */
* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif; background: #f7f8fa; color: #2c3038; min-height: 100vh; display: flex; flex-direction: column; }
a { color: #1a73e8; text-decoration: none; }
a:hover { text-decoration: underline; }

.topnav { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 24px; background: #fff; border-bottom: 1px solid #e8eaed; flex-wrap: wrap; }
.brand { font-size: 22px; font-weight: 700; color: #2c3038; }
.brand span { color: #1a73e8; }
.brand:hover { text-decoration: none; }
.nav-links { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.nav-user { color: #5f6368; font-size: 14px; }

.container { flex: 1; width: 100%; max-width: 1080px; margin: 0 auto; padding: 24px 16px; }

.flash { padding: 10px 14px; border-radius: 8px; margin-bottom: 14px; font-size: 14px; }
.flash-ok { background: #e6f4ea; color: #137333; }
.flash-err { background: #fce8e6; color: #c5221f; }

.btn { display: inline-block; padding: 9px 18px; border-radius: 6px; border: 1px solid #dadce0; background: #fff; color: #1a73e8; font-size: 14px; cursor: pointer; }
.btn:hover { background: #f1f3f4; text-decoration: none; }
.btn-primary { background: #1a73e8; border-color: #1a73e8; color: #fff; }
.btn-primary:hover { background: #1765cc; }
.btn-danger { color: #c5221f; border-color: #f3c1bd; }
.btn-danger:hover { background: #fce8e6; }
.btn-sm { padding: 5px 10px; font-size: 13px; }

/* 首页 hero */
.hero { text-align: center; padding: 48px 0 28px; }
.hero h1 { font-size: 34px; margin-bottom: 22px; font-weight: 600; }
.searchbox { max-width: 560px; margin: 0 auto; display: flex; gap: 8px; }
.searchbox input { flex: 1; padding: 12px 18px; border: 1px solid #dfe1e5; border-radius: 24px; font-size: 16px; outline: none; box-shadow: 0 1px 6px rgba(32,33,36,.15); }
.searchbox input:focus { border-color: #1a73e8; }
.searchbox button { padding: 0 22px; border-radius: 24px; border: none; background: #1a73e8; color: #fff; font-size: 15px; cursor: pointer; }

/* 资源列表 */
.section { margin-top: 28px; }
.section h2 { font-size: 17px; color: #5f6368; border-left: 3px solid #1a73e8; padding-left: 10px; margin-bottom: 14px; }
.filter-clear { font-size: 13px; margin-left: 8px; font-weight: 400; }
.res-list { list-style: none; }
.res-list li { background: #fff; border: 1px solid #e8eaed; border-radius: 10px; padding: 14px 18px; margin-bottom: 10px; }
.res-list li.res-item { display: flex; gap: 14px; align-items: flex-start; }
.res-cover { flex: 0 0 72px; width: 72px; height: 96px; border-radius: 6px; overflow: hidden; background: #f1f3f4; display: block; }
.res-cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.res-body { flex: 1; min-width: 0; }
.res-title { font-size: 17px; font-weight: 600; }
.res-desc { color: #5f6368; font-size: 14px; margin: 6px 0; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.res-meta { font-size: 13px; color: #9aa0a6; display: flex; gap: 14px; flex-wrap: wrap; }
.res-meta .cost { color: #e8710a; font-weight: 600; }
.tag-pdf { background: #e8f0fe; color: #1a73e8; margin-left: 6px; vertical-align: 2px; }
.pdf-filter { display: inline-flex; align-items: center; gap: 6px; margin-top: 16px; font-size: 14px; color: #5f6368; cursor: pointer; }
.pdf-filter input { cursor: pointer; }

/* 详情页封面 */
.detail-cover { max-width: 280px; margin-bottom: 16px; }
.detail-cover img { width: 100%; border-radius: 8px; border: 1px solid #e8eaed; display: block; }

/* 后台审核表单 */
.review-cell { min-width: 260px; }
.review-form { display: flex; flex-direction: column; gap: 4px; }
.review-form input[type="text"], .review-form input[type="url"] { width: 220px; padding: 5px 8px; border: 1px solid #dadce0; border-radius: 5px; font-size: 13px; font-family: inherit; }
.mini-label { font-size: 12px; color: #9aa0a6; margin-top: 4px; }
.mini-check { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: #3c4043; cursor: pointer; margin-top: 4px; }
code { background: #f1f3f4; border-radius: 4px; padding: 1px 6px; font-size: 12px; }

/* 表单 */
.card { background: #fff; border: 1px solid #e8eaed; border-radius: 12px; padding: 26px; max-width: 460px; margin: 20px auto; }
.card.wide { max-width: 680px; }
.card h1 { font-size: 22px; margin-bottom: 18px; }
.form-item { margin-bottom: 14px; }
.form-item label { display: block; font-size: 14px; color: #5f6368; margin-bottom: 6px; }
.form-item input, .form-item textarea, .form-item select { width: 100%; padding: 10px 12px; border: 1px solid #dadce0; border-radius: 6px; font-size: 15px; font-family: inherit; }
.form-item textarea { min-height: 100px; resize: vertical; }
.form-item .hint { font-size: 12px; color: #9aa0a6; margin-top: 4px; }

/* 详情页 */
.detail { background: #fff; border: 1px solid #e8eaed; border-radius: 12px; padding: 28px; max-width: 760px; margin: 20px auto; }
.detail h1 { font-size: 24px; margin-bottom: 12px; }
.detail .desc { color: #3c4043; line-height: 1.8; margin-bottom: 18px; white-space: pre-wrap; }
.down-box { background: #f1f6ff; border-radius: 10px; padding: 18px; display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; }
.down-box .info { font-size: 14px; color: #5f6368; }
.down-box .info b { color: #e8710a; }

/* 表格 */
.table-card { background: #fff; border: 1px solid #e8eaed; border-radius: 12px; padding: 20px; margin-bottom: 20px; overflow-x: auto; }
.table-card h2 { font-size: 17px; margin-bottom: 14px; color: #3c4043; }
table.grid { width: 100%; border-collapse: collapse; font-size: 14px; min-width: 560px; }
table.grid th, table.grid td { text-align: left; padding: 9px 10px; border-bottom: 1px solid #eef0f2; white-space: nowrap; }
table.grid th { color: #5f6368; font-weight: 600; background: #fafbfc; }
.tag { display: inline-block; padding: 2px 9px; border-radius: 10px; font-size: 12px; }
.tag-pending { background: #fef7e0; color: #b06000; }
.tag-approved { background: #e6f4ea; color: #137333; }
.tag-rejected { background: #fce8e6; color: #c5221f; }

.actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.admin-tabs { display: flex; gap: 8px; margin-bottom: 18px; flex-wrap: wrap; }
.admin-tabs a { padding: 7px 16px; border-radius: 18px; background: #fff; border: 1px solid #dadce0; font-size: 14px; }
.admin-tabs a.active, .admin-tabs a:hover { background: #1a73e8; color: #fff; text-decoration: none; border-color: #1a73e8; }

.footer { text-align: center; color: #9aa0a6; font-size: 13px; padding: 22px; border-top: 1px solid #e8eaed; }

@media (max-width: 600px) {
  .topnav { padding: 10px 14px; }
  .hero { padding: 26px 0 16px; }
  .hero h1 { font-size: 24px; }
  .searchbox { padding: 0 8px; }
  .container { padding: 14px 10px; }
  .detail, .card { padding: 18px; }
  .down-box { flex-direction: column; align-items: flex-start; }
}

/* ===== 三期：栏目 / 评论 ===== */
.cat-bar { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 22px; }
.cat-chip { background: #fff; border: 1px solid #dadce0; border-radius: 16px; padding: 5px 14px; font-size: 14px; color: #3c4043; text-decoration: none; transition: all .15s; }
.cat-chip span { color: #9aa0a6; font-size: 12px; margin-left: 2px; }
.cat-chip:hover { border-color: #1a73e8; color: #1a73e8; }
.cat-chip.active { background: #1a73e8; border-color: #1a73e8; color: #fff; }
.cat-chip.active span { color: #c5d9ff; }
.tag-cat { background: #e8f0fe; color: #1a73e8; font-size: 12px; padding: 2px 8px; border-radius: 4px; text-decoration: none; }
.tag-cat:hover { background: #d2e3fc; }
.tag-admin { background: #fef7e0; color: #b06000; font-size: 12px; padding: 1px 6px; border-radius: 4px; }

.comment-box { background: #fff; border: 1px solid #e8eaed; border-radius: 12px; padding: 20px 22px; margin-top: 24px; }
.comment-box h2 { font-size: 17px; color: #3c4043; margin-bottom: 14px; }
.comment-item { border-top: 1px solid #f1f3f4; padding: 12px 0; }
.comment-item:first-of-type { border-top: none; }
.comment-head { font-size: 14px; color: #202124; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.comment-time { color: #9aa0a6; font-size: 12px; margin-left: auto; }
.comment-content { margin-top: 6px; font-size: 15px; color: #3c4043; line-height: 1.7; word-break: break-word; }
.comment-form { margin-top: 16px; }
.comment-form textarea { width: 100%; min-height: 80px; border: 1px solid #dadce0; border-radius: 8px; padding: 10px 12px; font-size: 15px; font-family: inherit; box-sizing: border-box; resize: vertical; }
.comment-form textarea:focus { outline: none; border-color: #1a73e8; box-shadow: 0 0 0 2px rgba(26,115,232,.15); }
.comment-form .btn { margin-top: 10px; }

.cat-add-form, .cat-edit-form { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.cat-add-form input[type=text], .cat-edit-form input[type=text] { border: 1px solid #dadce0; border-radius: 8px; padding: 8px 12px; font-size: 14px; }
.cat-add-form input[type=text] { flex: 1; min-width: 200px; }

/* ===== 四期：点赞 / 推荐 / 列表心形计数 ===== */
.like-form { display: inline; }
.like-btn { display: inline-flex; align-items: center; gap: 6px; border: 1px solid #dadce0; background: #fff; border-radius: 20px; padding: 8px 16px; font-size: 14px; color: #3c4043; cursor: pointer; transition: all .15s; }
.like-btn:hover { border-color: #e8710a; color: #e8710a; }
.like-btn:hover svg { stroke: #e8710a; }
.like-btn.liked { background: #fef3e8; border-color: #f5c396; color: #e8710a; cursor: default; }
.res-meta .like-count { color: #e8710a; }

.recommend-box { background: #fff; border: 1px solid #e8eaed; border-radius: 12px; padding: 20px 22px; margin-top: 24px; }
.recommend-box h2 { font-size: 17px; color: #3c4043; margin-bottom: 14px; }
.rec-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 10px; }
.rec-item { border: 1px solid #eef0f2; border-radius: 10px; overflow: hidden; }
.rec-link { display: flex; align-items: center; gap: 10px; padding: 10px 12px; text-decoration: none; color: #202124; font-size: 14px; }
.rec-link:hover { background: #f8f9fa; }
.rec-cover { width: 42px; height: 56px; object-fit: cover; border-radius: 4px; flex: none; }
.rec-title { flex: 1; line-height: 1.5; }
.rec-meta { display: block; color: #9aa0a6; font-size: 12px; margin-top: 4px; }

/* ===== 手机端栏目条：单行横向滑动（置于文件末尾以覆盖基础样式） ===== */
@media (max-width: 600px) {
  .cat-bar { flex-wrap: nowrap; overflow-x: auto; -webkit-overflow-scrolling: touch; margin: 16px -10px 0; padding: 0 10px 6px; scrollbar-width: none; -ms-overflow-style: none; }
  .cat-bar::-webkit-scrollbar { display: none; }
  .cat-chip { flex: none; white-space: nowrap; }
}
