:root {
    --case-accent: #7b292b;
    --case-accent-active: #983438;
    --case-ink: #171b20;
    --case-copy: #4f5963;
    --case-muted: #737d86;
    --case-line: #cfd5d9;
    --case-soft-line: #e2e6e8;
    --case-surface: #edf0f2;
    --case-surface-deep: #e3e8eb;
    --case-white: #fcfcfb;
    --case-header-height: 72px;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; overflow-x: clip; }
body {
    margin: 0;
    padding-top: var(--case-header-height);
    color: var(--case-ink);
    background: var(--case-white);
    font-family: "Alibaba PuHuiTi", "Microsoft YaHei", "PingFang SC", Arial, sans-serif;
    line-height: 1.65;
    overflow-x: hidden;
}
button, input { font: inherit; }
button, a, input { -webkit-tap-highlight-color: transparent; }
img { display: block; max-width: 100%; }
[hidden] { display: none !important; }

.case-shell {
    width: min(calc(100% - 96px), 1400px);
    margin-inline: auto;
}

.case-archive-section {
    padding: 76px 0 132px;
    background: var(--case-white);
    scroll-margin-top: var(--case-header-height);
}

.case-archive-layout {
    display: grid;
    grid-template-columns: minmax(250px, 300px) minmax(0, 1fr);
    gap: clamp(56px, 6vw, 96px);
    align-items: start;
}

.case-index {
    position: sticky;
    top: calc(var(--case-header-height) + 36px);
}

.case-filters { border-top: 1px solid var(--case-line); }

.case-filter {
    position: relative;
    display: block;
    width: 100%;
    padding: 14px 4px 14px 0;
    border: 0;
    border-bottom: 1px solid var(--case-soft-line);
    border-radius: 0;
    color: var(--case-copy);
    background: transparent;
    text-align: start;
    cursor: pointer;
    transition: color .2s ease;
}

.case-filter::after {
    content: "";
    position: absolute;
    right: 0;
    bottom: -1px;
    left: 0;
    height: 1px;
    background: var(--case-accent);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform .24s cubic-bezier(.16, 1, .3, 1);
}

[dir="rtl"] .case-filter::after,
html[lang="ar"] .case-filter::after { transform-origin: right; }

.case-filter:hover,
.case-filter:focus-visible,
.case-filter[aria-pressed="true"] {
    color: var(--case-accent);
    outline: none;
}

.case-filter[aria-pressed="true"] { font-weight: 650; }
.case-filter[aria-pressed="true"]::after { transform: scaleX(1); }

.case-search { margin-top: 36px; }
.case-search label {
    display: block;
    margin-bottom: 9px;
    color: var(--case-ink);
    font-size: 13px;
    font-weight: 650;
}

.case-search-field { position: relative; }

.case-search input {
    width: 100%;
    height: 46px;
    padding: 0 64px 0 13px;
    border: 1px solid #aeb5ba;
    border-radius: 8px;
    color: var(--case-ink);
    background: var(--case-white);
    font-size: 14px;
}

html[lang="ar"] .case-search { direction: rtl; }
[dir="rtl"] .case-search input,
html[lang="ar"] .case-search input { padding: 0 13px 0 64px; text-align: right; }
.case-search input::placeholder { color: #646e76; }
.case-search input:focus {
    border-color: var(--case-accent);
    outline: 2px solid rgba(123, 41, 43, .18);
    outline-offset: 2px;
}

.case-search-clear {
    position: absolute;
    top: 50%;
    right: 12px;
    padding: 4px 0;
    border: 0;
    border-bottom: 1px solid transparent;
    border-radius: 0;
    color: var(--case-accent);
    background: transparent;
    font-size: 12px;
    font-weight: 650;
    line-height: 1;
    cursor: pointer;
    transform: translateY(-50%);
}

[dir="rtl"] .case-search-clear,
html[lang="ar"] .case-search-clear { right: auto; left: 12px; }
.case-search-clear:hover { border-bottom-color: currentColor; }
.case-search-clear:focus-visible { outline: 2px solid rgba(123, 41, 43, .28); outline-offset: 3px; }
.case-result-count { margin: 14px 0 0; color: var(--case-muted); font-size: 12px; }

.case-projects { min-width: 0; }

.case-loading {
    min-height: 320px;
    padding: 72px 0;
    border-top: 1px solid var(--case-line);
    color: var(--case-muted);
    font-size: 14px;
}

.case-project {
    min-width: 0;
    padding-bottom: clamp(42px, 4.2vw, 56px);
    border-bottom: 1px solid var(--case-line);
}

.case-project + .case-project { padding-top: clamp(42px, 4.2vw, 56px); }
.case-project[hidden] { display: none; }

.case-project-head {
    max-width: 860px;
    margin-bottom: 18px;
}

.case-project-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 20px;
    margin-bottom: 12px;
    color: var(--case-muted);
    font-size: 12px;
    font-weight: 600;
}

.case-project-meta span:first-child { color: var(--case-accent); }
.case-project-meta span + span { position: relative; padding-inline-start: 20px; }
.case-project-meta span + span::before {
    content: "";
    position: absolute;
    top: .65em;
    left: 0;
    width: 10px;
    height: 1px;
    background: var(--case-line);
}

[dir="rtl"] .case-project-meta span + span::before,
html[lang="ar"] .case-project-meta span + span::before { right: 0; left: auto; }

.case-project h2 {
    margin: 0;
    max-width: 18em;
    font-size: clamp(29px, 2.6vw, 38px);
    font-weight: 620;
    letter-spacing: -.03em;
    line-height: 1.28;
}

.case-project-lead {
    max-width: 66ch;
    margin: 12px 0 0;
    color: var(--case-copy);
    font-size: 15px;
    line-height: 1.62;
}

.case-gallery {
    min-width: 0;
}

.case-gallery-stage {
    position: relative;
    height: clamp(320px, 29vw, 390px);
    overflow: hidden;
    background: var(--case-surface-deep);
}

.case-gallery-slide {
    position: absolute;
    inset: 0;
    display: grid;
    grid-template-rows: minmax(0, 1fr) 38px;
    margin: 0;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity .28s cubic-bezier(.16, 1, .3, 1), visibility 0s linear .28s;
}

.case-gallery-slide.is-active {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transition-delay: 0s;
}

.case-gallery-frame {
    min-height: 0;
    background: var(--case-surface-deep);
    overflow: hidden;
}

.case-gallery-frame img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.case-gallery-frame--document { background: #f4f5f5; }
.case-gallery-frame--document img { object-fit: contain; }

.case-gallery-slide figcaption {
    display: flex;
    align-items: center;
    padding: 0 12px;
    color: var(--case-muted);
    background: var(--case-white);
    font-size: 11px;
    font-weight: 600;
    line-height: 1.3;
}

.case-gallery-controls {
    position: absolute;
    inset: 0 0 38px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 16px;
    direction: ltr;
    pointer-events: none;
}

.case-gallery-arrow {
    display: grid;
    width: 44px;
    height: 44px;
    padding: 0 0 3px;
    border: 1px solid rgba(255, 255, 255, .36);
    border-radius: 8px;
    color: #f7f7f5;
    background: rgba(23, 27, 32, .76);
    place-items: center;
    font-size: 30px;
    line-height: 1;
    cursor: pointer;
    pointer-events: auto;
    transition: background-color .2s ease, transform .2s cubic-bezier(.16, 1, .3, 1);
}

.case-gallery-arrow:hover { background: rgba(123, 41, 43, .94); transform: translateY(-1px); }
.case-gallery-arrow:active { transform: translateY(1px); }
.case-gallery-arrow:focus-visible { outline: 2px solid rgba(255, 255, 255, .92); outline-offset: 3px; }

.case-gallery-nav {
    display: flex;
    min-height: 54px;
    align-items: center;
    gap: 18px;
    padding-top: 8px;
}

.case-gallery-counter {
    min-width: 42px;
    color: var(--case-muted);
    font-size: 12px;
    font-weight: 650;
    white-space: nowrap;
}

.case-gallery-thumbs {
    display: flex;
    min-width: 0;
    gap: 8px;
    overflow-x: auto;
    padding: 2px;
    scrollbar-width: thin;
}

.case-gallery-thumb {
    flex: 0 0 74px;
    width: 74px;
    height: 48px;
    padding: 0;
    border: 1px solid var(--case-line);
    border-radius: 0;
    background: var(--case-surface);
    overflow: hidden;
    cursor: pointer;
    opacity: .6;
    transition: border-color .2s ease, opacity .2s ease, transform .2s cubic-bezier(.16, 1, .3, 1);
}

.case-gallery-thumb img { width: 100%; height: 100%; object-fit: cover; }
.case-gallery-thumb:hover { opacity: .9; transform: translateY(-1px); }
.case-gallery-thumb.is-active { border-color: var(--case-accent); opacity: 1; }
.case-gallery-thumb:focus-visible { outline: 2px solid rgba(123, 41, 43, .34); outline-offset: 2px; }
.case-gallery.is-single .case-gallery-controls,
.case-gallery.is-single .case-gallery-nav { display: none; }

.case-gallery.is-single .case-gallery-stage { height: clamp(320px, 29vw, 390px); }

[dir="rtl"] .case-gallery-slide figcaption,
html[lang="ar"] .case-gallery-slide figcaption { justify-content: flex-start; text-align: right; }

[dir="rtl"] .case-gallery-nav,
html[lang="ar"] .case-gallery-nav { direction: rtl; }

[dir="rtl"] .case-gallery-thumbs,
html[lang="ar"] .case-gallery-thumbs { direction: rtl; }

.case-gallery-slide[aria-hidden="true"] img { visibility: hidden; }
.case-gallery-slide.is-active img { visibility: visible; }

.case-gallery-thumb img[src*="/technology/"] { object-fit: contain; background: #f4f5f5; }

.case-gallery.is-single .case-gallery-slide { transition: none; }

.case-gallery:not(.is-single) .case-gallery-stage { cursor: default; }

.case-gallery-thumb[aria-selected="true"] { cursor: default; }

.case-gallery-arrow[disabled] { cursor: default; opacity: .4; }

.case-gallery-arrow[disabled]:hover { background: rgba(23, 27, 32, .76); transform: none; }

.case-gallery-slide figcaption:empty { display: none; }

.case-gallery-slide:has(figcaption:empty) { grid-template-rows: 1fr; }

@supports not selector(:has(*)) {
    .case-gallery-slide figcaption:empty { min-height: 0; }
}

.case-file-facts {
    display: grid;
    grid-template-columns: .8fr 1.05fr 1.25fr;
    margin: 16px 0 0;
    padding: 16px 20px;
    background: var(--case-surface);
}

.case-file-facts > div { min-width: 0; padding-right: 24px; }
.case-file-facts > div + div { padding-inline-start: 24px; border-inline-start: 1px solid var(--case-line); }

.case-file-facts dt {
    margin-bottom: 7px;
    color: var(--case-muted);
    font-size: 11px;
    font-weight: 650;
}

.case-file-facts dd {
    margin: 0;
    color: var(--case-ink);
    font-size: 13px;
    font-weight: 560;
    line-height: 1.65;
}

.case-project-analysis {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: clamp(30px, 4vw, 56px);
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--case-soft-line);
}

.case-project-analysis section { min-width: 0; }
.case-project-analysis h3 { margin: 0 0 9px; font-size: 14px; font-weight: 680; }
.case-project-analysis p { max-width: 58ch; margin: 0; color: var(--case-copy); font-size: 13px; line-height: 1.68; }

.case-empty {
    min-height: 320px;
    padding: 80px 0;
    border-top: 1px solid var(--case-line);
}

.case-empty h3 { margin: 0; font-size: 28px; font-weight: 620; letter-spacing: -.03em; }
.case-empty p { max-width: 480px; margin: 12px 0 0; color: var(--case-copy); }

.case-method {
    padding: 96px 0 104px;
    border-top: 1px solid var(--case-line);
    background: var(--case-surface);
}

.case-method-layout {
    display: grid;
    grid-template-columns: minmax(280px, .72fr) minmax(0, 1.38fr);
    gap: clamp(58px, 7vw, 112px);
    align-items: start;
}

.case-method-intro {
    position: sticky;
    top: calc(var(--case-header-height) + 38px);
}

.case-method-intro h2 {
    max-width: 520px;
    margin: 0;
    font-size: clamp(28px, 2.55vw, 36px);
    font-weight: 620;
    letter-spacing: -.03em;
    line-height: 1.32;
    text-wrap: balance;
}

.case-method-lead {
    max-width: 46ch;
    margin: 20px 0 0;
    color: var(--case-copy);
    font-size: 16px;
    line-height: 1.78;
}

.case-method-reassurance {
    max-width: 44ch;
    margin: 34px 0 0;
    padding-top: 18px;
    border-top: 1px solid var(--case-line);
    color: var(--case-muted);
    font-size: 13px;
    line-height: 1.72;
}

.case-method-cta {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 50px;
    margin-top: 24px;
    padding: 0 26px;
    border: 1px solid var(--case-accent);
    border-radius: 8px;
    color: #fff;
    background: var(--case-accent);
    font-size: 14px;
    font-weight: 650;
    line-height: 1.2;
    text-decoration: none;
    white-space: nowrap;
    transition: background-color .2s ease, border-color .2s ease, transform .2s cubic-bezier(.16, 1, .3, 1);
}

.case-method-cta:hover { border-color: var(--case-accent-active); background: var(--case-accent-active); transform: translateY(-2px); }
.case-method-cta:active { transform: translateY(-1px); }
.case-method-cta:focus-visible { outline: 2px solid rgba(123, 41, 43, .3); outline-offset: 4px; }

.case-method-path { min-width: 0; border-top: 2px solid var(--case-ink); }

.case-method-item {
    display: grid;
    grid-template-columns: minmax(160px, .48fr) minmax(0, 1.52fr);
    gap: clamp(24px, 3vw, 44px);
    padding: 27px 0 29px;
    border-bottom: 1px solid var(--case-line);
}

.case-method-item h3 {
    margin: 0;
    font-size: 17px;
    font-weight: 650;
    line-height: 1.5;
}

.case-method-detail {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: clamp(22px, 2.8vw, 40px);
    min-width: 0;
}

.case-method-detail > div { min-width: 0; }
.case-method-label {
    display: block;
    margin-bottom: 8px;
    color: var(--case-muted);
    font-size: 12px;
    font-weight: 650;
    line-height: 1.45;
}

.case-method-detail p {
    margin: 0;
    color: var(--case-copy);
    font-size: 14px;
    line-height: 1.74;
    overflow-wrap: anywhere;
    hyphens: auto;
}

.case-method-response p { color: var(--case-ink); font-weight: 520; }
.case-method-note {
    max-width: 72ch;
    margin: 20px 0 0;
    color: var(--case-muted);
    font-size: 12px;
    line-height: 1.7;
}

html[lang="ar"] .case-method,
[dir="rtl"] .case-method { text-align: start; }

.case-contact-intro {
    max-width: 520px;
    margin: -18px 0 38px;
    color: rgba(255, 255, 255, .62);
    font-size: 15px;
}

.case-contact-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 16px; }
.contact .case-contact-expand { border: 1px solid var(--border-light); color: rgba(255, 255, 255, .68); background: transparent; }
.contact .case-contact-expand:hover,
.contact .case-contact-expand:focus-visible { border-color: rgba(255, 255, 255, .24); color: #f7f7f5; background: rgba(255, 255, 255, .04); box-shadow: none; }
.contact .contact-form-input:focus-visible,
.contact .contact-form-submit:focus-visible,
.contact .btn-pri:focus-visible { outline: 2px solid rgba(163, 58, 60, .72); outline-offset: 3px; }

@media (max-width: 1180px) {
    .case-archive-layout { grid-template-columns: 250px minmax(0, 1fr); gap: 54px; }
    .case-file-facts { padding: 19px 20px; }
    .case-method-layout { grid-template-columns: minmax(250px, .62fr) minmax(0, 1.38fr); gap: 52px; }
    .case-method-item { grid-template-columns: 140px minmax(0, 1fr); gap: 24px; }
    .case-method-detail { gap: 22px; }
}

@media (max-width: 900px) {
    .case-shell { width: min(calc(100% - 48px), 1400px); }
    .case-archive-section { padding: 58px 0 100px; }
    .case-archive-layout { grid-template-columns: 1fr; gap: 58px; }
    .case-index { position: static; }
    .case-filters { display: flex; gap: 20px; overflow-x: auto; scrollbar-width: thin; }
    .case-filter { flex: 0 0 auto; width: auto; padding-right: 2px; }
    .case-filter:hover,
    .case-filter:focus-visible,
    .case-filter[aria-pressed="true"] { padding-inline-start: 0; }
    .case-search { max-width: 420px; }
    .case-method { padding: 76px 0 84px; }
    .case-method-layout { grid-template-columns: 1fr; gap: 52px; }
    .case-method-intro { position: static; }
    .case-method-lead,
    .case-method-reassurance { max-width: 62ch; }
}

@media (max-width: 660px) {
    :root { --case-header-height: 64px; }
    body { padding-top: var(--case-header-height); }
    .case-shell { width: calc(100% - 32px); }
    .case-archive-section { padding: 42px 0 78px; }
    .case-archive-layout { gap: 46px; }
    .case-project { padding-bottom: 40px; }
    .case-project + .case-project { padding-top: 40px; }
    .case-project-head { margin-bottom: 16px; }
    .case-project h2 { font-size: 27px; }
    .case-project-lead { font-size: 14px; line-height: 1.7; }
    .case-gallery-stage,
    .case-gallery.is-single .case-gallery-stage { height: 246px; }
    .case-gallery-controls { padding: 0 10px; }
    .case-gallery-arrow { width: 40px; height: 40px; font-size: 27px; }
    .case-gallery-nav { min-height: 52px; gap: 12px; padding-top: 7px; }
    .case-gallery-thumb { flex-basis: 66px; width: 66px; height: 44px; }
    .case-file-facts { grid-template-columns: 1fr; margin-top: 14px; padding: 6px 18px; }
    .case-file-facts > div,
    .case-file-facts > div + div { padding: 10px 0; border-inline-start: 0; border-top: 1px solid var(--case-line); }
    .case-file-facts > div:first-child { border-top: 0; }
    .case-project-analysis { grid-template-columns: 1fr; gap: 14px; margin-top: 14px; padding-top: 14px; }
    .case-method { padding: 62px 0 70px; }
    .case-method-layout { gap: 42px; }
    .case-method-intro h2 { font-size: 27px; }
    .case-method-lead { margin-top: 16px; font-size: 15px; }
    .case-method-reassurance { margin-top: 26px; padding-top: 15px; }
    .case-method-cta { display: flex; width: 100%; }
    .case-method-item { grid-template-columns: 1fr; gap: 17px; padding: 23px 0 25px; }
    .case-method-detail { grid-template-columns: 1fr; gap: 17px; }
    .case-method-response { padding-top: 16px; border-top: 1px solid var(--case-soft-line); }
    .case-method-label { margin-bottom: 6px; }
    .case-contact-intro { margin-top: -14px; }
    .case-contact-actions { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
