/* 数智工具箱 — 全局样式表
 *
 * 传统管理后台风格：白底、直角、1px 实线边框、紧凑排版。
 * 不使用渐变、阴影、圆角、过渡或动画。所有页面共用本文件。
 */

/* ------------------------------------------------------------------ 基础 */

* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    padding: 0;
}

body {
    background: #f0f0f0;
    color: #000;
    font-family: "Segoe UI", "Microsoft YaHei", "PingFang SC", "Hiragino Sans GB",
        "Source Han Sans SC", "Helvetica Neue", Arial, sans-serif;
    font-size: 13px;
    line-height: 1.5;
}

a {
    color: #0000cc;
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

a:visited {
    color: #551a8b;
}

h1,
h2,
h3,
h4 {
    margin: 0 0 6px 0;
    font-weight: bold;
}

h1 {
    font-size: 17px;
}

h2 {
    font-size: 15px;
}

h3 {
    font-size: 14px;
}

p {
    margin: 0 0 6px 0;
}

hr {
    border: 0;
    border-top: 1px solid #ccc;
    margin: 10px 0;
}

code,
pre {
    font-family: Consolas, "Courier New", monospace;
    font-size: 12px;
}

/* ------------------------------------------------------------------ 布局 */

.page {
    max-width: 1180px;
    margin: 0 auto;
    background: #fff;
    border-left: 1px solid #999;
    border-right: 1px solid #999;
    border-bottom: 1px solid #999;
}

.header {
    background: #d8d8d8;
    border-bottom: 1px solid #999;
    padding: 6px 10px;
    overflow: hidden;
}

.header .sysname {
    font-size: 15px;
    font-weight: bold;
    float: left;
}

.header .identity {
    float: right;
    color: #333;
}

.header .identity form {
    display: inline;
    margin-left: 8px;
}

.nav {
    background: #e8e8e8;
    border-bottom: 1px solid #999;
    padding: 0 6px;
}

.nav ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.nav li {
    display: inline-block;
}

.nav li a {
    display: inline-block;
    padding: 4px 12px;
    border-right: 1px solid #ccc;
    color: #0000cc;
}

.nav li.active a {
    background: #fff;
    font-weight: bold;
    color: #000;
}

.statusbar {
    border-bottom: 1px solid #ccc;
    background: #f7f7f7;
    padding: 4px 10px;
    color: #333;
}

.content {
    padding: 10px;
}

.footer {
    border-top: 1px solid #ccc;
    background: #f7f7f7;
    padding: 6px 10px;
    color: #555;
    font-size: 12px;
}

/* -------------------------------------------------------------- 消息提示 */

.msg {
    border: 1px solid #999;
    padding: 5px 8px;
    margin-bottom: 8px;
    background: #f7f7f7;
}

.msg-error {
    border-color: #cc0000;
    background: #ffecec;
    color: #990000;
}

.msg-warning {
    border-color: #cc9900;
    background: #fff8e0;
    color: #805500;
}

.msg-success {
    border-color: #009900;
    background: #eaffea;
    color: #006600;
}

.msg-info {
    border-color: #6699cc;
    background: #eef4fb;
    color: #224466;
}

.msg ul {
    margin: 4px 0 0 0;
    padding-left: 20px;
}

/* ------------------------------------------------------------------ 表单 */

fieldset {
    border: 1px solid #999;
    margin: 0 0 10px 0;
    padding: 6px 10px 10px 10px;
}

legend {
    font-weight: bold;
    padding: 0 4px;
}

.form-row {
    margin-bottom: 6px;
}

.form-row label {
    display: inline-block;
    min-width: 96px;
    vertical-align: middle;
}

label.inline {
    display: inline;
    min-width: 0;
    margin-right: 12px;
}

input[type="text"],
input[type="password"],
input[type="number"],
input[type="date"],
input[type="file"],
select,
textarea {
    border: 1px solid #7f9db9;
    background: #fff;
    color: #000;
    font-family: inherit;
    font-size: 13px;
    padding: 2px 4px;
    vertical-align: middle;
}

input[type="text"],
input[type="password"],
input[type="date"] {
    min-width: 200px;
}

input[type="number"] {
    min-width: 84px;
}

select {
    min-width: 200px;
}

textarea {
    width: 100%;
    min-height: 70px;
}

input[type="checkbox"] {
    vertical-align: middle;
    margin: 0 3px 0 0;
}

button,
input[type="submit"] {
    border: 1px solid #999;
    background: #e6e6e6;
    color: #000;
    font-family: inherit;
    font-size: 13px;
    padding: 3px 12px;
    cursor: pointer;
}

button:hover,
input[type="submit"]:hover {
    background: #dcdcdc;
}

button:disabled,
input[type="submit"]:disabled {
    background: #f0f0f0;
    color: #888;
    cursor: default;
}

button.primary,
input[type="submit"].primary {
    font-weight: bold;
    border-color: #666;
    background: #dcdcdc;
}

.hint {
    color: #555;
    font-size: 12px;
    margin: 2px 0 6px 0;
}

.actions {
    margin: 8px 0;
}

.actions form {
    display: inline-block;
    margin-right: 6px;
}

/* ------------------------------------------------------------------ 表格 */

table.grid {
    border-collapse: collapse;
    width: 100%;
    margin-bottom: 8px;
}

table.grid th,
table.grid td {
    border: 1px solid #999;
    padding: 3px 6px;
    text-align: left;
    vertical-align: top;
    word-break: break-word;
}

table.grid th {
    background: #e8e8e8;
    font-weight: bold;
    white-space: nowrap;
}

table.grid tr:nth-child(even) td {
    background: #fafafa;
}

table.grid td.num,
table.grid th.num {
    text-align: right;
    white-space: nowrap;
}

table.grid td.center,
table.grid th.center {
    text-align: center;
}

table.grid input[type="text"],
table.grid input[type="number"] {
    min-width: 0;
    width: 100%;
}

table.grid td.rank {
    text-align: right;
    white-space: nowrap;
}

/* 奖品名次区间列的固定宽度 */
table.grid th.col-rank {
    width: 110px;
}

/* 只读值行：用于原先的 st.metric 指标 */
table.counters {
    border-collapse: collapse;
    margin-bottom: 8px;
}

table.counters th,
table.counters td {
    border: 1px solid #999;
    padding: 3px 10px;
    text-align: center;
}

table.counters th {
    background: #e8e8e8;
    font-weight: bold;
    white-space: nowrap;
}

table.counters td {
    font-weight: bold;
    font-size: 14px;
}

/* 名册/预览用窄表 */
table.grid.narrow {
    width: auto;
    min-width: 420px;
}

/* ------------------------------------------------------------- 折叠区块 */

details {
    border: 1px solid #ccc;
    background: #fafafa;
    padding: 4px 8px;
    margin-bottom: 8px;
}

details > summary {
    cursor: pointer;
    font-weight: bold;
}

details > *:not(summary) {
    margin-top: 6px;
}

/* ------------------------------------------------------------------ 其他 */

.downloads {
    border: 1px solid #999;
    padding: 6px 10px;
    margin-bottom: 10px;
    background: #fcfcfc;
}

.downloads ul {
    margin: 0;
    padding-left: 18px;
}

.downloads li {
    margin-bottom: 3px;
}

.downloads .desc {
    color: #555;
    font-size: 12px;
}

.mono {
    font-family: Consolas, "Courier New", monospace;
}

.nowrap {
    white-space: nowrap;
}

.login-box {
    max-width: 360px;
    margin: 60px auto;
    border: 1px solid #999;
    background: #fff;
}

.login-box .title {
    background: #d8d8d8;
    border-bottom: 1px solid #999;
    padding: 6px 10px;
    font-weight: bold;
}

.login-box .body {
    padding: 12px;
}

.qr {
    border: 1px solid #999;
    padding: 6px;
    background: #fff;
    display: inline-block;
}

.qr img {
    display: block;
    width: 200px;
    height: 200px;
}

/* -------------------------------------------------------------- 加载遮罩 */

/* 全屏半透明遮罩，内容居中；只在数据抓取页存在该元素。 */
#loading-overlay {
    position: fixed;
    left: 0;
    top: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.78);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
}

#loading-overlay[hidden] {
    display: none;
}

.loading-box {
    border: 1px solid #999;
    background: #fff;
    padding: 16px 32px;
    text-align: center;
}

.loading-text {
    font-size: 14px;
    font-weight: bold;
    margin-bottom: 10px;
}

.loading-spinner {
    display: block;
    margin: 0 auto;
    animation: loading-rotate 0.9s linear infinite;
}

@keyframes loading-rotate {
    to {
        transform: rotate(360deg);
    }
}

.invitation-review { display: grid; grid-template-columns: minmax(180px, 28%) minmax(0, 1fr); gap: 22px; margin: 20px 0; }
.review-queue { max-height: 720px; overflow-y: auto; border: 1px solid #ddd; }
.review-person { display: block; padding: 12px; border-bottom: 1px solid #ddd; text-decoration: none; }
.review-person.selected { background: #e9f2ff; border-left: 3px solid #3169a8; }
.review-detail article { border-bottom: 1px solid #ddd; padding-bottom: 16px; margin-bottom: 16px; }
.review-text { white-space: pre-wrap; overflow-wrap: anywhere; }
.review-images { display: flex; gap: 12px; flex-wrap: wrap; margin: 12px 0; }
.review-images img { max-width: 100%; width: 260px; height: 240px; object-fit: contain; background: #f4f4f4; }
@media (max-width: 700px) { .invitation-review { grid-template-columns: 1fr; } .review-queue { max-height: 220px; } }
