* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #2563eb;
    --primary-dark: #1d4ed8;
    --secondary-color: #10b981;
    --danger-color: #ef4444;
    --text-primary: #1f2937;
    --text-secondary: #6b7280;
    --bg-primary: #ffffff;
    --bg-secondary: #f9fafb;
    --border-color: #e5e7eb;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Helvetica Neue', Arial, sans-serif;
    background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
    color: var(--text-primary);
    min-height: 100vh;
    line-height: 1.6;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

header {
    background: var(--bg-primary);
    border-bottom: 1px solid var(--border-color);
    padding: 20px 0;
    box-shadow: var(--shadow-sm);
    animation: slideDown 0.5s ease-out;
}

.header-content {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo-icon {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
    font-size: 20px;
    animation: pulse 2s infinite;
}

h1 {
    font-size: 1.8em;
    font-weight: 700;
    color: var(--text-primary);
}

.subtitle {
    color: var(--text-secondary);
    font-size: 0.9em;
}

.author-link {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
    transition: var(--transition);
}

.author-link:hover {
    color: var(--primary-dark);
    text-decoration: underline;
}

main {
    flex: 1;
    display: flex;
    gap: 20px;
    padding: 20px;
    animation: fadeIn 0.8s ease-out;
}

.input-panel {
    flex: 1;
    background: var(--bg-primary);
    border-radius: 16px;
    padding: 30px;
    box-shadow: var(--shadow-md);
    min-width: 0;
    display: flex;
    flex-direction: column;
    animation: slideInLeft 0.6s ease-out;
}

.result-panel {
    flex: 1;
    background: var(--bg-primary);
    border-radius: 16px;
    padding: 30px;
    box-shadow: var(--shadow-md);
    min-width: 0;
    display: flex;
    flex-direction: column;
    animation: slideInRight 0.6s ease-out;
}

.panel-header {
    margin-bottom: 25px;
}

.panel-title {
    font-size: 1.3em;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.panel-subtitle {
    color: var(--text-secondary);
    font-size: 0.9em;
}

label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: var(--text-primary);
    font-size: 0.95em;
}

textarea {
    width: 100%;
    height: 200px;
    padding: 15px;
    border: 2px solid var(--border-color);
    border-radius: 12px;
    font-size: 14px;
    font-family: 'SF Mono', 'Monaco', 'Inconsolata', 'Roboto Mono', monospace;
    resize: vertical;
    transition: var(--transition);
    background: var(--bg-secondary);
}

textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
    background: var(--bg-primary);
}

.button-group {
    display: flex;
    gap: 12px;
    margin-top: 20px;
}

button {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    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.3);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

button:active::before {
    width: 300px;
    height: 300px;
}

.parse-btn {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: white;
    flex: 1;
}

.parse-btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.parse-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.clear-btn {
    background: var(--bg-secondary);
    color: var(--text-secondary);
}

.clear-btn:hover {
    background: var(--border-color);
}

.sample-section {
    margin-top: 20px;
    padding: 15px;
    background: var(--bg-secondary);
    border-radius: 8px;
    border-left: 3px solid var(--primary-color);
}

.sample-label {
    font-size: 0.85em;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.sample-jwt {
    font-family: 'SF Mono', 'Monaco', 'Inconsolata', 'Roboto Mono', monospace;
    font-size: 12px;
    color: var(--primary-color);
    background: var(--bg-primary);
    padding: 8px 12px;
    border-radius: 6px;
    cursor: pointer;
    transition: var(--transition);
    word-break: break-all;
    border: 1px solid var(--border-color);
}

.sample-jwt:hover {
    background: var(--primary-color);
    color: white;
    transform: translateX(5px);
}

.result-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 16px;
    min-height: 0;
}

.jwt-card {
    background: var(--bg-secondary);
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid var(--border-color);
    transition: var(--transition);
    opacity: 0;
    transform: translateY(20px);
    animation: fadeInUp 0.5s ease-out forwards;
}

.jwt-card:nth-child(1) { animation-delay: 0.1s; }
.jwt-card:nth-child(2) { animation-delay: 0.2s; }
.jwt-card:nth-child(3) { animation-delay: 0.3s; }

.jwt-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.card-header {
    padding: 15px 20px;
    background: var(--bg-primary);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.card-title {
    font-weight: 600;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 8px;
}

.card-icon {
    width: 24px;
    height: 24px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
}

.header-icon { background: #dbeafe; color: #1e40af; }
.payload-icon { background: #dcfce7; color: #15803d; }
.signature-icon { background: #fef3c7; color: #b45309; }

.copy-btn {
    padding: 6px 12px;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 12px;
    cursor: pointer;
    transition: var(--transition);
    color: var(--text-secondary);
}

.copy-btn:hover {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
    transform: scale(1.05);
}

.card-content {
    padding: 20px;
}

.json-content {
    white-space: pre-wrap;
    font-family: 'SF Mono', 'Monaco', 'Inconsolata', 'Roboto Mono', monospace;
    font-size: 13px;
    line-height: 1.5;
    color: var(--text-primary);
    background: var(--bg-primary);
    padding: 15px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    overflow-x: auto;
    max-height: 200px;
    overflow-y: auto;
}

.time-highlight {
    background: linear-gradient(135deg, #fef3c7, #fde68a);
    border-left: 3px solid #f59e0b;
    margin: 8px 0;
    padding: 12px;
    border-radius: 6px;
    animation: timeGlow 2s ease-in-out infinite;
}

.time-expired {
    background: linear-gradient(135deg, #fee2e2, #fecaca);
    border-left: 3px solid #ef4444;
}

.time-valid {
    background: linear-gradient(135deg, #d1fae5, #a7f3d0);
    border-left: 3px solid #10b981;
}

.time-warning {
    background: linear-gradient(135deg, #fef3c7, #fde68a);
    border-left: 3px solid #f59e0b;
}

.time-header {
    font-weight: 600;
    color: #92400e;
    margin-bottom: 4px;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.time-content {
    font-size: 13px;
    color: #78350f;
    line-height: 1.4;
}

.time-chinese {
    font-weight: 600;
    font-size: 14px;
    color: #1f2937;
    margin-bottom: 4px;
}

.time-status {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    margin-top: 4px;
}

.status-expired {
    background: #ef4444;
    color: white;
}

.status-valid {
    background: #10b981;
    color: white;
}

.status-warning {
    background: #f59e0b;
    color: white;
}

@keyframes timeGlow {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.8; }
}

.signature-content {
    font-family: 'SF Mono', 'Monaco', 'Inconsolata', 'Roboto Mono', monospace;
    font-size: 13px;
    word-break: break-all;
    color: var(--text-secondary);
    background: var(--bg-primary);
    padding: 15px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    max-height: 200px;
    overflow-y: auto;
}

.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    min-height: 300px;
    color: var(--text-secondary);
    text-align: center;
}

.empty-icon {
    width: 80px;
    height: 80px;
    background: var(--bg-secondary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 40px;
    margin-bottom: 20px;
    opacity: 0.5;
}

.empty-title {
    font-size: 1.2em;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--text-primary);
}

.empty-description {
    font-size: 0.9em;
}

.error-toast {
    position: fixed;
    top: 20px;
    right: 20px;
    background: var(--danger-color);
    color: white;
    padding: 15px 20px;
    border-radius: 8px;
    box-shadow: var(--shadow-lg);
    display: none;
    align-items: center;
    gap: 12px;
    max-width: 400px;
    z-index: 1000;
    animation: slideInRight 0.3s ease-out;
}

.error-toast.active {
    display: flex;
}

.error-icon {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

.success-toast {
    position: fixed;
    top: 20px;
    right: 20px;
    background: var(--secondary-color);
    color: white;
    padding: 12px 20px;
    border-radius: 8px;
    box-shadow: var(--shadow-lg);
    display: none;
    align-items: center;
    gap: 12px;
    z-index: 1000;
    animation: slideInRight 0.3s ease-out;
}

.success-toast.active {
    display: flex;
}

/* 动画 */
@keyframes slideDown {
    from { transform: translateY(-100%); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

@keyframes slideInLeft {
    from { transform: translateX(-50px); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

@keyframes slideInRight {
    from { transform: translateX(50px); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes fadeInUp {
    to { opacity: 1; transform: translateY(0); }
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

/* 响应式设计 */
@media (max-width: 968px) {
    main {
        flex-direction: column;
        padding: 15px;
    }

    .input-panel,
    .result-panel {
        animation: fadeIn 0.6s ease-out;
    }

    .header-content {
        flex-direction: column;
        text-align: center;
        gap: 15px;
    }

    h1 {
        font-size: 1.5em;
    }
}

@media (max-width: 480px) {
    .input-panel,
    .result-panel {
        padding: 20px;
        border-radius: 12px;
    }

    .button-group {
        flex-direction: column;
    }

    button {
        width: 100%;
    }

    .card-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .copy-btn {
        align-self: flex-end;
    }
}

/* 滚动条样式 */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: var(--bg-secondary);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-secondary);
}