* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  background: #f4f6fb;
  color: #1f2937;
}

a {
  color: inherit;
  text-decoration: none;
}

.topbar {
  height: 64px;
  padding: 0 32px;
  background: #ffffff;
  border-bottom: 1px solid #e5e7eb;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 100;
}

.brand {
  font-size: 20px;
  font-weight: 700;
}

nav {
  display: flex;
  gap: 16px;
  align-items: center;
}

.container {
  max-width: 1320px;
  margin: 0 auto;
  padding: 28px 20px;
}

.btn,
.primary,
.primary-button {
  background: #2563eb;
  color: #fff;
  border: 0;
  border-radius: 10px;
  padding: 10px 16px;
  cursor: pointer;
  display: inline-block;
}

.danger {
  background: #ef4444;
}

.ghost {
  border: 1px solid #d1d5db;
  background: #fff;
  border-radius: 10px;
  padding: 8px 14px;
  cursor: pointer;
}

.card {
  background: #ffffff;
  border-radius: 18px;
  box-shadow: 0 12px 30px rgba(15, 23, 42, 0.07);
  overflow: hidden;
}

.publish-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 430px;
  gap: 22px;
  align-items: start;
}

.editor-header {
  padding: 24px;
  background: #ffffff;
  border-bottom: 1px solid #e5e7eb;
}

.editor-header h2 {
  margin: 0 0 18px;
  font-size: 22px;
  font-weight: 700;
}

.field {
  display: block;
  margin: 16px 0;
}

.field span {
  display: block;
  margin-bottom: 8px;
  color: #475569;
  font-size: 14px;
}

.article-content img {
  max-width: 100% !important;
  height: auto !important;
}

input,
textarea,
select {
  width: 100%;
  border: 1px solid #d1d5db;
  border-radius: 10px;
  padding: 0 12px;
  font-size: 15px;
  outline: none;
  transition: 0.18s ease;
  background: #fff;
}

input,
select {
  height: 44px;
}
textarea {
  min-height: 78px;
  padding: 10px 12px;
  resize: vertical;
}

input:focus,
textarea:focus {
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.hint {
  background: #fff7ed;
  color: #9a3412;
  padding: 12px 14px;
  border-radius: 10px;
  line-height: 1.7;
  font-size: 14px;
}

/* 全新编辑器外壳 */
.editor-shell {
  background: #fff;
}

/* 全新工具栏 */
.editor-topbar {
  position: sticky;
  top: 64px;
  z-index: 90;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  background: linear-gradient(180deg, #ffffff, #f8fafc);
  border-bottom: 1px solid #e5e7eb;
  box-shadow: 0 3px 12px rgba(15, 23, 42, 0.05);

  flex-wrap: wrap;
 
  overflow-y: auto;
  max-height: 96px;
}

.toolbar-section {
  display: flex;
  align-items: center;
  gap: 6px;
  padding-right: 10px;
  border-right: 1px solid #e5e7eb;
  flex-shrink: 0;
}

.toolbar-section:last-child {
  border-right: none;
}

.toolbar-actions {
  margin-left: 0;
}

.editor-topbar button {
  height: 32px;
  padding: 0 10px;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  background: #ffffff;
  color: #334155;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  flex-shrink: 0;
  transition: 0.18s ease;
}



.editor-topbar button:hover {
  color: #2563eb;
  border-color: #2563eb;
  background: #eff6ff;
}

.editor-topbar button:active {
  transform: translateY(1px);
}

.publish-btn {
  background: #2563eb !important;
  border-color: #2563eb !important;
  color: #ffffff !important;
  box-shadow: 0 5px 14px rgba(37, 99, 235, 0.28);
}

.publish-btn:hover {
  background: #1d4ed8 !important;
  border-color: #1d4ed8 !important;
}

/* 编辑区域 */
.paste-editor {
  height: calc(100vh - 330px);
  min-height: 540px;
  overflow-y: auto;
  padding: 38px 46px;
  background: #ffffff;
  outline: none;
  font-size: 16px;
  line-height: 1.9;
  color: #1e293b;
  word-break: break-word;
  overflow-wrap: break-word;
}

.paste-editor:empty::before {
  content: "从 96 编辑器复制内容后，直接粘贴到这里开始编辑...";
  color: #94a3b8;
}

.paste-editor img {
  max-width: 100%;
  height: auto;
  cursor: pointer;
  border-radius: 12px;
  outline: 2px solid transparent;
}

.paste-editor img.selected-img,
.selected-img {
  outline: 3px solid #2563eb !important;
  outline-offset: 4px;
}

.paste-editor h1,
.article-content h1 {
  font-size: 30px;
  line-height: 1.45;
  margin: 24px 0 16px;
  color: #0f172a;
}

.paste-editor h2,
.article-content h2 {
  font-size: 24px;
  line-height: 1.45;
  margin: 22px 0 14px;
  color: #0f172a;
}

.paste-editor h3,
.article-content h3 {
  font-size: 20px;
  line-height: 1.45;
  margin: 20px 0 12px;
  color: #0f172a;
}

.custom-quote,
.paste-editor blockquote,
.article-content blockquote {
  border-left: 4px solid #2563eb;
  background: #eff6ff;
  padding: 14px 16px;
  margin: 16px 0;
  color: #475569;
  line-height: 1.8;
  border-radius: 10px;
}

.custom-divider,
.paste-editor hr,
.article-content hr {
  border: none;
  border-top: 1px solid #e5e7eb;
  margin: 26px 0;
}

/* 右侧预览 */
.preview-panel {
  position: sticky;
  top: 84px;
  max-height: calc(100vh - 110px);
  overflow: auto;
  padding: 22px;
}

.preview-panel h3 {
  margin: 0 0 16px;
  font-size: 18px;
}

.article-content {
  line-height: 1.8;
  word-break: break-word;
  overflow-wrap: break-word;
}

.article-content img {
  width: 100% !important;
  height: auto !important;
  display: block;
  margin: 12px auto;
}

/* 首页文章卡片 */
.hero {
  background: linear-gradient(135deg, #fff, #eef5ff);
  padding: 36px;
  border-radius: 18px;
  margin-bottom: 28px;
  box-shadow: 0 10px 30px rgba(20, 40, 80, 0.06);
}

.hero h1 {
  margin: 0 0 10px;
  font-size: 34px;
}

.hero p {
  color: #64748b;
  margin-bottom: 24px;
}

.section-title {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.article-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 18px;
}

.article-card {
  background: #fff;
  border-radius: 14px;
  padding: 18px;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.05);
}

.article-card h3 {
  margin: 0 0 8px;
}

.article-card .summary {
  color: #64748b;
  line-height: 1.7;
  max-height: 80px;
  overflow: hidden;
}

.meta {
  color: #94a3b8;
  font-size: 14px;
  margin-bottom: 16px;
}

/* 文章详情页 */
.article-page {
  max-width: 720px;
  margin: 0 auto;
  padding: 32px 18px 80px;
  background: #fff;
  min-height: calc(100vh - 64px);
}

.article-page h1 {
  text-align: center;
  margin-bottom: 10px;
}

.article-page .meta {
  text-align: center;
}

/* HTML 弹窗 */
.modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 999;
}

.hidden {
  display: none;
}

.modal-box {
  width: min(900px, 92vw);
  height: 78vh;
  background: #fff;
  border-radius: 16px;
  padding: 16px;
  display: flex;
  flex-direction: column;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

#htmlOutput {
  flex: 1;
  width: 100%;
  resize: none;
  border: 1px solid #d1d5db;
  border-radius: 10px;
  padding: 12px;
  font-family: Consolas, Monaco, monospace;
}


.brief-page {
  max-width: 900px;
  margin: 0 auto;
  background: #fff;
  font-family: "宋体", SimSun, serif;
}

.brief-red-head {
  position: sticky;
  top: 0;
  z-index: 50;
  background: #fff;
  text-align: center;
  padding: 36px 36px 0;
}

.brief-org {
  color: #c40000;
  font-size: 26px;
  font-weight: bold;
  letter-spacing: 4px;
  margin-bottom: 18px;
}

.brief-title {
  color: #c40000;
  font-size: 46px;
  font-weight: bold;
  letter-spacing: 6px;
  margin-bottom: 18px;
}

.brief-issue {
  font-size: 16px;
  color: #555;
  margin-bottom: 24px;
}

.brief-red-line {
  height: 5px;
  border-top: 1px solid #c40000;
  border-bottom: 2px solid #c40000;
  margin-top: 20px;
}

.brief-content {
  padding: 46px 42px 20px;
  font-size: 18px;
  line-height: 1.9;
}

/* 保护 96 编辑器内容 */
.brief-content img {
  max-width: 100%;
  height: auto;
}

.brief-content table {
  max-width: 100%;
}

.article-actions {
  text-align: center;
  margin-top: 36px;
}

.brief-footer {
  position: relative;
  margin: 40px 42px 0;
  padding: 0 0 70px;
  font-family: "宋体", SimSun, serif;
  font-size: 15px;
  color: #333;
}



.brief-sign {
  position: relative;
  margin: 2em 42px 24px;
  min-height: 150px;
  font-family: "宋体", SimSun, serif;
}

.brief-sign-text {
  text-align: right;
  font-size: 18px;
  line-height: 2;
  padding-right: 2em;
}

.brief-sign-seal {
  position: absolute;
  right: 2em;
  top: -58px;
  width: 145px;
  opacity: 0.85;
  pointer-events: none;
}


.brief-seal {
  position: absolute;
  right: 8px;
  top: -183px;
  width: 135px;
  opacity: 0.82;
  z-index: 1;
  pointer-events: none;
}

.brief-footer-line,
.brief-footer-row {
  position: relative;
  z-index: 2;
}

.brief-footer-line {
  border-top: 1px solid #c40000;
  margin-bottom: 10px;
}

.brief-footer-row {
  display: flex;
  justify-content: space-between;
  line-height: 2;
}


.site-footer {
  text-align: center;
  padding: 28px 16px;
  color: #64748b;
  font-size: 14px;
  line-height: 1.8;
}

.site-footer p {
  margin: 4px 0;
}

.topbar nav {
  gap: 8px;
}

.nav-link {
  padding: 8px 14px;
  border-radius: 10px;
  color: #0f172a;
  font-size: 15px;
  border: 1px solid transparent;
}

.nav-link:hover {
  background: #f1f5f9;
}

.nav-primary {
  color: #2563eb;
  background: #eff6ff;
  border-color: #bfdbfe;
}

/* 移动端 */
@media (max-width: 900px) {
  .publish-layout {
    grid-template-columns: 1fr;
  }

  .preview-panel {
    position: static;
    max-height: none;
  }

  .topbar {
    padding: 0 16px;
  }

  .paste-editor {
    height: auto;
    min-height: 460px;
    padding: 26px 22px;
  }
}