:root {
    --primary: #4f46e5;
    /* 现代蓝紫色 */
    --primary-hover: #4338ca;
    --bg-color: #f3f4f6;
    --card-bg: #ffffff;
    --text-main: #1f2937;
    --text-muted: #6b7280;
    --border: #e5e7eb;
    --success: #10b981;
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background: var(--bg-color);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
    color: var(--text-main);
}

.container {
    background: var(--card-bg);
    width: 100%;
    max-width: 500px;
    border-radius: 20px;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
    padding: 30px;
    transition: all 0.3s ease;
}

h1 {
    text-align: center;
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 20px;
    color: var(--text-main);
}

/* --- Hero Password Section --- */
.hero-password-container {
    background: #f9fafb;
    border: 2px solid var(--border);
    border-radius: 12px;
    padding: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    position: relative;
    transition: border-color 0.2s;
}

.hero-password-container:hover {
    border-color: var(--primary);
}

.password-display {
    font-family: 'SF Mono', 'Roboto Mono', monospace;
    font-size: 1.4rem;
    font-weight: 600;
    color: var(--text-main);
    word-break: break-all;
    flex: 1;
    margin-right: 10px;
}

.action-buttons {
    display: flex;
    gap: 8px;
}

.icon-btn {
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 8px;
    border-radius: 8px;
    color: var(--text-muted);
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.icon-btn:hover {
    background: #e0e7ff;
    color: var(--primary);
}

.status-msg {
    text-align: center;
    height: 20px;
    font-size: 0.85rem;
    color: var(--success);
    margin-bottom: 20px;
    opacity: 0;
    transition: opacity 0.3s;
}

.status-msg.show {
    opacity: 1;
}

/* --- Settings Panel --- */
.settings-panel {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.setting-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 500;
}

/* Range Slider Styling */
.range-container {
    flex: 1;
    margin-left: 15px;
    display: flex;
    align-items: center;
}

input[type=range] {
    width: 100%;
    cursor: pointer;
    accent-color: var(--primary);
}

/* Custom Checkbox Grid */
.checkbox-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.checkbox-item {
    display: flex;
    align-items: center;
    cursor: pointer;
    font-size: 0.9rem;
    color: var(--text-muted);
    user-select: none;
}

.checkbox-item input {
    display: none;
    /* Hide default checkbox */
}

.checkmark {
    width: 20px;
    height: 20px;
    background-color: #f3f4f6;
    border: 2px solid var(--border);
    border-radius: 5px;
    margin-right: 10px;
    position: relative;
    transition: all 0.2s;
}

.checkbox-item input:checked+.checkmark {
    background-color: var(--primary);
    border-color: var(--primary);
}

.checkbox-item input:checked+.checkmark::after {
    content: "";
    position: absolute;
    left: 6px;
    top: 2px;
    width: 4px;
    height: 10px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.small-input {
    width: 60px;
    padding: 5px;
    border: 1px solid var(--border);
    border-radius: 6px;
    text-align: center;
}

/* Generate Button */
.generate-btn {
    width: 100%;
    padding: 14px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.1s, background-color 0.2s;
    box-shadow: 0 4px 6px -1px rgba(79, 70, 229, 0.2);
}

.generate-btn:hover {
    background-color: var(--primary-hover);
    transform: translateY(-1px);
}

.generate-btn:active {
    transform: translateY(0);
}

/* --- Batch Output --- */
.batch-output {
    margin-top: 30px;
    border-top: 1px solid var(--border);
    padding-top: 20px;
}

.batch-output h3 {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.password-list {
    max-height: 200px;
    overflow-y: auto;
}

.password-item {
    padding: 8px 12px;
    font-family: 'SF Mono', 'Roboto Mono', monospace;
    font-size: 0.9rem;
    color: var(--text-main);
    border-bottom: 1px solid #f3f4f6;
    cursor: pointer;
    transition: background 0.2s;
}

.password-item:hover {
    background: #f9fafb;
    color: var(--primary);
}

/* Tooltip for ambiguous chars */
.tooltip-container {
    position: relative;
}

.tooltip {
    visibility: hidden;
    background-color: #333;
    color: #fff;
    text-align: center;
    border-radius: 6px;
    padding: 5px 10px;
    position: absolute;
    z-index: 1;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    font-size: 0.75rem;
    white-space: nowrap;
    opacity: 0;
    transition: opacity 0.3s;
}

.tooltip-container:hover .tooltip {
    visibility: visible;
    opacity: 1;
}