* { margin:0; padding:0; box-sizing:border-box; -webkit-tap-highlight-color:transparent; }
body {
  font-family:-apple-system,BlinkMacSystemFont,'Segoe UI','PingFang SC','Hiragino Sans GB','Microsoft YaHei',sans-serif;
  background:linear-gradient(180deg,#eef2f7 0%,#f5f7fa 40%,#f0f4f8 100%);
  color:#333; font-size:14px; min-height:100vh;
}
#app { max-width:640px; margin:0 auto; min-height:100vh; position:relative; }
.page { min-height:100vh; }
.bottom-spacer { height:70px; }

/* ============ 首页横幅 ============ */
.banner {
  background:linear-gradient(135deg,#1565c0 0%,#1e88e5 50%,#42a5f5 100%);
  padding:36px 20px 30px; color:#fff; position:relative; overflow:hidden;
}
.banner::after {
  content:''; position:absolute; right:-30px; top:10px; width:180px; height:120px;
  background:radial-gradient(circle,rgba(255,255,255,.12) 0%,transparent 70%);
  border-radius:50%;
}
.banner-title { font-size:32px; font-weight:800; letter-spacing:2px; line-height:1.1; }
.banner-sub { font-size:24px; font-weight:700; margin-top:4px; letter-spacing:4px; opacity:.95; }
.banner-tags { display:flex; gap:16px; margin-top:14px; font-size:13px; opacity:.9; }
.banner-tags span { background:rgba(255,255,255,.15); padding:3px 10px; border-radius:12px; }

/* 教程横幅 */
.tutorial-banner {
  margin:12px 12px 0; border-radius:12px; overflow:hidden;
  background:linear-gradient(90deg,#e3f2fd 0%,#bbdefb 100%);
  padding:14px 16px; cursor:pointer; position:relative;
}
.tutorial-text { display:flex; justify-content:space-between; align-items:center; }
.tutorial-title { font-size:16px; font-weight:700; color:#1565c0; }
.tutorial-btn { font-size:13px; color:#1976d2; background:#fff; padding:4px 12px; border-radius:12px; font-weight:600; }

/* ============ 功能入口卡片 ============ */
.entry-grid { padding:12px; display:grid; grid-template-columns:1fr 1fr; gap:10px; }
.entry-card {
  border-radius:12px; padding:16px; display:flex; justify-content:space-between; align-items:center;
  cursor:pointer; position:relative; overflow:hidden; min-height:90px;
}
.entry-card:active { transform:scale(.97); }
.entry-purple { background:linear-gradient(135deg,#e1bee7 0%,#ce93d8 100%); }
.entry-blue { background:linear-gradient(135deg,#bbdefb 0%,#90caf9 100%); }
.entry-orange { background:linear-gradient(135deg,#ffccbc 0%,#ffab91 100%); grid-column:1 / -1; }
.entry-info { flex:1; }
.entry-name { font-size:18px; font-weight:800; color:#333; }
.entry-desc { font-size:12px; color:#555; margin-top:4px; line-height:1.4; }
.entry-go {
  display:inline-block; margin-top:8px; background:rgba(255,255,255,.6);
  color:#333; font-size:12px; font-weight:700; padding:3px 12px; border-radius:12px;
}
.entry-icon { font-size:36px; opacity:.8; margin-left:8px; }

/* ============ 通用section ============ */
.section { padding:0 12px; margin-top:8px; }
.section-title { font-size:15px; font-weight:700; color:#333; margin:12px 4px 10px; }

/* 文案工具tab */
.tool-tabs { display:flex; gap:0; margin-bottom:10px; }
.tool-tab {
  padding:6px 16px; font-size:13px; color:#666; background:#fff; border-radius:8px 8px 0 0;
  cursor:pointer; font-weight:500;
}
.tool-tab.active { background:#1976d2; color:#fff; font-weight:600; }
.tool-grid { display:grid; grid-template-columns:1fr 1fr; gap:10px; }
.tool-card {
  background:#fff; border-radius:10px; padding:12px; display:flex; gap:10px; align-items:flex-start;
  cursor:pointer; box-shadow:0 1px 4px rgba(0,0,0,.04);
}
.tool-card:active { background:#f5f5f5; }
.tool-icon {
  width:36px; height:36px; border-radius:8px; display:flex; align-items:center; justify-content:center;
  font-size:18px; flex-shrink:0;
}
.tool-icon-purple { background:#f3e5f5; color:#7b1fa2; }
.tool-icon-green { background:#e8f5e9; color:#388e3c; }
.tool-icon-blue { background:#e3f2fd; color:#1976d2; }
.tool-info { flex:1; min-width:0; }
.tool-name { font-size:14px; font-weight:600; color:#333; }
.tool-desc { font-size:11px; color:#999; margin-top:3px; line-height:1.4; }

/* 生成记录 */
.record-center {
  background:linear-gradient(135deg,#e3f2fd 0%,#bbdefb 100%); border-radius:10px;
  padding:14px 16px; cursor:pointer; position:relative; overflow:hidden;
}
.record-center::after {
  content:''; position:absolute; right:0; top:0; width:60px; height:100%;
  background:linear-gradient(90deg,transparent,rgba(255,255,255,.3));
}
.record-center-title { font-size:15px; font-weight:700; color:#1565c0; }
.record-center-desc { font-size:12px; color:#5c6bc0; margin-top:3px; }
.record-view-btn {
  text-align:right; margin-top:8px; color:#1976d2; font-size:13px; font-weight:600;
  background:#e3f2fd; display:inline-block; padding:5px 14px; border-radius:14px; float:right;
}

/* ============ 搜索栏 ============ */
.search-bar {
  display:flex; align-items:center; padding:10px 12px; background:#fff; gap:8px;
  border-bottom:1px solid #f0f0f0;
}
.search-input {
  flex:1; border:1px solid #e0e0e0; border-radius:20px; padding:8px 14px;
  font-size:13px; outline:none; background:#f5f7fa;
}
.search-input:focus { border-color:#1976d2; background:#fff; }
.search-btn { font-size:18px; cursor:pointer; padding:4px; }

/* ============ 模板页 ============ */
.tpl-container { padding:8px 12px; }
.tpl-category { margin-bottom:16px; }
.tpl-cat-title { font-size:15px; font-weight:700; color:#333; margin:12px 4px 10px; }
.tpl-grid { display:grid; grid-template-columns:1fr 1fr; gap:8px; }
.tpl-card {
  background:#fff; border-radius:10px; padding:12px; display:flex; gap:10px; align-items:flex-start;
  cursor:pointer; box-shadow:0 1px 4px rgba(0,0,0,.04);
}
.tpl-card:active { background:#f9f9f9; }
.tpl-icon {
  width:34px; height:34px; border-radius:8px; display:flex; align-items:center; justify-content:center;
  font-size:18px; flex-shrink:0;
}
.tpl-info { flex:1; min-width:0; }
.tpl-name { font-size:13px; font-weight:600; color:#333; }
.tpl-desc { font-size:11px; color:#999; margin-top:3px; line-height:1.4; }

/* ============ 历史页 ============ */
.filter-bar { padding:8px 12px; }
.filter-select {
  border:1px solid #e0e0e0; border-radius:8px; padding:6px 10px; font-size:13px;
  background:#fff; outline:none; color:#333;
}
.history-list { padding:8px 12px; }
.history-item {
  background:#fff; border-radius:10px; padding:14px; margin-bottom:10px; cursor:pointer;
  box-shadow:0 1px 4px rgba(0,0,0,.04);
}
.history-item:active { background:#f9f9f9; }
.history-title { font-size:14px; font-weight:600; color:#333; margin-bottom:6px; }
.history-meta { font-size:12px; color:#999; margin-bottom:8px; display:flex; align-items:center; gap:8px; }
.hist-tag { display:inline-block; border-radius:4px; padding:1px 7px; font-size:11px; font-weight:500; }
.tag-rewrite { background:#e3f2fd; color:#1976d2; }
.tag-url_rewrite { background:#e8f5e9; color:#388e3c; }
.tag-merge_text { background:#f3e5f5; color:#7b1fa2; }
.tag-merge_url { background:#fff3e0; color:#f57c00; }
.tag-template { background:#fce4ec; color:#c2185b; }
.hist-time { color:#bbb; }
.history-result { font-size:12px; color:#888; line-height:1.6; }
.empty { text-align:center; color:#bbb; padding:80px 0; font-size:14px; }

/* ============ 我的页 ============ */
.mine-header {
  background:linear-gradient(135deg,#3949ab 0%,#5c6bc0 50%,#7986cb 100%);
  padding:30px 20px 36px; color:#fff; display:flex; flex-direction:column; align-items:center;
}
.mine-avatar {
  width:60px; height:60px; border-radius:50%; overflow:hidden; border:2px solid rgba(255,255,255,.3);
  background:rgba(255,255,255,.2); display:flex; align-items:center; justify-content:center; font-size:28px;
}
.mine-avatar img { width:100%; height:100%; object-fit:cover; }
.mine-name { font-size:17px; font-weight:600; margin-top:10px; cursor:pointer; }
.mine-vip {
  margin-top:6px; font-size:12px; background:linear-gradient(135deg,#ffd54f,#ffb300);
  color:#5d4037; padding:2px 10px; border-radius:10px; font-weight:600;
}
.mine-vip.free { background:rgba(255,255,255,.2); color:#fff; }

.vip-card {
  margin:12px 12px 0; border-radius:12px; padding:14px 16px; cursor:pointer;
  background:linear-gradient(135deg,#ffe0b2 0%,#ffcc80 50%,#ffb74d 100%);
  display:flex; justify-content:space-between; align-items:center;
  box-shadow:0 2px 8px rgba(255,152,0,.15);
}
.vip-card.agent { background:linear-gradient(135deg,#ffecb3 0%,#ffe082 50%,#ffd54f 100%); }
.vip-left { display:flex; align-items:center; gap:10px; }
.vip-crown { font-size:24px; }
.vip-title { font-size:15px; font-weight:700; color:#5d4037; }
.vip-desc { font-size:12px; color:#795548; margin-top:2px; }
.vip-btn {
  background:#5d4037; color:#fff; font-size:12px; padding:5px 14px; border-radius:14px; font-weight:600;
}

.mine-menu-grid {
  margin:16px 12px; background:#fff; border-radius:12px; padding:20px 10px;
  display:grid; grid-template-columns:repeat(4,1fr); gap:16px 8px;
  box-shadow:0 1px 4px rgba(0,0,0,.04);
}
.mine-menu-item { display:flex; flex-direction:column; align-items:center; cursor:pointer; }
.mine-menu-item:active { opacity:.6; }
.mine-menu-icon { font-size:24px; margin-bottom:6px; }
.mine-menu-text { font-size:12px; color:#555; }

/* ============ 子页面头部 ============ */
.sub-header {
  background:#fff; padding:12px 16px; display:flex; align-items:center; position:relative;
  border-bottom:1px solid #f0f0f0;
}
.back-btn { font-size:26px; color:#333; cursor:pointer; line-height:1; width:30px; }
.sub-title { font-size:16px; font-weight:600; color:#333; flex:1; text-align:center; margin-right:30px; }

/* ============ 改写/生成页 ============ */
.rewrite-container { padding:16px; }
.rewrite-input {
  width:100%; border:1px solid #e0e0e0; border-radius:10px; padding:12px 14px;
  font-size:14px; outline:none; background:#fff; margin-bottom:10px;
}
.rewrite-input:focus { border-color:#1976d2; }
.rewrite-textarea {
  width:100%; border:1px solid #e0e0e0; border-radius:10px; padding:12px 14px;
  font-size:14px; outline:none; background:#fff; resize:none; height:200px; font-family:inherit;
}
.rewrite-textarea.small { height:100px; margin-bottom:10px; }
.rewrite-textarea:focus { border-color:#1976d2; }
.char-count { text-align:right; font-size:12px; color:#999; margin:6px 0 10px; }
.merge-label { font-size:13px; color:#555; margin:8px 0 6px; font-weight:500; }
.rewrite-tip { font-size:12px; color:#999; margin:6px 0 10px; }
.tpl-desc-text { font-size:13px; color:#666; margin-bottom:14px; line-height:1.6; }
.form-field { margin-bottom:14px; }
.form-label { font-size:13px; color:#333; margin-bottom:6px; font-weight:500; }
.required { color:#f44336; margin-left:2px; }

.btn-primary {
  width:100%; background:linear-gradient(135deg,#1976d2,#42a5f5); color:#fff; border:none;
  border-radius:10px; padding:14px; font-size:16px; font-weight:600; cursor:pointer; margin-top:8px;
}
.btn-primary:disabled { opacity:.6; cursor:not-allowed; }
.btn-primary:active { opacity:.85; }
.usage { text-align:center; font-size:12px; color:#999; margin-top:10px; }

/* 结果 */
.result-box { margin:0 16px 16px; background:#fff; border-radius:12px; padding:16px; box-shadow:0 1px 4px rgba(0,0,0,.04); }
.result-header { display:flex; justify-content:space-between; align-items:center; margin-bottom:10px; font-size:15px; font-weight:600; color:#333; }
.btn-copy { background:#1976d2; color:#fff; border:none; border-radius:6px; padding:4px 14px; font-size:12px; cursor:pointer; }
.btn-copy:active { opacity:.8; }
.result-content { font-size:14px; line-height:1.8; color:#444; white-space:pre-wrap; word-break:break-all; max-height:500px; overflow-y:auto; }

/* ============ 文章库 ============ */
.article-list { padding:8px 12px; }
.article-item { background:#fff; border-radius:10px; padding:14px; margin-bottom:10px; cursor:pointer; box-shadow:0 1px 4px rgba(0,0,0,.04); }
.article-item:active { background:#f9f9f9; }
.article-title { font-size:15px; font-weight:600; color:#333; line-height:1.5; margin-bottom:8px; }
.article-meta { display:flex; gap:10px; margin-bottom:8px; font-size:12px; }
.article-cat { background:#e3f2fd; color:#1976d2; padding:2px 8px; border-radius:4px; }
.article-hot { color:#ff5722; }
.article-summary { font-size:13px; color:#888; line-height:1.6; }

/* ============ 详情页 ============ */
.detail-container { padding:16px; }
.detail-title { font-size:17px; font-weight:700; color:#333; margin-bottom:8px; line-height:1.5; }
.detail-meta { font-size:12px; color:#999; margin-bottom:16px; display:flex; align-items:center; gap:8px; }
.detail-section { margin-bottom:20px; }
.detail-label { font-size:14px; font-weight:600; color:#333; margin-bottom:8px; display:flex; justify-content:space-between; align-items:center; }
.detail-content {
  background:#fff; border-radius:10px; padding:14px; font-size:14px; line-height:1.8;
  color:#444; white-space:pre-wrap; word-break:break-all; box-shadow:0 1px 4px rgba(0,0,0,.04);
  max-height:500px; overflow-y:auto;
}

/* ============ 底部导航 ============ */
.tabbar {
  position:fixed; bottom:0; left:50%; transform:translateX(-50%); width:100%; max-width:640px;
  display:flex; background:#fff; border-top:1px solid #eee; z-index:100; padding-bottom:env(safe-area-inset-bottom);
}
.tab-item { flex:1; text-align:center; padding:8px 0 6px; font-size:11px; color:#999; cursor:pointer; }
.tab-item.active { color:#1976d2; }
.tab-icon { font-size:22px; line-height:1.2; }

/* ============ Toast ============ */
.toast {
  position:fixed; top:50%; left:50%; transform:translate(-50%,-50%);
  background:rgba(0,0,0,.78); color:#fff; padding:12px 24px; border-radius:8px;
  font-size:14px; z-index:999; max-width:80%; text-align:center;
}

/* 回到顶部 */
.back-top {
  position:fixed; bottom:80px; right:20px; width:36px; height:36px; border-radius:50%;
  background:#1976d2; color:#fff; display:flex; align-items:center; justify-content:center;
  font-size:18px; cursor:pointer; z-index:99; box-shadow:0 2px 8px rgba(25,118,210,.3);
}
/* ============ 登录页 ============ */
.login-page { background:#f5f6f8; min-height:100vh; }
.login-wrap { display:flex; flex-direction:column; align-items:center; padding:40px 30px 0; }
.login-logo {
  width:80px; height:80px; border-radius:18px; background:linear-gradient(135deg,#1976d2,#42a5f5);
  display:flex; align-items:center; justify-content:center; margin-bottom:16px;
  box-shadow:0 4px 16px rgba(25,118,210,.3);
}
.login-logo-icon { font-size:40px; font-weight:800; color:#fff; }
.login-app-name { font-size:22px; font-weight:700; color:#333; margin-bottom:4px; }
.login-app-desc { font-size:14px; color:#999; margin-bottom:40px; }
.login-btn {
  width:100%; max-width:340px; height:48px; border:none; border-radius:24px;
  background:linear-gradient(135deg,#1976d2,#2196f3); color:#fff; font-size:17px;
  font-weight:600; cursor:pointer; box-shadow:0 4px 12px rgba(25,118,210,.35);
  transition:opacity .2s;
}
.login-btn:active { opacity:.85; }
.login-policy {
  display:flex; align-items:center; margin-top:18px; font-size:12px; color:#999;
  max-width:340px; width:100%;
}
.login-checkbox {
  width:16px; height:16px; border:1.5px solid #ccc; border-radius:50%; margin-right:8px;
  display:flex; align-items:center; justify-content:center; font-size:11px; color:#fff;
  cursor:pointer; flex-shrink:0; transition:all .2s;
}
.login-checkbox.checked { background:#1976d2; border-color:#1976d2; }
.login-policy-text a { color:#1976d2; }
.login-divider {
  display:flex; align-items:center; margin:36px 0 24px; width:100%; max-width:340px;
  color:#bbb; font-size:12px;
}
.login-divider::before, .login-divider::after {
  content:''; flex:1; height:1px; background:#e0e0e0;
}
.login-divider span { padding:0 16px; }
.login-other { display:flex; gap:32px; }
.login-other-btn {
  width:48px; height:48px; border-radius:50%; display:flex; align-items:center; justify-content:center;
  cursor:pointer; transition:opacity .2s;
}
.login-other-btn:active { opacity:.8; }
.login-other-btn.wechat { background:#07c160; box-shadow:0 2px 8px rgba(7,193,96,.3); }
