/* Ensure box-sizing matches source demo */
*,
*::before,
*::after {
    box-sizing: border-box;
}

:root {
    --glass-edge: rgba(255, 255, 255, 0.85);
}

/* ——— Core 3D shell ——— */
.ux-parent {
    width: 100%;
    max-width: 400px;
    height: 300px;
    margin-inline: auto;
    perspective: 1000px;
    perspective-origin: 50% 50%;
    filter: drop-shadow(0 28px 50px rgba(0, 40, 30, 0.45));
}

.ux-parent--wide {
    max-width: none;
    width: 100%;
}

.ux-card {
    position: relative;
    height: 100%;
    border-radius: 50px;
    background: var(--ux-grad);
    transform-style: preserve-3d;
    transition:
        transform 0.55s cubic-bezier(0.22, 1, 0.36, 1),
        box-shadow 0.55s ease;
    box-shadow:
        rgba(5, 71, 17, 0) 40px 50px 25px -40px,
        rgba(5, 71, 17, 0.28) 0 25px 25px -5px;
}

.ux-parent:hover .ux-card {
    transform: rotate3d(1, 1, 0, 28deg);
    box-shadow:
        rgba(5, 71, 17, 0.45) 28px 48px 28px -38px,
        rgba(0, 255, 214, 0.12) 0 0 60px -10px,
        rgba(5, 71, 17, 0.15) 0 25px 35px 0;
}

/* Themes */
.ux-parent--mint {
    --ux-grad: linear-gradient(135deg, rgb(0, 255, 214) 0%, rgb(8, 226, 96) 100%);
    --ux-title: #00894d;
    --ux-body: rgba(0, 137, 78, 0.82);
    --ux-cta: #00c37b;
    --ux-orbit: rgba(0, 249, 203, 0.22);
    --ux-fill: #00894d;
}

.ux-parent--violet {
    --ux-grad: linear-gradient(145deg, #a855f7 0%, #6366f1 40%, #ec4899 100%);
    --ux-title: #3b0764;
    --ux-body: rgba(59, 7, 100, 0.85);
    --ux-cta: #7c3aed;
    --ux-orbit: rgba(216, 180, 254, 0.35);
    --ux-fill: #5b21b6;
}

.ux-parent--solar {
    --ux-grad: linear-gradient(135deg, #fbbf24 0%, #f97316 45%, #dc2626 100%);
    --ux-title: #7c2d12;
    --ux-body: rgba(124, 45, 18, 0.88);
    --ux-cta: #c2410c;
    --ux-orbit: rgba(254, 243, 199, 0.4);
    --ux-fill: #9a3412;
}

.ux-parent--ocean {
    --ux-grad: linear-gradient(155deg, #22d3ee 0%, #0284c7 50%, #1e3a8a 100%);
    --ux-title: #0c4a6e;
    --ux-body: rgba(12, 74, 110, 0.88);
    --ux-cta: #0369a1;
    --ux-orbit: rgba(125, 211, 252, 0.35);
    --ux-fill: #0e7490;
}

.ux-parent--prism {
    --ux-grad: conic-gradient(from 200deg at 65% 35%, #22d3ee, #818cf8, #f472b6, #facc15, #22d3ee);
    --ux-title: #0f172a;
    --ux-body: rgba(15, 23, 42, 0.88);
    --ux-cta: #4338ca;
    --ux-orbit: rgba(255, 255, 255, 0.35);
    --ux-fill: #312e81;
}

.ux-parent--void {
    --ux-grad: linear-gradient(160deg, #0f172a 0%, #1e1b4b 50%, #312e81 100%);
    --ux-title: #5eead4;
    --ux-body: rgba(203, 213, 225, 0.82);
    --ux-cta: #c084fc;
    --ux-orbit: rgba(167, 139, 250, 0.25);
    --ux-fill: #c084fc;
}

.ux-parent--void .ux-card {
    box-shadow:
        rgba(5, 71, 17, 0) 40px 50px 25px -40px,
        rgba(0, 0, 0, 0.5) 0 25px 35px -5px;
}

/* Glass */
.ux-glass {
    transform-style: preserve-3d;
    position: absolute;
    inset: 8px;
    border-radius: 55px;
    border-top-right-radius: 100%;
    background: linear-gradient(0deg, rgba(255, 255, 255, 0.38) 0%, rgba(255, 255, 255, 0.82) 100%);
    transform: translate3d(0, 0, 25px);
    border-inline-start: 1px solid var(--glass-edge);
    border-bottom: 1px solid rgba(255, 255, 255, 0.75);
    transition: all 0.5s ease-in-out;
    pointer-events: none;
}

.ux-parent--void .ux-glass {
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.12) 0%, rgba(15, 23, 42, 0.55) 100%);
    border-color: rgba(148, 163, 184, 0.25);
}

/* Shape modifiers — after glass base so they can override */
.ux-parent--cut {
    clip-path: polygon(16px 0, calc(100% - 16px) 0, 100% 16px, 100% calc(100% - 16px), calc(100% - 16px) 100%, 16px 100%, 0 calc(100% - 16px), 0 16px);
    filter: none;
}

.ux-parent--cut .ux-card {
    border-radius: 36px;
}

.ux-parent--cut .ux-glass {
    border-radius: 32px !important;
    border-top-right-radius: 32px !important;
    clip-path: polygon(14px 0, calc(100% - 14px) 0, 100% 14px, 100% calc(100% - 14px), calc(100% - 14px) 100%, 14px 100%, 0 calc(100% - 14px), 0 14px);
}

.ux-parent--wide {
    height: 230px;
}

.ux-parent--wide .ux-card {
    border-radius: 44px;
}

.ux-parent--wide .ux-glass {
    border-radius: 48px;
    border-top-right-radius: 55%;
}

.ux-parent--wide .ux-content {
    padding: 2rem 50% 0 1.75rem !important;
}

.ux-parent--wide .ux-logo .ux-circle:nth-child(1) {
    width: 180px;
    height: 180px;
}

/* Logo orbits */
.ux-logo {
    position: absolute;
    inset-inline-end: 0;
    top: 0;
    transform-style: preserve-3d;
    pointer-events: none;
    z-index: 2;
}

.ux-circle {
    display: block;
    position: absolute;
    aspect-ratio: 1;
    border-radius: 50%;
    top: 0;
    inset-inline-end: 0;
    background: var(--ux-orbit);
    box-shadow: rgba(100, 100, 111, 0.25) -10px 10px 24px 0;
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    transition: all 0.5s ease-in-out;
}

.ux-circle:nth-child(1) {
    width: 170px;
    transform: translate3d(0, 0, 20px);
    top: 8px;
    inset-inline-end: 8px;
}
.ux-circle:nth-child(2) {
    width: 140px;
    transform: translate3d(0, 0, 40px);
    top: 10px;
    inset-inline-end: 10px;
    backdrop-filter: blur(4px);
    transition-delay: 0.05s;
}
.ux-circle:nth-child(3) {
    width: 110px;
    transform: translate3d(0, 0, 60px);
    top: 17px;
    inset-inline-end: 17px;
    transition-delay: 0.1s;
}
.ux-circle:nth-child(4) {
    width: 80px;
    transform: translate3d(0, 0, 80px);
    top: 23px;
    inset-inline-end: 23px;
    transition-delay: 0.15s;
}
.ux-circle:nth-child(5) {
    width: 50px;
    transform: translate3d(0, 0, 100px);
    top: 30px;
    inset-inline-end: 30px;
    display: grid;
    place-content: center;
    transition-delay: 0.2s;
}

.ux-circle:nth-child(5) svg {
    width: 20px;
    fill: #fff;
}

.ux-parent:hover .ux-circle:nth-child(2) {
    transform: translate3d(0, 0, 60px);
}
.ux-parent:hover .ux-circle:nth-child(3) {
    transform: translate3d(0, 0, 80px);
}
.ux-parent:hover .ux-circle:nth-child(4) {
    transform: translate3d(0, 0, 100px);
}
.ux-parent:hover .ux-circle:nth-child(5) {
    transform: translate3d(0, 0, 120px);
}

/* Content */
.ux-content {
    padding: 100px 3.75rem 0 1.85rem;
    transform: translate3d(0, 0, 26px);
    position: relative;
    z-index: 3;
}

.ux-parent--wide .ux-logo .ux-circle:nth-child(2) {
    transform: translate3d(0, 0, 38px);
}

.ux-title {
    display: block;
    color: var(--ux-title);
    font-weight: 900;
    font-size: 1.25rem;
    letter-spacing: -0.02em;
}

.ux-text {
    display: block;
    margin-top: 1.05rem;
    color: var(--ux-body);
    font-size: 0.95rem;
    line-height: 1.5;
    font-weight: 600;
}

/* Bottom bar */
.ux-bottom {
    padding: 10px 12px;
    transform-style: preserve-3d;
    position: absolute;
    bottom: 20px;
    left: 20px;
    right: 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    transform: translate3d(0, 0, 26px);
    z-index: 4;
}

.ux-social {
    display: flex;
    gap: 10px;
    transform-style: preserve-3d;
}

.ux-social-btn {
    width: 32px;
    aspect-ratio: 1;
    padding: 6px;
    background: #fff;
    border-radius: 50%;
    border: none;
    display: grid;
    place-content: center;
    cursor: pointer;
    box-shadow: rgba(5, 71, 17, 0.45) 0 8px 6px -5px;
    transition:
        transform 0.2s ease-in-out,
        box-shadow 0.2s ease-in-out,
        background 0.2s;
}

.ux-social-btn:nth-child(1) {
    transition-delay: 0.05s;
}
.ux-social-btn:nth-child(2) {
    transition-delay: 0.1s;
}
.ux-social-btn:nth-child(3) {
    transition-delay: 0.15s;
}

.ux-social-btn svg {
    width: 15px;
    height: 15px;
    fill: var(--ux-fill);
}

.ux-social-btn:hover {
    background: #0f172a;
}
.ux-social-btn:hover svg {
    fill: #fff;
}
.ux-social-btn:active {
    background: #ffea00;
}
.ux-social-btn:active svg {
    fill: #0f172a;
}

.ux-parent:hover .ux-social-btn {
    transform: translate3d(0, 0, 50px);
    box-shadow: rgba(5, 71, 17, 0.25) -5px 20px 12px 0;
}

.ux-more {
    display: flex;
    align-items: center;
    gap: 4px;
    width: 42%;
    justify-content: flex-end;
    transition: transform 0.2s ease;
}

.ux-more:hover {
    transform: translate3d(0, 0, 10px);
}

.ux-more-btn {
    background: none;
    border: none;
    color: var(--ux-cta);
    font-weight: 800;
    font-size: 0.75rem;
    font-family: inherit;
    cursor: pointer;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    text-decoration: none;
}

.ux-more svg {
    fill: none;
    stroke: var(--ux-cta);
    stroke-width: 3px;
    max-height: 15px;
    width: 18px;
}

/* ============================================
   Override brutalist-theme vision styles
   ============================================ */
.vision-section {
    background: none !important;
    border-top: none !important;
    position: relative;
    z-index: 10;
}

.vision-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
    background: none;
    align-items: start;
}

/* Ensure cards render above body::after overlay */
.ux-parent {
    position: relative;
    z-index: 10;
}

/* Override reveal animation on cards to not break 3D context */
.ux-parent.reveal {
    opacity: 0;
    transform: none;
    transition: opacity 0.6s ease;
}
.ux-parent.reveal.active {
    opacity: 1;
    transform: none;
}

/* ============================================
   Site-specific: Grid layouts
   ============================================ */
.shape-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 288px), 1fr));
    gap: clamp(1.1rem, 2.8vw, 1.65rem);
    align-items: stretch;
}

@media (min-width: 900px) {
    .shape-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
    .ux-parent--span-2 {
        grid-column: span 2;
    }
}

.services-detail-grid,
.advantages-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
}

.services-detail-grid .ux-parent {
    height: 380px;
}

.services-detail-grid .ux-content {
    padding-top: 106.5px;
}

.services-detail-grid .ux-content .ux-text {
    font-size: 0.88rem;
    line-height: 1.45;
    margin-top: 0.7rem;
}

.services-detail-grid .ux-title {
    font-size: 1.1rem;
}

.services-detail-grid .ux-bottom {
    bottom: 14px;
}

.advantages-grid .ux-parent {
    height: 340px;
}

.advantages-grid .ux-content {
    padding-top: 106.5px;
}

.advantages-grid .ux-content .ux-text {
    font-size: 0.88rem;
    line-height: 1.45;
    margin-top: 0.7rem;
}

.advantages-grid .ux-title {
    font-size: 1.1rem;
}

@media (max-width: 1100px) {
    .services-detail-grid,
    .advantages-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 640px) {
    .services-detail-grid,
    .advantages-grid {
        grid-template-columns: 1fr;
    }
}

.advantages-grid {
    grid-template-columns: repeat(4, 1fr);
}

@media (max-width: 1100px) {
    .advantages-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 600px) {
    .advantages-grid {
        grid-template-columns: 1fr;
    }
}

.process-steps {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 24px;
}

@media (max-width: 1100px) {
    .process-steps {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 640px) {
    .process-steps {
        grid-template-columns: 1fr;
    }
}

.services-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

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

@media (max-width: 900px) {
    .vision-grid {
        grid-template-columns: 1fr;
    }
}

.services-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
}

.services-grid .ux-parent {
    height: 360px;
}

.services-grid .ux-content {
    padding-top: 106.5px;
}

.services-grid .ux-content .ux-text {
    font-size: 0.88rem;
    line-height: 1.45;
    margin-top: 0.7rem;
}

.services-grid .ux-title {
    font-size: 1.1rem;
}

.services-grid .ux-bottom {
    bottom: 14px;
}

@media (max-width: 900px) {
    .services-grid {
        grid-template-columns: 1fr;
    }
}

/* ============================================
   Site-specific: Extra content inside cards
   ============================================ */

.ux-features {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-top: 8px;
}

.ux-feature {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--ux-body);
    line-height: 1.2;
}

.ux-feature svg {
    width: 12px;
    height: 12px;
    flex-shrink: 0;
    fill: none;
    stroke: var(--ux-fill);
    stroke-width: 2.5;
}

.service-techs {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    margin-top: 10px;
}

.service-techs span {
    padding: 3px 10px;
    border-radius: 999px;
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--ux-body);
    background: rgba(255, 255, 255, 0.28);
    border: 1px solid rgba(255, 255, 255, 0.38);
    letter-spacing: 0.02em;
}

/* ============================================
   Case row cards (brutal style - not ux-card)
   ============================================ */
.case-row-brutal {
    position: relative;
    border-radius: 20px;
    background: var(--ux-grad);
    transform-style: preserve-3d;
    transition:
        transform 0.5s cubic-bezier(0.22, 1, 0.36, 1),
        box-shadow 0.5s ease;
    overflow: hidden;
    padding: 24px 32px;
    margin-bottom: 16px;
    box-shadow:
        rgba(20, 20, 19, 0) 20px 30px 15px -25px,
        rgba(20, 20, 19, 0.2) 0 15px 15px -3px;
}

.case-row-brutal:hover {
    transform: rotate3d(1, 1, 0, 6deg);
    padding-left: 32px;
    box-shadow:
        rgba(20, 20, 19, 0.3) 20px 35px 20px -30px,
        rgba(0, 255, 214, 0.12) 0 0 40px -5px;
}

.case-row-brutal::before {
    content: '';
    position: absolute;
    inset: 5px;
    border-radius: 16px;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.06) 0%, rgba(255, 255, 255, 0.02) 50%, transparent 100%);
    transform: translate3d(0, 0, 12px);
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    border-inline-start: 1px solid rgba(255, 255, 255, 0.05);
    pointer-events: none;
    z-index: 1;
}

.case-row-brutal .case-row-content {
    position: relative;
    z-index: 2;
    transform: translate3d(0, 0, 15px);
}

/* 兼容 HTML 中的 case-row-body 类名 */
.case-row-brutal .case-row-body {
    position: relative;
    z-index: 2;
    transform: translate3d(0, 0, 15px);
    flex: 1;
    min-width: 0;
}

.case-row-brutal .case-row-visual {
    position: relative;
    z-index: 2;
    transform: translate3d(0, 0, 15px);
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.case-row-brutal .case-row-arrow {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    transform: translate3d(0, 0, 15px);
    z-index: 3;
}

.case-row-brutal .case-row-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 8px;
}

.case-row-brutal .case-row-title,
.case-row-brutal h3 {
    color: rgba(255, 255, 255, 0.92) !important;
}

.case-row-brutal .case-row-desc,
.case-row-brutal p {
    color: rgba(255, 255, 255, 0.6) !important;
}

.case-row-brutal .case-row-icon i {
    color: rgba(255, 255, 255, 0.5) !important;
    opacity: 1 !important;
}

.case-row-brutal:hover .case-row-icon i {
    color: rgba(255, 255, 255, 0.85) !important;
    transform: scale(1.1);
}

.case-row-brutal .case-row-arrow i {
    color: rgba(255, 255, 255, 0.5) !important;
}

.case-row-brutal:hover .case-row-arrow i {
    color: rgba(255, 255, 255, 0.9) !important;
}

.case-row-brutal .case-row-arrow {
    border-color: rgba(255, 255, 255, 0.1) !important;
}

.case-row-brutal:hover .case-row-arrow {
    border-color: rgba(255, 255, 255, 0.25) !important;
}

.case-row-brutal .case-row-number {
    color: rgba(255, 255, 255, 0.25) !important;
}

.case-row-brutal .badge {
    color: rgba(255, 255, 255, 0.7) !important;
    border-color: rgba(255, 255, 255, 0.15) !important;
    background: rgba(255, 255, 255, 0.06) !important;
}

.case-row-brutal:hover .case-row-content {
    transform: translate3d(0, 0, 30px);
}

.case-row-brutal:hover .case-row-title,
.case-row-brutal:hover h3 {
    color: #fff !important;
}

.case-row-brutal.theme-mint,
.case-row-brutal.ux-parent--mint {
    --ux-grad: linear-gradient(135deg, #0a3d33 0%, #0b4a2a 100%);
    border-left: 3px solid rgba(0, 255, 214, 0.4);
}

.case-row-brutal.theme-violet,
.case-row-brutal.ux-parent--violet {
    --ux-grad: linear-gradient(145deg, #2d1a4e 0%, #1e1b5e 100%);
    border-left: 3px solid rgba(168, 85, 247, 0.4);
}

.case-row-brutal.theme-solar,
.case-row-brutal.ux-parent--solar {
    --ux-grad: linear-gradient(135deg, #4a2c0a 0%, #5a1a0a 100%);
    border-left: 3px solid rgba(251, 191, 36, 0.4);
}

.case-row-brutal.theme-ocean,
.case-row-brutal.ux-parent--ocean {
    --ux-grad: linear-gradient(155deg, #0a3040 0%, #0a2244 100%);
    border-left: 3px solid rgba(34, 211, 238, 0.4);
}

.case-row-brutal.theme-prism,
.case-row-brutal.ux-parent--prism {
    --ux-grad: linear-gradient(135deg, #1a1a3e 0%, #2a1a3e 100%);
    border-left: 3px solid rgba(244, 114, 182, 0.4);
}

.case-row-brutal.theme-void,
.case-row-brutal.ux-parent--void {
    --ux-grad: linear-gradient(160deg, #0f172a 0%, #1e1b4b 100%);
}

.case-row-brutal.ux-parent--mint,
.case-row-brutal.ux-parent--violet,
.case-row-brutal.ux-parent--solar,
.case-row-brutal.ux-parent--ocean,
.case-row-brutal.ux-parent--prism,
.case-row-brutal.ux-parent--void {
    filter: none;
    height: auto;
    max-width: none;
    perspective: none;
}

/* ============================================
   Reduced motion
   ============================================ */
@media (prefers-reduced-motion: reduce) {
    .ux-card,
    .ux-circle,
    .ux-social-btn,
    .ux-more {
        transition: none !important;
    }
    .ux-parent:hover .ux-card {
        transform: none;
    }
    .ux-parent:hover .ux-circle:nth-child(2),
    .ux-parent:hover .ux-circle:nth-child(3),
    .ux-parent:hover .ux-circle:nth-child(4),
    .ux-parent:hover .ux-circle:nth-child(5) {
        transform: inherit;
    }
    .ux-parent:hover .ux-social-btn {
        transform: none;
    }
}

/* ============================================
   Templates section styles
   ============================================ */
.templates-section {
    padding-top: 60px;
    padding-bottom: 80px;
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.templates-section .section-header {
    opacity: 1 !important;
    transform: translateY(0) !important;
}

.templates-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 30px;
    margin-top: 40px;
}

.template-card {
    position: relative;
    background: rgba(20, 20, 19, 0.6);
    border-radius: 20px;
    overflow: hidden;
    border: 1px solid rgba(217, 119, 87, 0.1);
    transition: all 0.5s cubic-bezier(0.22, 1, 0.36, 1);
    transform-style: preserve-3d;
}

.template-card:hover {
    transform: translateY(-8px) rotate3d(0, 1, 0, 2deg);
    border-color: rgba(217, 119, 87, 0.3);
    box-shadow: 
        0 20px 40px rgba(0, 0, 0, 0.3),
        0 0 30px rgba(217, 119, 87, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.template-card-inner {
    position: relative;
    display: flex;
    flex-direction: column;
}

.template-card-visual {
    position: relative;
    width: 100%;
    height: 420px;
    overflow: hidden;
    background: #fff;
    display: flex;
    flex-direction: column;
    border-radius: 12px 12px 0 0;
    border: 1px solid rgba(255,255,255,0.1);
    border-bottom: none;
}

.template-card-visual::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 50px;
    background: linear-gradient(to top, rgba(0,0,0,0.2), transparent);
    pointer-events: none;
    z-index: 1;
}

/* 预览容器 */
.template-preview-box {
    flex: 1;
    width: 100%;
    height: 100%;
    background-color: #f5f5f5;
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* 缩略图 - contain模式显示完整图片（不裁剪） */
.template-preview-img {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
    object-position: center top;
    display: block;
}

/* CSS模拟首页结构（无缩略图时使用） */
.template-preview-mock {
    display: flex;
    flex-direction: column;
    padding: 10px;
    gap: 8px;
    background-color: transparent !important;
}

.template-mock-nav {
    height: 22px;
    background: rgba(255,255,255,0.1);
    border-radius: 4px;
    position: relative;
    flex-shrink: 0;
}

.template-mock-nav::before {
    content: '';
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    width: 28px;
    height: 7px;
    background: rgba(255,255,255,0.35);
    border-radius: 3px;
}

.template-mock-nav::after {
    content: '';
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    width: 45px;
    height: 5px;
    background: rgba(255,255,255,0.18);
    border-radius: 3px;
}

.template-mock-hero {
    flex: 1;
    min-height: 0;
    background: rgba(255,255,255,0.06);
    border-radius: 6px;
    position: relative;
}

.template-mock-hero::before {
    content: '';
    position: absolute;
    top: 35%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 55%;
    height: 10px;
    background: rgba(255,255,255,0.35);
    border-radius: 4px;
}

.template-mock-hero::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 35%;
    height: 6px;
    background: rgba(255,255,255,0.2);
    border-radius: 3px;
}

.template-mock-content {
    height: 40px;
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 8px;
    flex-shrink: 0;
}

.template-mock-content::before,
.template-mock-content::after {
    content: '';
    background: rgba(255,255,255,0.08);
    border-radius: 4px;
}

.template-mock-content::after {
    grid-column: span 2;
}

.template-browser-bar {
    position: relative;
    height: 28px;
    background: linear-gradient(180deg, #3a3a3a 0%, #2c2c2c 100%);
    display: flex;
    align-items: center;
    padding: 0 10px;
    gap: 6px;
    flex-shrink: 0;
    z-index: 5;
    border-bottom: 1px solid rgba(255,255,255,0.05);
}

.template-browser-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

.template-browser-dot.red { background: #ff5f57; }
.template-browser-dot.yellow { background: #ffbd2e; }
.template-browser-dot.green { background: #28c840; }

.template-browser-url {
    flex: 1;
    height: 14px;
    background: rgba(255,255,255,0.1);
    border-radius: 7px;
    margin-left: 8px;
}

.template-webpage {
    flex: 1;
    position: relative;
    background: var(--grad, linear-gradient(180deg, #f5f7fa 0%, #e4e8ec 100%));
    padding: 8px 10px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.template-navbar {
    display: flex;
    gap: 6px;
}

.template-nav-item {
    height: 6px;
    background: rgba(0,0,0,0.15);
    border-radius: 3px;
}

.template-nav-item.logo {
    width: 20px;
    background: var(--grad, #667eea);
}

.template-nav-item.menu {
    flex: 1;
    width: 40px;
}

.template-nav-item.right {
    width: 25px;
}

.template-hero {
    flex: 1;
    min-height: 0;
    background: rgba(255,255,255,0.8);
    border-radius: 4px;
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 6px;
    gap: 4px;
}

.template-hero-title {
    height: 6px;
    background: rgba(0,0,0,0.7);
    border-radius: 3px;
    width: 70%;
}

.template-hero-subtitle {
    height: 4px;
    background: rgba(0,0,0,0.4);
    border-radius: 2px;
    width: 50%;
}

.template-hero-btn {
    height: 8px;
    background: var(--grad, #667eea);
    border-radius: 4px;
    width: 25%;
    margin-top: 4px;
}

.template-content {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 4px;
}

.template-card-mini {
    height: 20px;
    background: rgba(255,255,255,0.7);
    border-radius: 3px;
}

.template-watermark {
    position: absolute;
    bottom: 4px;
    right: 6px;
    padding: 2px 8px;
    background: rgba(0,0,0,0.7);
    backdrop-filter: blur(6px);
    border-radius: 999px;
    font-size: 0.6rem;
    color: rgba(217,119,87,0.9);
    font-weight: 600;
    z-index: 10;
}

.template-card-content {
    padding: 16px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.template-card-tags {
    display: flex;
    gap: 6px;
    margin-bottom: 8px;
    flex-wrap: wrap;
}

.template-card-tags .badge {
    padding: 2px 8px;
    font-size: 0.65rem;
    font-weight: 600;
    color: rgba(217, 119, 87, 0.9);
    background: rgba(217, 119, 87, 0.1);
    border: 1px solid rgba(217, 119, 87, 0.2);
    border-radius: 999px;
    letter-spacing: 0.02em;
}

.template-card-title {
    font-size: 1rem;
    font-weight: 800;
    color: #faf9f5;
    margin: 0 0 6px 0;
    letter-spacing: -0.01em;
    line-height: 1.3;
}

.template-card-desc {
    font-size: 0.78rem;
    color: #b0aea5;
    margin: 0 0 12px 0;
    line-height: 1.5;
    flex: 1;
}

.template-card-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.78rem;
    font-weight: 700;
    color: rgba(217, 119, 87, 0.9);
    text-decoration: none;
    transition: all 0.3s ease;
    padding: 6px 0;
    border-bottom: 1px solid transparent;
    align-self: flex-start;
}

.template-card-link:hover {
    color: #d97757;
    border-bottom-color: rgba(217, 119, 87, 0.4);
    gap: 10px;
}

/* 模板卡片双按钮 */
.template-card-actions {
    display: flex;
    gap: 10px;
    margin-top: auto;
    position: relative;
    z-index: 10;
}

.template-card-actions .template-card-link {
    flex: 1;
    justify-content: center;
    font-size: 0.75rem;
    padding: 8px 12px;
    border-radius: 6px;
    background: rgba(217, 119, 87, 0.1);
    border: 1px solid rgba(217, 119, 87, 0.2);
    text-align: center;
}

.template-card-actions .template-card-link:hover {
    background: rgba(217, 119, 87, 0.2);
    border-color: rgba(217, 119, 87, 0.4);
    gap: 6px;
}

.template-card-actions .template-card-link.primary {
    background: linear-gradient(135deg, rgba(217, 119, 87, 0.8), rgba(180, 90, 50, 0.9));
    color: #fff;
    border: none;
}

.template-card-actions .template-card-link.primary:hover {
    background: linear-gradient(135deg, rgba(217, 119, 87, 1), rgba(200, 100, 60, 1));
    gap: 10px;
}

.template-card-link i {
    font-size: 0.85rem;
    transition: transform 0.3s ease;
}

.template-card-link:hover i {
    transform: translateX(4px);
}

.template-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, transparent, rgba(217, 119, 87, 0.4), transparent);
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 5;
}

.template-card:hover::before {
    opacity: 1;
}

@media (max-width: 1200px) {
    .templates-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 900px) {
    .templates-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 16px;
    }
    
    .template-card-content {
        padding: 14px;
    }
    
    .template-card-title {
        font-size: 0.9rem;
    }
    
    .template-card-desc {
        font-size: 0.74rem;
    }
}

@media (max-width: 640px) {
    .templates-grid {
        grid-template-columns: 1fr;
    }

    .templates-section {
        padding-top: 40px;
        padding-bottom: 60px;
    }
}

/* ============================================
   移动端全局优化 (< 768px)
   解决卡片变形、文字重叠、元素溢出
   ============================================ */
@media (max-width: 767px) {
    /* 3D 卡片容器：缩小高度、限制最大宽度 */
    .ux-parent {
        max-width: 100%;
        height: 260px;
    }

    .ux-parent--wide {
        height: 200px;
    }

    /* 卡片圆角缩小，避免小屏幕变形 */
    .ux-card {
        border-radius: 28px;
    }

    .ux-glass {
        inset: 6px;
        border-radius: 32px;
        border-top-right-radius: 80%;
    }

    .ux-parent--cut .ux-card {
        border-radius: 24px;
    }

    .ux-parent--cut .ux-glass {
        border-radius: 20px !important;
        border-top-right-radius: 20px !important;
    }

    .ux-parent--wide .ux-card {
        border-radius: 28px;
    }

    .ux-parent--wide .ux-glass {
        border-radius: 32px;
        border-top-right-radius: 50%;
    }

    /* 内容区域：减小 padding，防止文字溢出 */
    .ux-content {
        padding: 80px 1.25rem 0 1.25rem;
    }

    .ux-parent--wide .ux-content {
        padding: 1.5rem 45% 0 1.25rem !important;
    }

    /* 标题和正文：缩小字号，防止重叠 */
    .ux-title {
        font-size: 1rem;
        line-height: 1.2;
    }

    .ux-text {
        font-size: 0.82rem;
        line-height: 1.4;
        margin-top: 0.6rem;
    }

    .services-detail-grid .ux-content .ux-text,
    .advantages-grid .ux-content .ux-text,
    .services-grid .ux-content .ux-text {
        font-size: 0.82rem;
        line-height: 1.4;
        margin-top: 0.6rem;
    }

    .services-detail-grid .ux-title,
    .advantages-grid .ux-title,
    .services-grid .ux-title {
        font-size: 1rem;
    }

    /* 底部按钮区域 */
    .ux-bottom {
        bottom: 14px;
        left: 14px;
        right: 14px;
        padding: 8px 10px;
    }

    .services-detail-grid .ux-bottom,
    .advantages-grid .ux-bottom,
    .services-grid .ux-bottom {
        bottom: 12px;
    }

    /* 装饰圆环：缩小，避免溢出 */
    .ux-circle:nth-child(1) {
        width: 120px;
        top: 6px;
        inset-inline-end: 6px;
    }

    .ux-circle:nth-child(2) {
        width: 60px;
    }

    .ux-parent--wide .ux-logo .ux-circle:nth-child(1) {
        width: 130px;
        height: 130px;
    }

    /* 模板卡片缩略图 */
    .template-card-thumbnail {
        height: 180px;
    }

    .template-card-content {
        padding: 12px;
    }

    .template-card-title {
        font-size: 0.88rem;
    }

    .template-card-desc {
        font-size: 0.72rem;
        line-height: 1.4;
        -webkit-line-clamp: 2;
    }

    /* 特性列表紧凑显示 */
    .ux-features {
        gap: 3px;
        margin-top: 6px;
    }

    .ux-feature {
        font-size: 0.72rem;
    }

    /* ===== cases.html 案例卡片修复 ===== */
    /* 减小 padding，给内容更多空间 */
    .case-row-brutal {
        padding: 16px 18px;
    }

    /* 禁用 rotate3d hover 效果，触屏点击会持续变形 */
    .case-row-brutal:hover {
        transform: none;
        padding-left: 18px;
        box-shadow:
            rgba(20, 20, 19, 0.3) 20px 35px 20px -30px,
            rgba(0, 255, 214, 0.12) 0 0 40px -5px;
    }

    /* 箭头按钮位置调整，避免遮挡内容 */
    .case-row-brutal .case-row-arrow {
        top: 14px;
        right: 14px;
        width: 32px;
        height: 32px;
    }

    /* 案例标题缩小 */
    .case-row-brutal .case-row-title,
    .case-row-brutal h3 {
        font-size: 1rem;
        line-height: 1.3;
    }

    /* 案例描述缩小 */
    .case-row-brutal .case-row-desc,
    .case-row-brutal p {
        font-size: 0.82rem;
        line-height: 1.5;
    }

    /* 图标缩小 */
    .case-row-brutal .case-row-icon i {
        font-size: 1.25rem;
    }

    .case-row-brutal .case-row-number {
        font-size: 0.9rem;
    }

    /* badge 缩小 */
    .case-row-brutal .badge {
        font-size: 0.68rem;
        padding: 2px 8px;
    }

    /* ===== vision-grid 三个信念卡片移动端优化 ===== */
    /* 卡片高度增加，让内容有更多垂直空间 */
    .vision-grid .ux-parent {
        height: 240px;
        max-width: 100%;
    }

    /* 装饰圆环缩小，避免占据太多空间 */
    .vision-grid .ux-circle:nth-child(1) {
        width: 100px;
    }

    .vision-grid .ux-circle:nth-child(2) {
        width: 50px;
    }

    /* 内容区域 padding 调整 */
    .vision-grid .ux-content {
        padding: 60px 1.25rem 0 1.25rem;
    }

    /* 底部按钮区域紧凑 */
    .vision-grid .ux-bottom {
        bottom: 12px;
        left: 14px;
        right: 14px;
    }

    /* 社交按钮缩小 */
    .vision-grid .ux-social-btn {
        width: 28px;
        padding: 4px;
    }

    /* "了解更多"按钮缩小 */
    .vision-grid .ux-more-btn {
        font-size: 0.78rem;
    }
}

/* ============================================
   超小屏幕优化 (< 480px)
   ============================================ */
@media (max-width: 480px) {
    .ux-parent {
        height: 230px;
    }

    .ux-parent--wide {
        height: 180px;
    }

    .ux-content {
        padding: 45px 1rem 0 1rem;
    }

    .ux-parent--wide .ux-content {
        padding: 1rem 28% 0 1rem !important;
    }

    .ux-title {
        font-size: 0.92rem;
    }

    .ux-text {
        font-size: 0.76rem;
        margin-top: 0.5rem;
    }

    .ux-circle:nth-child(1) {
        width: 100px;
    }

    .ux-bottom {
        bottom: 10px;
        left: 10px;
        right: 10px;
        padding: 6px 8px;
    }

    .template-card-thumbnail {
        height: 160px;
    }

    /* cases.html 案例卡片进一步缩小 */
    .case-row-brutal {
        padding: 14px 14px;
    }

    .case-row-brutal:hover {
        padding-left: 14px;
    }

    .case-row-brutal .case-row-arrow {
        top: 12px;
        right: 12px;
        width: 28px;
        height: 28px;
    }

    .case-row-brutal .case-row-title,
    .case-row-brutal h3 {
        font-size: 0.92rem;
    }

    .case-row-brutal .case-row-desc,
    .case-row-brutal p {
        font-size: 0.78rem;
        line-height: 1.45;
    }
}
