/* GeekMind - 极客简约风格样式 */

/* CSS 变量 */
:root {
    --bg-primary: #0d1117;
    --bg-secondary: #161b22;
    --bg-tertiary: #21262d;
    --border-color: #30363d;
    --text-primary: #c9d1d9;
    --text-secondary: #8b949e;
    --text-muted: #6e7681;
    --accent-green: #2ea043;
    --accent-blue: #58a6ff;
    --accent-purple: #a371f7;
    --accent-orange: #f0883e;
    --accent-red: #f85149;
    --shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
    --radius: 6px;
    --radius-lg: 12px;
    --transition: all 0.2s ease;
}

/* 重置样式 */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

/* 基础样式 */
html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    overflow-x: hidden;
}

/* 滚动条样式 */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-secondary);
}

::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* 视图切换 */
.view {
    display: none;
    min-height: 100vh;
}

.view.active {
    display: block;
}

/* ============ 认证界面 ============ */
.auth-container {
    max-width: 400px;
    margin: 0 auto;
    padding: 60px 24px;
    text-align: center;
}

.logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-bottom: 8px;
}

.logo .prompt {
    font-family: 'JetBrains Mono', monospace;
    font-size: 2rem;
    font-weight: 700;
    color: var(--accent-green);
    text-shadow: 0 0 10px rgba(46, 160, 67, 0.4);
}

.logo h1 {
    font-family: 'JetBrains Mono', monospace;
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-primary);
}

.tagline {
    color: var(--text-secondary);
    margin-bottom: 40px;
    font-size: 0.9rem;
}

/* 表单样式 */
.auth-form {
    text-align: left;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-size: 0.875rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.form-group input {
    width: 100%;
    padding: 12px 16px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    color: var(--text-primary);
    font-size: 1rem;
    font-family: inherit;
    transition: var(--transition);
}

.form-group input:focus {
    outline: none;
    border-color: var(--accent-blue);
    box-shadow: 0 0 0 3px rgba(88, 166, 255, 0.15);
}

.form-group input::placeholder {
    color: var(--text-muted);
}

/* 按钮样式 */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 24px;
    border: none;
    border-radius: var(--radius);
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    font-family: inherit;
}

.btn-primary {
    width: 100%;
    background: var(--accent-green);
    color: #fff;
}

.btn-primary:hover {
    background: #3fb950;
    transform: translateY(-1px);
}

.btn-secondary {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    background: var(--border-color);
}

.btn-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: transparent;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    color: var(--text-secondary);
    cursor: pointer;
    transition: var(--transition);
}

.btn-icon:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border-color: var(--text-muted);
}

.switch-mode {
    text-align: center;
    margin-top: 24px;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.switch-mode a {
    color: var(--accent-blue);
    text-decoration: none;
    font-weight: 500;
}

.switch-mode a:hover {
    text-decoration: underline;
}

.error-message {
    margin-top: 16px;
    padding: 12px 16px;
    background: rgba(248, 81, 73, 0.1);
    border: 1px solid var(--accent-red);
    border-radius: var(--radius);
    color: var(--accent-red);
    font-size: 0.875rem;
    text-align: center;
}

.hidden {
    display: none !important;
}

/* ============ 主应用界面 ============ */
.app-header {
    position: sticky;
    top: 0;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 20px;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
    backdrop-filter: blur(10px);
}

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

.logo-small {
    font-family: 'JetBrains Mono', monospace;
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--accent-green);
}

.app-title {
    font-family: 'JetBrains Mono', monospace;
    font-size: 1rem;
    font-weight: 500;
    color: var(--text-secondary);
}

.header-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.view-toggle {
    display: flex;
    background: var(--bg-tertiary);
    border-radius: var(--radius);
    padding: 4px;
}

.toggle-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 32px;
    background: transparent;
    border: none;
    border-radius: 4px;
    color: var(--text-muted);
    cursor: pointer;
    transition: var(--transition);
}

.toggle-btn:hover {
    color: var(--text-secondary);
}

.toggle-btn.active {
    background: var(--bg-secondary);
    color: var(--accent-blue);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

/* 输入区域 */
.input-area {
    position: sticky;
    top: 57px;
    z-index: 90;
    padding: 16px 20px;
    background: var(--bg-primary);
    border-bottom: 1px solid var(--border-color);
}

.input-container {
    display: flex;
    gap: 12px;
    align-items: flex-end;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 12px 16px;
    transition: var(--transition);
}

.input-container:focus-within {
    border-color: var(--accent-blue);
    box-shadow: 0 0 0 3px rgba(88, 166, 255, 0.1);
}

#thought-input {
    flex: 1;
    background: transparent;
    border: none;
    color: var(--text-primary);
    font-size: 1rem;
    font-family: inherit;
    resize: none;
    min-height: 24px;
    max-height: 150px;
    line-height: 1.5;
}

#thought-input:focus {
    outline: none;
}

#thought-input::placeholder {
    color: var(--text-muted);
}

.input-actions {
    display: flex;
    gap: 8px;
    align-items: center;
}

#voice-btn.recording {
    color: var(--accent-red);
    animation: pulse 1s infinite;
}

#submit-btn {
    padding: 8px 20px;
    font-size: 0.9rem;
}

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

.voice-indicator {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 12px;
    padding: 10px 16px;
    background: rgba(248, 81, 73, 0.1);
    border: 1px solid var(--accent-red);
    border-radius: var(--radius);
    color: var(--accent-red);
    font-size: 0.875rem;
    font-family: 'JetBrains Mono', monospace;
}

.pulse {
    width: 10px;
    height: 10px;
    background: var(--accent-red);
    border-radius: 50%;
    animation: pulse 1s infinite;
}

/* 内容区域 */
.content-area {
    padding: 20px;
    min-height: calc(100vh - 150px);
}

.view-content {
    display: none;
}

.view-content.active {
    display: block;
}

/* ============ 时间轴视图 ============ */
.timeline {
    max-width: 800px;
    margin: 0 auto;
}

.timeline-item {
    position: relative;
    padding-left: 32px;
    padding-bottom: 24px;
    border-left: 2px solid var(--border-color);
}

.timeline-item:last-child {
    border-left-color: transparent;
}

.timeline-dot {
    position: absolute;
    left: -7px;
    top: 0;
    width: 12px;
    height: 12px;
    background: var(--accent-blue);
    border-radius: 50%;
    border: 2px solid var(--bg-primary);
}

.timeline-item.status-todo .timeline-dot {
    background: var(--accent-orange);
}

.timeline-item.status-done .timeline-dot {
    background: var(--accent-green);
}

.thought-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 16px 20px;
    transition: var(--transition);
}

.thought-card:hover {
    border-color: var(--text-muted);
    transform: translateX(4px);
}

.thought-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
}

.thought-meta {
    display: flex;
    align-items: center;
    gap: 10px;
}

.thought-status {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    background: var(--bg-tertiary);
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.status-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
}

.status-idea .status-dot { background: var(--accent-blue); }
.status-idea { color: var(--accent-blue); }

.status-todo .status-dot { background: var(--accent-orange); }
.status-todo { color: var(--accent-orange); }

.status-done .status-dot { background: var(--accent-green); }
.status-done { color: var(--accent-green); }

.thought-time {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.75rem;
    color: var(--text-muted);
}

.thought-actions {
    display: flex;
    gap: 6px;
    opacity: 0;
    transition: var(--transition);
}

.thought-card:hover .thought-actions {
    opacity: 1;
}

.thought-actions button {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    color: var(--text-muted);
    cursor: pointer;
    transition: var(--transition);
}

.thought-actions button:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.thought-actions button.delete-btn:hover {
    color: var(--accent-red);
    border-color: var(--accent-red);
}

.thought-content {
    color: var(--text-primary);
    font-size: 0.95rem;
    line-height: 1.7;
    white-space: pre-wrap;
    word-break: break-word;
}

.thought-content code {
    background: var(--bg-tertiary);
    padding: 2px 6px;
    border-radius: 4px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.85rem;
}

/* ============ 看板视图 ============ */
.kanban-board {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    max-width: 1200px;
    margin: 0 auto;
}

.kanban-column {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 16px;
    min-height: 200px;
}

.column-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 16px;
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.column-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
}

.column-dot.idea { background: var(--accent-blue); }
.column-dot.todo { background: var(--accent-orange); }
.column-dot.done { background: var(--accent-green); }

.column-count {
    margin-left: auto;
    background: var(--bg-tertiary);
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 0.75rem;
    font-family: 'JetBrains Mono', monospace;
}

.column-cards {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.kanban-card {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 14px;
    cursor: pointer;
    transition: var(--transition);
}

.kanban-card:hover {
    border-color: var(--text-muted);
    transform: translateY(-2px);
}

.kanban-card .thought-time {
    margin-bottom: 8px;
}

.kanban-card .thought-content {
    font-size: 0.875rem;
}

/* ============ 编辑弹窗 ============ */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
}

.modal-content {
    position: relative;
    width: 100%;
    max-width: 500px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    animation: modalIn 0.2s ease;
}

@keyframes modalIn {
    from {
        opacity: 0;
        transform: scale(0.95) translateY(10px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-color);
}

.modal-header h3 {
    font-size: 1.1rem;
    font-weight: 600;
}

.btn-close {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 1.5rem;
    cursor: pointer;
    transition: var(--transition);
}

.btn-close:hover {
    color: var(--text-primary);
}

.modal-body {
    padding: 20px;
}

#edit-content {
    width: 100%;
    padding: 14px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    color: var(--text-primary);
    font-size: 0.95rem;
    font-family: inherit;
    resize: vertical;
    min-height: 120px;
}

#edit-content:focus {
    outline: none;
    border-color: var(--accent-blue);
}

.edit-status {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 16px;
}

.edit-status label {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

#edit-status {
    flex: 1;
    padding: 8px 12px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    color: var(--text-primary);
    font-size: 0.9rem;
}

.modal-footer {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    padding: 16px 20px;
    border-top: 1px solid var(--border-color);
}

.modal-footer .btn {
    padding: 10px 20px;
}

/* ============ 加载动画 ============ */
.loading {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(13, 17, 23, 0.9);
}

.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--border-color);
    border-top-color: var(--accent-blue);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

/* 空状态 */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
}

.empty-state svg {
    margin-bottom: 16px;
    opacity: 0.5;
}

.empty-state p {
    font-size: 0.95rem;
}

/* ============ 响应式设计 ============ */
@media (max-width: 768px) {
    .auth-container {
        padding: 40px 20px;
    }
    
    .app-header {
        padding: 10px 16px;
    }
    
    .app-title {
        display: none;
    }
    
    .input-area {
        padding: 12px 16px;
        bottom: 0;
        top: auto;
    }
    
    .input-container {
        border-radius: var(--radius);
    }
    
    #thought-input {
        font-size: 0.95rem;
    }
    
    .content-area {
        padding: 16px;
        padding-bottom: 100px;
    }
    
    .kanban-board {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    
    .kanban-column {
        min-height: 150px;
    }
    
    .thought-actions {
        opacity: 1;
    }
    
    .timeline-item {
        padding-left: 24px;
    }
    
    .timeline-dot {
        width: 10px;
        height: 10px;
        left: -6px;
    }
}

@media (min-width: 769px) {
    .input-area {
        position: relative;
        top: 0;
    }
    
    .content-area {
        padding: 24px;
    }
}

/* 移动端底部输入区域 */
@media (max-width: 768px) {
    body {
        padding-bottom: 80px;
    }
    
    .input-area {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        border-top: 1px solid var(--border-color);
        border-bottom: none;
    }
}

/* 代码块样式 */
pre {
    background: var(--bg-tertiary);
    padding: 12px 16px;
    border-radius: var(--radius);
    overflow-x: auto;
    margin: 10px 0;
}

pre code {
    background: transparent;
    padding: 0;
}
