* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html, body {
    height: 100%;
    overflow: hidden;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background-color: #1a1a2e;
    color: #eee;
    line-height: 1.4;
}

/* 4分屏布局 */
#anchors-container {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    grid-template-rows: repeat(2, 1fr);
    height: 100vh;
    gap: 2px;
    background: #0f3460;
}

/* 锚点区域 */
.anchor-card {
    background: #16213e;
    padding: 15px;
    display: flex;
    flex-direction: column;
}

.anchor-header {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
    flex-shrink: 0;
}

.anchor-title {
    font-weight: bold;
    font-size: 1.2rem;
    color: #e94560;
}

.anchor-status {
    font-size: 0.8rem;
    color: #666;
}

.anchor-status.bound {
    color: #4ecca3;
}

.anchor-status.unbound {
    color: #ff6b6b;
}

.anchor-input {
    flex: 1;
    width: 100%;
    padding: 12px;
    border: 2px solid #0f3460;
    border-radius: 8px;
    font-size: 16px;
    margin-bottom: 10px;
    resize: none;
    background: #0f0f23;
    color: #fff;
}

.anchor-input:focus {
    outline: none;
    border-color: #e94560;
}

.anchor-input:disabled {
    background: #1a1a2e;
    color: #444;
}

/* 发送按钮 */
.btn-send {
    width: 100%;
    padding: 16px;
    border: none;
    border-radius: 8px;
    font-size: 18px;
    font-weight: bold;
    cursor: pointer;
    background: linear-gradient(135deg, #4ecca3, #2ecc71);
    color: #1a1a2e;
    touch-action: manipulation;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
    flex-shrink: 0;
}

.btn-send:active {
    transform: scale(0.98);
}

.btn-send:disabled {
    background: #34495e;
    color: #666;
}

.btn-small {
    padding: 8px 14px;
    font-size: 14px;
    background-color: #0f3460;
    border: 1px solid #1a4a7a;
    border-radius: 8px;
    cursor: pointer;
    margin-left: 10px;
    color: #fff;
}

.btn-small:hover {
    background-color: #1a4a7a;
}

.btn-danger {
    background-color: #e74c3c;
    color: white;
    padding: 10px 16px;
    font-size: 14px;
}

.btn-danger:hover {
    background-color: #c0392b;
}

/* 表单 */
.section {
    background: #16213e;
    border-radius: 16px;
    padding: 20px;
    margin-bottom: 15px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    border: 2px solid #0f3460;
}

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

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
    color: #ddd;
}

select {
    width: 100%;
    padding: 12px;
    border: 2px solid #0f3460;
    border-radius: 8px;
    font-size: 16px;
    background-color: #0f0f23;
    color: #fff;
}

select:focus {
    outline: none;
    border-color: #e94560;
}

input[type="text"],
input[type="number"] {
    background-color: #0f0f23;
    color: #fff;
    border: 2px solid #0f3460;
}

input[type="text"]:focus,
input[type="number"]:focus {
    border-color: #e94560;
    outline: none;
}

.coord-inputs {
    display: flex;
    gap: 10px;
    align-items: center;
    margin-top: 8px;
}

.coord-inputs input {
    padding: 10px;
    border: 2px solid #0f3460;
    border-radius: 8px;
    font-size: 14px;
    background: #0f0f23;
    color: #fff;
}

.coord-inputs input:focus {
    outline: none;
    border-color: #e94560;
}

.help-text {
    display: block;
    margin-top: 6px;
    color: #888;
    font-size: 0.85rem;
}

/* 绑定列表 */
.bindings-list {
    min-height: 50px;
}

.binding-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    background-color: #0f0f23;
    border-radius: 12px;
    margin-bottom: 10px;
    border: 1px solid #0f3460;
}

.binding-info {
    flex: 1;
}

.binding-anchor {
    font-weight: bold;
    color: #e94560;
    font-size: 1.1rem;
}

.binding-window {
    font-size: 0.9rem;
    color: #888;
    margin-top: 4px;
    word-break: break-all;
}

.binding-coords {
    font-size: 0.85rem;
    color: #4ecca3;
    margin-top: 4px;
}

.no-bindings {
    color: #666;
    text-align: center;
    padding: 20px;
}

/* 页脚 - 管理页面使用 */
.footer {
    text-align: center;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #0f3460;
}

.footer a {
    color: #4ecca3;
    text-decoration: none;
    font-size: 1.1rem;
}

/* Toast 提示 */
.toast {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    padding: 16px 32px;
    background-color: #16213e;
    color: white;
    border-radius: 12px;
    opacity: 0;
    transition: all 0.3s ease;
    z-index: 1000;
    font-size: 16px;
    border: 1px solid #0f3460;
}

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

.toast.success {
    background-color: #27ae60;
    border-color: #219a52;
}

.toast.error {
    background-color: #e74c3c;
    border-color: #c0392b;
}

/* 响应式 - 竖屏模式也保持 2x2 */
@media (max-width: 600px) {
    .anchor-card {
        padding: 10px;
    }
    
    .anchor-title {
        font-size: 1rem;
    }
    
    .btn-send {
        padding: 14px;
        font-size: 16px;
    }
}
