* { box-sizing: border-box; }

html, body {
    margin: 0;
    padding: 0;
}

body {
    background: #f4f6f8;
    color: #1f2328;
    font: 14px/1.6 -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Segoe UI", sans-serif;
}

a { color: #15803d; text-decoration: none; }
a:hover { text-decoration: underline; }

h1, h2, h3, p { margin: 0; }

.muted { color: #6b7280; }
.small { font-size: 12px; }

/* 登录 / 安装 */
.page-auth {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: linear-gradient(180deg, #eef7f1 0%, #f4f6f8 40%);
}

.auth-wrap { width: 100%; max-width: 380px; }

.card {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    box-shadow: 0 1px 2px rgba(16, 24, 40, .04);
}

.auth-card { padding: 28px 24px; }

.auth-title {
    font-size: 22px;
    font-weight: 600;
    text-align: center;
}

.auth-sub { text-align: center; margin-top: 6px; margin-bottom: 20px; }
.auth-foot { text-align: center; margin-top: 16px; }

.field { display: block; margin-bottom: 14px; }
.field > span { display: block; margin-bottom: 6px; font-size: 13px; color: #4b5563; }

input[type="text"], input[type="password"], input[type="number"], textarea {
    width: 100%;
    padding: 9px 12px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    background: #fff;
    color: #111827;
    font: inherit;
    outline: none;
}

input:focus, textarea:focus {
    border-color: #16a34a;
    box-shadow: 0 0 0 3px rgba(22, 163, 74, .12);
}

textarea { resize: vertical; min-height: 88px; }

/* 按钮 */
.btn {
    display: inline-block;
    padding: 9px 16px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    background: #fff;
    color: #1f2937;
    font: inherit;
    line-height: 1.4;
    cursor: pointer;
    text-decoration: none;
    text-align: center;
}

.btn:hover { background: #f9fafb; text-decoration: none; }
.btn:disabled { opacity: .6; cursor: not-allowed; }

.btn-primary {
    background: #16a34a;
    border-color: #16a34a;
    color: #fff;
}
.btn-primary:hover { background: #15803d; border-color: #15803d; }

.btn-danger { color: #b91c1c; border-color: #fecaca; background: #fff5f5; }
.btn-danger:hover { background: #fee2e2; }

.btn-block { display: block; width: 100%; }
.btn-sm { padding: 5px 10px; font-size: 13px; }

/* 顶部栏 */
.topbar {
    background: #fff;
    border-bottom: 1px solid #e5e7eb;
}

.topbar-inner {
    max-width: 1000px;
    margin: 0 auto;
    padding: 0 20px;
    height: 58px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.brand { font-size: 17px; font-weight: 600; color: #111827; }

.userbox { display: flex; align-items: center; gap: 12px; font-size: 13px; color: #4b5563; }

/* 页面容器 */
.container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 24px 20px 48px;
}

.page-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 16px;
}

.page-title { font-size: 20px; font-weight: 600; }
.page-desc { margin-top: 4px; }

/* 提示 */
.alert {
    padding: 10px 12px;
    border-radius: 8px;
    margin-bottom: 16px;
    font-size: 13px;
    border: 1px solid transparent;
}

.alert-error { background: #fef2f2; border-color: #fecaca; color: #b91c1c; }
.alert-success { background: #f0fdf4; border-color: #bbf7d0; color: #15803d; }

.msg-list { margin: 12px 0 18px; padding-left: 18px; }
.msg-list li { margin-bottom: 6px; }
.msg-list .ok { color: #15803d; }
.msg-list .err { color: #b91c1c; }

/* 表格 */
.table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    overflow: hidden;
}

.table th, .table td {
    padding: 12px 14px;
    text-align: left;
    border-bottom: 1px solid #f0f1f3;
    vertical-align: middle;
}

.table th {
    background: #fafafa;
    font-size: 13px;
    font-weight: 500;
    color: #6b7280;
}

.table tr:last-child td { border-bottom: 0; }
.table tr:hover td { background: #fcfdfc; }

.table .actions { white-space: nowrap; }
.table .actions form { display: inline; }

/* 徽标 */
.badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 12px;
    line-height: 18px;
}

.badge-on { background: #e8f8ee; color: #15803d; }
.badge-off { background: #f3f4f6; color: #6b7280; }
.badge-mode { background: #eef2ff; color: #4338ca; }

.code-mono {
    font-family: Consolas, Menlo, monospace;
    font-size: 13px;
    background: #f3f4f6;
    padding: 2px 6px;
    border-radius: 4px;
}

/* 表单卡片 */
.panel {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 16px;
}

.panel-title {
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 14px;
}

.row { display: flex; gap: 12px; }
.row > * { flex: 1; }

.form-actions { display: flex; gap: 10px; align-items: center; margin-top: 6px; }

/* 二维码 */
.qr-box {
    display: flex;
    gap: 20px;
    align-items: center;
    flex-wrap: wrap;
}

.qr-box img {
    width: 168px;
    height: 168px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    background: #fff;
    padding: 6px;
}

.qr-meta { flex: 1; min-width: 220px; }
.qr-meta dl { margin: 0; }
.qr-meta dt { font-size: 12px; color: #6b7280; margin-top: 10px; }
.qr-meta dd { margin: 2px 0 0; word-break: break-all; }

.empty {
    padding: 28px;
    text-align: center;
    color: #9ca3af;
}

@media (max-width: 640px) {
    .topbar-inner { padding: 0 14px; }
    .container { padding: 18px 14px 40px; }
    .page-head { flex-direction: column; align-items: stretch; }
    .table th:nth-child(3), .table td:nth-child(3) { display: none; }
    .row { flex-direction: column; }
}
