:root {
    --bg-color: #0f172a;
    --text-color: #f8fafc;
    --primary-color: #3b82f6;
    --primary-hover: #2563eb;
    --secondary-color: #64748b;
    --glass-bg: rgba(30, 41, 59, 0.7);
    --glass-border: rgba(255, 255, 255, 0.1);
    --node-color-self: #ef4444;
    --node-color-male: #3b82f6;
    --node-color-female: #ec4899;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', sans-serif;
}

body {
    background-color: var(--bg-color);
    color: var(--text-color);
    overflow: hidden;
    height: 100vh;
    width: 100vw;
    background-image: 
        radial-gradient(circle at 15% 50%, rgba(59, 130, 246, 0.15), transparent 25%),
        radial-gradient(circle at 85% 30%, rgba(236, 72, 153, 0.15), transparent 25%);
}

/* 屏幕切换 */
.screen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    transition: opacity 0.5s ease, visibility 0.5s;
}

.screen.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.hidden {
    display: none !important;
}

/* 玻璃拟态面板 */
.glass-panel {
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    padding: 40px;
    text-align: center;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    animation: float 6s ease-in-out infinite;
}

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

.glass-panel h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
    background: linear-gradient(to right, #60a5fa, #c084fc);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.glass-panel p {
    color: #94a3b8;
    margin-bottom: 30px;
}

/* 输入框和按钮 */
input[type="text"], select {
    width: 100%;
    padding: 12px 20px;
    margin-bottom: 20px;
    border-radius: 10px;
    border: 1px solid var(--glass-border);
    background: rgba(15, 23, 42, 0.6);
    color: white;
    font-size: 1rem;
    outline: none;
    transition: border-color 0.3s, box-shadow 0.3s;
}

input[type="text"]:focus, select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.3);
}

button {
    padding: 12px 30px;
    border-radius: 10px;
    border: none;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-primary, #start-btn {
    background: linear-gradient(135deg, #3b82f6, #8b5cf6);
    color: white;
    box-shadow: 0 4px 15px rgba(59, 130, 246, 0.4);
}

.btn-primary:hover, #start-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(59, 130, 246, 0.6);
}

.btn-primary:active, #start-btn:active {
    transform: translateY(1px);
}

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

.btn-secondary:hover {
    background: rgba(100, 116, 139, 0.2);
}

/* 主界面 */
#main-screen header {
    position: absolute;
    top: 20px;
    left: 20px;
    z-index: 10;
    background: var(--glass-bg);
    padding: 15px 25px;
    border-radius: 15px;
    backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
}

#main-screen header h2 {
    font-size: 1.5rem;
    color: #e2e8f0;
}

#main-screen header p {
    font-size: 0.9rem;
    color: #94a3b8;
}

#network-container {
    width: 100vw;
    height: 100vh;
    cursor: grab;
}

#network-container:active {
    cursor: grabbing;
}

/* 亲戚查询面板 */
#search-panel {
    position: absolute;
    top: 20px;
    right: 20px;
    z-index: 10;
    width: 320px;
    padding: 20px;
    animation: none; /* Disable float */
}

#search-panel h3 {
    font-size: 1.2rem;
    background: none;
    -webkit-text-fill-color: var(--text-color);
}

/* 亲戚计算器按键面板 */
.calc-screen {
    width: 100%;
    min-height: 45px;
    padding: 10px;
    margin-bottom: 15px;
    background: rgba(15, 23, 42, 0.8);
    border: 1px solid var(--primary-color);
    border-radius: 8px;
    color: #fff;
    font-size: 1rem;
    text-align: right;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    overflow-x: auto;
    white-space: nowrap;
}

.calc-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
}

.calc-btn {
    padding: 12px 0;
    font-size: 1rem;
    background: rgba(59, 130, 246, 0.2);
    border: 1px solid rgba(59, 130, 246, 0.3);
    color: #e2e8f0;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
}

.calc-btn:hover {
    background: rgba(59, 130, 246, 0.5);
    transform: translateY(-2px);
}

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

.btn-action {
    background: rgba(239, 68, 68, 0.2);
    border-color: rgba(239, 68, 68, 0.3);
    color: #fca5a5;
}

.btn-action:hover {
    background: rgba(239, 68, 68, 0.5);
}

/* 模态框 */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 100;
    opacity: 1;
    visibility: visible;
    transition: opacity 0.3s ease, visibility 0.3s;
}

.modal.hidden {
    opacity: 0;
    visibility: hidden;
    display: flex !important; /* Keep it flex to allow opacity transition, visibility handles hiding */
    pointer-events: none;
}

.modal .modal-content {
    width: 400px;
    animation: none; /* Disable float animation for modal */
    transform: scale(1);
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.modal.hidden .modal-content {
    transform: scale(0.8);
}

.modal-content h3 {
    font-size: 1.8rem;
    margin-bottom: 5px;
}

#modal-subtitle {
    margin-bottom: 25px;
    font-size: 0.9rem;
}

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

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: #cbd5e1;
    font-size: 0.95rem;
}

.radio-group {
    display: flex;
    gap: 20px;
}

.radio-group label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}

.radio-group input[type="radio"] {
    accent-color: var(--primary-color);
    width: 16px;
    height: 16px;
}

.modal-actions {
    display: flex;
    justify-content: space-between;
    margin-top: 30px;
}

.modal-actions button {
    width: 48%;
}

/* 针对选择兄弟姐妹时的选项控制 */
#age-relative-group {
    display: none;
}

/* Action Menu Styles */
.action-buttons {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 20px;
}

.btn-danger {
    background: transparent;
    color: #ef4444;
    border: 1px solid #ef4444;
}

.btn-danger:hover {
    background: rgba(239, 68, 68, 0.2);
}

.mt-15 {
    margin-top: 15px;
    width: 100%;
}

.subtitle-text {
    color: #94a3b8;
    font-size: 0.9rem;
    margin-bottom: 20px;
}
