:root {
  --bg: #f7f8fa;
  --card-bg: #fff;
  --text: #222;
  --muted: #666;
  --accent: #2563eb;
  --accent-h: #1d4ed8;
  --border: #e5e7eb;
  --radius: 10px;
  --shadow: 0 2px 8px rgba(0,0,0,.07);
}
* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif; background: var(--bg); color: var(--text); min-height: 100vh; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* Header */
.header { background: #fff; border-bottom: 1px solid var(--border); padding: 0 24px; display: flex; align-items: center; justify-content: space-between; height: 60px; position: sticky; top: 0; z-index: 100; }
.logo { font-size: 1.3rem; font-weight: 700; color: var(--accent); letter-spacing: -.5px; }
.logo span { color: var(--text); }
.nav-links { display: flex; gap: 24px; font-size: .9rem; }

/* Hero */
.hero { background: linear-gradient(135deg, #2563eb 0%, #1e40af 100%); color: #fff; padding: 48px 24px 40px; text-align: center; }
.hero h1 { font-size: 2rem; font-weight: 700; margin-bottom: 10px; }
.hero p { font-size: 1.05rem; opacity: .85; max-width: 500px; margin: 0 auto; }

/* Search */
.search-wrap { max-width: 500px; margin: 0 auto; padding: 24px 24px 0; }
.search-wrap input { width: 100%; padding: 12px 16px; border: 1.5px solid var(--border); border-radius: 8px; font-size: 1rem; background: #fff; outline: none; transition: border .2s; }
.search-wrap input:focus { border-color: var(--accent); }

/* Grid */
.section-title { font-size: 1rem; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .5px; padding: 28px 24px 12px; max-width: 1100px; margin: 0 auto; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; padding: 0 24px 40px; max-width: 1100px; margin: 0 auto; }

/* Card */
.card { background: var(--card-bg); border: 1.5px solid var(--border); border-radius: var(--radius); padding: 22px; cursor: pointer; transition: all .2s; display: flex; flex-direction: column; gap: 8px; text-decoration: none; color: inherit; }
.card:hover { border-color: var(--accent); box-shadow: var(--shadow); transform: translateY(-2px); text-decoration: none; }
.card-icon { font-size: 2rem; line-height: 1; }
.card-title { font-size: 1rem; font-weight: 600; }
.card-desc { font-size: .85rem; color: var(--muted); line-height: 1.5; }
.card-tag { display: inline-block; font-size: .72rem; background: #eff6ff; color: var(--accent); border-radius: 4px; padding: 2px 8px; font-weight: 500; width: fit-content; }

/* Tool page */
.tool-page { display: none; max-width: 720px; margin: 32px auto; padding: 0 24px 60px; }
.tool-page.active { display: block; }
.tool-header { margin-bottom: 24px; }
.tool-header .back { font-size: .9rem; color: var(--muted); cursor: pointer; display: inline-flex; align-items: center; gap: 6px; margin-bottom: 12px; background: none; border: none; }
.tool-header .back:hover { color: var(--accent); }
.tool-header h2 { font-size: 1.6rem; font-weight: 700; }
.tool-header p { color: var(--muted); margin-top: 4px; }

/* Form elements */
.form-group { margin-bottom: 16px; }
label { display: block; font-size: .88rem; font-weight: 500; margin-bottom: 6px; color: var(--muted); }
input[type=text], input[type=number], textarea, select { width: 100%; padding: 10px 14px; border: 1.5px solid var(--border); border-radius: 8px; font-size: .95rem; font-family: inherit; outline: none; transition: border .2s; background: #fff; }
input[type=text]:focus, input[type=number]:focus, textarea:focus, select:focus { border-color: var(--accent); }
textarea { resize: vertical; min-height: 120px; font-family: 'Courier New', monospace; }

/* Buttons */
.btn { display: inline-flex; align-items: center; gap: 8px; padding: 10px 20px; border-radius: 8px; font-size: .95rem; font-weight: 500; cursor: pointer; border: none; transition: all .2s; }
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-h); }
.btn-secondary { background: #f3f4f6; color: var(--text); border: 1.5px solid var(--border); }
.btn-secondary:hover { background: #e5e7eb; }
.btn-group { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 4px; }

/* Result box */
.result-box { background: #f8faff; border: 1.5px solid #dbeafe; border-radius: 8px; padding: 14px 16px; margin-top: 16px; font-family: 'Courier New', monospace; font-size: .9rem; word-break: break-all; line-height: 1.6; position: relative; }
.result-box .copy-btn { position: absolute; top: 8px; right: 8px; font-size: .75rem; padding: 4px 10px; }

/* Range */
.range-row { display: flex; align-items: center; gap: 12px; }
.range-row input[type=range] { flex: 1; }
.range-val { min-width: 36px; text-align: right; font-weight: 600; }

/* Checkboxes */
.checks { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 4px; }
.check-item { display: flex; align-items: center; gap: 6px; font-size: .9rem; cursor: pointer; }
.check-item input { width: 16px; height: 16px; cursor: pointer; accent-color: var(--accent); }

/* Color preview */
.color-preview { width: 100%; height: 80px; border-radius: 8px; border: 1.5px solid var(--border); margin: 12px 0; transition: background .2s; }

/* QR output */
#qr-output { display: flex; justify-content: center; margin-top: 16px; }
#qr-output canvas { border-radius: 8px; border: 1.5px solid var(--border); }

/* Hash results */
.hash-list { display: flex; flex-direction: column; gap: 10px; }
.hash-item { background: #f8faff; border: 1.5px solid #dbeafe; border-radius: 8px; padding: 12px 14px; }
.hash-item .hash-label { font-size: .75rem; font-weight: 600; color: var(--muted); text-transform: uppercase; margin-bottom: 4px; }
.hash-item .hash-val { font-family: 'Courier New', monospace; font-size: .82rem; word-break: break-all; }

/* Badge copied */
.copied-badge { position: fixed; bottom: 24px; right: 24px; background: #22c55e; color: #fff; padding: 10px 20px; border-radius: 8px; font-size: .9rem; font-weight: 500; opacity: 0; transition: opacity .3s; pointer-events: none; z-index: 9999; }
.copied-badge.show { opacity: 1; }

/* Toast */
.toast { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); background: #1e293b; color: #fff; padding: 12px 24px; border-radius: 8px; font-size: .9rem; opacity: 0; transition: opacity .3s; pointer-events: none; z-index: 9999; }
.toast.show { opacity: 1; }

/* Footer */
.footer { border-top: 1px solid var(--border); background: #fff; padding: 24px; text-align: center; font-size: .85rem; color: var(--muted); }

/* Hidden */
.hidden { display: none !important; }

@media (max-width: 600px) {
  .hero h1 { font-size: 1.5rem; }
  .grid { grid-template-columns: 1fr 1fr; gap: 12px; padding: 0 12px 32px; }
  .card { padding: 14px; }
  .card-icon { font-size: 1.5rem; }
  .nav-links { display: none; }
}
