* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: "Microsoft YaHei", "PingFang SC", sans-serif; background: #f0f2f5; color: #333; font-size: 14px; }
a { text-decoration: none; color: #1e88e5; }

/* 登录页 */
.login-page { display: flex; align-items: center; justify-content: center; min-height: 100vh; background: linear-gradient(135deg, #1e88e5, #0d47a1); }
.login-card { width: 400px; background: #fff; border-radius: 12px; padding: 40px; box-shadow: 0 20px 60px rgba(0,0,0,.3); }
.login-card .brand { text-align: center; margin-bottom: 30px; }
.login-card .brand img { width: 72px; height: 72px; }
.login-card h1 { font-size: 20px; margin-top: 12px; color: #0d47a1; }
.login-card label { display: block; margin: 16px 0 6px; color: #555; font-weight: 600; }
.login-card input { width: 100%; padding: 12px; border: 1px solid #ddd; border-radius: 6px; font-size: 14px; }
.login-card input:focus { outline: none; border-color: #1e88e5; }
.login-card button { width: 100%; margin-top: 24px; padding: 12px; background: #1e88e5; color: #fff; border: none; border-radius: 6px; font-size: 16px; cursor: pointer; }
.login-card button:hover { background: #1565c0; }
.alert-error { background: #ffebee; color: #c62828; padding: 10px; border-radius: 6px; margin-bottom: 12px; text-align: center; }
.alert-ok { background: #e8f5e9; color: #2e7d32; padding: 10px; border-radius: 6px; margin-bottom: 12px; }

/* 布局 */
.layout { display: flex; min-height: 100vh; }
.sidebar { width: 220px; background: #001529; color: #fff; flex-shrink: 0; }
.sidebar .brand { display: flex; align-items: center; gap: 10px; padding: 18px; border-bottom: 1px solid #1f2d3d; }
.sidebar .brand img { width: 36px; height: 36px; }
.sidebar .brand span { font-size: 15px; font-weight: 600; }
.sidebar nav a { display: block; padding: 14px 22px; color: #bfcbd9; border-left: 3px solid transparent; }
.sidebar nav a:hover, .sidebar nav a.active { background: #1f2d3d; color: #fff; border-left-color: #1e88e5; }
.main { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.header { height: 60px; background: #fff; border-bottom: 1px solid #e8e8e8; display: flex; align-items: center; justify-content: space-between; padding: 0 24px; }
.header .user { color: #666; }
.header .user b { color: #1e88e5; }
.content { padding: 24px; flex: 1; overflow: auto; }

/* 卡片与表格 */
.card { background: #fff; border-radius: 8px; padding: 20px; margin-bottom: 20px; box-shadow: 0 1px 4px rgba(0,0,0,.06); }
.card h2 { font-size: 16px; margin-bottom: 16px; color: #333; border-left: 3px solid #1e88e5; padding-left: 10px; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 16px; margin-bottom: 20px; }
.stat { background: #fff; border-radius: 8px; padding: 20px; box-shadow: 0 1px 4px rgba(0,0,0,.06); }
.stat .num { font-size: 30px; font-weight: bold; color: #1e88e5; }
.stat .label { color: #888; margin-top: 6px; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 10px 12px; text-align: left; border-bottom: 1px solid #eee; }
th { background: #fafafa; color: #555; font-weight: 600; }
tr:hover td { background: #f5f9ff; }
.tag { display: inline-block; padding: 2px 8px; border-radius: 4px; font-size: 12px; }
.tag-green { background: #e8f5e9; color: #2e7d32; }
.tag-orange { background: #fff3e0; color: #ef6c00; }
.tag-red { background: #ffebee; color: #c62828; }

/* 表单与按钮 */
.form-row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin-bottom: 12px; }
.form-row label { min-width: 80px; color: #555; }
input[type=text], input[type=password], input[type=time], select { padding: 8px 10px; border: 1px solid #ddd; border-radius: 4px; font-size: 14px; }
input:focus, select:focus { outline: none; border-color: #1e88e5; }
.btn { display: inline-block; padding: 9px 18px; border: none; border-radius: 4px; background: #1e88e5; color: #fff; cursor: pointer; font-size: 14px; }
.btn:hover { background: #1565c0; }
.btn-danger { background: #e53935; } .btn-danger:hover { background: #c62828; }
.btn-sm { padding: 5px 12px; font-size: 12px; }
.btn-gray { background: #78909c; }
.config-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 12px; }
.config-item { border: 1px solid #eee; border-radius: 6px; padding: 12px; }
.config-item label { display: block; font-weight: 600; color: #555; margin-bottom: 4px; font-size: 13px; }
.config-item .desc { color: #999; font-size: 12px; margin-bottom: 8px; }
.config-item input { width: 100%; }
.notice { background: #e3f2fd; border-left: 4px solid #1e88e5; padding: 12px 16px; margin-bottom: 16px; border-radius: 4px; color: #1565c0; }
.notice-err { background: #ffebee !important; border-left-color: #c62828 !important; color: #c62828 !important; }
.notice-warn { background: #fff8e1 !important; border-left-color: #f9a825 !important; color: #8d6e00 !important; }
details summary { outline: none; user-select: none; }
.empty { color: #999; padding: 30px; text-align: center; }

/* 公网IP监测 */
.ip-banner { background: #ffebee; color: #c62828; padding: 10px 24px; border-bottom: 1px solid #ffcdd2; font-weight: 600; }
.ip-banner a { color: #c62828; text-decoration: underline; }
.ip-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px; }
.ip-box { border: 1px solid #e8e8e8; border-radius: 6px; padding: 14px 16px; background: #fafcff; }
.ip-label { color: #888; font-size: 12px; margin-bottom: 8px; }
.ip-value { font-size: 24px; font-weight: 700; color: #1e88e5; letter-spacing: .5px; word-break: break-all; }
.ip-loc { font-size: 14px; color: #333; line-height: 1.6; word-break: break-all; min-height: 22px; }
.ip-small { color: #999; font-size: 12px; margin-top: 4px; line-height: 1.5; word-break: break-all; }
