* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; background: #f0f2f5; color: #333; min-height: 100vh; }
.page-login { display: flex; align-items: center; justify-content: center; }

.page-index .container { max-width: 960px; margin: 0 auto; padding: 32px 16px; }
.page-verify .container { max-width: 600px; margin: 0 auto; padding: 32px 16px; }

h1 { text-align: center; font-size: 24px; margin-bottom: 24px; color: #1a1a2e; }
.page-login h1 { font-size: 20px; }
.page-verify h1 { font-size: 22px; }

.card { background: #fff; border-radius: 12px; box-shadow: 0 2px 8px rgba(0,0,0,0.08); padding: 24px; margin-bottom: 24px; }
.page-login .card { padding: 32px; width: 360px; margin-bottom: 0; }
.card h2 { font-size: 18px; margin-bottom: 16px; color: #1a1a2e; }

.form-row { display: flex; gap: 16px; flex-wrap: wrap; margin-bottom: 16px; }
.form-group { margin-bottom: 16px; }
.page-index .form-group { flex: 1; min-width: 180px; }
.form-group label { display: block; font-size: 14px; font-weight: 600; margin-bottom: 4px; color: #555; }
.form-group input { width: 100%; padding: 10px 12px; border: 1px solid #d9d9d9; border-radius: 6px; font-size: 14px; outline: none; transition: border-color 0.2s; }
.form-group input:focus { border-color: #4a6cf7; box-shadow: 0 0 0 2px rgba(74,108,247,0.15); }
.page-index .form-group input { padding: 8px 12px; }

.btn { padding: 10px 24px; border: none; border-radius: 6px; font-size: 14px; font-weight: 600; cursor: pointer; transition: all 0.2s; }
.btn-primary { background: #4a6cf7; color: #fff; }
.btn-primary:hover { background: #3b5de7; }
.btn-primary:disabled { opacity: 0.5; cursor: not-allowed; }
.page-verify .btn-primary, .page-login .btn-primary { width: 100%; }
.btn-success { background: #22c55e; color: #fff; }
.btn-success:hover { background: #16a34a; }
.btn-logout { padding: 6px 16px; border: 1px solid #ef4444; border-radius: 6px; font-size: 13px; background: #fff; color: #ef4444; cursor: pointer; }
.btn-logout:hover { background: #ef4444; color: #fff; }

.hint { font-size: 12px; color: #888; margin-top: 4px; }
.error-msg { color: #ef4444; font-size: 14px; margin-top: 8px; }
.page-login .error-msg { text-align: center; margin-top: 12px; }
.success-msg { color: #22c55e; font-size: 14px; margin-top: 8px; }

.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13px; table-layout: fixed; }
th, td { padding: 8px 12px; text-align: left; border-bottom: 1px solid #eee; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
th:nth-child(1), td:nth-child(1) { width: 40px; }
th:nth-child(2), td:nth-child(2) { width: 140px; }
th:nth-child(3), td:nth-child(3) { width: 400px; word-break: break-all; white-space: normal; }
td:nth-child(3) code { word-break: break-all; white-space: normal; }
th:nth-child(4), td:nth-child(4) { width: 200px; }
th { background: #f8f9fa; font-weight: 600; color: #555; position: sticky; top: 0; }
tr:hover td { background: #f8f9fa; }
.sub-key { color: #888; font-style: italic; }
.actions { margin-top: 16px; display: flex; gap: 12px; align-items: center; }

.badge { display: inline-block; padding: 2px 8px; border-radius: 4px; font-size: 12px; font-weight: 600; }
.badge-red { background: #fef2f2; color: #ef4444; }
.badge-green { background: #f0fdf4; color: #22c55e; }

.btn-view-subkey { margin-left: 8px; padding: 2px 8px; border: 1px solid #4a6cf7; border-radius: 4px; font-size: 11px; background: #fff; color: #4a6cf7; cursor: pointer; white-space: nowrap; }
.btn-view-subkey:hover { background: #4a6cf7; color: #fff; }
.subkey-cell { max-width: 200px; overflow: hidden; text-overflow: ellipsis; font-family: monospace; font-size: 12px; }

.pagination { display: flex; align-items: center; gap: 8px; margin-top: 12px; flex-wrap: wrap; }
.pagination .page-btn { padding: 4px 10px; border: 1px solid #d9d9d9; border-radius: 4px; font-size: 13px; background: #fff; color: #333; cursor: pointer; }
.pagination .page-btn:hover { border-color: #4a6cf7; color: #4a6cf7; }
.pagination .page-btn.active { background: #4a6cf7; color: #fff; border-color: #4a6cf7; }
.pagination .page-btn:disabled { opacity: 0.4; cursor: not-allowed; }
.pagination .page-info { font-size: 13px; color: #666; }

.overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.4); z-index: 1000; align-items: center; justify-content: center; }
.overlay.show { display: flex; }
.modal { background: #fff; border-radius: 12px; padding: 24px; min-width: 360px; max-width: 480px; box-shadow: 0 4px 24px rgba(0,0,0,0.15); }
.modal h3 { font-size: 16px; margin-bottom: 12px; }
.modal .key-box { background: #f5f5f5; border-radius: 6px; padding: 12px; font-family: monospace; font-size: 13px; word-break: break-all; margin-bottom: 16px; }
.modal .modal-actions { display: flex; gap: 8px; justify-content: flex-end; }
.btn-copy { padding: 8px 16px; border: none; border-radius: 6px; font-size: 13px; cursor: pointer; background: #4a6cf7; color: #fff; }
.btn-copy:hover { background: #3b5de7; }
.btn-close { padding: 8px 16px; border: 1px solid #d9d9d9; border-radius: 6px; font-size: 13px; cursor: pointer; background: #fff; color: #333; }
.btn-close:hover { background: #f5f5f5; }

.loading-overlay { display: none; position: fixed; inset: 0; background: rgba(255,255,255,0.92); z-index: 999; flex-direction: column; align-items: center; justify-content: center; }
.loading-overlay.show { display: flex; }
.spinner { width: 40px; height: 40px; border: 4px solid #e0e0e0; border-top-color: #4a6cf7; border-radius: 50%; animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.loading-overlay .loading-text { margin-top: 16px; font-size: 16px; color: #555; }

.header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 24px; }
.header h1 { margin-bottom: 0; }
.page-verify .header a { font-size: 14px; color: #4a6cf7; text-decoration: none; }
.page-verify .header a:hover { text-decoration: underline; }

.result { margin-top: 16px; padding: 12px 16px; border-radius: 6px; font-size: 14px; text-align: center; }
.code-block { margin-top: 16px; }
.code-block h3 { font-size: 15px; margin-bottom: 8px; color: #1a1a2e; }
.code-block pre { background: #1e1e2e; color: #cdd6f4; border-radius: 8px; padding: 16px; font-size: 13px; overflow-x: auto; white-space: pre-wrap; word-break: break-all; }

.footer { text-align: center; font-size: 12px; color: #aaa; margin-top: 32px; }
