/* ========== 杰哥板材 AI 数据端点 - 样式 ========== */

:root {
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --bg: #f8fafc;
    --card-bg: #ffffff;
    --text: #1e293b;
    --text-light: #64748b;
    --border: #e2e8f0;
    --eco-enf: #059669;
    --eco-e0: #0284c7;
    --eco-e1: #d97706;
    --radius: 8px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header */
header {
    background: var(--card-bg);
    border-bottom: 1px solid var(--border);
    padding: 16px 0;
    position: sticky;
    top: 0;
    z-index: 100;
}

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

.logo {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--primary);
    text-decoration: none;
}

.nav-links a {
    margin-left: 24px;
    color: var(--text-light);
    text-decoration: none;
    font-size: 0.95rem;
}

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

/* Hero */
.hero {
    text-align: center;
    padding: 60px 0 40px;
}

.hero h1 {
    font-size: 2.5rem;
    font-weight: 800;
    margin-bottom: 8px;
}

.tagline {
    font-size: 1.2rem;
    color: var(--primary);
    font-weight: 600;
    margin-bottom: 8px;
}

.subtitle {
    color: var(--text-light);
    max-width: 600px;
    margin: 0 auto 24px;
}

.search-box {
    display: flex;
    max-width: 560px;
    margin: 0 auto;
    gap: 8px;
}

.search-box input {
    flex: 1;
    padding: 12px 16px;
    border: 2px solid var(--border);
    border-radius: var(--radius);
    font-size: 1rem;
    outline: none;
    transition: border-color 0.2s;
}

.search-box input:focus {
    border-color: var(--primary);
}

.search-box button {
    padding: 12px 28px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: var(--radius);
    font-size: 1rem;
    cursor: pointer;
    font-weight: 600;
}

.search-box button:hover {
    background: var(--primary-dark);
}

/* Categories */
.categories { margin: 40px 0; }
.categories h2 { margin-bottom: 16px; }

.cat-grid {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.cat-card {
    padding: 12px 24px;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    text-decoration: none;
    color: var(--text);
    font-weight: 600;
    transition: all 0.2s;
}

.cat-card:hover {
    border-color: var(--primary);
    color: var(--primary);
}

/* Product Grid */
.products { margin: 40px 0; }
.products h2 { margin-bottom: 16px; }

.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 16px;
}

.product-card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    text-decoration: none;
    color: var(--text);
    transition: all 0.2s;
}

.product-card:hover {
    border-color: var(--primary);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.1);
    transform: translateY(-2px);
}

.product-name {
    font-weight: 600;
    margin-bottom: 8px;
    font-size: 0.95rem;
}

.product-meta {
    display: flex;
    gap: 8px;
    margin-bottom: 8px;
}

.eco-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 700;
    color: white;
    background: var(--eco-enf);
}

.eco-badge.e0 { background: var(--eco-e0); }
.eco-badge.e1 { background: var(--eco-e1); }

.thickness {
    font-size: 0.8rem;
    color: var(--text-light);
}

.product-price {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--primary);
}

/* AI Info */
.ai-info {
    margin: 60px 0 40px;
    padding: 32px;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}

.ai-info h2 { margin-bottom: 12px; }

.ai-info p {
    color: var(--text-light);
    margin-bottom: 12px;
}

.ai-info ul {
    padding-left: 20px;
}

.ai-info li {
    margin-bottom: 6px;
    color: var(--text-light);
}

.ai-info li strong {
    color: var(--text);
}

/* Product Detail */
.product-detail { padding: 24px 0; }

.breadcrumb {
    margin-bottom: 20px;
    font-size: 0.9rem;
    color: var(--text-light);
}

.breadcrumb a {
    color: var(--primary);
    text-decoration: none;
}

.detail-grid {
    display: grid;
    grid-template-columns: 1fr 340px;
    gap: 32px;
}

.detail-main h1 {
    font-size: 1.8rem;
    margin-bottom: 12px;
}

.product-desc {
    color: var(--text-light);
    margin-bottom: 24px;
}

.spec-table h2 {
    font-size: 1.2rem;
    margin-bottom: 12px;
}

.spec-table table {
    width: 100%;
    border-collapse: collapse;
}

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

.spec-table th {
    width: 140px;
    color: var(--text-light);
    font-weight: 500;
    background: #f8fafc;
}

/* Sidebar */
.price-box {
    background: var(--card-bg);
    border: 2px solid var(--primary);
    border-radius: var(--radius);
    padding: 24px;
    text-align: center;
    margin-bottom: 20px;
}

.price-main {
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--primary);
}

.price-main span {
    font-size: 1rem;
    font-weight: 400;
    color: var(--text-light);
}

.price-sqm {
    color: var(--text-light);
    margin: 4px 0 12px;
}

.in-stock { color: var(--eco-enf); font-weight: 600; }
.out-stock { color: var(--eco-e1); font-weight: 600; }

.quote-btn {
    display: block;
    padding: 12px 0;
    background: var(--primary);
    color: white;
    text-decoration: none;
    border-radius: var(--radius);
    font-weight: 600;
    margin: 16px 0 8px;
    transition: background 0.2s;
}

.quote-btn:hover { background: var(--primary-dark); }

.price-note {
    font-size: 0.85rem;
    color: var(--text-light);
}

.compare-box {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px;
}

.compare-box h3 {
    margin-bottom: 12px;
    font-size: 1rem;
}

.compare-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
}

.compare-table th, .compare-table td {
    padding: 6px 8px;
    border-bottom: 1px solid var(--border);
    text-align: left;
}

/* Related */
.related { margin: 40px 0; }
.related h2 { margin-bottom: 16px; }

/* Search */
.search-section { padding: 24px 0; }
.search-section h1 { margin-bottom: 20px; }

.search-form { margin-bottom: 24px; }

.search-row {
    display: flex;
    gap: 8px;
}

.search-row input {
    flex: 1;
    padding: 10px 14px;
    border: 2px solid var(--border);
    border-radius: var(--radius);
    font-size: 0.95rem;
    outline: none;
}

.search-row input:focus { border-color: var(--primary); }

.search-row select {
    padding: 10px 12px;
    border: 2px solid var(--border);
    border-radius: var(--radius);
    font-size: 0.95rem;
    outline: none;
    background: white;
}

.search-row button {
    padding: 10px 24px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: var(--radius);
    font-size: 0.95rem;
    cursor: pointer;
    font-weight: 600;
}

.result-count {
    color: var(--text-light);
    margin-bottom: 12px;
}

.results-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--card-bg);
    border-radius: var(--radius);
    overflow: hidden;
    border: 1px solid var(--border);
}

.results-table th {
    padding: 12px 16px;
    background: #f8fafc;
    text-align: left;
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--text-light);
    border-bottom: 1px solid var(--border);
}

.results-table td {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border);
    font-size: 0.9rem;
}

.results-table tr {
    cursor: pointer;
    transition: background 0.15s;
}

.results-table tr:hover { background: #f0f4ff; }

.no-results {
    text-align: center;
    padding: 40px;
    color: var(--text-light);
}

/* 404 */
.not-found {
    text-align: center;
    padding: 80px 0;
}

.not-found h1 { font-size: 4rem; color: var(--text-light); }
.not-found p { color: var(--text-light); margin: 8px 0 24px; }

.back-home {
    display: inline-block;
    padding: 10px 24px;
    background: var(--primary);
    color: white;
    text-decoration: none;
    border-radius: var(--radius);
    font-weight: 600;
}

/* Contact Section */
.contact-section {
    margin: 40px 0;
    padding: 32px;
    background: var(--card-bg);
    border: 2px solid var(--primary);
    border-radius: var(--radius);
}

.contact-section h2 {
    margin-bottom: 20px;
    color: var(--primary);
}

.contact-grid {
    display: grid;
    grid-template-columns: 1fr 200px;
    gap: 32px;
    align-items: center;
}

.contact-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 8px;
}

.contact-desc {
    color: var(--text-light);
    margin-bottom: 16px;
    line-height: 1.7;
}

.contact-detail p {
    margin-bottom: 4px;
}

.contact-qr {
    text-align: center;
}

.contact-qr img {
    width: 180px;
    height: 180px;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    margin-bottom: 8px;
}

.contact-qr p {
    font-size: 0.85rem;
    color: var(--text-light);
}

/* Contact Mini (sidebar) */
.contact-mini {
    margin-top: 16px;
    padding: 16px;
    background: #f0f4ff;
    border-radius: var(--radius);
    text-align: center;
}

.contact-mini-title {
    font-weight: 600;
    font-size: 0.9rem;
    margin-bottom: 8px;
    color: var(--primary);
}

.contact-mini img {
    width: 120px;
    height: 120px;
    border-radius: var(--radius);
    margin-bottom: 4px;
}

.contact-mini-name {
    font-size: 0.8rem;
    color: var(--text-light);
}

/* Search contact hint */
.search-contact-hint {
    background: #f0f4ff;
    padding: 12px 16px;
    border-radius: var(--radius);
    margin-bottom: 16px;
    font-size: 0.9rem;
}

.search-contact-hint a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
}

.search-contact-hint a:hover {
    text-decoration: underline;
}

/* Footer */
footer {
    margin-top: 60px;
    padding: 24px 0;
    border-top: 1px solid var(--border);
    text-align: center;
    font-size: 0.85rem;
    color: var(--text-light);
}

.footer-ai { margin-top: 8px; }
.footer-ai a { color: var(--primary); text-decoration: none; margin: 0 4px; }
.footer-ai a:hover { text-decoration: underline; }

.footer-contact {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--border);
}

/* Responsive */
@media (max-width: 768px) {
    .detail-grid { grid-template-columns: 1fr; }
    .search-row { flex-wrap: wrap; }
    .hero h1 { font-size: 1.8rem; }
    .product-grid { grid-template-columns: 1fr 1fr; }
    .contact-grid { grid-template-columns: 1fr; text-align: center; }
    .contact-qr { order: -1; }
}
