/* 文章站全局样式 */
* { box-sizing: border-box; }
html, body { overflow-x: hidden; }  /* 问题35：防止宽元素撑出横向滚动条 */
body { margin: 0; font-family: -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif; background: #fffaf0; color: #2d3748; line-height: 1.6; }
.wrap { max-width: 960px; margin: 0 auto; padding: 0 16px; }
.wrap.narrow { max-width: 560px; }

/* 顶栏 */
.topbar { background: #1a1a1a; color: #fff; }
.topbar-inner { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; padding-top: 10px; padding-bottom: 10px; }
.logo { color: #f6ad55; font-size: 20px; font-weight: bold; text-decoration: none; }
.nav a { color: #e2e8f0; text-decoration: none; margin-left: 14px; }
.nav a:hover { color: #f6ad55; text-decoration: underline; }
.nav .admin-link { color: #fbd38d; font-weight: bold; }
.nav .hello { margin-left: 14px; color: #a0aec0; font-size: 14px; }
.admin-topbar { background: #744210; }

main.wrap { background: #fff; margin-top: 20px; margin-bottom: 20px; padding: 20px; border-radius: 8px; box-shadow: 0 1px 4px rgba(0,0,0,.08); }
.footer { text-align: center; color: #a0aec0; font-size: 13px; padding: 20px 0; background: #1a1a1a; margin-top: 40px; }

/* 文章列表 */
.article-list { list-style: none; padding: 0; }
.article-list li { border-bottom: 1px solid #eee; padding: 14px 0; }
.article-list .title { font-size: 18px; font-weight: bold; color: #dd6b20; text-decoration: none; }
.article-list .title:hover { text-decoration: underline; }
.article-list .excerpt { color: #666; margin: 6px 0; font-size: 14px; }
.article-list .date { color: #999; font-size: 13px; }
.article-list .actions { margin-left: 12px; font-size: 13px; }
.article-list .actions a { margin-right: 8px; }

/* 文章浏览页 */
.article-view h1 { margin-top: 0; }
.article-view .meta { color: #999; font-size: 14px; border-bottom: 1px solid #eee; padding-bottom: 10px; margin-bottom: 16px; }
.article-view .content { font-size: 16px; }
.article-view .content img { max-width: 100%; }
/* 问题36：视频宽度撑满页面宽度；iframe 按 16:9 高宽比，video 按自身比例 */
.article-view .content iframe { width: 100%; aspect-ratio: 16 / 9; height: auto; border: 0; }
.article-view .content video { width: 100%; height: auto; }
.article-view .content blockquote { border-left: 3px solid #dd6b20; background: #f7fafc; margin: 12px 0; padding: 8px 14px; color: #555; }
.article-view .content pre { background: #1a202c; color: #e2e8f0; padding: 12px; border-radius: 6px; overflow-x: auto; }

/* 表单 */
.form label { display: block; margin: 12px 0; font-weight: bold; }
/* 统一所有文本类输入框的尺寸（含 email / tel / url 等类型） */
.form input:not([type=checkbox]):not([type=radio]):not([type=submit]):not([type=button]):not([type=file]):not([type=hidden]),
.form textarea, .form select {
  display: block; width: 100%; margin-top: 6px; padding: 9px 10px;
  border: 1px solid #cbd5e0; border-radius: 6px; font-size: 15px; font-family: inherit;
}
.form textarea { resize: vertical; }
.form.narrow { max-width: 420px; }
.hint { color: #888; font-size: 13px; }
.empty { color: #999; padding: 30px 0; text-align: center; }
.form-actions { margin-top: 14px; }

/* 按钮 */
/* 可爱风按钮（2026-10-19）：胶囊形 + 柔和阴影 + 悬停上浮 */
.btn { display: inline-block; padding: 10px 24px; border: 2px solid #fed7aa;
  border-radius: 999px; background: #fff; color: #4a5568; text-decoration: none;
  cursor: pointer; font-size: 14px; font-weight: 600; line-height: 1.4;
  box-shadow: 0 2px 6px rgba(0,0,0,.06); transition: all .2s ease; }
.btn:hover { transform: translateY(-2px); box-shadow: 0 4px 12px rgba(237,137,54,.25);
  border-color: #ed8936; color: #dd6b20; }
.btn:active { transform: translateY(0); box-shadow: 0 1px 3px rgba(0,0,0,.1); }
.btn.primary { background: #ed8936; border-color: #ed8936; color: #fff;
  box-shadow: 0 3px 10px rgba(237,137,54,.35); }
.btn.primary:hover { background: #dd6b20; border-color: #dd6b20; color: #fff;
  box-shadow: 0 5px 16px rgba(237,137,54,.45); }
.btn.small { padding: 6px 16px; font-size: 13px; }
.btn.danger { background: #e53e3e; border-color: #e53e3e; color: #fff;
  box-shadow: 0 3px 10px rgba(229,62,62,.3); }
.btn.danger:hover { background: #c53030; border-color: #c53030; color: #fff; }
.link-btn { background: none; border: none; color: #dd6b20; cursor: pointer; font-size: 13px; padding: 0; }
.link-btn.danger { color: #c53030; }
.inline-form { display: inline; }

/* 提示消息 */
.flash { padding: 10px 14px; border-radius: 6px; margin: 12px 0; }
.flash-ok { background: #c6f6d5; color: #22543d; }
.flash-err { background: #fed7d7; color: #742a2a; }
.flash-warn { background: #fefcbf; color: #744210; }
.flash-info { background: #feebc8; color: #7b341e; }

/* 分页 */
.pagination { margin: 20px 0; text-align: center; }
.pagination a, .pagination .current { display: inline-block; padding: 6px 12px; margin: 0 3px; border: 1px solid #cbd5e0; border-radius: 4px; text-decoration: none; color: #dd6b20; }
.pagination .current { background: #dd6b20; color: #fff; border-color: #dd6b20; }

/* 个人中心 */
.profile-card { background: #f7fafc; border: 1px solid #e2e8f0; border-radius: 8px; padding: 14px 18px; margin-bottom: 16px; }
.profile-card p { margin: 6px 0; }

/* 发帖编辑器（仿 Discuz / phpBB 工具条） */
.editor-toolbar { display: flex; align-items: center; flex-wrap: wrap; gap: 4px;
  background: #edf2f7; border: 1px solid #cbd5e0; border-bottom: none; border-radius: 6px 6px 0 0; padding: 6px 8px; position: relative; }
.editor-toolbar button { border: 1px solid transparent; background: #fff; border-radius: 4px;
  padding: 4px 10px; cursor: pointer; font-size: 14px; }
.editor-toolbar button:hover { border-color: #dd6b20; color: #dd6b20; }
.editor-toolbar .sep { width: 1px; height: 20px; background: #cbd5e0; margin: 0 4px; }
.post-form textarea#editor { border-radius: 0 0 6px 6px; font-family: Consolas, monospace; }
.smilie-panel { position: absolute; top: 100%; left: 0; background: #fff; border: 1px solid #cbd5e0;
  border-radius: 6px; padding: 8px; box-shadow: 0 4px 12px rgba(0,0,0,.15); z-index: 10; }
.smilie-panel button { font-size: 20px; padding: 4px 8px; }

/* 后台 */
.admin-layout { display: flex; gap: 20px; align-items: flex-start; padding-top: 20px; padding-bottom: 20px; }
.sidebar { width: 180px; flex-shrink: 0; background: #fff; border-radius: 8px; box-shadow: 0 1px 4px rgba(0,0,0,.08); padding: 10px; }
.sidebar a { display: block; padding: 10px 12px; color: #4a5568; text-decoration: none; border-radius: 6px; }
.sidebar a:hover { background: #fff5e6; color: #dd6b20; }
.admin-main { flex: 1; background: #fff; border-radius: 8px; box-shadow: 0 1px 4px rgba(0,0,0,.08); padding: 20px; min-height: 60vh; }
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 14px; margin: 16px 0; }
.stat-card { background: #f7fafc; border: 1px solid #e2e8f0; border-radius: 8px; padding: 16px; text-align: center; }
.stat-card .num { font-size: 28px; font-weight: bold; color: #dd6b20; }
.stat-card .label { color: #666; font-size: 14px; }
.table { width: 100%; border-collapse: collapse; margin: 14px 0; font-size: 14px; }
.table th, .table td { border: 1px solid #e2e8f0; padding: 8px 10px; text-align: left; }
.table th { background: #edf2f7; }
.table code { background: #f7fafc; padding: 2px 6px; border-radius: 4px; font-size: 13px; }
.badge { display: inline-block; padding: 2px 10px; border-radius: 12px; font-size: 12px; white-space: nowrap; }
.nowrap { white-space: nowrap; }
.filter-form { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; margin: 12px 0; }
.filter-form label { font-size: 13px; color: #555; }
.filter-form input[type="text"], .filter-form input[type="date"] { padding: 6px 8px; border: 1px solid #cbd5e0; border-radius: 6px; font-size: 13px; }
.template-import { display: flex; gap: 8px; align-items: center; margin: 8px 0; font-size: 13px; color: #555; }
.template-import select { padding: 6px 8px; border: 1px solid #cbd5e0; border-radius: 6px; font-size: 13px; }
label.check { display: flex; align-items: center; gap: 8px; font-size: 14px; margin: 8px 0; cursor: pointer; }
label.check input[type="checkbox"] { width: 16px; height: 16px; }
/* wangEditor 容器（问题22） */
#toolbar-container { border: 1px solid #cbd5e0; border-bottom: 0; border-radius: 6px 6px 0 0; }
#editor-container { border: 1px solid #cbd5e0; border-radius: 0 0 6px 6px; min-height: 320px; }
#editor-container .w-e-text-container { min-height: 320px; }
/* 模板预览（问题27）：编辑器左侧，预览面板右侧 */
.editor-layout { display: flex; gap: 16px; align-items: flex-start; }
.editor-main { flex: 1; min-width: 0; }
.template-preview { width: 320px; flex-shrink: 0; border: 1px solid #cbd5e0; border-radius: 6px; padding: 12px; background: #f8fafc; max-height: 640px; overflow-y: auto; }
.template-preview h4 { margin: 0 0 8px; font-size: 14px; color: #333; }
.template-preview-body { font-size: 14px; word-break: break-word; }
.template-preview-body img, .template-preview-body video { max-width: 100%; }
@media (max-width: 900px) {
  .editor-layout { flex-direction: column; }
  .template-preview { width: 100%; }
}
.badge-unused { background: #c6f6d5; color: #22543d; }
.badge-used { background: #e2e8f0; color: #4a5568; }
.badge-revoked { background: #fed7d7; color: #742a2a; }
.muted { color: #aaa; }

/* 编辑器插入链接/图片弹窗 */
.insert-modal-backdrop { position: fixed; inset: 0; background: rgba(0,0,0,.45); z-index: 100;
  display: flex; align-items: center; justify-content: center; padding: 16px; }
.insert-modal { background: #fff; border-radius: 8px; width: 100%; max-width: 420px;
  box-shadow: 0 8px 24px rgba(0,0,0,.2); }
.insert-modal-head { display: flex; align-items: center; justify-content: space-between;
  padding: 12px 16px; border-bottom: 1px solid #e2e8f0; font-weight: bold; }
.insert-modal-head button { background: none; border: none; font-size: 20px; cursor: pointer; color: #999; line-height: 1; }
.insert-modal-tabs { display: flex; border-bottom: 1px solid #e2e8f0; }
.insert-modal-tabs button { flex: 1; padding: 10px; background: none; border: none; cursor: pointer; font-size: 14px; color: #666; }
.insert-modal-tabs button.active { color: #dd6b20; border-bottom: 2px solid #dd6b20; font-weight: bold; }
.insert-modal-body { padding: 16px; }
.insert-modal-body label { display: block; margin: 10px 0; font-size: 14px; font-weight: bold; }
.insert-modal-body input[type=text], .insert-modal-body input[type=file] {
  display: block; width: 100%; margin-top: 6px; padding: 8px 10px;
  border: 1px solid #cbd5e0; border-radius: 6px; font-size: 14px; font-family: inherit; }
.insert-modal-foot { padding: 0 16px 16px; text-align: right; }
.insert-modal .upload-status { font-size: 13px; color: #c53030; margin-top: 8px; min-height: 18px; }

/* ---- H5 移动端适配 ---- */
@media (max-width: 640px) {
  .logo { font-size: 17px; }
  .topbar-inner { padding-top: 8px; padding-bottom: 8px; }
  .nav a, .nav .hello { margin-left: 8px; font-size: 13px; }
  main.wrap { margin-top: 10px; margin-bottom: 10px; padding: 14px; }
  /* 后台：侧边栏变横向菜单，整体上下堆叠 */
  .admin-layout { flex-direction: column; }
  .sidebar { width: 100%; display: flex; flex-wrap: wrap; gap: 4px; }
  .sidebar a { padding: 8px 10px; font-size: 14px; }
  .admin-main { padding: 14px; }
  /* 表格横向滚动，避免挤压变形 */
  .table { display: block; overflow-x: auto; white-space: nowrap; }
  /* 表单按钮全宽 */
  .form-actions .btn { display: block; width: 100%; margin: 6px 0; text-align: center; }
  /* 编辑器工具条小屏下正常换行、缩小间距 */
  .editor-toolbar { gap: 2px; padding: 4px 6px; }
  .editor-toolbar button { padding: 4px 8px; font-size: 13px; }
  .editor-toolbar select { padding: 3px 4px; font-size: 13px; max-width: 96px; }
  .color-panel { min-width: 180px; }
  .article-list .title { font-size: 16px; }
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
  /* 问题35：iOS Safari 输入框字号小于16px 会自动缩放页面，统一 16px */
  .form input:not([type=checkbox]):not([type=radio]):not([type=submit]):not([type=button]):not([type=file]):not([type=hidden]),
  .form textarea, .form select { font-size: 16px; }
  /* 顶栏在小屏更紧凑 */
  .topbar-inner { gap: 6px; }
  /* 后台内容区减边距、去阴影，省空间 */
  .admin-main { box-shadow: none; }
  .admin-layout { gap: 12px; padding-top: 12px; }
  /* 表格字号略小、内边距收紧 */
  .table { font-size: 13px; }
  .table th, .table td { padding: 6px 8px; }
  /* 文章正文字号略小，行宽更舒适 */
  .article-view .content { font-size: 15px; }
}

/* 超小屏（<480px）：顶栏上下堆叠，避免导航挤压 */
@media (max-width: 480px) {
  .topbar-inner { flex-direction: column; align-items: flex-start; }
  .nav { margin-top: 2px; }
  .nav a:first-child, .nav .hello:first-child { margin-left: 0; }
  .wrap { padding: 0 12px; }
  main.wrap { padding: 12px; }
}

/* ---- Discuz 风格编辑器扩展样式 ---- */
/* 工具条下拉框（字体/字号），与按钮风格统一 */
.editor-toolbar select {
  border: 1px solid transparent; background: #fff; border-radius: 4px;
  padding: 4px 6px; cursor: pointer; font-size: 14px; color: #333; max-width: 110px;
}
.editor-toolbar select:hover { border-color: #dd6b20; color: #dd6b20; }

/* 颜色选择器弹窗（仿表情面板） */
.color-panel {
  position: absolute; top: 100%; left: 0; background: #fff; border: 1px solid #cbd5e0;
  border-radius: 6px; padding: 8px; box-shadow: 0 4px 12px rgba(0,0,0,.15); z-index: 10;
  min-width: 200px;
}
.color-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 4px; margin-bottom: 8px; }
.color-grid button {
  width: 24px; height: 24px; border: 1px solid #cbd5e0; border-radius: 4px;
  padding: 0; cursor: pointer;
}
.color-grid button:hover { border-color: #dd6b20; }
.color-custom { display: flex; gap: 6px; align-items: center; }
.color-custom input {
  flex: 1; min-width: 0; padding: 4px 8px; border: 1px solid #cbd5e0;
  border-radius: 4px; font-size: 13px; font-family: Consolas, monospace;
}
.color-custom button {
  padding: 4px 12px; font-size: 13px; white-space: nowrap;
}

/* 文章正文中的 BBCode 扩展标签渲染 */
.article-view .content table.bb-table {
  border-collapse: collapse; margin: 12px 0; max-width: 100%;
}
.article-view .content table.bb-table td,
.article-view .content table.bb-table th {
  border: 1px solid #cbd5e0; padding: 6px 10px; font-size: 15px;
}
.article-view .content del { color: #888; }
.article-view .content hr { border: none; border-top: 1px solid #cbd5e0; margin: 16px 0; }
.article-view .content ul, .article-view .content ol { margin: 10px 0; padding-left: 28px; }
.article-view .content sup, .article-view .content sub { font-size: 12px; }
.article-actions { margin-top: 24px; padding-top: 16px; border-top: 1px solid #eee; }

/* ========== 宠物站首页（2026-10-19） ========== */
.pet-home { background: #fff; }
.pet-nav { background: #1a1a1a; position: sticky; top: 0; z-index: 100; }
.pet-nav-inner { max-width: 1200px; margin: 0 auto; padding: 14px 20px; display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px; }
.pet-logo { color: #f6ad55; font-size: 22px; font-weight: bold; text-decoration: none; }
.pet-links { display: flex; align-items: center; flex-wrap: wrap; gap: 4px; }
.pet-links a { color: #e2e8f0; text-decoration: none; margin-left: 18px; font-size: 15px; }
.pet-links a:hover { color: #f6ad55; }
.pet-links .admin-link { color: #fbd38d; font-weight: bold; }
.pet-links .hello { margin-left: 18px; color: #a0aec0; font-size: 14px; }

/* 汉堡菜单按钮（移动端） */
.pet-menu-btn { display: none; background: none; border: none; color: #f6ad55; font-size: 26px; cursor: pointer; padding: 4px 8px; }
/* 右侧半透明抽屉 */
.pet-nav-mask { display: none; position: fixed; inset: 0; background: rgba(0,0,0,.45); z-index: 99; }
.pet-nav-mask.show { display: block; }

/* 深色横幅 */
.pet-hero { background: #111; color: #fff; overflow: hidden; }
.pet-hero-inner { max-width: 1200px; margin: 0 auto; padding: 60px 20px; display: flex; align-items: center; gap: 40px; }
.pet-hero-text { flex: 1; min-width: 280px; }
.pet-hero-text h1 { font-size: 84px; line-height: 1.1; margin: 0 0 16px; color: #f6ad55; letter-spacing: 12px; font-weight: 900; }
.pet-hero-sub { font-size: 20px; color: #e2e8f0; letter-spacing: 4px; margin: 0 0 30px; }
.pet-btn { display: inline-block; background: #ed8936; color: #fff; padding: 14px 36px; border-radius: 30px; text-decoration: none; font-size: 16px; font-weight: bold; }
.pet-btn:hover { background: #dd6b20; }
.pet-hero-img { flex: 1; min-width: 280px; text-align: center; }
.pet-hero-img img { max-width: 100%; max-height: 480px; border-radius: 12px; box-shadow: 0 20px 60px rgba(0,0,0,.5); }

/* 关于 */
.pet-about { max-width: 1100px; margin: 0 auto; padding: 70px 20px; text-align: center; }
.pet-about h2, .pet-showcase h2 { font-size: 38px; margin: 0 0 10px; color: #2d3748; }
.pet-subtitle { color: #718096; font-size: 16px; margin: 0 0 40px; }
.pet-about-inner { display: flex; gap: 40px; align-items: center; text-align: left; }
.pet-about-img { flex: 1; min-width: 260px; }
.pet-about-img img { width: 100%; border-radius: 12px; box-shadow: 0 8px 30px rgba(0,0,0,.12); }
.pet-about-text { flex: 1; min-width: 260px; }
.pet-about-text p { color: #4a5568; line-height: 1.9; margin: 0 0 16px; font-size: 15px; }
.pet-link { color: #ed8936; text-decoration: none; font-weight: bold; }
.pet-link:hover { text-decoration: underline; }

/* 萌宠展示 */
.pet-showcase { background: #fffaf0; padding: 70px 20px; text-align: center; }
.pet-cards { max-width: 1100px; margin: 36px auto 0; display: flex; gap: 24px; justify-content: center; flex-wrap: wrap; }
.pet-card { background: #fff; border-radius: 12px; overflow: hidden; width: 300px; box-shadow: 0 4px 20px rgba(0,0,0,.08); transition: transform .2s; }
.pet-card:hover { transform: translateY(-6px); }
.pet-card img { width: 100%; height: 220px; object-fit: cover; }
.pet-card-body { padding: 20px; }
.pet-card-body h3 { margin: 0 0 8px; font-size: 18px; color: #2d3748; }
.pet-card-body p { margin: 0; color: #718096; font-size: 14px; }

.pet-footer { background: #1a1a1a; color: #a0aec0; padding: 36px 20px 20px; font-size: 14px; }
.pet-footer-inner { max-width: 1100px; margin: 0 auto; display: flex; align-items: center; justify-content: space-between; gap: 30px; flex-wrap: wrap; padding-bottom: 24px; border-bottom: 1px solid rgba(255,255,255,.1); }
.pet-footer-brand { display: flex; align-items: center; gap: 12px; }
.pet-footer-brand img { width: 64px; height: 64px; border-radius: 12px; object-fit: cover; background: #fff; }
.pet-footer-brand span { color: #fff; font-size: 22px; font-weight: bold; }
.pet-footer-apps { display: flex; gap: 36px; flex-wrap: wrap; }
.pet-app { display: flex; flex-direction: column; align-items: center; gap: 8px; color: #cbd5e0; font-size: 13px; }
.pet-app-icon { width: 52px; height: 52px; border-radius: 14px; object-fit: cover; }
.pet-footer-qr { display: flex; flex-direction: column; align-items: center; gap: 8px; color: #cbd5e0; font-size: 13px; }
.pet-qr-box { width: 110px; height: 110px; background: #fff; color: #718096; display: flex; align-items: center; justify-content: center; text-align: center; font-size: 13px; border-radius: 6px; line-height: 1.6; }
.pet-copyright { text-align: center; margin: 16px 0 0; }

@media (max-width: 768px) {
  .pet-footer-inner { flex-direction: column; text-align: center; }
  .pet-footer-apps { justify-content: center; gap: 24px; }
}

@media (max-width: 768px) {
  .pet-hero-inner { flex-direction: column; padding: 40px 20px; }
  .pet-hero-text h1 { font-size: 56px; letter-spacing: 8px; }
  .pet-hero-sub { font-size: 17px; letter-spacing: 2px; }
  .pet-about-inner { flex-direction: column; }
  .pet-about h2 { font-size: 28px; }
  /* 移动端：导航变右侧半透明抽屉 */
  .pet-menu-btn { display: block; }
  .pet-nav-inner { justify-content: space-between; }
  .pet-links {
    position: fixed; top: 0; right: -260px; width: 240px; height: 100vh;
    background: rgba(26, 26, 26, .96); flex-direction: column; align-items: stretch;
    padding: 60px 20px 20px; gap: 0; z-index: 199; transition: right .28s ease;
    box-shadow: -4px 0 20px rgba(0,0,0,.4);
  }
  .pet-links.open { right: 0; }
  .pet-links a, .pet-links .hello {
    margin: 0; padding: 13px 8px; border-bottom: 1px solid rgba(255,255,255,.08);
    font-size: 16px; display: block;
  }
}

/* 后台按钮：实用简洁，不花哨（2026-10-19） */
.admin-main .btn {
  padding: 5px 12px;
  font-size: 13px;
  border-radius: 4px;
  border-width: 1px;
  box-shadow: none;
  font-weight: normal;
}
.admin-main .btn:hover {
  transform: none;
  box-shadow: none;
}
.admin-main .btn:active {
  transform: none;
  box-shadow: none;
}
.admin-main .btn.small {
  padding: 3px 10px;
  font-size: 12px;
}
.admin-main .btn.primary {
  box-shadow: none;
}
.admin-main .btn.primary:hover {
  box-shadow: none;
}

/* 发码页按钮美化（2026-10-19）：小尺寸 + 间距 */
.issuer-create-form { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.issuer-create-form input[type="text"] { width: 90px; padding: 4px 8px; font-size: 12px; border: 1px solid #e2e8f0; border-radius: 4px; }
.issuer-create-form .btn.small { padding: 4px 12px; font-size: 12px; }
