* { box-sizing: border-box; }
body { margin: 0; font-family: "Microsoft YaHei", "PingFang SC", system-ui, sans-serif; background: #f4f6f9; color: #26303b; font-size: 14px; }
a { color: #2563eb; text-decoration: none; }

/* 顶部菜单 */
.menu { display: flex; flex-wrap: wrap; align-items: center; gap: 2px; background: #1f2937; padding: 0 16px; }
.menu a { color: #d1d5db; padding: 12px 10px; display: inline-block; }
.menu a:hover { color: #fff; background: #374151; }
.menu-spacer { flex: 1; }
.menu-user { color: #e5e7eb; padding: 12px 6px; display: flex; align-items: center; gap: 6px; }
.menu-user .muted { color: #9ca3af; font-style: normal; font-size: 12px; }
.menu-logout { background: #b91c1c; color: #fff !important; border-radius: 4px; padding: 6px 12px !important; margin-left: 6px; }

main.page { max-width: 1080px; margin: 20px auto; padding: 0 16px; }
h1 { font-size: 20px; margin: 0 0 16px; }
h2 { font-size: 16px; margin: 0 0 12px; }

.card { background: #fff; border-radius: 8px; padding: 18px; margin-bottom: 16px; box-shadow: 0 1px 3px rgba(0,0,0,.06); }
.card h1, .card h2 { margin-top: 0; }

.toolbar { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; align-items: center; }
.toolbar input, .toolbar select, .toolbar button, input, select, textarea, button { padding: 7px 10px; border: 1px solid #d1d5db; border-radius: 6px; font-size: 14px; }
input:focus, select:focus, textarea:focus { outline: 2px solid #bfdbfe; border-color: #2563eb; }
button { background: #2563eb; color: #fff; border: none; cursor: pointer; }
button:hover { background: #1d4ed8; }
button.secondary, .btn.secondary { background: #6b7280; }
button.danger { background: #b91c1c; }
.btn { display: inline-block; padding: 7px 12px; border-radius: 6px; background: #2563eb; color: #fff; }
.btn.secondary { background: #6b7280; }
.btn.success { background: #059669; }

table { width: 100%; border-collapse: collapse; background: #fff; }
th, td { text-align: left; padding: 9px 10px; border-bottom: 1px solid #e5e7eb; vertical-align: top; }
th { background: #f9fafb; color: #4b5563; font-weight: 600; white-space: nowrap; }
tr:hover td { background: #f8fafc; }

.badge { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 12px; }
.badge.green { background: #d1fae5; color: #065f46; }
.badge.red { background: #fee2e2; color: #991b1b; }
.badge.yellow { background: #fef3c7; color: #92400e; }
.badge.blue { background: #dbeafe; color: #1e40af; }
.badge.gray { background: #e5e7eb; color: #374151; }

.muted { color: #6b7280; }
.small { font-size: 12px; }
.mt { margin-top: 12px; }
.mb { margin-bottom: 12px; }
.price { color: #b91c1c; font-weight: 600; }
pre { background: #f3f4f6; padding: 12px; border-radius: 6px; overflow: auto; white-space: pre-wrap; }

/* 登录页 */
main.login { max-width: 460px; margin: 60px auto; padding: 0 16px; }
.login .card { padding: 24px; }
.login form { display: flex; flex-direction: column; gap: 8px; }
.login label { font-weight: 600; margin-top: 6px; }
.login button { margin-top: 14px; padding: 10px; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px; }
.account-fill { background: #eef2ff; color: #3730a3; border: 1px solid #c7d2fe; text-align: left; }
.account-fill:hover { background: #e0e7ff; }

/* 公网跳转 */
.portal-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; }
.portal-card { border: 1px solid #e5e7eb; border-radius: 8px; padding: 14px; background: #fff; }
.portal-card h3 { margin: 0 0 6px; }
.portal-card .cat { font-size: 12px; color: #6b7280; }

/* AI 对话 */
.chat-box { border: 1px solid #e5e7eb; border-radius: 8px; padding: 12px; height: 320px; overflow: auto; background: #fafafa; }
.chat-msg { margin-bottom: 10px; padding: 8px 12px; border-radius: 8px; max-width: 85%; }
.chat-msg.user { background: #dbeafe; margin-left: auto; }
.chat-msg.ai { background: #fff; border: 1px solid #e5e7eb; }
.chat-msg .who { font-size: 12px; color: #6b7280; margin-bottom: 2px; }

.tabs { display: flex; gap: 6px; margin-bottom: 12px; }
.tabs a { padding: 8px 14px; border-radius: 6px; background: #e5e7eb; color: #374151; }
.tabs a.active { background: #2563eb; color: #fff; }

/* 支付二维码 */
.qr { font-family: monospace; background: #f3f4f6; padding: 14px; border-radius: 6px; word-break: break-all; }
