* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
    --nw-bg: #f8f9fa;
    --nw-white: #ffffff;
    --nw-primary: #0066cc;
    --nw-primary-dark: #004999;
    --nw-text: #333333;
    --nw-text2: #666666;
    --nw-muted: #999999;
    --nw-border: #dee2e6;
    --nw-green: #28a745;
    --nw-yellow: #ffc107;
    --nw-red: #dc3545;
    --nw-radius: 8px;
}

body.nw-body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--nw-bg);
    color: var(--nw-text);
    min-height: 100vh;
}

/* Nav */
.nw-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--nw-primary);
    padding: 0 2rem;
    height: 52px;
}

.nw-brand {
    color: white;
    font-size: 1.2rem;
    font-weight: 700;
}

.nw-links {
    display: flex;
    gap: 0.5rem;
}

.nw-links a {
    color: rgba(255,255,255,0.8);
    text-decoration: none;
    padding: 0.4rem 0.8rem;
    border-radius: var(--nw-radius);
    font-size: 0.9rem;
    transition: all 0.2s;
}

.nw-links a:hover, .nw-links a.active {
    background: rgba(255,255,255,0.15);
    color: white;
}

/* Main */
.nw-main {
    max-width: 800px;
    margin: 0 auto;
    padding: 2rem;
}

.nw-main h1 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

.nw-main > p {
    color: var(--nw-text2);
    margin-bottom: 1.5rem;
}

/* Hero */
.nw-hero {
    text-align: center;
    padding: 2rem 0 1rem;
}

.nw-hero h1 {
    font-size: 2rem;
    color: var(--nw-primary);
}

.nw-hero p {
    font-size: 1.1rem;
    color: var(--nw-text2);
}

/* Tool cards */
.nw-tools {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin: 2rem 0;
}

.nw-tool-card {
    background: var(--nw-white);
    border: 1px solid var(--nw-border);
    border-radius: var(--nw-radius);
    padding: 1.5rem;
    text-decoration: none;
    color: var(--nw-text);
    transition: all 0.2s;
    display: block;
}

.nw-tool-card:hover {
    border-color: var(--nw-primary);
    box-shadow: 0 4px 12px rgba(0, 102, 204, 0.1);
    transform: translateY(-2px);
}

.tool-icon {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.nw-tool-card h3 {
    font-size: 1rem;
    margin-bottom: 0.3rem;
    color: var(--nw-primary);
}

.nw-tool-card p {
    font-size: 0.85rem;
    color: var(--nw-text2);
}

/* Notice */
.nw-notice {
    background: #fff3cd;
    border: 1px solid #ffc107;
    border-radius: var(--nw-radius);
    padding: 1rem 1.2rem;
    font-size: 0.9rem;
    color: #856404;
}

.nw-notice code {
    background: rgba(0,0,0,0.05);
    padding: 0.1rem 0.4rem;
    border-radius: 3px;
    font-weight: 600;
}

/* Form */
.nw-form {
    margin-bottom: 1.5rem;
}

.nw-input-group {
    display: flex;
    gap: 0.5rem;
}

.nw-input {
    flex: 1;
    padding: 0.6rem 1rem;
    border: 2px solid var(--nw-border);
    border-radius: var(--nw-radius);
    font-size: 1rem;
    font-family: inherit;
}

.nw-input:focus {
    outline: none;
    border-color: var(--nw-primary);
}

.nw-btn {
    padding: 0.6rem 1.5rem;
    background: var(--nw-primary);
    color: white;
    border: none;
    border-radius: var(--nw-radius);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

.nw-btn:hover { background: var(--nw-primary-dark); }

/* Output */
.nw-output {
    background: var(--nw-white);
    border: 1px solid var(--nw-border);
    border-radius: var(--nw-radius);
    overflow: hidden;
    margin-bottom: 1.5rem;
}

.output-header {
    background: #f1f3f5;
    padding: 0.6rem 1rem;
    font-size: 0.85rem;
    border-bottom: 1px solid var(--nw-border);
}

.output-body {
    padding: 1rem;
    font-family: 'Courier New', monospace;
    font-size: 0.85rem;
    line-height: 1.5;
    overflow-x: auto;
    white-space: pre-wrap;
    background: #1e1e1e;
    color: #d4d4d4;
}

/* Hint */
.nw-hint {
    background: #e8f4fd;
    border: 1px solid #b8daff;
    border-radius: var(--nw-radius);
    padding: 1rem 1.2rem;
    font-size: 0.9rem;
    color: #004085;
}

.nw-hint code {
    background: rgba(0,0,0,0.05);
    padding: 0.1rem 0.4rem;
    border-radius: 3px;
}

/* Help */
.help-section {
    background: var(--nw-white);
    border: 1px solid var(--nw-border);
    border-radius: var(--nw-radius);
    padding: 1.5rem;
    margin-bottom: 1rem;
}

.help-section h2 {
    font-size: 1.1rem;
    margin-bottom: 0.8rem;
    color: var(--nw-primary);
}

.help-section ul, .help-section ol {
    margin-left: 1.5rem;
}

.help-section li {
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
    line-height: 1.5;
}

.help-section code {
    background: #f1f3f5;
    padding: 0.1rem 0.4rem;
    border-radius: 3px;
    font-size: 0.85rem;
}

.help-section.hints {
    border-color: var(--nw-yellow);
    background: #fffdf0;
}

/* Footer */
.nw-footer {
    text-align: center;
    padding: 1.5rem;
    color: var(--nw-muted);
    font-size: 0.85rem;
    border-top: 1px solid var(--nw-border);
    margin-top: 2rem;
}

@media (max-width: 600px) {
    .nw-tools { grid-template-columns: 1fr; }
    .nw-input-group { flex-direction: column; }
    .nw-nav { padding: 0 1rem; }
    .nw-main { padding: 1rem; }
}
