* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif; background: #f5f5f5; padding: 20px; color: #2c3e50; }
.container { max-width: 800px; margin: 0 auto; background: #fff; border-radius: 12px; padding: 30px; box-shadow: 0 4px 20px rgba(0,0,0,0.1); }
.title { font-size: 2rem; font-weight: 600; margin-bottom: 8px; }
.subtitle { color: #7f8c8d; margin-bottom: 20px; line-height: 1.6; font-size: 14px; }

.offline-badge { background: #d4edda; border: 1px solid #27ae60; color: #1e6b3a; border-radius: 8px; padding: 12px 16px; margin-bottom: 24px; font-size: 14px; line-height: 1.6; }
.offline-badge strong { display: block; margin-bottom: 4px; }
.offline-badge code { background: rgba(255,255,255,.6); padding: 1px 5px; border-radius: 3px; font-size: 13px; }

.section { margin-bottom: 24px; padding: 20px; border: 2px solid #e9ecef; border-radius: 8px; }
.section h3 { font-size: 1.1rem; margin-bottom: 14px; }

label { display: block; font-size: 13px; color: #5a6c7d; margin-bottom: 5px; }
.input-field, .textarea, select { width: 100%; padding: 12px 16px; border: 2px solid #e9ecef; border-radius: 6px; font-size: 16px; font-family: inherit; background: #fff; color: inherit; transition: border-color .2s; }
.input-field:focus, .textarea:focus, select:focus { outline: none; border-color: #3498db; }
.input-field { font-family: 'SF Mono', Menlo, Consolas, monospace; }
.textarea { height: 120px; resize: vertical; font-family: 'SF Mono', Menlo, Consolas, monospace; font-size: 13px; }
.input-group { margin-bottom: 14px; }

.opts { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.opts > div { flex: 1; min-width: 120px; }
select { padding: 10px 12px; font-size: 14px; }

.btn { background: linear-gradient(135deg, #3498db, #2980b9); color: #fff; border: none; padding: 12px 24px; border-radius: 6px; font-size: 16px; font-weight: 600; font-family: inherit; cursor: pointer; transition: transform .15s; }
.btn:hover { transform: translateY(-2px); }
.btn:active { transform: translateY(0); }
.btn:focus-visible { outline: 3px solid #3498db; outline-offset: 2px; }
.btn-secondary { background: linear-gradient(135deg, #27ae60, #229954); }
.btn-danger { background: linear-gradient(135deg, #e74c3c, #c0392b); }
.btn-sm { padding: 8px 16px; font-size: 14px; }

.hidden { display: none; }

.result { margin-top: 18px; padding: 18px; background: #f8f9fa; border-radius: 8px; }
.result-label { font-size: 12px; color: #7f8c8d; margin-bottom: 2px; }
.result-issuer { font-size: 15px; font-weight: 600; margin-bottom: 12px; word-break: break-all; }
.code-display { font-size: 40px; color: #27ae60; font-weight: 700; text-align: center; letter-spacing: 4px; font-family: 'SF Mono', Menlo, Consolas, monospace; margin: 6px 0 12px; cursor: pointer; user-select: all; }
.bar-track { height: 6px; background: #e9ecef; border-radius: 3px; overflow: hidden; margin-bottom: 8px; }
.bar-fill { height: 100%; background: linear-gradient(90deg, #27ae60, #2ecc71); border-radius: 3px; transition: width .25s linear; }
.bar-fill.warn { background: linear-gradient(90deg, #e67e22, #e74c3c); }
.timer-row { display: flex; justify-content: space-between; align-items: center; font-size: 13px; color: #7f8c8d; }
.timer { color: #e74c3c; font-weight: 700; }
.result-actions { margin-top: 14px; display: flex; gap: 10px; flex-wrap: wrap; }

.error-box { margin-top: 14px; padding: 12px 16px; background: #fdecea; border: 1px solid #e74c3c; color: #c0392b; border-radius: 6px; font-size: 14px; line-height: 1.5; }

.warn-box { background: #fff3cd; border: 1px solid #e0b400; color: #7a5c00; border-radius: 6px; padding: 12px 16px; margin-bottom: 14px; font-size: 13px; line-height: 1.6; }
.warn-box strong { color: #664d00; }

.notification { position: fixed; top: 20px; right: 20px; background: #2c3e50; color: #fff; padding: 15px 20px; border-radius: 6px; z-index: 1000; opacity: 0; transform: translateX(120%); transition: all .3s; max-width: 80vw; }
.notification.show { opacity: 1; transform: translateX(0); }

.help { line-height: 1.9; font-size: 14px; color: #5a6c7d; }
.help code { background: #eef1f4; padding: 2px 6px; border-radius: 4px; font-size: 13px; }
hr { border: none; height: 2px; background: linear-gradient(90deg, #3498db, #2980b9); margin: 26px 0; border-radius: 2px; }

/* ---------------- 404 页面 ---------------- */
.nf { text-align: center; }
.nf h1 { font-size: 64px; color: #2c3e50; margin-bottom: 8px; }
.nf p { color: #7f8c8d; margin-bottom: 20px; }

@media (max-width: 600px) {
  body { padding: 12px; }
  .container { padding: 20px; }
  .code-display { font-size: 32px; letter-spacing: 2px; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}
