/* ==========================================================================
   PasteBin Clone — 补充样式（Win7 / 7.css）
   ========================================================================== */

:root {
    --pb-accent: #2a6fb8;
    --pb-accent-2: #1b4f8a;
    --pb-code-bg: #1b1d23;
    --pb-code-fg: #e8e8ea;
    --pb-gutter-bg: #26292f;
    --pb-gutter-fg: #6f7684;
    --pb-mono: Consolas, "Cascadia Mono", "DejaVu Sans Mono", "Courier New", monospace;
    --pb-ui: "Segoe UI", "Microsoft YaHei", "PingFang SC", "Hiragino Sans GB", sans-serif;
    --w7-font: 13px var(--pb-ui);
}

html { box-sizing: border-box; overflow-x: clip; }
*, *::before, *::after { box-sizing: inherit; }

body {
    margin: 0;
    padding: 22px 18px 36px;
    min-height: 100vh;
    font: 13px/1.55 var(--pb-ui);
    color: #17191c;
    background-color: #dbe7f4;
    background-image: linear-gradient(160deg, #eaf3fc 0%, #d7e7f8 42%, #c9dcef 100%);
    background-attachment: fixed;
}

a { color: var(--pb-accent); }

/* ---------- 外壳与窗口 ---------- */
.pb-shell {
    max-width: 1060px;
    margin: 0 auto;
}
.pb-shell-wide { max-width: 1240px; }

.pb-window {
    width: 100%;
    margin-bottom: 14px;
}
.pb-window.is-max { max-width: none; }

.pb-body-top {
    padding-bottom: 0;
    margin-bottom: 0;
    background: linear-gradient(#f4f8fc, #e8f0f8);
    border-bottom: 1px solid #c4d2e0;
}
.pb-body-main {
    padding: 14px;
}

/* 顶部导航 */
.pb-nav {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 5px;
    padding: 4px 2px 6px;
}
.pb-nav-gap { flex: 1 1 auto; }
.pb-navbtn {
    display: inline-flex;
    align-items: center;
    min-height: 23px;
    padding: 0 12px;
    font: 12px var(--pb-ui);
    text-decoration: none;
    border: 1px solid transparent;
    border-radius: 3px;
}
.pb-navbtn:hover {
    background: linear-gradient(#fdfefe, #e8f2fb 45%, #d5e8f8);
    border-color: #a9c8e2;
    box-shadow: inset 0 0 0 1px #fff;
}
.pb-navbtn.is-active {
    background: linear-gradient(#cfe2f5, #bcd6ef);
    border-color: #8fb4d6;
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, .12);
    font-weight: 600;
    color: #14385e;
}

/* 提示条 */
.pb-announce {
    margin-bottom: 12px;
    padding: 8px 12px;
    background: #fffbe6;
    border: 1px solid #e6d38a;
    border-radius: 3px;
    color: #6b5200;
    font-size: 12.5px;
}
.pb-alert {
    margin-bottom: 12px;
    padding: 8px 12px;
    border-radius: 3px;
    font-size: 12.5px;
    border: 1px solid;
}
.pb-alert-ok { background: #eaf7ee; border-color: #a8d8b9; color: #1d5b34; }
.pb-alert-err { background: #fdeeee; border-color: #e8b0b0; color: #8a2020; }
.pb-alert-warn { background: #fff8e4; border-color: #e8d193; color: #74570a; }

/* ---------- 通用排版 ---------- */
.pb-title {
    margin: 0 0 4px;
    font-size: 15px;
    font-weight: 700;
    color: #17334f;
}
.pb-sub {
    margin: 0 0 12px;
    font-size: 12px;
    color: #61707f;
}
.pb-muted { color: #6b7784; }
.pb-mono { font-family: var(--pb-mono); }
.pb-right { text-align: right; }
.pb-center { text-align: center; }
.pb-nowrap { white-space: nowrap; }
.pb-mt { margin-top: 12px; }
.pb-mb { margin-bottom: 12px; }

/* ---------- 表单 ---------- */
.pb-form { display: block; }
.pb-row {
    display: grid;
    grid-template-columns: 110px 1fr;
    gap: 8px 12px;
    align-items: center;
    margin-bottom: 9px;
}
.pb-row > label { font-size: 12.5px; color: #2c3d4f; text-align: right; }
.pb-row > .pb-cell { min-width: 0; }
.pb-row-top { align-items: start; }
.pb-row-top > label { padding-top: 5px; }
.pb-grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

.pb-input, select.pb-input, textarea.pb-input, input[type="text"].pb-input,
input[type="password"].pb-input, input[type="email"].pb-input, input[type="number"].pb-input {
    width: 100%;
    min-height: 23px;
    padding: 3px 6px;
    font: 12.5px/1.45 var(--pb-ui);
    background: #fff;
    border: 1px solid #7a8b9c;
    border-radius: 2px;
    box-shadow: inset 1px 1px 1px rgba(0, 0, 0, .08);
}
.pb-input:focus { outline: none; border-color: #3a7fc1; box-shadow: inset 0 0 0 1px #9cc8ea; }

/* ---------- 单选 / 复选 ----------
   7.css 的套路是「隐藏原生控件 + 在紧邻的 label 上画圈」，要求 <input><label>
   是兄弟节点；本项目 markup 是 <label><input>文字</label>，圈画不出来、原生控件
   又被藏了 → 页面上只剩文字。这里对 label 内嵌的控件自绘 Win7 风格。 */
.pb-body-main input[type="radio"],
.pb-body-main input[type="checkbox"] {
    appearance: none;
    -webkit-appearance: none;
    position: static;
    opacity: 1;
    flex: 0 0 auto;
    width: 13px;
    height: 13px;
    margin: 0 6px 0 0;
    background-color: #f6f6f6;
    background-repeat: no-repeat;
    background-position: center;
    background-size: 9px 9px;
    border: 1px solid #7f8b98;
    border-radius: 2px;
    box-shadow: inset 0 0 0 1px #fff, inset 1px 1px 2px rgba(0, 0, 0, .15);
    vertical-align: -2px;
    cursor: pointer;
}
.pb-body-main input[type="radio"] { border-radius: 50%; }
.pb-body-main input[type="checkbox"]:checked {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 10'%3E%3Cpath d='M1.5 5.5l2.4 2.6L8.6 2' fill='none' stroke='%232a6fb8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}
.pb-body-main input[type="radio"]:checked {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 10'%3E%3Ccircle cx='5' cy='5' r='2.7' fill='%232a6fb8'/%3E%3C/svg%3E");
}
.pb-body-main input[type="radio"]:disabled,
.pb-body-main input[type="checkbox"]:disabled { opacity: .5; cursor: not-allowed; }
.pb-body-main input[type="radio"]:focus-visible,
.pb-body-main input[type="checkbox"]:focus-visible { outline: 1px dotted #000; outline-offset: 2px; }

/* ---------- 下拉框 ----------
   7.css 的 select 用「多层背景」画箭头，部分浏览器会丢掉 no-repeat，把箭头
   平铺成一排黑三角。这里整体接管：单层背景 + 自绘箭头（优先级压过 7.css
   的基础态与 hover/active 态）。 */
select.pb-input:not([multiple]), .pb-body-main select:not([multiple]) {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-color: #fff;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%23556474'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 7px center;
    background-size: 10px 6px;
    padding-right: 24px;
}
select.pb-input:not([multiple]):hover, .pb-body-main select:not([multiple]):hover,
select.pb-input:not([multiple]):active, .pb-body-main select:not([multiple]):active {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%232a6fb8'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 7px center;
    background-size: 10px 6px;
    background-color: #f4f9fd;
    border-color: #3a7fc1;
}

textarea.pb-editor {
    width: 100%;
    min-height: 330px;
    padding: 10px 12px;
    font: 13px/20px var(--pb-mono);
    white-space: pre;
    overflow: auto;
    resize: vertical;
    background: #fdfefe;
    border: 1px solid #7a8b9c;
    border-radius: 2px;
    box-shadow: inset 1px 1px 2px rgba(0, 0, 0, .08);
}
.pb-hint { font-size: 11.5px; color: #6f7c89; margin-top: 3px; }

.pb-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin-top: 14px;
    padding-top: 12px;
    border-top: 1px solid #dbe3ec;
}

fieldset.pb-group {
    margin: 0 0 12px;
    padding: 10px 12px 12px;
    border: 1px solid #c3d0dd;
    border-radius: 3px;
    background: linear-gradient(#fcfdff, #f4f8fc);
    /* 7.css 把 fieldset 设为 flex 容器：不加 min-width:0 会被长内容撑破 */
    min-width: 0;
    max-width: 100%;
}
fieldset.pb-group > legend {
    padding: 0 6px;
    font-size: 12px;
    font-weight: 700;
    color: #2a4a6b;
}

/* 选项行（单选/复选） */
.pb-checks { display: flex; flex-wrap: wrap; gap: 6px 18px; align-items: center; }

/* ---------- 粘贴查看 ---------- */
.pb-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 18px;
    align-items: center;
    margin-bottom: 10px;
    font-size: 12px;
    color: #4c5b6a;
}
.pb-meta b { color: #1d3247; }
.pb-badge {
    display: inline-block;
    padding: 1px 7px;
    font-size: 11px;
    border-radius: 9px;
    border: 1px solid;
    line-height: 16px;
}
.pb-badge-pub { background: #e8f5ec; border-color: #a8d8b9; color: #1d5b34; }
.pb-badge-unl { background: #eef2f7; border-color: #b8c6d4; color: #3d4d5e; }
.pb-badge-pri { background: #fdeeee; border-color: #e8b0b0; color: #8a2020; }
.pb-badge-adm { background: #eae6fb; border-color: #b3a8e8; color: #3c2f80; }

/* 代码区 */
.pb-code {
    max-width: 100%;
    border: 1px solid #0d0f13;
    border-radius: 4px;
    overflow: hidden;
    background: var(--pb-code-bg);
    box-shadow: 0 1px 3px rgba(0, 0, 0, .25);
}
.pb-code-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    padding: 6px 8px;
    background: linear-gradient(#3c4048, #2b2f36);
    border-bottom: 1px solid #0d0f13;
    color: #cfd4dc;
    font-size: 12px;
}
.pb-code-toolbar .pb-spacer { flex: 1 1 auto; }
.pb-code-toolbar .pb-tbtn {
    min-width: 0;
    min-height: 21px;
    padding: 0 10px;
    font: 11.5px var(--pb-ui);
    color: #e8eaee;
    border: 1px solid #565b66;
    border-radius: 3px;
    background: linear-gradient(#4d525c, #3b3f48);
    cursor: pointer;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
}
.pb-code-toolbar .pb-tbtn:hover { background: linear-gradient(#5b6170, #474c56); }
.pb-code-toolbar .pb-tbtn:before, .pb-code-toolbar .pb-tbtn:after { display: none; }
.pb-lang-tag { color: #9aa3b0; font-size: 11.5px; }

.pb-code-scroll {
    display: flex;
    max-width: 100%;
    max-height: 68vh;
    overflow: auto;
    background: var(--pb-code-bg);
}
.pb-lines {
    flex: 0 0 auto;
    position: sticky;
    left: 0;
    z-index: 2;
    padding: 10px 8px 10px 12px;
    background: var(--pb-gutter-bg);
    color: var(--pb-gutter-fg);
    text-align: right;
    user-select: none;
    font: 13px/20px var(--pb-mono);
    white-space: pre;
    border-right: 1px solid #101319;
}
/* 7.css 的 `.window-body pre { margin: -16px }` 特异性(0,1,1)高于 `.pb-pre`(0,1,0)，
   会把代码块向四周拉出 16px（顶住工具栏、戳出容器）——必须用更高特异性压掉 */
.window-body pre.pb-pre { margin: 0; }
.pb-pre {
    margin: 0;
    padding: 10px 14px 10px 12px;
    flex: 1 1 auto;
    min-width: 0;
    font: 13px/20px var(--pb-mono);
    color: var(--pb-code-fg);
    white-space: pre;
    tab-size: 4;
    background: var(--pb-code-bg);
}
.pb-pre code, .pb-pre code.hljs {
    display: block;
    padding: 0;
    margin: 0;
    background: none;
    overflow: visible;
    font: inherit;
    white-space: pre;
}
/* 无行号类代码块（API 示例等）：手机上直接折行，免横向滚动 */
.pb-pre-plain, .pb-pre-plain code {
    white-space: pre-wrap;
    word-break: break-word;
}
/* 行内 code（长 URL 等）允许断行，避免撑破段落 */
.pb-body-main code { overflow-wrap: anywhere; }

/* ---------- 归档列表 ---------- */
.pb-list { display: flex; flex-direction: column; gap: 7px; }
.pb-item {
    display: flex;
    align-items: baseline;
    gap: 10px;
    padding: 7px 10px;
    border: 1px solid #d3dde7;
    border-radius: 3px;
    background: linear-gradient(#fdfeff, #f3f8fc);
    text-decoration: none;
    color: inherit;
}
.pb-item:hover { border-color: #9fc0dd; background: linear-gradient(#fdfeff, #e8f2fb); }
.pb-item-key {
    font-family: var(--pb-mono);
    font-size: 12.5px;
    font-weight: 700;
    color: var(--pb-accent-2);
    flex: 0 0 auto;
}
.pb-item-title {
    flex: 1 1 auto;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 12.5px;
}
.pb-item-info { flex: 0 0 auto; font-size: 11.5px; color: #7b8794; }

/* ---------- 表格（后台） ---------- */
.pb-table-wrap { overflow: auto; max-width: 100%; border: 1px solid #c3d0dd; border-radius: 3px; background: #fff; max-height: 62vh; }
table.pb-table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
table.pb-table th {
    position: sticky;
    top: 0;
    z-index: 1;
    padding: 6px 8px;
    text-align: left;
    font-weight: 600;
    color: #23384e;
    background: linear-gradient(#fbfdff, #e9f0f7);
    border-bottom: 1px solid #b9c8d6;
    white-space: nowrap;
}
table.pb-table td { padding: 6px 8px; border-bottom: 1px solid #e6ecf2; vertical-align: top; }
table.pb-table tbody tr:nth-child(even) td { background: #fafcfe; }
table.pb-table tbody tr:hover td { background: #eef6fd; }
.pb-table .pb-td-key { font-family: var(--pb-mono); font-weight: 700; color: var(--pb-accent-2); }
.pb-table .pb-td-nowrap { white-space: nowrap; }

/* ---------- 统计卡片 ---------- */
.pb-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(148px, 1fr)); gap: 10px; margin-bottom: 14px; }
.pb-stat {
    padding: 11px 14px;
    border: 1px solid #bfcddb;
    border-radius: 4px;
    background: linear-gradient(#ffffff, #eef4fa);
    box-shadow: inset 0 1px 0 #fff;
}
.pb-stat b { display: block; font-size: 21px; line-height: 1.25; color: var(--pb-accent-2); }
.pb-stat span { font-size: 11.5px; color: #5d6d7d; }

/* ---------- 分页 ---------- */
.pb-pager { display: flex; gap: 5px; align-items: center; justify-content: center; margin-top: 14px; flex-wrap: wrap; }
.pb-pager a, .pb-pager span {
    min-width: 24px;
    padding: 2px 8px;
    text-align: center;
    font-size: 12px;
    border: 1px solid #c3d0dd;
    border-radius: 3px;
    background: linear-gradient(#fff, #f0f5fa);
    text-decoration: none;
    color: #2a4a6b;
}
.pb-pager .is-cur { background: linear-gradient(#cfe2f5, #bcd6ef); border-color: #8fb4d6; font-weight: 700; }

/* ---------- 空状态 ---------- */
.pb-empty {
    padding: 30px 16px;
    text-align: center;
    color: #7b8794;
    font-size: 12.5px;
    border: 1px dashed #c3d0dd;
    border-radius: 4px;
    background: #fbfdff;
}
.pb-empty-icon { font-size: 22px; opacity: .45; margin-bottom: 6px; }

/* ---------- 弹窗 ---------- */
.pb-dialog-mask {
    position: fixed;
    inset: 0;
    z-index: 99;
    background: rgba(10, 24, 40, .28);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}
.pb-dialog-mask[hidden] { display: none; }
.pb-dialog { width: 100%; max-width: 460px; }
/* 7.css 默认把 .window[role=dialog] 设为 opacity:0 / visibility:hidden（它只靠
   :target 开窗），会把我们的弹窗藏掉 —— 显隐由 .pb-dialog-mask 控制，这里覆盖回来 */
.pb-dialog-mask .window[role="dialog"] {
    position: relative;
    left: auto;
    top: auto;
    transform: none;
    opacity: 1;
    visibility: visible;
    transition: none;
    z-index: 1;
    animation: pb-dialog-in .16s ease-out;
}
@keyframes pb-dialog-in {
    from { opacity: 0; transform: translateY(-10px) scale(.985); }
    to   { opacity: 1; transform: none; }
}
.pb-dialog-text { margin: 0 0 16px; font-size: 12.5px; line-height: 1.6; word-break: break-word; }
.pb-dialog-codewrap { margin: 0 0 14px; }
.pb-dialog-code {
    margin: 0;
    padding: 8px 10px;
    max-height: 40vh;
    overflow: auto;
    font: 12px/1.55 var(--pb-mono);
    color: var(--pb-code-fg);
    background: var(--pb-code-bg);
    border: 1px solid #0d0f13;
    border-radius: 3px;
    white-space: pre-wrap;
    word-break: break-all;
}
.pb-dialog-actions { justify-content: flex-end; }

/* ---------- 状态栏 ---------- */
.pb-status-right { flex: 1 1 auto; text-align: right; }

.pb-copyright {
    text-align: center;
    font-size: 11.5px;
    color: #6b7c8d;
    padding: 2px 6px 0;
}

/* ---------- 登陆页 ---------- */
.pb-auth { max-width: 400px; margin: 0 auto; }
.pb-auth .pb-row { grid-template-columns: 80px 1fr; }

/* ---------- 富文本预览 ---------- */
.pb-markdown { line-height: 1.7; font-size: 13px; }
.pb-markdown h1, .pb-markdown h2, .pb-markdown h3 { color: #17334f; margin: 14px 0 6px; }
.pb-markdown code { font-family: var(--pb-mono); background: #eef2f6; padding: 1px 4px; border-radius: 3px; }
.pb-markdown pre { background: var(--pb-code-bg); color: var(--pb-code-fg); padding: 10px 12px; border-radius: 4px; overflow: auto; }

/* ---------- 响应式 ---------- */
@media (max-width: 720px) {
    body { padding: 10px 8px 24px; }
    .pb-row { grid-template-columns: 1fr; gap: 4px; }
    .pb-row > label { text-align: left; }
    .pb-grid2 { grid-template-columns: 1fr; }
    .pb-body-main { padding: 10px; }
    .pb-code-scroll { max-height: 60vh; -webkit-overflow-scrolling: touch; }
    .pb-item-info { display: none; }
    .pb-stat b { font-size: 18px; }
    /* 代码区字号收紧，尽量少横滚 */
    .pb-pre, .pb-lines { font: 12px/18px var(--pb-mono); }
    .pb-pre { padding: 8px 10px 8px 10px; }
    .pb-lines { padding: 8px 6px 8px 10px; }
    /* 表格参数名列窄一点也够用 */
    table.pb-table { font-size: 12px; }
}

/* 打印：只留代码 */
@media print {
    body { background: #fff; padding: 0; }
    .pb-nav, .pb-body-top, .status-bar, .pb-copyright, .pb-code-toolbar, .pb-actions { display: none !important; }
    .pb-code-scroll { max-height: none; overflow: visible; }
    .pb-code { border-color: #999; box-shadow: none; }
}
