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

:root {
    --primary-color: #6366f1;
    --success-color: #10b981;
    --danger-color: #ef4444;
    --warning-color: #f59e0b;
    --text-color: #1f2937;
    --border-color: #e5e7eb;
    --bg-color: #f9fafb;
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB',
                 'Microsoft YaHei', sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
    color: var(--text-color);
    position: relative;
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background:
        radial-gradient(circle at 20% 50%, rgba(120, 119, 198, 0.3), transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(255, 119, 198, 0.3), transparent 50%),
        radial-gradient(circle at 40% 20%, rgba(138, 180, 248, 0.3), transparent 50%);
    animation: gradient 15s ease infinite;
    pointer-events: none;
    z-index: 0;
}

@keyframes gradient {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.8; }
}

.container {
    max-width: 1100px;
    margin: 0 auto;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(20px);
    border-radius: 24px;
    box-shadow: var(--shadow-lg);
    overflow: hidden;
    position: relative;
    z-index: 1;
    border: 1px solid rgba(255, 255, 255, 0.5);
}

header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 35px 30px;
    text-align: center;
    position: relative;
    overflow: hidden;
}

header::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.1) 1px, transparent 1px);
    background-size: 50px 50px;
    animation: moveBackground 20s linear infinite;
}

@keyframes moveBackground {
    0% { transform: translate(0, 0); }
    100% { transform: translate(50px, 50px); }
}

.header-icon {
    font-size: 2.5rem;
    margin-bottom: 10px;
    animation: float 3s ease-in-out infinite;
    position: relative;
    z-index: 1;
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.2));
}

@keyframes float {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-10px); }
}

header h1 {
    font-size: 1.75rem;
    margin-bottom: 8px;
    font-weight: 700;
    letter-spacing: -0.3px;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
    position: relative;
    z-index: 1;
}

.subtitle {
    opacity: 0.95;
    font-size: 0.9rem;
    font-weight: 400;
    position: relative;
    z-index: 1;
}

.status-bar {
    background: linear-gradient(to right, #f8f9fa, #ffffff);
    padding: 16px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 2px solid var(--border-color);
    font-size: 0.9rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.status-left {
    display: flex;
    align-items: center;
    gap: 10px;
}

.status-indicator {
    font-size: 0.8rem;
    color: #9ca3af;
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.status-success .status-indicator {
    color: var(--success-color);
}

.status-error .status-indicator {
    color: var(--danger-color);
}

.status-warning .status-indicator {
    color: var(--warning-color);
}

#status-text {
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

.status-success {
    color: var(--success-color);
    animation: fadeIn 0.3s ease;
}

.status-error {
    color: var(--danger-color);
    animation: shake 0.5s ease;
}

.status-warning {
    color: var(--warning-color);
    animation: fadeIn 0.3s ease;
}

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

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

#last-saved {
    color: #666;
    font-size: 0.85rem;
}

.editor-container {
    padding: 30px;
}

.toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 15px;
    padding: 20px;
    background: linear-gradient(to right, #f8f9fa, #ffffff);
    border-radius: 12px;
    border: 1px solid var(--border-color);
}

.toolbar-label {
    font-weight: 700;
    color: var(--text-color);
    font-size: 1rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

.toolbar-label::before {
    content: '✏️';
    font-size: 1.2rem;
}

.toolbar-buttons {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 600;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    position: relative;
    overflow: hidden;
}

.btn::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;
}

.btn:hover::before {
    width: 300px;
    height: 300px;
}

.btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

.btn:active {
    transform: translateY(-1px);
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color), #8b5cf6);
    color: white;
}

.btn-success {
    background: linear-gradient(135deg, var(--success-color), #059669);
    color: white;
}

.btn-danger {
    background: linear-gradient(135deg, var(--danger-color), #dc2626);
    color: white;
}

.editor {
    min-height: 350px;
    max-height: 550px;
    overflow-y: auto;
    padding: 24px;
    border: 2px solid var(--border-color);
    border-radius: 12px;
    background: white;
    outline: none;
    font-size: 1rem;
    line-height: 1.8;
    transition: all 0.3s ease;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.02);
}

.editor:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.1), inset 0 2px 4px rgba(0, 0, 0, 0.02);
}

.editor:hover {
    border-color: #c7d2fe;
}

.editor .placeholder {
    color: #999;
    font-style: italic;
    pointer-events: none;
}

.editor:empty::before {
    content: '在此处按 Ctrl+V 粘贴富文本内容，或直接编辑...';
    color: #999;
    font-style: italic;
}

/* 富文本样式保持 */
.editor p {
    margin-bottom: 0.5em;
}

.editor h1, .editor h2, .editor h3 {
    margin-top: 0.5em;
    margin-bottom: 0.3em;
}

.editor ul, .editor ol {
    margin-left: 2em;
    margin-bottom: 0.5em;
}

.editor a {
    color: #2196F3;
    text-decoration: none;
}

.editor a:hover {
    text-decoration: underline;
}

.editor img {
    max-width: 100%;
    height: auto;
    border-radius: 4px;
}

.editor table {
    border-collapse: collapse;
    width: 100%;
    margin-bottom: 1em;
}

.editor th, .editor td {
    border: 1px solid var(--border-color);
    padding: 8px;
}

.editor th {
    background: #f5f5f5;
}

.info-panel {
    padding: 30px;
    background: linear-gradient(to bottom, #f8f9fa, #ffffff);
    border-top: 2px solid var(--border-color);
}

.info-panel h3 {
    margin-bottom: 20px;
    color: var(--text-color);
    font-size: 1.2rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 8px;
}

.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
}

.info-item {
    background: white;
    padding: 24px;
    border-radius: 12px;
    border: 2px solid var(--border-color);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.info-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: linear-gradient(to bottom, var(--primary-color), var(--success-color));
    opacity: 0;
    transition: opacity 0.3s ease;
}

.info-item:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    border-color: var(--primary-color);
}

.info-item:hover::before {
    opacity: 1;
}

.info-icon {
    font-size: 2rem;
    margin-bottom: 4px;
    filter: grayscale(0.2);
}

.info-label {
    display: block;
    color: var(--text-color);
    font-size: 0.9rem;
    font-weight: 700;
    letter-spacing: 0.3px;
}

.info-desc {
    display: block;
    color: #9ca3af;
    font-size: 0.75rem;
    line-height: 1.4;
    margin-bottom: 4px;
    font-weight: 400;
}

.info-value {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-color);
    background: linear-gradient(135deg, var(--primary-color), var(--success-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-top: 4px;
}

.status-saved {
    color: var(--success-color) !important;
    font-weight: 600;
}

.help-section {
    padding: 30px;
    border-top: 2px solid var(--border-color);
    background: #f9fafb;
}

.help-section h3 {
    margin-bottom: 20px;
    color: var(--text-color);
    font-size: 1.2rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 8px;
}

.help-section ul {
    list-style: none;
    padding: 0;
    display: grid;
    gap: 12px;
}

.help-section li {
    padding: 16px 20px;
    padding-left: 50px;
    position: relative;
    line-height: 1.7;
    background: white;
    border-radius: 10px;
    border: 1px solid var(--border-color);
    transition: all 0.3s ease;
}

.help-section li:hover {
    transform: translateX(5px);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    border-color: var(--primary-color);
}

.help-section li::before {
    content: '✨';
    position: absolute;
    left: 18px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1.2rem;
    transition: transform 0.3s ease;
}

.help-section li:hover::before {
    transform: translateY(-50%) scale(1.2);
}

.help-section kbd {
    display: inline-block;
    padding: 4px 10px;
    font-size: 0.85em;
    background: linear-gradient(to bottom, #ffffff, #f3f4f6);
    border: 2px solid #d1d5db;
    border-radius: 6px;
    box-shadow: 0 2px 0 #d1d5db, 0 3px 4px rgba(0, 0, 0, 0.1);
    font-family: 'SF Mono', 'Monaco', 'Inconsolata', 'Fira Code', monospace;
    font-weight: 600;
    color: var(--text-color);
}

/* 滚动条样式 */
.editor::-webkit-scrollbar {
    width: 10px;
}

.editor::-webkit-scrollbar-track {
    background: #f1f5f9;
    border-radius: 10px;
}

.editor::-webkit-scrollbar-thumb {
    background: linear-gradient(to bottom, var(--primary-color), var(--success-color));
    border-radius: 10px;
    border: 2px solid #f1f5f9;
}

.editor::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(to bottom, #4f46e5, #059669);
}

/* 平滑过渡 */
* {
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

/* 按钮加载动画 */
.btn.loading {
    position: relative;
    color: transparent;
    pointer-events: none;
}

.btn.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* 卡片入场动画 */
.info-item {
    animation: slideUp 0.5s ease;
}

.info-item:nth-child(1) { animation-delay: 0.1s; }
.info-item:nth-child(2) { animation-delay: 0.2s; }
.info-item:nth-child(3) { animation-delay: 0.3s; }

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

/* 帮助项入场动画 */
.help-section li {
    animation: fadeInLeft 0.5s ease;
}

.help-section li:nth-child(1) { animation-delay: 0.1s; }
.help-section li:nth-child(2) { animation-delay: 0.2s; }
.help-section li:nth-child(3) { animation-delay: 0.3s; }
.help-section li:nth-child(4) { animation-delay: 0.4s; }
.help-section li:nth-child(5) { animation-delay: 0.5s; }

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

/* 响应式设计 */
@media (max-width: 768px) {
    body {
        padding: 10px;
    }
    
    body::before {
        animation: none;
    }
    
    .header-icon {
        font-size: 3rem;
    }
    
    header h1 {
        font-size: 1.8rem;
    }
    
    header {
        padding: 35px 20px;
    }
    
    .editor-container {
        padding: 20px;
    }
    
    .toolbar {
        flex-direction: column;
        align-items: stretch;
        padding: 15px;
    }
    
    .toolbar-label {
        text-align: center;
    }
    
    .toolbar-buttons {
        justify-content: stretch;
        flex-direction: column;
    }
    
    .btn {
        width: 100%;
        text-align: center;
    }
    
    .info-grid {
        grid-template-columns: 1fr;
    }
    
    .status-bar {
        flex-direction: column;
        gap: 8px;
        align-items: flex-start;
    }
    
    #last-saved {
        font-size: 0.8rem;
    }
}

@media (max-width: 480px) {
    .container {
        border-radius: 16px;
    }
    
    header h1 {
        font-size: 1.5rem;
    }
    
    .subtitle {
        font-size: 0.9rem;
    }
    
    .editor {
        min-height: 250px;
        padding: 16px;
    }
}

/* 打印样式 */
@media print {
    body {
        background: white;
    }
    
    .container {
        box-shadow: none;
    }
    
    .toolbar,
    .status-bar,
    .info-panel,
    .help-section {
        display: none;
    }
    
    .editor {
        border: 1px solid #ddd;
        min-height: auto;
        max-height: none;
    }
}