:root {
  --bg: #f5f7fa;
  --card: #ffffff;
  --text: #1d2129;
  --text-2: #4e5969;
  --muted: #86909c;
  --line: #e5e6eb;
  --line-soft: #f2f3f5;
  --primary: #0052d9;
  --primary-dark: #0046b8;
  --primary-soft: #f2f6ff;
  --green: #00a870;
  --red: #cb2634;
  --orange: #e37318;
  --shadow-sm: 0 1px 3px rgba(29, 33, 41, .06);
  --shadow-md: 0 4px 16px rgba(29, 33, 41, .07);
  --shadow-lg: 0 12px 40px rgba(29, 33, 41, .10);
  --radius: 10px;
  --radius-sm: 6px;
}

* { box-sizing: border-box; }

html, body { min-height: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei UI",
    "Microsoft YaHei", "PingFang SC", "Hiragino Sans GB", sans-serif;
  font-size: 14px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--primary); text-decoration: none; }

.hidden { display: none !important; }

/* ------------------------------------------------------------ 滚动条 */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: #d5d8de;
  border-radius: 6px;
  border: 2px solid transparent;
  background-clip: content-box;
}
::-webkit-scrollbar-thumb:hover { background: #b8bcc4; background-clip: content-box; }

/* ------------------------------------------------------------ 顶栏 */
.nav {
  background: rgba(255, 255, 255, .88);
  backdrop-filter: saturate(180%) blur(12px);
  -webkit-backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--line-soft);
  position: sticky;
  top: 0;
  z-index: 100;
}
.nav-inner {
  max-width: 1120px;
  height: 62px;
  margin: 0 auto;
  padding: 0 20px;
  display: flex;
  align-items: center;
  gap: 40px;
}
.logo { display: flex; align-items: center; gap: 10px; color: var(--text); }
.logo-mark {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: linear-gradient(135deg, #0052d9, #3a8cff);
  color: #fff;
  font-weight: 700;
  font-size: 16px;
  box-shadow: 0 2px 8px rgba(0, 82, 217, .28);
  display: flex;
  align-items: center;
  justify-content: center;
}
.logo-text { font-size: 17px; font-weight: 650; letter-spacing: .4px; }

.nav-links { display: flex; align-items: center; gap: 30px; flex: 1; }
.nav-links a {
  color: var(--text-2);
  font-size: 14px;
  position: relative;
  padding: 4px 0;
  transition: color .15s;
}
.nav-links a:hover { color: var(--primary); }
.nav-links a.active { color: var(--primary); font-weight: 500; }
.nav-links a.active::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -2px;
  transform: translateX(-50%);
  width: 16px;
  height: 2px;
  border-radius: 2px;
  background: var(--primary);
}

.nav-right { display: flex; align-items: center; gap: 12px; }
.credit {
  background: var(--primary-soft);
  color: var(--primary);
  padding: 5px 13px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 500;
  border: 1px solid rgba(0, 82, 217, .12);
}
.credit b { font-size: 14px; font-weight: 650; }

/* ------------------------------------------------------------ 按钮 */
.btn-primary {
  height: 42px;
  padding: 0 30px;
  border: none;
  border-radius: var(--radius-sm);
  background: linear-gradient(135deg, #0052d9, #2b7fff);
  color: #fff;
  font-size: 14.5px;
  font-weight: 500;
  letter-spacing: .5px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(0, 82, 217, .22);
  transition: transform .15s, box-shadow .15s, opacity .15s;
}
.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(0, 82, 217, .28);
}
.btn-primary:active { transform: translateY(0); }
.btn-primary:disabled {
  opacity: .55;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}
.btn-primary.btn-sm { height: 34px; padding: 0 16px; font-size: 13px; }
.btn-primary.wide { width: 100%; margin-top: 11px; }

.btn-ghost {
  height: 34px;
  padding: 0 15px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: #fff;
  color: var(--text-2);
  font-size: 13px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all .15s;
}
.btn-ghost:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: var(--primary-soft);
}
a.btn-ghost { text-decoration: none; }

/* ------------------------------------------------------------ 主体 */
.page {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 20px 72px;
}

.hero { text-align: center; padding: 44px 0 24px; }
.hero h1 {
  margin: 0;
  font-size: 30px;
  font-weight: 650;
  letter-spacing: .6px;
  color: #171a1f;
}
.hero p { margin: 12px 0 0; color: var(--muted); font-size: 14px; }
.hero-tags {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 20px;
}
.hero-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 13px;
  border-radius: 999px;
  background: #fff;
  border: 1px solid var(--line);
  font-size: 12.5px;
  color: var(--text-2);
  box-shadow: var(--shadow-sm);
}
.hero-tag b { color: var(--primary); font-weight: 650; }
.hero-tag i {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--green);
  font-style: normal;
}

/* 朱雀保通 */
.guarantee {
  display: flex;
  align-items: center;
  gap: 16px;
  margin: 0 0 16px;
  padding: 16px 20px;
  border: 1px solid rgba(0, 168, 112, .28);
  border-radius: var(--radius);
  background: linear-gradient(135deg, #f2fff9 0%, #ffffff 70%);
  box-shadow: var(--shadow-sm);
}
.guarantee-badge {
  flex: none;
  padding: 6px 12px;
  border-radius: 6px;
  background: var(--green);
  color: #fff;
  font-size: 13px;
  font-weight: 650;
  letter-spacing: .5px;
}
.guarantee-text { min-width: 0; }
.guarantee-text b { display: block; font-size: 14px; color: #0b6b4b; font-weight: 650; }
.guarantee-text span { display: block; margin-top: 3px; font-size: 12px; color: var(--muted); }

/* 三条卖点 */
.why {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin: 0 0 22px;
}
.why-item {
  padding: 18px 18px 16px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}
.why-no {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .12em;
  color: var(--primary);
}
.why-item h3 { margin: 7px 0 6px; font-size: 15px; font-weight: 650; color: var(--text); }
.why-item p { margin: 0; font-size: 12.5px; line-height: 1.75; color: var(--muted); }

@media (max-width: 760px) {
  .guarantee { flex-direction: column; align-items: flex-start; gap: 10px; }
  .why { grid-template-columns: 1fr; }
  .hero { padding-top: 30px; }
  .hero h1 { font-size: 26px; }
}

.panel {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  margin-bottom: 22px;
  overflow: hidden;
  transition: box-shadow .2s, border-color .2s;
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 24px;
  border-bottom: 1px solid var(--line-soft);
  background: linear-gradient(180deg, #fcfcfd, #fff);
}
.panel-title {
  font-size: 14px;
  font-weight: 650;
  display: flex;
  align-items: center;
  gap: 8px;
}
.panel-title::before {
  content: "";
  width: 3px;
  height: 14px;
  border-radius: 2px;
  background: var(--primary);
}
.panel-tip { font-size: 12px; color: var(--muted); }

/* 输入区 */
textarea#source {
  display: block;
  width: 100%;
  min-height: 380px;
  padding: 22px 24px;
  border: none;
  outline: none;
  resize: vertical;
  background: #fff;
  color: var(--text);
  font-family: inherit;
  font-size: 15px;
  line-height: 2;
  letter-spacing: .2px;
  transition: background .2s;
}
textarea#source::placeholder { color: #c9cdd4; }
textarea#source:focus { background: #fdfdff; }
textarea#source:read-only { background: #fafbfc; color: var(--text-2); }

.panel-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 11px 22px;
  border-top: 1px solid var(--line-soft);
  flex-wrap: wrap;
}
.foot-left, .foot-right { display: flex; align-items: center; gap: 16px; }
.count { font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }
.count.over { color: var(--red); font-weight: 600; }
.cost { font-size: 12px; color: var(--muted); }

.file-btn { font-size: 13px; color: var(--primary); cursor: pointer; }
.file-btn:hover { text-decoration: underline; }

.run-state { padding: 0 22px 14px; }
.status {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 18px;
  padding-top: 8px;
  font-size: 13px;
  color: var(--text-2);
}
.status::before {
  content: "";
  flex: 0 0 auto;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--primary);
  animation: pulse 1.4s ease-in-out infinite;
}
.status:empty::before { display: none; }
@keyframes pulse {
  0%, 100% { opacity: .35; transform: scale(.8); }
  50% { opacity: 1; transform: scale(1); }
}
.progress {
  height: 4px;
  background: var(--line-soft);
  border-radius: 4px;
  overflow: hidden;
  position: relative;
}
#bar {
  height: 100%;
  width: 0;
  border-radius: 4px;
  background: linear-gradient(90deg, #0052d9, #3a8cff);
  transition: width .5s cubic-bezier(.4, 0, .2, 1);
  position: relative;
  overflow: hidden;
}
#bar::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    90deg, transparent, rgba(255, 255, 255, .55), transparent);
  animation: bar-shine 1.6s linear infinite;
}
@keyframes bar-shine {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}

.error {
  display: none;
  margin: 0 22px 16px;
  padding: 9px 12px;
  border: 1px solid #ffd4d1;
  border-radius: 4px;
  background: #fff2f0;
  color: var(--red);
  font-size: 13px;
}
.error.ok {
  border-color: #b7ebd3;
  background: #f0fff7;
  color: var(--green);
}
.forgot-link { font-size: 12.5px; color: var(--muted); }
.forgot-link:hover { color: var(--primary); }

/* ------------------------------------------------------------ 结果 */
.result-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 20px 22px 14px;
  flex-wrap: wrap;
}
.result-head h2 { margin: 0; font-size: 18px; font-weight: 600; }
.stats-line { margin-top: 5px; font-size: 12px; color: var(--muted); }
.result-actions { display: flex; align-items: center; gap: 10px; }

.report { padding: 0 22px 22px; }
.report-title {
  font-size: 13px;
  font-weight: 650;
  color: var(--text-2);
  margin: 6px 0 10px;
  display: flex;
  align-items: center;
  gap: 7px;
}
.report-title::before {
  content: "";
  width: 3px;
  height: 12px;
  border-radius: 2px;
  background: var(--primary);
  opacity: .5;
}
.report-bar { display: flex; align-items: center; justify-content: space-between; }
.report-bar .report-title { margin-top: 4px; }

.coverage {
  display: flex;
  height: 10px;
  border-radius: 5px;
  overflow: hidden;
  background: var(--line-soft);
}
.coverage-changed {
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, #00a870, #2fc48d);
  transition: width .5s ease;
}
.coverage-same {
  height: 100%;
  width: 100%;
  background: #e8eaef;
  border-radius: 0 4px 4px 0;
}

.coverage-legend {
  display: flex;
  gap: 26px;
  margin-top: 9px;
  font-size: 12px;
  color: var(--muted);
}
.coverage-legend b { color: var(--text-2); font-weight: 500; margin-left: 3px; }
.dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 2px;
  margin-right: 6px;
  vertical-align: 1px;
}
.dot.changed { background: var(--green); }
.dot.same { background: #d5d8de; }

.view-tabs { display: flex; gap: 4px; }
.view-tabs {
  background: #f2f3f5;
  border-radius: 6px;
  padding: 2px;
}
.view-tab {
  height: 26px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: #fff;
  color: var(--muted);
  font-size: 12px;
  cursor: pointer;
}
.view-tab.active {
  border-color: var(--primary);
  background: var(--primary-soft);
  color: var(--primary);
  font-weight: 500;
}

.diff {
  border: 1px solid var(--line-soft);
  border-radius: 6px;
  overflow: hidden;
}
.seg {
  display: grid;
  grid-template-columns: 46px 1fr;
  border-bottom: 1px solid var(--line-soft);
}
.seg:last-child { border-bottom: none; }
.seg-no {
  padding: 13px 0 0;
  text-align: center;
  font-size: 11px;
  color: #a9aeb8;
  background: #fafbfc;
  border-right: 1px solid var(--line-soft);
  font-variant-numeric: tabular-nums;
}
.seg-body { display: grid; grid-template-columns: 1fr 1fr; min-width: 0; }
.seg-src, .seg-dst {
  padding: 12px 14px;
  font-size: 14px;
  line-height: 1.8;
  white-space: pre-wrap;
  word-break: break-word;
}
.seg-src {
  color: var(--muted);
  border-right: 1px solid var(--line-soft);
  background: #fcfcfd;
}
.seg-dst { color: var(--text); }
.seg.is-changed .seg-dst {
  background: #f7faff;
  box-shadow: inset 3px 0 0 #9cc3ff;
}

.text-view {
  margin: 0;
  padding: 18px;
  max-height: 760px;
  overflow: auto;
  border: 1px solid var(--line-soft);
  border-radius: 6px;
  background: #fcfcfd;
  font-family: inherit;
  font-size: 14px;
  line-height: 1.9;
  white-space: pre-wrap;
  word-break: break-word;
  color: var(--text);
}

/* ------------------------------------------------------------ 弹窗 */
.mask {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(15, 23, 42, .45);
}
.modal {
  width: 100%;
  max-width: 420px;
  max-height: 90vh;
  overflow: auto;
  padding: 22px 24px;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 20px 60px rgba(0, 0, 0, .22);
}
.modal-head { display: flex; align-items: center; justify-content: space-between; }
.modal-head h2 { margin: 0 0 12px; font-size: 18px; }
.modal-close {
  width: 28px;
  height: 28px;
  margin-top: -8px;
  border: none;
  background: none;
  color: var(--muted);
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
}
.modal-close:hover { color: var(--text); }

.modal label { display: block; margin: 13px 0 5px; font-size: 13px; color: var(--text-2); }
.modal input[type=text], .modal input[type=password], .modal input[type=email] {
  width: 100%;
  height: 40px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 4px;
  outline: none;
  font-size: 14px;
  font-family: inherit;
}
.modal input:focus { border-color: var(--primary); }
.code-row { display: flex; gap: 8px; }
.code-row input { flex: 1; min-width: 0; }
.code-row .btn-ghost { height: 40px; padding: 0 14px; white-space: nowrap; flex: none; }
.code-row .btn-ghost:disabled { opacity: .55; cursor: not-allowed; }

.tabs { display: flex; gap: 6px; margin-bottom: 4px; }
.tab {
  flex: 1;
  height: 34px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: #fff;
  color: var(--muted);
  font-size: 13px;
  cursor: pointer;
}
.tab.active {
  border-color: var(--primary);
  background: var(--primary-soft);
  color: var(--primary);
  font-weight: 500;
}

.tip {
  margin: 14px 0;
  padding: 9px 11px;
  border-radius: 4px;
  background: #f7f8fa;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.65;
}
.tip b { color: #d25f00; }

.credit-big { margin: 12px 0 4px; font-size: 14px; color: var(--muted); }
.credit-big b { margin: 0 3px; font-size: 24px; color: var(--primary); }
.msg { min-height: 18px; margin: 8px 0; font-size: 13px; color: var(--green); }
.msg:empty { display: none; }

.ref-link { display: flex; gap: 8px; margin: 10px 0 4px; }
.ref-link input {
  flex: 1;
  min-width: 0;
  height: 34px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: #f7f8fa;
  color: var(--text-2);
  font-size: 12px;
}
.linkbtn {
  display: block;
  width: 100%;
  margin-top: 12px;
  border: none;
  background: none;
  color: var(--muted);
  font-size: 13px;
  cursor: pointer;
}
.linkbtn:hover { color: var(--text); }

/* ------------------------------------------------------------ 移动端 */
@media (max-width: 760px) {
  .nav-inner { gap: 16px; }
  .nav-links { display: none; }
  .hero { padding: 30px 0 20px; }
  .hero h1 { font-size: 23px; }
  textarea#source { min-height: 260px; }
  .seg-body { grid-template-columns: 1fr; }
  .seg-src { border-right: none; border-bottom: 1px dashed var(--line-soft); }
  .result-head { flex-direction: column; }
}

/* ------------------------------------------------------------ 实时改写 */
.live-wrap {
  display: grid;
  grid-template-columns: 1fr 1fr;
  min-width: 0;
}
.live-col {
  display: flex;
  flex-direction: column;
  min-width: 0;
  border-right: 1px solid var(--line-soft);
}
.live-col:last-child { border-right: none; }
.live-label {
  padding: 10px 16px;
  font-size: 12px;
  font-weight: 650;
  color: var(--text-2);
  background: linear-gradient(180deg, #fafbfc, #fff);
  border-bottom: 1px solid var(--line-soft);
  display: flex;
  align-items: center;
  gap: 7px;
}
.live-col:first-child .live-label::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 2px;
  background: #c9cdd4;
}
.live-col:last-child .live-label::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 2px;
  background: var(--primary);
  box-shadow: 0 0 0 3px rgba(0, 82, 217, .12);
}
.live-text {
  padding: 16px 18px;
  font-size: 14.5px;
  line-height: 2;
  letter-spacing: .2px;
  white-space: pre-wrap;
  word-break: break-word;
  min-height: 340px;
  max-height: 600px;
  overflow: auto;
  scroll-behavior: smooth;
}
.live-src { color: var(--muted); }
.live-dst { color: var(--text); position: relative; }
.live-dst.is-changed { background: #f7faff; }

.caret {
  display: inline-block;
  width: 2px;
  height: 15px;
  vertical-align: -2px;
  background: var(--primary);
  margin-left: 1px;
  animation: caret-blink 1s steps(2, start) infinite;
}
@keyframes caret-blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0; }
}
.caret.done { display: none; }

@media (max-width: 720px) {
  .live-wrap { grid-template-columns: 1fr; }
  .live-col { border-right: none; border-bottom: 1px solid var(--line-soft); }
}

/* ------------------------------------------------------------ 待人工确认 */
.review-tip {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.7;
  margin-bottom: 8px;
}
.review-list {
  max-height: 220px;
  overflow: auto;
  border: 1px solid #ffe4ba;
  border-radius: 6px;
  background: #fffbf2;
}
.review-row {
  display: flex;
  gap: 10px;
  padding: 7px 12px;
  font-size: 12.5px;
  line-height: 1.6;
  border-bottom: 1px solid #fff2dc;
}
.review-row:last-child { border-bottom: none; }
.review-no {
  flex: 0 0 auto;
  color: #b8720a;
  font-variant-numeric: tabular-nums;
}
.review-text { color: #7a5a20; }


/* ------------------------------------------------------------ 移动端 */
@media (max-width: 720px) {
  .nav-inner { height: 56px; gap: 16px; padding: 0 14px; }
  .nav-links { gap: 16px; }
  .nav-links a { font-size: 13px; }
  .hero { padding: 30px 0 18px; }
  .hero h1 { font-size: 24px; }
  .hero p { font-size: 13px; }
  .hero-tags { gap: 7px; margin-top: 14px; }
  .hero-tag { font-size: 11.5px; padding: 4px 10px; }
  .page { padding: 0 12px 48px; }
  .panel-head { padding: 12px 16px; }
  textarea#source { padding: 16px; min-height: 260px; font-size: 14.5px; }
  .panel-foot { padding: 10px 16px; }
  .run-state { padding: 0 16px 12px; }
  .report { padding: 0 16px 18px; }
  .result-head { flex-direction: column; align-items: stretch; }
  .result-actions { flex-wrap: wrap; }
  .live-text { padding: 13px; font-size: 14px; min-height: 240px; }
  .seg { grid-template-columns: 34px 1fr; }
  .seg-body { grid-template-columns: 1fr; }
  .seg-src { border-right: none; border-bottom: 1px solid var(--line-soft); }
}
