/* ===================================
   LSR设计指南 - 样式文件 (官网风格版)
   彦榕精密 YRlims Technical
   适配官网配色: #0A2540 深蓝系
   =================================== */

:root {
    /* 官网统一配色 */
    --primary: #0A2540;
    --primary-light: #1E3A5F;
    --accent: #00D4FF;
    
    /* 辅助色 */
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    
    /* 中性色 - 官网标准 */
    --bg-body: #ffffff;
    --bg-light: #F7F9FC;
    --bg-card: #ffffff;
    --text: #334155;
    --text-light: #64748B;
    --text-muted: #94a3b8;
    --border: #E2E8F0;
    
    /* 阴影 */
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.06);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.08);
    --shadow-lg: 0 8px 24px rgba(0,0,0,0.12);
    
    /* 圆角 - 官网标准 */
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 14px;
}

/* 重置 */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Noto Sans SC', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: 15px;
    line-height: 1.6;
    color: var(--text);
    background: var(--bg-light);
    min-height: 100vh;
}

/* 顶部栏 - 官网风格 */
.top-bar {
    background: var(--primary);
    color: #fff;
    padding: 8px 0;
    font-size: 13px;
}

.top-bar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.company-en {
    opacity: 0.9;
}

.lang-switch a {
    color: #fff;
    text-decoration: none;
    margin-left: 12px;
    opacity: 0.7;
    transition: opacity 0.2s;
}

.lang-switch a:hover,
.lang-switch a.active {
    opacity: 1;
}

/* 布局 */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
    text-align: left;
}

/* 页头 - 官网白色风格 */
.header {
    background: var(--bg-body);
    border-bottom: 1px solid var(--border);
    padding: 16px 0;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: var(--shadow-sm);
}

.header .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    flex-shrink: 0;
}

.logo-img {
    height: 40px;
    width: auto;
}
/* was: .logo-img { width: 120px; height: auto; } */

.logo-text {
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.logo-name {
    font-size: 24px;
    font-weight: 700;
    color: var(--primary);
    line-height: 1.1;
    letter-spacing: 1px;
}

.logo-full {
    font-size: 11px;
    color: var(--text-light);
    letter-spacing: 0.5px;
}

/* 头部导航 */
.header-nav {
    display: flex;
    gap: 32px;
}

.header-nav a {
    color: var(--text);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: color 0.2s;
    position: relative;
    padding: 8px 0;
}

.header-nav a:hover {
    color: var(--primary);
}

.header-nav a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--primary);
    transition: width 0.2s;
}

.header-nav a:hover::after {
    width: 100%;
}

/* 搜索框 */
.search-box {
    display: flex;
    align-items: center;
    background: var(--bg-light);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 4px;
    flex: 1;
    max-width: 400px;
    transition: all 0.2s;
}

.search-box:focus-within {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(10,37,64,0.1);
}

.search-box input {
    flex: 1;
    border: none;
    background: transparent;
    padding: 10px 16px;
    font-size: 14px;
    outline: none;
    color: var(--text);
}

.search-box input::placeholder {
    color: var(--text-muted);
}

.search-btn {
    background: var(--primary);
    color: white;
    border: none;
    padding: 10px 16px;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: background 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.search-btn:hover {
    background: var(--primary-light);
}

/* 分类导航 */
.category-nav {
    background: var(--bg-body);
    border-bottom: 1px solid var(--border);
    padding: 12px 0;
    overflow-x: auto;
}

.category-nav .container {
    display: flex;
    gap: 8px;
    flex-wrap: nowrap;
}

.nav-item {
    background: transparent;
    border: 1px solid var(--border);
    padding: 8px 20px;
    border-radius: var(--radius-lg);
    font-size: 14px;
    font-weight: 500;
    color: var(--text-light);
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.2s;
}

.nav-item:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.nav-item.active {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
}

/* 主内容区 */
.main-content {
    padding: 40px 0;
    min-height: calc(100vh - 300px);
}

/* 标签页 */
.tabs {
    display: flex;
    gap: 4px;
    margin-bottom: 32px;
    border-bottom: 2px solid var(--border);
    padding-bottom: 0;
}

.tab {
    background: transparent;
    border: none;
    padding: 14px 24px;
    font-size: 15px;
    font-weight: 500;
    color: var(--text-light);
    cursor: pointer;
    position: relative;
    transition: all 0.2s;
    border-radius: var(--radius-sm) var(--radius-sm) 0 0;
}

.tab::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--primary);
    transform: scaleX(0);
    transition: transform 0.2s;
}

.tab:hover {
    color: var(--primary);
    background: rgba(10,37,64,0.03);
}

.tab.active {
    color: var(--primary);
    background: rgba(10,37,64,0.05);
}

.tab.active::after {
    transform: scaleX(1);
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

/* 卡片网格 */
.cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 24px;
}

/* 卡片 - 官网扁平风格 */
.card {
    background: var(--bg-card);
    border-radius: var(--radius-md);
    padding: 28px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border);
    transition: all 0.3s ease;
}

.card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
    border-color: rgba(10,37,64,0.15);
}

.card-header {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 18px;
    padding-bottom: 14px;
    border-bottom: 1px solid var(--border);
}

.card-icon {
    width: 44px;
    height: 44px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
}

.card-title {
    font-size: 17px;
    font-weight: 600;
    color: var(--primary);
}

.card-badge {
    margin-left: auto;
    background: var(--primary);
    color: white;
    font-size: 11px;
    padding: 3px 10px;
    border-radius: 12px;
    font-weight: 500;
}

/* 表格样式 */
.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
    background: var(--bg-card);
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

.data-table th,
.data-table td {
    padding: 12px 16px;
    text-align: left;
    border-bottom: 1px solid var(--border);
}

.data-table th {
    background: var(--bg-light);
    font-weight: 600;
    color: var(--text);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.data-table tr:last-child td {
    border-bottom: none;
}

.data-table tr:hover td {
    background: rgba(10,37,64,0.02);
}

.data-table .highlight {
    color: var(--primary);
    font-weight: 600;
}

/* 检查清单 */
.checklist-section {
    margin-top: 48px;
}

.section-title {
    font-size: 22px;
    font-weight: 600;
    margin-bottom: 24px;
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--primary);
}

.checklist-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 24px;
}

.checklist-card {
    background: var(--bg-card);
    border-radius: var(--radius-md);
    padding: 24px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border);
}

.checklist-card h3 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 16px;
    color: var(--primary);
}

.checklist {
    list-style: none;
}

.checklist li {
    margin-bottom: 12px;
}

.checklist label {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    cursor: pointer;
    font-size: 14px;
    color: var(--text);
    transition: color 0.2s;
}

.checklist label:hover {
    color: var(--primary);
}

.checklist input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--primary);
    cursor: pointer;
    flex-shrink: 0;
    margin-top: 2px;
}

/* 搜索结果弹窗 */
.search-results-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.search-results-modal.active {
    display: flex;
    animation: fadeIn 0.2s ease;
}

.search-results-content {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 700px;
    max-height: 80vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow-lg);
}

.search-results-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid var(--border);
}

.search-results-header h3 {
    font-size: 18px;
    font-weight: 600;
    color: var(--primary);
}

.close-btn {
    background: none;
    border: none;
    font-size: 28px;
    color: var(--text-muted);
    cursor: pointer;
    line-height: 1;
    padding: 0;
}

.close-btn:hover {
    color: var(--text);
}

#searchResultsBody {
    padding: 24px;
    overflow-y: auto;
    flex: 1;
}

.search-result-item {
    padding: 16px;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    margin-bottom: 12px;
    cursor: pointer;
    transition: all 0.2s;
}

.search-result-item:hover {
    border-color: var(--primary);
    background: rgba(10,37,64,0.02);
}

.search-result-item h4 {
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 6px;
    color: var(--primary);
}

.search-result-item p {
    font-size: 13px;
    color: var(--text-light);
    line-height: 1.5;
}

.search-result-item .highlight {
    background: #fef3c7;
    padding: 0 2px;
    border-radius: 2px;
}

/* 页脚 */
.footer {
    background: var(--bg-card);
    border-top: 1px solid var(--border);
    padding: 32px 0;
    text-align: center;
    margin-top: 48px;
}

.footer p {
    color: var(--text-light);
    font-size: 14px;
}

.footer .reference {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 8px;
}

/* 分类标签颜色 */
.category-tag {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 500;
    margin-right: 6px;
}

.category-tag.keycap { background: #e0f2fe; color: #0369a1; }
.category-tag.seal { background: #dcfce7; color: #15803d; }
.category-tag.medical { background: #fef3c7; color: #b45309; }
.category-tag.overmold { background: #f3e8ff; color: #7c3aed; }
.category-tag.electronic { background: #fee2e2; color: #dc2626; }
.category-tag.automotive { background: #dbeafe; color: #1d4ed8; }

/* 响应式 */
@media (max-width: 768px) {
    .header .container {
        flex-direction: column;
        gap: 16px;
    }
    
    .search-box {
        max-width: 100%;
        order: 2;
    }
    
    .logo {
        order: 1;
    }
    
    .category-nav {
        padding: 8px 0;
    }
    
    .nav-item {
        padding: 6px 14px;
        font-size: 13px;
    }
    
    .tabs {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    .tab {
        padding: 12px 16px;
        font-size: 14px;
        white-space: nowrap;
    }
    
    .cards-grid {
        grid-template-columns: 1fr;
    }
    
    .checklist-grid {
        grid-template-columns: 1fr;
    }
    
    .data-table {
        font-size: 13px;
    }
    
    .data-table th,
    .data-table td {
        padding: 10px 12px;
    }
}

@media (max-width: 480px) {
    .top-bar {
        font-size: 11px;
        padding: 6px 0;
    }
    
    .container {
        padding: 0 12px;
    }
    
    .header-nav {
        gap: 16px;
    }
    
    .header-nav a {
        font-size: 13px;
    }
    
    .tab {
        padding: 10px 14px;
        font-size: 13px;
    }
    
    .card {
        padding: 20px;
    }
    
    .card-title {
        font-size: 15px;
    }
    
    .section-title {
        font-size: 18px;
    }
}

/* 打印样式 */
@media print {
    .header,
    .category-nav,
    .tabs,
    .search-box,
    .footer {
        display: none;
    }
    
    .card {
        break-inside: avoid;
        box-shadow: none;
        border: 1px solid #ddd;
    }
}

/* 加载动画 */
.card-loading {
    animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* 触摸优化 */
@media (hover: none) and (pointer: coarse) {
    .tab,
    .nav-item,
    .card,
    .checklist label {
        min-height: 44px;
    }
}
