/* =========================================================
   《翠屏新闻》稿件编排管理
   桌面端网站样式
   ========================================================= */

/* ---------------------------------------------------------
   全局基础设置
   --------------------------------------------------------- */

* {
  box-sizing: border-box;
}

:root {
  --primary: #155eef;
  --primary-dark: #004eeb;
  --primary-light: #eff4ff;

  --success: #079455;
  --success-dark: #067647;

  --danger: #d92d20;
  --danger-dark: #b42318;

  --warning: #dc6803;
  --warning-dark: #b54708;

  --text: #101828;
  --text-secondary: #344054;
  --muted: #667085;
  --light-muted: #98a2b3;

  --border: #d0d5dd;
  --light-border: #e4e7ec;

  --background: #f2f4f7;
  --white: #ffffff;
}

html,
body {
  min-height: 100%;
}

body {
  margin: 0;
  min-width: 1100px;
  color: var(--text);
  background: var(--background);
  font-family:
    "Microsoft YaHei",
    "微软雅黑",
    Arial,
    Helvetica,
    sans-serif;
  font-size: 14px;
}

button,
input,
textarea,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.hidden {
  display: none !important;
}

.required-mark {
  color: var(--danger);
}

.field-help {
  margin-top: 6px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

/* ---------------------------------------------------------
   登录页面
   --------------------------------------------------------- */

.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px;
  background:
    linear-gradient(
      135deg,
      rgba(0, 55, 107, 0.97),
      rgba(21, 94, 239, 0.86)
    ),
    #0b4a87;
}

.login-card {
  width: 440px;
  padding: 40px 43px 36px;
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 15px;
  background: var(--white);
  box-shadow: 0 28px 75px rgba(0, 0, 0, 0.3);
}

.login-logo {
  margin-bottom: 30px;
  text-align: center;
}

.login-logo h1 {
  margin: 0 0 5px;
  color: #123b66;
  font-size: 29px;
  letter-spacing: 1px;
}

.login-logo h2 {
  margin: 0 0 12px;
  color: #123b66;
  font-size: 22px;
  font-weight: 700;
}

.login-logo p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}

.login-button {
  width: 100%;
  height: 46px;
  margin-top: 4px;
  border: 0;
  border-radius: 8px;
  color: var(--white);
  background: var(--primary);
  font-size: 16px;
  font-weight: 700;
  transition:
    background 0.15s ease,
    transform 0.15s ease;
}

.login-button:hover:not(:disabled) {
  background: var(--primary-dark);
}

.login-button:active:not(:disabled) {
  transform: translateY(1px);
}

.login-error {
  min-height: 23px;
  margin-top: 13px;
  color: var(--danger);
  text-align: center;
  line-height: 1.55;
}

/* ---------------------------------------------------------
   表单通用样式
   --------------------------------------------------------- */

.form-group {
  margin-bottom: 18px;
}

.form-group > label {
  display: block;
  margin-bottom: 7px;
  color: var(--text-secondary);
  font-weight: 700;
}

.form-control {
  width: 100%;
  height: 42px;
  padding: 8px 11px;
  border: 1px solid var(--border);
  border-radius: 7px;
  outline: none;
  color: var(--text);
  background: var(--white);
  font-size: 14px;
  transition:
    border-color 0.15s ease,
    box-shadow 0.15s ease;
}

.form-control:hover {
  border-color: #98a2b3;
}

.form-control:focus {
  border-color: #84adff;
  box-shadow: 0 0 0 3px rgba(21, 94, 239, 0.12);
}

.form-control::placeholder {
  color: #98a2b3;
}

textarea.form-control {
  height: auto;
  min-height: 110px;
  line-height: 1.65;
  resize: vertical;
}

.form-row {
  display: flex;
  gap: 17px;
}

.form-row .form-group {
  flex: 1;
  min-width: 0;
}

.checkbox-row {
  min-height: 42px;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 5px 0;
}

.checkbox-row input[type="checkbox"] {
  width: 18px;
  height: 18px;
  margin: 0;
  accent-color: var(--primary);
}

.checkbox-row label {
  color: var(--text-secondary);
  cursor: pointer;
}

/* ---------------------------------------------------------
   顶部标题栏
   --------------------------------------------------------- */

.topbar {
  min-height: 74px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 25px;
  padding: 10px 32px;
  color: var(--white);
  background: linear-gradient(90deg, #123b66, #155eef);
  box-shadow: 0 2px 12px rgba(16, 24, 40, 0.18);
}

.topbar-title {
  min-width: 300px;
}

.topbar-title h1 {
  margin: 0 0 5px;
  font-size: 23px;
  line-height: 1.25;
}

.topbar-title span {
  color: rgba(255, 255, 255, 0.78);
  font-size: 12px;
}

.topbar-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

/* ---------------------------------------------------------
   各类按钮
   --------------------------------------------------------- */

.button {
  min-height: 38px;
  padding: 8px 15px;
  border: 1px solid transparent;
  border-radius: 7px;
  font-size: 14px;
  font-weight: 700;
  white-space: nowrap;
  transition:
    background 0.15s ease,
    border-color 0.15s ease,
    color 0.15s ease,
    transform 0.15s ease;
}

.button:active:not(:disabled) {
  transform: translateY(1px);
}

.button-primary {
  color: var(--white);
  background: var(--primary);
}

.button-primary:hover:not(:disabled) {
  background: var(--primary-dark);
}

.button-success {
  color: var(--white);
  background: var(--success);
}

.button-success:hover:not(:disabled) {
  background: var(--success-dark);
}

.button-warning {
  color: var(--white);
  background: var(--warning);
}

.button-warning:hover:not(:disabled) {
  background: var(--warning-dark);
}

.button-danger {
  color: var(--white);
  background: var(--danger);
}

.button-danger:hover:not(:disabled) {
  background: var(--danger-dark);
}

.button-white {
  color: var(--text-secondary);
  border-color: var(--border);
  background: var(--white);
}

.button-white:hover:not(:disabled) {
  border-color: #98a2b3;
  background: #f9fafb;
}

.button-top {
  color: var(--white);
  border-color: rgba(255, 255, 255, 0.35);
  background: rgba(255, 255, 255, 0.12);
}

.button-top:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.23);
}

/* ---------------------------------------------------------
   主内容区域及工具栏
   --------------------------------------------------------- */

.main-container {
  width: calc(100% - 52px);
  max-width: 1750px;
  margin: 24px auto 50px;
}

.toolbar {
  min-height: 70px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 19px;
  padding: 15px 17px;
  border: 1px solid var(--light-border);
  border-radius: 10px;
  background: var(--white);
  box-shadow: 0 2px 9px rgba(16, 24, 40, 0.05);
}

.toolbar-left,
.toolbar-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.search-input {
  width: 310px;
  height: 38px;
}

.overall-summary {
  color: var(--muted);
  font-weight: 700;
  white-space: nowrap;
}

.overall-summary strong {
  color: var(--primary);
  font-size: 18px;
}

/* ---------------------------------------------------------
   新闻日期区块
   --------------------------------------------------------- */

.news-section {
  overflow: hidden;
  margin-bottom: 22px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--white);
  box-shadow: 0 3px 11px rgba(16, 24, 40, 0.065);
}

.section-header {
  min-height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 11px 18px;
  color: var(--white);
  background: linear-gradient(90deg, #184f82, #2878c7);
}

.section-header.unscheduled {
  background: linear-gradient(90deg, #344054, #667085);
}

.section-title {
  min-width: 260px;
  display: flex;
  align-items: baseline;
  gap: 13px;
}

.section-title h2 {
  margin: 0;
  font-size: 19px;
}

.weekday {
  color: rgba(255, 255, 255, 0.78);
  font-size: 13px;
}

.section-meta {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}

.stat-badge {
  min-width: 112px;
  display: inline-flex;
  align-items: baseline;
  justify-content: center;
  gap: 4px;
  padding: 7px 12px;
  border: 1px solid rgba(255, 255, 255, 0.23);
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.15);
  white-space: nowrap;
}

.stat-badge strong {
  font-size: 21px;
  line-height: 1;
}

.copy-button {
  margin-left: 5px;
  padding: 9px 14px;
  border: 0;
  border-radius: 7px;
  color: #16436d;
  background: var(--white);
  font-weight: 700;
  white-space: nowrap;
}

.copy-button:hover:not(:disabled) {
  background: #eff8ff;
}

/* ---------------------------------------------------------
   新闻表格
   --------------------------------------------------------- */

table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}

th {
  padding: 11px 10px;
  border-bottom: 1px solid var(--light-border);
  color: #475467;
  background: #f9fafb;
  text-align: left;
  font-size: 13px;
  font-weight: 700;
}

td {
  padding: 11px 10px;
  border-bottom: 1px solid #eaecf0;
  vertical-align: middle;
  overflow-wrap: anywhere;
}

tbody tr:last-child td {
  border-bottom: 0;
}

tbody tr {
  transition: background 0.12s ease;
}

tbody tr:hover {
  background: #f8fbff;
}

tbody tr.priority-row {
  background: #fffaeb;
}

tbody tr.priority-row:hover {
  background: #fff4cc;
}

.col-sort {
  width: 88px;
  text-align: center;
}

.col-word-count {
  width: 105px;
  text-align: right;
}

.col-reporter {
  width: 190px;
}

.col-priority {
  width: 105px;
  text-align: center;
}

.col-date {
  width: 140px;
  text-align: center;
}

.col-actions {
  width: 150px;
  text-align: center;
}

.news-title-link {
  display: inline;
  padding: 0;
  border: 0;
  color: #175cd3;
  background: transparent;
  text-align: left;
  line-height: 1.65;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
}

.news-title-link:hover {
  color: var(--primary-dark);
  text-decoration: underline;
}

.news-title-no-text {
  color: var(--text-secondary);
  line-height: 1.65;
  font-weight: 700;
}

.priority-label {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 999px;
  color: var(--danger-dark);
  background: #fee4e2;
  font-size: 12px;
  font-weight: 700;
}

.normal-label {
  color: var(--light-muted);
}

.sort-buttons {
  display: flex;
  justify-content: center;
  gap: 5px;
}

.arrow-button {
  width: 31px;
  height: 31px;
  padding: 0;
  border: 1px solid #b2ccff;
  border-radius: 6px;
  color: #175cd3;
  background: var(--primary-light);
  font-size: 17px;
  font-weight: 700;
  line-height: 1;
}

.arrow-button:hover:not(:disabled) {
  color: var(--white);
  border-color: var(--primary);
  background: var(--primary);
}

.small-action {
  padding: 5px 8px;
  border: 0;
  background: transparent;
  font-weight: 700;
}

.edit-action {
  color: #175cd3;
}

.edit-action:hover {
  color: var(--primary-dark);
  text-decoration: underline;
}

.delete-action {
  color: var(--danger);
}

.delete-action:hover {
  color: var(--danger-dark);
  text-decoration: underline;
}

.empty-row {
  padding: 38px 20px;
  color: var(--light-muted);
  text-align: center;
}

/* ---------------------------------------------------------
   弹窗基础结构
   --------------------------------------------------------- */

.modal-overlay {
  position: fixed;
  z-index: 1000;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 30px;
  background: rgba(16, 24, 40, 0.64);
}

.modal {
  width: 700px;
  max-width: calc(100vw - 60px);
  max-height: calc(100vh - 60px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border-radius: 12px;
  background: var(--white);
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.34);
}

.item-modal {
  width: 730px;
}

.modal-large {
  width: 1220px;
}

.modal-original {
  width: 1020px;
}

.confirm-modal {
  width: 560px;
}

.modal-header {
  min-height: 66px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 16px 21px;
  border-bottom: 1px solid var(--light-border);
}

.modal-header h2 {
  margin: 0;
  color: #1d2939;
  font-size: 19px;
}

.modal-subtitle {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.close-modal {
  width: 35px;
  height: 35px;
  flex: 0 0 auto;
  padding: 0;
  border: 0;
  border-radius: 6px;
  color: var(--muted);
  background: var(--background);
  font-size: 24px;
  line-height: 1;
}

.close-modal:hover {
  color: var(--text-secondary);
  background: #e4e7ec;
}

.modal-body {
  overflow: auto;
  padding: 21px;
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 14px 21px;
  border-top: 1px solid var(--light-border);
  background: #f9fafb;
}

/* ---------------------------------------------------------
   新增和编辑稿件
   --------------------------------------------------------- */

.original-text-area {
  min-height: 205px !important;
  white-space: pre-wrap;
}

.recount-box {
  min-height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-top: -6px;
  padding: 10px 12px;
  border-radius: 7px;
  color: #475467;
  background: var(--background);
}

/* ---------------------------------------------------------
   智能导入
   --------------------------------------------------------- */

.import-rule-tip {
  margin-bottom: 16px;
  padding: 11px 14px;
  border: 1px solid #b2ccff;
  border-radius: 7px;
  color: #1849a9;
  background: var(--primary-light);
  line-height: 1.65;
}

.import-rule-tip code {
  padding: 2px 5px;
  border-radius: 4px;
  color: #1849a9;
  background: #dbe8ff;
  font-family: inherit;
  font-weight: 700;
}

.import-textarea {
  min-height: 290px !important;
  font-family:
    "Microsoft YaHei",
    "微软雅黑",
    sans-serif;
  line-height: 1.7;
}

.import-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 14px 0;
}

.recognition-summary {
  color: var(--text-secondary);
  font-weight: 700;
}

.warning-box {
  margin: 12px 0;
  padding: 11px 13px;
  border: 1px solid #fedf89;
  border-radius: 7px;
  color: #93370d;
  background: #fffaeb;
  line-height: 1.65;
}

.warning-box ul {
  margin: 7px 0 0;
  padding-left: 22px;
}

.warning-box li + li {
  margin-top: 5px;
}

.preview-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
  margin: 17px 0 9px;
}

.preview-heading h3 {
  margin: 0;
  color: var(--text-secondary);
  font-size: 16px;
}

.preview-heading span {
  color: var(--muted);
  font-size: 12px;
}

.preview-wrapper {
  max-height: 390px;
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: 8px;
}

.preview-table {
  min-width: 1070px;
}

.preview-table th {
  position: sticky;
  z-index: 1;
  top: 0;
}

.preview-table input {
  width: 100%;
  height: 35px;
  padding: 5px 7px;
  border: 1px solid var(--border);
  border-radius: 5px;
  outline: none;
}

.preview-table input:focus {
  border-color: #84adff;
  box-shadow: 0 0 0 2px rgba(21, 94, 239, 0.1);
}

.preview-number-column {
  width: 58px;
  text-align: center;
}

.preview-word-column {
  width: 105px;
}

.preview-reporter-column {
  width: 210px;
}

.preview-remove-column {
  width: 80px;
  text-align: center;
}

.preview-remove {
  padding: 5px 8px;
  border: 0;
  color: var(--danger);
  background: transparent;
  font-weight: 700;
}

.preview-remove:hover {
  color: var(--danger-dark);
  text-decoration: underline;
}

.preview-empty {
  padding: 28px;
  color: var(--light-muted);
  text-align: center;
}

/* ---------------------------------------------------------
   稿件原文弹窗
   --------------------------------------------------------- */

.original-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px 20px;
  margin-bottom: 14px;
  padding: 11px 14px;
  border-radius: 7px;
  color: #475467;
  background: var(--background);
}

.original-meta strong {
  color: var(--text-secondary);
}

.original-display {
  min-height: 300px;
  max-height: 62vh;
  overflow: auto;
  margin: 0;
  padding: 18px;
  border: 1px solid var(--border);
  border-radius: 8px;
  color: #1d2939;
  background: #fcfcfd;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font-family:
    "Microsoft YaHei",
    "微软雅黑",
    sans-serif;
  font-size: 15px;
  line-height: 1.85;
}

/* ---------------------------------------------------------
   删除确认
   --------------------------------------------------------- */

.delete-warning-icon {
  width: 54px;
  height: 54px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 2px auto 14px;
  border-radius: 50%;
  color: var(--danger);
  background: #fee4e2;
  font-size: 29px;
  font-weight: 800;
}

.delete-warning-text {
  margin: 0 0 13px;
  color: var(--text-secondary);
  text-align: center;
  font-size: 16px;
  font-weight: 700;
}

.delete-item-title {
  padding: 12px 14px;
  border: 1px solid var(--light-border);
  border-radius: 7px;
  color: var(--text-secondary);
  background: #f9fafb;
  text-align: center;
  line-height: 1.65;
  font-weight: 700;
}

.delete-warning-detail {
  margin: 12px 0 0;
  color: var(--danger);
  text-align: center;
  font-size: 12px;
}

/* ---------------------------------------------------------
   顶部消息提示
   --------------------------------------------------------- */

.toast {
  position: fixed;
  z-index: 2000;
  top: 22px;
  left: 50%;
  min-width: 290px;
  max-width: 700px;
  transform: translateX(-50%);
  padding: 13px 20px;
  border-radius: 8px;
  color: var(--white);
  text-align: center;
  line-height: 1.55;
  box-shadow: 0 10px 35px rgba(16, 24, 40, 0.27);
  font-weight: 700;
}

.toast-success {
  background: var(--success);
}

.toast-error {
  background: var(--danger);
}

.toast-warning {
  background: var(--warning);
}

/* ---------------------------------------------------------
   全屏加载提示
   --------------------------------------------------------- */

.loading-mask {
  position: fixed;
  z-index: 3000;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(16, 24, 40, 0.57);
}

.loading-card {
  min-width: 250px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 13px;
  padding: 18px 23px;
  border-radius: 10px;
  color: var(--white);
  background: rgba(16, 24, 40, 0.92);
  box-shadow: 0 18px 55px rgba(0, 0, 0, 0.28);
  font-size: 15px;
  font-weight: 700;
}

.loading-spinner {
  width: 23px;
  height: 23px;
  border: 3px solid rgba(255, 255, 255, 0.28);
  border-top-color: var(--white);
  border-radius: 50%;
  animation: loading-rotate 0.75s linear infinite;
}

@keyframes loading-rotate {
  to {
    transform: rotate(360deg);
  }
}

/* ---------------------------------------------------------
   JavaScript 禁用提示
   --------------------------------------------------------- */

.noscript-warning {
  position: fixed;
  z-index: 5000;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px;
  color: #7a271a;
  background: #fef3f2;
  text-align: center;
  font-size: 18px;
  font-weight: 700;
}

/* ---------------------------------------------------------
   较窄电脑屏幕的轻度调整
   仍然不是移动端适配
   --------------------------------------------------------- */

@media (max-width: 1250px) {
  .topbar {
    padding-right: 22px;
    padding-left: 22px;
  }

  .topbar-actions {
    gap: 7px;
  }

  .button {
    padding-right: 11px;
    padding-left: 11px;
  }

  .main-container {
    width: calc(100% - 30px);
  }

  .col-reporter {
    width: 160px;
  }

  .col-actions {
    width: 135px;
  }
}

/* ---------------------------------------------------------
   浏览器打印时的基础处理
   当前主要用于避免弹窗和工具栏被打印
   --------------------------------------------------------- */

@media print {
  body {
    min-width: 0;
    background: var(--white);
  }

  .topbar-actions,
  .toolbar,
  .copy-button,
  .col-actions,
  .modal-overlay,
  .toast,
  .loading-mask {
    display: none !important;
  }

  .main-container {
    width: 100%;
    max-width: none;
    margin: 0;
  }

  .news-section {
    break-inside: avoid;
    box-shadow: none;
  }
}
