/*
Theme Name: Traneasy 易翻译
Description: 易翻译官网迁移版，保留原有页面设计并适配 WordPress 内容管理。
Version: 1.0.9
Text Domain: traneasy
Requires at least: 6.4
Requires PHP: 7.4
*/

:root {
  --traneasy-brand: #084aff;
  --traneasy-ink: #000213;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--traneasy-ink);
  background: #fff;
}

body.admin-bar .traneasy-site-header {
  top: 32px;
}

.skip-to-content {
  position: fixed;
  top: 8px;
  left: 8px;
  z-index: 10000;
  padding: 10px 14px;
  color: #fff;
  background: var(--traneasy-brand);
  border-radius: 4px;
  transform: translateY(-150%);
}

.skip-to-content:focus {
  transform: translateY(0);
}

[role="region"][hidden] {
  display: none !important;
}

.traneasy-disabled {
  cursor: not-allowed;
  opacity: .58;
}

.nav-item[aria-current="page"] {
  color: var(--traneasy-brand) !important;
}

.traneasy-content-shell {
  min-height: 60vh;
  padding: 120px 24px 72px;
  background: #f8fafc;
}

.traneasy-content {
  max-width: 900px;
  margin: 0 auto;
  padding: 40px;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
}

.traneasy-content h1 {
  margin: 0 0 24px;
  font-size: 2rem;
}

.traneasy-content a {
  color: var(--traneasy-brand);
}

.traneasy-post-list {
  display: grid;
  gap: 20px;
}

.traneasy-post-list article {
  padding-bottom: 20px;
  border-bottom: 1px solid #e2e8f0;
}

@media (max-width: 782px) {
  body.admin-bar .traneasy-site-header {
    top: 46px;
  }
}

@media (max-width: 640px) {
  .traneasy-content-shell {
    padding: 96px 16px 48px;
  }

  .traneasy-content {
    padding: 24px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: .01ms !important;
  }
}

/* Footer spacing */
.traneasy-site-footer {
  padding-top: 64px;
  padding-bottom: 64px;
}

@media (max-width: 640px) {
  .traneasy-site-footer {
    padding-top: 48px;
    padding-bottom: 48px;
  }

  .traneasy-site-footer>div {
    padding-left: 24px;
    padding-right: 24px;
  }
}

/* Blog archive */
.traneasy-blog-page {
  min-height: 65vh;
  padding: 144px 24px 96px;
  background: #f8faff;
}

.traneasy-blog-inner {
  max-width: 1184px;
  margin: 0 auto;
}

.traneasy-blog-heading {
  max-width: 680px;
  margin-bottom: 52px;
}

.traneasy-blog-heading span {
  color: #2563eb;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .16em;
}

.traneasy-blog-heading h1 {
  margin: 14px 0;
  font-size: clamp(36px, 4vw, 52px);
  line-height: 1.2;
  font-weight: 700;
}

.traneasy-blog-heading p {
  color: #64748b;
  line-height: 1.8;
}

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

.traneasy-blog-card {
  overflow: hidden;
  background: white;
  border: 1px solid #e5eaf2;
  border-radius: 18px;
  box-shadow: 0 12px 35px rgba(30, 58, 100, .04);
}

.traneasy-blog-image {
  display: block;
  aspect-ratio: 16/9;
  background: #eaf1ff;
  overflow: hidden;
}

.traneasy-blog-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.traneasy-blog-card-content {
  padding: 28px;
}

.traneasy-blog-card time {
  font-size: 13px;
  color: #94a3b8;
}

.traneasy-blog-card h2 {
  margin: 14px 0 10px;
  font-size: 20px;
  line-height: 1.5;
  font-weight: 700;
}

.traneasy-blog-card p {
  color: #64748b;
  font-size: 15px;
  line-height: 1.8;
}

.traneasy-blog-card h2 a:hover,
.traneasy-blog-read {
  color: #084aff;
}

.traneasy-blog-read {
  display: inline-block;
  margin-top: 20px;
  font-size: 14px;
  font-weight: 600;
}

.traneasy-blog-empty {
  padding: 48px;
  border: 1px dashed #cbd9f6;
  border-radius: 18px;
  background: #fff;
}

.traneasy-blog-empty span {
  color: #7aa2ff;
  font-size: 32px;
}

.traneasy-blog-empty h2 {
  margin: 12px 0 8px;
  font-size: 20px;
  font-weight: 700;
}

.traneasy-blog-empty p {
  color: #64748b;
}

.traneasy-blog-pagination {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 36px;
}

.traneasy-blog-pagination .page-numbers {
  padding: 8px 14px;
  border: 1px solid #dce5f5;
  border-radius: 8px;
  background: #fff;
}

.traneasy-blog-pagination .current {
  background: #084aff;
  color: white;
  border-color: #084aff;
}

@media (max-width: 767px) {
  .traneasy-blog-page {
    padding: 112px 20px 64px;
  }

  .traneasy-blog-grid {
    grid-template-columns: 1fr;
  }

  .traneasy-blog-empty {
    padding: 28px;
  }
}

/* Article detail */
.traneasy-article-page {
  min-height: 65vh;
  padding: 116px 24px 96px;
  background: #f8faff;
}

.traneasy-article-wrap {
  max-width: 960px;
  margin: 0 auto;
}

.traneasy-breadcrumb {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 24px;
  color: #94a3b8;
  font-size: 14px;
}

.traneasy-breadcrumb a {
  color: #64748b;
}

.traneasy-breadcrumb a:hover {
  color: #084aff;
}

.traneasy-article {
  overflow: hidden;
  padding: 56px 64px;
  border: 1px solid #e5eaf2;
  border-radius: 20px;
  background: #fff;
  box-shadow: 0 16px 45px rgba(30, 58, 100, .04);
}

.traneasy-article-header {
  padding-bottom: 30px;
  border-bottom: 1px solid #edf0f5;
}

.traneasy-article-categories {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.traneasy-article-categories a,
.traneasy-article-tags a {
  display: inline-block;
  padding: 5px 12px;
  border-radius: 999px;
  background: #edf3ff;
  color: #205dff;
  font-size: 13px;
  font-weight: 600;
}

.traneasy-article-header h1 {
  margin: 18px 0;
  color: #0f172a;
  font-size: clamp(28px, 4vw, 42px);
  line-height: 1.3;
  font-weight: 700;
  overflow-wrap: anywhere;
}

.traneasy-article-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  color: #94a3b8;
  font-size: 14px;
}

.traneasy-article-cover {
  display: grid;
  aspect-ratio: 16 / 9;
  margin: 32px 0 0;
  overflow: hidden;
  place-items: center;
  border: 1px solid #e6ebf4;
  border-radius: 14px;
  background: #f8faff;
}

.traneasy-article-cover img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.traneasy-article-body {
  padding-top: 32px;
  color: #334155;
  font-size: 16px;
  line-height: 1.9;
  overflow-wrap: anywhere;
}

.traneasy-article-body>* {
  margin-bottom: 1.4em;
}

.traneasy-article-body h2,
.traneasy-article-body h3,
.traneasy-article-body h4 {
  margin: 1.8em 0 .7em;
  color: #0f172a;
  font-weight: 700;
  line-height: 1.4;
}

.traneasy-article-body h2 {
  font-size: 1.6em;
}

.traneasy-article-body h3 {
  font-size: 1.3em;
}

.traneasy-article-body a {
  color: #084aff;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.traneasy-article-body ul,
.traneasy-article-body ol {
  padding-left: 1.6em;
  list-style: revert;
}

.traneasy-article-body li {
  margin: .4em 0;
}

.traneasy-article-body img,
.traneasy-article-body video,
.traneasy-article-body iframe {
  max-width: 100%;
  height: auto;
}

.traneasy-article-body iframe {
  aspect-ratio: 16/9;
}

.traneasy-article-body blockquote {
  margin: 1.5em 0;
  padding: 18px 24px;
  border-left: 4px solid #3570ff;
  background: #f5f8ff;
  color: #475569;
}

.traneasy-article-body pre {
  overflow-x: auto;
  padding: 20px;
  border-radius: 10px;
  background: #0f172a;
  color: #e2e8f0;
}

.traneasy-article-body table {
  display: block;
  max-width: 100%;
  overflow-x: auto;
  border-collapse: collapse;
}

.traneasy-article-body th,
.traneasy-article-body td {
  padding: 10px 14px;
  border: 1px solid #e2e8f0;
}

.traneasy-article-tags {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  padding-top: 24px;
  border-top: 1px solid #edf0f5;
  color: #64748b;
  font-size: 14px;
}

.traneasy-article-nav {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin-top: 24px;
}

.traneasy-article-nav a {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 22px 24px;
  border: 1px solid #e5eaf2;
  border-radius: 14px;
  background: #fff;
}

.traneasy-article-nav a:hover strong {
  color: #084aff;
}

.traneasy-article-nav span {
  color: #94a3b8;
  font-size: 13px;
}

.traneasy-article-nav strong {
  color: #334155;
  font-size: 15px;
  overflow-wrap: anywhere;
}

.traneasy-article-back {
  display: inline-block;
  margin-top: 32px;
  color: #084aff;
  font-weight: 600;
}

.traneasy-article-page a:focus-visible {
  outline: 2px solid #2563eb;
  outline-offset: 3px;
}

@media (max-width: 640px) {
  .traneasy-article-page {
    padding: 100px 16px 64px;
  }

  .traneasy-article {
    padding: 28px 22px;
    border-radius: 14px;
  }

  .traneasy-article-nav {
    grid-template-columns: 1fr;
  }

  .traneasy-article-nav:has(> div:empty) {
    gap: 0;
  }
}

/* Blog and article navigation arrows */
.traneasy-blog-read,
.traneasy-article-back {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.traneasy-arrow {
  position: relative;
  display: inline-flex;
  flex: 0 0 28px;
  width: 28px;
  height: 28px;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: #edf3ff;
  transition: transform .2s ease, background-color .2s ease;
}

.traneasy-arrow::before {
  content: '';
  width: 10px;
  height: 1.5px;
  background: currentColor;
}

.traneasy-arrow::after {
  content: '';
  position: absolute;
  width: 6px;
  height: 6px;
  border-top: 1.5px solid currentColor;
  border-right: 1.5px solid currentColor;
}

.traneasy-arrow-right::after {
  right: 8px;
  transform: rotate(45deg);
}

.traneasy-arrow-left::after {
  left: 8px;
  transform: rotate(-135deg);
}

.traneasy-blog-read:hover .traneasy-arrow-right {
  transform: translateX(3px);
  background: #dce9ff;
}

.traneasy-article-back:hover .traneasy-arrow-left {
  transform: translateX(-3px);
  background: #dce9ff;
}

.traneasy-breadcrumb {
  align-items: center;
}

.traneasy-breadcrumb-arrow {
  width: 6px;
  height: 6px;
  border-top: 1.5px solid #b4c0d0;
  border-right: 1.5px solid #b4c0d0;
  transform: rotate(45deg);
  margin: 0 2px;
}

.traneasy-article-nav a {
  position: relative;
  padding-right: 50px;
}

.traneasy-article-nav a::after {
  content: '→';
  position: absolute;
  right: 22px;
  top: 50%;
  transform: translateY(-50%);
  color: #205dff;
  font-size: 20px;
}

.traneasy-article-nav>div:first-child a::after {
  content: '←';
}

@media (prefers-reduced-motion: reduce) {
  .traneasy-arrow {
    transition: none;
  }
}

/* About page */
.traneasy-about-page {
  color: #0f172a;
}

.traneasy-about-inner {
  width: min(1184px, calc(100% - 48px));
  margin: 0 auto;
}

.traneasy-about-hero {
  padding: 168px 0 112px;
  background: radial-gradient(circle at 78% 28%, rgba(73, 126, 255, .17), transparent 28%), linear-gradient(145deg, #edf4ff 0%, #fff 62%);
}

.traneasy-about-hero .traneasy-about-inner {
  max-width: 820px;
  text-align: center;
}

.traneasy-about-eyebrow,
.traneasy-about-label {
  display: block;
  margin-bottom: 16px;
  color: #205dff;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .16em;
}

.traneasy-about-hero h1 {
  margin: 0;
  font-size: clamp(42px, 6vw, 68px);
  line-height: 1.15;
  font-weight: 700;
  letter-spacing: -.035em;
}

.traneasy-about-hero p {
  max-width: 680px;
  margin: 24px auto 0;
  color: #526077;
  font-size: 18px;
  line-height: 1.9;
}

.traneasy-about-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 14px;
  margin-top: 38px;
}

.traneasy-about-actions a {
  display: inline-flex;
  align-items: center;
  gap: 18px;
  padding: 13px 24px;
  border-radius: 8px;
  font-weight: 600;
}

.traneasy-about-primary {
  background: #084aff;
  color: #fff;
  box-shadow: 0 12px 30px rgba(8, 74, 255, .2);
}

.traneasy-about-primary:hover {
  background: #003dcc;
}

.traneasy-about-secondary {
  border: 1px solid #ced9ea;
  background: rgba(255, 255, 255, .8);
  color: #334155;
}

.traneasy-about-secondary:hover {
  border-color: #9fb4d8;
}

.traneasy-about-section {
  padding: 104px 0;
}

.traneasy-about-muted {
  background: #ffffff;
}

.traneasy-about-intro {
  display: grid;
  grid-template-columns: .9fr 1.1fr;
  gap: 96px;
  align-items: start;
}

.traneasy-about-section h2,
.traneasy-about-contact h2 {
  margin: 0;
  font-size: clamp(28px, 3vw, 40px);
  line-height: 1.35;
  font-weight: 700;
  letter-spacing: -.02em;
}

.traneasy-about-intro p,
.traneasy-about-heading p {
  margin: 0 0 18px;
  color: #64748b;
  font-size: 16px;
  line-height: 1.9;
}

.traneasy-about-heading {
  max-width: 680px;
  margin-bottom: 48px;
}

.traneasy-about-heading p {
  margin-top: 16px;
}

.traneasy-about-cards {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 22px;
}

.traneasy-about-cards article {
  padding: 32px;
  border: 1px solid #e4eaf4;
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 12px 35px rgba(30, 58, 100, .04);
}

.traneasy-about-card-icon {
  display: grid;
  width: 48px;
  height: 48px;
  place-items: center;
  border-radius: 14px;
  background: #edf3ff;
  color: #205dff;
  font-weight: 700;
}

.traneasy-about-cards h3,
.traneasy-about-values h3 {
  margin: 22px 0 10px;
  font-size: 19px;
  font-weight: 700;
}

.traneasy-about-cards p,
.traneasy-about-values p {
  color: #64748b;
  line-height: 1.8;
}

.traneasy-about-values {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  border-top: 1px solid #e2e8f0;
}

.traneasy-about-values>div {
  padding: 36px 36px 0 0;
}

.traneasy-about-values strong {
  color: #a9bce8;
  font-size: 14px;
}

.traneasy-about-values h3 {
  margin-top: 14px;
}

.traneasy-about-contact {
  padding: 80px 0;
  background: #07102e;
  color: #fff;
}

.traneasy-about-contact .traneasy-about-inner {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 40px;
}

.traneasy-about-contact p {
  margin: 14px 0 0;
  color: rgba(255, 255, 255, .65);
}

.traneasy-about-contact a {
  display: inline-flex;
  gap: 14px;
  color: #fff;
  font-weight: 600;
}

.traneasy-about-custom {
  padding: 88px 24px;
  background: #f8faff;
}

.traneasy-about-prose {
  max-width: 900px;
  margin: 0 auto;
  padding: 48px;
  border-radius: 18px;
  background: #fff;
  color: #334155;
  line-height: 1.9;
}

.traneasy-about-prose>* {
  margin-bottom: 1.3em;
}

.traneasy-about-prose h2,
.traneasy-about-prose h3 {
  color: #0f172a;
  font-weight: 700;
}

.traneasy-about-page a:focus-visible {
  outline: 2px solid #2563eb;
  outline-offset: 3px;
}

@media (max-width: 767px) {
  .traneasy-about-inner {
    width: min(100% - 40px, 1184px);
  }

  .traneasy-about-hero {
    padding: 128px 0 72px;
  }

  .traneasy-about-section {
    padding: 68px 0;
  }

  .traneasy-about-intro,
  .traneasy-about-cards,
  .traneasy-about-values {
    grid-template-columns: 1fr;
    gap: 28px;
  }

  .traneasy-about-contact .traneasy-about-inner {
    align-items: flex-start;
    flex-direction: column;
  }

  .traneasy-about-prose {
    padding: 26px;
  }
}

/* Article three-column layout */
.traneasy-article-wrap {
  max-width: 1440px;
}

.traneasy-article-layout {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr) 280px;
  gap: 24px;
  align-items: start;
}

.traneasy-article-main-column {
  min-width: 0;
}

.traneasy-article-sidebar {
  position: sticky;
  top: 100px;
  min-width: 0;
}

.traneasy-article-side-panel {
  overflow: hidden;
  padding: 22px;
  border: 1px solid #e5eaf2;
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 10px 30px rgba(30, 58, 100, .035);
}

.traneasy-article-side-panel > h2 {
  margin: 0 0 18px;
  padding-bottom: 14px;
  border-bottom: 1px solid #edf0f5;
  color: #0f172a;
  font-size: 16px;
  font-weight: 700;
}

.traneasy-article-toc ol {
  display: grid;
  gap: 4px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.traneasy-article-toc li {
  position: relative;
}

.traneasy-article-toc a {
  display: block;
  padding: 7px 0 7px 13px;
  border-left: 2px solid #e4eaf4;
  color: #64748b;
  font-size: 13px;
  line-height: 1.55;
  overflow-wrap: anywhere;
}

.traneasy-article-toc a:hover {
  border-left-color: #2563eb;
  color: #205dff;
}

.traneasy-article-toc .toc-level-3 a { padding-left: 23px; }
.traneasy-article-toc .toc-level-4 a { padding-left: 33px; font-size: 12px; }

.traneasy-article-body h2[id],
.traneasy-article-body h3[id],
.traneasy-article-body h4[id] {
  scroll-margin-top: 110px;
}

.traneasy-article-side-empty {
  margin: 0;
  color: #94a3b8;
  font-size: 13px;
  line-height: 1.7;
}

.traneasy-related-list {
  display: grid;
  gap: 18px;
}

.traneasy-related-card {
  overflow: hidden;
  border: 1px solid #e8edf5;
  border-radius: 12px;
  background: #fff;
  transition: border-color .2s ease, transform .2s ease, box-shadow .2s ease;
}

.traneasy-related-card:hover {
  transform: translateY(-2px);
  border-color: #cbd8ef;
  box-shadow: 0 10px 24px rgba(30, 58, 100, .07);
}

.traneasy-related-image {
  display: block;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: #f2f5fb;
}

.traneasy-related-image img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .3s ease;
}

.traneasy-related-card:hover .traneasy-related-image img {
  transform: scale(1.035);
}

.traneasy-related-content {
  padding: 14px;
}

.traneasy-related-content time {
  color: #94a3b8;
  font-size: 11px;
}

.traneasy-related-content h3 {
  margin: 7px 0 0;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.55;
}

.traneasy-related-content h3 a {
  color: #334155;
}

.traneasy-related-content h3 a:hover {
  color: #205dff;
}

@media (max-width: 1180px) {
  .traneasy-article-layout {
    grid-template-columns: minmax(0, 1fr) 260px;
  }

  .traneasy-article-toc {
    position: static;
    grid-column: 1 / -1;
  }

  .traneasy-article-toc .traneasy-article-side-panel {
    padding: 20px 24px;
  }

  .traneasy-article-toc ol {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    column-gap: 24px;
  }
}

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

  .traneasy-article-sidebar {
    position: static;
  }

  .traneasy-article-toc,
  .traneasy-related {
    grid-column: auto;
  }

  .traneasy-related-list {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .traneasy-article-layout { gap: 18px; }
  .traneasy-article-toc ol { grid-template-columns: 1fr; }
  .traneasy-related-list { grid-template-columns: 1fr; }
  .traneasy-related-card { display: grid; grid-template-columns: 112px minmax(0, 1fr); }
  .traneasy-related-image { aspect-ratio: 1 / 1; }
}

@media (prefers-reduced-motion: reduce) {
  .traneasy-related-card,
  .traneasy-related-image img { transition: none; }
  .traneasy-related-card:hover { transform: none; }
  .traneasy-related-card:hover .traneasy-related-image img { transform: none; }
}


/* Article author meta */
.traneasy-article-author {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}
.traneasy-article-author a { color: #64748b; font-weight: 600; }
.traneasy-article-author a:hover { color: #205dff; }
.traneasy-author-icon {
  position: relative;
  display: inline-block;
  width: 24px;
  height: 24px;
  flex: 0 0 24px;
  overflow: hidden;
  border-radius: 50%;
  background: #edf3ff;
}
.traneasy-author-icon::before {
  position: absolute;
  top: 5px;
  left: 9px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #5d83dc;
  content: '';
}
.traneasy-author-icon::after {
  position: absolute;
  right: 5px;
  bottom: 4px;
  left: 5px;
  height: 7px;
  border-radius: 8px 8px 5px 5px;
  background: #5d83dc;
  content: '';
}
