:root {
  --blue-900: #0f2d59;
  --blue-800: #1a4f9c;
  --blue-700: #2563eb;
  --blue-600: #3b82f6;
  --blue-100: #eff6ff;
  --cyan-100: #ecfeff;
  --ink: #1e293b;
  --muted: #64748b;
  --line: #e2e8f0;
  --paper: #ffffff;
  --soft: #f8fafc;
  --danger: #ef4444;
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1);
  --shadow-hover: 0 20px 25px -5px rgba(37, 99, 235, 0.1), 0 8px 10px -6px rgba(37, 99, 235, 0.1);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--soft);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Microsoft YaHei", sans-serif;
  font-size: 17px;
  line-height: 1.8;
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
  text-decoration: none;
  transition: all 0.2s ease;
}

button,
input,
select,
textarea {
  font: inherit;
  outline: none;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 12px 16px;
  background: #fff;
  color: var(--ink);
  transition: all 0.25s ease;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--blue-600);
  box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.12);
}

textarea {
  resize: vertical;
}

label {
  display: grid;
  gap: 8px;
  color: #334155;
  font-weight: 600;
  font-size: 14px;
}

label input,
label select,
label textarea {
  font-weight: 400;
  font-size: 15px;
}

button,
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 18px;
  background: #fff;
  color: var(--blue-800);
  font-weight: 500;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

button:hover,
.button:hover {
  border-color: var(--blue-600);
  background: var(--blue-100);
  color: var(--blue-700);
}

.primary,
button.primary {
  border-color: var(--blue-700);
  background: var(--blue-700);
  color: #fff;
  font-weight: 600;
  box-shadow: var(--shadow-sm);
}

.primary:hover,
button.primary:hover {
  background: var(--blue-800);
  border-color: var(--blue-800);
  color: #fff;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.2);
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255, 255, 255, 0.85);
  border-bottom: 1px solid rgba(226, 232, 240, 0.8);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.02);
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  max-width: 1200px;
  margin: 0 auto;
  padding: 16px 24px;
}

.article-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 1200px;
  margin: 0 auto;
  padding: 16px 24px;
  background: var(--bg);
}

.article-topbar .back-btn {
  display: flex;
  align-items: center;
  gap: 2px;
  font-size: 16px;
  font-weight: 600;
  color: var(--ink);
  text-decoration: none;
}

.article-topbar .home-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--ink);
  padding: 8px;
  border-radius: 50%;
  background: rgba(226, 232, 240, 0.5);
}

.brand {
  color: var(--blue-900);
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.5px;
  white-space: nowrap;
}

.nav-wrapper {
  max-width: 100%;
}

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

nav a {
  flex: 0 0 auto;
  border-radius: 8px;
  padding: 8px 14px;
  color: #475569;
  font-size: 15px;
  font-weight: 550;
}

nav a:hover {
  background: var(--blue-100);
  color: var(--blue-700);
}

.hero {
  background:
    linear-gradient(135deg, rgba(15, 45, 89, 0.96), rgba(37, 99, 235, 0.9)),
    radial-gradient(circle at 90% 10%, rgba(59, 130, 246, 0.4) 0, transparent 40%),
    #0b2f6b;
  color: #fff;
  position: relative;
  overflow: hidden;
}

.hero-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 80px 24px 90px;
}

.eyebrow {
  margin: 0 0 12px;
  color: #93c5fd;
  font-size: 14px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.5px;
}

.hero h1 {
  max-width: 800px;
  margin: 0;
  font-size: 46px;
  font-weight: 800;
  line-height: 1.25;
  letter-spacing: -1px;
}

.hero p:not(.eyebrow) {
  max-width: 700px;
  margin: 20px 0 32px;
  color: #bfdbfe;
  font-size: 18px;
  line-height: 1.6;
}

.searchbar {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  max-width: 640px;
  background: rgba(255, 255, 255, 0.1);
  padding: 6px;
  border-radius: 14px;
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.15);
}

.searchbar input {
  min-height: 48px;
  border: none;
  background: rgba(255, 255, 255, 0.95);
  border-radius: 10px;
  color: #0f172a;
}

.searchbar input::placeholder {
  color: #94a3b8;
}

.searchbar input:focus {
  box-shadow: none;
  background: #fff;
}

.searchbar button {
  min-width: 100px;
  border: none;
  background: #fff;
  color: var(--blue-700);
  font-weight: 700;
  border-radius: 10px;
  box-shadow: var(--shadow-sm);
}

.searchbar button:hover {
  background: var(--blue-100);
  color: var(--blue-800);
  transform: translateY(0);
}

.searchbar.flat {
  max-width: none;
  margin: 24px 0;
  background: none;
  padding: 0;
  border: none;
  grid-template-columns: 1fr auto;
}

.searchbar.flat input {
  border: 1px solid var(--line);
  background: #fff;
}

.searchbar.flat button {
  background: var(--blue-700);
  color: #fff;
}

.searchbar.flat button:hover {
  background: var(--blue-800);
}

.section,
.article-page,
.admin-shell {
  max-width: 1200px;
  margin: 0 auto;
  padding: 48px 24px;
}

.narrow {
  max-width: 900px;
}

.section-head,
.admin-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 24px;
  border-left: 4px solid var(--blue-700);
  padding-left: 12px;
}

.section-head.tab-head {
  border-left: none;
  padding-left: 0;
}

.section h1,
.section h2,
.admin-shell h1,
.article-page h1 {
  margin: 0;
  color: var(--blue-900);
  font-weight: 850;
  letter-spacing: -0.5px;
}

.section-head span,
.muted {
  color: var(--muted);
  font-size: 15px;
}

.category-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.category-pill,
.tag-row a {
  border: 1px solid #cbd5e1;
  border-radius: 20px;
  padding: 8px 18px;
  background: #fff;
  color: var(--ink);
  font-weight: 550;
  font-size: 14px;
  box-shadow: var(--shadow-sm);
  transition: all 0.2s ease;
}

.category-pill:hover,
.tag-row a:hover {
  border-color: var(--blue-600);
  background: var(--blue-100);
  color: var(--blue-700);
  transform: translateY(-2px);
  box-shadow: 0 4px 10px rgba(59, 130, 246, 0.1);
}

.article-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

.article-list {
  display: grid;
  gap: 18px;
  margin-top: 24px;
}

.article-card {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--paper);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.article-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-hover);
  border-color: rgba(37, 99, 235, 0.2);
}

.article-card a {
  display: flex;
  flex-direction: column;
  gap: 12px;
  height: 100%;
  padding: 24px 24px 12px 24px;
}

.article-card .card-cover {
  width: calc(100% + 48px);
  height: 160px;
  margin: -24px -24px 4px;
  object-fit: cover;
  background: #e2e8f0;
}

.article-card span,
.article-meta {
  color: var(--muted);
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.article-card a > span {
  margin-top: auto;
  padding-top: 12px;
}

.article-card h3 {
  margin: 0;
  color: var(--blue-900);
  font-size: 20px;
  font-weight: 700;
  line-height: 1.4;
}

.article-card p {
  margin: 0;
  color: #475569;
  font-size: 15.5px;
  line-height: 1.6;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.article-page {
  max-width: 880px;
  background: #fff;
  margin-top: 32px;
  margin-bottom: 48px;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 40px;
  box-shadow: var(--shadow-sm);
}

.article-page h1 {
  margin-top: 12px;
  font-size: 36px;
  font-weight: 800;
  line-height: 1.3;
}

.article-cover {
  margin: 20px 0 24px;
  border-radius: 14px;
  overflow: hidden;
  background: #f1f5f9;
}

.article-cover img {
  display: block;
  width: 100%;
  max-height: 460px;
  object-fit: cover;
}

.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 20px 0;
}

.lead {
  color: #334155;
  font-size: 18px;
  line-height: 1.7;
  padding: 16px 20px;
  background: #f8fafc;
  border-left: 4px solid var(--blue-600);
  border-radius: 0 10px 10px 0;
  margin-bottom: 28px;
}

.content-body {
  margin-top: 28px;
  color: #334155;
  font-size: 18px;
  line-height: 1.85;
}

.content-body p {
  margin: 0 0 18px 0;
}

.content-body h2 {
  font-size: 22px;
  color: var(--blue-900);
  margin: 36px 0 16px 0;
  font-weight: 700;
}

.content-body h3 {
  font-size: 18px;
  color: var(--blue-800);
  margin: 28px 0 12px 0;
  font-weight: 700;
}

.content-body ul,
.content-body ol {
  padding-left: 20px;
  margin-bottom: 20px;
}

.content-body li {
  margin-bottom: 8px;
}

.article-media,
.external-video,
.cover-preview {
  margin: 24px 0;
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
  background: #fff;
  box-shadow: var(--shadow-sm);
}

.article-media img,
.cover-preview img {
  display: block;
  width: 100%;
  height: auto;
}

.article-media video,
.external-video video,
.media-preview video {
  display: block;
  width: 100%;
  background: #0f172a;
}

.article-media figcaption,
.cover-preview figcaption {
  padding: 10px 14px;
  color: var(--muted);
  font-size: 13px;
  background: #f8fafc;
}

.external-video {
  padding: 18px;
}

.external-video h2 {
  margin: 0 0 12px;
  color: var(--blue-900);
  font-size: 20px;
}

.external-video p {
  margin: 12px 0 0;
  color: #475569;
}

.video-link {
  display: inline-flex;
  min-height: 42px;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  padding: 8px 14px;
  background: var(--blue-700);
  color: #fff;
  font-weight: 700;
}

.answer-box,
.faq {
  margin-top: 32px;
  border: 1px solid #cbd5e1;
  border-radius: 12px;
  padding: 24px;
  background: linear-gradient(180deg, #f8fafc, #fff);
  box-shadow: var(--shadow-sm);
}

.answer-box h2,
.faq h2 {
  margin: 0 0 16px;
  color: var(--blue-900);
  font-size: 20px;
  font-weight: 750;
}

.answer-box ul {
  padding-left: 20px;
  margin: 0;
}

.answer-box li {
  margin-bottom: 8px;
  color: #334155;
}

.faq details {
  border-top: 1px solid var(--line);
  padding: 16px 0;
  transition: all 0.2s ease;
}

.faq details:first-of-type {
  border-top: 0;
}

.faq summary {
  color: var(--blue-900);
  cursor: pointer;
  font-weight: 700;
  font-size: 15px;
  padding: 4px 0;
}

.faq summary:hover {
  color: var(--blue-700);
}

.faq details p {
  margin: 12px 0 0 0;
  color: #475569;
  font-size: 14px;
  line-height: 1.6;
}

.wechat-float {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 1000;
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 10px;
  padding: 10px 18px;
  border: none;
  border-radius: 999px;
  box-shadow: 0 10px 25px -5px rgba(37, 99, 235, 0.4);
  background: linear-gradient(135deg, var(--blue-600), var(--blue-800));
  color: #fff;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.wechat-float:hover {
  transform: translateY(-4px) scale(1.02);
  box-shadow: 0 20px 30px -5px rgba(37, 99, 235, 0.5);
  background: linear-gradient(135deg, var(--blue-700), var(--blue-900));
}

.wechat-float .chat-icon {
  font-size: 20px;
  line-height: 1;
}

.wechat-float .chat-text {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  text-align: left;
}

.wechat-float .chat-text span {
  font-size: 11px;
  opacity: 0.9;
  letter-spacing: 0.5px;
}

.wechat-float .chat-text strong {
  font-size: 14px;
  margin-top: 2px;
  line-height: 1;
}

.wechat-float.copied::after {
  content: "已复制客服微信号";
  position: absolute;
  bottom: calc(100% + 10px);
  left: 50%;
  transform: translateX(-50%);
  border-radius: 8px;
  padding: 6px 12px;
  background: #0f172a;
  color: #fff;
  font-size: 12px;
  white-space: nowrap;
  box-shadow: var(--shadow-md);
  animation: popIn 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes popIn {
  from { opacity: 0; transform: translateX(-50%) translateY(8px); }
  to { opacity: 1; transform: translateX(-50%) translateY(0); }
}

.admin-body {
  background: #f1f5f9;
}

.panel {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 24px;
  background: #fff;
  box-shadow: var(--shadow-sm);
}

.panel h1,
.panel h2,
.panel h3 {
  margin-top: 0;
  color: var(--blue-900);
}

.login-wrap {
  display: grid;
  min-height: calc(100vh - 80px);
  place-items: center;
  padding: 24px;
}

.login-panel {
  display: grid;
  gap: 18px;
  width: min(400px, 100%);
  padding: 32px;
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}

.stat {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 20px;
  background: #fff;
  box-shadow: var(--shadow-sm);
}

.stat span {
  color: var(--muted);
  font-size: 14px;
  font-weight: 550;
}

.stat strong {
  display: block;
  color: var(--blue-900);
  font-size: 32px;
  font-weight: 800;
  margin-top: 4px;
}

.table-wrap {
  width: 100%;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  box-shadow: var(--shadow-sm);
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 800px;
}

th,
td {
  border-bottom: 1px solid var(--line);
  padding: 14px 18px;
  text-align: left;
  vertical-align: middle;
}

th {
  background: #f8fafc;
  color: #475569;
  font-weight: 600;
  font-size: 14px;
  text-transform: uppercase;
}

td strong {
  color: #0f172a;
  font-size: 15px;
}

td small {
  display: block;
  color: var(--muted);
  margin-top: 2px;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.actions form {
  margin: 0;
}

.actions button,
.actions a {
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 6px 12px;
  background: #fff;
  color: var(--blue-800);
  font-size: 13px;
  transition: all 0.2s ease;
}

.actions a:hover,
.actions button:hover {
  background: var(--blue-100);
  border-color: var(--blue-600);
  color: var(--blue-700);
}

.form-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(300px, 0.8fr);
  gap: 20px;
}

.form-grid .panel {
  display: grid;
  gap: 16px;
  align-content: start;
}

.form-grid .panel:nth-child(n+3) {
  grid-column: 1 / -1;
}

.rich-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px;
  background: #f8fafc;
}

.rich-toolbar button {
  min-height: 34px;
  border-radius: 8px;
  padding: 6px 12px;
  font-size: 13px;
  font-weight: 700;
}

.rich-editor {
  min-height: 360px;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 18px;
  background: #fff;
  color: #334155;
  font-size: 16px;
  line-height: 1.85;
  overflow: auto;
}

.rich-editor:focus {
  border-color: var(--blue-600);
  box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.12);
}

.rich-editor:empty::before {
  content: attr(data-placeholder);
  color: var(--muted);
}

.rich-editor h2 {
  margin: 28px 0 12px;
  color: var(--blue-900);
  font-size: 22px;
}

.rich-editor h3 {
  margin: 22px 0 10px;
  color: var(--blue-800);
  font-size: 18px;
}

.rich-editor p {
  margin: 0 0 14px;
}

.rich-editor img,
.rich-editor video {
  max-width: 100%;
}

.home-tabs {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.home-tab {
  min-height: 38px;
  border-color: transparent;
  background: transparent;
  color: var(--muted);
  font-size: 24px;
  font-weight: 800;
  letter-spacing: -0.5px;
  padding: 4px 8px;
}

.home-tab:hover,
.home-tab.active {
  background: var(--blue-100);
  color: var(--blue-900);
}

.home-tab-panel {
  display: none;
}

.home-tab-panel.active {
  display: block;
}

.media-list {
  display: grid;
  gap: 12px;
}

.media-item {
  display: grid;
  grid-template-columns: 130px 1fr auto;
  gap: 12px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px;
  background: #f8fafc;
}

.media-preview {
  overflow: hidden;
  border-radius: 10px;
  background: #e2e8f0;
  aspect-ratio: 16 / 9;
}

.media-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.media-info {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.media-info span,
.media-info code {
  color: var(--muted);
  font-size: 13px;
  word-break: break-all;
}

.media-info code {
  display: inline-flex;
  width: fit-content;
  border-radius: 6px;
  padding: 2px 6px;
  background: #e0f2fe;
  color: var(--blue-800);
}

.media-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.checks {
  display: grid;
  gap: 10px;
}

.check {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 550;
  cursor: pointer;
}

.check input {
  width: auto;
  cursor: pointer;
}

.sticky-actions {
  position: sticky;
  bottom: 0;
  display: flex;
  justify-content: flex-end;
  margin-top: 24px;
  border-top: 1px solid var(--line);
  padding: 16px 0;
  background: rgba(241, 245, 249, 0.9);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.compact-form {
  display: grid;
  gap: 16px;
  max-width: 700px;
  margin-bottom: 24px;
}

.inline-form {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
}

.edit-fields {
  display: flex;
  gap: 10px;
  flex-grow: 1;
}

.edit-fields input {
  flex: 1;
  height: 40px;
  padding: 8px 12px;
}

.edit-buttons {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}

.hot-badge {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 2px 8px;
  background: #dbeafe;
  color: var(--blue-800);
  font-size: 12px;
  font-style: normal;
  font-weight: 700;
}

.compact-btn {
  min-height: 40px !important;
  height: 40px !important;
  padding: 6px 16px !important;
  font-size: 14px !important;
  border-radius: 8px !important;
}

.danger-btn {
  background: var(--danger) !important;
  border-color: var(--danger) !important;
  color: #fff !important;
  font-weight: 500;
}

.danger-btn:hover {
  background: #dc2626 !important;
  border-color: #dc2626 !important;
  color: #fff !important;
}

.error {
  border: 1px solid #fecaca;
  border-radius: 10px;
  padding: 12px 16px;
  background: #fef2f2;
  color: var(--danger);
  font-size: 14px;
}

@media (max-width: 820px) {
  .topbar {
    align-items: flex-start;
    flex-direction: column;
    padding: 16px;
    gap: 12px;
  }
  
  .article-topbar {
    padding: 12px 16px;
  }
  
  .nav-wrapper {
    position: relative;
    width: 100%;
    overflow: hidden;
  }
  
  .nav-wrapper::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 48px;
    height: 100%;
    background: linear-gradient(to right, rgba(255,255,255,0) 0%, rgba(255,255,255,1) 85%);
    pointer-events: none;
  }
  
  nav {
    display: flex;
    align-items: center;
    gap: 8px;
    overflow-x: auto;
    white-space: nowrap;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 4px;
    scrollbar-width: none;
  }
  
  nav::-webkit-scrollbar {
    display: none;
  }
  
  nav a {
    flex: 0 0 auto;
    padding: 8px 14px;
    background: rgba(241, 245, 249, 0.5);
    border: 1px solid rgba(226, 232, 240, 0.8);
    border-radius: 8px;
    font-size: 14px;
  }

  .hero-inner {
    padding: 56px 16px 64px;
  }

  .hero h1,
  .article-page h1 {
    font-size: 32px;
  }

  .section,
  .article-page,
  .admin-shell {
    padding: 32px 16px;
  }

  .section-head,
  .admin-head {
    align-items: stretch;
    flex-direction: column;
    gap: 8px;
  }

  .section-head.tab-head {
    align-items: flex-start;
  }

  .article-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .stat-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .form-grid {
    grid-template-columns: 1fr;
  }

  .form-grid .panel:nth-child(n+3) {
    grid-column: auto;
  }

  .media-item {
    grid-template-columns: 1fr;
  }

  .media-actions {
    justify-content: stretch;
  }

  .media-actions button {
    flex: 1 1 120px;
  }

  .searchbar {
    grid-template-columns: 1fr;
    padding: 0;
    background: none;
    border: none;
  }

  .searchbar button {
    width: 100%;
  }

  .article-page {
    margin-top: 0;
    border-radius: 0;
    border-left: none;
    border-right: none;
    padding: 24px 16px;
  }

  .wechat-float {
    right: 16px;
    bottom: 16px;
    min-width: 0;
    width: 52px;
    height: 52px;
    border-radius: 50%;
    padding: 0;
    justify-content: center;
  }
  
  .wechat-float .chat-text {
    display: none !important;
  }
  
  .wechat-float .chat-icon {
    font-size: 24px;
  }
  
  .wechat-float.copied::after {
    content: "已复制";
    width: 60px;
    left: 50%;
    transform: translateX(-50%);
    bottom: 60px;
  }

  .inline-form {
    display: flex !important;
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 12px !important;
    width: 100% !important;
  }

  .table-wrap {
    border: none;
    box-shadow: none;
    background: transparent;
    width: 100%;
    overflow-x: hidden;
  }

  table, thead, tbody, th, td, tr {
    display: block;
    width: 100%;
  }

  table {
    min-width: 0 !important;
  }

  thead tr {
    position: absolute;
    top: -9999px;
    left: -9999px;
  }

  tr {
    border: 1px solid var(--line);
    border-radius: 16px;
    margin-bottom: 20px;
    padding: 20px;
    background: #fff;
    box-shadow: var(--shadow-sm);
    box-sizing: border-box;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
  }

  tr:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
  }

  td {
    border: none;
    border-bottom: 1px solid #f1f5f9;
    position: relative;
    padding: 12px 0;
    display: flex;
    flex-direction: column; /* 改为纵向叠放，腾出完整宽度 */
    align-items: flex-start; /* 靠左对齐，极大提升小屏的阅读舒适性 */
    gap: 6px;
    box-sizing: border-box;
    width: 100%;
  }

  td:last-child {
    border-bottom: 0;
    padding-bottom: 0;
  }

  td:first-child {
    padding-top: 0;
  }

  /* 卡片小标签样式 */
  td::before {
    content: attr(data-label);
    font-size: 11px;
    font-weight: 700;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 2px;
    flex-shrink: 0;
    display: block;
  }

  /* 强行折行展示，绝不撑出滚动条 */
  td > span,
  td > strong,
  td > a,
  td > small,
  td > div {
    text-align: left;
    display: block;
    width: 100%;
    font-size: 14px;
    line-height: 1.5;
    color: var(--dark);
    word-break: break-all;
    box-sizing: border-box;
  }

  td[data-label="文章"] strong,
  td[data-label="分类"] strong {
    font-size: 16px;
    font-weight: 700;
    color: var(--primary);
    line-height: 1.4;
  }

  td[data-label="文章"] small,
  td[data-label="分类"] small {
    font-size: 12px;
    color: var(--muted);
    margin-top: 2px;
  }

  /* 针对文章管理移动端单行优化 */
  .hide-mobile {
    display: none !important;
  }
  
  .hide-pc {
    display: flex !important;
  }
  
  .art-title-wrap {
    display: flex !important;
    align-items: center;
    gap: 8px;
    margin-bottom: 4px;
    flex-direction: row !important;
  }
  
  .status-dot {
    width: 8px !important;
    height: 8px !important;
    border-radius: 50% !important;
    flex-shrink: 0 !important;
    display: inline-block !important;
  }
  
  .dot-pub { background: var(--green, #10b981); }
  .dot-draft { background: var(--muted, #94a3b8); }

  .col-actions {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    justify-content: space-between !important;
    padding: 12px 0 0 0 !important;
    border-top: 1px solid var(--line) !important;
    border-bottom: none !important;
    margin-top: 12px;
  }
  
  .col-actions::before {
    display: none !important;
  }
  
  .mobile-inline-meta {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    gap: 12px !important;
    width: auto !important;
  }
  
  .mobile-inline-meta span {
    font-size: 13px !important;
    color: var(--muted) !important;
    width: auto !important;
    display: inline !important;
  }
  
  .btn-group {
    display: flex !important;
    flex-direction: row !important;
    gap: 8px !important;
    width: auto !important;
  }
  
  .col-actions .compact-btn {
    margin: 0 !important;
    width: auto !important;
    min-width: 60px !important;
    height: 30px !important;
    padding: 0 10px !important;
    font-size: 13px !important;
    display: flex !important;
    align-items: center;
    justify-content: center;
  }

  /* 针对后台编辑表单行（分类管理） */
  .actions-category {
    align-items: stretch !important;
    gap: 12px !important;
    border-bottom: none;
    width: 100%;
  }

  .actions-category .inline-form {
    display: flex;
    flex-direction: column;
    gap: 12px;
    width: 100%;
    padding: 16px;
    background: #f8fafc;
    border-radius: 12px;
    border: 1px dashed var(--line);
    box-sizing: border-box;
  }

  .actions-category .edit-fields {
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: 100%;
  }

  .actions-category .edit-fields input {
    width: 100% !important;
    box-sizing: border-box;
    height: 40px;
  }

  /* 按钮排布在左下方 */
  .actions-category .edit-buttons {
    display: flex;
    flex-direction: row; /* 水平并列 */
    justify-content: flex-start; /* 靠左对齐 */
    gap: 10px;
    width: 100%;
    margin-top: 4px;
  }

  .actions-category .edit-buttons button {
    width: auto !important; /* 不占满，只占自适应大小 */
    min-width: 90px;
    height: 38px !important;
    font-size: 14px;
    margin: 0;
  }

  /* 管理员管理的操作（删除按钮靠左下方） */
  .actions-admin {
    align-items: flex-start !important;
    border-bottom: none;
    width: 100%;
  }

  .actions-admin form {
    width: auto;
  }

  .actions-admin button {
    width: auto !important;
    min-width: 90px;
    height: 38px !important;
    font-size: 14px;
    margin: 0;
  }

  /* 文章/管理员管理等卡片底部的简单按钮行并排美化 */
  .actions {
    display: flex !important;
    flex-direction: row !important; /* 并排横排显示 */
    flex-wrap: wrap;
    gap: 12px;
    width: 100%;
  }

  .actions > a,
  .actions > button,
  .actions > form {
    flex: 1;
    min-width: 100px;
  }

  .actions > a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #eff6ff !important;
    color: var(--primary) !important;
    font-weight: 600;
    height: 38px !important;
    border-radius: 8px;
    text-decoration: none;
    transition: background 0.2s;
    border: 1px solid #dbeafe !important;
    box-sizing: border-box;
  }

  .actions > a:hover {
    background: #dbeafe !important;
  }

  .actions > button.danger-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #fef2f2 !important;
    color: var(--danger) !important;
    font-weight: 600;
    height: 38px !important;
    border-radius: 8px;
    border: 1px solid #fecaca !important;
    transition: background 0.2s;
    box-sizing: border-box;
    margin: 0;
  }

  .actions > button.danger-btn:hover {
    background: #fecaca !important;
  }

  .actions button {
    height: 38px;
    width: 100% !important;
    border-radius: 8px;
  }
}

@media (max-width: 580px) {
  .article-grid {
    grid-template-columns: 1fr;
  }

  .stat-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 520px) {
  .brand {
    font-size: 20px;
  }

  nav a {
    font-size: 14px;
    padding: 8px 10px;
    flex: 1 1 auto;
    text-align: center;
    white-space: nowrap;
  }

  .hero h1,
  .article-page h1 {
    font-size: 26px;
  }

  .lead {
    font-size: 16px;
    padding: 12px 16px;
  }

  .content-body {
    font-size: 15px;
  }
}

/* 二次确认删除按钮样式 */
.danger-btn.confirming,
.actions > button.danger-btn.confirming {
  background: var(--danger) !important;
  color: #ffffff !important;
  border-color: var(--danger) !important;
  animation: pulse-danger 1.5s infinite;
  box-shadow: 0 0 0 4px rgba(239, 68, 68, 0.2);
}

@keyframes pulse-danger {
  0% {
    opacity: 1;
  }
  50% {
    opacity: 0.75;
  }
  100% {
    opacity: 1;
  }
}

/* 移动端新建文章悬浮按钮 */
.floating-add-btn {
  display: flex;
  position: fixed;
  right: 24px;
  bottom: 24px;
  width: 56px;
  height: 56px;
  background: linear-gradient(135deg, var(--blue-600), var(--blue-800));
  color: white;
  border-radius: 50%;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 24px rgba(37,99,235,0.4);
  z-index: 999;
  transition: transform 0.2s;
}

.floating-add-btn:active {
  transform: scale(0.95);
}

.floating-add-btn svg {
  margin: 0;
  padding: 0;
}

/* PC 端默认隐藏浮动按钮和移动端 meta */
@media (min-width: 769px) {
  .hide-pc {
    display: none !important;
  }
}

/* 过滤栏样式 */
.filter-bar {
  margin-bottom: 20px;
  background: var(--paper);
  padding: 16px;
  border-radius: 12px;
  border: 1px solid var(--line);
  box-shadow: var(--shadow-sm);
}

.filter-form {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
}

.filter-form input,
.filter-form select {
  margin: 0;
  height: 42px;
}

.filter-form input[type="text"] {
  flex: 1;
  min-width: 200px;
}

.filter-form button {
  margin: 0;
  height: 42px;
  padding: 0 20px;
}

/* 分页器样式 */
.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 16px;
  margin-top: 24px;
  margin-bottom: 24px;
}

.pagination .page-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 38px;
  padding: 0 16px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--primary);
  font-weight: 600;
  font-size: 14px;
  text-decoration: none;
  transition: all 0.2s;
  box-shadow: var(--shadow-sm);
}

.pagination .page-btn:hover {
  background: #f8fafc;
  border-color: #cbd5e1;
}

.pagination .page-btn.disabled {
  color: var(--muted);
  background: #f1f5f9;
  border-color: var(--line);
  pointer-events: none;
  box-shadow: none;
}

.pagination .page-info {
  font-size: 14px;
  color: var(--dark);
  font-weight: 600;
}

/* 导航栏分类标签蓝色背景 */
nav a.nav-cat {
  background: #eff6ff;
  color: var(--primary);
  font-weight: 600;
  border-radius: 999px;
  padding: 6px 14px;
  margin-left: 4px;
}

nav a.nav-cat:hover {
  background: #dbeafe;
}

@media (max-width: 520px) {
  nav a.nav-cat {
    padding: 6px 10px;
    font-size: 13px;
  }
}

/* Toast 提示样式 */
.toast-container {
  position: fixed;
  top: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(-20px);
  z-index: 9999;
  pointer-events: none;
  opacity: 0;
  transition: all 0.35s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(16, 185, 129, 0.95); /* 亮翡翠绿 */
  color: #ffffff;
  padding: 12px 24px;
  border-radius: 50px;
  box-shadow: 0 10px 25px -5px rgba(16, 185, 129, 0.4);
  font-weight: 600;
  font-size: 15px;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.toast-container.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.toast-icon {
  font-size: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* Media Modal Styling */
.media-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(15, 23, 42, 0.5);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.media-modal-overlay.show {
  opacity: 1;
  pointer-events: auto;
}

.media-modal {
  background: rgba(255, 255, 255, 0.95);
  border: 1px solid rgba(255, 255, 255, 0.8);
  box-shadow: 0 25px 50px -12px rgba(15, 23, 42, 0.18),
              0 0 0 1px rgba(15, 23, 42, 0.05);
  border-radius: 20px;
  width: min(720px, 92vw);
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  transform: scale(0.95) translateY(10px);
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  overflow: hidden;
}

.media-modal-overlay.show .media-modal {
  transform: scale(1) translateY(0);
}

/* Header */
.media-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid rgba(15, 23, 42, 0.08);
}

.media-modal-title {
  margin: 0;
  font-size: 18px;
  font-weight: 750;
  color: var(--blue-900);
  display: flex;
  align-items: center;
  gap: 8px;
}

.media-modal-close {
  background: transparent;
  border: none;
  font-size: 24px;
  color: var(--muted);
  cursor: pointer;
  line-height: 1;
  padding: 4px;
  transition: all 0.2s ease;
  border-radius: 50%;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.media-modal-close:hover {
  background: rgba(15, 23, 42, 0.06);
  color: var(--blue-900);
}

/* Body / Step 1: Selection Cards */
.media-modal-body {
  padding: 24px;
  overflow-y: auto;
  flex-grow: 1;
  display: flex;
  flex-direction: column;
}

.media-source-select {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
  padding: 10px 0;
}

.media-card-btn {
  background: #fff;
  border: 2px solid rgba(15, 23, 42, 0.06);
  border-radius: 16px;
  padding: 32px 24px;
  text-align: center;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  box-shadow: 0 4px 6px -1px rgba(15, 23, 42, 0.03);
}

.media-card-btn:hover {
  border-color: var(--blue-500);
  transform: translateY(-4px);
  box-shadow: 0 12px 20px -8px rgba(37, 99, 235, 0.15);
}

.media-card-icon {
  font-size: 38px;
  width: 72px;
  height: 72px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.3s ease;
}

.media-card-btn:hover .media-card-icon {
  transform: scale(1.08);
}

.media-card-btn.local .media-card-icon {
  background: linear-gradient(135deg, #eff6ff, #dbeafe);
  color: var(--blue-600);
}

.media-card-btn.server .media-card-icon {
  background: linear-gradient(135deg, #fdf2f8, #fbcfe8);
  color: #db2777;
}

.media-card-title {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
  color: #0f172a;
}

.media-card-desc {
  margin: 0;
  font-size: 13px;
  color: var(--muted);
  line-height: 1.5;
}

/* Step 2: Server Media Library Grid */
.media-library-view {
  display: none;
  flex-direction: column;
  gap: 16px;
  flex-grow: 1;
}

.media-library-view.active {
  display: flex;
}

.media-grid-container {
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 12px;
  background: #f8fafc;
  max-height: 380px;
  overflow-y: auto;
  padding: 16px;
}

.media-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
  gap: 12px;
}

.media-grid-item {
  position: relative;
  border-radius: 10px;
  overflow: hidden;
  background: #fff;
  border: 2px solid transparent;
  box-shadow: 0 2px 4px rgba(15, 23, 42, 0.04);
  aspect-ratio: 1;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.media-grid-item:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 12px rgba(15, 23, 42, 0.08);
  border-color: rgba(37, 99, 235, 0.3);
}

.media-grid-item.selected {
  border-color: var(--blue-600);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.2);
}

.media-grid-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.media-grid-item .video-thumbnail-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: #0f172a;
  color: #94a3b8;
  gap: 6px;
}

.media-grid-item .video-icon {
  font-size: 28px;
}

.media-grid-item .media-name-tooltip {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(15, 23, 42, 0.75);
  backdrop-filter: blur(4px);
  color: #fff;
  font-size: 11px;
  padding: 4px 6px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.media-grid-item .selected-badge {
  position: absolute;
  top: 6px;
  right: 6px;
  background: var(--blue-600);
  color: #fff;
  border-radius: 50%;
  width: 22px;
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: bold;
  opacity: 0;
  transform: scale(0.6);
  transition: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
  box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.media-grid-item.selected .selected-badge {
  opacity: 1;
  transform: scale(1);
}

/* Empty & Loading states */
.media-empty-state, .media-loading-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 20px;
  color: var(--muted);
  gap: 12px;
}

.media-empty-icon {
  font-size: 40px;
}

.media-spinner {
  width: 32px;
  height: 32px;
  border: 3px solid rgba(37, 99, 235, 0.15);
  border-top-color: var(--blue-600);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Footer */
.media-modal-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  padding: 16px 24px;
  background: #f8fafc;
  border-top: 1px solid rgba(15, 23, 42, 0.06);
}

.media-modal-footer button {
  min-height: 40px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 700;
  padding: 8px 18px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.media-btn-secondary {
  background: #fff;
  border: 1px solid var(--line);
  color: #334155;
}

.media-btn-secondary:hover {
  background: #f1f5f9;
  border-color: #cbd5e1;
}

.media-btn-primary {
  background: linear-gradient(135deg, var(--blue-600), var(--blue-800));
  border: none;
  color: #fff;
  box-shadow: 0 4px 6px -1px rgba(37, 99, 235, 0.2);
}

.media-btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 12px -1px rgba(37, 99, 235, 0.35);
}

.media-btn-primary:disabled {
  background: #e2e8f0;
  color: #94a3b8;
  cursor: not-allowed;
  box-shadow: none;
  transform: none;
}

/* 超链接在正文和编辑器中的统一样式 */
.content-body a,
.rich-editor a {
  color: var(--primary, #2563eb);
  text-decoration: underline;
  text-underline-offset: 4px;
  font-weight: 500;
  transition: color 0.2s ease;
}

.content-body a:hover,
.rich-editor a:hover {
  color: var(--blue-800, #1e40af);
}
