:root {
    --glass-bg: rgba(255, 255, 255, 0.75);
    --glass-border: rgba(255, 255, 255, 0.6);
    --text-main: #1d1d1f;
    --text-dim: #6e6e73;
    --accent: #007aff;
    --radius: 12px;
    --shadow: 0 8px 32px rgba(0, 0, 0, 0.05);
}

* { box-sizing: border-box; margin: 0; padding: 0; outline: none; -webkit-font-smoothing: antialiased; }

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    color: var(--text-main);
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    height: 100vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    user-select: none; 
}

header {
    height: 60px;
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--glass-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 25px;
    position: fixed;
    top: 0; left: 0; right: 0;
    z-index: 1000;
}

.logo { font-weight: 800; font-size: 18px; cursor: pointer; display: flex; gap: 5px; }
.logo span { color: var(--accent); }

.nav-menu { display: flex; gap: 15px; align-items: center; }

.nav-btn {
    background: transparent; border: none; color: var(--text-dim);
    font-size: 14px; font-weight: 500; cursor: pointer; padding: 8px 12px;
    border-radius: 8px; transition: all 0.2s ease; display: flex; align-items: center; gap: 6px;
}
.nav-btn:hover { background: rgba(0,0,0,0.05); color: var(--text-main); }

.auth-btn {
    background: var(--accent); color: white !important; padding: 8px 16px !important;
    border-radius: 20px !important; box-shadow: 0 2px 10px rgba(0,122,255,0.2);
}
.auth-btn:hover { transform: translateY(-1px); box-shadow: 0 4px 15px rgba(0,122,255,0.3); }

.icon-svg { width: 16px; height: 16px; fill: currentColor; }

#app-container { margin-top: 60px; height: calc(100vh - 60px); position: relative; overflow: hidden; }

.view {
    position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    display: none; opacity: 0; transition: opacity 0.3s ease; overflow-y: auto;
}
.view.active { display: block; opacity: 1; }

.landing-content {
    height: 100%; display: flex; flex-direction: column; align-items: center;
    justify-content: center; text-align: center; padding: 20px;
}
.landing-title {
    font-size: 3.5rem; font-weight: 800; margin-bottom: 15px;
    background: linear-gradient(90deg, #1d1d1f, #4a4a4a);
    -webkit-background-clip: text; -webkit-text-fill-color: transparent;
}
.landing-desc { font-size: 1.1rem; color: var(--text-dim); max-width: 500px; margin-bottom: 50px; line-height: 1.6; }

.cards-row { display: flex; gap: 25px; flex-wrap: wrap; justify-content: center; }

.big-card {
    background: rgba(255, 255, 255, 0.6); backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border); padding: 30px; border-radius: 20px;
    width: 220px; text-align: left; cursor: pointer; transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    box-shadow: var(--shadow);
}
.big-card:hover { transform: translateY(-8px); background: rgba(255, 255, 255, 0.9); box-shadow: 0 15px 40px rgba(0,0,0,0.1); border-color: var(--accent); }
.big-card h3 { font-size: 18px; margin-bottom: 8px; color: var(--text-main); }
.big-card p { font-size: 13px; color: var(--text-dim); line-height: 1.4; }

.editor-wrapper { display: flex; flex-direction: column; height: 100%; background: #fff; }
.editor-toolbar {
    height: 50px; border-bottom: 1px solid #eee; display: flex; align-items: center;
    padding: 0 15px; gap: 10px; background: #fafafa;
}
.tool-btn {
    background: #fff; border: 1px solid #ddd; padding: 6px 10px; border-radius: 6px;
    font-size: 12px; font-weight: 600; cursor: pointer; transition: 0.2s; color: #333;
    display: flex; align-items: center; justify-content: center;
}
.tool-btn svg { width: 16px; height: 16px; fill: #555; }
.tool-btn:hover { border-color: #bbb; background: #f5f5f5; }
.tool-btn.primary { background: var(--accent); color: white; border: none; }
.tool-btn.primary svg { fill: white; }
.tool-btn.primary:hover { opacity: 0.9; }

.workspace { flex: 1; display: flex; overflow: hidden; }
.code-panel { flex: 1; display: flex; flex-direction: column; border-right: 1px solid #eee; }
.tabs { display: flex; background: #f5f5f5; border-bottom: 1px solid #eee; }
.tab { padding: 10px 20px; font-size: 12px; font-weight: 600; color: #888; cursor: pointer; border-right: 1px solid #eee; transition: 0.2s; }
.tab.active { background: #fff; color: var(--accent); border-bottom: 2px solid var(--accent); }

textarea {
    flex: 1; border: none; resize: none; padding: 20px;
    font-family: 'Consolas', monospace; font-size: 14px; line-height: 1.5;
    color: #333; display: none; background: #fff; user-select: text;
}
textarea.active { display: block; }

.preview-panel { flex: 1; background: #fff; position: relative; }
iframe { width: 100%; height: 100%; border: none; }

.page-header {
    padding: 20px 30px; display: flex; align-items: center; gap: 15px;
    background: rgba(255,255,255,0.3); backdrop-filter: blur(5px);
    border-bottom: 1px solid rgba(0,0,0,0.05);
}
.back-btn {
    background: rgba(0,0,0,0.05); border: none; width: 32px; height: 32px;
    border-radius: 8px; cursor: pointer; display: flex; align-items: center; justify-content: center; transition: 0.2s;
}
.back-btn:hover { background: rgba(0,0,0,0.1); }
.back-btn svg { width: 16px; height: 16px; fill: #333; }

.grid-container { padding: 30px; display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 25px; }
.project-card {
    background: rgba(255, 255, 255, 0.6); backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border); border-radius: 16px; overflow: hidden;
    cursor: pointer; transition: all 0.3s ease; box-shadow: var(--shadow);
}
.project-card:hover { transform: translateY(-5px); background: rgba(255, 255, 255, 0.9); box-shadow: 0 10px 30px rgba(0,0,0,0.1); }
.card-thumb { height: 160px; background: linear-gradient(135deg, #e0eafc, #cfdef3); display: flex; align-items: center; justify-content: center; color: #888; font-size: 40px; }
.card-body { padding: 20px; }
.card-title { font-weight: 700; font-size: 16px; margin-bottom: 5px; color: #1d1d1f; }
.card-meta { display: flex; justify-content: space-between; font-size: 12px; color: #6e6e73; margin-top: 10px; }
.badge { background: #eee; padding: 2px 8px; border-radius: 10px; font-size: 10px; font-weight: 600; }

.detail-container { max-width: 900px; margin: 0 auto; padding: 40px 20px; }
.detail-preview-box {
    width: 100%; height: 450px; background: #fff; border-radius: 16px; border: 1px solid #eee;
    box-shadow: var(--shadow); overflow: hidden; margin-bottom: 30px;
}
.action-bar { display: flex; gap: 15px; margin-bottom: 40px; }
.btn {
    padding: 10px 20px; border-radius: 10px; border: none; font-weight: 600;
    cursor: pointer; transition: 0.2s; display: flex; align-items: center; gap: 8px; font-size: 14px;
}
.btn-primary { background: var(--accent); color: white; }
.btn-secondary { background: #fff; border: 1px solid #ddd; color: #333; }
.btn:hover { transform: translateY(-2px); box-shadow: 0 5px 15px rgba(0,0,0,0.1); }

.modal-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.2); backdrop-filter: blur(5px);
    z-index: 2000; display: none; align-items: center; justify-content: center;
}
.modal {
    background: rgba(255, 255, 255, 0.95); backdrop-filter: blur(20px);
    padding: 30px; border-radius: 20px; width: 400px; border: 1px solid var(--glass-border);
    box-shadow: 0 20px 50px rgba(0,0,0,0.1);
}
.form-group { margin-bottom: 15px; }
.form-group label { display: block; font-size: 12px; color: #666; margin-bottom: 5px; }
.form-input { width: 100%; padding: 10px; border-radius: 8px; border: 1px solid #ddd; background: rgba(255,255,255,0.5); }