/* ============ 通用 ============ */
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
body {
    margin: 0;
    font-family: -apple-system, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
    color: #333;
    background: #f0f2f5;
    font-size: 15px;
    line-height: 1.6;
}
a { color: #2f6fed; text-decoration: none; }
h1, h2, h3 { margin: 0; font-weight: 600; }

.btn {
    display: inline-block;
    padding: 8px 16px;
    border: 1px solid #d0d5dd;
    border-radius: 8px;
    background: #fff;
    color: #333;
    font-size: 14px;
    cursor: pointer;
    line-height: 1.4;
    text-align: center;
}
.btn:hover { opacity: .88; }
.btn-primary { background: #2f6fed; border-color: #2f6fed; color: #fff; }
.btn-danger { background: #d9534f; border-color: #d9534f; color: #fff; }
.btn-ghost { background: #fff; border-color: #d0d5dd; color: #555; }
.btn-big {
    width: 100%;
    padding: 15px;
    font-size: 18px;
    font-weight: 600;
    border-radius: 12px;
    background: linear-gradient(135deg, #2f6fed, #4a8af0);
    border: none;
    color: #fff;
    box-shadow: 0 4px 12px rgba(47, 111, 237, .3);
}
.btn-mini { padding: 4px 10px; font-size: 13px; border-radius: 6px; }
.btn-block { width: 100%; }

.alert { padding: 10px 14px; border-radius: 8px; font-size: 14px; margin-bottom: 14px; }
.alert-ok { background: #e8f5e9; color: #1b5e20; }
.alert-err { background: #fdecea; color: #b71c1c; }

.fld { margin-bottom: 14px; }
.fld label { display: block; font-size: 14px; color: #555; margin-bottom: 6px; font-weight: 600; }
.fld input[type=text], .fld input[type=password], .fld select, .fld textarea, .login-box input[type=text], .login-box input[type=password] {
    width: 100%;
    padding: 11px 12px;
    border: 1px solid #d0d5dd;
    border-radius: 8px;
    font-size: 16px;
    font-family: inherit;
    background: #fff;
    color: #333;
    outline: none;
}
.fld textarea { resize: vertical; }
.fld input:focus, .fld select:focus, .fld textarea:focus { border-color: #2f6fed; }
.fld input[disabled] { background: #f5f6f8; color: #999; }
.fld-hint { font-size: 13px; color: #888; margin: 4px 0 10px; }
.opt-tag { font-size: 12px; color: #999; font-weight: 400; }

.badge { display: inline-block; padding: 2px 10px; border-radius: 20px; font-size: 12px; }
.badge-open { background: #e8f5e9; color: #1b5e20; }
.badge-closed { background: #eee; color: #777; }
.badge-admin { background: #e3f2fd; color: #1565c0; }
.badge-leader { background: #fff3e0; color: #e65100; }
.badge-bad { background: #fdecea; color: #c62828; }

/* ============ 移动端问卷页 ============ */
.survey-wrap { max-width: 720px; margin: 0 auto; padding: 14px 14px 40px; }

.s-header { background: linear-gradient(160deg, #2f6fed, #5a9cf5); color: #fff; border-radius: 14px; padding: 20px 18px; margin-bottom: 14px; }
.s-header .s-org { font-size: 13px; opacity: .85; margin-bottom: 6px; }
.s-header h1 { font-size: 21px; line-height: 1.4; margin-bottom: 8px; }
.s-tip { font-size: 14px; margin: 0; color: #666; }
.s-header .s-tip { color: rgba(255,255,255,.92); }
.s-tip.small { font-size: 13px; color: #999; }

.s-card { background: #fff; border-radius: 14px; padding: 16px 16px 8px; margin-bottom: 14px; box-shadow: 0 1px 6px rgba(0,0,0,.05); }
.s-sec { font-size: 17px; margin-bottom: 12px; padding-bottom: 10px; border-bottom: 2px solid #2f6fed; }

.q { margin-bottom: 18px; }
.qt { font-size: 16px; font-weight: 600; margin-bottom: 10px; line-height: 1.5; }
.qno {
    display: inline-block; min-width: 24px; height: 24px; line-height: 24px;
    background: #2f6fed; color: #fff; border-radius: 6px;
    text-align: center; font-size: 13px; margin-right: 6px; padding: 0 5px;
}
.opts { overflow: hidden; }
.opt {
    display: inline-block;
    width: 31.5%;
    margin: 0 1% 8px 0;
    vertical-align: top;
    cursor: pointer;
}
.opt input { position: absolute; opacity: 0; width: 0; height: 0; }
.opt span {
    display: block;
    padding: 10px 4px;
    text-align: center;
    border: 1.5px solid #d8dce3;
    border-radius: 10px;
    font-size: 14px;
    color: #555;
    background: #fafbfc;
    line-height: 1.3;
}
.opt input:checked + span {
    border-color: #2f6fed;
    background: #eaf1fe;
    color: #2f6fed;
    font-weight: 600;
}
.opt.score-5 input:checked + span { border-color: #27ae60; background: #e8f5e9; color: #1b5e20; }
.opt.score-4 input:checked + span { border-color: #8bc34a; background: #f1f8e9; color: #33691e; }
.opt.score-3 input:checked + span { border-color: #f0ad4e; background: #fff8e1; color: #e65100; }
.opt.score-2 input:checked + span { border-color: #f39c12; background: #fff3e0; color: #e65100; }
.opt.score-1 input:checked + span { border-color: #d9534f; background: #fdecea; color: #b71c1c; }
.opt.score-0 input:checked + span { border-color: #9e9e9e; background: #f5f5f5; color: #616161; }

.qc { margin-top: 8px; }
.qc textarea, .s-card textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1.5px solid #d9534f;
    border-radius: 8px;
    font-size: 15px;
    font-family: inherit;
    background: #fffdfd;
    outline: none;
    resize: vertical;
}

.opt-row { overflow: hidden; }
.opt-l {
    display: inline-block;
    width: 48.5%;
    margin: 0 1% 8px 0;
    cursor: pointer;
    vertical-align: top;
}
.opt-l input { position: absolute; opacity: 0; width: 0; height: 0; }
.opt-l span {
    display: block;
    padding: 10px 4px;
    text-align: center;
    border: 1.5px solid #d8dce3;
    border-radius: 10px;
    font-size: 14px;
    color: #555;
    background: #fafbfc;
}
.opt-l input:checked + span { border-color: #2f6fed; background: #eaf1fe; color: #2f6fed; font-weight: 600; }

.s-submit { margin-top: 18px; }

/* ============ 登录页 ============ */
.login-body { display: block; padding: 60px 16px; background: #eef1f6; }
.login-box { max-width: 400px; margin: 0 auto; background: #fff; border-radius: 14px; padding: 32px 28px; box-shadow: 0 2px 14px rgba(0,0,0,.08); }
.login-box h1 { font-size: 22px; text-align: center; }
.login-sub { text-align: center; color: #999; font-size: 13px; margin: 4px 0 22px; }

/* ============ 后台 ============ */
.topnav { background: #1f2a3d; color: #fff; }
.nav-inner { max-width: 1180px; margin: 0 auto; padding: 0 16px; display: flex; align-items: center; }
.nav-inner .brand { font-weight: 700; font-size: 16px; padding: 14px 20px 14px 0; }
.nav-inner a { color: #c9d4e5; padding: 14px 14px; font-size: 14px; }
.nav-inner a.on, .nav-inner a:hover { color: #fff; background: rgba(255,255,255,.08); }
.nav-user { margin-left: auto; font-size: 13px; color: #9fb0c7; }
.nav-user a { padding: 0 0 0 12px; font-size: 13px; }

.admin-wrap { max-width: 1180px; margin: 0 auto; padding: 18px 16px 60px; }

.card { background: #fff; border-radius: 12px; padding: 18px 20px; margin-bottom: 16px; box-shadow: 0 1px 5px rgba(0,0,0,.05); }
.card-title { font-size: 16px; margin-bottom: 14px; }

.form-grid { display: flex; gap: 16px; flex-wrap: wrap; }
.form-grid .fld { flex: 1; min-width: 220px; }

.table-wrap { overflow-x: auto; }
.tbl { width: 100%; border-collapse: collapse; font-size: 14px; }
.tbl th, .tbl td { border: 1px solid #e6e9ef; padding: 8px 10px; text-align: left; vertical-align: middle; }
.tbl th { background: #f5f7fa; font-weight: 600; white-space: nowrap; }
.tbl tr:hover td { background: #fafbfd; }
.tbl-num td { text-align: center; }
.tbl-num .td-title { text-align: left; }
.td-title { min-width: 180px; }
.td-ops { white-space: nowrap; }
.td-ops .btn { margin-right: 4px; }

.stat-cards { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.stat { flex: 1; min-width: 150px; background: #fff; border-radius: 12px; padding: 16px 18px; text-align: center; box-shadow: 0 1px 5px rgba(0,0,0,.05); }
.stat-num { font-size: 28px; font-weight: 700; color: #2f6fed; }
.stat-label { font-size: 13px; color: #888; margin-top: 4px; }

.survey-head { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 12px; }
.survey-ops .btn { margin: 0 4px 6px 0; }

.opinion { border: 1px solid #e6e9ef; border-radius: 10px; padding: 12px 14px; margin-bottom: 10px; }
.opinion-meta { font-size: 13px; color: #888; margin-bottom: 8px; }
.opinion-item { font-size: 14px; margin-bottom: 4px; }

/* 二维码弹窗 */
.modal { position: fixed; inset: 0; background: rgba(0,0,0,.5); display: flex; align-items: center; justify-content: center; z-index: 99; }
.modal-box { background: #fff; border-radius: 14px; width: 320px; max-width: 92vw; padding: 0; overflow: hidden; }
.modal-head { display: flex; justify-content: space-between; align-items: center; padding: 14px 16px; border-bottom: 1px solid #eee; font-size: 15px; }
.modal-close { color: #999; font-size: 16px; }
.modal-body { padding: 18px 16px; }

@media (max-width: 480px) {
    .opt { width: 48.5%; }
}
