/* ==========================================================
YUE YUAN LIGHTING - GLOBAL DESIGN SYSTEM
Layer 1: Global Style Sheet (style.css)
Version: 4.6 Universal Base (Optimized Architecture)
Description: Controls Global Tokens, Reset, Header, Footer, 
             Breadcrumbs, Buttons, and Base Form Elements.
========================================================== */

/* ==========================================================
01 GLOBAL DESIGN TOKENS (The Single Source of Truth)
========================================================== */
:root {
    /* ========= Brand Colors ========= */
    --primary: #0F172A;
    --secondary: #1E293B;
    --accent: #2563EB;
    --accent-hover: #1D4ED8;
    
    --success: #10B981;
    --warning: #F59E0B;
    --danger: #EF4444;

    /* ========= Theme Backgrounds & Texts ========= */
    --bg-page: #ffffff;
    --bg-card: #ffffff;
    --text-primary: #0F172A;
    --text-secondary: #64748B;

    /* ========= Neutral Slate Scale ========= */
    --white: #ffffff;
    --gray-50: #F8FAFC;
    --gray-100: #F1F5F9;
    --gray-200: #E2E8F0;
    --gray-300: #CBD5E1;
    --gray-400: #94A3B8;
    --gray-500: #64748B;
    --gray-600: #475569;
    --gray-700: #334155;
    --gray-800: #1E293B;
    --gray-900: #0F172A;

    /* ========= Typography Font Sizes ========= */
    --font-family: "Inter", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    --font-size-xs: .75rem;
    --font-size-sm: .875rem;
    --font-size-base: 1rem;
    --font-size-lg: 1.125rem;
    --font-size-xl: 1.25rem;
    --font-size-h4: 1.5rem;
    --font-size-h3: 1.75rem;
    --font-size-h2: 2.5rem;
    --font-size-h1: 3.5rem;

    /* ========= Font Weights ========= */
    --fw-normal: 400;
    --fw-medium: 500;
    --fw-semibold: 600;
    --fw-bold: 700;

    /* ========= Layout & Spacing ========= */
    --space-xs: .5rem;
    --space-sm: .75rem;
    --space-md: 1rem;
    --space-lg: 1.5rem;
    --space-xl: 2rem;
    --space-2xl: 3rem;
    --space-3xl: 5rem;

    /* ========= Components Borders & Shadows ========= */
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-xl: 20px;

    --shadow-sm: 0 2px 6px rgba(0,0,0,.08);
    --shadow-md: 0 8px 20px rgba(0,0,0,.12);
    --shadow-lg: 0 15px 40px rgba(0,0,0,.18);

    /* ========= Definitive Structural Width ========= */
    --container-width: 1280px;

    /* ========= Animation Motion Constants ========= */
    --transition-fast: .2s ease;
    --transition: .35s ease;

    /* ========= Layer Stack Configuration ========= */
    --z-header: 1000;
    --z-nav: 900;
    --z-modal: 5000;
}

/* ==========================================================
02 CSS STANDARD RESET
========================================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-family);
    font-size: var(--font-size-base);
    line-height: 1.7;
    color: var(--text-secondary);
    background: var(--bg-page);
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

img {
    display: block;
    max-width: 100%;
    height: auto;
}

iframe {
    border: 0;
    display: block;
}

a {
    text-decoration: none;
    color: inherit;
    transition: var(--transition);
}

ul {
    list-style: none;
}

button {
    border: none;
    background: none;
    cursor: pointer;
    font: inherit;
}

/* ==========================================================
03 GLOBAL TYPOGRAPHY AUTHORITY
========================================================== */
h1 {
    font-size: var(--font-size-h1);
    font-weight: var(--fw-bold);
    line-height: 1.1;
    color: var(--text-primary);
}

h2 {
    font-size: var(--font-size-h2);
    font-weight: var(--fw-bold);
    margin-bottom: 1rem;
    color: var(--text-primary);
}

h3 {
    font-size: var(--font-size-h3);
    font-weight: var(--fw-semibold);
    color: var(--text-primary);
}

h4 {
    font-size: var(--font-size-h4);
    font-weight: var(--fw-semibold);
    color: var(--text-primary);
}

p {
    margin-bottom: 1rem;
    color: var(--text-secondary);
}

/* Fix ④: Added Mobile Typography Overrides for Screen Safety */
@media(max-width: 768px) {
    h1 { font-size: 2.25rem; } /* Downscaling from 56px to 36px */
    h2 { font-size: 1.75rem; } /* Downscaling from 40px to 28px */
    h3 { font-size: 1.5rem; }
    h4 { font-size: 1.25rem; }
}

/* ==========================================================
04 DEFINITIVE GLOBAL CONTAINERS, SECTIONS & GRIDS
========================================================== */
/* 锁定在此，任何页面下的二级CSS绝不覆盖此类的 width/margin 属性 */
.container {
    width: min(100% - 40px, var(--container-width));
    margin: auto;
}

/* Fix ③: Universal Section Layout Tokens for Multi-page Scalability */
.section {
    padding: var(--space-3xl) 0; /* Standardized 80px top/bottom padding */
}

.section-header {
    text-align: center;
    max-width: 850px;
    margin: 0 auto var(--space-2xl);
}

/* 全局响应式排版网格 */
.grid-2-col { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--space-xl); }
.grid-3-col { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--space-xl); }
.grid-4-col { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--space-lg); }

@media(max-width: 992px) {
    .grid-3-col, .grid-4-col { grid-template-columns: repeat(2, 1fr); }
}
@media(max-width: 576px) {
    .grid-2-col, .grid-3-col, .grid-4-col { grid-template-columns: 1fr; }
}

/* ==========================================================
05 GLOBAL UI COMPONENTS (Header, Footer & Breadcrumb)
========================================================== */
/* ==========================
   GLOBAL HEADER COMPATIBILITY
========================== */
.site-header,
#site-header {
    width:100%;
    background:#000;
    position:sticky;
    top:0;
    z-index:var(--z-header);
    box-shadow:var(--shadow-sm);
}

/* header layout */
.header-inner {
    max-width:1280px;
    margin:auto;
    display:flex;
    align-items:center;
    justify-content:space-between;
    padding:18px 30px;
}

/* logo */
.logo img {
    width:160px;
    height:auto;
}

/* navigation */
.main-nav {
    display:flex;
    align-items:center;
    gap:35px;
}

.main-nav a {
    color:white;
    font-weight:600;
}

.main-nav a:hover {
    color:#2563EB;
}

/* ==========================
   FOOTER COMPATIBILITY
========================== */
.site-footer,
#siteFooter {
    width: 100%;
    background: var(--primary);
    color: var(--white);
    padding: var(--space-3xl) 0 var(--space-xl) 0;
}
/* ==========================
   BREADCRUMB
========================== */
.breadcrumb {
    padding: var(--space-md) var(--space-lg);
    background:var(--gray-50);
    border-bottom: 1px solid var(--gray-200);
    font-size: var(--font-size-sm);
    color: var(--gray-500);
}

.breadcrumb a {
    color:var(--accent);
}

.breadcrumb span {
    color:var(--gray-800);
    font-weight:var(--fw-medium);
}

/* ==========================================================
06 INTERACTIVE ACTIONS (Universal Buttons)
========================================================== */
.primary-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 14px 28px;
    background: var(--accent);
    color: var(--white);
    border-radius: var(--radius-md);
    font-weight: var(--fw-semibold);
    transition: var(--transition);
}

.primary-btn:hover { background: var(--accent-hover); }

.secondary-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 14px 28px;
    border: 2px solid var(--accent);
    color: var(--accent);
    border-radius: var(--radius-md);
    font-weight: var(--fw-semibold);
    transition: var(--transition);
}

.secondary-btn:hover { background: var(--accent); color: var(--white); }

button:focus-visible, .primary-btn:focus-visible, .secondary-btn:focus-visible {
    outline: 3px solid var(--accent);
    outline-offset: 3px;
}

/* ==========================================================
07 UNIVERSAL CRM / INPUT FORM CONTROL FACTOR
========================================================== */
.engineering-form input,
.engineering-form textarea,
.engineering-form select {
    width: 100%;
    padding: 15px 18px;
    margin-bottom: 18px;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-sm);
    font-family: var(--font-family);
    font-size: var(--font-size-sm);
    transition: var(--transition-fast);
}

.engineering-form input:focus,
.engineering-form textarea:focus,
.engineering-form select:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

/* ==========================================================
08 GLOBAL UTILITIES
========================================================== */
.text-center { text-align: center; }
.text-accent { color: var(--accent); }
.mb-0 { margin-bottom: 0 !important; }
.w-full { width: 100%; }

/* ==========================================================
09 INTERACTION REDUCED MOTION SAFETY LAYER
========================================================== */
@media (prefers-reduced-motion: reduce) {
    * {
        animation: none !important;
        transition: none !important;
        scroll-behavior: auto !important;
    }
}
