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

:root {
    --bg-surface: #f5f7fb;
    --bg-card: rgba(255, 255, 255, 0.92);
    --bg-card-light: rgba(255, 255, 255, 0.8);
    --border-color: rgba(15, 23, 42, 0.08);
    --text-primary: #1f2937;
    --text-secondary: #4b5563;
    --accent-blue: #2563eb;
    --accent-blue-strong: #1d4ed8;
    --accent-teal: #0ea5e9;
    --accent-purple: #6366f1;
    --shadow-soft: 0 18px 45px rgba(15, 23, 42, 0.08);
    --radius-lg: 18px;
    --radius-md: 12px;
    --radius-sm: 8px;
    --spacing-xs: 0.5rem;
    --spacing-sm: 1rem;
    --spacing-md: 1.5rem;
    --spacing-lg: 2.25rem;
    --spacing-xl: 3rem;
    --max-width: 1100px;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: var(--bg-surface);
    color: var(--text-primary);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    padding: var(--spacing-lg) var(--spacing-sm);
    position: relative;
    overflow-x: hidden;
}

.gradient-background {
    position: fixed;
    inset: 0;
    background: radial-gradient(circle at 15% 20%, rgba(37, 99, 235, 0.18) 0, transparent 42%),
                radial-gradient(circle at 85% 25%, rgba(14, 165, 233, 0.15) 0, transparent 48%),
                radial-gradient(circle at 50% 75%, rgba(99, 102, 241, 0.18) 0, transparent 55%),
                linear-gradient(160deg, #ffffff 0%, #f3f4f6 100%);
    z-index: 0;
    pointer-events: none;
}

.app-shell {
    width: 100%;
    max-width: var(--max-width);
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    gap: var(--spacing-lg);
}

.header {
    text-align: center;
    padding-bottom: var(--spacing-sm);
}

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

.title-icon {
    width: 52px;
    height: 52px;
    filter: drop-shadow(0 10px 24px rgba(37, 99, 235, 0.3));
}

.subtitle {
    margin-top: var(--spacing-xs);
    color: rgba(75, 85, 99, 0.8);
    font-size: 1.05rem;
    line-height: 1.7;
}

.content-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
    gap: var(--spacing-lg);
}

.panel {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: var(--spacing-lg);
    box-shadow: var(--shadow-soft);
    backdrop-filter: blur(18px);
}

.calculator-panel {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-md);
}

.insight-panel {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-md);
}

.input-tabs {
    display: inline-flex;
    align-self: flex-start;
    background: rgba(15, 23, 42, 0.04);
    border-radius: 999px;
    padding: 0.3rem;
    border: 1px solid rgba(15, 23, 42, 0.08);
}

.tab-btn {
    border: none;
    background: transparent;
    color: rgba(75, 85, 99, 0.75);
    padding: 0.6rem 1.6rem;
    border-radius: 999px;
    font-weight: 600;
    letter-spacing: 0.01em;
    cursor: pointer;
    transition: all 0.25s ease;
}

.tab-btn.active {
    background: rgba(37, 99, 235, 0.1);
    color: var(--accent-blue);
    box-shadow: inset 0 0 0 1px rgba(37, 99, 235, 0.3);
}

.input-label {
    display: block;
    margin-bottom: 0.75rem;
    font-weight: 600;
    color: #1f2937;
}

.form-field {
    display: grid;
    gap: 0.65rem;
}

textarea,
input[type="text"],
input[type="url"],
input[type="search"],
input[type="email"],
input[type="password"] {
    width: 100%;
    padding: 1.05rem 1.25rem;
    border-radius: var(--radius-md);
    border: 1px solid rgba(15, 23, 42, 0.12);
    background: #ffffff;
    color: var(--text-primary);
    font-size: 1rem;
    line-height: 1.6;
    transition: border-color 0.25s ease, box-shadow 0.25s ease, background-color 0.25s ease;
    box-shadow: 0 4px 14px rgba(15, 23, 42, 0.04);
}

textarea:focus,
input[type="text"]:focus,
input[type="url"]:focus,
input[type="search"]:focus,
input[type="email"]:focus,
input[type="password"]:focus {
    outline: none;
    border-color: rgba(37, 99, 235, 0.6);
    background: #ffffff;
    box-shadow: 0 0 0 0.22rem rgba(37, 99, 235, 0.12);
}

textarea::placeholder,
input::placeholder {
    color: rgba(107, 114, 128, 0.55);
}

input[type="file"] {
    font-size: 1rem;
    color: rgba(75, 85, 99, 0.8);
    border: 1px solid rgba(15, 23, 42, 0.1);
    border-radius: var(--radius-md);
    padding: 0.85rem 1rem;
    background: rgba(255, 255, 255, 0.95);
}

input[type="file"]:focus {
    outline: none;
    border-color: rgba(37, 99, 235, 0.45);
    box-shadow: 0 0 0 0.18rem rgba(37, 99, 235, 0.12);
}

.file-input {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
}

.input-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-top: 1rem;
}

.btn {
    border: none;
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: 0.95rem;
    padding: 0.85rem 1.6rem;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
}

.btn-primary {
    background: linear-gradient(135deg, var(--accent-blue) 0%, var(--accent-blue-strong) 100%);
    color: #ffffff;
    box-shadow: 0 12px 25px rgba(37, 99, 235, 0.18);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 16px 28px rgba(96, 165, 250, 0.25);
}

.btn-secondary {
    background: rgba(37, 99, 235, 0.06);
    color: var(--accent-blue);
    border: 1px solid rgba(37, 99, 235, 0.18);
}

.btn-secondary:hover {
    border-color: rgba(37, 99, 235, 0.35);
    background: rgba(37, 99, 235, 0.12);
    color: var(--accent-blue-strong);
}

.file-drop {
    position: relative;
    border: 1.5px dashed rgba(37, 99, 235, 0.35);
    border-radius: var(--radius-md);
    padding: var(--spacing-md);
    background: linear-gradient(140deg, rgba(255, 255, 255, 0.95) 0%, rgba(229, 240, 255, 0.65) 100%);
    transition: border-color 0.3s ease, box-shadow 0.3s ease, transform 0.3s ease;
    box-shadow: 0 10px 30px rgba(37, 99, 235, 0.08);
}

.file-drop.dragover {
    border-color: rgba(37, 99, 235, 0.65);
    background: linear-gradient(140deg, rgba(229, 240, 255, 0.95) 0%, rgba(199, 227, 255, 0.85) 100%);
    transform: translateY(-3px);
    box-shadow: 0 16px 32px rgba(37, 99, 235, 0.12);
}

.file-drop-content {
    text-align: center;
    color: rgba(75, 85, 99, 0.9);
    display: grid;
    gap: 0.55rem;
}

/* .file-drop-content::before {
    content: '';
    display: block;
    width: 52px;
    height: 52px;
    margin: 0 auto;
    border-radius: 16px;
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.25) 0%, rgba(14, 165, 233, 0.35) 100%);
    border: 1px solid rgba(37, 99, 235, 0.35);
} */

.file-drop-title {
    font-weight: 600;
    letter-spacing: 0.01em;
    font-size: 1.05rem;
}

.file-drop-subtitle {
    margin-top: 0.15rem;
    font-size: 0.93rem;
    color: rgba(75, 85, 99, 0.7);
}

.file-info {
    margin-top: 0.75rem;
    padding: 0.85rem 1rem;
    border-radius: var(--radius-sm);
    background: rgba(255, 255, 255, 0.85);
    border: 1px solid rgba(15, 23, 42, 0.08);
    color: rgba(67, 56, 202, 0.75);
    font-size: 0.93rem;
}

.tip-list {
    margin-top: var(--spacing-sm);
    padding: 1.1rem 1.25rem;
    border-radius: var(--radius-md);
    background: rgba(14, 165, 233, 0.1);
    border: 1px solid rgba(14, 165, 233, 0.22);
    color: rgba(29, 78, 216, 0.8);
    display: grid;
    gap: 0.5rem;
    font-size: 0.95rem;
}

.tip-list li {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    list-style: none;
}

.tip-list li::before {
    content: '•';
    color: var(--accent-purple);
}

.result-header-inline {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    margin-bottom: var(--spacing-sm);
    color: var(--text-primary);
}

.result-hint {
    color: rgba(107, 114, 128, 0.75);
    font-size: 0.9rem;
    letter-spacing: 0.03em;
}

.section-title {
    font-size: 1.35rem;
    letter-spacing: 0.01em;
}

.result-container {
    display: grid;
    gap: 1rem;
}

.result-card {
    background: var(--bg-card-light);
    border: 1px solid rgba(148, 163, 184, 0.2);
    border-radius: var(--radius-md);
    padding: 1.1rem 1.2rem;
    display: grid;
    gap: 0.75rem;
}

.result-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.result-title {
    font-size: 0.95rem;
    letter-spacing: 0.08em;
    color: rgba(107, 114, 128, 0.95);
}

.hash-value {
    font-family: 'JetBrains Mono', 'SFMono-Regular', Menlo, Monaco, Consolas, 'Liberation Mono', 'Courier New', monospace;
    font-size: 0.98rem;
    letter-spacing: 0.02em;
    line-height: 1.7;
    color: var(--text-primary);
    word-break: break-all;
}

.result-actions {
    display: flex;
    gap: 0.4rem;
}

.btn-copy {
    background: rgba(37, 99, 235, 0.08);
    color: var(--accent-blue);
    border: 1px solid rgba(37, 99, 235, 0.22);
    border-radius: var(--radius-sm);
    padding: 0.5rem 1.1rem;
    font-weight: 600;
    transition: all 0.2s ease;
}

.btn-copy:hover {
    background: rgba(37, 99, 235, 0.18);
    border-color: rgba(37, 99, 235, 0.35);
}

.result-placeholder {
    padding: 1.8rem 1.4rem;
    border-radius: var(--radius-md);
    background: rgba(255, 255, 255, 0.85);
    border: 1px dashed rgba(15, 23, 42, 0.08);
    color: rgba(75, 85, 99, 0.8);
    text-align: center;
}

.progress-bar {
    height: 6px;
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.08);
    overflow: hidden;
}

.progress-bar-fill {
    height: 100%;
    width: 0;
    background: linear-gradient(90deg, var(--accent-teal), var(--accent-purple));
    transition: width 0.25s ease;
}

.status-text {
    font-size: 0.9rem;
    color: rgba(107, 114, 128, 0.75);
}

.faq-block {
    margin-top: var(--spacing-md);
}

.faq-section {
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(15, 23, 42, 0.08);
    border-radius: var(--radius-md);
    padding: 1.6rem 1.5rem;
    box-shadow: 0 14px 36px rgba(15, 23, 42, 0.08);
}

.faq-list {
    display: grid;
    gap: 0.9rem;
    margin-top: var(--spacing-sm);
}

.faq-item {
    border: none;
    border-radius: var(--radius-sm);
    background: rgba(249, 250, 251, 0.9);
    padding: 1rem 1.1rem;
    color: rgba(75, 85, 99, 0.85);
}

.faq-item[open] .faq-title {
    color: var(--accent-blue);
}

.faq-title {
    font-size: 1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

details summary::-webkit-details-marker {
    display: none;
}

summary::after {
    content: '+';
    color: rgba(107, 114, 128, 0.7);
    font-size: 1.1rem;
    margin-left: auto;
}

.faq-item[open] summary::after {
    content: '−';
    color: var(--accent-blue);
}

.faq-text {
    margin-top: 0.6rem;
    line-height: 1.7;
}

/* ==========================================
   Links Section (友情链接)
   ========================================== */
.links-section {
    margin-top: var(--spacing-md);
    padding: var(--spacing-sm) 0;
    border-top: 1px solid var(--border-color);
}

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

.links-label {
    font-size: 0.85rem;
    color: rgba(107, 114, 128, 0.7);
    font-weight: 500;
}

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

.link-item {
    font-size: 0.85rem;
    color: rgba(75, 85, 99, 0.75);
    text-decoration: none;
    transition: color 0.2s ease;
    padding: 0.25rem 0.5rem;
}

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

.link-item:not(:last-child)::after {
    content: '|';
    margin-left: 0.5rem;
    color: rgba(107, 114, 128, 0.4);
}

.footer {
    text-align: center;
    color: rgba(107, 114, 128, 0.75);
    font-size: 0.9rem;
    padding: var(--spacing-sm) 0;
}

.toast {
    position: fixed;
    top: 22px;
    right: 22px;
    background: rgba(37, 99, 235, 0.9);
    color: #ffffff;
    padding: 0.85rem 1.4rem;
    border-radius: var(--radius-sm);
    box-shadow: 0 12px 32px rgba(37, 99, 235, 0.18);
    animation: slideIn 0.3s ease, fadeOut 0.4s ease 2.6s forwards;
    z-index: 1000;
}

.toast.error {
    background: rgba(220, 38, 38, 0.9);
}

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

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

@media (max-width: 1100px) {
    .content-grid {
        grid-template-columns: 1fr;
    }

    .insight-panel {
        order: -1;
    }

    .faq-block {
        margin-top: var(--spacing-md);
    }
}

@media (max-width: 768px) {
    body {
        padding: var(--spacing-md) var(--spacing-xs);
    }

    .panel {
        padding: var(--spacing-md);
        border-radius: var(--radius-md);
    }

    .title {
        font-size: 2.2rem;
    }

    .subtitle {
        font-size: 1rem;
    }

    .input-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .btn {
        width: 100%;
    }

    .faq-section {
        padding: 1.3rem 1.2rem;
    }
}

@media (max-width: 520px) {
    .content-grid {
        gap: var(--spacing-md);
    }

    .result-header-inline {
        flex-direction: column;
        align-items: flex-start;
    }

    .tip-list {
        padding: 0.9rem 1rem;
        font-size: 0.9rem;
    }

    .faq-item {
        padding: 0.85rem 0.9rem;
    }

    .hash-value {
        font-size: 0.92rem;
    }

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

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

    .link-item {
        font-size: 0.8rem;
    }
}

