/*
 * Rain 主题更新服务 - 全局样式（安装向导 / 登录页 / 管理面板共用）
 * 由 system/lib.php us_head() 引入
 */

/* ---------- 全局模板样式：简约现代，与 Rain 主题调性一致 ---------- */
* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif; background: #f4f6fa; color: #2b3445; min-height: 100vh; }
.wrap { max-width: 760px; margin: 0 auto; padding: 36px 16px 60px; }
/* 顶部品牌条 */
.topbar { display: flex; align-items: center; gap: 10px; max-width: 760px; margin: 0 auto; padding: 20px 16px 0; }
.topbar .logo { width: 34px; height: 34px; border-radius: 9px; background: linear-gradient(135deg, #2f7ef7, #6ea8ff); color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 17px; }
.topbar .name { font-size: 16px; font-weight: 700; }
.topbar .sub { font-size: 12px; color: #8a94a6; margin-left: auto; }
/* 卡片 */
.card { background: #fff; border: 1px solid #e5e9f2; border-radius: 14px; padding: 24px; margin-bottom: 20px; box-shadow: 0 2px 10px rgba(30,50,90,.05); }
.card h2 { font-size: 16px; margin-bottom: 16px; padding-bottom: 12px; border-bottom: 1px solid #eef1f7; }
.card .desc { font-size: 13px; color: #7a8699; margin-bottom: 14px; }
/* 表单 */
label { display: block; font-size: 13px; font-weight: 600; margin: 14px 0 6px; }
.req::after { content: " *"; color: #e05656; }
input[type=text], input[type=password], input[type=number], textarea, select { width: 100%; padding: 10px 12px; border: 1px solid #d9dfeb; border-radius: 10px; font-size: 14px; font-family: inherit; background: #fff; }
textarea { min-height: 110px; resize: vertical; }
input:focus, textarea:focus { outline: none; border-color: #2f7ef7; box-shadow: 0 0 0 3px rgba(47,126,247,.12); }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
@media (max-width: 560px) { .grid2 { grid-template-columns: 1fr; } }
button { margin-top: 18px; padding: 11px 22px; border: 0; border-radius: 10px; background: #2f7ef7; color: #fff; font-size: 14.5px; font-weight: 600; cursor: pointer; }
button:hover { background: #256de0; }
button.ghost { background: #eef2f9; color: #4a5568; }
button.ghost:hover { background: #e2e9f4; }
button.danger { background: #fdeeed; color: #b42323; }
button.danger:hover { background: #fadddb; }
.btn-row { display: flex; gap: 10px; }
.btn-row button { flex: 1; }
/* 链接式按钮（安装向导"上一步"） */
.btn-link { flex: 1; margin-top: 18px; padding: 11px 22px; border-radius: 10px; background: #eef2f9; color: #4a5568; font-size: 14.5px; font-weight: 600; text-align: center; text-decoration: none; }
.btn-link:hover { background: #e2e9f4; }
/* 提示条 */
.tip { margin: 12px 0; padding: 10px 14px; border-radius: 10px; font-size: 13px; }
.tip-ok { background: #e9f7ef; color: #1e7e46; border: 1px solid #bfe6cf; }
.tip-err { background: #fdeeed; color: #b42323; border: 1px solid #f3c8c5; }
.tip-info { background: #fff8e6; color: #8a6116; border: 1px solid #f0e0b0; }
/* 安装向导步骤条 */
.steps { display: flex; align-items: center; margin-bottom: 22px; }
.step { flex: 1; text-align: center; font-size: 12.5px; color: #98a2b3; position: relative; }
.step .dot { width: 28px; height: 28px; border-radius: 50%; background: #e6ebf3; color: #98a2b3; display: flex; align-items: center; justify-content: center; margin: 0 auto 6px; font-weight: 700; font-size: 13px; }
.step.on { color: #2f7ef7; }
.step.on .dot { background: #2f7ef7; color: #fff; }
.step.done .dot { background: #1e7e46; color: #fff; }
.step::before, .step::after { content: ""; position: absolute; top: 14px; height: 2px; background: #e6ebf3; width: 50%; }
.step::before { left: 0; }
.step::after { right: 0; }
.step:first-child::before, .step:last-child::after { display: none; }
/* 检测项 */
.check-row { display: flex; align-items: center; gap: 10px; padding: 11px 2px; border-bottom: 1px dashed #e8ecf4; font-size: 14px; }
.check-row:last-child { border-bottom: 0; }
.check-row .ok { color: #1e7e46; font-weight: 700; }
.check-row .no { color: #b42323; font-weight: 700; }
.check-row .why { margin-left: auto; font-size: 12px; color: #98a2b3; }
/* 版本列表 */
.meta-row { display: flex; flex-wrap: wrap; gap: 10px 28px; font-size: 13.5px; color: #4a5568; }
.meta-row b { color: #2b3445; }
.note-box { margin-top: 12px; padding: 12px 14px; background: #f7f9fc; border-radius: 10px; font-size: 13.5px; white-space: pre-wrap; line-height: 1.7; color: #4a5568; }
.hist-item { padding: 13px 2px; border-bottom: 1px dashed #e8ecf4; font-size: 13.5px; }
.hist-item:last-child { border-bottom: 0; }
.hist-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.vtag { background: #eaf1ff; color: #2f7ef7; border-radius: 999px; padding: 2px 10px; font-size: 12px; font-weight: 600; }
.vtag.cur { background: #1e7e46; color: #fff; }
.time { color: #98a2b3; font-size: 12px; margin-left: auto; }
.hist-note { margin-top: 6px; color: #6b7688; white-space: pre-wrap; }
.empty { text-align: center; color: #98a2b3; font-size: 13.5px; padding: 20px 0; }
a.link { color: #2f7ef7; text-decoration: none; font-size: 13px; cursor: pointer; }
a.link:hover { text-decoration: underline; }
.foot { text-align: center; color: #b3bccb; font-size: 12px; margin-top: 8px; }
/* 上传框 */
.file-box { margin-top: 6px; padding: 16px; border: 1px dashed #c9d3e4; border-radius: 10px; text-align: center; font-size: 13px; color: #7a8699; cursor: pointer; }
.file-box.has { border-color: #2f7ef7; color: #2f7ef7; }
.file-box input { display: none; }

/* ============================================================
 * 后台管理布局：左侧边栏导航 + 独立内容页
 * ============================================================ */
.admin { display: flex; min-height: 100vh; }
.sidebar { width: 224px; flex-shrink: 0; background: #fff; border-right: 1px solid #e5e9f2; padding: 18px 14px; display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.sidebar .brand { display: flex; align-items: center; gap: 10px; padding: 2px 8px 16px; border-bottom: 1px solid #eef1f7; margin-bottom: 12px; }
.sidebar .brand .logo { width: 34px; height: 34px; border-radius: 9px; background: linear-gradient(135deg, #2f7ef7, #6ea8ff); color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 17px; flex-shrink: 0; }
.sidebar .brand .name { font-size: 14.5px; font-weight: 700; }
.sidebar .brand .sub { font-size: 11px; color: #8a94a6; margin-top: 1px; }
.nav-group { font-size: 11px; color: #a6afbf; padding: 12px 10px 6px; letter-spacing: .08em; }
.nav-item { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 10px; color: #4a5568; font-size: 14px; text-decoration: none; margin-bottom: 2px; }
.nav-item:hover { background: #f4f7fc; }
.nav-item.on { background: #eaf1ff; color: #2f7ef7; font-weight: 600; }
.nav-item .ico { width: 20px; text-align: center; flex-shrink: 0; }
.nav-item .cnt { margin-left: auto; background: #eef2f9; color: #6b7688; font-size: 11px; padding: 1px 8px; border-radius: 999px; }
.nav-item.on .cnt { background: #d5e4ff; color: #2f7ef7; }
.sidebar .footbox { margin-top: auto; padding: 14px 10px 4px; border-top: 1px solid #eef1f7; font-size: 13px; color: #4a5568; }
.sidebar .footbox .user { margin-bottom: 8px; }
.admin-main { flex: 1; min-width: 0; padding: 26px 30px 50px; }
.wrap-inner { max-width: 880px; }
/* 页头 */
.page-head { margin-bottom: 18px; }
.page-head h1 { font-size: 20px; }
.page-head .desc { font-size: 13px; color: #8a94a6; margin-top: 4px; }
/* 统计卡 */
.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 20px; }
.stat-card { background: #fff; border: 1px solid #e5e9f2; border-radius: 14px; padding: 18px; box-shadow: 0 2px 10px rgba(30,50,90,.04); }
.stat-card .num { font-size: 24px; font-weight: 700; word-break: break-all; }
.stat-card .lbl { font-size: 12.5px; color: #8a94a6; margin-top: 5px; }
.stat-card.hl .num { color: #2f7ef7; }
/* 数据表格 */
.table-wrap { background: #fff; border: 1px solid #e5e9f2; border-radius: 14px; overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.table th { text-align: left; padding: 11px 14px; background: #f7f9fc; color: #6b7688; font-weight: 600; border-bottom: 1px solid #e5e9f2; white-space: nowrap; }
.table td { padding: 12px 14px; border-bottom: 1px solid #f0f3f8; vertical-align: top; }
.table tr:last-child td { border-bottom: 0; }
.table .note-cell { max-width: 320px; color: #6b7688; white-space: pre-wrap; }
.table .op { display: flex; gap: 8px; align-items: center; white-space: nowrap; }
/* 搜索框 */
.search-box { position: relative; margin-bottom: 14px; }
.search-box input { padding-left: 34px; }
.search-box::before { content: "\1F50D"; position: absolute; left: 12px; top: 50%; transform: translateY(-50%); font-size: 13px; opacity: .55; }
/* 桌面端退出链接只显示文字 */
.logout .ico-lg { display: none; }

/* 响应式：≤900px 侧栏收窄为图标模式（保持左侧边栏形态，不再转顶部横排） */
@media (max-width: 900px) {
    .sidebar { width: 62px; padding: 14px 8px; overflow-x: hidden; }
    .sidebar .brand { justify-content: center; padding: 2px 0 14px; }
    .sidebar .brand > div:last-child { display: none; } /* 品牌名称隐藏，仅保留 Logo */
    .sidebar .brand .logo { width: 32px; height: 32px; font-size: 15px; }
    .nav-group { display: none; }
    .nav-item { position: relative; justify-content: center; padding: 11px 0; margin-bottom: 4px; }
    .nav-item span:not(.ico):not(.cnt) { display: none; } /* 菜单文字隐藏 */
    .nav-item .ico { width: auto; font-size: 17px; }
    .nav-item .cnt { position: absolute; top: 3px; right: 8px; margin: 0; padding: 0 5px; font-size: 10px; }
    .sidebar .footbox { padding: 12px 0 4px; text-align: center; }
    .sidebar .footbox .user { display: none; }
    .logout .ico-lg { display: inline; font-size: 16px; }
    .logout .logout-txt { display: none; }
    .admin-main { padding: 16px 14px 44px; }
    .stat-grid { grid-template-columns: repeat(2, 1fr); }
}

/* 响应式：手机端（≤640px）整体收紧，触控友好 */
@media (max-width: 640px) {
    /* 输入框 16px：防止 iOS Safari 聚焦时页面自动放大 */
    input[type=text], input[type=password], input[type=number], textarea, select { font-size: 16px; }
    /* 布局间距收紧 */
    .wrap { padding: 22px 12px 44px; }
    .topbar { padding: 14px 12px 0; }
    .card { padding: 18px 14px; border-radius: 12px; }
    .admin-main { padding: 12px 10px 40px; }
    /* 图标侧栏进一步收窄 */
    .sidebar { width: 54px; padding: 10px 6px; }
    .sidebar .brand .logo { width: 30px; height: 30px; font-size: 14px; }
    .nav-item { padding: 10px 0; margin-bottom: 3px; }
    .nav-item .ico { font-size: 16px; }
    .nav-item .cnt { top: 2px; right: 5px; }
    /* 页头与统计卡 */
    .page-head h1 { font-size: 18px; }
    .page-head .desc { font-size: 12px; }
    .stat-grid { gap: 10px; margin-bottom: 16px; }
    .stat-card { padding: 14px; }
    .stat-card .num { font-size: 20px; }
    .stat-card .lbl { font-size: 11.5px; }
    /* 表格紧凑：横向滚动已有 .table-wrap 兜底 */
    .table { font-size: 12.5px; }
    .table th { padding: 9px 10px; }
    .table td { padding: 10px 10px; }
    .table .note-cell { max-width: none; }
    .search-box input { font-size: 16px; }
    /* 表单与提示 */
    .card h2 { font-size: 15px; }
    label { font-size: 12.5px; }
    .card form > button { width: 100%; } /* 主操作按钮全宽，触控更稳 */
    .tip { font-size: 12.5px; }
    .meta-row { gap: 8px 18px; font-size: 12.5px; }
    .note-box { font-size: 12.5px; }
    /* 安装向导步骤条 */
    .steps { margin-bottom: 18px; }
    .step { font-size: 11px; }
    .step .dot { width: 26px; height: 26px; font-size: 12px; }
    /* 上传框 */
    .file-box { padding: 13px 10px; font-size: 12.5px; }
}
