/* ==========================================
   Reset & Base Styles
   ========================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    /* Google Material Design Colors */
    --primary-blue: #4285f4;
    --primary-red: #ea4335;
    --primary-yellow: #fbbc04;
    --primary-green: #34a853;
    
    /* Neutral Colors */
    --white: #ffffff;
    --gray-50: #f8f9fa;
    --gray-100: #f1f3f4;
    --gray-200: #e8eaed;
    --gray-300: #dadce0;
    --gray-400: #bdc1c6;
    --gray-700: #5f6368;
    --gray-900: #202124;
    
    /* Diff Colors */
    --diff-add-bg: #e6ffec;
    --diff-add-text: #0d8527;
    --diff-delete-bg: #ffebe9;
    --diff-delete-text: #d73a33;
    --diff-equal-bg: #f6f8fa;
    --diff-equal-text: #57606a;
    
    /* Shadows - Flatter */
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.06);
    --shadow-md: 0 2px 4px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 4px 8px rgba(0, 0, 0, 0.1);
    
    /* Spacing */
    --spacing-xs: 0.5rem;
    --spacing-sm: 1rem;
    --spacing-md: 1.5rem;
    --spacing-lg: 2rem;
    --spacing-xl: 3rem;
    
    /* Border Radius - Flatter */
    --radius-sm: 4px;
    --radius-md: 6px;
    --radius-lg: 8px;
    --radius-full: 9999px;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: #ffffff;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--spacing-md);
    color: var(--gray-900);
    line-height: 1.6;
    position: relative;
    overflow-x: hidden;
}

/* ==========================================
   Background - Gradient Lines (Different from QRCode)
   ========================================== */
.bg-shapes {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    z-index: 0;
    pointer-events: none;
    background: linear-gradient(135deg, #f5f7fa 0%, #ffffff 100%);
}

.shape {
    position: absolute;
    opacity: 0.08;
}

/* Vertical Lines */
.shape-1 {
    width: 2px;
    height: 100%;
    background: linear-gradient(180deg, transparent 0%, #4285f4 50%, transparent 100%);
    left: 15%;
    animation: slideDown 15s infinite ease-in-out;
}

.shape-2 {
    width: 2px;
    height: 100%;
    background: linear-gradient(180deg, transparent 0%, #34a853 50%, transparent 100%);
    left: 35%;
    animation: slideDown 18s infinite ease-in-out 3s;
}

.shape-3 {
    width: 2px;
    height: 100%;
    background: linear-gradient(180deg, transparent 0%, #fbbc04 50%, transparent 100%);
    right: 35%;
    animation: slideDown 20s infinite ease-in-out 6s;
}

.shape-4 {
    width: 2px;
    height: 100%;
    background: linear-gradient(180deg, transparent 0%, #ea4335 50%, transparent 100%);
    right: 15%;
    animation: slideDown 16s infinite ease-in-out 9s;
}

/* Horizontal Lines */
.shape-5 {
    width: 100%;
    height: 2px;
    background: linear-gradient(90deg, transparent 0%, #4285f4 50%, transparent 100%);
    top: 20%;
    animation: slideRight 20s infinite ease-in-out;
}

.shape-6 {
    width: 100%;
    height: 2px;
    background: linear-gradient(90deg, transparent 0%, #34a853 50%, transparent 100%);
    top: 60%;
    animation: slideRight 22s infinite ease-in-out 5s;
}

.shape-7 {
    width: 100%;
    height: 2px;
    background: linear-gradient(90deg, transparent 0%, #fbbc04 50%, transparent 100%);
    top: 80%;
    animation: slideRight 18s infinite ease-in-out 10s;
}

@keyframes slideDown {
    0%, 100% {
        transform: translateY(-20%);
    }
    50% {
        transform: translateY(20%);
    }
}

@keyframes slideRight {
    0%, 100% {
        transform: translateX(-20%);
    }
    50% {
        transform: translateX(20%);
    }
}

/* ==========================================
   Container
   ========================================== */
.container {
    width: 100%;
    max-width: 1400px;
    background: var(--white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--gray-200);
    padding: var(--spacing-xl);
    animation: fadeInUp 0.6s ease-out;
    position: relative;
    z-index: 1;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ==========================================
   Header
   ========================================== */
.header {
    text-align: center;
    margin-bottom: var(--spacing-xl);
}

.title {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--gray-900);
    margin-bottom: var(--spacing-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-sm);
    letter-spacing: -0.02em;
}

.title-icon {
    width: 48px;
    height: 48px;
    vertical-align: middle;
}

.subtitle {
    font-size: 1.125rem;
    color: var(--gray-700);
    font-weight: 400;
    line-height: 1.6;
}

/* ==========================================
   Compare Section
   ========================================== */
.compare-section {
    margin-bottom: var(--spacing-lg);
}

.text-inputs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--spacing-lg);
    margin-bottom: var(--spacing-md);
}

.input-wrapper {
    display: flex;
    flex-direction: column;
}

.input-label {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--spacing-xs);
    font-weight: 600;
    color: var(--gray-900);
    font-size: 0.9375rem;
}

.label-text {
    flex: 1;
}

.btn-clear {
    background: transparent;
    border: none;
    color: var(--gray-400);
    cursor: pointer;
    font-size: 1rem;
    padding: 0.25rem 0.5rem;
    border-radius: var(--radius-sm);
    transition: all 0.3s ease;
}

.btn-clear:hover {
    color: var(--primary-red);
    background: var(--gray-100);
}

.text-input {
    width: 100%;
    padding: 1rem;
    font-size: 0.9375rem;
    border: 1px solid var(--gray-300);
    border-radius: var(--radius-sm);
    outline: none;
    transition: all 0.2s ease;
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    resize: vertical;
    background: var(--gray-50);
    line-height: 1.5;
    min-height: 320px;
}

.text-input:focus {
    border-color: var(--primary-blue);
    background: var(--white);
    box-shadow: 0 0 0 3px rgba(66, 133, 244, 0.08);
}

.text-input::placeholder {
    color: var(--gray-400);
    opacity: 0.6;
}

/* ==========================================
   Buttons
   ========================================== */
.action-buttons {
    display: flex;
    gap: var(--spacing-sm);
    margin-bottom: var(--spacing-lg);
}

.btn {
    padding: 1rem 2rem;
    font-size: 1rem;
    font-weight: 600;
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-xs);
    font-family: inherit;
    text-decoration: none;
}

.btn-primary {
    background: var(--primary-blue);
    color: var(--white);
    box-shadow: none;
    flex: 1;
}

.btn-primary:hover {
    background: #3367d6;
    box-shadow: var(--shadow-sm);
}

.btn-primary:active {
    background: #2952b3;
    box-shadow: none;
}

.btn-secondary {
    background: var(--gray-100);
    color: var(--gray-900);
    flex: 0 0 auto;
}

.btn-secondary:hover {
    background: var(--gray-200);
}

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

/* ==========================================
   Stats Section
   ========================================== */
.stats-section {
    display: flex;
    gap: var(--spacing-md);
    justify-content: center;
    padding: var(--spacing-md);
    background: var(--gray-50);
    border-radius: var(--radius-sm);
    border: 1px solid var(--gray-200);
    margin-bottom: var(--spacing-lg);
    animation: fadeIn 0.5s ease-out;
}

.stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--spacing-xs);
}

.stat-label {
    font-size: 0.875rem;
    color: var(--gray-700);
    font-weight: 500;
}

.stat-value {
    font-size: 1.75rem;
    font-weight: 700;
    font-family: 'Consolas', 'Monaco', monospace;
}

.stat-add {
    color: var(--primary-green);
}

.stat-delete {
    color: var(--primary-red);
}

.stat-equal {
    color: var(--gray-700);
}

/* ==========================================
   Result Section
   ========================================== */
.result-section {
    animation: fadeIn 0.5s ease-out;
}

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

.result-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--spacing-md);
}

.result-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--gray-900);
}

.result-actions {
    display: flex;
    gap: var(--spacing-xs);
}

.btn-action {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    font-weight: 600;
    border: 1px solid var(--gray-300);
    border-radius: var(--radius-sm);
    background: var(--white);
    color: var(--gray-900);
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: inherit;
}

.btn-action:hover {
    background: var(--gray-100);
    border-color: var(--gray-400);
}

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

/* ==========================================
   Legend
   ========================================== */
.legend {
    display: flex;
    gap: var(--spacing-md);
    justify-content: center;
    padding: var(--spacing-sm);
    margin-bottom: var(--spacing-md);
    background: transparent;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-sm);
}

.legend-item {
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
}

.legend-color {
    width: 16px;
    height: 16px;
    border-radius: 3px;
}

.legend-add {
    background: var(--diff-add-bg);
    border: 1px solid var(--diff-add-text);
}

.legend-delete {
    background: var(--diff-delete-bg);
    border: 1px solid var(--diff-delete-text);
}

.legend-equal {
    background: var(--diff-equal-bg);
    border: 1px solid var(--diff-equal-text);
}

.legend-text {
    font-size: 0.875rem;
    color: var(--gray-700);
}

/* ==========================================
   Diff Result
   ========================================== */
.diff-result {
    background: var(--white);
    border: 1px solid var(--gray-300);
    border-radius: var(--radius-sm);
    padding: var(--spacing-md);
    max-height: 500px;
    overflow-y: auto;
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    font-size: 0.9375rem;
    line-height: 1.8;
    white-space: pre-wrap;
    word-wrap: break-word;
}

.diff-result::-webkit-scrollbar {
    width: 8px;
}

.diff-result::-webkit-scrollbar-track {
    background: var(--gray-200);
    border-radius: 4px;
}

.diff-result::-webkit-scrollbar-thumb {
    background: var(--gray-400);
    border-radius: 4px;
}

.diff-result::-webkit-scrollbar-thumb:hover {
    background: var(--gray-700);
}

.diff-add {
    background: var(--diff-add-bg);
    color: var(--diff-add-text);
    padding: 0.125rem 0.25rem;
    border-radius: 3px;
    font-weight: 600;
    text-decoration: underline;
    text-decoration-color: var(--diff-add-text);
    text-decoration-thickness: 2px;
}

.diff-delete {
    background: var(--diff-delete-bg);
    color: var(--diff-delete-text);
    padding: 0.125rem 0.25rem;
    border-radius: 3px;
    font-weight: 600;
    text-decoration: line-through;
    text-decoration-color: var(--diff-delete-text);
    text-decoration-thickness: 2px;
}

.diff-equal {
    color: var(--gray-900);
}

/* ==========================================
   Links Section (友情链接)
   ========================================== */
.links-section {
    margin-top: var(--spacing-lg);
    padding: var(--spacing-sm) 0;
}

.links-container {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.links-label {
    font-size: 0.8125rem;
    color: var(--gray-500);
    font-weight: 500;
}

.links-list {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.link-item {
    font-size: 0.8125rem;
    color: var(--gray-700);
    text-decoration: none;
    transition: color 0.3s ease;
    padding: 0.25rem 0.5rem;
}

.link-item:hover {
    color: var(--primary-blue);
}

.link-item:not(:last-child)::after {
    content: '|';
    margin-left: 0.5rem;
    color: var(--gray-300);
}

/* ==========================================
   Footer
   ========================================== */
.footer {
    text-align: center;
    padding-top: var(--spacing-lg);
    border-top: 1px solid var(--gray-200);
    color: var(--gray-700);
    font-size: 0.875rem;
}

/* ==========================================
   Success Toast
   ========================================== */
.success-toast {
    position: fixed;
    top: 20px;
    right: 20px;
    background: var(--primary-green);
    color: var(--white);
    padding: 1rem 1.5rem;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    animation: slideInRight 0.3s ease-out, fadeOut 0.3s ease-out 2.7s;
    z-index: 1000;
}

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

@keyframes fadeOut {
    to {
        opacity: 0;
    }
}

/* ==========================================
   Responsive Design
   ========================================== */

/* Tablet */
@media (max-width: 1024px) {
    .container {
        max-width: 100%;
    }
    
    .text-inputs {
        gap: var(--spacing-md);
    }
}

@media (max-width: 768px) {
    .container {
        padding: var(--spacing-md);
        max-width: 100%;
    }
    
    .title {
        font-size: 1.75rem;
    }
    
    .title-icon {
        width: 36px;
        height: 36px;
    }
    
    .subtitle {
        font-size: 0.9375rem;
    }
    
    .text-inputs {
        grid-template-columns: 1fr;
        gap: var(--spacing-md);
    }
    
    .text-input {
        min-height: 200px;
    }
    
    .shape {
        display: none;
    }
    
    .stats-section {
        flex-wrap: wrap;
        padding: var(--spacing-sm);
    }
    
    .result-header {
        flex-direction: column;
        align-items: flex-start;
        gap: var(--spacing-sm);
    }
    
    .legend {
        flex-wrap: wrap;
        gap: var(--spacing-sm);
    }
}

/* Mobile */
@media (max-width: 480px) {
    body {
        padding: var(--spacing-xs);
    }
    
    .container {
        padding: var(--spacing-sm);
        border-radius: var(--radius-sm);
    }
    
    .header {
        margin-bottom: var(--spacing-md);
    }
    
    .title {
        font-size: 1.5rem;
        gap: var(--spacing-xs);
    }
    
    .title-icon {
        width: 32px;
        height: 32px;
    }
    
    .subtitle {
        font-size: 0.875rem;
    }
    
    .text-input {
        padding: 0.75rem;
        font-size: 0.875rem;
        min-height: 150px;
    }
    
    .action-buttons {
        flex-direction: column;
        gap: var(--spacing-xs);
    }
    
    .btn-primary,
    .btn-secondary {
        width: 100%;
    }
    
    .stat-value {
        font-size: 1.25rem;
    }
    
    .diff-result {
        font-size: 0.8125rem;
        padding: var(--spacing-sm);
        max-height: 300px;
    }
    
    .result-actions {
        width: 100%;
    }
    
    .btn-action {
        font-size: 0.8125rem;
        padding: 0.5rem 0.75rem;
    }

    .links-container {
        flex-direction: column;
        gap: 0.5rem;
    }
}

/* ==========================================
   Utility Classes
   ========================================== */
.text-center {
    text-align: center;
}

.hidden {
    display: none !important;
}

