/* ============================================================
   style.css - 海创智造科技官网全局样式
   ============================================================ */

/* ========== 1. 基础重置 ========== */
* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
    font-family: 'Microsoft YaHei', 'PingFang SC', 'Helvetica Neue', Arial, sans-serif;
    color: #333;
    line-height: 1.6;
    background: #f8f9fa;
    overflow-x: hidden;
}
a { text-decoration: none; color: inherit; transition: 0.3s; }
img { max-width: 100%; display: block; }
ul { list-style: none; }
button { font-family: inherit; cursor: pointer; }

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

/* ========== 2. 颜色变量 ========== */
:root {
    --primary: #1a56db;
    --primary-dark: #1543a8;
    --primary-light: #e0eaff;
    --text-dark: #1e293b;
    --text-gray: #64748b;
    --bg-light: #f1f5f9;
    --border: #e2e8f0;
    --white: #ffffff;
}

/* ========== 3. 导航栏 ========== */
header {
    background: #fff;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    position: sticky;
    top: 0;
    z-index: 1000;
}
.nav-wrap {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 70px;
}
.logo img { height: 40px; width: auto; }
nav { display: flex; align-items: center; }
nav a {
    margin-left: 35px;
    font-weight: 500;
    color: #555;
    font-size: 15px;
    position: relative;
}
nav a::after {
    content: '';
    position: absolute;
    bottom: -6px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--primary);
    transition: 0.3s;
}
nav a:hover { color: var(--primary); }
nav a:hover::after { width: 100%; }

.nav-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 26px;
    color: var(--primary);
    padding: 5px 10px;
}

/* ========== 4. Banner ========== */
.banner {
    height: 520px;
    background-size: cover;
    background-position: center;
    display: flex;
    align-items: center;
    color: #fff;
    position: relative;
    overflow: hidden;
}
.banner::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: linear-gradient(120deg, rgba(15, 42, 92, 0.75), rgba(26, 86, 219, 0.45));
}
.banner-text { position: relative; z-index: 2; max-width: 700px; }
.banner-text h1 {
    font-size: 3rem;
    font-weight: 700;
    margin-bottom: 15px;
    line-height: 1.2;
    letter-spacing: 1px;
}
.banner-text p { font-size: 1.25rem; margin-bottom: 30px; opacity: 0.95; }

.banner.small { height: 320px; }
.banner.small .banner-text h1 { font-size: 2.2rem; }

/* ========== 5. 按钮 ========== */
.btn {
    display: inline-block;
    padding: 13px 34px;
    background: var(--primary);
    color: #fff;
    border-radius: 4px;
    font-size: 15px;
    font-weight: 500;
    transition: all 0.3s;
    border: none;
    cursor: pointer;
}
.btn:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(26, 86, 219, 0.35);
    color: #fff;
}
.btn-outline {
    background: transparent;
    border: 2px solid var(--primary);
    color: var(--primary);
}
.btn-outline:hover { background: var(--primary); color: #fff; }

/* ========== 6. 通用 Section ========== */
.section { padding: 80px 0; }
.section.bg-light { background: var(--bg-light); }
.section-title {
    text-align: center;
    font-size: 2rem;
    margin-bottom: 15px;
    color: var(--text-dark);
    position: relative;
    padding-bottom: 20px;
}
.section-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 3px;
    background: var(--primary);
    border-radius: 2px;
}
.section-subtitle {
    text-align: center;
    color: var(--text-gray);
    margin-bottom: 50px;
    font-size: 1rem;
}
.text-center { text-align: center; }

/* ========== 7. 网格 / 卡片 ========== */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 30px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 30px; }

.card {
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
    transition: all 0.4s;
}
.card:hover {
    transform: translateY(-8px);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.12);
}
.card img { width: 100%; height: 220px; object-fit: cover; }
.card h3 { padding: 22px 22px 10px; font-size: 1.2rem; color: var(--text-dark); }
.card p { padding: 0 22px 22px; color: var(--text-gray); font-size: 0.95rem; line-height: 1.7; }

/* ========== 8. 数据区 ========== */
.data-grid {
    display: flex;
    justify-content: space-around;
    text-align: center;
    flex-wrap: wrap;
    gap: 20px;
    margin-top: 50px;
}
.data-grid > div {
    padding: 20px 30px;
    background: #fff;
    border-radius: 8px;
    min-width: 180px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
}
.data-grid h3 { font-size: 2.5rem; color: var(--primary); font-weight: 700; margin-bottom: 5px; }
.data-grid p { color: var(--text-gray); font-size: 0.95rem; }

/* ========== 9. 表单 / 联系我们 ========== */
.form-box {
    background: #fff;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
}
.form-box input,
.form-box textarea,
.form-box select {
    width: 100%;
    padding: 13px 15px;
    margin-bottom: 18px;
    border: 1px solid var(--border);
    border-radius: 4px;
    font-size: 15px;
    font-family: inherit;
    transition: 0.3s;
    background: #fafbfc;
}
.form-box input:focus,
.form-box textarea:focus {
    outline: none;
    border-color: var(--primary);
    background: #fff;
    box-shadow: 0 0 0 3px rgba(26, 86, 219, 0.1);
}
.form-box textarea { resize: vertical; min-height: 120px; }
.form-box button { width: 100%; }

.contact-info p {
    padding: 12px 0;
    font-size: 1.05rem;
    color: var(--text-gray);
    border-bottom: 1px dashed var(--border);
}
.contact-info p:last-child { border-bottom: none; }
.contact-info strong { color: var(--text-dark); }

/* ========== 10. 页脚 ========== */
footer {
    background: #1e293b;
    color: #94a3b8;
    text-align: center;
    padding: 35px 0;
    font-size: 14px;
}
footer p { margin: 5px 0; }
footer a { color: #cbd5e1; }
footer a:hover { color: #fff; }

/* ========== 11. 提示消息 ========== */
.alert-success {
    background: #dcfce7;
    color: #166534;
    padding: 12px 18px;
    border-radius: 6px;
    margin-bottom: 20px;
    border-left: 4px solid #22c55e;
}
.alert-error {
    background: #fee2e2;
    color: #991b1b;
    padding: 12px 18px;
    border-radius: 6px;
    margin-bottom: 20px;
    border-left: 4px solid #ef4444;
}

/* ========== 12. 滚动动画 ========== */
.card, .section-title, .data-grid > div {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.7s ease, transform 0.7s ease;
}
.card.fade-in, .section-title.fade-in, .data-grid > div.fade-in {
    opacity: 1;
    transform: translateY(0);
}

/* ============================================================
   13. 后台登录
   ============================================================ */
.admin-login {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: linear-gradient(135deg, #1e293b 0%, #1a56db 100%);
    padding: 20px;
}
.login-box {
    background: #fff;
    padding: 45px 40px;
    border-radius: 10px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    width: 100%;
    max-width: 420px;
}
.login-box h2 {
    text-align: center;
    margin-bottom: 30px;
    color: var(--text-dark);
    font-size: 1.4rem;
}
.login-box input {
    width: 100%;
    padding: 13px 15px;
    margin-bottom: 18px;
    border: 1px solid var(--border);
    border-radius: 4px;
    font-size: 15px;
    transition: 0.3s;
}
.login-box input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(26, 86, 219, 0.1);
}
.login-box .btn { width: 100%; }

/* ============================================================
   14. 后台布局（新版）
   ============================================================ */
.admin-container { display: flex; min-height: 100vh; background: #f1f5f9; }

.admin-sidebar {
    width: 240px;
    background: linear-gradient(180deg, #1e293b 0%, #0f172a 100%);
    color: #fff;
    padding: 25px 15px;
    flex-shrink: 0;
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
}
.admin-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0 10px 22px;
    border-bottom: 1px solid #334155;
    margin-bottom: 22px;
    font-size: 1.05rem;
    font-weight: 700;
    letter-spacing: 1px;
    color: #fff;
}
.admin-brand img { height: 32px; width: auto; }
.admin-sidebar h3 {
    font-size: 12px;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    margin: 0 10px 12px;
    font-weight: 600;
}
.admin-sidebar a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    color: #94a3b8;
    border-radius: 8px;
    margin-bottom: 4px;
    font-size: 14.5px;
    transition: all 0.25s;
}
.admin-sidebar a .ico { font-size: 16px; width: 20px; text-align: center; }
.admin-sidebar a:hover { background: #334155; color: #fff; transform: translateX(3px); }
.admin-sidebar a.active {
    background: linear-gradient(135deg, #1a56db, #2563eb);
    color: #fff;
    box-shadow: 0 6px 18px rgba(26, 86, 219, 0.4);
}
.admin-sidebar a.logout { color: #f87171; }
.admin-sidebar a.logout:hover { background: #7f1d1d; color: #fff; }

.admin-content {
    flex: 1;
    padding: 30px 35px;
    overflow-x: auto;
    max-width: calc(100vw - 240px);
}

/* ============================================================
   15. 后台留言管理页美化（新版）
   ============================================================ */

/* 顶部横幅 */
.admin-hero {
    background: linear-gradient(135deg, #1e293b 0%, #1a56db 100%);
    color: #fff;
    border-radius: 12px;
    padding: 28px 32px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
    margin-bottom: 25px;
    box-shadow: 0 10px 30px rgba(26, 86, 219, 0.25);
    position: relative;
    overflow: hidden;
}
.admin-hero::after {
    content: '';
    position: absolute;
    right: -60px;
    top: -60px;
    width: 200px;
    height: 200px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 50%;
}
.admin-hero::before {
    content: '';
    position: absolute;
    right: 40px;
    bottom: -80px;
    width: 150px;
    height: 150px;
    background: rgba(255, 255, 255, 0.06);
    border-radius: 50%;
}
.admin-hero h2 { font-size: 1.6rem; margin-bottom: 6px; position: relative; z-index: 2; }
.admin-hero p { font-size: 14px; opacity: 0.9; position: relative; z-index: 2; }
.admin-hero strong { color: #fbbf24; }
.hero-btn {
    display: inline-block;
    padding: 10px 22px;
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: #fff;
    border-radius: 8px;
    font-size: 14px;
    backdrop-filter: blur(10px);
    transition: 0.3s;
    position: relative;
    z-index: 2;
}
.hero-btn:hover {
    background: #fff;
    color: #1a56db;
    transform: translateY(-2px);
}

/* 统计卡片 */
.stat-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin-bottom: 25px;
}
.stat-card {
    background: #fff;
    border-radius: 14px;
    padding: 22px 24px;
    display: flex;
    align-items: center;
    gap: 16px;
    box-shadow: 0 4px 20px rgba(15, 23, 42, 0.06);
    transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    border: 1px solid #f1f5f9;
}
.stat-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 15px 35px rgba(15, 23, 42, 0.12);
}
.stat-card::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    border-radius: 14px 0 0 14px;
}
.stat-blue::before { background: linear-gradient(180deg, #3b82f6, #1a56db); }
.stat-green::before { background: linear-gradient(180deg, #4ade80, #16a34a); }
.stat-orange::before { background: linear-gradient(180deg, #fbbf24, #d97706); }

.stat-icon {
    width: 54px;
    height: 54px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    flex-shrink: 0;
}
.stat-blue .stat-icon { background: linear-gradient(135deg, #dbeafe, #bfdbfe); color: #1a56db; }
.stat-green .stat-icon { background: linear-gradient(135deg, #dcfce7, #bbf7d0); color: #16a34a; }
.stat-orange .stat-icon { background: linear-gradient(135deg, #fef3c7, #fde68a); color: #d97706; }

.stat-num { font-size: 1.9rem; font-weight: 700; color: #0f172a; line-height: 1.2; }
.stat-label { color: #64748b; font-size: 13px; margin-top: 2px; }
.stat-trend {
    margin-left: auto;
    font-size: 12px;
    padding: 4px 10px;
    border-radius: 12px;
    background: #f1f5f9;
    color: #64748b;
    font-weight: 600;
}

/* 搜索栏 */
.admin-search {
    display: flex;
    gap: 10px;
    margin-bottom: 22px;
    flex-wrap: wrap;
}
.search-input-wrap {
    flex: 1;
    min-width: 220px;
    position: relative;
}
.search-ico {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 15px;
    pointer-events: none;
    opacity: 0.6;
}
.admin-search input {
    width: 100%;
    padding: 12px 16px 12px 44px;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    font-size: 14px;
    font-family: inherit;
    transition: 0.3s;
    background: #fff;
}
.admin-search input:focus {
    outline: none;
    border-color: #1a56db;
    box-shadow: 0 0 0 4px rgba(26, 86, 219, 0.1);
}
.admin-search .btn {
    padding: 12px 26px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
}

/* 表格容器 */
.table-wrap {
    background: #fff;
    border-radius: 14px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(15, 23, 42, 0.06);
    border: 1px solid #f1f5f9;
}

/* 表格 */
.admin-table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
}
.admin-table thead th {
    background: #f8fafc;
    padding: 16px 20px;
    text-align: left;
    font-size: 12.5px;
    font-weight: 700;
    color: #475569;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    border-bottom: 2px solid #e2e8f0;
}
.admin-table tbody td {
    padding: 16px 20px;
    border-bottom: 1px solid #f1f5f9;
    font-size: 14px;
    color: #334155;
    vertical-align: middle;
}
.admin-table tbody tr { transition: all 0.25s; }
.admin-table tbody tr:hover { background: #f8fafc; }
.admin-table tbody tr:last-child td { border-bottom: none; }

/* ID 徽章 */
.id-badge {
    display: inline-block;
    padding: 4px 10px;
    background: linear-gradient(135deg, #e0eaff, #c7d8ff);
    color: #1a56db;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 700;
}

/* 用户单元格（头像 + 名字） */
.user-cell {
    display: flex;
    align-items: center;
    gap: 10px;
}
.avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: linear-gradient(135deg, #1a56db, #2563eb);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 14px;
    flex-shrink: 0;
    box-shadow: 0 3px 8px rgba(26, 86, 219, 0.3);
}

/* 电话单元格 */
.phone-cell {
    display: inline-block;
    padding: 4px 10px;
    background: #f1f5f9;
    color: #334155;
    border-radius: 6px;
    font-size: 13px;
    font-family: 'Courier New', monospace;
    cursor: pointer;
    transition: 0.25s;
    border: 1px dashed transparent;
}
.phone-cell:hover {
    background: #e0eaff;
    color: #1a56db;
    border-color: #1a56db;
}
.phone-cell.copied {
    background: #dcfce7;
    color: #16a34a;
    border-color: #16a34a;
}

/* 留言内容 */
.msg-content {
    max-width: 420px;
    word-break: break-word;
    line-height: 1.65;
    color: #475569;
    font-size: 13.5px;
}

/* 时间 */
.time-cell {
    color: #94a3b8;
    font-size: 12.5px;
    white-space: nowrap;
}

/* 删除按钮 */
.btn-del {
    display: inline-block;
    padding: 7px 16px;
    background: #fee2e2;
    color: #dc2626;
    border-radius: 7px;
    font-size: 13px;
    font-weight: 600;
    transition: 0.3s;
    border: 1px solid transparent;
}
.btn-del:hover {
    background: #dc2626;
    color: #fff;
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(220, 38, 38, 0.35);
}

/* 空状态 */
.empty-state {
    text-align: center;
    padding: 80px 20px;
    color: #94a3b8;
}
.empty-state p { margin-top: 15px; font-size: 15px; }

/* 分页 */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 6px;
    margin-top: 28px;
    flex-wrap: wrap;
}
.pagination a,
.pagination span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    padding: 0 14px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 500;
    color: #475569;
    background: #fff;
    border: 1px solid #e2e8f0;
    transition: 0.25s;
}
.pagination a:hover {
    background: #e0eaff;
    border-color: #1a56db;
    color: #1a56db;
    transform: translateY(-2px);
}
.pagination a.active {
    background: linear-gradient(135deg, #1a56db, #2563eb);
    border-color: #1a56db;
    color: #fff;
    font-weight: 700;
    box-shadow: 0 6px 15px rgba(26, 86, 219, 0.4);
}
.pagination span { border: none; background: transparent; color: #94a3b8; }

.admin-footer-note {
    text-align: center;
    color: #94a3b8;
    font-size: 13px;
    margin-top: 18px;
}

/* 移动端 */
@media (max-width: 768px) {
    .admin-container { flex-direction: column; }
    .admin-sidebar {
        width: 100%;
        height: auto;
        position: static;
        padding: 15px;
        display: flex;
        flex-wrap: wrap;
        gap: 8px;
    }
    .admin-brand { width: 100%; margin-bottom: 8px; padding-bottom: 12px; }
    .admin-sidebar h3 { width: 100%; margin-bottom: 8px; }
    .admin-sidebar a {
        padding: 8px 12px;
        font-size: 13px;
        margin-bottom: 0;
    }
    .admin-sidebar a .ico { font-size: 14px; }
    .admin-content { padding: 20px 15px; max-width: 100%; }

    .admin-hero { padding: 22px; }
    .admin-hero h2 { font-size: 1.3rem; }

    .stat-grid { grid-template-columns: 1fr; gap: 14px; }
    .stat-card { padding: 18px; }

    .admin-search { flex-direction: column; }
    .admin-search .btn { width: 100%; }

    .table-wrap { overflow-x: auto; }
    .admin-table { min-width: 750px; }
    .msg-content { max-width: 260px; }
}
/* ============================================================
   16. 响应式
   ============================================================ */
@media (max-width: 992px) {
    .grid-3 { grid-template-columns: repeat(2, 1fr); }
    .banner-text h1 { font-size: 2.4rem; }
}

@media (max-width: 768px) {
    /* 导航 */
    .nav-toggle { display: block; }
    nav {
        position: absolute;
        top: 70px;
        left: 0;
        right: 0;
        background: #fff;
        flex-direction: column;
        align-items: stretch;
        box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.4s ease;
    }
    nav.open { max-height: 400px; }
    nav a {
        margin: 0;
        padding: 15px 25px;
        border-bottom: 1px solid var(--border);
    }
    nav a::after { display: none; }

    /* Banner */
    .banner { height: 420px; }
    .banner-text h1 { font-size: 1.9rem; }
    .banner-text p { font-size: 1rem; }
    .banner.small { height: 220px; }
    .banner.small .banner-text h1 { font-size: 1.6rem; }

    /* 网格 */
    .grid-2, .grid-3 { grid-template-columns: 1fr; gap: 22px; }

    /* Section */
    .section { padding: 55px 0; }
    .section-title { font-size: 1.6rem; }

    /* 数据 */
    .data-grid { flex-direction: column; align-items: center; }
    .data-grid > div { width: 100%; max-width: 300px; }

    /* 后台 */
    .admin-container { flex-direction: column; }
    .admin-sidebar {
        width: 100%;
        padding: 15px;
        display: flex;
        flex-wrap: wrap;
        gap: 8px;
    }
    .admin-sidebar h3 { width: 100%; margin-bottom: 10px; }
    .admin-sidebar a {
        padding: 8px 14px;
        font-size: 13px;
        margin-bottom: 0;
    }
    .admin-content { padding: 20px 15px; }

    /* 后台留言管理 */
    .stat-grid { grid-template-columns: 1fr; }
    .admin-search { flex-direction: column; }
    .admin-search .btn { width: 100%; }
    .table-wrap { overflow-x: auto; }
    .admin-table { min-width: 700px; }
    .msg-content { max-width: 220px; }
    .admin-topbar { flex-direction: column; align-items: flex-start; }

    /* 表单 */
    .form-box { padding: 22px; }
}