/* ================= 资源信息平台 样式 ================= */
* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
    --brand: #2563eb;
    --green: #10b981;
    --purple: #7c5cf0;
    --orange: #e08a1e;
    --gray: #9ca3af;
    --ink: #1f2d3d;
    --muted: #8a94a6;
    --line: #e3e8ef;
    --bg: #f3f5f9;
    --radius: 14px;
    --shadow: 0 2px 12px rgba(31, 45, 61, 0.06);
}

html, body { height: 100%; }
body {
    font-family: 'Microsoft YaHei', 'Segoe UI', system-ui, sans-serif;
    background: var(--bg);
    color: var(--ink);
    font-size: 14px;
    line-height: 1.6;
}

.rp-wrap { width: 92%; max-width: 1240px; margin: 20px auto 36px; }

.rp-card {
    background: #fff;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 26px 30px;
    margin-bottom: 20px;
}

/* ---------- 顶部语言切换 ---------- */
.rp-topbar { display: flex; }
[dir="rtl"] .rp-topbar { justify-content: flex-start; }
[dir="ltr"] .rp-topbar { justify-content: flex-start; }

/* ---------- 卡片标题 ---------- */
.rp-card-title {
    font-size: 22px;
    font-weight: 700;
    margin-bottom: 18px;
    display: flex;
    align-items: center;
    gap: 8px;
}
.rp-title-ico { font-size: 22px; }
.rp-lang-hint { color: var(--muted); font-size: 13px; margin: -8px 0 14px; }
.rp-lang-hint b { color: var(--purple); }

/* ---------- 表单 ---------- */
.rp-form { display: grid; grid-template-columns: repeat(6, 1fr); gap: 16px 18px; }
.rp-filter { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px 18px; }

.rp-field { display: flex; flex-direction: column; gap: 7px; min-width: 0; }
.rp-field-wide { grid-column: span 1; }
.rp-form .rp-field { grid-column: span 1; }
.rp-form .rp-field-wide { grid-column: span 1; }

.rp-label { font-size: 14px; color: var(--ink); font-weight: 500; }

select, input[type="text"], input[type="password"] {
    width: 100%;
    height: 44px;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 0 14px;
    font-size: 14px;
    font-family: inherit;
    color: var(--ink);
    background: #fff;
    outline: none;
    transition: border-color .2s, box-shadow .2s;
}
select:focus, input:focus {
    border-color: var(--brand);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}
select:disabled, input:disabled {
    background: #f5f7fa;
    color: var(--muted);
    cursor: not-allowed;
}
select { appearance: none; -webkit-appearance: none; cursor: pointer;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%238a94a6' stroke-width='2.5'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    padding-right: 34px;
}
[dir="rtl"] select {
    background-position: left 14px center;
    padding-right: 14px;
    padding-left: 34px;
}

.rp-form-actions { grid-column: 1 / -1; }
.rp-filter-actions { display: flex; align-items: center; gap: 12px; margin: 18px 0 16px; flex-wrap: wrap; }
.rp-count { color: var(--muted); font-size: 13px; }

/* ---------- 按钮 ---------- */
.rp-btn {
    border: none;
    border-radius: 8px;
    height: 42px;
    padding: 0 22px;
    font-size: 14px;
    font-family: inherit;
    font-weight: 600;
    color: #fff;
    cursor: pointer;
    transition: filter .2s, transform .15s, opacity .2s;
    white-space: nowrap;
}
.rp-btn:hover { filter: brightness(1.08); }
.rp-btn:active { transform: translateY(1px); }
.rp-btn-blue   { background: var(--brand); }
.rp-btn-green  { background: var(--green); }
.rp-btn-gray   { background: var(--gray); }
.rp-btn-purple { background: var(--purple); }
.rp-btn-orange { background: var(--orange); }
.rp-btn .fa, .rp-btn i { margin-right: 6px; }

/* ---------- 表格 ---------- */
.rp-table-box { border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.rp-table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.rp-table th, .rp-table td {
    padding: 12px 14px;
    text-align: left;
    border-bottom: 1px solid #eef1f5;
    vertical-align: middle;
}
[dir="rtl"] .rp-table th, [dir="rtl"] .rp-table td { text-align: right; }
.rp-table thead th { background: #f8fafc; font-weight: 600; white-space: nowrap; }
.rp-table tbody tr:hover { background: #f9fbff; }
.rp-table tbody tr:last-child td { border-bottom: none; }
.rp-table td { color: #33415c; }
.rp-table .cell-sub { color: var(--muted); font-size: 12px; display: block; margin-top: 2px; }
.rp-other-badge {
    display: inline-block;
    font-size: 10px;
    line-height: 1;
    padding: 2px 5px;
    border-radius: 4px;
    background: #eef1f6;
    color: var(--muted);
    margin-inline-end: 5px;
    vertical-align: middle;
}

.rp-op-btn {
    border: none;
    background: none;
    cursor: pointer;
    font-size: 13px;
    font-family: inherit;
    padding: 2px 6px;
}
.rp-op-edit { color: var(--brand); }
.rp-op-del { color: #e5484d; }
.rp-op-btn + .rp-op-btn { margin-inline-start: 4px; }

.rp-empty {
    display: none;
    text-align: center;
    color: var(--muted);
    padding: 26px 0;
    font-size: 14px;
}
.rp-empty.show { display: block; }
.rp-table.hide { display: none; }

/* ---------- 底部操作条 ---------- */
.rp-footer-bar { display: flex; justify-content: center; gap: 16px; }

/* ---------- 弹层 ---------- */
.rp-modal { position: fixed; inset: 0; z-index: 1000; display: flex; align-items: center; justify-content: center; padding: 20px; }
.rp-modal[hidden] { display: none; }
.rp-mask { position: absolute; inset: 0; background: rgba(20, 30, 45, 0.45); }
.rp-modal-box {
    position: relative;
    background: #fff;
    border-radius: 14px;
    padding: 26px 28px;
    width: 720px;
    max-width: 100%;
    max-height: 88vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(20, 30, 45, 0.25);
}
.rp-modal-sm { width: 380px; }
.rp-modal-title { font-size: 18px; margin-bottom: 18px; }
.rp-modal-sm input { margin-bottom: 18px; }
.rp-modal-box .rp-form { grid-template-columns: repeat(2, 1fr); }
.rp-modal-actions { grid-column: 1 / -1; display: flex; justify-content: flex-end; gap: 12px; margin-top: 4px; }
[dir="rtl"] .rp-modal-actions { justify-content: flex-start; }

/* 柯语（RTL）时输入内容右对齐，方便阿拉伯字母输入 */
[dir="rtl"] input, [dir="rtl"] select { text-align: right; }

/* ---------- 提示 toast ---------- */
.rp-toast {
    position: fixed;
    top: 24px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(31, 45, 61, 0.92);
    color: #fff;
    padding: 10px 22px;
    border-radius: 8px;
    font-size: 14px;
    z-index: 2000;
    opacity: 0;
    transition: opacity .25s, transform .25s;
    pointer-events: none;
}
.rp-toast.show { opacity: 1; transform: translateX(-50%) translateY(6px); }
[dir="rtl"] .rp-toast { font-size: 14.5px; }

/* ================= 响应式 ================= */
@media (max-width: 1024px) {
    .rp-form { grid-template-columns: repeat(3, 1fr); }
    .rp-filter { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 720px) {
    .rp-card { padding: 20px 16px; }
    .rp-form, .rp-filter { grid-template-columns: 1fr 1fr; }
    .rp-table-box { overflow-x: auto; }
    .rp-table { min-width: 860px; }
    .rp-footer-bar { flex-direction: column; }
    .rp-footer-bar .rp-btn { width: 100%; }
    .rp-modal-box .rp-form { grid-template-columns: 1fr; }
}
@media (max-width: 460px) {
    .rp-form, .rp-filter { grid-template-columns: 1fr; }
}
