:root {
    /* 调色盘优化：使用更深邃的科技蓝 */
    --primary-color: #2563eb;
    --primary-dark: #1d4ed8;
    --tech-green: #10b981;
    --tech-green-dark: #059669;
    --card-bg: rgba(255, 255, 255, 0.8);
    --border-radius: 16px; /* 更圆润的角 */
    --card-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.05), 0 8px 10px -6px rgba(0, 0, 0, 0.05);
    --bg-color: #f8fafc;
    --bg-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --text-color: #1a1a2e;
    --text-secondary: #64748b;
    --border-color: #e2e8f0;
    --border-focus: #2563eb;
    --font-mono: 'JetBrains Mono', 'Fira Code', 'SF Mono', Consolas, monospace;
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --spacing-unit: 1rem;
    --transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

@media (prefers-color-scheme: dark) {
    :root {
        --primary-color: #4dabf7;
        --primary-dark: #339af0;
        --tech-green: #51cf66;
        --card-bg: rgba(26, 27, 38, 0.9);
        --border-radius: 16px;
        --card-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.25), 0 8px 10px -6px rgba(0, 0, 0, 0.2);
        --bg-color: #0f0f23;
        --text-color: #e9ecef;
        --text-secondary: #adb5bd;
        --border-color: #2d3748;
        --border-focus: #4dabf7;
    }
}

* {
    box-sizing: border-box;
}

body {
    font-family: var(--font-sans);
    background: linear-gradient(135deg, var(--bg-color) 0%, #f1f5f9 100%);
    color: var(--text-color);
    margin: 0;
    padding: 0;
    line-height: 1.6;
    font-size: 16px;
    min-height: 100vh;
}

/* Background pattern */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image:
        radial-gradient(circle at 20% 80%, rgba(0, 102, 255, 0.05) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(0, 255, 136, 0.05) 0%, transparent 50%);
    pointer-events: none;
    z-index: -1;
}

/* Typography */
h1, h2, h3 {
    margin-top: 0;
    font-weight: 700;
}

h1 {
    font-size: 2.5rem;
    margin-bottom: 1.5rem;
    color: var(--text-color);
    font-weight: 700;
    line-height: 1.2;
}

h2 {
    font-size: 2rem;
    margin-bottom: 1.5rem;
    color: var(--text-color);
    font-weight: 600;
}

h3 {
    font-size: 1.25rem;
    margin-bottom: 1rem;
    color: var(--text-color);
    font-weight: 600;
}

a {
    color: var(--primary-color);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

/* Layout */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--spacing-unit);
}

/* For wider screens, use more of the available width */
@media (min-width: 1400px) {
    .container {
        max-width: 1400px;
    }
}

/* For ultra-wide screens */
@media (min-width: 1920px) {
    .container {
        max-width: 1600px;
    }
}

/* Header Styles */
header {
    background-color: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border-color);
    padding: 0.75rem 0;
    margin-bottom: 0;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03);
}

.nav-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 2rem;
    padding: 1rem 0;
}

.logo h1 {
    font-size: 1.8rem;
    margin-bottom: 0;
    background: linear-gradient(135deg, var(--primary-color), var(--tech-green));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-weight: 600;
    text-align: center;
}

.mobile-menu-toggle {
    display: none;
}

/* Scrollbar styling for mobile */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: var(--background-color);
}

::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-secondary);
}

/* Smooth scrolling */
html {
    scroll-behavior: smooth;
}

.tagline {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-top: 0.25rem;
}

nav ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    gap: 2rem;
}

nav a {
    font-weight: 500;
    color: var(--text-secondary);
    transition: var(--transition);
    position: relative;
}

nav a:hover,
nav a.active {
    color: var(--primary-color);
}

nav a.active::after {
    content: '';
    position: absolute;
    bottom: -0.5rem;
    left: 0;
    right: 0;
    height: 2px;
    background-color: var(--primary-color);
    border-radius: 1px;
}

/* Dropdown Navigation */
nav ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

nav > ul > li {
    position: relative;
}

nav > ul > li > a {
    font-weight: 500;
    color: var(--text-secondary);
    transition: var(--transition);
    position: relative;
    padding: 0.5rem 0.75rem;
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

nav > ul > li > a:hover,
nav > ul > li > a.active {
    background-color: var(--primary-color);
    color: white;
    font-weight: 500;
    position: relative;
}

nav > ul > li > a.active::after {
    content: '';
    position: absolute;
    bottom: -0.5rem;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--tech-green), var(--primary-color));
    border-radius: 2px;
}

nav > ul > li > a:hover:not(.active) {
    background-color: rgba(0, 102, 255, 0.1);
    color: var(--primary-color);
}

/* Special styling for dropdown trigger when active */
nav > ul > li > a.active .dropdown-arrow {
    border-top-color: white;
    transform: rotate(180deg);
}

/* Dropdown Arrow */
.dropdown-arrow {
    display: inline-block;
    width: 0;
    height: 0;
    border-left: 4px solid transparent;
    border-right: 4px solid transparent;
    border-top: 4px solid currentColor;
    margin-left: 4px;
    transition: transform 0.3s ease;
}

nav > ul > li:hover .dropdown-arrow {
    transform: rotate(180deg);
}

/* Dropdown Menu */
.dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    background-color: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 0.5rem;
    min-width: 280px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1000;
    margin-top: 0.75rem;
    backdrop-filter: blur(10px);
}

nav > ul > li:hover .dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown::before {
    content: '';
    position: absolute;
    top: -6px;
    left: 24px;
    width: 12px;
    height: 12px;
    background-color: var(--card-bg);
    border: 1px solid var(--border-color);
    border-bottom: none;
    border-right: none;
    transform: rotate(45deg);
    z-index: -1;
}

.dropdown-item {
    margin: 0;
    padding: 0.25rem;
    border-radius: 12px;
}

.dropdown-item:not(:last-child) {
    margin-bottom: 0.25rem;
}

.dropdown-category {
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    padding: 0.5rem 1rem 0.25rem 1rem;
    background: linear-gradient(135deg, rgba(0, 102, 255, 0.05), rgba(0, 255, 136, 0.05));
    border-radius: 8px;
    margin: 0 0 0.25rem 0;
    border: 1px solid rgba(0, 102, 255, 0.1);
}

.dropdown a {
    display: block;
    padding: 0.875rem 1rem;
    color: var(--text-color);
    text-decoration: none;
    border-radius: 10px;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    font-weight: 500;
    margin: 0;
    position: relative;
    background-color: transparent;
    border: 1px solid transparent;
    overflow: hidden;
}

.dropdown a::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.1), transparent);
    transition: left 0.4s ease;
}

.dropdown a:hover::before {
    left: 100%;
}

.dropdown a:hover,
.dropdown a:focus {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: white;
    outline: none;
    transform: translateX(4px);
    box-shadow: 0 4px 15px rgba(0, 102, 255, 0.3);
    border-color: var(--primary-color);
}

.dropdown a.active {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: white;
    font-weight: 600;
    box-shadow: 0 4px 15px rgba(0, 102, 255, 0.3);
    border-color: var(--primary-color);
}

.dropdown a:focus-visible {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

.dropdown-description {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-top: 0.375rem;
    line-height: 1.4;
    opacity: 0.9;
    font-weight: 400;
}

.dropdown a:hover .dropdown-description,
.dropdown a:focus .dropdown-description {
    color: rgba(255, 255, 255, 0.95);
    opacity: 1;
}


/* Hero Section */
.hero-section {
    text-align: center;
    padding: 4rem 0 3rem 0;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--tech-green) 100%);
    color: white;
    margin: -2rem -2rem 2rem -2rem;
    border-radius: 0 0 30px 30px;
}

.hero-content {
    max-width: 800px;
    margin: 0 auto;
    padding: 0 2rem;
}

.hero-title {
    font-size: 3rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    line-height: 1.2;
    background: linear-gradient(135deg, #ffffff 0%, #e0e7ff 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-subtitle {
    font-size: 1.25rem;
    line-height: 1.6;
    margin-bottom: 3rem;
    opacity: 0.95;
    font-weight: 400;
}

.hero-stats {
    display: flex;
    justify-content: center;
    gap: 3rem;
    flex-wrap: wrap;
}

.stat-item {
    text-align: center;
    min-width: 120px;
}

.stat-number {
    font-size: 2.5rem;
    font-weight: 700;
    line-height: 1;
    margin-bottom: 0.5rem;
    background: linear-gradient(135deg, #ffffff 0%, #e0e7ff 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.stat-label {
    font-size: 0.9rem;
    opacity: 0.9;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 500;
}

/* Section Titles */
.section-title {
    font-size: 2rem;
    text-align: center;
    margin-bottom: 3rem;
    color: var(--text-color);
    position: relative;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: -0.75rem;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 3px;
    background: linear-gradient(135deg, var(--primary-color), var(--tech-green));
    border-radius: 2px;
}

/* 玻璃拟态效果 */
.converter-box {
    background: var(--card-bg);
    backdrop-filter: blur(12px); /* 磨砂玻璃感 */
    border: 1px solid rgba(255, 255, 255, 0.3);
    padding: 2rem;
    border-radius: var(--border-radius);
    box-shadow: var(--card-shadow);
    margin-bottom: 2rem;
    transition: var(--transition);
}

.converter-box:hover {
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}

/* 桌面端左右并排布局 */
@media (min-width: 992px) {
    .converter-grid {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 2rem;
        align-items: start;
    }
}

.converter-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2.5rem;
}

.converter-header h3 {
    margin-bottom: 0;
    font-size: 1.5rem;
}

.quick-actions {
    display: flex;
    gap: 0.5rem;
}

.btn-icon {
    padding: 0.5rem;
    font-size: 1.25rem;
    min-width: auto;
}

/* Base Selector Row */
.base-selector-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1.5rem;
    margin-bottom: 2.5rem;
    padding: 1.5rem;
    background: linear-gradient(135deg, rgba(0, 102, 255, 0.05), rgba(0, 255, 136, 0.05));
    border-radius: var(--border-radius);
    border: 1px solid rgba(0, 102, 255, 0.1);
    flex-wrap: wrap;
}

.base-selector {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

.base-selector label {
    font-weight: 600;
    color: var(--text-color);
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0;
}

.base-select {
    padding: 0.75rem 1rem;
    border: 2px solid var(--border-color);
    border-radius: var(--border-radius);
    background-color: var(--card-bg);
    color: var(--text-color);
    font-family: var(--font-mono);
    font-size: 1rem;
    min-width: 180px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.base-select:hover {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(0, 102, 255, 0.1);
}

.base-select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(0, 102, 255, 0.2);
}

.swap-bases {
    display: flex;
    align-items: center;
    justify-content: center;
}

.swap-bases .btn-icon {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: white;
    border: none;
    border-radius: 50%;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    transform: rotate(0deg);
}

.swap-bases .btn-icon:hover {
    transform: rotate(180deg);
    box-shadow: 0 4px 15px rgba(0, 102, 255, 0.4);
}

/* Digit Count Style */
.digit-count {
    background: linear-gradient(135deg, var(--tech-green), var(--tech-green-dark));
    color: white;
    padding: 0.25rem 0.5rem;
    border-radius: 12px;
    font-weight: 600;
    font-size: 0.8rem;
}

/* Example Conversion Grid */
.conversion-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.25rem;
    margin-top: 0.5rem;
    font-family: var(--font-mono);
    font-size: 0.8rem;
}

.conversion-grid small {
    color: var(--text-secondary);
    background: rgba(0, 102, 255, 0.05);
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    display: block;
    border-left: 3px solid var(--primary-color);
}


.history-actions {
    margin-left: 1rem;
}

/* Button Small Variant */
.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    min-width: auto;
}

/* Quick Conversion Shortcuts */
.quick-shortcuts {
    margin-bottom: 2rem;
    padding: 1.5rem;
    background: linear-gradient(135deg, rgba(0, 255, 136, 0.08), rgba(0, 102, 255, 0.08));
    border-radius: var(--border-radius);
    border: 1px solid rgba(0, 102, 255, 0.15);
}

.quick-shortcuts h4 {
    margin: 0 0 1rem 0;
    color: var(--text-color);
    font-size: 1rem;
    font-weight: 600;
    text-align: center;
}

.shortcut-buttons {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 0.75rem;
}

.btn-shortcut {
    padding: 0.75rem 1rem;
    background: var(--card-bg);
    border: 2px solid var(--border-color);
    border-radius: var(--border-radius);
    color: var(--text-color);
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: center;
    font-family: var(--font-sans);
}

.btn-shortcut:hover {
    border-color: var(--primary-color);
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0, 102, 255, 0.3);
}

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

.btn-shortcut.active {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: white;
    border-color: var(--primary-color);
    box-shadow: 0 4px 15px rgba(0, 102, 255, 0.3);
}

/* Preview Section */
.preview-section {
    margin-top: 1rem;
}

.preview-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--border-color);
}

.preview-header h4 {
    margin: 0;
    color: var(--text-color);
    font-size: 1rem;
    font-weight: 600;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.preview-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 0.75rem;
}

.preview-item {
    background: linear-gradient(135deg, rgba(0, 102, 255, 0.05), rgba(0, 255, 136, 0.05));
    border: 1px solid rgba(0, 102, 255, 0.15);
    border-radius: 6px;
    padding: 0.75rem;
    transition: all 0.2s ease;
}

.preview-item:hover {
    box-shadow: 0 4px 15px rgba(0, 102, 255, 0.1);
    transform: translateY(-2px);
}

.preview-base {
    font-weight: 600;
    color: var(--primary-color);
    font-size: 0.8rem;
    margin-bottom: 0.4rem;
}

.preview-value {
    font-family: var(--font-mono);
    font-size: 0.9rem;
    color: var(--text-color);
    word-break: break-all;
    background: rgba(255, 255, 255, 0.8);
    padding: 0.4rem;
    border-radius: 4px;
    border: 1px solid rgba(0, 102, 255, 0.2);
    cursor: pointer;
    transition: all 0.2s ease;
    line-height: 1.3;
}

.preview-value:hover {
    background: rgba(0, 102, 255, 0.1);
}

/* Optimized Input/Output Groups */
.input-group {
    margin-bottom: 1rem;
}

.base-converter .input-wrapper textarea {
    min-height: 60px;
    max-height: 120px;
    font-family: var(--font-mono);
    font-size: 1rem;
    padding: 0.5rem;
    border: 2px solid var(--border-color);
    border-radius: var(--border-radius);
    background-color: var(--card-bg);
    color: var(--text-color);
    resize: vertical;
    transition: all 0.2s ease;
    line-height: 1.4;
}

.base-converter .input-wrapper textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(0, 102, 255, 0.2);
}

.base-converter .input-wrapper textarea[readonly] {
    background-color: rgba(0, 102, 255, 0.05);
    cursor: default;
}

.base-converter .input-wrapper textarea[readonly]:hover {
    background-color: rgba(0, 102, 255, 0.08);
}

.label-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.label-icon {
    margin-right: 0.5rem;
    font-size: 1.125rem;
}

.stats-container {
    display: flex;
    gap: 1rem;
    font-size: 0.875rem;
    color: var(--text-secondary);
    font-family: var(--font-mono);
}

.input-wrapper {
    position: relative;
}

.input-overlay {
    position: absolute;
    top: 1rem;
    right: 1rem;
    opacity: 0.5;
    pointer-events: none;
    transition: var(--transition);
}

.example-text {
    font-size: 0.875rem;
    color: var(--text-secondary);
    cursor: pointer;
}

.input-actions,
.output-actions {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
    margin-top: 1rem;
    align-items: center;
}

label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
}

.label-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.char-count {
    font-size: 0.875rem;
    color: #6c757d;
    font-weight: normal;
    font-family: var(--font-mono);
}

textarea {
    border: 1px solid #e2e8f0;
    background-color: #f8fafc;
    border-radius: 12px;
    padding: 1.25rem;
    font-family: var(--font-mono);
    line-height: 1.6;
    transition: all 0.2s ease;
    width: 100%;
    min-height: 150px;
    font-size: 1rem;
    color: var(--text-color);
    resize: vertical;
}

textarea:focus {
    background-color: #ffffff;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.1);
    outline: none;
}

textarea:valid {
    border-color: #28a745;
}

textarea:not(:placeholder-shown) {
    background-color: #f8fafc;
}

textarea.error {
    border-color: #dc3545;
}

/* 输出框背景略微变暗以示区分 */
textarea[readonly] {
    background-color: #f1f5f9;
    color: #475569;
    cursor: default;
    opacity: 0.9;
}

textarea[readonly]:focus {
    border-color: var(--border-color);
    box-shadow: none;
}

/* Drag and Drop Styles */
.drag-over {
    border-color: var(--primary-color) !important;
    border-width: 2px !important;
    border-style: dashed !important;
    background-color: rgba(13, 110, 253, 0.05) !important;
}

.drag-over-textarea {
    position: relative;
}

.drag-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(13, 110, 253, 0.1);
    border: 2px dashed var(--primary-color);
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--primary-color);
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s;
    z-index: 10;
}

.drag-overlay.show {
    opacity: 1;
}

.error-msg {
    color: #dc3545;
    font-size: 0.875rem;
    margin-top: 0.25rem;
    display: none;
}

.conversion-indicator {
    background: linear-gradient(135deg, var(--primary-color), #0056b3);
    color: white;
    padding: 0.75rem 1rem;
    border-radius: 8px;
    text-align: center;
    font-weight: 600;
    font-size: 0.95rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.controls {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

/* Button Styles */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1.25rem;
    font-size: 0.875rem;
    font-weight: 500;
    border-radius: var(--border-radius);
    border: 1px solid var(--border-color);
    cursor: pointer;
    transition: var(--transition);
    background-color: var(--card-bg);
    color: var(--text-color);
    text-decoration: none;
    font-family: var(--font-sans);
    position: relative;
    overflow: hidden;
    height: 44px;
    box-sizing: border-box;
}

.btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left 0.5s;
}

.btn:hover::before {
    left: 100%;
}

.btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 102, 255, 0.2);
    border-color: var(--primary-color);
    background-color: var(--bg-color);
}

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

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: white;
    border-color: var(--primary-color);
}

.btn-primary:hover {
    box-shadow: 0 6px 20px rgba(0, 102, 255, 0.3);
}

.btn-success {
    background: linear-gradient(135deg, var(--tech-green), var(--tech-green-dark));
    color: var(--text-color);
    border-color: var(--tech-green);
}

.btn-success:hover {
    box-shadow: 0 6px 20px rgba(0, 255, 136, 0.3);
}

.btn-example {
    background: linear-gradient(135deg, var(--primary-color), var(--tech-green));
    color: white;
    border: none;
    font-weight: 600;
}

.btn-upload {
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin: 0;
    padding: 0.75rem 1.25rem;
}

.btn-copy,
.btn-paste {
    background-color: var(--bg-color);
}

.btn-clear {
    background-color: var(--bg-color);
    color: var(--text-color);
    border-color: var(--border-color);
}

.btn-clear:hover {
    background-color: var(--bg-color);
    border-color: var(--primary-color);
}

.btn-icon {
    padding: 0.5rem;
    border-radius: 50%;
    min-width: auto;
    background-color: var(--bg-color);
}

.btn-icon:hover {
    background-color: var(--bg-color);
    color: var(--text-color);
}

.btn-primary {
    background-color: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background-color: #0b5ed7;
}

.btn-success {
    background-color: #198754 !important;
    color: white !important;
    border-color: #198754 !important;
}

.btn-sm {
    padding: 0.375rem 0.75rem;
    font-size: 0.875rem;
}

/* Features Section */
.features-section {
    background-color: rgba(255, 255, 255, 0.5);
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    padding: 2rem;
}

.feature-card {
    background-color: var(--card-bg);
    padding: 2rem;
    border-radius: var(--border-radius);
    box-shadow: var(--card-shadow);
    text-align: center;
    transition: var(--transition);
    border: 1px solid var(--border-color);
}

.feature-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 25px rgba(0, 0, 0, 0.1);
}

.feature-icon {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    display: block;
}

.feature-card h3 {
    margin-bottom: 0.75rem;
    color: var(--text-color);
}

.feature-card p {
    color: var(--text-secondary);
    line-height: 1.6;
}

/* How to Use Section */
.how-to-section {
    background-color: var(--bg-color);
}

.steps-container {
    max-width: 100%;
    margin: 0 auto;
    padding: 2rem;
}

.step-item {
    display: flex;
    gap: 2rem;
    margin-bottom: 3rem;
    align-items: flex-start;
    padding: 1.5rem;
    border-radius: var(--border-radius);
    background-color: var(--card-bg);
    border: 1px solid var(--border-color);
    box-shadow: var(--card-shadow);
    transition: var(--transition);
}

.step-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
}

.step-number {
    background: linear-gradient(135deg, var(--primary-color), var(--tech-green));
    color: white;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    font-weight: 700;
    flex-shrink: 0;
}

.step-content h3 {
    margin-bottom: 0.5rem;
    color: var(--primary-color);
}

.step-content p {
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 1rem;
}

.step-content ul {
    margin: 0.5rem 0;
    padding-left: 1.5rem;
}

.step-content li {
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
    line-height: 1.5;
}

.step-content strong {
    color: var(--primary-color);
    font-weight: 600;
}

/* Quick Tips Styles */
.quick-tips {
    margin-top: 2rem;
    padding: 2rem;
    background-color: rgba(0, 102, 255, 0.05);
    border-radius: var(--border-radius);
    border-left: 4px solid var(--primary-color);
}

.quick-tips h4 {
    color: var(--primary-color);
    margin-bottom: 1rem;
    font-size: 1.1rem;
}

.tips-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1rem;
}

.tip-item {
    background-color: var(--card-bg);
    padding: 1rem;
    border-radius: var(--border-radius);
    border: 1px solid var(--border-color);
    transition: var(--transition);
    cursor: pointer;
}

.tip-item:hover {
    border-color: var(--primary-color);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.tip-item strong {
    color: var(--primary-color);
    display: block;
    margin-bottom: 0.25rem;
}

/* Collapsible Sections */
.collapsible-section {
    margin-top: 2rem;
    border-radius: var(--border-radius);
    overflow: hidden;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 2rem;
    background: linear-gradient(135deg, var(--primary-color), var(--tech-green));
    color: white;
    cursor: pointer;
    user-select: none;
    transition: all 0.3s ease;
    border-radius: var(--border-radius);
    position: relative;
    overflow: hidden;
}

.section-header:focus {
    outline: 2px solid white;
    outline-offset: 2px;
}

.section-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left 0.5s ease;
}

.section-header:hover::before {
    left: 100%;
}

.section-header:hover {
    background: linear-gradient(135deg, var(--primary-dark), var(--tech-green-dark));
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(37, 99, 235, 0.2);
}

.section-header:hover .section-title {
    color: white;
}

.section-header .section-title {
    color: white;
    margin: 0;
    font-size: 1.5rem;
    font-weight: 600;
}

.section-toggle {
    font-size: 1.2rem;
    font-weight: bold;
    transition: transform 0.3s ease;
    display: inline-block;
}

.section-content {
    overflow: hidden;
    transition: max-height 0.3s ease-out;
    background-color: var(--card-bg);
    border: 1px solid var(--border-color);
    border-top: none;
}

.collapsible-section.expanded .section-header {
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
}

/* Examples Section */
.examples-section {
    background-color: rgba(255, 255, 255, 0.5);
}

.examples-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    padding: 2rem;
}

.example-item {
    background-color: var(--card-bg);
    padding: 2rem;
    border-radius: var(--border-radius);
    box-shadow: var(--card-shadow);
    border: 1px solid var(--border-color);
    transition: var(--transition);
}

.example-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
}

.example-preview,
.example-code {
    margin-bottom: 1rem;
}

.example-type {
    font-weight: 600;
    color: var(--primary-color);
    margin-right: 0.5rem;
}

.example-code code {
    font-family: var(--font-mono);
    font-size: 0.875rem;
    color: var(--text-secondary);
    word-break: break-all;
}

.example-preview small {
    display: block;
    color: var(--text-secondary);
    font-size: 0.75rem;
    margin-top: 0.25rem;
    font-style: italic;
}

.example-type {
    font-weight: 600;
    color: var(--primary-color);
}

/* FAQ Section */
.faq-section {
    background-color: var(--bg-color);
    margin-top: 2rem;
}

.faq-section .section-content {
    padding: 2rem 0;
}

.faq-section .section-content[style*="max-height: 0px"] {
    padding: 0;
}

.faq-container {
    max-width: 100%;
    margin: 0 auto;
    padding: 0 var(--spacing-unit);
}

.faq-item {
    background-color: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    margin-bottom: 1rem;
    overflow: hidden;
}

.faq-question {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    cursor: pointer;
    transition: var(--transition);
}

.faq-question:hover {
    background-color: rgba(0, 102, 255, 0.05);
}

.faq-question h3 {
    margin-bottom: 0;
    color: var(--text-color);
}

.faq-toggle {
    font-size: 1.5rem;
    color: var(--primary-color);
    transition: var(--transition);
}

.faq-answer {
    padding: 0 1.5rem;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-out;
}

.faq-answer p {
    padding-bottom: 1.5rem;
    color: var(--text-secondary);
    line-height: 1.6;
}

.faq-item.active .faq-answer {
    /* Height will be set dynamically by JavaScript */
}

.faq-item.active .faq-toggle {
    transform: rotate(45deg);
}

/* Educational Section */
.educational-section {
    background-color: rgba(255, 255, 255, 0.5);
}

.educational-content {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 4rem;
    align-items: start;
    padding: 2rem;
}

.edu-text h3 {
    color: var(--primary-color);
    margin-top: 2rem;
    margin-bottom: 1rem;
    padding-left: 1rem;
}

.edu-text p {
    color: var(--text-secondary);
    line-height: 1.6;
    padding-left: 1rem;
}

.edu-visual {
    position: sticky;
    top: 2rem;
}

.binary-table {
    background-color: var(--card-bg);
    padding: 1.5rem;
    border-radius: var(--border-radius);
    box-shadow: var(--card-shadow);
    border: 1px solid var(--border-color);
}

.binary-table h4 {
    margin-bottom: 1rem;
    color: var(--text-color);
}

.binary-table table {
    width: 100%;
    border-collapse: collapse;
}

.binary-table th,
.binary-table td {
    padding: 0.75rem;
    text-align: center;
    border-bottom: 1px solid var(--border-color);
}

.binary-table th {
    background-color: rgba(0, 102, 255, 0.1);
    color: var(--primary-color);
    font-weight: 600;
}

.binary-table td {
    font-family: var(--font-mono);
    color: var(--text-secondary);
}

/* Utilities */
.text-mono {
    font-family: var(--font-mono);
}

/* Modal Styles */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    animation: fadeIn 0.3s ease-out;
    padding: 1rem;
}


@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal-content {
    background-color: var(--card-bg);
    border-radius: 16px;
    width: 100%;
    max-width: 900px;
    max-height: 85vh;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: slideUp 0.4s cubic-bezier(0.2, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(50px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(100%);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideOutRight {
    from {
        opacity: 1;
        transform: translateX(0);
    }
    to {
        opacity: 0;
        transform: translateX(100%);
    }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 2rem;
    border-bottom: 1px solid var(--border-color);
    background: linear-gradient(to bottom, var(--card-bg), rgba(var(--card-bg-rgb, 255, 255, 255), 0.95));
    position: sticky;
    top: 0;
    z-index: 10;
}

.modal-header h2 {
    margin: 0;
    color: var(--text-color);
    font-size: 1.5rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.modal-header h2::before {
    content: "📜";
    font-size: 1.5rem;
}

.modal-header-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-secondary);
    padding: 0.5rem;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s;
    flex-shrink: 0;
}

.modal-close:hover {
    background-color: var(--bg-hover);
    color: var(--text-color);
    transform: rotate(90deg);
}

.modal-body {
    padding: 0;
    overflow-y: auto;
    flex: 1;
    scrollbar-width: thin;
    scrollbar-color: var(--border-color) transparent;
}

.modal-body::-webkit-scrollbar {
    width: 6px;
}

.modal-body::-webkit-scrollbar-track {
    background: transparent;
}

.modal-body::-webkit-scrollbar-thumb {
    background-color: var(--border-color);
    border-radius: 3px;
}

.modal-body::-webkit-scrollbar-thumb:hover {
    background-color: var(--text-secondary);
}

/* History List */
.history-list {
    padding: 1.5rem 2rem 2rem;
    max-width: 800px;
    margin: 0 auto;
}

/* History Item Styles - New Layout */
.history-item {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1.25rem;
    margin-bottom: 1rem;
    cursor: pointer;
    transition: all 0.2s;
}

.history-item:hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
    border-color: var(--primary-color);
    transform: translateY(-2px);
}

/* 第一行：进制转换类型 */
.history-conversion-type {
    font-size: 1rem;
    font-weight: 600;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.history-conversion-type::before {
    content: "🔄";
    font-size: 1.1rem;
}

/* 第二行：时间日期 */
.history-item-time {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.history-item-time::before {
    content: "🕐";
}

/* 第三行：输入 */
.history-input-section {
    margin-bottom: 0.75rem;
}

.history-input-label {
    font-size: 0.75rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.25rem;
    font-weight: 600;
}

.history-input-content {
    background: var(--bg-color);
    padding: 0.75rem;
    border-radius: 8px;
    font-family: var(--font-mono);
    font-size: 0.875rem;
    line-height: 1.4;
    color: var(--text-color);
    word-break: break-word;
}

/* 第四行：输出 */
.history-output-section {
    margin-bottom: 0;
}

.history-output-label {
    font-size: 0.75rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.25rem;
    font-weight: 600;
}

.history-output-content {
    background: rgba(13, 110, 253, 0.05);
    border: 1px solid rgba(13, 110, 253, 0.2);
    padding: 0.75rem;
    border-radius: 8px;
    font-family: var(--font-mono);
    font-size: 0.875rem;
    line-height: 1.4;
    color: var(--primary-color);
    word-break: break-word;
}

/* Empty State */
.no-history {
    text-align: center;
    color: var(--text-secondary);
    padding: 4rem 2rem;
    margin: 0;
    font-size: 1.125rem;
    line-height: 1.6;
}

.no-history::before {
    content: "📝";
    display: block;
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

/* History Stats Bar */
.history-stats {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 2rem;
    background: var(--bg-color);
    border-top: 1px solid var(--border-color);
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.history-stats-left {
    display: flex;
    gap: 2rem;
}

.history-stat {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.history-stat-value {
    font-weight: 600;
    color: var(--text-color);
}

/* Search Bar */
.history-search {
    padding: 1rem 2rem 0;
    position: sticky;
    top: 0;
    background: var(--card-bg);
    z-index: 5;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
}

.search-input {
    width: 100%;
    padding: 0.75rem 1rem 0.75rem 2.5rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 0.9rem;
    background: var(--bg-color);
    color: var(--text-color);
    transition: all 0.2s;
    position: relative;
}

.search-wrapper {
    position: relative;
}

.search-wrapper::before {
    content: "🔍";
    position: absolute;
    left: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1rem;
    opacity: 0.5;
}

.search-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(13, 110, 253, 0.1);
    background: white;
}

.btn-danger {
    background-color: #dc3545 !important;
    color: white !important;
    border-color: #dc3545 !important;
}

.btn-danger:hover {
    background-color: #c82333 !important;
}

.no-history {
    text-align: center;
    color: #6c757d;
    padding: 2rem;
    margin: 0;
}

/* Responsive Design */
@media (max-width: 768px) {
    .hero-section {
        padding: 3rem 0 2rem 0;
        margin: -2rem -1rem 2rem -1rem;
        border-radius: 0 0 20px 20px;
    }

    .hero-title {
        font-size: 2rem;
        margin-bottom: 1rem;
    }

    .hero-subtitle {
        font-size: 1rem;
        margin-bottom: 2rem;
        line-height: 1.5;
    }

    .hero-stats {
        gap: 2rem;
    }

    .stat-item {
        min-width: 80px;
    }

    .stat-number {
        font-size: 2rem;
    }

    .stat-label {
        font-size: 0.8rem;
    }

    .nav-wrapper {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        padding: 0.5rem 0;
    }

    nav {
        position: relative;
    }

    .mobile-menu-toggle {
        display: block;
        background: none;
        border: none;
        font-size: 1.5rem;
        cursor: pointer;
        padding: 0.5rem;
        border-radius: 8px;
        transition: var(--transition);
    }

    .mobile-menu-toggle:hover {
        background-color: var(--background-hover);
    }

    nav > ul {
        display: none;
        position: absolute;
        top: 100%;
        right: 0;
        background-color: var(--card-bg);
        border: 1px solid var(--border-color);
        border-radius: 12px;
        padding: 1rem;
        min-width: 280px;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
        flex-direction: column;
        gap: 0.25rem;
        z-index: 1000;
        max-height: 80vh;
        overflow-y: auto;
    }

    nav > ul.active {
        display: flex;
    }

    nav > ul > li {
        width: 100%;
        position: static;
    }

    nav > ul > li > a {
        display: block;
        padding: 0.75rem 1rem;
        border-radius: 8px;
        transition: var(--transition);
        background-color: transparent;
        font-weight: 500;
    }

    nav > ul > li > a:hover {
        background-color: var(--primary-color);
        color: white;
    }

    nav > ul > li > a.active {
        background-color: var(--primary-color);
        color: white;
        font-weight: 600;
    }

    nav > ul > li > a.active .dropdown-arrow {
        border-top-color: white;
        transform: rotate(180deg);
    }

    /* Mobile dropdown styles - IMPORTANT! */
    nav > ul > li .dropdown {
        position: static !important;
        opacity: 1 !important;
        visibility: visible !important;
        transform: none !important;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1) !important;
        border: 1px solid var(--border-color) !important;
        border-radius: 12px !important;
        padding: 0.75rem !important;
        margin: 0.5rem 0 0 0 !important;
        min-width: 100% !important;
        display: none !important;
        background-color: var(--card-bg) !important;
        z-index: 1001 !important;
        max-height: 300px !important;
        overflow-y: auto !important;
        left: 0 !important;
        right: 0 !important;
        width: 100% !important;
        box-sizing: border-box !important;
    }

    .dropdown::before {
        display: none !important;
    }

    /* Override all hover behaviors on mobile */
    nav > ul > li:hover .dropdown,
    nav ul li:hover .dropdown,
    .dropdown:hover {
        display: none !important;
    }

    /* Force display when active */
    nav > ul > li .dropdown.active,
    .dropdown.active {
        display: block !important;
        position: static !important;
        animation: slideDownMobile 0.3s ease !important;
    }

    @keyframes slideDownMobile {
        from {
            opacity: 0;
            transform: translateY(-10px);
        }
        to {
            opacity: 1;
            transform: translateY(0);
        }
    }

    /* Ensure dropdown items are visible */
    .dropdown-item {
        display: block !important;
        opacity: 1 !important;
        visibility: visible !important;
    }

    .dropdown a {
        display: block !important;
        opacity: 1 !important;
        visibility: visible !important;
    }

    .dropdown-item {
        border-bottom: none;
        border-radius: 8px;
        margin-bottom: 0.5rem;
        padding: 0.25rem;
        background: rgba(0, 0, 0, 0.02);
    }

    .dropdown-category {
        padding: 0.6rem 1rem 0.3rem 1rem;
        font-size: 0.75rem;
        border: none;
        margin: 0;
        background: linear-gradient(135deg, rgba(0, 102, 255, 0.08), rgba(0, 255, 136, 0.08));
        border-radius: 6px;
        font-weight: 700;
        color: var(--primary-color);
    }

    .dropdown a {
        padding: 0.8rem 1.25rem;
        font-size: 0.9rem;
        border-radius: 6px;
        margin: 0.2rem 0;
        border: 1px solid transparent;
        display: block;
        width: 100%;
        box-sizing: border-box;
    }

    .dropdown a:hover,
    .dropdown a:focus {
        background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
        color: white;
        transform: none;
        box-shadow: 0 2px 8px rgba(0, 102, 255, 0.3);
    }

    .dropdown a.active {
        background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
        color: white;
        font-weight: 600;
        box-shadow: 0 2px 8px rgba(0, 102, 255, 0.3);
    }

    .dropdown a:focus-visible {
        outline: 2px solid var(--primary-color);
        outline-offset: 2px;
    }

    .dropdown-description {
        display: none;
    }

    .features-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }

    .examples-grid {
        grid-template-columns: 1fr;
    }

    .educational-content {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .edu-visual {
        position: static;
    }

    .converter-header {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
        margin-bottom: 1.5rem;
    }

    .converter-box {
        padding: 1.5rem;
        border-radius: 16px;
    }

    .input-group {
        margin-bottom: 1.5rem;
    }

    .stats-container {
        flex-direction: row;
        gap: 0.75rem;
        font-size: 0.75rem;
        flex-wrap: wrap;
    }

    .input-actions,
    .output-actions {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 0.75rem;
        margin-top: 1rem;
    }

    .input-actions .btn,
    .output-actions .btn {
        font-size: 0.875rem;
        padding: 0.75rem;
        height: auto;
        min-height: 44px; /* Apple HIG minimum touch target */
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 0.5rem;
    }

    textarea {
        font-size: 16px; /* Prevent zoom on iOS */
        padding: 1rem;
        min-height: 120px;
        resize: vertical;
    }

    .label-container {
        margin-bottom: 0.75rem;
    }

    .label-text {
        font-size: 0.95rem;
    }

    .step-item {
        flex-direction: column;
        text-align: center;
        gap: 1rem;
    }

    nav ul {
        flex-wrap: wrap;
        justify-content: center;
        gap: 1rem;
    }

    .feature-card {
        padding: 1.25rem;
        text-align: center;
    }

    .feature-icon {
        font-size: 2rem;
        margin-bottom: 0.75rem;
    }

    .feature-card h3 {
        font-size: 1.1rem;
        margin-bottom: 0.5rem;
    }

    .feature-card p {
        font-size: 0.9rem;
        line-height: 1.5;
    }

    .section-title {
        font-size: 1.5rem;
        margin-bottom: 2rem;
    }

    .steps-container {
        gap: 1.5rem;
    }

    .step-item {
        padding: 1.5rem;
        border-radius: 12px;
    }

    .example-item {
        padding: 1rem;
    }

    .example-code {
        font-size: 0.8rem;
        word-break: break-all;
    }

    .faq-item {
        padding: 1rem;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 0.75rem;
    }

    .logo h1 {
        font-size: 1.2rem;
    }

    .mobile-menu-toggle {
        font-size: 1.25rem;
        padding: 0.4rem;
    }

    .features-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .converter-box {
        padding: 1rem;
    }

    .converter-header {
        margin-bottom: 1rem;
    }

    .converter-header h3 {
        font-size: 1.25rem;
    }

    .input-actions,
    .output-actions {
        grid-template-columns: 1fr;
        gap: 0.5rem;
    }

    .btn {
        font-size: 0.875rem;
        padding: 0.75rem;
        min-height: 44px;
    }

    .btn-icon {
        font-size: 1rem;
    }

    .stats-container {
        font-size: 0.7rem;
        gap: 0.5rem;
    }

    textarea {
        min-height: 100px;
        padding: 0.75rem;
    }

    .feature-card {
        padding: 1rem;
    }

    .feature-icon {
        font-size: 1.75rem;
    }

    .feature-card h3 {
        font-size: 1rem;
    }

    .feature-card p {
        font-size: 0.85rem;
    }

    .section-title {
        font-size: 1.4rem;
        margin-bottom: 1.5rem;
    }

    .step-item {
        padding: 1rem;
        gap: 0.75rem;
    }

    .step-number {
        font-size: 1.5rem;
        width: 40px;
        height: 40px;
    }

    .example-item {
        padding: 0.75rem;
    }

    .example-code code {
        font-size: 0.75rem;
        padding: 0.5rem;
    }

    .faq-item {
        padding: 0.75rem;
    }

    .faq-question h3 {
        font-size: 0.95rem;
    }

    .faq-answer {
        font-size: 0.85rem;
    }
  }

/* Landscape mobile optimizations */
@media (max-width: 768px) and (orientation: landscape) {
    .converter-box {
        padding: 1rem;
    }

    textarea {
        min-height: 80px;
    }

    .input-actions,
    .output-actions {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* Touch-friendly hover states */
@media (hover: none) and (pointer: coarse) {
    .btn:hover {
        transform: none;
    }

    .btn:active {
        transform: scale(0.95);
    }

    .feature-card:hover {
        transform: none;
    }

    nav a:hover {
        transform: none;
    }

    nav a:active {
        background-color: var(--background-hover);
    }
}

/* Loading States */
.loading {
    position: relative;
    overflow: hidden;
}

.loading::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(0, 102, 255, 0.1), transparent);
    animation: loading 1.5s infinite;
}

@keyframes loading {
    to {
        left: 100%;
    }
}

/* Toast Notification */
.toast {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    background: linear-gradient(135deg, var(--primary-color), var(--tech-green));
    color: white;
    padding: 1rem 1.5rem;
    border-radius: var(--border-radius);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
    z-index: 1000;
    animation: slideUp 0.3s ease-out;
    font-weight: 500;
}

@keyframes slideUp {
    from {
        transform: translateY(100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Footer Styles */
footer {
    background-color: var(--bg-color);
    border-top: 1px solid var(--border-color);
    margin-top: 4rem;
    padding: 3rem 0 1.5rem;
}

.footer-content {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 3rem;
    margin-bottom: 2rem;
}

.footer-section h3,
.footer-section h4 {
    color: var(--text-color);
    margin: 0 0 1rem 0;
    font-size: 1.2rem !important;
    cursor: pointer;
    transition: var(--transition);
    line-height: 1.4;
    display: flex;
    align-items: center;
    font-weight: 600;
    min-height: 1.4em;
}

.footer-section h3:hover,
.footer-section h4:hover {
    color: var(--primary-color);
}

/* Footer collapsible styles */
.footer-section {
    /* No special positioning needed */
}

.footer-section .footer-toggle {
    font-size: 1rem;
    cursor: pointer;
    color: var(--text-secondary);
    transition: var(--transition);
    user-select: none;
    margin-left: 0.5rem;
    font-weight: normal;
}

.footer-section .footer-toggle:hover {
    color: var(--primary-color);
}

.footer-section .footer-toggle-content {
    overflow: hidden;
    transition: max-height 0.3s ease-out;
}

.footer-section.collapsed .footer-toggle-content {
    max-height: 0;
}

.footer-section.expanded .footer-toggle-content {
    max-height: 2000px;
}

.footer-section.collapsed .footer-toggle {
    transform: rotate(-90deg);
}

.footer-section.expanded .footer-toggle {
    transform: rotate(0deg);
}

/* Ensure all footer headings have the same height */
.footer-section .footer-toggle-content {
    overflow: hidden;
    transition: max-height 0.3s ease-out;
}

.footer-section {
    display: flex;
    flex-direction: column;
}

.footer-section h3,
.footer-section h4 {
    height: auto !important;
    min-height: 1.4em;
    display: flex;
    align-items: center;
}

.footer-section p {
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 0;
}

.footer-section ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.footer-section ul li {
    margin-bottom: 0.5rem;
}

.footer-section ul li a {
    color: var(--text-secondary);
    text-decoration: none;
    transition: var(--transition);
}

.footer-section ul li a:hover {
    color: var(--primary-color);
    text-decoration: underline;
}

.footer-bottom {
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-color);
    text-align: center;
}

.footer-bottom p {
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
    font-size: 0.875rem;
}

@media (max-width: 768px) {
    .footer-content {
        grid-template-columns: 1fr;
        gap: 2rem;
        text-align: center;
    }

    .footer-section ul {
        text-align: center;
    }
}

/* Base Converter Mobile Responsive Styles */
@media (max-width: 768px) {
    /* Base Selector Row Mobile */
    .base-selector-row {
        flex-direction: column;
        gap: 1rem;
        padding: 1rem;
    }

    .base-selector {
        width: 100%;
    }

    .base-select {
        width: 100%;
        min-width: auto;
        font-size: 0.9rem;
        padding: 0.6rem;
        -webkit-appearance: menulist-button;
        appearance: menulist-button;
    }

    .swap-bases {
        order: -1;
    }

    .swap-bases .btn-icon {
        width: 40px;
        height: 40px;
        font-size: 1rem;
    }

    /* Quick Shortcuts Mobile */
    .quick-shortcuts {
        padding: 1rem;
        margin-bottom: 1.5rem;
    }

    .quick-shortcuts h4 {
        font-size: 0.9rem;
        margin-bottom: 0.75rem;
    }

    .shortcut-buttons {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.5rem;
    }

    .btn-shortcut {
        padding: 0.6rem 0.8rem;
        font-size: 0.8rem;
        min-height: 44px; /* Touch target size */
        display: flex;
        align-items: center;
        justify-content: center;
        text-align: center;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    /* Input Groups Mobile */
    .converter-box {
        padding: 1.5rem;
        margin-bottom: 1rem;
    }

    .input-group {
        margin-bottom: 1rem;
    }

    .base-converter .input-wrapper textarea {
        min-height: 50px;
        max-height: 100px;
        padding: 0.6rem;
        font-size: 0.9rem;
        border-radius: 6px;
    }

    .label-container {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
        margin-bottom: 0.5rem;
    }

    .stats-container {
        align-self: flex-end;
        font-size: 0.75rem;
        gap: 0.5rem;
    }

    /* Input Actions Mobile - Hide on mobile */
    .input-actions,
    .output-actions {
        display: none; /* Hide all action buttons on mobile */
    }

    /* Only show essential buttons on mobile */
    .quick-actions {
        display: flex !important; /* Keep header action buttons */
    }

    .btn-icon {
        padding: 0.5rem;
        font-size: 1rem;
        min-width: 40px;
        min-height: 40px;
    }

    /* Preview Section Mobile */
    .preview-section {
        margin-top: 1rem;
    }

    .preview-header h4 {
        font-size: 0.9rem;
    }

    .preview-grid {
        grid-template-columns: 1fr;
        gap: 0.5rem;
    }

    .preview-item {
        padding: 0.6rem;
        border-radius: 6px;
    }

    .preview-base {
        font-size: 0.75rem;
        margin-bottom: 0.3rem;
    }

    .preview-value {
        font-size: 0.8rem;
        padding: 0.3rem;
        min-height: 36px; /* Touch target size */
        display: flex;
        align-items: center;
        justify-content: center;
        text-align: center;
    }

    /* Converter Header Mobile */
    .converter-header {
        flex-direction: column;
        gap: 1rem;
        align-items: flex-start;
    }

    .quick-actions {
        align-self: flex-end;
    }

    .converter-header h3 {
        font-size: 1.2rem;
    }

    /* History Item Mobile */
    .history-item {
        flex-direction: column;
        align-items: stretch;
        padding: 0.8rem;
        margin-bottom: 0.5rem;
    }

    .history-content {
        width: 100%;
        margin-bottom: 0.5rem;
    }

    .history-conversion {
        font-size: 0.9rem;
        margin-bottom: 0.3rem;
        text-align: left;
    }

    .history-input {
        margin-bottom: 0.2rem;
        font-size: 0.8rem;
    }

    .history-output {
        margin-bottom: 0.2rem;
        font-size: 0.8rem;
    }

    .history-time {
        font-size: 0.7rem;
        margin-top: 0.3rem;
        text-align: left;
        color: var(--text-secondary);
    }

    .history-input code,
    .history-output code {
        font-size: 0.8rem;
        padding: 0.3rem;
        word-break: break-all;
        display: block;
        margin-top: 0.2rem;
    }

    .history-actions {
        margin-left: 0;
        align-self: flex-end;
    }

    /* Modal Mobile */
    .modal {
        padding: 1rem;
        align-items: center;
        justify-content: center;
    }

    .modal-content {
        margin: auto;
        max-width: 100%;
        max-height: 90vh;
        border-radius: 16px;
        animation: slideUp 0.3s ease-out;
    }

    .modal-header {
        padding: 1rem 1.5rem;
        flex-wrap: wrap;
        gap: 0.75rem;
        background: var(--card-bg);
        position: sticky;
        top: 0;
        z-index: 20;
    }

    .modal-header h2 {
        font-size: 1.25rem;
        text-align: left;
        flex: 1;
        min-width: 0;
    }

    .modal-header-actions {
        display: flex;
        gap: 0.5rem;
        flex-wrap: wrap;
        justify-content: flex-end;
    }

    .modal-header-actions .btn-sm {
        font-size: 0.75rem;
        padding: 0.5rem 0.75rem;
    }

    .modal-close {
        width: 36px;
        height: 36px;
        font-size: 1.25rem;
    }

    .history-search {
        padding: 1rem 1.5rem;
        position: sticky;
        top: 0;
        z-index: 15;
    }

    .search-input {
        padding: 0.75rem 1rem 0.75rem 2.5rem;
        font-size: 0.9rem;
    }

    .modal-body {
        padding: 0;
        flex: 1;
        overflow-y: auto;
    }

    .history-list {
        padding: 1rem 1.5rem 1.5rem;
        max-width: none;
        margin: 0;
    }

    /* History Item Mobile */
    .history-item {
        padding: 1rem;
        margin-bottom: 0.75rem;
        border-radius: 10px;
    }

    .history-conversion-type {
        font-size: 1.1rem;
        margin-bottom: 0.5rem;
    }

    .history-item-time {
        font-size: 0.8rem;
        margin-bottom: 0.75rem;
    }

    .history-input-label,
    .history-output-label {
        font-size: 0.7rem;
    }

    .history-input-content {
        font-size: 0.9rem;
        padding: 0.6rem;
    }

    .history-output-content {
        font-size: 0.8rem;
        padding: 0.6rem;
        line-height: 1.5;
    }

    /* History Stats Mobile */
    .history-stats {
        flex-direction: column;
        gap: 1rem;
        padding: 1rem 1.5rem;
        background: var(--bg-color);
    }

    .history-stats-left {
        flex-direction: column;
        gap: 0.5rem;
        width: 100%;
    }

    .history-stat {
        justify-content: space-between;
        padding: 0.5rem 0;
        border-bottom: 1px solid var(--border-color);
    }

    .history-stat:last-child {
        border-bottom: none;
    }

    .history-stats-right {
        display: flex;
        gap: 0.75rem;
        width: 100%;
    }

    .history-stats-right .btn-sm {
        flex: 1;
        font-size: 0.8125rem;
        padding: 0.625rem 1rem;
        min-height: 40px;
    }

    /* Empty State Mobile */
    .no-history {
        padding: 3rem 1.5rem;
        font-size: 1rem;
    }

    .no-history::before {
        font-size: 2.5rem;
        margin-bottom: 0.75rem;
    }

    /* Error Message Mobile */
    .error-msg {
        font-size: 0.8rem;
        padding: 0.5rem;
    }

    /* Conversion Indicator Mobile */
    .conversion-indicator {
        font-size: 0.8rem;
        padding: 0.4rem 0.8rem;
        margin-bottom: 1rem;
    }
}

/* Extra Small Screens */
@media (max-width: 480px) {
    .converter-box {
        padding: 1rem;
    }

    .base-selector-row {
        padding: 0.75rem;
        gap: 0.75rem;
    }

    /* Modal Extra Small Mobile */
    .modal-header {
        padding: 0.875rem 1rem;
        gap: 0.5rem;
    }

    .modal-header h2 {
        font-size: 1.125rem;
    }

    .modal-header-actions {
        gap: 0.375rem;
    }

    .modal-header-actions .btn-sm {
        font-size: 0.6875rem;
        padding: 0.4375rem 0.625rem;
    }

    .history-search {
        padding: 0.875rem 1rem;
    }

    .search-input {
        padding: 0.625rem 1rem 0.625rem 2.25rem;
        font-size: 0.875rem;
    }

    .search-wrapper::before {
        left: 0.625rem;
        font-size: 0.875rem;
    }

    .history-list {
        padding: 0.75rem 1rem 1rem;
        max-width: none;
        margin: 0;
    }

    .history-item {
        padding: 0.875rem;
        margin-bottom: 0.625rem;
        border-radius: 8px;
    }

    .history-conversion-type {
        font-size: 1rem;
    }

    .history-item-time {
        font-size: 0.75rem;
    }

    .history-input-content {
        font-size: 0.85rem;
        padding: 0.5rem;
    }

    .history-output-content {
        font-size: 0.75rem;
        padding: 0.5rem;
    }

    .history-stats {
        padding: 0.875rem 1rem;
        gap: 0.875rem;
    }

    .history-stats-right .btn-sm {
        font-size: 0.75rem;
        padding: 0.5rem 0.875rem;
        min-height: 36px;
    }

    .quick-shortcuts {
        padding: 0.75rem;
    }

    .shortcut-buttons {
        grid-template-columns: 1fr;
        gap: 0.4rem;
    }

    .btn-shortcut {
        padding: 0.8rem;
        font-size: 0.85rem;
    }

    .base-converter .input-wrapper textarea {
        min-height: 45px;
        padding: 0.5rem;
        font-size: 0.85rem;
    }

    .preview-value {
        font-size: 0.75rem;
        padding: 0.4rem;
        min-height: 32px;
    }
}
