/* =========================================================
   AI学业规划师 登记与查询系统 —— 前台样式
   移动端优先，PC 端自适应
   ========================================================= */

:root {
    --brand:        #12457b;
    --brand-dark:   #0b2f57;
    --brand-light:  #2f6fb5;
    --gold:         #c8963e;
    --gold-light:   #f0dfbc;
    --ink:          #16202b;
    --text:         #33404f;
    --muted:        #7c8b9c;
    --line:         #e3e9f0;
    --bg:           #f2f6fa;
    --card:         #ffffff;
    --ok:           #17915c;
    --warn:         #d98114;
    --danger:       #d64545;
    --radius:       14px;
    --radius-sm:    10px;
    --shadow:       0 8px 28px rgba(18, 69, 123, .10);
    --shadow-lg:    0 18px 48px rgba(18, 69, 123, .18);
    --maxw:         1180px;
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    padding: 0;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
                 "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
    color: var(--text);
    background: var(--bg);
    font-size: 15px;
    line-height: 1.7;
    -webkit-font-smoothing: antialiased;
    -webkit-text-size-adjust: 100%;
}

a { color: var(--brand-light); text-decoration: none; }
a:hover { text-decoration: underline; }

img { max-width: 100%; display: block; }

button, input, select, textarea {
    font-family: inherit;
    font-size: 15px;
    color: inherit;
}

.container {
    width: 100%;
    max-width: var(--maxw);
    margin: 0 auto;
    padding: 0 16px;
}

/* ============ 顶部导航 ============ */
.topbar {
    position: sticky;
    top: 0;
    z-index: 50;
    background: rgba(11, 47, 87, .96);
    backdrop-filter: blur(10px);
    color: #fff;
    box-shadow: 0 2px 14px rgba(0, 0, 0, .18);
}
.topbar .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    min-height: 60px;
    flex-wrap: wrap;
}
.brand {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #fff;
    font-weight: 700;
    font-size: 17px;
    letter-spacing: .5px;
}
.brand:hover { text-decoration: none; }
.brand .logo {
    width: 34px;
    height: 34px;
    flex: 0 0 34px;
    border-radius: 9px;
    background: linear-gradient(140deg, var(--gold) 0%, #e9c273 100%);
    color: var(--brand-dark);
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 0;
    box-shadow: 0 3px 10px rgba(200, 150, 62, .45);
}
.brand .logo svg { width: 20px; height: 20px; display: block; }
.brand small {
    display: block;
    font-size: 11px;
    font-weight: 400;
    opacity: .72;
    letter-spacing: 1px;
}

.nav { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.nav a {
    color: rgba(255, 255, 255, .86);
    padding: 7px 13px;
    border-radius: 999px;
    font-size: 14px;
    transition: .2s;
}
.nav a:hover { background: rgba(255, 255, 255, .12); color: #fff; text-decoration: none; }
.nav a.active { background: var(--gold); color: var(--brand-dark); font-weight: 600; }
.nav a.nav-admin { border: 1px solid rgba(255, 255, 255, .35); }

/* ============ Hero ============ */
.hero {
    background:
        radial-gradient(1000px 380px at 18% -10%, rgba(200, 150, 62, .28), transparent 60%),
        linear-gradient(135deg, var(--brand-dark) 0%, var(--brand) 55%, #1a6bb0 100%);
    color: #fff;
    padding: 46px 0 68px;
    position: relative;
    overflow: hidden;
}
.hero::after {
    content: "";
    position: absolute;
    left: 0; right: 0; bottom: -1px;
    height: 44px;
    background: var(--bg);
    clip-path: ellipse(72% 100% at 50% 100%);
}
.hero .container { max-width: 980px; text-align: center; }
.hero h1 {
    margin: 0 0 12px;
    font-size: 30px;
    line-height: 1.35;
    font-weight: 800;
    letter-spacing: 1px;
}
.hero p {
    margin: 0 auto 26px;
    max-width: 680px;
    color: rgba(255, 255, 255, .86);
    font-size: 15px;
}
.hero-badges {
    display: flex;
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap;
}
.hero-badges span {
    background: rgba(255, 255, 255, .14);
    border: 1px solid rgba(255, 255, 255, .22);
    padding: 6px 14px;
    border-radius: 999px;
    font-size: 13px;
}

/* Hero 品牌标识 */
.hero-brand {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: clamp(10px, 1.6vw, 18px);
    margin-bottom: 28px;
}
.hero-brand .icon {
    flex: none;
    width: clamp(48px, 5.6vw, 66px);
    height: clamp(48px, 5.6vw, 66px);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    line-height: 0;
    border-radius: clamp(12px, 1.5vw, 17px);
    background: rgba(255, 255, 255, .14);
    border: 1px solid rgba(255, 255, 255, .26);
}
.hero-brand .icon svg {
    width: clamp(30px, 3.9vw, 46px);
    height: clamp(30px, 3.9vw, 46px);
    flex: none;
}
.hero-brand .txt {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    min-width: 0;
    text-align: left;
}
.hero-brand .txt strong {
    display: block;
    margin: 0;
    padding: 0;
    font-size: clamp(17px, 3vw, 35px);
    line-height: 1.25;
    font-weight: 700;
    letter-spacing: .5px;
    word-break: break-word;
}
.hero-brand .txt span {
    display: block;
    margin: 2px 0 0;
    padding: 0;
    font-size: clamp(11px, 1.45vw, 16px);
    line-height: 1.35;
    letter-spacing: .3px;
    word-break: break-word;
    color: rgba(255, 255, 255, .68);
}

/* 次级页面（报名学习 / 我的报名）页头 */
.hero.hero-sm { padding: 28px 0 54px; }
.hero.hero-sm h1 { font-size: 22px; margin-bottom: 8px; }
.hero.hero-sm p { margin-bottom: 0; font-size: 14px; }

.section-single { padding-bottom: 44px; }

/* ============ 区块卡片 ============ */
.section { padding: 26px 0 8px; }
.section-head { margin-bottom: 18px; }
.section-head h2 {
    margin: 0 0 6px;
    font-size: 21px;
    color: var(--ink);
    display: flex;
    align-items: center;
    gap: 10px;
}
.section-head h2::before {
    content: "";
    width: 5px;
    height: 21px;
    border-radius: 3px;
    background: linear-gradient(180deg, var(--gold), var(--brand-light));
}
.section-head p { margin: 0; color: var(--muted); font-size: 14px; }

.card {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 22px;
    margin-bottom: 24px;
}

/* ============ 表单 ============ */
.form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px 18px;
}
.field { display: flex; flex-direction: column; gap: 7px; min-width: 0; }
.field.full { grid-column: 1 / -1; }
.field > label {
    font-size: 14px;
    color: var(--ink);
    font-weight: 600;
}
.field > label.uploader { font-weight: 400; font-size: 13px; color: var(--muted); }
.field label .req { color: var(--danger); margin-left: 3px; }

.control {
    width: 100%;
    padding: 11px 13px;
    border: 1px solid #d6dfea;
    border-radius: var(--radius-sm);
    background: #fbfcfe;
    transition: .18s;
    outline: none;
}
.control:focus {
    border-color: var(--brand-light);
    background: #fff;
    box-shadow: 0 0 0 3px rgba(47, 111, 181, .16);
}
.control::placeholder { color: #a9b6c4; }
textarea.control { resize: vertical; min-height: 74px; }
select.control { appearance: none; background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%237c8b9c' stroke-width='1.6' fill='none' stroke-linecap='round'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 13px center; padding-right: 34px; }

.radio-row { display: flex; gap: 10px; flex-wrap: wrap; }
.radio-chip {
    flex: 1 1 90px;
    text-align: center;
    padding: 10px 8px;
    border: 1px solid #d6dfea;
    border-radius: var(--radius-sm);
    background: #fbfcfe;
    cursor: pointer;
    font-size: 14px;
    transition: .18s;
    user-select: none;
}
.radio-chip input { display: none; }
.radio-chip:hover { border-color: var(--brand-light); }
.radio-chip.checked {
    border-color: var(--brand);
    background: rgba(18, 69, 123, .07);
    color: var(--brand);
    font-weight: 600;
}

/* 照片上传 */
.uploader {
    display: block;
    border: 1.5px dashed #c3d0de;
    border-radius: var(--radius-sm);
    background: #fbfcfe;
    padding: 14px;
    text-align: center;
    cursor: pointer;
    transition: .18s;
    font-weight: 400;
    font-size: 13px;
    color: var(--muted);
}
.uploader:hover, .uploader.dragover { border-color: var(--brand-light); background: #f3f8ff; }
.uploader .hint { font-size: 13px; color: var(--muted); }
.uploader .hint b { color: var(--brand-light); }
.preview {
    margin-top: 12px;
    display: none;
    align-items: center;
    gap: 12px;
    padding: 10px;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: #fff;
}
.preview.show { display: flex; }
.preview img { width: 76px; height: 100px; object-fit: cover; border-radius: 6px; border: 1px solid var(--line); }
.preview .meta { flex: 1; min-width: 0; font-size: 13px; color: var(--muted); word-break: break-all; }
.preview .meta b { display: block; color: var(--ink); font-size: 14px; }

/* ============ 按钮 ============ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    border: 0;
    border-radius: var(--radius-sm);
    padding: 12px 26px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: .18s;
    white-space: nowrap;
}
.btn-primary {
    background: linear-gradient(135deg, var(--brand) 0%, var(--brand-light) 100%);
    color: #fff;
    box-shadow: 0 6px 18px rgba(18, 69, 123, .28);
}
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 10px 24px rgba(18, 69, 123, .34); }
.btn-primary:active { transform: translateY(0); }
.btn-gold { background: linear-gradient(135deg, var(--gold) 0%, #e2b45f 100%); color: #4a3208; }
.btn-ghost { background: #fff; border: 1px solid #cfdae6; color: var(--brand); }
.btn-ghost:hover { border-color: var(--brand-light); background: #f5f9ff; }
a.btn:hover { text-decoration: none; }
.btn:disabled { opacity: .6; cursor: not-allowed; transform: none; }

.form-actions { margin-top: 20px; display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.form-actions .btn { flex: 0 0 auto; }
.form-note { font-size: 13px; color: var(--muted); }

/* ============ 提示条 ============ */
.alert {
    display: none;
    align-items: flex-start;
    gap: 10px;
    padding: 12px 14px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    margin-top: 16px;
    border: 1px solid transparent;
    word-break: break-all;
}
.alert.show { display: flex; }
.alert-error { background: #fdeeee; border-color: #f5c6c6; color: #a33434; }
.alert-success { background: #e9f8f0; border-color: #b7e6cd; color: #12734a; }
.alert-info { background: #eef4fd; border-color: #c9dcf6; color: #1d4f8c; }

/* ============ 查询结果：证书 ============ */
#queryResult { margin-top: 22px; }

.cert-wrap {
    border-radius: var(--radius);
    background: linear-gradient(180deg, #fffdf7 0%, #ffffff 40%);
    border: 1px solid #e8dcc0;
    box-shadow: var(--shadow-lg);
    padding: 26px 22px 22px;
    position: relative;
    overflow: hidden;
    animation: rise .35s ease both;
}
@keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
.cert-wrap::before {
    content: "";
    position: absolute;
    inset: 8px;
    border: 1px solid rgba(200, 150, 62, .35);
    border-radius: 10px;
    pointer-events: none;
}
.cert-wrap::after {
    content: "";
    position: absolute;
    inset: 13px;
    border: 1px solid rgba(200, 150, 62, .16);
    border-radius: 8px;
    pointer-events: none;
}
.cert-title {
    text-align: center;
    font-size: 23px;
    font-weight: 800;
    color: var(--brand-dark);
    letter-spacing: 3px;
    margin: 6px 0 4px;
}
.cert-sub {
    text-align: center;
    color: var(--gold);
    letter-spacing: 4px;
    font-size: 12px;
    margin-bottom: 18px;
}
.cert-rule { height: 1px; background: linear-gradient(90deg, transparent, rgba(200, 150, 62, .8), transparent); margin: 0 0 18px; }

/* 照片 + 信息 */
.cert-main { display: flex; align-items: flex-start; gap: 24px; position: relative; z-index: 1; }
.cert-photo {
    flex: none;
    width: 108px;
    height: 146px;
    border: 1px solid #dbe3ec;
    border-radius: 6px;
    overflow: hidden;
    background: #f4f7fa;
    cursor: zoom-in;
    box-shadow: 0 2px 8px rgba(18, 69, 123, .07);
}
.cert-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.cert-main .cert-info { flex: 1 1 auto; min-width: 0; }

.cert-info { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 20px; position: relative; z-index: 1; }
.cert-info .item { display: flex; align-items: baseline; gap: 8px; font-size: 15px; min-width: 0; }
.cert-info .item.full { grid-column: 1 / -1; }
.cert-info .k { color: var(--muted); flex: 0 0 auto; font-size: 14px; }
.cert-info .v { color: var(--ink); font-weight: 600; word-break: break-all; }

.cert-seal {
    position: absolute;
    right: 22px;
    bottom: 18px;
    width: 104px;
    height: 104px;
    border-radius: 50%;
    border: 2.5px solid rgba(200, 45, 45, .55);
    color: rgba(190, 40, 40, .7);
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 2px;
    line-height: 1.5;
    transform: rotate(-14deg);
    pointer-events: none;
    padding: 8px;
}
.cert-seal::before {
    content: "";
    position: absolute;
    inset: 6px;
    border: 1px solid rgba(200, 45, 45, .35);
    border-radius: 50%;
}

.cert-archive, .cert-scan { margin-top: 22px; position: relative; z-index: 1; }
.cert-archive h4,
.cert-scan h4 {
    margin: 0 0 10px;
    font-size: 15px;
    color: var(--ink);
    display: flex;
    align-items: center;
    gap: 8px;
}
.cert-archive h4::before,
.cert-scan h4::before { content: ""; width: 4px; height: 15px; background: var(--gold); border-radius: 2px; }
.archive-note {
    background: #fbfaf6;
    border: 1px dashed #e2d6b8;
    border-radius: var(--radius-sm);
    padding: 10px 13px;
    font-size: 14px;
    color: #6d5c36;
    margin-bottom: 12px;
}
/* 证书扫描件：横版缩略图 260 × 185 */
.thumb-grid { display: flex; flex-wrap: wrap; gap: 16px; }
.thumb { width: 260px; max-width: 100%; cursor: zoom-in; }
.thumb .ph {
    width: 100%;
    height: 185px;
    border: 1px solid var(--line);
    border-radius: 8px;
    overflow: hidden;
    background: #eef2f7;
    transition: .18s;
}
.thumb:hover .ph { transform: translateY(-2px); box-shadow: 0 8px 18px rgba(18, 69, 123, .16); }
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.thumb .cap {
    margin-top: 7px;
    font-size: 13px;
    line-height: 1.45;
    color: var(--muted);
    text-align: center;
    word-break: break-all;
}
.empty-tip { color: var(--muted); font-size: 14px; }

.other-certs { margin-top: 18px; position: relative; z-index: 1; }
.other-certs h4 { margin: 0 0 8px; font-size: 15px; color: var(--ink); }
.other-certs ul { margin: 0; padding-left: 18px; color: var(--text); font-size: 14px; }
.other-certs li { margin-bottom: 4px; }

/* ============ 我的报名 ============ */
.mine-login { max-width: 420px; margin: 0 auto; }
.mine-body { display: none; }
.mine-body.show { display: block; }
.profile {
    display: flex;
    gap: 18px;
    align-items: flex-start;
    flex-wrap: wrap;
    padding-bottom: 16px;
    border-bottom: 1px dashed var(--line);
    margin-bottom: 16px;
}
.profile img {
    width: 96px; height: 126px;
    object-fit: cover;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #eef2f7;
}
.profile .info { flex: 1; min-width: 220px; }
.profile .info h3 { margin: 0 0 8px; font-size: 19px; color: var(--ink); }
.kv-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px 18px; font-size: 14px; }
.kv-grid span.k { color: var(--muted); }
.kv-grid span.v { color: var(--ink); font-weight: 600; word-break: break-all; }

.badge {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
    line-height: 1.9;
}
.badge-pending  { background: #fff4e2; color: #b26b06; }
.badge-passed   { background: #e7f7ef; color: #12824f; }
.badge-rejected { background: #fdecec; color: #b83636; }

.mine-certs { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.mine-cert {
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    padding: 14px;
    background: #fbfcfe;
}
.mine-cert h5 { margin: 0 0 8px; font-size: 16px; color: var(--brand-dark); }
.mine-cert .line { font-size: 13.5px; color: var(--muted); }
.mine-cert .line b { color: var(--ink); font-weight: 600; }
.mine-cert-cover { margin-bottom: 10px; border-radius: 8px; overflow: hidden; border: 1px solid var(--line); cursor: zoom-in; }
.mine-cert-cover img { width: 100%; height: 150px; object-fit: cover; }
.mine-certs-title { margin: 0 0 12px; font-size: 16px; color: var(--ink); }

/* ============ 图片预览层 ============ */
.lightbox {
    position: fixed;
    inset: 0;
    background: rgba(8, 18, 30, .9);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 200;
    padding: 20px;
}
.lightbox.show { display: flex; }
.lightbox img { max-width: 96%; max-height: 92%; border-radius: 8px; background: #fff; }
.lightbox .close {
    position: absolute;
    top: 18px; right: 22px;
    width: 40px; height: 40px;
    border-radius: 50%;
    border: 0;
    background: rgba(255, 255, 255, .16);
    color: #fff;
    font-size: 22px;
    cursor: pointer;
    line-height: 1;
}
.lightbox .close:hover { background: rgba(255, 255, 255, .3); }

/* ============ 页脚 ============ */
.footer {
    margin-top: 30px;
    background: var(--brand-dark);
    color: rgba(255, 255, 255, .7);
    padding: 26px 0;
    font-size: 13px;
    text-align: center;
}
.footer p { margin: 4px 0; }

/* ============ PC 端 ============ */
@media (min-width: 820px) {
    body { font-size: 15px; }
    .hero { padding: 66px 0 88px; }
    .hero h1 { font-size: 40px; }
    .hero p { font-size: 16px; }
    .card { padding: 30px 34px; }
    .cert-wrap { padding: 34px 40px 30px; }
    .cert-title { font-size: 28px; }
    .cert-info .item:last-child:nth-child(odd) { grid-column: 1 / -1; }
}

/* ============ 移动端 ============ */
@media (max-width: 819px) {
    .topbar .container { padding-top: 8px; padding-bottom: 8px; }
    .brand { font-size: 15px; }
    .brand small { display: none; }
    .nav { width: 100%; justify-content: flex-start; overflow-x: auto; }
    .nav::-webkit-scrollbar { display: none; }
    .nav a { padding: 6px 11px; font-size: 13px; }

    .hero { padding: 34px 0 56px; }
    .hero h1 { font-size: 24px; letter-spacing: .5px; }
    .hero p { font-size: 14px; margin-bottom: 18px; }

    /* 尺寸由 clamp() 自适应，这里只调间距 */
    .hero-brand { margin-bottom: 20px; }
    .hero-brand .txt strong { letter-spacing: .3px; }

    .hero.hero-sm { padding: 22px 0 46px; }
    .hero.hero-sm h1 { font-size: 20px; }

    .card { padding: 18px 16px; border-radius: 12px; }
    .section-head h2 { font-size: 19px; }

    .form-grid { grid-template-columns: 1fr; gap: 14px; }
    .form-actions .btn { flex: 1 1 100%; }

    .cert-wrap { padding: 22px 16px 20px; }
    .cert-main { gap: 13px; }
    .cert-photo { width: 80px; height: 108px; }
    .cert-info { grid-template-columns: 1fr; gap: 10px; }
    .cert-title { font-size: 20px; letter-spacing: 2px; }
    .cert-seal { width: 74px; height: 74px; font-size: 10px; right: 12px; bottom: 12px; opacity: .8; }
    .thumb-grid { gap: 12px; }
    .thumb { width: 100%; }
    .thumb .ph { height: auto; aspect-ratio: 260 / 185; }

    .kv-grid { grid-template-columns: 1fr; }
    .profile { justify-content: center; text-align: left; }
}
