/* 光亮智虹谱官网 - 样式表 */
:root {
    --primary: #1a3a5c;
    --primary-light: #2a5a8c;
    --secondary: #e8a925;
    --text-dark: #333;
    --text-light: #666;
    --bg-light: #f5f7fa;
    --white: #fff;
    --border: #e0e4e8;
    --shadow: 0 2px 8px rgba(0,0,0,0.1);
}

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

body {
    font-family: 'Noto Sans SC', -apple-system, BlinkMacSystemFont, sans-serif;
    color: var(--text-dark);
    line-height: 1.6;
    background: var(--white);
}

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

a { text-decoration: none; color: inherit; }
img { max-width: 100%; height: auto; }

/* 头部 */
.header {
    background: var(--white);
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 15px 20px;
    max-width: 1200px;
    margin: 0 auto;
    gap: 20px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
}

.header-search {
    display: flex;
    align-items: center;
    gap: 0;
}

.header-search input {
    padding: 8px 12px;
    border: 1px solid var(--border);
    border-radius: 6px 0 0 6px;
    font-size: 14px;
    width: 180px;
    outline: none;
}

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

.header-search button {
    padding: 8px 12px;
    border: 1px solid var(--primary);
    border-left: none;
    border-radius: 0 6px 6px 0;
    background: var(--primary);
    color: white;
    cursor: pointer;
}

.logo-icon {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
    font-size: 18px;
}

.logo-text {
    font-size: 20px;
    font-weight: 700;
    color: var(--primary);
}

.logo-sub {
    font-size: 12px;
    color: var(--text-light);
}

.nav { display: flex; gap: 30px; }

.nav a {
    font-size: 15px;
    color: var(--text-dark);
    padding: 8px 0;
    position: relative;
    transition: color 0.3s;
}

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

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

.nav a:hover::after, .nav a.active::after { width: 100%; }

/* 轮播 */
.banner {
    position: relative;
    height: 50vh;
    min-height: 300px;
    max-height: 600px;
    overflow: hidden;
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
}

.banner-slide { opacity: 0; position: absolute; width: 100%; height: 100%; transition: opacity 0.8s; display: flex; align-items: center; justify-content: center; overflow: hidden; }

.banner-slide.active { opacity: 1; }

.banner-overlay { display: none; }

.banner-slide > img { position: absolute; top: 0; left: 0; width: 100%; height: 100%; object-fit: cover; }

.banner-content { position: relative; z-index: 2; }

.banner-slides {
    height: 100%;
    position: relative;
}

.banner-slide {
    position: absolute;
    width: 100%;
    height: 100%;
    opacity: 0;
    transition: opacity 0.8s;
    display: flex;
    align-items: center;
    background-size: cover;
    background-position: center;
}

.banner-slide.active { opacity: 1; }

.banner-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(26,58,92,0.7), rgba(42,90,140,0.5));
}

.banner-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 40px;
    color: white;
    width: 100%;
    position: relative;
    z-index: 2;
}

.banner-title {
    font-size: 42px;
    font-weight: 700;
    margin-bottom: 15px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

.banner-subtitle {
    font-size: 18px;
    opacity: 0.9;
    margin-bottom: 30px;
}

.banner-dots {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 10px;
}

.banner-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: rgba(255,255,255,0.5);
    cursor: pointer;
    transition: all 0.3s;
}

.banner-dot.active {
    background: var(--secondary);
    transform: scale(1.2);
}

/* 区块标题 */
.section-title {
    text-align: center;
    margin-bottom: 50px;
}

.section-title h2 {
    font-size: 32px;
    color: var(--primary);
    margin-bottom: 10px;
}

.section-title p {
    color: var(--text-light);
    font-size: 16px;
}

.section-title::after {
    content: '';
    display: block;
    width: 60px;
    height: 3px;
    background: var(--secondary);
    margin: 15px auto 0;
}

/* 产品分类 */
.categories {
    padding: 60px 0;
    background: var(--bg-light);
}

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

.category-card {
    background: white;
    padding: 30px 20px;
    border-radius: 12px;
    text-align: center;
    box-shadow: var(--shadow);
    transition: all 0.3s;
    cursor: pointer;
}

.category-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
}

.category-icon {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    border-radius: 50%;
    margin: 0 auto 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 24px;
}

.category-card h3 {
    font-size: 16px;
    color: var(--primary);
    margin-bottom: 8px;
}

.category-card p {
    font-size: 13px;
    color: var(--text-light);
}

/* 产品列表 */
.products {
    padding: 80px 0;
}

.products-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 40px;
}

.products-filter {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.filter-btn {
    padding: 8px 20px;
    border: 1px solid var(--border);
    border-radius: 20px;
    background: white;
    cursor: pointer;
    transition: all 0.3s;
    font-size: 14px;
}

.filter-btn:hover, .filter-btn.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 30px;
}

.product-card {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: all 0.3s;
}

.product-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 30px rgba(0,0,0,0.15);
}

.product-image {
    height: 200px;
    background: linear-gradient(135deg, #f0f4f8, #e0e8f0);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 48px;
    color: var(--primary);
    overflow: hidden;
    padding: 10px;
    box-sizing: border-box;
}

.product-image img {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
    display: block;
    margin: auto;
}

.product-info {
    padding: 20px;
}

.product-category {
    font-size: 12px;
    color: var(--secondary);
    margin-bottom: 5px;
}

.product-title {
    font-size: 18px;
    color: var(--primary);
    margin-bottom: 8px;
    font-weight: 600;
}

.product-model {
    font-size: 13px;
    color: var(--text-light);
    margin-bottom: 10px;
}

.product-desc {
    font-size: 14px;
    color: var(--text-light);
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.product-link {
    display: inline-block;
    margin-top: 15px;
    color: var(--primary);
    font-size: 14px;
    font-weight: 500;
}

.product-link:hover { color: var(--secondary); }

/* 关于我们 */
.about {
    padding: 80px 0;
    background: var(--bg-light);
}

.about-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 60px;
    align-items: center;
}

.about-text h3 {
    font-size: 24px;
    color: var(--primary);
    margin-bottom: 20px;
}

.about-text p {
    color: var(--text-light);
    margin-bottom: 15px;
    line-height: 1.8;
}

.about-stats {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 30px;
    margin-top: 30px;
}

.stat-item {
    text-align: center;
}

.stat-number {
    font-size: 42px;
    font-weight: 700;
    color: var(--primary);
}

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

/* 联系 */
.contact {
    padding: 80px 0;
}

.contact-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 60px;
}

.contact-info h3 {
    font-size: 24px;
    color: var(--primary);
    margin-bottom: 30px;
}

.contact-item {
    display: flex;
    align-items: flex-start;
    gap: 15px;
    margin-bottom: 25px;
}

.contact-icon {
    width: 45px;
    height: 45px;
    background: var(--primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 18px;
    flex-shrink: 0;
}

.contact-detail h4 {
    font-size: 16px;
    color: var(--text-dark);
    margin-bottom: 5px;
}

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

.contact-form {
    background: white;
    padding: 40px;
    border-radius: 16px;
    box-shadow: var(--shadow);
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-size: 14px;
    color: var(--text-dark);
    font-weight: 500;
}

.form-group input, .form-group textarea {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 15px;
    transition: border-color 0.3s;
    font-family: inherit;
}

.form-group input:focus, .form-group textarea:focus {
    outline: none;
    border-color: var(--primary);
}

.form-group textarea {
    min-height: 120px;
    resize: vertical;
}

.btn {
    display: inline-block;
    padding: 12px 30px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    cursor: pointer;
    transition: all 0.3s;
}

.btn:hover {
    background: var(--primary-light);
    transform: translateY(-2px);
}

/* 页脚 */
.footer {
    background: var(--primary);
    color: white;
    padding: 50px 0 20px;
}

.footer-content {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 40px;
    margin-bottom: 40px;
}

.footer h4 {
    font-size: 18px;
    margin-bottom: 20px;
}

.footer p, .footer a {
    color: rgba(255,255,255,0.8);
    font-size: 14px;
    line-height: 2;
}

.footer a:hover { color: var(--secondary); }

.footer-bottom {
    text-align: center;
    padding-top: 20px;
    border-top: 1px solid rgba(255,255,255,0.1);
    color: rgba(255,255,255,0.6);
    font-size: 13px;
}

/* 产品详情 */
.product-detail {
    padding: 60px 0;
}

.product-detail-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 60px;
}

.product-gallery {
    background: var(--bg-light);
    border-radius: 16px;
    padding: 30px;
    text-align: center;
}

.product-gallery-main {
    height: 400px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 72px;
    color: var(--primary);
    margin-bottom: 20px;
    overflow: hidden;
}

.product-gallery-main img {
    max-width: 100%;
    max-height: 400px;
    width: auto;
    height: auto;
    object-fit: contain;
}

.product-meta {
    margin-top: 30px;
}

.product-meta-item {
    display: flex;
    padding: 12px 0;
    border-bottom: 1px solid var(--border);
}

.product-meta-item:last-child { border-bottom: none; }

.product-meta-label {
    width: 120px;
    font-weight: 500;
    color: var(--text-light);
}

.product-meta-value {
    flex: 1;
    color: var(--text-dark);
}

.product-specs {
    margin-top: 40px;
    padding: 20px;
    background: var(--bg-light);
    border-radius: 12px;
}

.product-specs h3 {
    font-size: 22px;
    color: var(--primary);
    margin-bottom: 20px;
    font-weight: 600;
}

.specs-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: 8px;
    overflow: hidden;
}

.specs-table th, .specs-table td {
    padding: 14px 18px;
    text-align: left;
    border-bottom: 1px solid var(--border);
}

.specs-table th {
    background: var(--primary);
    color: white;
    font-weight: 500;
    width: 25%;
}

.specs-table td { color: var(--text-dark); }

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

/* 分页 */
.pagination {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 40px;
}

.pagination a, .pagination span {
    padding: 8px 14px;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 14px;
}

.pagination a:hover {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

.pagination .current {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

/* 响应式 */
@media (max-width: 768px) {
    .header-inner { flex-direction: column; gap: 15px; }
    .nav { flex-wrap: wrap; justify-content: center; gap: 15px; }
    .banner { height: 300px; }
    .banner-title { font-size: 28px; }
    .about-content, .contact-content, .product-detail-content { grid-template-columns: 1fr; }
    .footer-content { grid-template-columns: 1fr; text-align: center; }
    .products-grid { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
}

/* 后台样式 */
.admin-body {
    background: #f0f2f5;
    font-family: -apple-system, BlinkMacSystemFont, sans-serif;
}

.admin-header {
    background: var(--primary);
    color: white;
    padding: 0 20px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.admin-logo {
    font-size: 18px;
    font-weight: 600;
}

.admin-user {
    display: flex;
    align-items: center;
    gap: 15px;
}

.admin-user a {
    color: rgba(255,255,255,0.8);
    font-size: 14px;
}

.admin-user a:hover { color: white; }

.admin-container {
    display: flex;
    min-height: calc(100vh - 60px);
}

.admin-sidebar {
    width: 220px;
    background: white;
    border-right: 1px solid #e0e0e0;
    padding: 20px 0;
}

.admin-menu {
    list-style: none;
}

.admin-menu li a {
    display: block;
    padding: 12px 20px;
    color: var(--text-dark);
    font-size: 15px;
    border-left: 3px solid transparent;
    transition: all 0.3s;
}

.admin-menu li a:hover, .admin-menu li a.active {
    background: #f5f7fa;
    color: var(--primary);
    border-left-color: var(--primary);
}

.admin-main {
    flex: 1;
    padding: 30px;
}

.admin-card {
    background: white;
    border-radius: 12px;
    padding: 25px;
    margin-bottom: 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.admin-card h2 {
    font-size: 20px;
    color: var(--primary);
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--border);
}

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

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

.admin-table th {
    background: #f8f9fa;
    font-weight: 600;
    color: var(--text-dark);
}

.admin-table tr:hover td { background: #f8f9fa; }

.admin-table .actions {
    display: flex;
    gap: 10px;
}

.admin-table .actions a {
    padding: 5px 12px;
    border-radius: 4px;
    font-size: 13px;
}

.btn-edit {
    background: var(--primary);
    color: white;
}

.btn-delete {
    background: #dc3545;
    color: white;
}

.btn-add {
    background: var(--secondary);
    color: white;
}

.admin-form {
    max-width: 800px;
}

.admin-form .form-row {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}

.admin-form .form-group {
    margin-bottom: 20px;
}

.admin-form .form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: var(--text-dark);
}

.admin-form .form-group input,
.admin-form .form-group select,
.admin-form .form-group textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 14px;
}

.admin-form .form-group textarea {
    min-height: 100px;
    resize: vertical;
}

.admin-form .btn { margin-top: 10px; }

.login-box {
    max-width: 400px;
    margin: 100px auto;
    background: white;
    padding: 40px;
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
}

.login-box h1 {
    font-size: 24px;
    color: var(--primary);
    text-align: center;
    margin-bottom: 30px;
}

.login-box .form-group {
    margin-bottom: 20px;
}

.alert {
    padding: 12px 15px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-size: 14px;
}

.alert-success {
    background: #d4edda;
    color: #155724;
}

.alert-error {
    background: #f8d7da;
    color: #721c24;
}

/* 统计卡片 */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: white;
    padding: 25px;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.stat-card h3 {
    font-size: 14px;
    color: var(--text-light);
    margin-bottom: 10px;
}

.stat-card .value {
    font-size: 32px;
    font-weight: 700;
    color: var(--primary);
}

.stat-card.blue { border-left: 4px solid #007bff; }
.stat-card.green { border-left: 4px solid #28a745; }
.stat-card.orange { border-left: 4px solid #fd7e14; }
.stat-card.red { border-left: 4px solid #dc3545; }

@media (max-width: 768px) {
    .stats-grid { grid-template-columns: repeat(2, 1fr); }
    .admin-sidebar { width: 60px; }
    .admin-menu li a span { display: none; }
    .admin-form .form-row { grid-template-columns: 1fr; }
    .banner { height: 40vh; min-height: 250px; }
    .banner-title { font-size: 24px; }
    .banner-subtitle { font-size: 14px; }
    .banner-content { padding: 0 20px; }
}
