:root { font-family: "Segoe UI", "Microsoft JhengHei", sans-serif; color: #1e293b; background: #f3f6fa; }
* { box-sizing: border-box; }
body { margin: 0; }
[hidden] { display: none !important; }
main { width: min(1180px, 96vw); margin: 26px auto 60px; }
h1 { margin: 0 0 6px; font-size: 1.65rem; }
h2 { margin: 0; font-size: 1.1rem; }
p { margin: 6px 0; }
.masthead { display: flex; justify-content: space-between; align-items: flex-start; gap: 20px; margin-bottom: 20px; }
.masthead p, .hint { color: #64748b; font-size: .9rem; }
.account-actions { display: flex; align-items: center; justify-content: flex-end; gap: 10px; flex-wrap: wrap; }
.auth-loading { margin: 22vh auto 0; text-align: center; color: #64748b; }
.auth-panel { width: min(420px, 100%); margin: 12vh auto 0; }
.auth-panel form { display: grid; gap: 15px; margin-top: 20px; }
.auth-panel input { width: 100%; margin-top: 5px; }
.auth-panel form button { justify-self: start; min-width: 100px; }
.auth-error { margin-top: 14px; color: #9f1239; }
.status, .selected { color: #334155; overflow-wrap: anywhere; }
.status { padding: 7px 12px; background: #e2e8f0; border-radius: 30px; }
.panel { background: white; border: 1px solid #dbe3ed; border-radius: 12px; padding: 18px 20px; margin-bottom: 16px; box-shadow: 0 3px 12px #20314f0a; }
.panel-heading { display: flex; justify-content: space-between; align-items: center; gap: 15px; margin-bottom: 14px; }
.actions, .filters, .export-row { display: flex; gap: 9px; align-items: end; flex-wrap: wrap; }
button { padding: 9px 13px; border: 1px solid #1d4ed8; border-radius: 7px; background: #1d4ed8; color: white; font: inherit; cursor: pointer; }
button.secondary { color: #1d4ed8; background: white; }
button:disabled { opacity: .45; cursor: not-allowed; }
input, select { display: block; min-height: 38px; padding: 7px 10px; border: 1px solid #b8c4d4; border-radius: 7px; background: white; font: inherit; color: inherit; }
label { display: block; font-size: .9rem; color: #475569; }
#friendSearch { width: min(460px, 100%); margin-top: 4px; }
#chatSearch { width: min(460px, 100%); margin-top: 4px; }
.workflow-options { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.workflow-button { text-align: left; display: flex; flex-direction: column; gap: 5px; padding: 14px; }
.workflow-button span { font-size: .88rem; font-weight: normal; }
.workflow-button.active { background: #dbeafe; border-color: #2563eb; }
.friend-list { max-height: 240px; overflow: auto; border: 1px solid #dbe3ed; border-radius: 8px; margin-top: 12px; }
.friend { width: 100%; display: flex; gap: 10px; align-items: center; text-align: left; border: 0; border-bottom: 1px solid #edf1f5; border-radius: 0; background: white; color: #1e293b; }
.friend:hover, .friend.active { background: #eff6ff; }
.friend small { margin-left: auto; color: #64748b; overflow-wrap: anywhere; }
.avatar { flex: 0 0 34px; width: 34px; height: 34px; display: inline-grid; place-items: center; overflow: hidden; border-radius: 50%; background: #dbeafe; color: #1e40af; font-size: .85rem; font-weight: bold; }
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.chat-row { width: 100%; display: flex; gap: 10px; align-items: center; padding: 10px 12px; border-bottom: 1px solid #edf1f5; color: #1e293b; cursor: pointer; }
.chat-row:hover { background: #eff6ff; }
.chat-row input { flex: 0 0 auto; }
.chat-details { display: flex; flex-direction: column; min-width: 0; }
.chat-details small { color: #64748b; overflow-wrap: anywhere; }
.badge { color: #166534; font-size: .75rem; }
.qr-wrap { text-align: center; padding: 8px; }
.qr-wrap img { width: 256px; height: 256px; }
.pin { font-size: 1.2rem; font-weight: bold; }
.notice { background: #fff4db; border: 1px solid #f3d58d; padding: 12px; border-radius: 8px; margin-bottom: 14px; }
.table-wrap { overflow-x: auto; }
table { width: 100%; min-width: 1000px; border-collapse: collapse; margin-top: 12px; }
th, td { padding: 10px 8px; border-bottom: 1px solid #e3e8ef; text-align: left; vertical-align: top; font-size: .89rem; }
th { background: #f8fafc; white-space: nowrap; }
td.id { font-family: Consolas, monospace; overflow-wrap: anywhere; max-width: 270px; }
td.empty, p.empty { color: #64748b; text-align: center; padding: 20px; }
.filters input { width: 240px; }
.export-row { border-top: 1px solid #e3e8ef; margin-top: 12px; padding-top: 12px; justify-content: flex-end; }
.export-row label { flex: 0 1 270px; min-width: 210px; }
.export-row input, .export-row select { width: 100%; margin-top: 4px; }
.export-row button { white-space: nowrap; }
@media (max-width: 640px) { .masthead, .panel-heading { display: block; } .account-actions { justify-content: flex-start; margin-top: 10px; } .workflow-options { grid-template-columns: 1fr; } .actions { margin-top: 10px; } .filters input { width: 100%; } .export-row label, .export-row button { flex: 1 1 100%; width: 100%; } }
