:root {
  --ink: #1a1a2e;
  --muted: #62627a;
  --line: #e8e8ee;
  --paper: #ffffff;
  --page: #f5f6fa;
  --navy: #05073b;
  --blue: #2563eb;
  --blue-dark: #1d4ed8;
  --teal: #1d4ed8;
  --red: #b42318;
  --soft-blue: #eff6ff;
  font-family: "PingFang SC", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }
.hidden { display: none !important; }
body { margin: 0; color: var(--ink); background: var(--page); }
a { color: inherit; text-decoration: none; }
button, input, textarea, select { font: inherit; }
button { cursor: pointer; }

.admin-header {
  height: 64px; padding: 0 32px; display: flex; justify-content: space-between; align-items: center;
  background: var(--paper); border-bottom: 1px solid var(--line);
}
.admin-brand { display: inline-flex; align-items: center; gap: 10px; font-size: 15px; }
.admin-brand span { display: grid; place-items: center; width: 30px; height: 30px; color: white; background: var(--blue); font-weight: 800; font-size: 12px; }
.header-actions { display: flex; align-items: center; gap: 18px; }
.quiet-link, .button-quiet { color: var(--muted); font-size: 14px; }
.header-actions form { margin: 0; }

.auth-layout-articles { min-height: calc(100vh - 64px); display: grid; grid-template-columns: minmax(0, 1fr) minmax(350px, 460px); }
.auth-copy { padding: 12vh 10vw; background: var(--navy); color: white; }
.eyebrow { margin: 0 0 10px; color: var(--blue); font-size: 11px; font-weight: 800; letter-spacing: .08em; }
.auth-copy .eyebrow { color: #82b5ff; }
.auth-copy h1 { max-width: 560px; margin: 0 0 20px; font-size: 46px; line-height: 1.17; letter-spacing: 0; }
.auth-copy > p:last-child { max-width: 510px; margin: 0; color: #c5d2e6; font-size: 17px; line-height: 1.8; }
.auth-panel { align-self: center; margin: 44px; padding: 38px; background: white; border: 1px solid var(--line); }
.auth-panel h2 { margin: 0 0 28px; font-size: 24px; }
.stack-form, .stack-form label { display: grid; gap: 8px; }
.stack-form { gap: 20px; }
.stack-form label, .article-settings label { color: #34445e; font-size: 13px; font-weight: 700; }
input, textarea, select { width: 100%; border: 1px solid #cbd5e1; border-radius: 4px; background: white; color: var(--ink); outline: none; }
input, select { height: 42px; padding: 0 12px; }
textarea { padding: 10px 12px; resize: vertical; line-height: 1.55; }
input:focus, textarea:focus, select:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(37, 99, 235, .12); }
.field-help { margin: -8px 0 0; color: var(--muted); font-size: 12px; line-height: 1.5; }
.form-error { margin: 0 0 18px; padding: 10px 12px; color: var(--red); background: #fff1f0; border: 1px solid #fecdca; font-size: 14px; line-height: 1.5; }

.button { min-height: 40px; display: inline-flex; align-items: center; justify-content: center; padding: 0 15px; border: 1px solid transparent; border-radius: 4px; font-weight: 700; font-size: 14px; }
.button-primary { color: white; background: var(--blue); }
.button-primary:hover { background: var(--blue-dark); }
.button-secondary { color: var(--ink); background: white; border-color: #cbd5e1; }
.button-secondary:hover { background: #f8fafc; }
.button-quiet { min-height: auto; padding: 4px 0; border: 0; background: transparent; }
.button-wide { width: 100%; margin-top: 12px; }

.admin-shell { min-height: calc(100vh - 64px); display: grid; grid-template-columns: 274px minmax(0, 1fr); }
.article-sidebar { background: #f8fafc; border-right: 1px solid var(--line); padding: 22px 14px; }
.new-article-link { display: block; margin-bottom: 28px; padding: 11px 12px; background: var(--blue); color: white; border-radius: 4px; font-size: 14px; font-weight: 750; }
.new-article-link:hover { background: var(--blue-dark); }
.sidebar-label { padding: 0 10px 10px; color: var(--muted); font-size: 11px; font-weight: 800; letter-spacing: .08em; }
.article-list { display: grid; gap: 4px; }
.article-list-item { display: grid; gap: 5px; padding: 11px 10px; border-radius: 4px; border-left: 3px solid transparent; }
.article-list-item:hover { background: #eef3f8; }
.article-list-item.active { border-left-color: var(--blue); background: #eaf2ff; }
.article-list-item strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; }
.article-list-item small { color: var(--muted); font-size: 11px; }
.article-status { width: fit-content; padding: 2px 5px; border-radius: 3px; color: #6b4b00; background: #fff4ce; font-size: 10px; font-weight: 700; }
.article-status.published { color: #075e54; background: #d7f5ef; }
.empty-list { padding: 8px 10px; color: var(--muted); font-size: 13px; }

.editor-pane { max-width: 1480px; width: 100%; margin: 0 auto; padding: 38px 48px; }
.editor-heading { display: flex; justify-content: space-between; align-items: flex-start; gap: 20px; margin-bottom: 26px; }
.editor-heading h1 { margin: 0; font-size: 28px; letter-spacing: 0; }
.notice { padding: 7px 10px; color: #065f46; background: #d1fae5; border-radius: 4px; font-size: 13px; font-weight: 700; }
.editor-grid { display: grid; grid-template-columns: minmax(0, 1fr) 275px; align-items: start; gap: 30px; }
.writing-column { min-width: 0; background: white; border: 1px solid var(--line); }
.title-field input { height: auto; border: 0; border-bottom: 1px solid var(--line); border-radius: 0; padding: 24px 28px 16px; font-size: 30px; font-weight: 750; box-shadow: none; }
.title-field input:focus { box-shadow: none; }
.summary-field { display: grid; gap: 8px; padding: 18px 28px; border-bottom: 1px solid var(--line); color: var(--muted); font-size: 12px; font-weight: 700; }
.summary-field textarea { min-height: 62px; background: #fafcff; }
.editor-toolbar { display: flex; flex-wrap: wrap; gap: 4px; padding: 10px 20px; border-bottom: 1px solid var(--line); background: #fbfcfd; }
.toolbar-select-label { display: inline-flex; align-items: center; }
.toolbar-select-label select { width: auto; min-width: 76px; height: 31px; padding: 0 24px 0 8px; border-color: #cbd5e1; border-radius: 3px; color: #40526e; background: white; font-size: 12px; }
.toolbar-select-label + .toolbar-select-label select { min-width: 58px; }
.editor-toolbar button { min-width: 35px; height: 31px; padding: 0 8px; border: 1px solid transparent; border-radius: 3px; color: #40526e; background: transparent; font-size: 12px; }
.editor-toolbar button:hover, .editor-toolbar button:focus { border-color: #cbd5e1; background: white; }
.editor-toolbar button.is-active { border-color: #94a3b8; color: #0f172a; background: #e2e8f0; box-shadow: inset 0 1px 3px rgba(15, 23, 42, .22); }
.editor-toolbar button:disabled { opacity: .6; cursor: wait; }
.toolbar-divider { width: 1px; height: 22px; align-self: center; margin: 0 3px; background: var(--line); }
.toolbar-color { position: relative; display: inline-grid; width: 31px; height: 31px; place-items: center; border: 1px solid transparent; border-radius: 3px; color: #263650; background: transparent; cursor: pointer; }
.toolbar-color:hover, .toolbar-color:focus-within { border-color: #cbd5e1; background: white; }
.toolbar-color-label { position: relative; z-index: 1; font-size: 14px; font-weight: 800; line-height: 1; pointer-events: none; }
.toolbar-highlight-label { text-decoration: underline 4px #fff2a8; }
.toolbar-color input { position: absolute; inset: 0; width: 100%; height: 100%; padding: 0; border: 0; opacity: 0; cursor: pointer; }
.editor-statusbar { display: flex; justify-content: space-between; padding: 6px 20px; border-bottom: 1px solid var(--line); color: #8090a6; background: #fff; font-size: 11px; }
.article-editor { min-height: 500px; padding: 30px 28px 44px; outline: none; color: #263650; font-family: "Microsoft YaHei", "PingFang SC", "Helvetica Neue", Arial, sans-serif; font-size: 16px; line-height: 1.9; }
.article-editor:empty::before { content: attr(data-placeholder); color: #94a3b8; pointer-events: none; }
.article-editor h2 { margin: 34px 0 12px; color: var(--ink); font-size: 24px; line-height: 1.35; }
.article-editor h3 { margin: 26px 0 8px; color: var(--ink); font-size: 19px; }
.article-editor p { margin: 0 0 18px; }
.article-editor ul, .article-editor ol { margin: 0 0 18px; padding-left: 26px; }
.article-editor blockquote { margin: 20px 0; padding: 6px 18px; border-left: 3px solid var(--blue); color: #50627d; background: var(--soft-blue); }
.article-editor img { display: block; max-width: 100%; height: auto; margin: 22px 0; border-radius: 3px; }
.article-editor a { color: var(--blue); text-decoration: underline; }
.article-editor table, .article-content table { width: 100%; margin: 24px 0; border-collapse: collapse; table-layout: auto; font-size: .95em; line-height: 1.65; }
.article-editor th, .article-editor td, .article-content th, .article-content td { min-width: 72px; padding: 9px 12px; border: 1px solid var(--line, #d8dee8); text-align: left; vertical-align: top; }
.article-editor th, .article-content th { color: var(--text-primary, var(--ink)); background: rgba(37, 99, 235, .07); font-weight: 700; }
.article-editor caption, .article-content caption { margin-bottom: 8px; color: var(--text-muted, var(--muted)); font-size: .9em; text-align: left; }

.article-settings { display: grid; gap: 16px; }
.setting-group { padding: 18px; background: white; border: 1px solid var(--line); }
.setting-group h2 { margin: 0 0 16px; font-size: 15px; }
.setting-group label { display: grid; gap: 7px; margin-top: 14px; }
.setting-group h2 + label { margin-top: 0; }
.checkbox-label { display: flex !important; align-items: center; gap: 8px !important; font-weight: 500 !important; }
.checkbox-label input { width: auto; height: auto; }
.upload-control { padding: 12px; border: 1px dashed #94a3b8; background: #fbfdff; }
.upload-control input { height: auto; padding: 0; border: 0; font-size: 12px; }
.upload-control small { color: var(--muted); font-size: 11px; line-height: 1.4; }
.cover-preview { width: 100%; max-height: 165px; object-fit: cover; margin-bottom: 12px; border-radius: 3px; }
.delete-form { margin-top: 24px; text-align: right; }
.delete-form button { padding: 0; border: 0; color: var(--red); background: none; font-size: 13px; }

.public-body { color: var(--text-body, var(--muted)); background: var(--page-bg, var(--page)); }
.article-page-hero { position: relative; isolation: isolate; display: flex; align-items: center; min-height: 440px; background-color: var(--navy); background-position: center; background-size: cover; }
.article-page-hero::after { content: ""; position: absolute; inset: 0; z-index: -1; background: rgba(5, 7, 59, .78); }
.article-page-hero-shell { padding-top: 48px; padding-bottom: 48px; color: white; }
.article-page-hero h1 { max-width: 700px; margin: 14px 0; color: white; font-size: clamp(38px, 5vw, 56px); line-height: 1.18; letter-spacing: 0; }
.article-page-hero p { max-width: 620px; margin: 0; color: var(--text-light, rgba(255,255,255,.72)); font-size: 17px; line-height: 1.8; }
.articles-section { min-height: 420px; }
.articles-heading { margin-bottom: 40px; text-align: left; }
.articles-heading .section-sub { margin-left: 0; }
.article-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; }
.public-article-card { display: flex; min-width: 0; flex-direction: column; overflow: hidden; border: 1px solid var(--border, var(--line)); border-radius: var(--radius, 10px); background: white; box-shadow: var(--shadow-card, 0 2px 12px rgba(0,0,0,.06)); transition: transform var(--ease, 280ms ease), box-shadow var(--ease, 280ms ease); }
.public-article-card:hover { transform: translateY(-5px); box-shadow: var(--shadow-card-hover, 0 8px 30px rgba(0,0,0,.12)); }
.public-card-cover, .public-card-placeholder { width: 100%; height: 196px; object-fit: cover; background: #dbeafe; }
.public-card-placeholder { position: relative; background-image: url('/images/02-homepage-ai-concept.webp'); background-size: cover; background-position: center; }
.public-card-placeholder::after { content: ""; position: absolute; inset: 0; background: rgba(5, 7, 59, .58); }
.public-card-content { display: grid; flex: 1; gap: 10px; padding: 22px; }
.public-card-meta { color: var(--gold, var(--blue)); font-size: 12px; font-weight: 700; }
.public-card-content h2 { margin: 0; color: var(--text-primary, var(--ink)); font-size: 20px; line-height: 1.45; }
.public-card-content p { display: -webkit-box; overflow: hidden; margin: 0; color: var(--text-body, var(--muted)); font-size: 14px; line-height: 1.7; -webkit-box-orient: vertical; -webkit-line-clamp: 3; }
.tag-row { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 2px; }
.tag { padding: 3px 7px; border-radius: 3px; color: var(--gold-dark, var(--blue-dark)); background: rgba(37, 99, 235, .1); font-size: 11px; font-weight: 700; }
.article-card-link { align-self: end; margin-top: 6px; color: var(--gold, var(--blue)); font-size: 13px; font-weight: 700; }
.public-empty { padding: 70px 20px; text-align: center; background: white; border: 1px solid var(--border, var(--line)); border-radius: var(--radius, 10px); box-shadow: var(--shadow-card, 0 2px 12px rgba(0,0,0,.06)); }
.public-empty h2 { margin: 0 0 8px; color: var(--text-primary, var(--ink)); font-size: 24px; }
.public-empty p { margin: 0; color: var(--text-muted, var(--muted)); }
.article-loading { min-height: 180px; padding-top: 55px; box-shadow: none; }
.content-notice { max-width: 760px; margin: 0 0 28px; padding: 13px 16px; border-left: 3px solid var(--blue); color: #38506e; background: var(--soft-blue); font-size: 14px; line-height: 1.65; }
.article-detail-notice { max-width: 812px; margin: -48px auto 42px; }
.article-detail { max-width: 860px; margin: 0 auto; padding: 58px 24px 88px; }
.back-link { display: inline-block; margin-bottom: 32px; color: var(--text-muted, var(--muted)); font-size: 14px; font-weight: 700; }
.back-link:hover { color: var(--gold, var(--blue)); }
.article-detail-header { text-align: center; }
.article-detail-header .section-label { margin-bottom: 14px; }
.article-detail-header h1 { max-width: 760px; margin: 0 auto 18px; color: var(--text-primary, var(--ink)); font-size: clamp(32px, 4vw, 46px); line-height: 1.3; letter-spacing: 0; }
.article-detail-summary { max-width: 680px; margin: 0 auto 20px; color: var(--text-body, var(--muted)); font-size: 17px; line-height: 1.8; }
.article-detail-tags { justify-content: center; }
.article-detail-cover { width: 100%; max-height: 510px; object-fit: cover; margin: 38px 0 46px; border-radius: var(--radius, 10px); box-shadow: var(--shadow-card, 0 2px 12px rgba(0,0,0,.06)); }
.article-content { color: var(--text-body, var(--muted)); font-family: "Microsoft YaHei", "PingFang SC", "Helvetica Neue", Arial, sans-serif; font-size: 16px; line-height: 1.95; }
.article-content h2 { margin: 46px 0 16px; color: var(--text-primary, var(--ink)); font-size: 27px; line-height: 1.4; }
.article-content h3 { margin: 34px 0 12px; color: var(--text-primary, var(--ink)); font-size: 21px; }
.article-content p { margin: 0 0 22px; }
.article-content ul, .article-content ol { margin: 0 0 22px; padding-left: 28px; }
.article-content blockquote { margin: 30px 0; padding: 16px 20px; border-left: 3px solid var(--gold, var(--blue)); color: var(--text-body, var(--muted)); background: rgba(37, 99, 235, .07); }
.article-content img { display: block; max-width: 100%; height: auto; margin: 30px auto; border-radius: var(--radius-sm, 6px); }
.article-content a { color: var(--gold, var(--blue)); text-decoration: underline; }
.not-found { max-width: 620px; margin: 100px auto; padding: 0 24px; text-align: center; }
.not-found h1 { margin: 0 0 12px; color: var(--text-primary, var(--ink)); font-size: 30px; }
.not-found p { margin-bottom: 24px; color: var(--text-muted, var(--muted)); }

@media (max-width: 900px) {
  .admin-header { padding: 0 18px; }
  .auth-layout-articles { grid-template-columns: 1fr; }
  .auth-copy { min-height: 300px; padding: 64px 10vw; }
  .auth-copy h1 { font-size: 36px; }
  .auth-panel { margin: 26px auto; width: min(460px, calc(100% - 36px)); }
  .admin-shell { grid-template-columns: 1fr; }
  .article-sidebar { border-right: 0; border-bottom: 1px solid var(--line); }
  .article-list { display: flex; overflow-x: auto; }
  .article-list-item { min-width: 200px; }
  .editor-pane { padding: 28px 20px; }
  .editor-grid { grid-template-columns: 1fr; }
  .article-settings { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .article-settings .button-wide { grid-column: span 2; }
  .article-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 600px) {
  .admin-brand strong { display: none; }
  .header-actions { gap: 10px; }
  .auth-copy { min-height: 245px; padding: 46px 24px; }
  .auth-copy h1 { font-size: 31px; }
  .auth-copy > p:last-child { font-size: 15px; }
  .auth-panel { margin: 18px; width: auto; padding: 25px; }
  .editor-pane { padding: 22px 14px; }
  .editor-heading h1 { font-size: 24px; }
  .title-field input { padding: 20px 18px 14px; font-size: 25px; }
  .summary-field, .article-editor { padding-left: 18px; padding-right: 18px; }
  .article-settings { grid-template-columns: 1fr; }
  .article-settings .button-wide { grid-column: auto; }
  .public-header { padding: 0 22px; }
  .public-nav { gap: 12px; }
  .article-hero { padding: 52px 24px 40px; }
  .article-hero h1 { font-size: 33px; }
  .article-index, .article-detail { padding-left: 22px; padding-right: 22px; }
  .article-grid { grid-template-columns: 1fr; }
  .article-detail { padding-top: 36px; }
  .article-detail-header h1 { font-size: 31px; }
  .article-page-hero { min-height: 360px; }
  .article-page-hero-shell { padding-top: 38px; padding-bottom: 38px; }
  .article-page-hero h1 { font-size: 37px; }
  .article-page-hero p { font-size: 15px; }
  .articles-heading { margin-bottom: 28px; }
  .article-grid { grid-template-columns: 1fr; gap: 18px; }
  .public-card-cover, .public-card-placeholder { height: 180px; }
  .article-detail { padding-top: 36px; padding-bottom: 58px; }
  .article-detail-cover { margin: 28px 0 34px; }
}
