/* 全局变量定义 */
:root {
    --bg-primary: #0b0f19;
    --card-bg: rgba(17, 24, 39, 0.6);
    --border-color: rgba(255, 255, 255, 0.08);
    --text-primary: #f3f4f6;
    --text-secondary: #9ca3af;
    --accent-color: #6366f1;
    --accent-gradient: linear-gradient(135deg, #6366f1 0%, #a855f7 100%);
    --danger-color: #ef4444;
    --success-color: #10b981;
    --warning-color: #f59e0b;
    --font-sans: 'Outfit', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    --font-mono: 'Consolas', 'Monaco', 'Fira Code', 'JetBrains Mono', monospace;
    --transition-smooth: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* 基础重置 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background-color: var(--bg-primary);
    color: var(--text-primary);
    font-family: var(--font-sans);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
    position: relative;
}

/* 背景霓虹光晕 */
.background-glow {
    position: absolute;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(99, 102, 241, 0.15) 0%, rgba(168, 85, 247, 0.05) 50%, rgba(0,0,0,0) 100%);
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 0;
    pointer-events: none;
    filter: blur(80px);
}

/* 主容器 */
.container {
    width: 90%;
    max-width: 1000px;
    height: 85vh;
    z-index: 1;
    display: flex;
    flex-direction: column;
}

/* 磨砂玻璃卡片 */
.note-card {
    background: var(--card-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    height: 100%;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transition: var(--transition-smooth);
}

.note-card:hover {
    border-color: rgba(255, 255, 255, 0.12);
    box-shadow: 0 25px 60px -10px rgba(99, 102, 241, 0.1);
}

/* 头部样式 */
.note-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 30px;
    border-bottom: 1px solid var(--border-color);
    background: rgba(0, 0, 0, 0.15);
    flex-wrap: wrap;
    gap: 15px;
}

/* LOGO 区 */
.logo-section {
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo-icon {
    background: var(--accent-gradient);
    width: 38px;
    height: 38px;
    border-radius: 10px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.1rem;
    box-shadow: 0 8px 16px rgba(99, 102, 241, 0.3);
}

.logo-text {
    font-size: 1.25rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    background: linear-gradient(to right, #ffffff, #d1d5db);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* 短链分享区 */
.share-section {
    display: flex;
    align-items: center;
    gap: 10px;
}

.share-label {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.share-badge {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border-color);
    padding: 6px 14px;
    border-radius: 30px;
    font-family: var(--font-mono);
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text-primary);
}

#short-url {
    letter-spacing: 0.5px;
}

#copy-btn {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 0.95rem;
    transition: var(--transition-smooth);
    display: flex;
    align-items: center;
}

#copy-btn:hover {
    color: #a855f7;
    transform: scale(1.1);
}

/* 状态指示区 */
.status-section {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.03);
    padding: 6px 14px;
    border-radius: 30px;
    border: 1px solid var(--border-color);
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    transition: var(--transition-smooth);
}

.status-dot.idled {
    background-color: var(--text-secondary);
    box-shadow: 0 0 8px rgba(156, 163, 175, 0.4);
}

.status-dot.saving {
    background-color: var(--warning-color);
    box-shadow: 0 0 10px rgba(245, 158, 11, 0.6);
    animation: pulse 1s infinite alternate;
}

.status-dot.saved {
    background-color: var(--success-color);
    box-shadow: 0 0 10px rgba(16, 185, 129, 0.6);
}

.status-dot.error {
    background-color: var(--danger-color);
    box-shadow: 0 0 12px rgba(239, 68, 68, 0.8);
    animation: pulse 0.5s infinite alternate;
}

.status-text {
    font-size: 0.8rem;
    color: var(--text-secondary);
    font-weight: 500;
}

/* 编辑器核心 */
.note-main {
    flex: 1;
    position: relative;
    background: rgba(0, 0, 0, 0.08);
}

#note-textarea {
    width: 100%;
    height: 100%;
    background: transparent;
    border: none;
    resize: none;
    outline: none;
    color: var(--text-primary);
    font-family: var(--font-mono);
    font-size: 1.05rem;
    line-height: 1.65;
    padding: 30px;
    scrollbar-width: thin;
    scrollbar-color: rgba(255,255,255,0.1) transparent;
}

#note-textarea::placeholder {
    color: rgba(156, 163, 175, 0.45);
    font-style: italic;
}

#note-textarea::-webkit-scrollbar {
    width: 8px;
}

#note-textarea::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.08);
    border-radius: 4px;
}

#note-textarea::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.16);
}

/* 底部样式 */
.note-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 15px 30px;
    border-top: 1px solid var(--border-color);
    background: rgba(0, 0, 0, 0.15);
}

.stat-item {
    font-size: 0.85rem;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 6px;
}

.actions-group {
    display: flex;
    gap: 12px;
}

/* 按钮通用设计 */
.btn-action {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 8px 18px;
    border-radius: 8px;
    font-family: var(--font-sans);
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: var(--transition-smooth);
}

.btn-action.danger:hover {
    background: rgba(239, 68, 68, 0.1);
    border-color: rgba(239, 68, 68, 0.3);
    color: var(--danger-color);
}

.btn-action.primary {
    background: var(--accent-gradient);
    border: none;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.25);
}

.btn-action.primary:hover {
    box-shadow: 0 6px 16px rgba(99, 102, 241, 0.4);
    transform: translateY(-1px);
}

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

/* Toast 提示 */
.toast {
    position: fixed;
    bottom: 40px;
    left: 50%;
    transform: translateX(-50%) translateY(30px);
    background: rgba(99, 102, 241, 0.95);
    color: #ffffff;
    padding: 10px 24px;
    border-radius: 30px;
    font-size: 0.9rem;
    font-weight: 600;
    box-shadow: 0 10px 25px rgba(99, 102, 241, 0.3);
    opacity: 0;
    pointer-events: none;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    z-index: 999;
}

.toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* 呼吸动画 */
@keyframes pulse {
    0% {
        opacity: 0.4;
    }
    100% {
        opacity: 1;
    }
}

/* 响应式调整 */
@media (max-width: 768px) {
    .note-header {
        padding: 15px 20px;
    }
    .note-footer {
        padding: 15px 20px;
    }
    #note-textarea {
        padding: 20px;
    }
    .container {
        height: 92vh;
    }
}
