/* ============================================================
   证书公示及颁发系统 - 前端样式
   设计方向: 方形、不对称、现代、无紫色
   ============================================================ */

/* --- Reset & Base --- */
*, *::before, *::after { margin:0; padding:0; box-sizing:border-box; }

:root {
    --bg: #F7F8FA;
    --surface: #FFFFFF;
    --primary: #0F172A;
    --accent: #E8751A;
    --accent2: #1A7F7F;
    --text: #1E293B;
    --text-light: #64748B;
    --border: #E2E8F0;
    --shadow: 0 2px 16px rgba(0,0,0,0.06);
    --font: 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', sans-serif;
}

html { font-size:16px; scroll-behavior:smooth; }
body { font-family:var(--font); background:var(--bg); color:var(--text); line-height:1.7; min-height:100vh; display:flex; flex-direction:column; }

a { color:var(--accent2); text-decoration:none; transition:color 0.2s; }
a:hover { color:var(--accent); }

/* --- Navigation --- */
.topnav {
    background:var(--primary);
    padding:0;
    position:sticky; top:0; z-index:100;
    box-shadow:0 2px 20px rgba(0,0,0,0.15);
}
.topnav .nav-inner {
    max-width:1300px; margin:0 auto;
    display:flex; align-items:center; justify-content:space-between;
    padding:0 32px;
}
.nav-logo {
    font-size:1.25rem; font-weight:700; color:#fff; letter-spacing:1px;
    text-transform:uppercase; padding:18px 0; display:flex; align-items:center; gap:10px;
}
.nav-logo .logo-square {
    width:36px; height:36px; background:var(--accent);
    display:inline-block; position:relative;
    transform:rotate(45deg);
}
.nav-logo .logo-square::before {
    content:''; position:absolute;
    width:10px; height:2px; background:#fff;
    top:17px; left:8px; transform:rotate(-45deg);
}
.nav-logo .logo-square::after {
    content:''; position:absolute;
    width:14px; height:2px; background:#fff;
    top:17px; left:11px; transform:rotate(-45deg);
}
.nav-logo span { margin-left:8px; }
.nav-links { display:flex; list-style:none; gap:0; }
.nav-links li a {
    display:block; padding:18px 24px; color:#94A3B8;
    font-size:0.9rem; font-weight:500; text-transform:uppercase; letter-spacing:0.5px;
    position:relative; transition:color 0.25s;
}
.nav-links li a::after {
    content:''; position:absolute; bottom:0; left:24px; right:24px; height:3px;
    background:var(--accent); transform:scaleX(0); transition:transform 0.25s;
}
.nav-links li a:hover { color:#fff; }
.nav-links li a:hover::after,
.nav-links li a.active::after { transform:scaleX(1); }
.nav-links li a.active { color:#fff; }

/* Mobile nav toggle */
.nav-toggle { display:none; background:none; border:none; color:#fff; font-size:1.6rem; cursor:pointer; padding:12px; }

/* --- Hero Section (Asymmetric) --- */
.hero {
    background:var(--primary);
    position:relative; overflow:hidden;
    padding:80px 32px 60px;
}
.hero::before {
    content:''; position:absolute;
    width:500px; height:500px; background:var(--accent);
    opacity:0.08; transform:rotate(45deg);
    top:-200px; right:-100px;
}
.hero::after {
    content:''; position:absolute;
    width:300px; height:300px; background:var(--accent2);
    opacity:0.06; transform:rotate(45deg);
    bottom:-150px; left:5%;
}
.hero-content {
    max-width:1300px; margin:0 auto; position:relative; z-index:2;
    display:grid; grid-template-columns:1.4fr 1fr; gap:60px; align-items:center;
}
.hero-left h1 {
    font-size:2.8rem; font-weight:800; color:#fff; line-height:1.25; margin-bottom:18px;
}
.hero-left h1 mark { background:var(--accent); color:#fff; padding:2px 12px; }
.hero-left p {
    font-size:1.1rem; color:#94A3B8; margin-bottom:32px; max-width:520px;
}
.hero-stats { display:flex; gap:40px; }
.hero-stat { text-align:left; }
.hero-stat .num { font-size:2.4rem; font-weight:800; color:var(--accent); display:block; line-height:1; }
.hero-stat .label { font-size:0.85rem; color:#64748B; text-transform:uppercase; letter-spacing:1px; }

.hero-right {
    display:grid; grid-template-columns:1fr 1fr; gap:16px;
    grid-template-rows: 180px 120px 180px;
}
.hero-card {
    background:rgba(255,255,255,0.05); border:1px solid rgba(255,255,255,0.08);
    padding:28px; display:flex; flex-direction:column; justify-content:center;
    transition:background 0.3s;
}
.hero-card:hover { background:rgba(255,255,255,0.09); }
.hero-card:nth-child(1) { grid-row:1 / 3; }
.hero-card:nth-child(2) { grid-row:1 / 2; }
.hero-card:nth-child(3) { grid-row:2 / 4; }
.hero-card:nth-child(4) { grid-row:3 / 4; }
.hero-card .card-icon {
    width:44px; height:44px;
    margin-bottom:14px; position:relative; flex-shrink:0;
}
/* Icon 1 - 公示/文档 */
.hero-card:nth-child(1) .card-icon {
    background:var(--accent);
}
.hero-card:nth-child(1) .card-icon::before,
.hero-card:nth-child(1) .card-icon::after {
    content:''; position:absolute; display:block;
}
.hero-card:nth-child(1) .card-icon::before {
    width:20px; height:2px; background:#fff;
    top:16px; left:12px; box-shadow:
        0 6px 0 #fff, 0 12px 0 #fff, 14px 3px 0 #fff, 14px 9px 0 #fff, 14px 15px 0 #fff;
}

/* Icon 2 - 二维码/扫码 */
.hero-card:nth-child(2) .card-icon {
    background:var(--accent2);
}
.hero-card:nth-child(2) .card-icon::before,
.hero-card:nth-child(2) .card-icon::after {
    content:''; position:absolute; display:block;
}
.hero-card:nth-child(2) .card-icon::before {
    width:24px; height:24px; border:2px solid #fff;
    top:10px; left:10px;
}
.hero-card:nth-child(2) .card-icon::after {
    width:8px; height:8px; background:#fff;
    top:18px; left:18px;
}

/* Icon 3 - 安全/锁 */
.hero-card:nth-child(3) .card-icon {
    background:var(--accent2);
}
.hero-card:nth-child(3) .card-icon::before,
.hero-card:nth-child(3) .card-icon::after {
    content:''; position:absolute; display:block;
}
.hero-card:nth-child(3) .card-icon::before {
    width:22px; height:16px; background:#fff;
    top:19px; left:11px;
}
.hero-card:nth-child(3) .card-icon::after {
    width:12px; height:12px; border:2px solid var(--accent2); border-bottom:none; border-radius:6px 6px 0 0;
    top:9px; left:16px; background:transparent;
}

/* Icon 4 - 管理/齿轮 */
.hero-card:nth-child(4) .card-icon {
    background:var(--accent);
}
.hero-card:nth-child(4) .card-icon::before,
.hero-card:nth-child(4) .card-icon::after {
    content:''; position:absolute; display:block;
}
.hero-card:nth-child(4) .card-icon::before {
    width:18px; height:18px; border:3px solid #fff;
    top:13px; left:13px;
}
.hero-card:nth-child(4) .card-icon::after {
    width:4px; height:4px; background:#fff;
    top:20px; left:20px; border-radius:1px; box-shadow:
        12px 0 0 #fff, -7px 9px 0 #fff, 5px 9px 0 #fff,
        12px 12px 0 #fff, 0px 12px 0 #fff, -7px -9px 0 #fff,
        5px -9px 0 #fff, 0px -11px 0 #fff;
}
.hero-card h4 { font-size:0.95rem; color:#fff; margin-bottom:6px; }
.hero-card p { font-size:0.8rem; color:#94A3B8; line-height:1.5; }

/* --- Main Wrapper --- */
.main-wrap { flex:1; }

/* --- Sections --- */
.section { padding:64px 32px; }
.section-inner { max-width:1300px; margin:0 auto; }

.section-title {
    display:flex; align-items:baseline; gap:16px; margin-bottom:40px;
}
.section-title .square {
    width:12px; height:36px; background:var(--accent); flex-shrink:0;
}
.section-title h2 { font-size:1.6rem; font-weight:700; letter-spacing:-0.5px; }
.section-title .sub { color:var(--text-light); font-size:0.9rem; }

/* --- Certificate Grid (Asymmetric) --- */
.cert-grid {
    display:grid;
    grid-template-columns:repeat(auto-fill, minmax(280px, 1fr));
    gap:24px;
}
.cert-card {
    background:var(--surface); border:1px solid var(--border);
    overflow:hidden; transition:transform 0.25s, box-shadow 0.25s;
    display:flex; flex-direction:column;
}
.cert-card:hover { transform:translateY(-4px); box-shadow:var(--shadow); }
.cert-card:nth-child(3n+1) .cert-img-wrap { padding-top:70%; }
.cert-card:nth-child(3n+2) .cert-img-wrap { padding-top:85%; }
.cert-card:nth-child(3n) .cert-img-wrap { padding-top:75%; }
.cert-img-wrap {
    position:relative; overflow:hidden; background:#F1F5F9;
    border-bottom:3px solid var(--accent);
}
.cert-img-wrap img {
    position:absolute; top:0; left:0; width:100%; height:100%;
    object-fit:cover; transition:transform 0.4s;
}
.cert-card:hover .cert-img-wrap img { transform:scale(1.05); }
.cert-body { padding:20px; flex:1; display:flex; flex-direction:column; }
.cert-body .cert-no { font-size:0.75rem; color:var(--accent); font-weight:600; text-transform:uppercase; letter-spacing:1.5px; margin-bottom:8px; }
.cert-body h3 { font-size:1.05rem; font-weight:700; margin-bottom:6px; line-height:1.4; }
.cert-body .cert-meta { font-size:0.85rem; color:var(--text-light); margin-bottom:14px; }
.cert-body .cert-btn {
    margin-top:auto; display:inline-block; padding:10px 24px;
    background:var(--primary); color:#fff; font-size:0.85rem; font-weight:600;
    text-align:center; text-transform:uppercase; letter-spacing:0.5px;
    transition:background 0.25s;
}
.cert-body .cert-btn:hover { background:var(--accent); color:#fff; }

/* --- Feature Strip --- */
.feature-strip {
    background:var(--primary); padding:56px 32px;
}
.feature-strip .section-inner {
    display:grid;
    grid-template-columns:repeat(4, 1fr); gap:0;
}
.feature-item {
    padding:32px 28px; text-align:left; border-right:1px solid rgba(255,255,255,0.06);
}
.feature-item:last-child { border-right:none; }
/* --- Feature Strip Icons --- */
.feature-square {
    width:40px; height:40px;
    margin-bottom:18px; position:relative; flex-shrink:0;
}
.feature-item:nth-child(1) .feature-square { background:var(--accent); }
.feature-item:nth-child(2) .feature-square { background:var(--accent2); }
.feature-item:nth-child(3) .feature-square { background:var(--accent); }
.feature-item:nth-child(4) .feature-square { background:var(--accent2); }

/* Feature Icon 1 - 二维码 */
.feature-item:nth-child(1) .feature-square::before,
.feature-item:nth-child(1) .feature-square::after {
    content:''; position:absolute; display:block;
}
.feature-item:nth-child(1) .feature-square::before {
    width:22px; height:22px; border:2px solid #fff;
    top:9px; left:9px;
}
.feature-item:nth-child(1) .feature-square::after {
    width:8px; height:8px; background:#fff;
    top:16px; left:16px;
}

/* Feature Icon 2 - 盾牌/防伪 */
.feature-item:nth-child(2) .feature-square::before,
.feature-item:nth-child(2) .feature-square::after {
    content:''; position:absolute; display:block;
}
.feature-item:nth-child(2) .feature-square::before {
    width:0; height:0;
    border-left:12px solid transparent;
    border-right:12px solid transparent;
    border-bottom:22px solid #fff;
    top:8px; left:8px;
}
.feature-item:nth-child(2) .feature-square::after {
    width:6px; height:6px; background:var(--accent2);
    top:18px; left:17px; border-radius:1px;
}

/* Feature Icon 3 - 眼睛/公开 */
.feature-item:nth-child(3) .feature-square::before,
.feature-item:nth-child(3) .feature-square::after {
    content:''; position:absolute; display:block;
}
.feature-item:nth-child(3) .feature-square::before {
    width:24px; height:14px; border:2px solid #fff;
    border-radius:0 0 12px 12px / 0 0 7px 7px;
    top:13px; left:8px; border-top:none; background:transparent;
}
.feature-item:nth-child(3) .feature-square::after {
    width:10px; height:10px; background:#fff;
    top:16px; left:15px; border-radius:50%;
}

/* Feature Icon 4 - 云/管理 */
.feature-item:nth-child(4) .feature-square::before,
.feature-item:nth-child(4) .feature-square::after {
    content:''; position:absolute; display:block;
}
.feature-item:nth-child(4) .feature-square::before {
    width:20px; height:12px; background:#fff;
    bottom:11px; left:10px;
}
.feature-item:nth-child(4) .feature-square::after {
    width:14px; height:10px; background:#fff;
    bottom:21px; left:13px; border-radius:7px 7px 0 0;
}
.feature-item h4 { font-size:1rem; color:#fff; margin-bottom:8px; }
.feature-item p { font-size:0.85rem; color:#94A3B8; line-height:1.6; }

/* --- Detail Page --- */
.detail-wrap {
    max-width:1000px; margin:0 auto; padding:48px 32px;
    display:grid; grid-template-columns:1fr 1fr; gap:40px;
}
.detail-left { }
.detail-left .cert-preview {
    width:100%; border:1px solid var(--border); background:var(--surface);
    padding:16px; position:relative;
}
.detail-left .cert-preview img { width:100%; display:block; }

/* --- 证书信息覆盖层（叠加在模板图上，按原版排版）--- */
.cert-overlay {
    position:absolute;
    top:16px; left:16px; right:16px; bottom:16px;
    padding:0;
    text-align:center; pointer-events:none;
}
/* 编号 - 顶部居中偏左，荣誉证书标题上方 */
.co-no {
    position:absolute; top:8%;
    left:50%; transform:translateX(-50%);
    font-size:0.82rem; color:#333; letter-spacing:3px; opacity:1;
    white-space:nowrap; font-weight:500;
}
/* 颁发给 - 中上部，带虚线下划线 */
.co-recipient {
    position:absolute; top:28%; left:22%;
    font-size:1.05rem; color:#222; font-weight:600;
    border-bottom:1px dashed #aaa; padding-bottom:4px; min-width:140px;
}
/* 颁发内容 - 居中主体区域 */
.co-content {
    position:absolute; top:38%; left:10%; right:10%;
    font-size:0.92rem; color:#1a1a1a; line-height:2.1;
    text-align:center; word-break:break-word;
}
/* 底部：颁发单位(右下) + 日期(右下角) */
.co-bottom {
    position:absolute; bottom:10%;
    right:14%; text-align:right;
}
.co-issuer {
    font-size:0.76rem; color:#444; margin-bottom:4px;
}
.co-date {
    font-size:0.72rem; color:#555; letter-spacing:2px;
}
.detail-right { }
.detail-right h1 { font-size:2rem; font-weight:800; margin-bottom:24px; line-height:1.3; }
.info-block {
    border-left:4px solid var(--accent); padding:8px 0 8px 20px; margin-bottom:18px;
}
.info-block .info-label { font-size:0.75rem; color:var(--accent); text-transform:uppercase; letter-spacing:1.5px; font-weight:600; margin-bottom:4px; }
.info-block .info-value { font-size:1rem; color:var(--text); font-weight:500; }

.qr-section {
    margin-top:28px; padding:24px; background:var(--surface); border:1px solid var(--border);
}
.qr-section h4 { font-size:0.9rem; margin-bottom:14px; color:var(--text); }
.qr-section img { width:160px; height:160px; display:block; }
.qr-section .qr-hint { font-size:0.8rem; color:var(--text-light); margin-top:10px; }

.back-link {
    display:inline-block; margin-bottom:28px; padding:8px 20px;
    background:var(--primary); color:#fff; font-size:0.85rem; font-weight:600;
    text-transform:uppercase; letter-spacing:0.5px;
}
.back-link:hover { background:var(--accent); color:#fff; }

/* --- Empty State --- */
.empty-state {
    text-align:left; padding:60px 32px; background:var(--surface);
    border:1px solid var(--border);
}
.empty-state h3 { font-size:1.2rem; color:var(--text); margin-bottom:10px; }
.empty-state p { color:var(--text-light); }

/* --- Pagination --- */
.pagination { display:flex; justify-content:center; gap:8px; margin-top:40px; }
.pagination a, .pagination span {
    display:inline-block; width:40px; height:40px; line-height:40px;
    text-align:center; background:var(--surface); border:1px solid var(--border);
    font-size:0.9rem; color:var(--text); font-weight:500;
}
.pagination a:hover { background:var(--primary); color:#fff; border-color:var(--primary); }
.pagination .current { background:var(--accent); color:#fff; border-color:var(--accent); }

/* --- Footer --- */
.site-footer {
    background:var(--primary); color:#94A3B8; padding:0; margin-top:auto;
}
.footer-top {
    max-width:1300px; margin:0 auto; padding:40px 32px;
    display:grid; grid-template-columns:2fr 1fr 1fr; gap:40px;
    border-bottom:1px solid rgba(255,255,255,0.06);
}
.footer-col h4 {
    font-size:0.85rem; color:#fff; text-transform:uppercase; letter-spacing:1.5px; margin-bottom:18px;
    position:relative; padding-bottom:10px;
}
.footer-col h4::after {
    content:''; position:absolute; bottom:0; left:0; width:30px; height:3px; background:var(--accent);
}
.footer-col p { font-size:0.85rem; line-height:1.8; }
.footer-col a { font-size:0.85rem; display:block; padding:5px 0; }
.footer-bottom {
    max-width:1300px; margin:0 auto; padding:20px 32px;
    display:flex; flex-wrap:wrap; justify-content:space-between; align-items:center;
    font-size:0.8rem;
}
.footer-bottom .icp-link { color:var(--accent); font-weight:500; }
.footer-bottom .icp-link:hover { color:#fff; }

/* --- Responsive --- */
@media (max-width:968px) {
    .hero-content { grid-template-columns:1fr; gap:32px; }
    .hero-right { grid-template-columns:1fr 1fr; grid-template-rows:auto; }
    .hero-card:nth-child(1),
    .hero-card:nth-child(2),
    .hero-card:nth-child(3),
    .hero-card:nth-child(4) { grid-row:auto; }
    .feature-strip .section-inner { grid-template-columns:repeat(2, 1fr); }
    .feature-item:nth-child(2) { border-right:none; }
    .detail-wrap { grid-template-columns:1fr; }
    .footer-top { grid-template-columns:1fr; gap:24px; }
    .footer-bottom { flex-direction:column; gap:12px; text-align:center; }
}

@media (max-width:640px) {
    .nav-links { display:none; flex-direction:column; position:absolute; top:100%; left:0; right:0; background:var(--primary); }
    .nav-links.open { display:flex; }
    .nav-toggle { display:block; }
    .hero { padding:48px 20px 40px; }
    .hero-left h1 { font-size:2rem; }
    .hero-right { grid-template-columns:1fr; }
    .hero-stats { gap:20px; }
    .section { padding:40px 20px; }
    .feature-strip .section-inner { grid-template-columns:1fr; }
    .feature-item { border-right:none; border-bottom:1px solid rgba(255,255,255,0.06); }
    .cert-grid { grid-template-columns:1fr; }
    .footer-bottom { flex-direction:column; gap:10px; }
}
