/* ===================================
   LSR设计指南 - 样式文件
   彦榕精密 YRlims Technical
   =================================== */

:root {
    /* 品牌色 - 科技蓝 */
    --primary: #0066cc;
    --primary-dark: #0052a3;
    --primary-light: #e6f2ff;
    
    /* 辅助色 */
    --accent: #00a0e9;
    --success: #52c41a;
    --warning: #faad14;
    --danger: #ff4d4f;
    
    /* 中性色 */
    --bg-body: #f5f7fa;
    --bg-card: #ffffff;
    --bg-header: #ffffff;
    --text-primary: #1a1a2e;
    --text-secondary: #5a6270;
    --text-muted: #8c92a4;
    --border: #e4e7ed;
    --border-light: #f0f2f5;
    
    /* 阴影 */
    --shadow-sm: 0 2px 8px rgba(0,0,0,0.06);
    --shadow-md: 0 4px 16px rgba(0,0,0,0.08);
    --shadow-lg: 0 8px 32px rgba(0,0,0,0.12);
    
    /* 圆角 */
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;
}

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

html {
    scroll-behavior: smooth;
}

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

/* 顶部栏 */
.top-bar {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    color: #fff;
    padding: 8px 0;
    font-size: 13px;
}

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

.company-en {
    opacity: 0.8;
}

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

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

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

/* 页头 */
.header {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    border-bottom: 1px solid var(--border);
    padding: 20px 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 {
    object-fit: contain;
    background: transparent;

    width: 80px;
    height: 40px;
}

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

.logo-name {
    font-size: 22px;
    font-weight: 700;
    color: #fff;
    line-height: 1.1;
    letter-spacing: 1px;
}

.logo-full {
    font-size: 11px;
    color: rgba(255,255,255,0.7);
    letter-spacing: 0.5px;
}

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

.header-nav a {
    color: #fff;
    text-decoration: none;
    font-size: 15px;
    font-weight: 500;
    transition: color 0.3s;
    position: relative;
}

.header-nav a::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 2px;
    background: #fff;
    transition: width 0.3s;
}

.header-nav a:hover {
    color: rgba(255,255,255,0.8);
}

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

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

.search-box:focus-within {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-light);
}

.search-box input {
    flex: 1;
    border: none;
    background: transparent;
    padding: 10px 16px;
    font-size: 15px;
    outline: none;
}

.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-dark);
}

/* 分类导航 */
.category-nav {
    background: var(--bg-header);
    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-secondary);
    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: 32px 0;
    min-height: calc(100vh - 300px);
}

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

.tab {
    background: transparent;
    border: none;
    padding: 12px 24px;
    font-size: 16px;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    position: relative;
    transition: color 0.2s;
}

.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);
}

.tab.active {
    color: var(--primary);
}

.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(10px); }
    to { opacity: 1; transform: translateY(0); }
}

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

/* 卡片 */
.card {
    background: var(--bg-card);
    border-radius: var(--radius-md);
    padding: 24px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-light);
    transition: all 0.3s ease;
}

.card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
    border-color: var(--primary-light);
}

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

.card-icon {
    width: 40px;
    height: 40px;
    background: var(--primary-light);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
}

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

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

/* 表格样式 */
.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

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

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

.data-table tr:hover td {
    background: var(--primary-light);
}

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

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

.section-title {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 24px;
    display: flex;
    align-items: center;
    gap: 10px;
}

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

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

.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-secondary);
    transition: color 0.2s;
}

.checklist label:hover {
    color: var(--text-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;
}

.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-primary);
}

#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: var(--primary-light);
}

.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-secondary);
    line-height: 1.5;
}

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

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

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

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

/* 响应式 */
@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: 10px 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: 8px;
    }
}

/* 打印样式 */
@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; }
}

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

.category-tag.keycap { background: #e6f7ff; color: #1890ff; }
.category-tag.seal { background: #f6ffed; color: #52c41a; }
.category-tag.medical { background: #fff7e6; color: #fa8c16; }
.category-tag.overmold { background: #f9f0ff; color: #722ed1; }
.category-tag.electronic { background: #fff1f0; color: #f5222d; }
.category-tag.automotive { background: #f0f5ff; color: #2f54eb; }

/* ===================================
   手机适配增强 - 2026-03-14
   =================================== */

/* 平板适配 */
@media (max-width: 1024px) {
    .header .container {
        flex-wrap: wrap;
    }
    
    .header-nav {
        gap: 20px;
    }
    
    .cards-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* 手机适配 */
@media (max-width: 768px) {
    /* 头部 */
    .header {
        padding: 12px 0;
    }
    
    .header .container {
        flex-direction: column;
        gap: 12px;
        padding: 0 12px;
    }
    
    /* Logo 缩小 */
    
.logo-img {
    object-fit: contain;
    background: transparent;

        width: 60px !important;
        height: 30px !important;
    }
    
    .logo-name {
        font-size: 18px !important;
    }
    
    .logo-full {
        font-size: 9px !important;
    }
    
    /* 顶部导航 - 改为横向滚动 */
    .header-nav {
        display: flex;
        gap: 8px;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        padding: 8px 0;
        width: 100%;
        justify-content: flex-start;
    }
    
    .header-nav a {
        white-space: nowrap;
        font-size: 14px;
        padding: 8px 12px;
        background: rgba(255,255,255,0.1);
        border-radius: 6px;
    }
    
    .header-nav a::after {
        display: none;
    }
    
    /* 搜索框 */
    .search-box {
        width: 100%;
        max-width: 100%;
    }
    
    /* 标签页 - 横向滚动 */
    .tabs {
        display: flex;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        gap: 4px;
        padding-bottom: 4px;
        border-bottom: 1px solid var(--border);
    }
    
    .tab {
        padding: 10px 16px;
        font-size: 14px;
        white-space: nowrap;
        flex-shrink: 0;
    }
    
    /* 分类导航 */
    .category-nav .container {
        flex-wrap: nowrap;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    /* 卡片网格 - 单列 */
    .cards-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    
    .card {
        padding: 16px;
    }
    
    /* 表格横向滚动 */
    .data-table {
        display: block;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    /* 检查清单 */
    .checklist-grid {
        grid-template-columns: 1fr;
    }
    
    .checklist-card {
        padding: 16px;
    }
    
    /* 搜索弹窗 */
    .search-results-content {
        max-height: 90vh;
        margin: 10px;
    }
    
    /* 页脚 */
    .footer {
        padding: 20px 0;
    }
    
    .footer p {
        font-size: 12px;
    }
}

/* 更小屏幕 */
@media (max-width: 480px) {
    .top-bar {
        font-size: 11px;
        padding: 6px 0;
    }
    
    .container {
        padding: 0 12px;
    }
    
    .logo-text {
        display: none;
    }
    
    .header-nav a {
        font-size: 13px;
        padding: 6px 10px;
    }
    
    .tab {
        padding: 8px 12px;
        font-size: 13px;
    }
    
    .card-title {
        font-size: 14px;
    }
    
    .section-title {
        font-size: 16px;
    }
}

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