* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif; color: #333; background: #f8f9fa; padding-top: 152px; }

.site-header { position: fixed; top: 0; left: 0; right: 0; z-index: 1000; background: #e8f4fd; }
.top-bar { border-bottom: 1px solid #d0e8f5; }
.top-bar-inner { max-width: 1200px; margin: 0 auto; display: flex; align-items: center; padding: 0 20px; gap: 16px; height: 100px; }
.header-logo { flex-shrink: 0; }
.header-logo img { height: 80px; display: block; }
.header-tagline { font-size: 16px; color: #555; flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-decoration: none; }
.header-tagline:hover { color: #1890ff; }
.header-actions { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.nav-bar { border-bottom: 1px solid #d0e8f5; background: #f0f8ff; }
.nav-bar-inner { max-width: 1200px; margin: 0 auto; display: flex; align-items: center; padding: 0 20px; height: 50px; gap: 2px; }
.nav-item { text-decoration: none; color: #2c3e50; font-size: 14px; padding: 6px 14px; border-radius: 20px; border: 1px solid transparent; transition: all 0.2s; }
.nav-item:hover { background: #4a9eff; color: #fff; border-color: #4a9eff; }
.nav-toggle { display: none; background: none; border: none; font-size: 22px; cursor: pointer; color: #2c3e50; margin-left: auto; }
.nav-btn { text-decoration: none; padding: 6px 14px; border-radius: 8px; font-size: 13px; font-weight: 500; white-space: nowrap; }
.btn-logout { background: transparent; color: #999; border: 1px solid #ddd; }
.btn-logout:hover { background: #f5f5f5; color: #666; }
.login-buttons, .user-center-link { display: flex; align-items: center; gap: 8px; }
.language-selector { display:flex; align-items:center; gap:6px; }
.language-selector select { padding: 5px 10px 5px 6px; border-radius: 8px; border: 1px solid #d0d5dd; background: #fff; font-size: 13px; cursor: pointer; }

/* Custom select replacement */
.lang-select-custom { position:relative; display:inline-block; z-index:999; }
.lang-select-trigger { display:flex; align-items:center; gap:6px; padding:4px 10px 4px 6px; border:1px solid #d0d5dd; border-radius:8px; background:#fff; cursor:pointer; font-size:13px; user-select:none; height:30px; box-sizing:border-box; }
.lang-select-trigger:hover { border-color:#bbb; }
.lang-select-trigger .lang-arrow { display:inline-block; width:0; height:0; border-left:4px solid transparent; border-right:4px solid transparent; border-top:5px solid #999; margin-left:2px; }
.lang-select-dropdown { display:none; position:absolute; top:calc(100% + 2px); left:0; background:#fff; border:1px solid #d0d5dd; border-radius:8px; box-shadow:0 4px 12px rgba(0,0,0,0.1); padding:4px 0; min-width:100%; width:max-content; box-sizing:border-box; overflow:hidden; }
.lang-select-custom.open .lang-select-dropdown { display:block; }
.lang-select-item { display:flex; align-items:center; gap:6px; padding:6px 10px 6px 6px; cursor:pointer; font-size:13px; white-space:nowrap; }
.lang-select-item:hover { background:#f0f7ff; }
.btn-primary { background: #4a9eff; color: #fff; border: none; }
.btn-primary:hover { background: #3a8eef; }
.btn-orange { background: #ff6b35; color: #fff; border: none; }
.btn-orange:hover { background: #e55a2b; }
.btn-lg { padding: 12px 24px; font-size: 16px; }
.btn-block { display: block; width: 100%; }
.btn { display: inline-block; padding: 8px 16px; border-radius: 8px; border: 1px solid #d0d5dd; background: #fff; color: #333; cursor: pointer; font-size: 14px; text-decoration: none; text-align: center; }
.btn-sm { padding: 4px 10px; font-size: 12px; }
.btn-success { background: #52c41a; color: #fff; border-color: #52c41a; }
.btn-danger { background: #ff4d4f; color: #fff; border-color: #ff4d4f; }
.btn-warning { background: #faad14; color: #fff; border-color: #faad14; }

.btn-translate-all { padding: 4px 14px; border: 1px solid #52c41a; border-radius: 6px; font-size: 12px; cursor: pointer; background: #52c41a; color: #fff; transition: all .2s; white-space: nowrap; }
.btn-translate-all:hover { background: #45a818; border-color: #45a818; }
.btn-translate-all:disabled { opacity: 0.7; cursor: not-allowed; }

.main-content { min-height: calc(100vh - 152px - 300px); }

.banner-carousel { position: relative; width: 100%; height: 400px; overflow: hidden; }
.banner-container { width: 100%; height: 400px; }
.banner-slide { display: none; width: 100%; height: 400px; }
.banner-slide.active { display: block; }
.banner-slide img { width: 100%; height: 400px; object-fit: cover; }
.banner-dots { position: absolute; bottom: 16px; left: 50%; transform: translateX(-50%); display: flex; gap: 8px; }
.dot { width: 10px; height: 10px; border-radius: 50%; background: rgba(255,255,255,0.5); cursor: pointer; }
.dot.active { background: #fff; }

.search-section { background: linear-gradient(135deg, #e8f4fd, #f0f8ff); padding: 32px 20px; text-align: center; }
.search-container { max-width: 600px; margin: 0 auto; }
.search-container h1 { font-size: 28px; margin-bottom: 20px; color: #2c3e50; }
.search-form { display: flex; gap: 8px; }
.search-input { flex: 1; padding: 14px 20px; border: 2px solid #d0d5dd; border-radius: 8px; font-size: 16px; outline: none; }
.search-input:focus { border-color: #4a9eff; }
.search-btn { padding: 14px 32px; background: #4a9eff; color: #fff; border: none; border-radius: 8px; font-size: 16px; cursor: pointer; }
.search-btn:hover { background: #3a8eef; }

.section { padding: 32px 20px; max-width: 1200px; margin: 0 auto; }
.bg-light { background: #f0f8ff; border-radius: 16px; }
.section-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; }
.section-header h2 { font-size: 22px; color: #1a3a6b; font-weight: 700; position: relative; padding-left: 14px; }
.section-header h2::before { content: ''; position: absolute; left: 0; top: 4px; bottom: 4px; width: 4px; border-radius: 2px; background: linear-gradient(180deg, #4a9eff, #2c6bcf); }
.section-header h2 .sec-icon { margin-right: 8px; }
.view-all { color: #4a9eff; text-decoration: none; font-weight: 500; font-size: 14px; }

.product-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 20px; }
.product-card { background: #fff; border-radius: 12px; box-shadow: 0 2px 8px rgba(0,0,0,0.08); overflow: hidden; text-decoration: none; color: #333; transition: all 0.3s; }
.product-card:hover { transform: translateY(-4px); box-shadow: 0 8px 24px rgba(0,0,0,0.12); }
.product-image { width: 100%; height: 180px; background: #f5f5f5; display: flex; align-items: center; justify-content: center; overflow: hidden; }
.product-image img { width: 100%; height: 100%; object-fit: contain; padding: 12px; }
.product-image-placeholder { font-size: 48px; color: #ccc; font-weight: 700; }
.product-info { padding: 16px; }
.product-model { font-size: 16px; font-weight: 600; margin-bottom: 4px; color: #2c3e50; }
.product-brand { font-size: 13px; color: #666; margin-bottom: 8px; }
.product-desc { font-size: 13px; color: #888; line-height: 1.5; }

.brand-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 20px; max-width: 1200px; margin: 0 auto; padding: 0 20px 28px; }
.brand-card { background: #fff; border-radius: 12px; box-shadow: 0 2px 8px rgba(0,0,0,0.08); padding: 2px 20px; text-align: center; text-decoration: none; color: #333; transition: all 0.3s; display: flex; flex-direction: column; align-items: center; gap: 2px; }
.brand-card:hover { transform: translateY(-4px); box-shadow: 0 8px 24px rgba(0,0,0,0.12); }
.brand-card img { max-height: 180px; max-width: 100%; object-fit: contain; }
.brand-name-logo { font-size: 14px; font-weight: 600; color: #4a9eff; }
.brand-name { font-size: 13px; color: #666; }

.case-grid, .news-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 24px; max-width: 1200px; margin: 0 auto; padding: 0 20px 48px; }
.case-card, .news-card { background: #fff; border-radius: 12px; box-shadow: 0 2px 8px rgba(0,0,0,0.08); overflow: hidden; text-decoration: none; color: #333; transition: all 0.3s; }
.case-card:hover, .news-card:hover { transform: translateY(-4px); box-shadow: 0 8px 24px rgba(0,0,0,0.12); }
.case-image, .news-image { width: 100%; height: 200px; object-fit: cover; }
.case-info, .news-info { padding: 20px; }
.case-info h3, .news-info h3 { font-size: 18px; margin-bottom: 8px; color: #2c3e50; }
.case-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.tag { background: #e8f4fd; color: #4a9eff; padding: 4px 10px; border-radius: 20px; font-size: 12px; }
.news-date { font-size: 13px; color: #999; margin-bottom: 8px; }

.products-layout, .news-layout { display: flex; gap: 24px; max-width: 1200px; margin: 24px auto; padding: 0 20px; }
.filter-sidebar { width: 220px; flex-shrink: 0; }
.filter-section { margin-bottom: 24px; }
.filter-section h3 { font-size: 16px; margin-bottom: 12px; color: #2c3e50; }
.filter-list { list-style: none; }
.filter-list li { margin-bottom: 4px; }
.filter-list a { display: block; padding: 8px 12px; border-radius: 8px; text-decoration: none; color: #555; font-size: 14px; }
.filter-list a:hover, .filter-list a.active { background: #e8f4fd; color: #4a9eff; }
.products-content, .news-content { flex: 1; }

.page-header { background: #e8f4fd; padding: 32px 20px; text-align: center; }
.page-header h1 { font-size: 28px; color: #2c3e50; }

.breadcrumb { padding: 16px 20px; font-size: 14px; color: #888; max-width: 1200px; margin: 0 auto; }
.breadcrumb a { color: #4a9eff; text-decoration: none; }
.product-detail { max-width: 1200px; margin: 0 auto; padding: 0 20px; }
.product-detail-layout { display: flex; gap: 40px; margin: 24px 0; }
.product-detail-image { flex: 1; max-width: 500px; }
.product-detail-image img { width: 100%; border-radius: 12px; cursor: zoom-in; }
.thumbnail-list { display: flex; gap: 8px; margin-top: 8px; }
.thumbnail { width: 60px; height: 60px; object-fit: contain; border: 2px solid transparent; border-radius: 8px; cursor: pointer; }
.thumbnail:hover { border-color: #4a9eff; }
.product-detail-info { flex: 1; }
.product-detail-info h1 { font-size: 28px; color: #2c3e50; margin-bottom: 12px; }
.product-brand-tag { color: #666; margin-bottom: 16px; }
.product-description { line-height: 1.8; color: #444; margin-bottom: 24px; white-space: pre-wrap; }
.product-detail-info .btn { margin-right: 12px; margin-top: 12px; }

.article-detail { max-width: 800px; margin: 0 auto; padding: 0 20px; }
.article-detail article h1 { font-size: 28px; color: #2c3e50; margin: 24px 0 12px; }
.article-date { color: #999; margin-bottom: 24px; }
.article-image { width: 100%; border-radius: 12px; margin-bottom: 24px; }
.article-content { line-height: 1.8; color: #444; white-space: pre-wrap; }
.article-content p { margin-bottom: 16px; }

.brand-detail { max-width: 1200px; margin: 0 auto; padding: 0 20px; }
.brand-header { display: flex; gap: 32px; margin: 24px 0; padding: 32px; background: #fff; border-radius: 12px; box-shadow: 0 2px 8px rgba(0,0,0,0.08); }
.brand-logo-large img { max-height: 100px; }
.brand-info h1 { font-size: 24px; margin-bottom: 16px; }
.brand-info p { white-space: pre-wrap; line-height: 1.6; color: #555; }

.stats-bar { display: flex; justify-content: center; gap: 48px; padding: 32px 20px; }
.stat-item { text-align: center; }
.stat-number { display: block; font-size: 36px; font-weight: 700; color: #4a9eff; }
.stat-label { font-size: 14px; color: #666; margin-top: 4px; }
.stats-grid { display: grid; grid-template-columns: repeat(3, 200px); gap: 24px; justify-content: center; padding: 32px 20px; }
.stats-row { display: flex; justify-content: center; gap: 24px; padding: 32px 20px; flex-wrap: nowrap; }
.stat-card { background: #fff; border-radius: 12px; box-shadow: 0 2px 8px rgba(0,0,0,0.08); padding: 24px; text-align: center; min-width: 180px; }
.client-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 24px; max-width: 1200px; margin: 0 auto; padding: 0 20px 48px; }
.client-card { background: #fff; border-radius: 12px; box-shadow: 0 2px 8px rgba(0,0,0,0.08); padding: 24px; text-align: center; }
.client-logo { max-height: 60px; margin-bottom: 12px; }
.client-industry { color: #888; font-size: 13px; margin: 8px 0; }
.client-card blockquote { font-style: italic; color: #666; border-left: 3px solid #4a9eff; padding-left: 16px; text-align: left; margin-top: 12px; font-size: 14px; }

.about-content { max-width: 800px; margin: 0 auto; padding: 48px 20px; line-height: 1.8; white-space: pre-wrap; }

.auth-page { display: flex; justify-content: center; align-items: center; min-height: calc(100vh - 64px - 300px); padding: 24px 20px; }
.auth-card { background: #fff; border-radius: 12px; box-shadow: 0 2px 16px rgba(0,0,0,0.1); padding: 40px; width: 100%; max-width: 600px; }
.auth-card h1 { font-size: 24px; margin-bottom: 24px; text-align: center; }
.auth-link { text-align: center; margin-top: 16px; font-size: 14px; color: #666; }
.auth-link a { color: #4a9eff; text-decoration: none; }

.dashboard { max-width: 1200px; margin: 0 auto; padding: 32px 20px; }
.dashboard h1 { font-size: 24px; margin-bottom: 24px; }
.dashboard-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 20px; }
.dashboard-card { background: #fff; border-radius: 12px; box-shadow: 0 2px 8px rgba(0,0,0,0.08); padding: 24px; }
.dashboard-card h3 { font-size: 18px; margin-bottom: 8px; }
.dashboard-card p { color: #666; margin-bottom: 16px; font-size: 14px; }

.footer { background: #1a2a3a; color: #c8d6e5; padding: 48px 20px 24px; margin-top: 48px; }
.footer-container { max-width: 1200px; margin: 0 auto; display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 32px; }
.footer-section h3 { color: #fff; margin-bottom: 12px; }
.footer-section h4 { color: #fff; margin-bottom: 12px; }
.footer-section p { margin-bottom: 8px; font-size: 14px; }
.footer-section a { display: block; color: #c8d6e5; text-decoration: none; margin-bottom: 8px; font-size: 14px; }
.footer-section a:hover { color: #4a9eff; }
.footer-bottom { text-align: center; margin-top: 32px; padding-top: 16px; border-top: 1px solid #2a3a4a; font-size: 13px; }
.footer-notice { text-align: center; padding: 4px 20px; margin: 24px auto 0; background: rgba(255,193,7,0.1); border: 1px solid rgba(255,193,7,0.3); border-radius: 4px; font-size: 13px; display: inline-block; }
.footer-notice .warn-icon { margin-right: 8px; font-size: 16px; vertical-align: middle; color: #ff8c00; }

.chat-fab { position: fixed; bottom: 24px; right: 24px; width: 56px; height: 56px; background: #4a9eff; border-radius: 50%; display: flex; align-items: center; justify-content: center; cursor: pointer; box-shadow: 0 4px 16px rgba(74,158,255,0.4); z-index: 999; }
.chat-fab:hover { transform: scale(1.1); }
.chat-window { position: fixed; bottom: 90px; right: 24px; width: 360px; max-height: 500px; background: #fff; border-radius: 16px; box-shadow: 0 8px 32px rgba(0,0,0,0.15); display: none; flex-direction: column; z-index: 1000; overflow: hidden; }
.chat-header { background: #4a9eff; color: #fff; padding: 12px 18px; display: flex; justify-content: space-between; align-items: center; font-weight: 600; font-size: 14px; }
.chat-header button { background: none; border: none; color: #fff; font-size: 18px; cursor: pointer; }
.chat-body { flex: 1; padding: 12px; overflow-y: auto; max-height: 300px; display: flex; flex-direction: column; gap: 8px; }
.chat-input-area { padding: 10px 14px; border-top: 1px solid #eee; }
.chat-input-field { width: 100%; padding: 8px; border: 1px solid #d0d5dd; border-radius: 8px; margin-bottom: 6px; font-size: 12px; outline: none; }
.chat-input-field:focus { border-color: #4a9eff; }
.chat-textarea { width: 100%; padding: 8px; border: 1px solid #d0d5dd; border-radius: 8px; resize: none; height: 54px; font-size: 12px; outline: none; margin-bottom: 6px; }
.chat-textarea:focus { border-color: #4a9eff; }
.chat-start-btn, .chat-send-btn { width: 100%; padding: 8px; background: #4a9eff; color: #fff; border: none; border-radius: 8px; cursor: pointer; font-size: 12px; }
.chat-start-btn:hover, .chat-send-btn:hover { background: #3a8eef; }
.chat-greeting { text-align: center; color: #888; font-size: 12px; padding: 16px; }
.msg-wrapper { display: flex; flex-direction: column; max-width: 80%; }
.msg-left { align-self: flex-start; }
.msg-right { align-self: flex-end; }
.msg-meta { font-size: 11px; color: #999; margin-bottom: 2px; padding: 0 2px; }
.user-msg { background: #e8f4fd; border: 1px solid #4a9eff; border-radius: 12px 4px 12px 12px; padding: 8px 12px; font-size: 12px; color: #333; word-break: break-word; }
.admin-msg { background: #fff; border: 1px solid #d0d5dd; border-radius: 4px 12px 12px 12px; padding: 8px 12px; font-size: 12px; color: #333; word-break: break-word; }
.chat-status { text-align: center; color: #888; font-size: 11px; padding: 4px; }

.form-group { margin-bottom: 16px; }
.form-group label { display: block; margin-bottom: 6px; font-size: 14px; color: #333; font-weight: 500; }
.form-input { width: 100%; padding: 10px 14px; border: 1px solid #d0d5dd; border-radius: 8px; font-size: 14px; outline: none; transition: border-color 0.2s; }
.form-input:focus { border-color: #4a9eff; }
.form-textarea { width: 100%; padding: 10px 14px; border: 1px solid #d0d5dd; border-radius: 8px; font-size: 14px; outline: none; resize: vertical; min-height: 80px; }
.form-textarea:focus { border-color: #4a9eff; }

.empty-state { text-align: center; padding: 48px; color: #999; font-size: 16px; }

.dashboard { max-width: 1200px; margin: 0 auto; padding: 32px 20px; }
.dashboard h1 { font-size: 24px; margin-bottom: 8px; }
.dashboard-welcome { color: #666; margin-bottom: 24px; font-size: 14px; }
.dashboard-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 20px; }
.dashboard-card { background: #fff; border: 1px solid #e0e0e0; border-radius: 12px; padding: 24px; transition: box-shadow 0.2s; }
.dashboard-card:hover { box-shadow: 0 4px 16px rgba(0,0,0,0.08); }
.dashboard-card .card-icon { font-size: 32px; margin-bottom: 12px; }
.dashboard-card h3 { font-size: 16px; margin-bottom: 6px; }
.dashboard-card p { font-size: 14px; color: #666; margin-bottom: 16px; }
.dashboard-card .btn { font-size: 13px; padding: 6px 14px; }

.product-title-row { display: flex; align-items: center; gap: 12px; }
.product-title-row h1 { flex: 1; }
.favorite-btn { font-size: 28px; background: none; border: none; cursor: pointer; color: #ccc; transition: color 0.2s, transform 0.2s; padding: 4px; line-height: 1; }
.favorite-btn:hover { color: #f5a623; transform: scale(1.2); }
.favorite-btn.favorited { color: #f5a623; }

.dashboard table { width: 100%; border-collapse: collapse; background: #fff; border-radius: 8px; overflow: hidden; box-shadow: 0 1px 4px rgba(0,0,0,0.06); }
.dashboard table th { background: #f8f9fa; padding: 10px 14px; text-align: left; font-size: 13px; color: #666; border-bottom: 2px solid #e8edf2; white-space: nowrap; }
.dashboard table td { padding: 10px 14px; font-size: 14px; border-bottom: 1px solid #f0f0f0; }
.dashboard table tr:hover { background: #f0f7ff; }

.status-badge { display: inline-block; padding: 2px 10px; border-radius: 12px; font-size: 12px; }
.status-pending { background: #fff7e6; color: #d48806; }
.status-active { background: #f6ffed; color: #52c41a; }
.status-inactive { background: #f5f5f5; color: #999; }

/* Language flags */
.lang-flag { display: inline-block; width: 20px; height: 15px; border-radius: 2px; vertical-align: middle; flex-shrink: 0; background-size: cover; background-position: center; background-repeat: no-repeat; }
.lang-flag-zh { background-image: url('/static/images/flags/zh.png'); }
.lang-flag-en { background-image: url('/static/images/flags/en.png'); }
.lang-flag-ko { background-image: url('/static/images/flags/ko.png'); }
.lang-flag-ja { background-image: url('/static/images/flags/ja.png'); }
.lang-flag-vi { background-image: url('/static/images/flags/vi.png'); }
.lang-flag-th { background-image: url('/static/images/flags/th.png'); }
.lang-flag-ms { background-image: url('/static/images/flags/ms.png'); }

.translate-spinner {
  display: inline-block;
  width: 14px;
  height: 14px;
  border: 2px solid currentColor;
  border-top-color: transparent;
  border-radius: 50%;
  animation: tspin 0.6s linear infinite;
  vertical-align: middle;
}
.btn-translate-all .translate-spinner {
  border-color: #fff;
  border-top-color: transparent;
}
@keyframes tspin {
  to { transform: rotate(360deg); }
}

@media (max-width: 768px) {
    .header-tagline { display: none; }
    .header-actions { gap: 4px; }
    .nav-bar-inner { padding: 0 10px; gap: 0; overflow-x: auto; }
    .nav-bar-inner .nav-item { padding: 6px 6px; font-size: 13px; white-space: nowrap; }
    .nav-toggle { display: none; }
    body { padding-top: 102px; }
    .banner-carousel, .banner-container, .banner-slide { height: 160px; }
    .banner-slide img { height: 160px; object-fit: cover; }
    .product-grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); }
    .products-layout, .news-layout { flex-direction: column; }
    .filter-sidebar { width: 100%; }
    .product-detail-layout { flex-direction: column; }
    .product-detail-image { max-width: 100%; }
    .brand-header { flex-direction: column; }
    .chat-window { width: calc(100% - 24px); right: 12px; }
}
