/* 高校在线考试系统 全局样式 */
* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: "Microsoft YaHei", "Segoe UI", Arial, sans-serif;
    font-size: 14px;
    color: #333;
    background: #eef1f6;
    min-height: 100vh;
}

/* 登录页 */
body.login-body, body:has(> .card) {
    background: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 30px 15px;
}

.card {
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, .25);
    padding: 30px 36px;
    width: 380px;
    max-width: 96vw;
}

.card.wide { width: 900px; }

h2 { font-size: 20px; margin-bottom: 18px; color: #444; text-align: center; }

.form-item { margin-bottom: 16px; }

.form-item label { display: block; margin-bottom: 6px; color: #555; font-weight: bold; }

.form-item input, .form-item select, .form-item textarea {
    width: 100%;
    height: 36px;
    padding: 0 10px;
    border: 1px solid #ccc;
    border-radius: 5px;
    outline: none;
    font-size: 14px;
    font-family: inherit;
}

.form-item textarea { height: auto; min-height: 70px; padding: 8px 10px; line-height: 1.6; }

.form-item input:focus, .form-item select:focus, .form-item textarea:focus {
    border-color: #2a5298;
    box-shadow: 0 0 0 3px rgba(42, 82, 152, .15);
}

.btn-primary {
    display: inline-block;
    background: #2a5298;
    color: #fff;
    border: none;
    border-radius: 5px;
    height: 36px;
    padding: 0 22px;
    cursor: pointer;
    font-size: 14px;
    text-decoration: none;
    line-height: 36px;
}

.btn-primary:hover { background: #234784; }

.btn-plain {
    display: inline-block;
    color: #2a5298;
    text-decoration: none;
    line-height: 36px;
    margin-left: 12px;
}

.btn-plain:hover { text-decoration: underline; }

.btn-danger { color: #d9534f; }

.error {
    background: #fdecea;
    color: #c0392b;
    border: 1px solid #f5c6cb;
    border-radius: 5px;
    padding: 8px 12px;
    margin-bottom: 14px;
}

.ok {
    background: #e8f6ec;
    color: #1e7e34;
    border: 1px solid #c3e6cb;
    border-radius: 5px;
    padding: 8px 12px;
    margin-bottom: 14px;
}

.tip { margin-top: 16px; color: #666; text-align: center; }
.tip.dim { color: #aaa; font-size: 12px; }

/* 顶栏 */
.topbar {
    background: #1e3c72;
    color: #fff;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 24px;
    height: 52px;
}

.topbar .brand { font-size: 16px; font-weight: bold; }
.topbar .who a { color: #ffd77a; text-decoration: none; margin-left: 10px; }
.topbar .who a:hover { text-decoration: underline; }

/* 主体容器 */
.container { max-width: 1000px; margin: 24px auto; padding: 0 16px; }

.container h2 { text-align: left; margin-bottom: 16px; }

/* 工作台导航卡片 */
.nav-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 18px;
}

.nav-card {
    background: #fff;
    border-radius: 10px;
    padding: 22px 24px;
    text-decoration: none;
    color: #333;
    box-shadow: 0 2px 10px rgba(0, 0, 0, .06);
    border: 1px solid #e5e9f0;
    transition: box-shadow .2s, transform .2s;
}

.nav-card:hover { box-shadow: 0 6px 20px rgba(0, 0, 0, .12); transform: translateY(-2px); }

.nav-card h3 { color: #1e3c72; margin-bottom: 8px; font-size: 16px; }
.nav-card p { color: #888; line-height: 1.6; font-size: 13px; }

/* 通用工具条 */
.toolbar {
    display: flex;
    gap: 10px;
    margin-bottom: 16px;
    flex-wrap: wrap;
    align-items: center;
}

.toolbar input[type="text"], .toolbar select {
    height: 36px;
    padding: 0 10px;
    border: 1px solid #ccc;
    border-radius: 5px;
    outline: none;
}

.toolbar input[type="text"]:focus, .toolbar select:focus {
    border-color: #2a5298;
    box-shadow: 0 0 0 3px rgba(42, 82, 152, .15);
}

/* 表格 */
table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0, 0, 0, .06);
    margin-bottom: 18px;
}

th, td { border-bottom: 1px solid #ecf0f5; padding: 10px 12px; text-align: left; }

th { background: #f4f6fa; color: #555; font-size: 13px; }

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

tr:hover td { background: #fafbfe; }

td.empty { text-align: center; color: #aaa; }

td a { color: #2a5298; text-decoration: none; margin-right: 10px; }
td a:hover { text-decoration: underline; }

/* 分页 */
.pager { display: flex; align-items: center; gap: 16px; justify-content: center; color: #666; }
.pager a { color: #2a5298; text-decoration: none; }
.pager a:hover { text-decoration: underline; }

/* 答题卡 */
.ans-card { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0; }
.ans-card a {
    width: 34px; height: 34px;
    display: inline-flex; align-items: center; justify-content: center;
    border: 1px solid #ccc; border-radius: 50%;
    color: #333; text-decoration: none; background: #fff;
}
.ans-card a.done { background: #d4edda; border-color: #b7dfba; }
.ans-card a.marked { background: #fff3cd; border-color: #ffe69c; }

/* ===== 管理框架布局：顶部系统名 / 左侧主菜单 / 中间数据 / 底部版权 ===== */
/* 登录/注册页（login-body）保持居中卡片，不参与框架布局 */
body:not(.login-body) { min-height: 100vh; display: flex; flex-direction: column; }

/* 顶部：系统名 */
.app-top {
    height: 56px; flex-shrink: 0;
    background: linear-gradient(90deg, #1e3c72, #2a5298);
    color: #fff; display: flex; justify-content: space-between; align-items: center;
    padding: 0 22px; position: sticky; top: 0; z-index: 100;
    box-shadow: 0 2px 8px rgba(0, 0, 0, .25);
}
.app-top .app-brand { font-size: 17px; font-weight: bold; letter-spacing: 1px; }
.app-top .app-user { font-size: 13px; }
.app-top .app-user a { color: #ffd77a; text-decoration: none; margin-left: 12px; }
.app-top .app-user a:hover { text-decoration: underline; }

/* 中部：左侧菜单 + 右侧内容 */
.app-body { display: flex; flex: 1; min-height: 0; }

.app-side {
    width: 208px; flex-shrink: 0; background: #24344e; padding: 14px 0;
    position: sticky; top: 56px; align-self: flex-start;
    height: calc(100vh - 56px - 44px); overflow-y: auto;
}
.app-side .side-title { font-size: 12px; color: #7f92b5; padding: 10px 20px 6px; letter-spacing: 2px; }
.app-side a {
    display: block; padding: 12px 20px; color: #cfd8e8; text-decoration: none;
    font-size: 14px; border-left: 3px solid transparent;
}
.app-side a:hover { background: rgba(255, 255, 255, .07); color: #fff; }
.app-side a.side-menu-active {
    background: rgba(255, 255, 255, .12); color: #ffd77a;
    border-left-color: #ffd77a; font-weight: bold;
}

/* 内容区（原 .container 类在框架内复用为内容主区，覆盖原居中限制） */
.container { flex: 1; max-width: none; margin: 0; padding: 22px 26px; min-width: 0; }

/* 底部：版权 / 公司 / 联系电话 / 友情链接（两行居中） */
.app-footer {
    flex-shrink: 0; background: #1e3c72; color: #c7d0e0;
    display: flex; flex-direction: column; align-items: center;
    gap: 5px; font-size: 12px; padding: 9px 16px;
}
.app-footer-row { display: flex; justify-content: center; align-items: center; gap: 28px; flex-wrap: wrap; }
.app-footer-links { display: flex; justify-content: center; align-items: center; gap: 5px 14px; flex-wrap: wrap; }
.app-footer-links span { color: #8fa3c4; }
.app-footer-links a { color: #9bd4ff; text-decoration: none; }
.app-footer-links a:hover { color: #fff; text-decoration: underline; }

/* ===== 门户首页（login.html，body.portal-home）===== */
html { scroll-behavior: smooth; }

body.portal-home {
    background: #16294a url("../images/campus-bg.jpg") no-repeat center center fixed;
    background-size: cover;
}

/* 顶部菜单栏（吸顶） */
.p-nav {
    position: sticky;
    top: 0;
    z-index: 120;
    background: rgba(255, 255, 255, .95);
    box-shadow: 0 1px 10px rgba(15, 30, 60, .18);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 18px;
    flex-wrap: wrap;
    padding: 0 22px;
    height: 60px;
    flex-shrink: 0;
}

.p-nav .p-brand { font-size: 19px; font-weight: bold; color: #1e3c72; text-decoration: none; letter-spacing: 1px; white-space: nowrap; }
.p-nav .p-brand:hover { color: #2a5298; }
.p-nav .p-menu { display: flex; align-items: center; gap: 26px; flex-wrap: wrap; }
.p-nav .p-menu .p-register {
    background: #2a5298; color: #fff; padding: 7px 20px; border-radius: 5px;
    border: none; cursor: pointer; font-size: 15px; font-family: inherit; line-height: normal;
}
.p-nav .p-menu .p-register:hover { background: #234784; color: #fff; text-decoration: none; }

/* 主视觉区：系统名大标题，深蓝渐变遮罩保证文字可读；flex:1 自动撑满剩余高度 */
.p-hero {
    background: linear-gradient(180deg, rgba(22, 41, 74, .78) 0%, rgba(22, 41, 74, .45) 55%, rgba(22, 41, 74, .6) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 68px 22px 78px;
    flex: 1 0 auto;
}

.p-hero-inner {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 60px;
    flex-wrap: wrap;
    width: 100%;
    max-width: 1100px;
}

.p-hero-text { flex: 1 1 420px; max-width: 620px; color: #fff; text-align: center; }

.p-hero-text h1 {
    font-size: 44px;
    letter-spacing: 6px;
    margin-bottom: 26px;
    text-shadow: 0 2px 12px rgba(0, 0, 0, .45);
}

.p-hero-text .p-tags { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; }

.p-hero-text .p-tags span {
    background: rgba(255, 255, 255, .14);
    border: 1px solid rgba(255, 255, 255, .38);
    border-radius: 16px;
    padding: 5px 14px;
    font-size: 13px;
}

.p-login-card { width: 400px; max-width: 96vw; margin: 0 auto; }
.p-login-card .btn-primary { width: 100%; }

/* 底部版权（尾） */
.p-footer {
    background: #16294a;
    color: #c7d0e0;
    text-align: center;
    padding: 30px 16px 26px;
    font-size: 13px;
    line-height: 2.1;
    margin-top: auto;
    flex-shrink: 0;
}

.p-footer .p-footer-brand { font-size: 17px; font-weight: bold; color: #fff; letter-spacing: 2px; margin-bottom: 6px; }
.p-footer .p-footer-links a { color: #9bd4ff; text-decoration: none; margin: 0 3px; }
.p-footer .p-footer-links a:hover { color: #fff; text-decoration: underline; }
/* 页脚 APK 下载按钮（inline-block 便于窄屏换行） */
.p-footer .p-footer-apk {
    display: inline-block;
    margin: 4px 0 10px;
    padding: 9px 26px;
    border: 1px solid rgba(56, 189, 248, .65);
    border-radius: 999px;
    font-size: 13.5px;
    font-weight: 600;
    letter-spacing: .03em;
    line-height: 1.6;
    color: #fff;
    background: rgba(56, 189, 248, .18);
    text-decoration: none;
    transition: background .25s, transform .25s, box-shadow .25s;
}
.p-footer .p-footer-apk:hover {
    background: rgba(56, 189, 248, .32);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(56, 189, 248, .25);
}
.p-footer .p-footer-apk svg {
    display: inline-block;
    vertical-align: -3px;
    margin-right: 8px;
}

/* 注册登录弹窗：点击"注册登录"按钮后显示 */
.p-modal { display: none; }
.p-modal.show { display: block; }

.p-modal .p-modal-mask {
    position: fixed; top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(12, 22, 42, .58); z-index: 200;
}

.p-modal .p-modal-card {
    position: fixed; z-index: 201; top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    max-height: 92vh; overflow-y: auto;
    animation: pModalIn .18s ease-out;
}

@keyframes pModalIn {
    from { opacity: 0; transform: translate(-50%, -46%) scale(.96); }
    to { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}

.p-modal .p-modal-close {
    position: absolute; top: 10px; right: 10px;
    width: 30px; height: 30px; padding: 0; border: none; border-radius: 50%;
    background: #eef1f6; color: #1e3c72; font-size: 17px; line-height: 30px;
    cursor: pointer;
}

.p-modal .p-modal-close:hover { background: #1e3c72; color: #fff; }

/* 门户首页响应式 */
@media (max-width: 600px) {
    .p-hero-text h1 { font-size: 32px; letter-spacing: 3px; }
    .p-hero { padding: 44px 16px 54px; }
    .p-hero-inner { gap: 30px; }
    .p-nav { height: auto; padding: 10px 16px; }
    .p-nav .p-menu { gap: 16px; }
}
