/* ============================================================
   APOLLO Dealer Portal — Mini-Program Style v8
   Brand red (China red):     #D7263D
   Brand blue (French flag):  #1E5BAA
   ============================================================ */
:root {
  --bg: #f5f6f8;
  --card: #ffffff;
  --text: #1a1a1a;
  --text-secondary: #666;
  --text-light: #999;
  --line: #eaeaea;
  --border: #e5e5e5;

  --brand: #D7263D;
  --brand-dark: #c01e2d;
  --brand-light: #fff0f2;

  --accent: #1E5BAA;
  --danger: #D7263D;
  --ok: #07c160;
  --warn: #fa9d3b;

  --radius: 12px;
  --radius-sm: 8px;
  --radius-xs: 6px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
[hidden] { display: none !important; }

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
}
body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Helvetica Neue", "Microsoft YaHei", sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  min-height: 100vh;
}

/* ====== Mini-program Nav Bar ====== */
.mp-nav {
  position: sticky; top: 0; z-index: 100;
  background: var(--card);
  border-bottom: 1px solid var(--line);
  padding: 10px 16px;
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px;
}
.mp-nav-brand {
  display: flex; align-items: center; gap: 8px; flex-shrink: 0;
}
.mp-nav-logo { height: 40px; width: auto; }
.mp-nav-title {
  font-size: 16px; font-weight: 600; color: var(--text);
  white-space: nowrap;
}
.mp-nav-title small {
  display: block; font-size: 10px; font-weight: 400;
  color: var(--text-light); margin-top: -1px;
}
.mp-nav-right {
  display: flex; align-items: center; gap: 8px;
  margin-left: auto; flex-shrink: 0;
}
.mp-user-info {
  text-align: right; line-height: 1.3;
  font-size: 13px; color: var(--text-secondary);
  white-space: nowrap;
}
.mp-user-name { font-weight: 500; color: var(--text); }
.mp-user-code { font-size: 11px; color: var(--text-light); }
/* Compact language switcher (icon-like codes) */
.mp-lang { position: relative; }
.mp-lang-btn {
  display: inline-flex; align-items: center; gap: 1px;
  height: 30px; padding: 0 8px;
  border: 1px solid var(--border); border-radius: 999px;
  background: #fff; color: var(--text);
  font-size: 13px; font-weight: 600; line-height: 1; cursor: pointer; font-family: inherit;
}
.mp-lang-btn:active { background: var(--bg); }
.mp-lang-btn[aria-expanded="true"] { border-color: var(--brand); }
.mp-caret { width: 14px; height: 14px; color: var(--text-light); pointer-events: none; }
.mp-lang-pop {
  position: absolute; top: calc(100% + 6px); right: 0; z-index: 60;
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px;
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius-sm);
  padding: 8px; box-shadow: 0 6px 20px rgba(0,0,0,.12);
}
.mp-lang-pop[hidden] { display: none; }
.mp-lang-item {
  min-width: 42px; padding: 7px 0; text-align: center;
  border: none; background: var(--bg); border-radius: var(--radius-xs);
  font-size: 13px; font-weight: 600; color: var(--text); cursor: pointer; font-family: inherit;
}
.mp-lang-item.active { background: var(--brand); color: #fff; }
.mp-lang-item:active { opacity: .7; }

/* Logout icon button */
.mp-btn-logout {
  display: inline-flex; align-items: center; justify-content: center;
  width: 30px; height: 30px; padding: 0;
  border: 1px solid var(--border); border-radius: 999px;
  background: #fff; color: var(--text-light); cursor: pointer;
}
.mp-btn-logout:active { background: var(--bg); }
.mp-btn-logout svg { width: 18px; height: 18px; display: block; }
/* Logout text: hidden on mobile/pad, shown on PC */
.mp-logout-text { display: none; }

/* Tab bar (mini-program style) */
.mp-tabs {
  display: flex; background: var(--card);
  border-bottom: 1px solid var(--line);
  padding: 0;
}
.mp-tab {
  flex: 1; display: flex; align-items: center; justify-content: center;
  padding: 11px 0; color: var(--text-secondary);
  border: none; background: none; cursor: pointer;
  position: relative; font-family: inherit;
  -webkit-tap-highlight-color: transparent;
}
.mp-tab-icon {
  width: 24px; height: 24px;
  fill: none; stroke: currentColor; stroke-width: 1.8;
  stroke-linecap: round; stroke-linejoin: round;
}
/* Tab text label: hidden on mobile/pad, shown on PC */
.mp-tab-text { display: none; }
.mp-tab.active { color: var(--brand); }
.mp-tab.active::after {
  content: ""; position: absolute; bottom: 0; left: 50%;
  transform: translateX(-50%);
  width: 28px; height: 3px; background: var(--brand);
  border-radius: 2px 2px 0 0;
}

/* Status bar */
.mp-status {
  margin: 12px 16px 0; padding: 10px 14px;
  border-radius: var(--radius-sm); font-size: 13px;
  border-left: 3px solid var(--accent);
  background: #eef4fc; color: var(--accent);
}
.mp-status.error { background: #fef0ef; color: var(--danger); border-left-color: var(--danger); }
.mp-status.success { background: #edfff3; color: var(--ok); border-left-color: var(--ok); }

/* ====== Page Content ====== */
.mp-page { padding: 16px; padding-bottom: 80px; }

/* Card */
.mp-card {
  background: var(--card); border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 1px 4px rgba(0,0,0,.04), 0 2px 8px rgba(0,0,0,.03);
  margin-bottom: 14px;
}
.mp-card-head {
  padding: 18px 20px 14px;
  border-bottom: 1px solid var(--line);
}
.mp-card-head h1 {
  font-size: 17px; font-weight: 600; color: var(--text);
}
.mp-card-head .hint {
  font-size: 13px; color: var(--text-light);
  margin-top: 4px;
}
.mp-card-body { padding: 16px 20px 20px; }

/* Login card */
.mp-login-card {
  max-width: 380px; margin: 40vh auto 0;
  transform: translateY(-50%); text-align: center;
}
.mp-login-card .mp-card-body { padding: 28px 24px; }
.mp-login-card h1 { font-size: 20px; margin-bottom: 6px; }
.mp-login-card .hint { font-size: 13px; color: var(--text-light); margin-bottom: 24px; }
.mp-login-card .footnote {
  font-size: 12px; color: var(--text-light); margin-top: 16px;
}

/* ====== Form Fields (Mini-program style) ====== */
.mp-field {
  margin-bottom: 0;
  border-bottom: 1px solid var(--line);
  display: flex; align-items: center;
  min-height: 50px;
}
.mp-field:last-child { border-bottom: none; }
.mp-field-label {
  width: 90px; flex-shrink: 0;
  font-size: 14px; color: var(--text);
  padding-right: 12px;
}
.mp-field-label .required {
  color: var(--danger); margin-left: 2px;
}
.mp-field-control {
  flex: 1; min-width: 0;
}
.mp-field-control input,
.mp-field-control select,
.mp-field-control textarea {
  width: 100%; border: none; outline: none;
  font-size: 14px; color: var(--text);
  background: transparent; font-family: inherit;
  padding: 14px 0;
  -webkit-appearance: none; appearance: none;
}
.mp-field-control select {
  padding-right: 24px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23ccc' d='M3 5l3 3 3-3'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 4px center;
  background-size: 12px;
}
.mp-field-control select option { direction: ltr; }

/* Segmented control (gender picker) */
.mp-segment-group {
  display: flex; gap: 8px;
}
.mp-segment-btn {
  flex: 1; padding: 9px 0; font-size: 14px;
  border: 1.5px solid var(--border); border-radius: var(--radius);
  background: #fff; color: var(--text-secondary); cursor: pointer;
  font-family: inherit; -webkit-tap-highlight-color: transparent;
  transition: border-color .15s, color .15s, background .15s;
}
.mp-segment-btn.active {
  border-color: var(--brand); color: var(--brand);
  background: rgba(220,38,38,0.04); font-weight: 500;
}
.mp-segment-btn:active { background: var(--bg-soft, #f5f6f7); }
.mp-field-control textarea {
  resize: vertical; min-height: 100px; padding-top: 14px; padding-bottom: 14px;
  line-height: 1.55;
}
.mp-field-control input::placeholder,
.mp-field-control textarea::placeholder { color: var(--text-light); }
.mp-field-error { color: var(--danger); font-size: 12px; padding: 4px 0 0; line-height: 1.4; }

/* Full-width field (for attachments, description etc.) */
.mp-field-block {
  border-bottom: 1px solid var(--line);
  padding: 14px 0;
}
.mp-field-block:last-child { border-bottom: none; }
.mp-field-block > label {
  display: block; font-size: 14px; color: var(--text);
  margin-bottom: 8px;
}
.mp-field-block > label .required { color: var(--danger); margin-left: 2px; }
.mp-field-block textarea,
.mp-field-block input {
  display: block; width: 100%; box-sizing: border-box;
  border: none; outline: none; background: transparent;
  font-size: 14px; color: var(--text); font-family: inherit;
  line-height: 1.55;
}
.mp-field-block textarea {
  resize: vertical; min-height: 110px; padding: 4px 0;
}

/* File upload area */
.mp-upload-area {
  border: 1.5px dashed var(--border); border-radius: var(--radius-sm);
  padding: 20px 16px; text-align: center;
  background: #fafafa; cursor: pointer;
  transition: border-color .15s, background .15s;
}
.mp-upload-area:active, .mp-upload-area:hover {
  border-color: var(--brand); background: var(--brand-light);
}
.mp-upload-icon {
  width: 40px; height: 40px; margin: 0 auto 8px;
  border-radius: 50%; background: var(--brand-light);
  display: flex; align-items: center; justify-content: center;
  font-size: 22px; color: var(--brand); line-height: 1;
}
.mp-upload-text { font-size: 13px; color: var(--text-light); }
.mp-upload-hint {
  font-size: 12px; color: var(--brand); margin-top: 8px;
  padding: 6px 10px; background: var(--brand-light);
  border-radius: var(--radius-xs); display: inline-block;
}
.mp-file-list { list-style: none; margin-top: 10px; }
.mp-file-list li {
  display: flex; align-items: center; justify-content: space-between;
  gap: 10px;
  padding: 10px 12px; margin-top: 6px;
  background: #fafafa; border-radius: var(--radius-xs);
  font-size: 13px; color: var(--text-secondary);
}
.mp-file-list li .name { flex: 1; min-width: 0; word-break: break-all; }
.mp-file-list li.bad { color: var(--danger); background: #fef0ef; }
.mp-file-remove {
  flex-shrink: 0;
  width: 24px; height: 24px; line-height: 22px;
  border: none; border-radius: 50%;
  background: rgba(0,0,0,.06); color: var(--text-secondary);
  font-size: 18px; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  padding: 0; font-family: inherit;
}
.mp-file-remove:hover { background: rgba(0,0,0,.12); }
.mp-file-remove:active { transform: scale(.92); }
.mp-file-list li.hint {
  justify-content: flex-start; background: transparent; color: var(--text-light);
  font-size: 12px; padding: 6px 4px;
}

/* Notice / Reminder */
.mp-notice {
  margin: 14px 0 0; padding: 14px 16px;
  background: linear-gradient(135deg, #fffbf0, #fff8e6);
  border: 1px solid #f0e6c8;
  border-left: 3px solid var(--warn);
  border-radius: var(--radius-sm);
  font-size: 13px; line-height: 1.65; color: #6b5a00;
}
.mp-notice strong { display: block; color: #8b6914; margin-bottom: 4px; font-size: 14px; }

/* ====== Buttons ====== */
.mp-btn {
  display: inline-flex; align-items: center; justify-content: center;
  border: none; border-radius: var(--radius-sm);
  font-size: 15px; font-weight: 500; cursor: pointer;
  font-family: inherit; transition: opacity .15s, transform .05s;
  padding: 12px 28px; line-height: 1.4;
}
.mp-btn:active { transform: scale(.97); opacity: .85; }
.mp-btn-primary {
  background: var(--brand); color: #fff;
  box-shadow: 0 2px 8px rgba(215,38,61,.25);
}
.mp-btn-primary:disabled { opacity: .45; cursor: not-allowed; box-shadow: none; transform: none; }
.mp-btn-primary:disabled:active { transform: none; opacity: .45; }
.mp-btn-block { width: 100%; }
.mp-btn-ghost {
  background: transparent; color: var(--text-secondary);
  border: 1px solid var(--border);
}
.mp-btn-group { display: flex; gap: 10px; margin-top: 20px; }

/* 配件品号（可多个） */
.mp-btn-sm { padding: 8px 16px; font-size: 13px; }
.mp-optional { color: var(--text-secondary); font-weight: 400; font-size: 12px; }
.mp-part-row { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.mp-part-row .mp-part-input {
  flex: 1; display: block; width: 100%; box-sizing: border-box;
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: var(--card); padding: 10px 12px; font-size: 14px; color: var(--text); font-family: inherit;
}
.mp-part-remove {
  flex: none; width: 32px; height: 32px; line-height: 1; font-size: 18px;
  border: 1px solid var(--border); background: transparent; border-radius: var(--radius-sm);
  color: var(--text-secondary); cursor: pointer;
}
.mp-part-remove:hover { color: var(--danger); border-color: var(--danger); }
#partList:empty { display: none; }

/* Bottom action bar (sticky) */
.mp-action-bar {
  position: fixed; bottom: 0; left: 0; right: 0;
  z-index: 99;
  padding: 10px 16px;
  background: var(--card);
  border-top: 1px solid var(--line);
  box-shadow: 0 -2px 10px rgba(0,0,0,.04);
}
.mp-action-bar .mp-btn-primary { width: 100%; padding: 14px 28px; font-size: 16px; }

/* ====== Success Card ====== */
.mp-success {
  text-align: center; padding: 48px 24px 36px;
}
.mp-success h1 { font-size: 19px; margin-bottom: 8px; }
.mp-success .hint { font-size: 13px; color: var(--text-light); margin-bottom: 12px; }
.mp-ref-no {
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-size: 26px; font-weight: 700; letter-spacing: 2px;
  color: var(--brand); margin: 16px 0 20px;
  padding: 14px 20px; background: var(--brand-light);
  border-radius: var(--radius-sm); display: inline-block;
}
.mp-success .mp-btn-group { justify-content: center; }

/* ====== Table (History) ====== */
.mp-table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.mp-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.mp-table th {
  text-align: left; font-weight: 500; color: var(--text-light);
  font-size: 12px; padding: 10px 12px;
  border-bottom: 1px solid var(--line); white-space: nowrap;
  background: #fafbfc;
}
.mp-table td {
  padding: 12px; border-bottom: 1px solid var(--line);
  vertical-align: middle; font-size: 13px;
}
.mp-table tr:last-child td { border-bottom: none; }
.mp-table tr:hover td { background: #fafbfc; }
.mp-table .empty { text-align: center; color: var(--text-light); padding: 40px 0; }
.mp-table .mono { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-size: 12px; }

/* Status chips */
.mp-chip {
  display: inline-flex; align-items: center; padding: 3px 10px;
  border-radius: 999px; font-size: 12px; font-weight: 500; white-space: nowrap;
}
.mp-chip.pending { background: #fff7e6; color: var(--warn); }
.mp-chip.accepted { background: #eafff2; color: var(--ok); }
.mp-chip.rejected { background: #fef0ef; color: var(--danger); }
.mp-chip.closed { background: #f5f5f5; color: var(--text-light); }

/* ====== Modal ====== */
.mp-modal {
  position: fixed; inset: 0; z-index: 200;
  background: rgba(0,0,0,.45);
  display: flex; align-items: flex-end; justify-content: center;
}
.mp-modal-inner {
  background: var(--card); border-radius: var(--radius) var(--radius) 0 0;
  width: 100%; max-width: 520px; max-height: 80vh;
  overflow-y: auto; animation: mpSlideUp .25s ease;
}
@keyframes mpSlideUp {
  from { transform: translateY(100%); } to { transform: translateY(0); }
}
.mp-modal-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 20px; border-bottom: 1px solid var(--line);
  position: sticky; top: 0; background: var(--card);
}
.mp-modal-head h2 { font-size: 16px; font-weight: 600; }
.mp-modal-close {
  font-size: 14px; color: var(--text-secondary); cursor: pointer;
  background: none; border: none; padding: 6px 10px; border-radius: var(--radius-xs);
}
.mp-modal-close:active { background: var(--bg); }
.mp-modal-body { padding: 20px; }

/* Detail key-value list */
.mp-kv { font-size: 14px; }
.mp-kv-row {
  display: flex; padding: 10px 0;
  border-bottom: 1px solid var(--line);
}
.mp-kv-row:last-child { border-bottom: none; }
.mp-kv-key {
  width: 80px; flex-shrink: 0; color: var(--text-light); font-size: 13px;
}
.mp-kv-val { flex: 1; color: var(--text); word-break: break-word; }
.mp-attach-list { list-style: none; margin-top: 12px; }
.mp-attach-list li {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 12px; margin-top: 6px;
  border: 1px solid var(--line); border-radius: var(--radius-sm);
  font-size: 13px; background: #fafbfc;
}
.mp-attach-list .size { font-size: 12px; color: var(--text-light); }
.mp-link {
  color: var(--accent); text-decoration: none; font-weight: 500;
  cursor: pointer; background: none; border: 0;
  font-size: 13px; padding: 0; font-family: inherit;
}
.mp-link:active { opacity: .7; }
/* Inline "view" action button (history list) */
.link {
  color: var(--brand); background: none; border: 0; cursor: pointer;
  font-size: 13px; font-weight: 500; font-family: inherit; padding: 4px 0;
}
.link:active { opacity: .7; }

/* ====== Footer ====== */
.mp-footer {
  text-align: center; padding: 16px 16px 22px; margin-top: 8px;
  color: var(--text-light); font-size: 12px;
  border-top: 1px solid var(--line);
}
.mp-footer-logo { height: 30px; width: auto; opacity: .9; margin-bottom: 8px; }
.mp-footer-copy { color: var(--text-light); font-size: 11px; }
.mp-footer-tag {
  display: inline-block; margin-top: 4px;
  font-size: 10px; letter-spacing: .12em; text-transform: uppercase;
  color: var(--brand); font-weight: 600; opacity: .8;
}

/* ====== Responsive: Pad (768–1023) & Desktop (>=1024) ====== */
/* Mobile-first: default styles below 768px stay as the mini-program layout.
   Pad widens content while keeping the icon style (no horizontal scroll). */
@media (min-width: 768px) {
  .mp-page { max-width: 920px; margin-left: auto; margin-right: auto; }
  .mp-login-card { margin: 8vh auto 0; transform: none; }
  .mp-modal-inner { border-radius: var(--radius); max-height: 75vh; margin: auto; }
  .mp-modal { align-items: center; }
}

/* ====== Account view ====== */
.mp-subsection { margin-bottom: 4px; }
.mp-subtitle {
  font-size: 15px; font-weight: 600; color: var(--text);
  margin: 24px 0 14px; padding-bottom: 8px;
  border-bottom: 1px solid var(--line);
}
.mp-subtitle:first-of-type { margin-top: 0; }

/* Account form: wider label to fit "售后人员姓名" on one line */
#viewAccount .mp-field-label { width: 100px; white-space: nowrap; }
#viewAccount #profileForm .mp-btn {
  margin-top: 18px; margin-bottom: 6px;
}
#viewAccount #passwordForm .mp-btn {
  margin-top: 18px;
}

/* ====== After-sales Consult (公众号 style) ====== */
/* Search box (replaces redundant title) */
.mp-search-head { padding: 12px 16px; }
/* Consult section title: hidden on mobile/pad, shown on PC beside search */
.mp-consult-title { display: none; }
.mp-search {
  display: flex; align-items: center; gap: 8px;
  background: var(--bg-soft, #f1f2f4);
  border: 1px solid var(--line, #e6e8eb);
  border-radius: var(--radius, 12px);
  padding: 9px 14px;
}
.mp-search-icon { flex: 0 0 16px; width: 16px; height: 16px; color: var(--text-light, #9aa0a6); }
.mp-search-input {
  flex: 1; min-width: 0; border: none; background: none; outline: none;
  font-size: 14px; font-family: inherit; color: var(--text, #1f2329);
}
.mp-search-input::placeholder { color: var(--text-light, #9aa0a6); }
.mp-search-input::-webkit-search-cancel-button { -webkit-appearance: none; }

.mp-news-list { list-style: none; margin: 0; padding: 4px 0 0; }
.mp-news-empty { color: var(--text-light); font-size: 14px; padding: 24px 20px; text-align: center; }
.mp-news-item {
  display: flex; align-items: stretch; gap: 12px;
  padding: 14px 20px; border-bottom: 1px solid var(--line);
  cursor: pointer; -webkit-tap-highlight-color: transparent;
}
.mp-news-item:active { background: rgba(0,0,0,.03); }
.mp-news-cover {
  flex: 0 0 84px; width: 84px; height: 84px;
  border-radius: var(--radius-sm); overflow: hidden; background: #f1f2f4;
}
.mp-news-cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.mp-news-body { flex: 1; min-width: 0; display: flex; flex-direction: column; justify-content: space-between; }
.mp-news-title {
  font-size: 16px; font-weight: 600; color: var(--text); line-height: 1.35;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.mp-news-summary {
  margin-top: 4px; font-size: 13px; color: var(--text-light); line-height: 1.45;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.mp-news-meta { margin-top: 6px; font-size: 12px; color: var(--text-light); display: flex; gap: 8px; flex-wrap: wrap; }
.mp-news-tags { color: var(--brand); }

/* Detail (公众号 article) */
.mp-article { padding: 16px 20px 20px; }
.mp-article-back {
  display: inline-flex; align-items: center; gap: 4px;
  border: none; background: none; color: var(--brand);
  font-size: 14px; padding: 0; margin: 4px 0 14px; cursor: pointer; font-family: inherit;
}
.mp-article-back:active { opacity: .6; }
.mp-article-title { font-size: 21px; font-weight: 700; line-height: 1.4; color: var(--text); margin: 0 0 8px; }
.mp-article-meta { font-size: 13px; color: var(--text-light); margin-bottom: 18px; line-height: 1.6; }
.mp-article-content { font-size: 16px; line-height: 1.8; color: #2b2b2b; word-break: break-word; }
.mp-article-content p { margin: 0 0 14px; }
.mp-article-content img { max-width: 100%; height: auto; border-radius: var(--radius-sm); margin: 8px 0; }
.mp-article-content div, .mp-article-content span { line-height: inherit; }
.mp-article-files { margin-top: 22px; border-top: 1px solid var(--line); padding-top: 16px; }
.mp-article-files-title { font-size: 15px; font-weight: 600; margin: 0 0 12px; color: var(--text); }
.mp-article-img { margin: 12px 0; }
.mp-article-img img { width: 100%; border-radius: var(--radius-sm); display: block; }
.mp-article-video { margin: 12px 0; }
.mp-article-video video { width: 100%; border-radius: var(--radius-sm); background: #000; display: block; }
.mp-article-file { margin: 8px 0; font-size: 14px; }
.mp-article-file a { color: var(--brand); text-decoration: none; word-break: break-all; }
.mp-article-file a:active { opacity: .7; }

/* ====== Desktop / PC (>=1024): wide, international, text-ified ====== */
@media (min-width: 1024px) {
  /* Generous wide layout, not a narrow center column */
  .mp-page { max-width: 1200px; padding: 28px 32px 64px; }

  /* Nav tabs become a horizontal text + icon nav */
  .mp-tabs { padding: 0 32px; }
  .mp-tab {
    flex: 0 0 auto;
    padding: 16px 22px;
    gap: 8px;
  }
  .mp-tab-text {
    display: inline;
    font-size: 15px; font-weight: 500;
  }
  .mp-tab.active::after {
    left: 22px; right: 22px; width: auto; transform: none;
  }

  /* Logout shows text label on PC */
  .mp-btn-logout {
    width: auto; height: 34px; padding: 0 14px 0 10px;
    gap: 6px; border-radius: 999px;
  }
  .mp-logout-text { display: inline; font-size: 13px; font-weight: 500; }

  /* Consult header: title + search on one row */
  .mp-search-head {
    display: flex; align-items: center; justify-content: space-between; gap: 24px;
    padding: 20px 32px;
  }
  .mp-consult-title { display: block; font-size: 22px; font-weight: 700; color: var(--text); }
  .mp-search { flex: 0 0 360px; max-width: 360px; }

  /* Consult: masonry / waterfall cards */
  .mp-news-list { columns: 2; column-gap: 22px; padding: 14px 32px 0; }
  .mp-news-item {
    display: inline-block; width: 100%;
    break-inside: avoid; margin: 0 0 22px; padding: 0;
    border-bottom: none;
    border: 1px solid var(--line); border-radius: var(--radius);
    overflow: hidden; background: #fff;
    transition: box-shadow .15s, transform .15s;
  }
  .mp-news-item:hover { box-shadow: 0 6px 22px rgba(0,0,0,.10); transform: translateY(-2px); }
  .mp-news-item:active { background: #fff; }
  .mp-news-cover { flex: 0 0 auto; width: 100%; height: 168px; border-radius: 0; }
  .mp-news-body { padding: 16px 18px 18px; gap: 0; }
  .mp-news-title { font-size: 17px; }
  .mp-news-summary { margin-top: 8px; }

  /* History: full comprehensive table */
  .mp-table-wrap { overflow: visible; }
  .mp-table { font-size: 14px; }
  .mp-table th { padding: 14px 16px; font-size: 12px; }
  .mp-table td { padding: 14px 16px; font-size: 14px; }
  .mp-table tr:hover td { background: #f7f9fc; }
  .mp-table .link {
    color: var(--brand); background: none; border: 0; cursor: pointer;
    font-size: 13px; font-weight: 500; font-family: inherit; padding: 4px 10px;
    border-radius: var(--radius-xs);
  }
  .mp-table .link:hover { background: var(--brand-light); }

  /* Account: two-column grid */
  #viewAccount .mp-card-body {
    display: grid; grid-template-columns: 1fr 1fr; gap: 0 44px;
    padding: 24px 32px 28px;
  }
  #viewAccount .mp-subsection { grid-column: 1 / -1; }
  #viewAccount #profileForm { grid-column: 1; }
  #viewAccount #passwordForm { grid-column: 2; }
  #viewAccount .mp-subtitle:first-of-type { margin-top: 4px; }

  /* Login card larger and centered on PC */
  .mp-login-card { max-width: 440px; margin: 8vh auto 0; transform: none; }
  .mp-login-card .mp-card-body { padding: 36px 32px; }

  /* Bottom submit bar aligned to content width on PC */
  .mp-action-bar {
    left: 50%; transform: translateX(-50%);
    width: 1200px; max-width: calc(100% - 64px);
    padding: 12px 32px;
    border-radius: var(--radius) var(--radius) 0 0;
  }
}
@media (min-width: 1320px) {
  .mp-news-list { columns: 3; }
}

/* ====== Responsive table: phone/pad card layout (no horizontal scroll) ====== */
@media (max-width: 1023px) {
  .mp-table-wrap { overflow-x: visible; }
  .mp-table thead { display: none; }
  .mp-table, .mp-table tbody, .mp-table tr, .mp-table td { display: block; width: 100%; }
  .mp-table tr {
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    margin-bottom: 12px;
    background: #fff;
    box-shadow: 0 1px 2px rgba(16,24,40,.04);
  }
  .mp-table td {
    display: flex; justify-content: space-between; align-items: center; gap: 12px;
    padding: 10px 14px; border-bottom: 1px solid var(--line);
    text-align: right; font-size: 13px;
  }
  .mp-table tr td:last-child { border-bottom: none; }
  .mp-table td::before {
    content: attr(data-label);
    font-weight: 500; color: var(--text-light);
    text-align: left; flex: 0 0 auto;
    font-size: 12px;
  }
  .mp-table .mono { word-break: break-all; font-size: 12px; }
}
