/* 智汇 AI 工具站 - 全宽响应式样式 */
:root {
  --bg: #f2f3f7;
  --card: #ffffff;
  --text: #1f2329;
  --muted: #8a919f;
  --primary: #4f6ef7;
  --gold: #f0a63a;
  --radius: 12px;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: "PingFang SC", "Microsoft YaHei", system-ui, sans-serif; background: var(--bg); color: var(--text); }
a { color: inherit; text-decoration: none; }

/* 顶栏 */
.topbar { background: #fff; border-bottom: 1px solid #e8eaf0; position: sticky; top: 0; z-index: 50; }
.topbar-inner { display: flex; align-items: center; gap: 24px; padding: 0 24px; height: 56px; }
.brand { font-size: 18px; font-weight: 700; display: flex; align-items: center; gap: 8px; }
.brand-logo { background: linear-gradient(135deg, #4f6ef7, #8b5cf6); color: #fff; border-radius: 8px; padding: 2px 8px; font-size: 14px; }
.topnav { display: flex; gap: 20px; flex: 1; }
.topnav a { color: #4b5563; font-size: 15px; }
.topnav a:hover { color: var(--primary); }
.topbar-user { display: flex; align-items: center; gap: 10px; }
.user-chip { font-size: 14px; color: #4b5563; }
.vip-badge { font-style: normal; background: linear-gradient(135deg, #f7c877, #f0a63a); color: #fff; border-radius: 4px; font-size: 11px; padding: 1px 6px; margin-left: 6px; }

/* 布局：全宽，侧栏 + 主区 */
.layout { display: flex; gap: 20px; padding: 20px 24px; align-items: flex-start; }
.sidebar { width: 260px; flex-shrink: 0; display: flex; flex-direction: column; gap: 16px; position: sticky; top: 72px; }
.main { flex: 1; min-width: 0; }
.card { background: var(--card); border-radius: var(--radius); padding: 16px; }
.side-user .avatar-row { display: flex; align-items: center; gap: 10px; font-size: 14px; }
.avatar { width: 40px; height: 40px; border-radius: 50%; background: #e5e7eb; display: inline-flex; align-items: center; justify-content: center; font-size: 16px; color: #6b7280; }
.member-box { margin-top: 12px; background: linear-gradient(135deg, #fdf3e3, #fbe8c8); border-radius: 10px; padding: 12px; display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 13px; color: #8a5a12; }
.member-box.member-on { background: linear-gradient(135deg, #e8f7ee, #d3f0de); color: #1c7c46; display: block; }
.side-recent h3 { font-size: 14px; color: #4b5563; margin-bottom: 12px; }
.recent-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.recent-item { display: flex; flex-direction: column; align-items: center; gap: 6px; font-size: 12px; color: #4b5563; text-align: center; }
.recent-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 70px; }

/* 按钮 */
.btn { display: inline-block; border: none; border-radius: 8px; padding: 8px 16px; font-size: 14px; cursor: pointer; transition: .15s; }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: #3d5ce0; }
.btn-ghost { background: transparent; color: #4b5563; }
.btn-ghost:hover { background: #f0f1f5; }
.btn-gold { background: linear-gradient(135deg, #f7c877, #f0a63a); color: #fff; white-space: nowrap; }
.btn-lg { padding: 12px 28px; font-size: 16px; }
.btn-block { width: 100%; }
.btn:disabled { opacity: .6; cursor: not-allowed; }

/* 分区与工具卡片网格 */
.section-title { font-size: 16px; font-weight: 600; margin: 24px 0 12px; }
.section-title:first-child { margin-top: 0; }
.tool-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.tool-card { background: var(--card); border-radius: var(--radius); padding: 16px; display: flex; gap: 12px; align-items: center; transition: .15s; position: relative; }
.tool-card:hover { transform: translateY(-2px); box-shadow: 0 6px 18px rgba(31, 35, 41, .08); }
.tool-icon { width: 44px; height: 44px; border-radius: 10px; display: inline-flex; align-items: center; justify-content: center; font-size: 20px; flex-shrink: 0; }
.icon-blue { background: #e3ecff; } .icon-purple { background: #ece7ff; } .icon-green { background: #ddf5e6; }
.icon-red { background: #ffe4e0; } .icon-orange { background: #ffefdb; } .icon-cyan { background: #dcf3f7; }
.tool-info h4 { font-size: 15px; font-weight: 600; display: flex; align-items: center; gap: 6px; }
.tool-info p { font-size: 12px; color: var(--muted); margin-top: 4px; display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden; }
.dot-new::after { content: ""; width: 6px; height: 6px; background: #f04438; border-radius: 50%; display: inline-block; }
.tag-member { background: #fdf3e3; color: #b07414; font-size: 11px; border-radius: 4px; padding: 1px 6px; }

/* 推荐横幅 */
.banner-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-bottom: 8px; }
.banner { border-radius: var(--radius); padding: 20px; color: #fff; display: flex; justify-content: space-between; align-items: center; }
.banner h4 { font-size: 17px; } .banner p { font-size: 13px; opacity: .9; margin-top: 6px; }
.banner-green { background: linear-gradient(135deg, #b7e4c7, #8fd6ae); color: #14532d; }
.banner-purple { background: linear-gradient(135deg, #d8ccf9, #c1aef5); color: #3b2a78; }
.banner-red { background: linear-gradient(135deg, #ffd3cc, #ffb4a8); color: #7c2d12; }

/* 表单页 */
.auth-wrap { max-width: 420px; margin: 40px auto; }
.auth-wrap .card { padding: 28px; }
.auth-wrap h2 { margin-bottom: 20px; font-size: 20px; }
.field { margin-bottom: 14px; }
.field label { display: block; font-size: 13px; color: #4b5563; margin-bottom: 6px; }
.field input, .field select, .field textarea { width: 100%; border: 1px solid #d7dbe4; border-radius: 8px; padding: 10px 12px; font-size: 14px; background: #fff; }
.field textarea { min-height: 120px; resize: vertical; }
.field input:focus, .field textarea:focus, .field select:focus { outline: 2px solid rgba(79, 110, 247, .3); border-color: var(--primary); }
.form-hint { font-size: 12px; color: var(--muted); margin-top: 4px; }

/* 套餐卡 */
.plan-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.plan-card { background: #fff; border-radius: var(--radius); padding: 24px; position: relative; border: 2px solid transparent; }
.plan-card.hot { border-color: var(--primary); }
.plan-tag { position: absolute; top: -12px; right: 16px; background: var(--primary); color: #fff; font-size: 12px; border-radius: 6px; padding: 2px 10px; }
.plan-name { font-size: 16px; font-weight: 600; }
.plan-price { font-size: 30px; font-weight: 700; margin: 12px 0; color: var(--primary); }
.plan-price small { font-size: 13px; color: var(--muted); font-weight: 400; }
.plan-benefits { list-style: none; font-size: 13px; color: #4b5563; margin-bottom: 20px; }
.plan-benefits li { padding: 4px 0; }
.plan-benefits li::before { content: "✓ "; color: #16a34a; }

/* 支付页 */
.pay-gateways { display: flex; gap: 12px; flex-wrap: wrap; margin: 16px 0; }
.gw-btn { border: 2px solid #e5e7eb; border-radius: 10px; padding: 12px 22px; cursor: pointer; background: #fff; font-size: 15px; }
.gw-btn.active { border-color: var(--primary); color: var(--primary); }
.qr-box { text-align: center; padding: 20px; }
.qr-box img { width: 220px; height: 220px; }

/* 工具使用页 */
.tool-page { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.tool-page .card { padding: 20px; }
.tool-head { grid-column: 1 / -1; display: flex; align-items: center; gap: 12px; }
.tool-head .tool-icon { width: 52px; height: 52px; font-size: 24px; }
.ai-output { min-height: 260px; white-space: pre-wrap; font-size: 14px; line-height: 1.8; color: #374151; }
.typing::after { content: "▍"; animation: blink 1s infinite; }
@keyframes blink { 50% { opacity: 0; } }

/* 模板页 */
.tpl-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.tpl-card { background: #fff; border-radius: var(--radius); padding: 18px; }
.tpl-card h4 { font-size: 15px; } .tpl-card p { font-size: 12px; color: var(--muted); margin: 8px 0 12px; min-height: 32px; }
.tpl-cat { font-size: 11px; color: var(--primary); background: #eef2ff; border-radius: 4px; padding: 1px 8px; }

/* 后台 */
.admin-wrap { display: flex; gap: 20px; padding: 20px 24px; }
.admin-side { width: 200px; flex-shrink: 0; }
.admin-side a { display: block; padding: 10px 14px; border-radius: 8px; font-size: 14px; color: #4b5563; margin-bottom: 4px; }
.admin-side a:hover, .admin-side a.on { background: #e8ecff; color: var(--primary); }
.admin-main { flex: 1; min-width: 0; }
.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 20px; }
.stat-card { background: #fff; border-radius: var(--radius); padding: 18px; }
.stat-card b { font-size: 26px; display: block; margin-top: 6px; }
table.tbl { width: 100%; background: #fff; border-radius: var(--radius); overflow: hidden; border-collapse: collapse; font-size: 13px; }
table.tbl th, table.tbl td { padding: 10px 12px; text-align: left; border-bottom: 1px solid #f0f1f5; }
table.tbl th { background: #fafbfc; color: #6b7280; font-weight: 600; }
table.tbl tr:last-child td { border-bottom: none; }
.toolbar { display: flex; gap: 10px; margin-bottom: 14px; flex-wrap: wrap; align-items: center; }
.badge { font-size: 11px; border-radius: 4px; padding: 2px 8px; }
.badge-ok { background: #e8f7ee; color: #16a34a; } .badge-wait { background: #fff7e6; color: #b07414; }

.flash { background: #e8f7ee; color: #166534; padding: 10px 24px; font-size: 14px; }
.muted { color: var(--muted); font-size: 13px; }
.footer { text-align: center; color: var(--muted); font-size: 13px; padding: 28px 0; }

/* 响应式 */
@media (max-width: 1200px) {
  .tool-grid, .tpl-grid, .banner-grid { grid-template-columns: repeat(2, 1fr); }
  .plan-grid { grid-template-columns: repeat(2, 1fr); }
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 860px) {
  .layout { flex-direction: column; padding: 12px; }
  .sidebar { width: 100%; position: static; flex-direction: row; }
  .sidebar .card { flex: 1; }
  .side-recent { display: none; }
  .tool-page { grid-template-columns: 1fr; }
  .topnav { display: none; }
  .admin-wrap { flex-direction: column; }
  .admin-side { width: 100%; display: flex; flex-wrap: wrap; }
}
@media (max-width: 600px) {
  .tool-grid, .tpl-grid, .banner-grid, .plan-grid, .stat-grid { grid-template-columns: 1fr; }
  .sidebar { flex-direction: column; }
}
