:root{font-family:Inter,"PingFang SC","Microsoft YaHei",system-ui,sans-serif;color:#172033;background:#f4f7fb}*{box-sizing:border-box}body{margin:0}.topbar{height:64px;background:#111827;color:#fff;display:flex;align-items:center;justify-content:space-between;padding:0 4vw;position:sticky;top:0;z-index:10}.brand{font-weight:800}.topbar nav{display:flex;gap:20px}.topbar a{color:#dbeafe;text-decoration:none;font-size:14px}.container{width:min(1560px,96vw);margin:28px auto 60px}.login-wrap{min-height:100vh;display:grid;place-items:center;margin-top:0}.card{background:#fff;border:1px solid #e5eaf1;border-radius:14px;padding:22px;box-shadow:0 8px 30px rgba(15,23,42,.05);margin-bottom:20px}.login-card{width:min(420px,92vw)}h1,h2{margin-top:0}h1{font-size:26px}h2{font-size:18px}.page-head,.split{display:flex;align-items:center;justify-content:space-between;gap:20px;margin-bottom:18px}.page-head p{margin:5px 0;color:#64748b}.btn{display:inline-flex;align-items:center;justify-content:center;border:1px solid #cbd5e1;background:#fff;color:#172033;border-radius:9px;padding:9px 14px;text-decoration:none;cursor:pointer;font-weight:650}.btn.primary{background:#16a34a;border-color:#16a34a;color:#fff}.btn.danger{background:#fff1f2;border-color:#fecdd3;color:#be123c}.btn.small{padding:6px 10px;font-size:12px}.btn:disabled{opacity:.45;cursor:not-allowed}.actions{display:flex;gap:8px;align-items:center;flex-wrap:wrap}.stats-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(170px,1fr));gap:16px;margin-bottom:20px}.stat{margin:0}.stat span{display:block;color:#64748b}.stat strong{display:block;font-size:30px;margin-top:8px}.form-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:16px}.form-grid.compact{grid-template-columns:repeat(3,minmax(0,1fr))}.form-grid label{display:flex;flex-direction:column;gap:7px;font-size:14px;font-weight:650}.form-grid .full{grid-column:1/-1}.form-grid .check{flex-direction:row;align-items:center;align-self:end;padding:10px 0}.section-title{border-top:1px solid #e5e7eb;padding-top:18px;margin-top:4px}input,select,textarea{width:100%;border:1px solid #cbd5e1;border-radius:9px;padding:10px 11px;font:inherit;background:#fff}textarea{resize:vertical}small,.muted{color:#64748b;font-weight:400}.alert{padding:12px 16px;border-radius:10px;margin-bottom:16px}.alert.success{background:#ecfdf5;color:#047857}.alert.error{background:#fff1f2;color:#be123c}.notice{background:#fffbeb;color:#92400e;padding:10px;border-radius:8px}.table-wrap{overflow:auto}table{width:100%;border-collapse:collapse;min-width:680px}th,td{text-align:left;border-bottom:1px solid #eef2f7;padding:12px 10px;font-size:14px}th{color:#475569;background:#f8fafc}.badge{display:inline-block;padding:4px 8px;border-radius:999px;font-size:12px}.badge.ok{background:#dcfce7;color:#166534}.badge.off{background:#e2e8f0;color:#475569}code{background:#f1f5f9;padding:3px 7px;border-radius:6px;word-break:break-all}.endpoint-box>div{display:grid;grid-template-columns:150px 1fr auto;gap:10px;align-items:center;padding:9px 0}.number-list{display:grid;gap:14px}.number-card{border:1px solid #e5e7eb;border-radius:12px;padding:16px}.number-head{display:flex;justify-content:space-between;margin-bottom:14px}.filter-row{display:flex;gap:12px;align-items:end;flex-wrap:wrap}.filter-row label{display:flex;flex-direction:column;gap:6px;min-width:170px}.chat-layout{display:grid;grid-template-columns:250px 1fr;padding:0;overflow:hidden;min-height:650px}.chat-list{border-right:1px solid #e5e7eb;padding:12px;display:flex;flex-direction:column;gap:6px}.chat-list a{padding:12px;border-radius:9px;text-decoration:none;color:#172033}.chat-list a.active{background:#dcfce7}.chat-list small{display:block;margin-top:4px}.chat-main{display:flex;flex-direction:column;min-width:0}.chat-title{padding:16px;border-bottom:1px solid #e5e7eb}.messages{padding:18px;flex:1;overflow:auto;max-height:520px;background:#f8fafc}.message{max-width:72%;background:#fff;border:1px solid #e5e7eb;border-radius:12px;padding:10px 12px;margin-bottom:12px}.message.mine{margin-left:auto;background:#ecfdf5}.message p{margin:7px 0}.message img,.message video{display:block;max-width:100%;max-height:320px;border-radius:8px;margin-top:8px}.chat-form{display:grid;grid-template-columns:1fr auto auto;gap:10px;padding:14px;border-top:1px solid #e5e7eb}.chat-form textarea{grid-row:1/3}.chat-form input[type=file]{max-width:220px}@media(max-width:800px){.topbar{height:auto;align-items:flex-start;gap:12px;padding:15px;flex-direction:column}.topbar nav{flex-wrap:wrap;gap:12px}.form-grid,.form-grid.compact{grid-template-columns:1fr}.endpoint-box>div{grid-template-columns:1fr}.chat-layout{grid-template-columns:1fr}.chat-list{border-right:0;border-bottom:1px solid #e5e7eb;max-height:180px;overflow:auto}.chat-form{grid-template-columns:1fr}.chat-form textarea{grid-row:auto}.message{max-width:90%}}


/* v2: 列表式号码管理与点击/时间轮询 */
.rotation-rule-box{border:1px solid #dbeafe;background:#eff6ff;border-radius:12px;padding:18px}.rotation-rule-title{font-size:16px;font-weight:800;margin-bottom:14px}.rotation-rule-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:16px}.rotation-rule-grid label{display:flex;flex-direction:column;gap:7px;font-size:14px;font-weight:650}.number-management-card{padding:22px 14px}.number-management-head{display:flex;align-items:center;justify-content:space-between;gap:18px;padding:0 8px 16px}.number-management-head h2{margin:0 0 6px}.number-management-head p{margin:0;color:#64748b}.wa-table-wrap{overflow:auto;border:1px solid #e2e8f0;border-radius:12px}.wa-number-table{min-width:1080px;table-layout:fixed}.wa-number-table th,.wa-number-table td{padding:8px 7px;vertical-align:middle}.wa-number-table th{font-size:13px;white-space:nowrap}.wa-number-table td{background:#fff}.wa-number-table tbody tr:hover td{background:#f8fbff}.wa-number-table input{height:38px;padding:7px 9px;border-radius:6px;font-size:13px}.wa-number-table .col-label{width:130px}.wa-number-table .col-phone{width:190px}.wa-number-table .col-status{width:86px;text-align:center}.wa-number-table .col-count{width:92px;text-align:center}.wa-number-table .col-actions{width:118px;text-align:center}.status-cell,.count-cell,.action-cell{text-align:center}.add-number-row td{background:#f8fafc}.table-help{font-size:12px;color:#64748b;margin:12px 8px 0}.switch{position:relative;display:inline-flex;width:46px;height:26px;cursor:pointer}.switch input{position:absolute;opacity:0;width:1px;height:1px}.switch span{width:46px;height:26px;border-radius:999px;background:#cbd5e1;transition:.18s;box-shadow:inset 0 0 0 1px rgba(15,23,42,.08)}.switch span:after{content:"";display:block;width:20px;height:20px;border-radius:50%;background:#fff;margin:3px;transition:.18s;box-shadow:0 1px 4px rgba(15,23,42,.25)}.switch input:checked+span{background:#2563eb}.switch input:checked+span:after{transform:translateX(20px)}.icon-btn{border:0;background:transparent;padding:6px 7px;border-radius:6px;cursor:pointer;font-size:12px;font-weight:700}.icon-btn.save{color:#2563eb}.icon-btn.save:hover{background:#eff6ff}.icon-btn.delete{color:#ef4444}.icon-btn.delete:hover{background:#fff1f2}
@media(max-width:800px){.rotation-rule-grid{grid-template-columns:1fr}.number-management-head{align-items:flex-start;flex-direction:column}.container{width:min(100%,96vw)}}


/* v3：稳定顺序、停用号码提示、所有已保存号码均可删除 */
.wa-number-table tbody tr.number-disabled td{background:#f1f5f9;color:#94a3b8}
.wa-number-table tbody tr.number-disabled:hover td{background:#e9eef5}
.wa-number-table tbody tr.number-disabled input{background:#f8fafc;color:#64748b}
.wa-number-table .add-number-row td{background:#f0fdf4;border-top:2px solid #bbf7d0}
.wa-number-table .add-number-row:hover td{background:#ecfdf5}
.wa-number-table .add-number-row .count-cell{color:#15803d;font-size:12px;font-weight:800}


/* v4：链接今日点击/清零/删除，以及可编辑代理与到期管理 */
.link-admin-table{min-width:1120px}
.link-row-actions{display:flex;align-items:center;gap:9px;flex-wrap:wrap}
.link-row-actions form{margin:0}
.today-click-count{font-size:18px;color:#0f766e}
.agent-security-note{background:#fffbeb;color:#92400e;border-color:#fde68a}
.agent-table-wrap{padding:12px}
.agent-admin-table{min-width:1480px;table-layout:fixed}
.agent-admin-table th,.agent-admin-table td{padding:8px 7px;vertical-align:middle}
.agent-admin-table input{min-width:120px;padding:8px;border-radius:7px;font-size:13px}
.agent-admin-table th:nth-child(1){width:150px}
.agent-admin-table th:nth-child(2){width:160px}
.agent-admin-table th:nth-child(3){width:170px}
.agent-admin-table th:nth-child(4),
.agent-admin-table th:nth-child(5){width:72px;text-align:center}
.agent-admin-table th:nth-child(6){width:110px}
.agent-admin-table th:nth-child(7){width:190px}
.agent-admin-table th:nth-child(8){width:150px}
.agent-admin-table th:nth-child(9){width:135px}
.agent-admin-table th:nth-child(10){width:105px}
.agent-admin-table td:nth-child(4),
.agent-admin-table td:nth-child(5){text-align:center}
.agent-expiry-cell strong,.agent-expiry-cell small{display:block}
.agent-expiry-cell small{margin-top:4px;color:#64748b}
.agent-status-cell{display:flex;align-items:center;gap:8px;white-space:nowrap}
@media(max-width:800px){.link-row-actions{align-items:flex-start;flex-direction:column}}


/* v6.1：后台数字每3秒局部更新，不整页刷新 */
@keyframes liveDataPulse {
  0% {
    background-color: rgba(34, 197, 94, .22);
  }
  100% {
    background-color: transparent;
  }
}

.live-pulse {
  border-radius: 4px;
  animation: liveDataPulse .75s ease-out;
}
