/* ============================================================
   雨诺科技 AI巡查 - 全局样式
   科技蓝风格，移动端优先
   ============================================================ */

* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

:root {
    --blue: #2d7ff0;
    --blue-light: #eaf2ff;
    --blue-deep: #1c5fc4;
    --green: #1fad67;
    --green-deep: #188a52;
    --red: #e5453f;
    --red-light: #fdeceb;
    --gray-bg: #f3f5f8;
    --gray-line: #e6e9ef;
    --text: #1f2733;
    --text-sub: #8a94a6;
    --radius: 12px;
    --shadow: 0 4px 16px rgba(31, 42, 66, .08);
}

html, body { height: 100%; }
body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
                 "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
    background: var(--gray-bg);
    color: var(--text);
    font-size: 15px;
    line-height: 1.5;
    overflow-x: hidden;
}

/* ===== 顶栏 ===== */
.topbar {
    position: fixed; top: 0; left: 0; right: 0; z-index: 100;
    height: 52px;
    background: #fff;
    display: flex; align-items: center;
    padding: 0 14px;
    box-shadow: 0 1px 0 var(--gray-line);
}
.menu-btn {
    width: 42px; height: 42px;
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    gap: 5px;
    background: transparent; border: none; cursor: pointer;
    border-radius: 8px;
}
.menu-btn:hover { background: var(--blue-light); }
.menu-btn span {
    display: block; width: 22px; height: 3px;
    background: var(--text); border-radius: 2px;
    transition: all .25s ease;
}
.menu-btn.open span:nth-child(1) { transform: translateY(8px) rotate(45deg); }
.menu-btn.open span:nth-child(2) { opacity: 0; }
.menu-btn.open span:nth-child(3) { transform: translateY(-8px) rotate(-45deg); }

.topbar-title { display: flex; align-items: center; margin-left: 6px; }
.topbar-title .logo {
    width: 30px; height: 30px; border-radius: 8px;
    background: linear-gradient(135deg, var(--blue), #5ba0ff);
    color: #fff; font-weight: 700; font-size: 17px;
    display: flex; align-items: center; justify-content: center;
    margin-right: 9px;
}
.topbar-title h1 { font-size: 17px; font-weight: 600; }

/* ===== 侧边菜单 ===== */
.overlay {
    position: fixed; inset: 0; z-index: 110;
    background: rgba(15, 23, 42, .45);
    opacity: 0; visibility: hidden;
    transition: opacity .25s ease, visibility .25s ease;
}
.overlay.show { opacity: 1; visibility: visible; }

.sidebar {
    position: fixed; top: 0; left: 0; bottom: 0; z-index: 120;
    width: 240px; max-width: 80vw;
    background: #fff;
    transform: translateX(-102%);
    transition: transform .28s cubic-bezier(.4, 0, .2, 1);
    box-shadow: 4px 0 24px rgba(31, 42, 66, .12);
    display: flex; flex-direction: column;
}
.sidebar.open { transform: translateX(0); }

.sidebar-head {
    padding: 20px 20px 14px;
    font-size: 13px; color: var(--text-sub);
    border-bottom: 1px solid var(--gray-line);
}
.menu-list { list-style: none; padding: 10px 12px; flex: 1; overflow-y: auto; }
.menu-item {
    padding: 13px 16px; border-radius: 10px;
    cursor: pointer; font-size: 15px; font-weight: 500;
    color: var(--text); margin-bottom: 4px;
    transition: background .2s, color .2s;
    position: relative;
}
.menu-item:hover { background: var(--gray-bg); }
.menu-item.active {
    background: var(--blue-light); color: var(--blue-deep);
    font-weight: 600;
}
.menu-item.active::before {
    content: ""; position: absolute; left: 0; top: 18%; bottom: 18%;
    width: 4px; border-radius: 4px; background: var(--blue);
}

/* ===== 主内容 ===== */
.main { padding: 64px 16px 40px; max-width: 760px; margin: 0 auto; }

.section { display: none; }
.section.active { display: block; animation: fadeIn .25s ease; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

.section-title { font-size: 19px; font-weight: 700; margin: 6px 2px 16px; }
.section-title.small { font-size: 14px; color: var(--text-sub); font-weight: 500; margin-bottom: 10px; }

/* ===== 控制台统计卡片（正方形，勿过大） ===== */
.stat-grid {
    display: flex; gap: 14px;
    max-width: 420px;
}
.stat-card {
    flex: 1; max-width: 190px;
    aspect-ratio: 1 / 1;              /* 正方形 */
    background: #fff;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    display: flex; flex-direction: column;
    align-items: center; justify-content: center;
    padding: 10px;
    cursor: default;
    user-select: none;
}
.stat-value {
    font-size: 40px; font-weight: 800;
    color: var(--blue); line-height: 1.1;
}
.stat-label { margin-top: 8px; font-size: 14px; color: var(--text-sub); font-weight: 500; }
.stat-card.danger .stat-value { color: var(--red); }

/* ===== 添加俱乐部：绿色加号 ===== */
.toolbar { margin-bottom: 18px; }
.plus-btn {
    width: 46px; height: 46px;
    background: var(--green); color: #fff;
    border: none; border-radius: 10px;
    font-size: 26px; font-weight: 700; line-height: 1;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(31, 173, 103, .35);
    transition: transform .15s, background .2s;
    display: flex; align-items: center; justify-content: center;
}
.plus-btn:active { transform: scale(.94); }
.plus-btn:hover { background: var(--green-deep); }

/* ===== 俱乐部列表 ===== */
.club-list { display: flex; flex-direction: column; gap: 12px; }
.empty-tip {
    background: #fff; border-radius: var(--radius);
    padding: 26px 16px; text-align: center;
    color: var(--text-sub); font-size: 14px;
    border: 1px dashed var(--gray-line);
}
.club-card {
    background: #fff; border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 14px 16px;
    display: flex; align-items: center; gap: 12px;
    position: relative;
}
.club-card .avatar {
    width: 42px; height: 42px; border-radius: 10px; flex-shrink: 0;
    background: var(--blue-light); color: var(--blue-deep);
    font-size: 18px; font-weight: 700;
    display: flex; align-items: center; justify-content: center;
}
.club-card .info { flex: 1; min-width: 0; }
.club-card .info .name { font-size: 15px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.club-card .info .url { font-size: 12px; color: var(--text-sub); margin-top: 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.club-card .badge {
    flex-shrink: 0; font-size: 12px; padding: 3px 8px; border-radius: 20px;
    background: var(--gray-bg); color: var(--text-sub);
}
.club-card .badge.warn { background: var(--red-light); color: var(--red); }
.club-card .del-btn {
    flex-shrink: 0; width: 28px; height: 28px;
    background: transparent; border: 1px solid var(--gray-line);
    color: var(--text-sub); border-radius: 8px; cursor: pointer; font-size: 15px;
    transition: all .2s;
}
.club-card .del-btn:hover { border-color: var(--red); color: var(--red); }

/* ===== 表单 / AI巡查 ===== */
.field { margin-bottom: 16px; }
.field-label { display: block; font-size: 14px; font-weight: 600; margin-bottom: 8px; color: var(--text); }
.input {
    width: 100%; height: 46px;
    border: 1px solid var(--gray-line); border-radius: 10px;
    padding: 0 14px; font-size: 15px; color: var(--text);
    background: #fff; outline: none;
    transition: border-color .2s, box-shadow .2s;
}
.input:focus { border-color: var(--blue); box-shadow: 0 0 0 3px var(--blue-light); }
.input::placeholder { color: #b6bdcb; }

.club-picker {
    display: flex; flex-wrap: wrap; gap: 8px;
}
.pick-item { display: inline-flex; align-items: center; cursor: pointer; }
.pick-item input { display: none; }
.pick-item span {
    display: inline-block; padding: 8px 14px;
    background: #fff; border: 1px solid var(--gray-line);
    border-radius: 20px; font-size: 14px; color: var(--text);
    transition: all .2s;
}
.pick-item.all span { font-weight: 600; }
.pick-item input:checked + span {
    background: var(--blue); border-color: var(--blue); color: #fff;
}

.patrol-btn {
    width: 100%; height: 50px; margin-top: 6px;
    background: linear-gradient(135deg, var(--blue), #5ba0ff);
    color: #fff; font-size: 17px; font-weight: 700;
    border: none; border-radius: 12px; cursor: pointer;
    box-shadow: 0 6px 18px rgba(45, 127, 240, .35);
    transition: transform .15s, opacity .2s;
    letter-spacing: 2px;
}
.patrol-btn:active { transform: scale(.98); }
.patrol-btn:disabled { opacity: .6; cursor: not-allowed; }
.patrol-hint { margin-top: 12px; font-size: 12px; color: var(--text-sub); text-align: center; }

/* ===== 网络波动转圈 ===== */
.spinner-mask {
    position: fixed; inset: 0; z-index: 200;
    background: rgba(255, 255, 255, .94);
    display: none;
    flex-direction: column; align-items: center; justify-content: center;
}
.spinner-mask.active { display: flex; }

.wave-spinner { position: relative; width: 120px; height: 120px; }
.wave-spinner .arc {
    position: absolute; border-radius: 50%;
    border: 4px solid transparent;
    border-top-color: var(--blue);
    animation: spin 1s linear infinite;
}
.wave-spinner .arc:nth-child(1) { inset: 0; }
.wave-spinner .arc:nth-child(2) { inset: 14px; border-top-color: #6aa8ff; animation-duration: 1.4s; border-right-color: rgba(106,168,255,.35); }
.wave-spinner .arc:nth-child(3) { inset: 28px; border-top-color: #9ac2ff; animation-duration: 1.8s; border-right-color: rgba(154,194,255,.4); }
.wave-spinner .arc:nth-child(4) { inset: 42px; border-top-color: #c6ddff; animation-duration: 2.3s; border-right-color: rgba(198,221,255,.5); }
.wave-core {
    position: absolute; left: 50%; top: 50%;
    width: 46px; height: 46px;
    transform: translate(-50%, -50%);
    background: linear-gradient(135deg, var(--blue), #5ba0ff);
    color: #fff; font-weight: 800; font-size: 16px;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    box-shadow: 0 0 20px rgba(45, 127, 240, .45);
}
@keyframes spin { to { transform: rotate(360deg); } }

.spinner-text { margin-top: 26px; font-size: 15px; color: var(--text-sub); letter-spacing: 1px; }

/* ===== 弹窗 ===== */
.modal-mask {
    position: fixed; inset: 0; z-index: 150;
    background: rgba(15, 23, 42, .5);
    display: none; align-items: center; justify-content: center;
    padding: 24px;
}
.modal-mask.show { display: flex; }
.modal {
    width: 100%; max-width: 400px;
    background: #fff; border-radius: 14px;
    box-shadow: 0 16px 48px rgba(15, 23, 42, .25);
    overflow: hidden;
    animation: popIn .2s ease;
}
@keyframes popIn { from { opacity: 0; transform: scale(.92); } to { opacity: 1; transform: none; } }
.modal-head {
    padding: 15px 18px; font-size: 16px; font-weight: 700;
    border-bottom: 1px solid var(--gray-line);
}
.modal-body { padding: 16px 18px; }
.modal-label { display: block; font-size: 13px; color: var(--text-sub); margin: 8px 0 6px; font-weight: 500; }
.modal-label:first-child { margin-top: 0; }
.modal-msg { min-height: 20px; font-size: 13px; margin-top: 10px; }
.modal-msg.err { color: var(--red); }
.modal-msg.ok { color: var(--green); }
.modal-foot {
    display: flex; gap: 10px; justify-content: flex-end;
    padding: 12px 18px 16px;
}
.btn {
    height: 40px; padding: 0 22px;
    border: none; border-radius: 10px; font-size: 15px; font-weight: 600; cursor: pointer;
    transition: opacity .2s, transform .15s;
}
.btn:active { transform: scale(.97); }
.btn.ghost { background: var(--gray-bg); color: var(--text); }
.btn.primary { background: var(--blue); color: #fff; }

/* 巡查结果 */
.result-body { max-height: 60vh; overflow-y: auto; }
.result-overview { text-align: center; padding: 6px 0 14px; }
.result-verdict { font-size: 17px; font-weight: 700; }
.result-verdict.ok { color: var(--green); }
.result-verdict.bad { color: var(--red); }
.result-sub { margin-top: 6px; font-size: 13px; color: var(--text-sub); }
.result-list { margin-top: 8px; display: flex; flex-direction: column; gap: 10px; }
.result-item {
    background: var(--gray-bg); border-radius: 10px; padding: 12px 14px;
}
.result-item .club-name { font-size: 14px; font-weight: 700; margin-bottom: 4px; }
.result-item .found { color: var(--red); font-weight: 600; font-size: 14px; }
.result-item .safe { color: var(--green); font-weight: 600; font-size: 14px; }
.result-item .prod { margin-top: 5px; font-size: 13px; color: var(--text); word-break: break-all; }
.result-item .err { margin-top: 5px; font-size: 12px; color: var(--text-sub); }

@media (max-width: 380px) {
    .stat-value { font-size: 34px; }
    .stat-label { font-size: 13px; }
}
