/* ============================================
   Base Styles - Deleetech Website
   Modern, Professional, Mobile-First Design
   ============================================ */

/* CSS Variables - Design System */
:root {
    /* Colors - Professional Industrial Palette */
    --color-primary: #008B8B;
    --color-primary-dark: #006B6B;
    --color-primary-light: #20B2AA;
    --color-secondary: #20B2AA;
    --color-accent: #FF6B35;
    --color-success: #00C48C;
    --color-warning: #FFA726;
    --color-error: #EF5350;
    
    /* Neutrals */
    --color-dark: #1A1A1A;
    --color-gray-900: #2D2D2D;
    --color-gray-800: #424242;
    --color-gray-700: #616161;
    --color-gray-600: #757575;
    --color-gray-500: #9E9E9E;
    --color-gray-400: #BDBDBD;
    --color-gray-300: #E0E0E0;
    --color-gray-200: #EEEEEE;
    --color-gray-100: #F5F5F5;
    --color-white: #FFFFFF;
    
    /* Typography */
    --font-primary: 'Outfit', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-mono: 'JetBrains Mono', 'Courier New', monospace;
    
    /* Font Sizes - Fluid Typography */
    --text-xs: clamp(0.75rem, 0.7rem + 0.25vw, 0.875rem);
    --text-sm: clamp(0.875rem, 0.8rem + 0.375vw, 1rem);
    --text-base: clamp(1rem, 0.95rem + 0.25vw, 1.125rem);
    --text-lg: clamp(1.125rem, 1.05rem + 0.375vw, 1.25rem);
    --text-xl: clamp(1.25rem, 1.15rem + 0.5vw, 1.5rem);
    --text-2xl: clamp(1.5rem, 1.35rem + 0.75vw, 1.875rem);
    --text-3xl: clamp(1.875rem, 1.65rem + 1.125vw, 2.25rem);
    --text-4xl: clamp(2.25rem, 1.95rem + 1.5vw, 3rem);
    --text-5xl: clamp(3rem, 2.5rem + 2.5vw, 4rem);
    
    /* Spacing */
    --space-xs: 0.5rem;
    --space-sm: 0.75rem;
    --space-md: 1rem;
    --space-lg: 1.5rem;
    --space-xl: 2rem;
    --space-2xl: 3rem;
    --space-3xl: 4rem;
    --space-4xl: 6rem;
    
    /* Layout */
    --container-max: 1280px;
    --container-padding: 1.5rem;
    --header-height: 80px;
    --top-bar-height: 40px;
    
    /* Shadows */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    
    /* Transitions */
    --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-base: 250ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 350ms cubic-bezier(0.4, 0, 0.2, 1);
    
    /* Border Radius */
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;
    --radius-full: 9999px;
    
    /* Z-index */
    --z-dropdown: 1000;
    --z-sticky: 1020;
    --z-fixed: 1030;
    --z-modal-backdrop: 1040;
    --z-modal: 1050;
    --z-popover: 1060;
    --z-tooltip: 1070;
}

/* ============================================
   Reset & Base Styles
   ============================================ */

*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    writing-mode: horizontal-tb;
    -webkit-writing-mode: horizontal-tb;
}

html {
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    scroll-behavior: smooth;
    writing-mode: horizontal-tb;
    overflow-x: hidden;
    overflow-y: auto;
    height: 100%;
}

html[lang="zh-CN"],
html[lang="zh-Hans"],
html[lang="zh"] {
    writing-mode: horizontal-tb !important;
    -webkit-writing-mode: horizontal-tb !important;
}

body {
    font-family: var(--font-primary);
    font-size: var(--text-base);
    line-height: 1.6;
    color: var(--color-gray-900);
    background-color: var(--color-white);
    overflow-x: hidden;
    overflow-y: auto;
    writing-mode: horizontal-tb;
    text-orientation: mixed;
    width: 100%;
    max-width: 100vw;
    min-height: 100%;
    position: relative;
    -webkit-overflow-scrolling: touch;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
    line-height: 1.2;
    color: var(--color-dark);
    margin-bottom: var(--space-md);
    writing-mode: horizontal-tb;
}

h1 { font-size: var(--text-5xl); }
h2 { font-size: var(--text-4xl); }
h3 { font-size: var(--text-3xl); }
h4 { font-size: var(--text-2xl); }
h5 { font-size: var(--text-xl); }
h6 { font-size: var(--text-lg); }

p {
    margin-bottom: var(--space-md);
}

a {
    color: var(--color-primary);
    text-decoration: none;
    transition: color var(--transition-fast);
}

a:hover {
    color: var(--color-primary-dark);
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* ============================================
   Layout Components
   ============================================ */

.container {
    max-width: var(--container-max);
    width: 100%;
    margin: 0 auto;
    padding: 0 var(--container-padding);
    box-sizing: border-box;
}

.skip-to-main {
    position: absolute;
    top: -100px;
    left: 0;
    background: var(--color-primary);
    color: var(--color-white);
    padding: var(--space-sm) var(--space-md);
    z-index: 9999;
    transition: top var(--transition-fast);
}

.skip-to-main:focus {
    top: 0;
}

/* ============================================
   Header Styles - 固定导航栏
   ============================================ */

.site-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    width: 100%;
    z-index: var(--z-sticky);
    background: var(--color-white);
    box-shadow: var(--shadow-sm);
    transition: box-shadow 0.3s ease, transform 0.3s ease;
    will-change: transform;
}

/* 滚动时增强阴影效果和背景颜色 */
.site-header.scrolled {
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    background: var(--color-white);
}

/* 为主内容添加顶部间距，避免被固定导航栏遮挡 */
#main-content {
    margin-top: calc(var(--top-bar-height) + var(--header-height));
}

/* Top Bar */
.top-bar {
    background: linear-gradient(135deg, var(--color-gray-900) 0%, var(--color-gray-800) 100%);
    color: var(--color-white);
    font-size: var(--text-sm);
    height: var(--top-bar-height);
    display: flex;
    align-items: center;
}

.top-bar-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    flex-wrap: nowrap;
}

.top-bar-left,
.top-bar-right {
    display: flex;
    align-items: center;
    gap: var(--space-lg);
    flex-wrap: nowrap;
}

.top-link {
    display: flex;
    align-items: center;
    gap: var(--space-xs);
    color: var(--color-gray-300);
    transition: color var(--transition-fast);
    white-space: nowrap;
}

.top-link:hover {
    color: var(--color-white);
}

.top-link .icon {
    flex-shrink: 0;
}

.top-link span {
    white-space: nowrap;
}

/* Language Switcher */
.language-switcher {
    position: relative;
    flex-shrink: 0;
}

.lang-btn {
    display: flex;
    align-items: center;
    gap: var(--space-xs);
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: var(--color-white);
    padding: var(--space-xs) var(--space-sm);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all var(--transition-fast);
    font-size: var(--text-sm);
    white-space: nowrap;
    flex-shrink: 0;
}

.lang-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.3);
}

.lang-dropdown {
    position: absolute;
    top: calc(100% + var(--space-xs));
    right: 0;
    background: var(--color-white);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    min-width: 120px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all var(--transition-base);
    overflow: hidden;
    padding: var(--space-xs) 0;
}

.language-switcher:hover .lang-dropdown,
.lang-btn[aria-expanded="true"] + .lang-dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.lang-form {
    margin: 0;
    padding: 0;
    display: block;
}

.lang-option {
    display: block;
    padding: var(--space-sm) var(--space-md);
    color: var(--color-gray-800);
    transition: all var(--transition-fast);
    width: 100%;
    text-align: left;
    font-family: inherit;
    font-size: var(--text-sm);
    border: none;
    background: none;
    cursor: pointer;
    line-height: 1.5;
}

.lang-option:hover {
    background: var(--color-gray-100);
    color: var(--color-primary);
}

.lang-option:active {
    background: var(--color-primary);
    color: var(--color-white);
}

/* Main Navigation */
.main-nav {
    height: var(--header-height);
    display: flex;
    align-items: center;
}

.nav-wrapper {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
}

.logo img,
.logo .logo-img {
    height: 50px;
    width: auto;
    display: block;
}

.logo .logo-svg {
    display: none;
}

.logo .logo-png {
    display: block;
    max-height: 50px;
    width: auto;
}

/* Desktop Navigation */
.desktop-nav {
    display: none;
    list-style: none;
    margin: 0;
    padding: 0;
    gap: var(--space-xs);
}

.nav-item {
    position: relative;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: var(--space-xs);
    padding: var(--space-sm) var(--space-md);
    color: var(--color-gray-800);
    font-weight: 500;
    font-size: var(--text-sm);
    transition: color var(--transition-fast);
    border-radius: var(--radius-sm);
}

.nav-link:hover,
.nav-item.active .nav-link {
    color: var(--color-primary);
    background: var(--color-gray-100);
}

/* 首页顶部未滚动时，导航链接悬停使用深色背景 */
body.home-page:not(.scrolled) .nav-link {
    color: var(--color-white);
}

body.home-page:not(.scrolled) .nav-link:hover,
body.home-page:not(.scrolled) .nav-item.active .nav-link {
    color: var(--color-white);
    background: rgba(0, 0, 0, 0.3);
}

/* 首页滚动后，导航链接悬停使用浅色背景 */
body.home-page.scrolled .nav-link:hover,
body.home-page.scrolled .nav-item.active .nav-link {
    color: var(--color-white);
    background: rgba(255, 255, 255, 0.15);
}

.icon-chevron {
    transition: transform var(--transition-fast);
}

.nav-item:hover .icon-chevron {
    transform: rotate(180deg);
}

/* Mega Menu */
.mega-menu {
    position: absolute;
    top: 100%;
    left: 0;
    width: 100vw;
    max-width: 100%;
    background: var(--color-white);
    box-shadow: none !important;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-20px);
    transition: all var(--transition-base);
    padding: var(--space-2xl) 0;
    overflow-x: hidden;
    border: none;
}

.nav-item:hover .mega-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.mega-menu-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: var(--space-2xl);
}

/* Navigation Actions */
.nav-actions {
    display: flex;
    align-items: center;
    gap: var(--space-md);
}

/* Inline Search Form */
.nav-search-form {
    position: relative;
    display: flex;
    align-items: center;
}

.nav-search-input {
    width: 200px;
    padding: var(--space-xs) var(--space-md);
    padding-right: 40px;
    border: 1px solid var(--color-gray-300);
    border-radius: var(--radius-full);
    font-size: var(--text-sm);
    transition: all var(--transition-fast);
    background: var(--color-gray-100);
}

.nav-search-input:focus {
    outline: none;
    border-color: var(--color-primary);
    background: var(--color-white);
    box-shadow: 0 0 0 3px rgba(0, 102, 204, 0.1);
    width: 250px;
}

.nav-search-input::placeholder {
    color: var(--color-gray-500);
}

.nav-search-btn {
    position: absolute;
    right: 4px;
    background: transparent;
    border: none;
    color: var(--color-gray-600);
    cursor: pointer;
    padding: var(--space-xs);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color var(--transition-fast);
    border-radius: var(--radius-full);
}

.nav-search-btn:hover {
    color: var(--color-primary);
    background: var(--color-gray-200);
}

.search-toggle {
    background: transparent;
    border: none;
    color: var(--color-gray-700);
    cursor: pointer;
    padding: var(--space-xs);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color var(--transition-fast);
}

.search-toggle:hover {
    color: var(--color-primary);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: var(--space-sm) var(--space-lg);
    font-size: var(--text-sm);
    font-weight: 600;
    border-radius: var(--radius-md);
    border: none;
    cursor: pointer;
    transition: all var(--transition-fast);
    text-decoration: none;
    white-space: nowrap;
}

.btn-primary {
    background: linear-gradient(135deg, #008B8B 0%, #20B2AA 100%);
    color: var(--color-white);
    box-shadow: 0 4px 12px rgba(0, 139, 139, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 139, 139, 0.4);
    color: var(--color-white);
}

/* Mobile Menu Toggle */
.mobile-menu-toggle {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: var(--space-xs);
}

.hamburger {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.hamburger .line {
    width: 24px;
    height: 2px;
    background: var(--color-gray-800);
    transition: all var(--transition-base);
}

.mobile-menu-toggle[aria-expanded="true"] .line:nth-child(1) {
    transform: rotate(45deg) translate(7px, 7px);
}

.mobile-menu-toggle[aria-expanded="true"] .line:nth-child(2) {
    opacity: 0;
}

.mobile-menu-toggle[aria-expanded="true"] .line:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -7px);
}

/* Search Overlay */
.search-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    z-index: var(--z-modal);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition-base);
}

.search-overlay.active {
    opacity: 1;
    visibility: visible;
}

.search-form {
    position: relative;
    width: 100%;
    max-width: 600px;
}

.search-input {
    width: 100%;
    padding: var(--space-lg) var(--space-xl);
    font-size: var(--text-2xl);
    background: var(--color-white);
    border: none;
    border-radius: var(--radius-xl);
    color: var(--color-dark);
}

.search-input:focus {
    outline: 3px solid var(--color-primary);
}

.search-submit {
    position: absolute;
    right: var(--space-md);
    top: 50%;
    transform: translateY(-50%);
    background: var(--color-primary);
    border: none;
    color: var(--color-white);
    padding: var(--space-sm);
    border-radius: var(--radius-md);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.search-close {
    position: absolute;
    top: var(--space-2xl);
    right: var(--space-2xl);
    background: transparent;
    border: none;
    color: var(--color-white);
    cursor: pointer;
    padding: var(--space-sm);
}

/* Mobile Navigation */
.mobile-nav {
    position: fixed;
    top: calc(var(--top-bar-height) + var(--header-height));
    left: 0;
    width: 100%;
    height: calc(100vh - var(--top-bar-height) - var(--header-height));
    background: var(--color-white);
    z-index: calc(var(--z-sticky) - 1);
    transform: translateX(-100%);
    transition: transform var(--transition-base);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.mobile-nav.active {
    transform: translateX(0);
}

.mobile-nav-content {
    padding: var(--space-xl);
}

.mobile-nav-menu {
    list-style: none;
}

.mobile-nav-item {
    border-bottom: 1px solid var(--color-gray-200);
}

.mobile-nav-link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-md) 0;
    color: var(--color-gray-800);
    font-size: var(--text-lg);
    font-weight: 500;
    width: 100%;
    background: transparent;
    border: none;
    text-align: left;
    cursor: pointer;
}

.mobile-submenu {
    list-style: none;
    padding-left: var(--space-lg);
    max-height: 0;
    overflow: hidden;
    transition: max-height var(--transition-base);
}

.mobile-nav-item.active .mobile-submenu {
    max-height: 500px;
}

/* ============================================
   Footer Styles
   ============================================ */

.site-footer {
    background: linear-gradient(135deg, var(--color-gray-900) 0%, var(--color-dark) 100%);
    color: var(--color-gray-300);
    margin-top: var(--space-4xl);
}

.footer-main {
    padding: var(--space-4xl) 0 var(--space-2xl);
}

.footer-grid {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: var(--space-3xl);
    align-items: start;
}

.footer-logo {
    margin-bottom: var(--space-lg);
    max-width: 160px;
    max-height: 60px;
    height: auto;
    filter: brightness(0) invert(1);
}

.footer-description {
    color: var(--color-gray-400);
    margin-bottom: var(--space-lg);
    line-height: 1.8;
}

.social-links {
    display: flex;
    gap: var(--space-md);
}

.social-link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-md);
    color: var(--color-gray-300);
    transition: all var(--transition-fast);
}

.social-link:hover {
    background: var(--color-primary);
    color: var(--color-white);
    transform: translateY(-3px);
}

.footer-title {
    color: var(--color-white);
    font-size: var(--text-lg);
    font-weight: 600;
    margin-bottom: var(--space-lg);
}

.footer-links {
    list-style: none;
}

.footer-links li {
    margin-bottom: var(--space-sm);
}

.footer-links a {
    color: var(--color-gray-400);
    transition: color var(--transition-fast);
}

.footer-links a:hover {
    color: var(--color-white);
}

.footer-bottom {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding: var(--space-xl) 0;
}

.footer-bottom-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.copyright {
    color: var(--color-gray-500);
    font-size: var(--text-sm);
    margin: 0;
}

.footer-legal {
    display: flex;
    gap: var(--space-lg);
    list-style: none;
}

.footer-legal a {
    color: var(--color-gray-500);
    font-size: var(--text-sm);
}

.footer-legal a:hover {
    color: var(--color-white);
}

/* QR Codes in Footer */
.footer-qrcodes {
    display: flex;
    flex-direction: row;
    gap: var(--space-lg);
    align-items: center;
}

.qr-code-item {
    text-align: center;
}

.qr-code-img {
    width: 90px;
    height: 90px;
    border-radius: var(--radius-md);
    background: var(--color-white);
    padding: 6px;
    margin-bottom: var(--space-xs);
}

.qr-code-label {
    color: var(--color-gray-400);
    font-size: var(--text-xs);
    margin: 0;
    white-space: nowrap;
}

/* Back to Top Button */
.back-to-top {
    position: fixed;
    bottom: var(--space-2xl);
    right: var(--space-2xl);
    width: 50px;
    height: 50px;
    background: var(--color-primary);
    color: var(--color-white);
    border: none;
    border-radius: var(--radius-full);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-xl);
    transition: all var(--transition-fast);
    z-index: var(--z-fixed);
}

.back-to-top:hover {
    background: var(--color-primary-dark);
    transform: translateY(-5px);
}

/* ============================================
   Utility Classes
   ============================================ */

.icon {
    flex-shrink: 0;
}

@media (min-width: 1024px) {
    .desktop-nav {
        display: flex;
    }
    
    .mobile-menu-toggle {
        display: none;
    }
}

