/* ============================================================
   OID 跳转管理系统 —— 样式（前台卡片 + 后台表格）
   ============================================================ */
:root {
    --bg: #f4f5f7;
    --card: #ffffff;
    --line: #e5e7eb;
    --line-2: #eef0f3;
    --text: #1f2328;
    --muted: #6b7280;
    --teal: #00b5ad;
    --teal-d: #009e97;
    --blue: #3b82f6;
    --blue-d: #2f6fe0;
    --green: #22c55e;
    --green-d: #16a34a;
    --orange: #f59e0b;
    --orange-d: #d97706;
    --red: #ef4444;
    --red-d: #dc2626;
    --radius: 10px;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    padding: 0;
    background: var(--bg);
    color: var(--text);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
                 "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
    font-size: 14px;
    -webkit-font-smoothing: antialiased;
}

a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }
code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12.5px; }
.muted { color: var(--muted); }

/* ---------------- 前台：访问码 ---------------- */
.page-public {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 24px;
    background: linear-gradient(180deg, #f7f8fa 0%, #eef0f4 100%);
}

.wrap { width: 100%; max-width: 420px; }

.card {
    background: var(--card);
    border-radius: 16px;
    box-shadow: 0 10px 30px rgba(17, 24, 39, .08);
    padding: 34px 28px 26px;
    text-align: center;
}

.card-icon { font-size: 34px; line-height: 1; margin-bottom: 10px; }
.card-title { margin: 0 0 8px; font-size: 20px; font-weight: 600; }
.card-sub { margin: 0 0 20px; color: var(--muted); font-size: 13px; line-height: 1.7; }
.card-foot { margin: 16px 0 0; color: #9aa1ab; font-size: 12px; }

.input-code {
    width: 100%;
    height: 46px;
    padding: 0 14px;
    border: 1px solid var(--line);
    border-radius: 10px;
    font-size: 16px;
    letter-spacing: .5px;
    outline: none;
    background: #fbfbfc;
    transition: border-color .15s, box-shadow .15s;
    text-align: center;
}
.input-code:focus {
    border-color: var(--teal);
    background: #fff;
    box-shadow: 0 0 0 3px rgba(0, 181, 173, .12);
}

/* ---------------- 按钮 ---------------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    height: 34px;
    padding: 0 14px;
    border: 1px solid transparent;
    border-radius: 6px;
    background: #eef0f3;
    color: #374151;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    white-space: nowrap;
    transition: background .15s, border-color .15s, color .15s, box-shadow .15s;
}
.btn:hover { text-decoration: none; filter: brightness(.97); }
.btn-block { width: 100%; height: 44px; margin-top: 12px; font-size: 15px; border-radius: 10px; }
.btn-primary { background: var(--teal); color: #fff; }
.btn-primary:hover { background: var(--teal-d); color: #fff; }
.btn-teal { background: var(--teal); color: #fff; }
.btn-blue { background: var(--blue); color: #fff; }
.btn-green { background: var(--green); color: #fff; }
.btn-orange { background: var(--orange); color: #fff; }
.btn-red { background: var(--red); color: #fff; }
.btn-ghost { background: #fff; border-color: var(--line); color: #4b5563; }
.btn-mini { height: 26px; padding: 0 9px; font-size: 12px; border-radius: 5px; background: #f1f3f5; color: #4b5563; }
.btn-mini.btn-blue { background: var(--blue); color: #fff; }
.btn-mini.btn-red { background: var(--red); color: #fff; }
.btn.disabled, .btn[disabled] { opacity: .5; pointer-events: none; }

/* ---------------- 提示条 ---------------- */
.alert {
    padding: 10px 14px;
    border-radius: 8px;
    font-size: 13px;
    line-height: 1.7;
    margin: 0 0 14px;
    text-align: left;
}
.alert-error { background: #fef2f2; border: 1px solid #fecaca; color: #b91c1c; }
.alert-ok    { background: #ecfdf5; border: 1px solid #bbf7d0; color: #047857; }
.alert-warn  { background: #fffbeb; border: 1px solid #fde68a; color: #92400e; }
.card .alert { margin-bottom: 16px; }

/* ---------------- 中转页 ---------------- */
.page-check { display: flex; align-items: center; justify-content: center; min-height: 100vh; padding: 24px; }
.check-wrap { width: 100%; max-width: 460px; }
.check-card {
    background: #fff; border-radius: 16px; box-shadow: 0 12px 34px rgba(17, 24, 39, .09);
    padding: 36px 30px; text-align: center;
}
.check-spinner { display: flex; justify-content: center; gap: 6px; margin-bottom: 18px; }
.check-spinner span {
    width: 9px; height: 9px; border-radius: 50%; background: var(--teal);
    animation: bounce 1s infinite ease-in-out;
}
.check-spinner span:nth-child(2) { animation-delay: .15s; }
.check-spinner span:nth-child(3) { animation-delay: .3s; }
@keyframes bounce { 0%, 80%, 100% { transform: scale(.6); opacity: .5; } 40% { transform: scale(1); opacity: 1; } }
.check-title { margin: 0 0 8px; font-size: 18px; font-weight: 600; }
.check-sub { margin: 0 0 18px; color: var(--muted); font-size: 13px; }
.check-bar { height: 6px; background: #eef0f3; border-radius: 999px; overflow: hidden; margin-bottom: 22px; }
.check-bar i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, #34d399, var(--teal)); transition: width .9s linear; }
.check-tip { margin: 14px 0 0; color: #9aa1ab; font-size: 12px; }

/* ---------------- 后台布局 ---------------- */
.admin { max-width: 1280px; margin: 0 auto; padding: 18px 20px 40px; }
.admin-narrow { max-width: 820px; }

.topbar {
    display: flex; align-items: center; justify-content: space-between;
    gap: 12px; padding: 12px 4px 16px;
}
.topbar-left { display: flex; align-items: baseline; gap: 12px; }
.logo { font-size: 17px; font-weight: 600; }
.topbar-right { display: flex; align-items: center; gap: 8px; }

/* ---------------- 工具栏 ---------------- */
.toolbar {
    display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
    background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
    padding: 10px 12px; margin-bottom: 12px;
}
.toolbar-spacer { flex: 1 1 auto; }
.input-search {
    height: 34px; min-width: 250px; padding: 0 12px;
    border: 1px solid var(--line); border-radius: 6px; outline: none; font-size: 13px; background: #fff;
}
.input-search:focus { border-color: var(--teal); box-shadow: 0 0 0 3px rgba(0, 181, 173, .1); }

/* ---------------- 表格 ---------------- */
.table-wrap {
    background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
    overflow: auto;
}
.grid { width: 100%; border-collapse: collapse; font-size: 13px; }
.grid thead th {
    background: #fafbfc; color: #4b5563; font-weight: 600; text-align: left;
    padding: 11px 12px; border-bottom: 1px solid var(--line); white-space: nowrap;
}
.grid tbody td { padding: 11px 12px; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
.grid tbody tr:hover { background: #fafcfd; }
.grid tbody tr:last-child td { border-bottom: none; }
.grid .empty { text-align: center; color: var(--muted); padding: 36px 12px; }

.col-check { width: 38px; }
.col-id { width: 62px; color: var(--muted); }
.col-oid { width: 110px; }
.col-short { width: 260px; }
.col-hits { width: 80px; text-align: right; }
.col-time { width: 160px; color: var(--muted); font-size: 12.5px; }
.col-status { width: 78px; }
.col-ops { width: 132px; white-space: nowrap; }
.col-target { max-width: 320px; }
.col-target a { display: inline-block; max-width: 320px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; vertical-align: bottom; }

.cell-title { font-weight: 500; }
.cell-note { color: var(--muted); font-size: 12px; margin-top: 2px; }
.link-short { display: inline-block; max-width: 200px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; vertical-align: middle; }

.badge {
    display: inline-block; padding: 2px 8px; border-radius: 4px; font-size: 12px; line-height: 1.6;
}
.badge-ok { background: #e7f8ef; color: #15803d; }
.badge-off { background: #fee2e2; color: #b91c1c; }

.inline { display: inline-block; margin: 0; }

/* ---------------- 分页 ---------------- */
.pager {
    display: flex; align-items: center; justify-content: space-between;
    gap: 12px; flex-wrap: wrap; padding: 12px 2px 0;
}
.pager-info { color: var(--muted); font-size: 12.5px; }
.per-page { margin-left: 10px; }
.per-page select { height: 28px; border: 1px solid var(--line); border-radius: 5px; background: #fff; }
.pager-links { display: flex; gap: 4px; }
.page-btn {
    display: inline-flex; align-items: center; justify-content: center;
    min-width: 30px; height: 30px; padding: 0 8px;
    border: 1px solid var(--line); border-radius: 5px; background: #fff; color: #4b5563; font-size: 13px;
}
.page-btn:hover { border-color: var(--teal); color: var(--teal); text-decoration: none; }
.page-btn.active { background: var(--teal); border-color: var(--teal); color: #fff; }
.page-btn.disabled { opacity: .4; pointer-events: none; }

/* ---------------- 表单页 ---------------- */
.form-card {
    background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
    padding: 20px 20px 18px;
}
.form-row { margin-bottom: 16px; }
.form-row label { display: block; font-weight: 500; margin-bottom: 6px; }
.form-row .req { color: var(--red); }
.form-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0 14px; }
.input-text {
    width: 100%; height: 38px; padding: 0 12px;
    border: 1px solid var(--line); border-radius: 7px; font-size: 13.5px; outline: none; background: #fff;
}
textarea.input-text { height: auto; padding: 10px 12px; }
.input-text:focus { border-color: var(--teal); box-shadow: 0 0 0 3px rgba(0, 181, 173, .1); }
.hint { margin: 6px 0 0; color: var(--muted); font-size: 12px; line-height: 1.7; }
.hint code { background: #f3f4f6; padding: 1px 5px; border-radius: 4px; }
.checkline { display: flex; align-items: center; gap: 8px; margin: 4px 0 18px; color: #374151; }
.form-actions { display: flex; gap: 10px; }
.adv { border-top: 1px dashed var(--line); padding-top: 12px; margin-bottom: 16px; }
.adv summary { cursor: pointer; color: var(--muted); font-size: 12.5px; user-select: none; }
.adv[open] summary { margin-bottom: 12px; }

.meta-card {
    margin-top: 14px; background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
    padding: 14px 16px; display: grid; gap: 8px; font-size: 13px;
}
.meta-card .muted { display: inline-block; min-width: 72px; }

/* ---------------- 响应式 ---------------- */
@media (max-width: 900px) {
    .form-grid { grid-template-columns: 1fr; }
    .col-target { max-width: 180px; }
    .col-target a { max-width: 180px; }
    .input-search { min-width: 160px; }
}
@media (max-width: 640px) {
    .admin { padding: 12px 10px 28px; }
    .toolbar { gap: 6px; }
    .btn { height: 32px; padding: 0 10px; font-size: 12.5px; }
    .col-time, .col-oid { display: none; }
    .col-short { width: auto; }
}
