* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: 'Microsoft YaHei', 'PingFang SC', 'Helvetica Neue', Arial, sans-serif;
    overflow: hidden;
    background: linear-gradient(to bottom, #000000 0%, #0a0a1a 50%, #000000 100%);
    touch-action: none;
    -webkit-user-select: none;
    user-select: none;
}

#galaxy-container {
    width: 100vw;
    height: 100vh;
    position: fixed;
    top: 0;
    left: 0;
}

/* 响应式留言板 */
#message-panel {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(20, 20, 40, 0.95);
    padding: 20px;
    border-radius: 15px;
    box-shadow: 0 0 30px rgba(100, 150, 255, 0.5);
    z-index: 1000;
    width: 90%;
    max-width: 450px;
    max-height: 90vh;
    overflow-y: auto;
    transition: all 0.3s ease;
    display: block;
}

/* 移动端优化 */
@media (max-width: 768px) {
    #message-panel {
        width: 95%;
        max-width: none;
        padding: 15px;
        border-radius: 10px;
    }
}

#message-panel .close-btn {
    position: absolute;
    top: 8px;
    right: 12px;
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.6);
    font-size: 28px;
    cursor: pointer;
    line-height: 1;
    padding: 0;
    width: 30px;
    height: 30px;
    transition: all 0.2s;
    z-index: 10;
}

#message-panel .close-btn:hover {
    color: #fff;
    transform: rotate(90deg);
}

#message-panel.minimized {
    top: auto;
    bottom: 20px;
    left: 20px;
    transform: none;
    padding: 12px 16px;
    width: auto;
    max-width: 200px;
    cursor: pointer;
}

#message-panel.minimized > *:not(h2) {
    display: none;
}

#message-panel.minimized h2 {
    margin: 0;
    font-size: 16px;
}

#message-panel h2 {
    color: #fff;
    margin-bottom: 15px;
    text-align: center;
    font-size: 20px;
    padding-right: 30px;
}

@media (max-width: 768px) {
    #message-panel h2 {
        font-size: 18px;
        margin-bottom: 12px;
    }
}

#nickname-input {
    width: 100%;
    padding: 12px;
    border: 2px solid rgba(100, 150, 255, 0.5);
    border-radius: 8px;
    background: rgba(10, 10, 30, 0.8);
    color: #fff;
    font-size: 15px;
    margin-bottom: 5px;
}

@media (max-width: 768px) {
    #nickname-input {
        padding: 10px;
        font-size: 14px;
    }
}

#nickname-warning {
    color: #ffa500;
    font-size: 11px;
    margin-bottom: 10px;
    min-height: 16px;
}

#message-input {
    width: 100%;
    height: 100px;
    padding: 12px;
    border: 2px solid rgba(100, 150, 255, 0.5);
    border-radius: 8px;
    background: rgba(10, 10, 30, 0.8);
    color: #fff;
    font-size: 15px;
    resize: none;
    margin-bottom: 5px;
}

@media (max-width: 768px) {
    #message-input {
        height: 80px;
        padding: 10px;
        font-size: 14px;
    }
}

#char-count {
    text-align: right;
    color: rgba(255, 255, 255, 0.6);
    font-size: 11px;
    margin-bottom: 12px;
}

/* 星星选项 - 响应式 */
.star-options {
    margin-bottom: 12px;
}

.star-options label {
    display: block;
    color: #fff;
    font-size: 13px;
    margin-bottom: 8px;
}

.color-picker {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: center;
}

.color-option {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    border: 3px solid transparent;
    transition: all 0.2s;
    flex-shrink: 0;
}

@media (max-width: 768px) {
    .color-option {
        width: 28px;
        height: 28px;
    }
}

.color-option:hover,
.color-option:active {
    transform: scale(1.15);
    box-shadow: 0 0 15px rgba(255, 255, 255, 0.5);
}

.color-option.active {
    border-color: #fff;
    box-shadow: 0 0 20px rgba(255, 255, 255, 0.8);
}

.shape-picker {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: center;
}

.shape-option {
    padding: 6px 12px;
    background: rgba(100, 150, 255, 0.2);
    color: #fff;
    border: 2px solid rgba(100, 150, 255, 0.3);
    border-radius: 8px;
    cursor: pointer;
    font-size: 13px;
    transition: all 0.2s;
    white-space: nowrap;
}

@media (max-width: 768px) {
    .shape-option {
        padding: 5px 10px;
        font-size: 12px;
    }
}

.shape-option:hover,
.shape-option:active {
    background: rgba(100, 150, 255, 0.4);
    transform: translateY(-2px);
}

.shape-option.active {
    background: rgba(100, 150, 255, 0.6);
    border-color: rgba(100, 150, 255, 0.8);
    box-shadow: 0 0 15px rgba(100, 150, 255, 0.5);
}

#panel-controls {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
}

#toggle-panel {
    padding: 8px 12px;
    background: rgba(100, 150, 255, 0.3);
    color: white;
    border: 1px solid rgba(100, 150, 255, 0.5);
    border-radius: 6px;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s;
}

@media (max-width: 768px) {
    #toggle-panel {
        padding: 6px 10px;
        font-size: 12px;
    }
}

#submit-btn {
    flex: 1;
    padding: 10px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    cursor: pointer;
    transition: transform 0.2s;
}

@media (max-width: 768px) {
    #submit-btn {
        padding: 8px;
        font-size: 14px;
    }
}

#submit-btn:active {
    transform: scale(0.98);
}

#status {
    margin-top: 8px;
    text-align: center;
    color: #4ade80;
    font-size: 13px;
    min-height: 18px;
}

/* 搜索面板 - 响应式 */
#search-panel {
    position: fixed;
    top: 15px;
    right: 15px;
    background: rgba(20, 20, 40, 0.9);
    padding: 15px;
    border-radius: 10px;
    box-shadow: 0 0 20px rgba(100, 150, 255, 0.3);
    z-index: 100;
    width: 260px;
    max-width: calc(100vw - 30px);
}

@media (max-width: 768px) {
    #search-panel {
        top: 10px;
        right: 10px;
        padding: 12px;
        width: calc(100vw - 20px);
        max-width: 300px;
    }
}

#search-panel h3 {
    color: #fff;
    margin-bottom: 12px;
    font-size: 16px;
}

@media (max-width: 768px) {
    #search-panel h3 {
        font-size: 14px;
        margin-bottom: 10px;
    }
}

#search-input {
    width: 100%;
    padding: 8px;
    border: 2px solid rgba(100, 150, 255, 0.5);
    border-radius: 6px;
    background: rgba(10, 10, 30, 0.8);
    color: #fff;
    font-size: 13px;
    margin-bottom: 8px;
}

#search-btn, #reset-btn {
    width: 48%;
    padding: 7px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 13px;
    cursor: pointer;
    transition: transform 0.2s;
}

@media (max-width: 768px) {
    #search-btn, #reset-btn {
        padding: 6px;
        font-size: 12px;
    }
}

#search-btn {
    margin-right: 4%;
}

#search-btn:active, #reset-btn:active {
    transform: scale(0.98);
}

#search-status {
    margin-top: 8px;
    color: #4ade80;
    font-size: 12px;
    text-align: center;
    display: none;
}

/* 星星详情 - 响应式 */
#star-detail {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(20, 20, 40, 0.95);
    padding: 20px;
    border-radius: 15px;
    box-shadow: 0 0 30px rgba(255, 200, 100, 0.5);
    z-index: 1000;
    width: 90%;
    max-width: 450px;
    max-height: 80vh;
    overflow-y: auto;
}

@media (max-width: 768px) {
    #star-detail {
        width: 95%;
        padding: 15px;
        max-height: 85vh;
    }
}

#close-detail {
    position: absolute;
    top: 8px;
    right: 12px;
    background: none;
    border: none;
    color: #fff;
    font-size: 28px;
    cursor: pointer;
    line-height: 1;
}

#star-nickname {
    color: #ffd700;
    font-size: 18px;
    font-weight: bold;
    margin-bottom: 12px;
    padding-right: 30px;
}

@media (max-width: 768px) {
    #star-nickname {
        font-size: 16px;
    }
}

#star-content {
    color: #fff;
    font-size: 16px;
    line-height: 1.6;
    margin-bottom: 12px;
    word-wrap: break-word;
    max-height: 400px;
    overflow-y: auto;
}

@media (max-width: 768px) {
    #star-content {
        font-size: 14px;
        max-height: 300px;
    }
}

#star-location {
    color: #88ccff;
    font-size: 13px;
    margin-bottom: 8px;
}

#star-time {
    color: rgba(255, 255, 255, 0.6);
    font-size: 12px;
    text-align: right;
}

/* 控制说明 - 响应式 */
#controls-info {
    position: fixed;
    bottom: 50px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(20, 20, 40, 0.8);
    padding: 12px 20px;
    border-radius: 10px;
    color: rgba(255, 255, 255, 0.8);
    font-size: 13px;
    text-align: center;
    z-index: 100;
    max-width: 90%;
}

@media (max-width: 768px) {
    #controls-info {
        bottom: 60px;
        padding: 10px 15px;
        font-size: 11px;
    }
    
    #controls-info p {
        margin: 3px 0;
    }
}

#controls-info p {
    margin: 5px 0;
}

#open-message-panel {
    margin-top: 8px;
    padding: 8px 16px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 13px;
}

@media (max-width: 768px) {
    #open-message-panel {
        padding: 6px 12px;
        font-size: 12px;
    }
}

/* 页面底部信息 */
#footer-info {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(10, 10, 30, 0.95);
    padding: 20px 30px;
    border-top: 1px solid rgba(100, 150, 255, 0.3);
    z-index: 50;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

#footer-info.show {
    max-height: 400px;
}

.footer-section {
    margin-bottom: 15px;
}

.footer-title {
    color: #88aaff;
    font-size: 14px;
    font-weight: bold;
    margin-bottom: 8px;
}

.footer-content {
    color: rgba(255, 255, 255, 0.7);
    font-size: 12px;
    line-height: 1.6;
    margin: 5px 0;
}

.footer-content a {
    color: #4ade80;
    text-decoration: none;
    transition: color 0.2s;
}

.footer-content a:hover {
    color: #22c55e;
    text-decoration: underline;
}

.footer-divider {
    height: 1px;
    background: rgba(100, 150, 255, 0.2);
    margin: 12px 0;
}

.footer-copyright {
    text-align: center;
    color: rgba(255, 255, 255, 0.5);
    font-size: 12px;
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid rgba(100, 150, 255, 0.2);
}

/* 底部展开按钮 */
#footer-toggle {
    position: fixed;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(20, 20, 40, 0.9);
    color: rgba(255, 255, 255, 0.7);
    border: none;
    padding: 8px 20px;
    border-radius: 8px 8px 0 0;
    cursor: pointer;
    font-size: 12px;
    z-index: 60;
    transition: all 0.2s;
}

#footer-toggle:hover {
    background: rgba(30, 30, 50, 0.95);
    color: #fff;
}

#footer-toggle.active {
    bottom: 400px;
}

/* 星星选项样式 */
.star-options {
    margin-bottom: 15px;
}

.star-options label {
    display: block;
    color: #fff;
    font-size: 14px;
    margin-bottom: 8px;
}

.color-picker {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.color-option {
    width: 35px;
    height: 35px;
    border-radius: 50%;
    cursor: pointer;
    border: 3px solid transparent;
    transition: all 0.2s;
}

.color-option:hover {
    transform: scale(1.15);
    box-shadow: 0 0 15px rgba(255, 255, 255, 0.5);
}

.color-option.active {
    border-color: #fff;
    box-shadow: 0 0 20px rgba(255, 255, 255, 0.8);
}

.shape-picker {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.shape-option {
    padding: 8px 15px;
    background: rgba(100, 150, 255, 0.2);
    color: #fff;
    border: 2px solid rgba(100, 150, 255, 0.3);
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s;
}

.shape-option:hover {
    background: rgba(100, 150, 255, 0.4);
    transform: translateY(-2px);
}

.shape-option.active {
    background: rgba(100, 150, 255, 0.6);
    border-color: rgba(100, 150, 255, 0.8);
    box-shadow: 0 0 15px rgba(100, 150, 255, 0.5);
}
