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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 0;
    color: #333;
    line-height: 1.6;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

header {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    padding: 20px 28px;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    margin: 0 auto 24px;
    max-width: 1200px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

header h1 {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-size: 24px;
    font-weight: 700;
    letter-spacing: -0.5px;
}

.github-link {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #667eea;
    text-decoration: none;
    padding: 10px 16px;
    border-radius: 8px;
    transition: all 0.3s ease;
    font-size: 14px;
    font-weight: 500;
    background: rgba(102, 126, 234, 0.1);
}

.github-link:hover {
    background: rgba(102, 126, 234, 0.2);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.github-link svg {
    fill: currentColor;
}

.nav-tabs {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    padding: 8px;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    margin-bottom: 24px;
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.nav-tabs a {
    color: #666;
    text-decoration: none;
    padding: 12px 24px;
    border-radius: 8px;
    transition: all 0.3s ease;
    font-weight: 500;
    font-size: 14px;
    position: relative;
}

.nav-tabs a:hover {
    background: rgba(102, 126, 234, 0.1);
    color: #667eea;
    transform: translateY(-2px);
}

.nav-tabs a.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

main {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    padding: 32px;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.tool-section {
    margin-bottom: 24px;
    padding: 24px;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.05) 0%, rgba(118, 75, 162, 0.05) 100%);
    border-radius: 12px;
    border-left: 4px solid #667eea;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.05);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.tool-section:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.08);
}

.tool-section h2 {
    color: #333;
    margin-bottom: 16px;
    font-size: 20px;
    font-weight: 700;
    letter-spacing: -0.3px;
}

.tool-section p {
    color: #666;
    margin-bottom: 16px;
    font-size: 14px;
    line-height: 1.7;
}

.input-group {
    margin-bottom: 12px;
}

.input-group label {
    display: block;
    color: #444;
    margin-bottom: 10px;
    font-weight: 600;
    font-size: 14px;
}

.input-group textarea,
.input-group input[type="text"],
.input-group input[type="password"],
.input-group select {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 14px;
    font-family: 'Courier New', monospace;
    transition: all 0.3s ease;
    resize: vertical;
    background: white;
}

.input-group textarea {
    min-height: 100px;
}

.input-group textarea:focus,
.input-group input:focus,
.input-group select:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.button-group {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 16px;
}

button {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    color: white;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    position: relative;
    overflow: hidden;
}

button::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

button:hover::before {
    width: 300px;
    height: 300px;
}

button:hover {
    background: linear-gradient(135deg, #5568d3 0%, #6a3f8f 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
}

button:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

button.primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

button.primary:hover {
    background: linear-gradient(135deg, #5568d3 0%, #6a3f8f 100%);
}

button.secondary {
    background: linear-gradient(135deg, #95a5a6 0%, #7f8c8d 100%);
}

button.secondary:hover {
    background: linear-gradient(135deg, #839496 0%, #6c7a7b 100%);
}

button.success {
    background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
}

button.success:hover {
    background: linear-gradient(135deg, #0f8579 0%, #2fd469 100%);
}

.output-box {
    background: #1e1e2e;
    padding: 16px;
    border-radius: 8px;
    border: 2px solid #2d2d44;
    min-height: 100px;
    word-break: break-all;
    font-family: 'Courier New', monospace;
    font-size: 14px;
    color: #a6e3a1;
    box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.2);
}

.alert {
    padding: 16px 20px;
    border-radius: 10px;
    margin-top: 16px;
    font-size: 14px;
    line-height: 1.7;
    border-left: 4px solid;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.alert-info {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.1) 0%, rgba(118, 75, 162, 0.1) 100%);
    color: #1565C0;
    border-left-color: #667eea;
}

.alert-warning {
    background: linear-gradient(135deg, rgba(255, 193, 7, 0.1) 0%, rgba(255, 152, 0, 0.1) 100%);
    color: #F57F17;
    border-left-color: #FFC107;
}

.alert-success {
    background: linear-gradient(135deg, rgba(76, 175, 80, 0.1) 0%, rgba(56, 142, 60, 0.1) 100%);
    color: #2E7D32;
    border-left-color: #4CAF50;
}

.alert-error {
    background: linear-gradient(135deg, rgba(244, 67, 54, 0.1) 0%, rgba(198, 40, 40, 0.1) 100%);
    color: #C62828;
    border-left-color: #F44336;
}

footer {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    padding: 24px;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    margin: 24px auto 0;
    max-width: 1200px;
    text-align: center;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

footer p {
    color: #666;
    margin: 6px 0;
    font-size: 14px;
}

footer a {
    color: #667eea;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s ease;
}

footer a:hover {
    color: #764ba2;
    text-decoration: underline;
}

/* JSON格式化页面特定样式 */
.input-section,
.output-section {
    margin-bottom: 32px;
}

.input-section h2,
.output-section h2 {
    color: #333;
    margin-bottom: 16px;
    font-size: 20px;
    font-weight: 700;
    letter-spacing: -0.3px;
}

#json-input {
    width: 100%;
    min-height: 300px;
    padding: 16px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-family: 'Courier New', monospace;
    font-size: 14px;
    resize: vertical;
    background: white;
    transition: all 0.3s ease;
}

#json-input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

pre {
    background: #1e1e2e;
    padding: 20px;
    border-radius: 8px;
    overflow-x: auto;
    margin-top: 16px;
    border: 2px solid #2d2d44;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

pre code {
    color: #abb2bf;
    font-family: 'Courier New', Monaco, Consolas, monospace;
    font-size: 14px;
    line-height: 1.6;
}

/* 代码对比页面特定样式 */
.diff-controls {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.05) 0%, rgba(118, 75, 162, 0.05) 100%);
    padding: 20px;
    border-radius: 12px;
    margin-bottom: 20px;
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    align-items: center;
    border: 1px solid rgba(102, 126, 234, 0.2);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.05);
}

.control-group {
    display: flex;
    align-items: center;
    gap: 6px;
}

.control-group label {
    margin-bottom: 0;
    color: #555;
    font-weight: 400;
    white-space: nowrap;
    font-size: 14px;
}

.control-group select {
    padding: 10px 14px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 14px;
    background: white;
    cursor: pointer;
    min-width: 140px;
    transition: all 0.3s ease;
}

.control-group select:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.control-group input[type="checkbox"] {
    width: 16px;
    height: 16px;
    cursor: pointer;
}

.diff-stats {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    padding: 16px 20px;
    border-radius: 12px;
    margin-bottom: 20px;
    display: flex;
    gap: 24px;
    flex-wrap: wrap;
    border: 1px solid rgba(255, 255, 255, 0.3);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
}

.stat-item {
    display: flex;
    align-items: center;
    gap: 6px;
}

.stat-label {
    color: #666;
    font-weight: 400;
    font-size: 14px;
}

.stat-value {
    font-weight: 600;
    font-size: 16px;
    padding: 2px 8px;
    border-radius: 3px;
}

.stat-value.added {
    color: #2E7D32;
    background: #E8F5E9;
}

.stat-value.removed {
    color: #C62828;
    background: #FFEBEE;
}

.stat-value.changed {
    color: #F57F17;
    background: #FFF8E1;
}

.stat-value.unchanged {
    color: #616161;
    background: #F5F5F5;
}

.diff-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 16px;
}

.diff-panel {
    background: white;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    min-height: 500px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.diff-panel:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.12);
}

.panel-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 14px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.panel-header h3 {
    margin: 0;
    font-size: 15px;
    font-weight: 500;
}

.panel-header button {
    background: rgba(255, 255, 255, 0.15);
    border: none;
    color: white;
    padding: 8px 12px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s ease;
    margin-left: 8px;
    backdrop-filter: blur(10px);
}

.panel-header button:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.05);
}

.upload-btn {
    position: relative;
    overflow: hidden;
}

.file-input {
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
}

.panel-content {
    flex: 1;
    position: relative;
    overflow: hidden;
}

.code-input {
    width: 100%;
    height: 100%;
    min-height: 500px;
    padding: 16px;
    border: none;
    resize: none;
    font-family: 'Courier New', Monaco, Consolas, monospace;
    font-size: 13px;
    line-height: 1.6;
    background: #1e1e2e;
    color: #abb2bf;
    transition: background 0.3s ease;
}

.code-input:focus {
    outline: none;
    background: #252536;
}

.diff-viewer {
    display: none;
    height: 100%;
    overflow: auto;
    background: #1e1e2e;
    font-family: 'Courier New', Monaco, Consolas, monospace;
    font-size: 13px;
    line-height: 1.6;
}

.diff-viewer pre {
    margin: 0;
    padding: 0;
    background: transparent;
}

.diff-viewer code {
    background: transparent;
    padding: 0;
}

.diff-line {
    display: flex;
    padding: 4px 16px;
    min-height: 24px;
    align-items: center;
    border-left: 4px solid transparent;
    transition: background 0.2s ease;
}

.diff-line.diff-empty {
    background: #252536;
}

.diff-line.diff-equal {
    background: #1e1e2e;
    border-left-color: transparent;
}

.diff-line.diff-added {
    background: rgba(76, 175, 80, 0.15);
    border-left-color: #4CAF50;
}

.diff-line.diff-removed {
    background: rgba(244, 67, 54, 0.15);
    border-left-color: #F44336;
}

.diff-line.diff-changed {
    background: rgba(255, 193, 7, 0.15);
    border-left-color: #FFC107;
}

.line-number {
    display: inline-block;
    min-width: 45px;
    text-align: right;
    padding-right: 12px;
    color: #6c757d;
    user-select: none;
    font-size: 11px;
}

.line-content {
    flex: 1;
    white-space: pre;
    word-break: break-all;
    color: #abb2bf;
}

.diff-viewer .hljs {
    background: transparent;
    padding: 0;
}

@media (max-width: 768px) {
    body {
        padding: 0;
        background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    }

    .container {
        padding: 12px;
    }

    header {
        margin-left: 12px;
        margin-right: 12px;
        flex-direction: column;
        gap: 12px;
        text-align: center;
        padding: 16px 20px;
    }

    header h1 {
        font-size: 20px;
    }

    .nav-tabs {
        justify-content: center;
        padding: 8px;
    }

    main {
        padding: 20px;
    }

    .button-group {
        flex-direction: column;
        gap: 10px;
    }

    button {
        width: 100%;
        padding: 14px 24px;
    }

    .diff-container {
        grid-template-columns: 1fr;
    }

    .diff-controls {
        flex-direction: column;
        align-items: stretch;
        padding: 12px;
    }

    .control-group {
        width: 100%;
        justify-content: space-between;
    }

    .control-group select {
        flex: 1;
    }

    .diff-stats {
        flex-direction: column;
        gap: 12px;
        padding: 10px 12px;
    }

    .stat-item {
        justify-content: space-between;
    }

    footer {
        margin: 24px 12px 0 12px;
    }
}

